Commit f26f0a02 authored by Gregory Szorc's avatar Gregory Szorc
Browse files

Bug 804491 - Data submission policy and scheduling driver for Firefox Health Report; r=rnewman

parent 56416b1c
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -10,9 +10,11 @@ VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk

modules := \
  policy.jsm \
  $(NULL)

testing_modules := \
  mocks.jsm \
  $(NULL)

TEST_DIRS += tests
+37 −0
Original line number Diff line number Diff line
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

"use strict";

this.EXPORTED_SYMBOLS = ["MockPolicyListener"];

const {utils: Cu} = Components;

Cu.import("resource://services-common/log4moz.js");


this.MockPolicyListener = function MockPolicyListener() {
  this._log = Log4Moz.repository.getLogger("HealthReport.Testing.MockPolicyListener");
  this._log.level = Log4Moz.Level["Debug"];

  this.requestDataSubmissionCount = 0;
  this.lastDataRequest = null;

  this.notifyUserCount = 0;
  this.lastNotifyRequest = null;
}

MockPolicyListener.prototype = {
  onRequestDataSubmission: function onRequestDataSubmission(request) {
    this._log.info("onRequestDataSubmission invoked.");
    this.requestDataSubmissionCount++;
    this.lastDataRequest = request;
  },

  onNotifyDataPolicy: function onNotifyDataPolicy(request) {
    this._log.info("onNotifyUser invoked.");
    this.notifyUserCount++;
    this.lastNotifyRequest = request;
  },
};
+850 −0

File added.

Preview size limit exceeded, changes collapsed.

+2 −0
Original line number Diff line number Diff line
@@ -4,9 +4,11 @@
"use strict";

const modules = [
  "policy.jsm",
];

const test_modules = [
  "mocks.jsm",
];

function run_test() {
+538 −0

File added.

Preview size limit exceeded, changes collapsed.

Loading