diff --git a/.eslintignore b/.eslintignore
index 0b5a61b43c7..564645d5383 100644
--- a/.eslintignore
+++ b/.eslintignore
@@ -201,6 +201,7 @@ toolkit/content/contentAreaUtils.js
toolkit/content/widgets/videocontrols.xml
toolkit/components/jsdownloads/src/DownloadIntegration.jsm
toolkit/components/search/nsSearchService.js
+toolkit/components/telemetry/healthreport-prefs.js
toolkit/components/url-classifier/**
toolkit/components/urlformatter/nsURLFormatter.js
toolkit/identity/FirefoxAccounts.jsm
diff --git a/b2g/chrome/content/shell.css b/b2g/chrome/content/shell.css
index 6f6d1b2a2e7..34daafd9910 100644
--- a/b2g/chrome/content/shell.css
+++ b/b2g/chrome/content/shell.css
@@ -62,6 +62,11 @@ body.content-loaded > #installing {
animation-timing-function: linear;
}
+#titlebar-buttonbox {
+ margin: 6px 7px;
+ -moz-appearance: -moz-window-button-box;
+}
+
@keyframes throbber{
from {
transform: scale(0);
diff --git a/b2g/chrome/content/shell.html b/b2g/chrome/content/shell.html
index f7c53433e9b..1d91e9bbf3f 100644
--- a/b2g/chrome/content/shell.html
+++ b/b2g/chrome/content/shell.html
@@ -58,6 +58,7 @@
diff --git a/b2g/config/aries-l/sources.xml b/b2g/config/aries-l/sources.xml
new file mode 100644
index 00000000000..4479e300527
--- /dev/null
+++ b/b2g/config/aries-l/sources.xml
@@ -0,0 +1,195 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/b2g/config/aries/sources.xml b/b2g/config/aries/sources.xml
index d67d00cde8e..1087915ca4a 100644
--- a/b2g/config/aries/sources.xml
+++ b/b2g/config/aries/sources.xml
@@ -21,7 +21,7 @@
-
+
@@ -35,7 +35,7 @@
-
+
diff --git a/b2g/config/dolphin/sources.xml b/b2g/config/dolphin/sources.xml
index 4389fa7f1de..ce4842a022e 100644
--- a/b2g/config/dolphin/sources.xml
+++ b/b2g/config/dolphin/sources.xml
@@ -21,7 +21,7 @@
-
+
@@ -35,7 +35,7 @@
-
+
diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml
index 741ce6046fe..e685b998edc 100644
--- a/b2g/config/emulator-ics/sources.xml
+++ b/b2g/config/emulator-ics/sources.xml
@@ -21,7 +21,7 @@
-
+
diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml
index 9a4c92ff2b3..6d8f69eb06b 100644
--- a/b2g/config/emulator-jb/sources.xml
+++ b/b2g/config/emulator-jb/sources.xml
@@ -21,7 +21,7 @@
-
+
@@ -31,7 +31,7 @@
-
+
diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml
index 2cb64165834..238b5e122f8 100644
--- a/b2g/config/emulator-kk/sources.xml
+++ b/b2g/config/emulator-kk/sources.xml
@@ -21,7 +21,7 @@
-
+
@@ -34,7 +34,7 @@
-
+
diff --git a/b2g/config/emulator-l/sources.xml b/b2g/config/emulator-l/sources.xml
index 72d4f1b7161..2f8a86f1a80 100644
--- a/b2g/config/emulator-l/sources.xml
+++ b/b2g/config/emulator-l/sources.xml
@@ -21,7 +21,7 @@
-
+
@@ -34,7 +34,7 @@
-
+
diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml
index 741ce6046fe..e685b998edc 100644
--- a/b2g/config/emulator/sources.xml
+++ b/b2g/config/emulator/sources.xml
@@ -21,7 +21,7 @@
-
+
diff --git a/b2g/config/flame-kk/sources.xml b/b2g/config/flame-kk/sources.xml
index 39412f82328..e4730f3a7dc 100644
--- a/b2g/config/flame-kk/sources.xml
+++ b/b2g/config/flame-kk/sources.xml
@@ -21,7 +21,7 @@
-
+
@@ -35,7 +35,7 @@
-
+
diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json
index 4c95dfa860c..48aab6c88d4 100644
--- a/b2g/config/gaia.json
+++ b/b2g/config/gaia.json
@@ -1,9 +1,9 @@
{
"git": {
- "git_revision": "260e51a4262f75341e037e583dfc8f6835b5ab31",
+ "git_revision": "3c97d6a8ac5a69662e1e2c22a84ea59bf50c305e",
"remote": "https://git.mozilla.org/releases/gaia.git",
"branch": ""
},
- "revision": "1af9f0deab127d830bbd4e29651fed46614104f8",
+ "revision": "39dd39c9b2ff6718c79af1617577366fa9510603",
"repo_path": "integration/gaia-central"
}
diff --git a/b2g/config/nexus-4-kk/sources.xml b/b2g/config/nexus-4-kk/sources.xml
index 06af214f3db..7018000b3a9 100644
--- a/b2g/config/nexus-4-kk/sources.xml
+++ b/b2g/config/nexus-4-kk/sources.xml
@@ -21,7 +21,7 @@
-
+
@@ -35,7 +35,7 @@
-
+
diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml
index db4cde688dc..770e81f16ee 100644
--- a/b2g/config/nexus-4/sources.xml
+++ b/b2g/config/nexus-4/sources.xml
@@ -21,7 +21,7 @@
-
+
@@ -32,7 +32,7 @@
-
+
diff --git a/b2g/config/nexus-5-l/sources.xml b/b2g/config/nexus-5-l/sources.xml
index dfcdb8584c8..2841afc1bbb 100644
--- a/b2g/config/nexus-5-l/sources.xml
+++ b/b2g/config/nexus-5-l/sources.xml
@@ -21,7 +21,7 @@
-
+
@@ -35,7 +35,7 @@
-
+
diff --git a/b2g/confvars.sh b/b2g/confvars.sh
index bbdf616047d..1e94ada62ce 100644
--- a/b2g/confvars.sh
+++ b/b2g/confvars.sh
@@ -19,7 +19,6 @@ MOZ_OFFICIAL_BRANDING_DIRECTORY=b2g/branding/official
MOZ_SAFE_BROWSING=1
MOZ_SERVICES_COMMON=1
-MOZ_SERVICES_METRICS=1
MOZ_WEBSMS_BACKEND=1
MOZ_NO_SMART_CARDS=1
diff --git a/b2g/graphene/confvars.sh b/b2g/graphene/confvars.sh
index 8a557d3c03b..4db1b760931 100644
--- a/b2g/graphene/confvars.sh
+++ b/b2g/graphene/confvars.sh
@@ -26,7 +26,6 @@ MOZ_OFFICIAL_BRANDING_DIRECTORY=b2g/branding/official
MOZ_SAFE_BROWSING=1
MOZ_SERVICES_COMMON=1
-MOZ_SERVICES_METRICS=1
MOZ_CAPTIVEDETECT=1
MOZ_WEBSMS_BACKEND=1
diff --git a/b2g/installer/package-manifest.in b/b2g/installer/package-manifest.in
index ce6589d9358..bd224e4b66a 100644
--- a/b2g/installer/package-manifest.in
+++ b/b2g/installer/package-manifest.in
@@ -627,10 +627,6 @@
#endif
@RESPATH@/components/servicesComponents.manifest
@RESPATH@/components/cryptoComponents.manifest
-#ifdef MOZ_SERVICES_HEALTHREPORT
-@RESPATH@/components/HealthReportComponents.manifest
-@RESPATH@/components/HealthReportService.js
-#endif
@RESPATH@/components/CaptivePortalDetectComponents.manifest
@RESPATH@/components/captivedetect.js
@RESPATH@/components/TelemetryStartup.js
diff --git a/browser/app/profile/firefox.js b/browser/app/profile/firefox.js
index d518b8a7f9e..7d8e680aa11 100644
--- a/browser/app/profile/firefox.js
+++ b/browser/app/profile/firefox.js
@@ -1548,7 +1548,8 @@ pref("experiments.supported", true);
pref("media.gmp-provider.enabled", true);
#ifdef NIGHTLY_BUILD
-pref("browser.polaris.enabled", false);
+pref("privacy.trackingprotection.ui.enabled", true);
+#else
pref("privacy.trackingprotection.ui.enabled", false);
#endif
pref("privacy.trackingprotection.introCount", 0);
diff --git a/browser/base/content/abouthealthreport/abouthealth.js b/browser/base/content/abouthealthreport/abouthealth.js
index 55669edc473..f90f6742d5d 100644
--- a/browser/base/content/abouthealthreport/abouthealth.js
+++ b/browser/base/content/abouthealthreport/abouthealth.js
@@ -23,10 +23,6 @@ var healthReportWrapper = {
let iframe = document.getElementById("remote-report");
iframe.addEventListener("load", healthReportWrapper.initRemotePage, false);
iframe.src = this._getReportURI().spec;
- iframe.onload = () => {
- MozSelfSupport.getHealthReportPayload().then(this.updatePayload,
- this.handleInitFailure);
- };
prefs.observe("uploadEnabled", this.updatePrefState, healthReportWrapper);
},
@@ -103,15 +99,6 @@ var healthReportWrapper = {
});
},
- refreshPayload: function () {
- MozSelfSupport.getHealthReportPayload().then(this.updatePayload,
- this.handlePayloadFailure);
- },
-
- updatePayload: function (payload) {
- healthReportWrapper.injectData("payload", JSON.stringify(payload));
- },
-
injectData: function (type, content) {
let report = this._getReportURI();
@@ -139,9 +126,6 @@ var healthReportWrapper = {
case "RequestCurrentPrefs":
this.updatePrefState();
break;
- case "RequestCurrentPayload":
- this.refreshPayload();
- break;
case "RequestTelemetryPingList":
this.sendTelemetryPingList();
break;
diff --git a/browser/base/content/browser-data-submission-info-bar.js b/browser/base/content/browser-data-submission-info-bar.js
index 93f79d092d5..cd7cddd9e46 100644
--- a/browser/base/content/browser-data-submission-info-bar.js
+++ b/browser/base/content/browser-data-submission-info-bar.js
@@ -2,6 +2,9 @@
* 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/. */
+const LOGGER_NAME = "Toolkit.Telemetry";
+const LOGGER_PREFIX = "DataNotificationInfoBar::";
+
/**
* Represents an info bar that shows a data submission notification.
*/
@@ -21,7 +24,7 @@ var gDataNotificationInfoBar = {
get _log() {
let Log = Cu.import("resource://gre/modules/Log.jsm", {}).Log;
delete this._log;
- return this._log = Log.repository.getLogger("Services.DataReporting.InfoBar");
+ return this._log = Log.repository.getLoggerWithMessagePrefix(LOGGER_NAME, LOGGER_PREFIX);
},
init: function() {
diff --git a/browser/base/content/browser.js b/browser/base/content/browser.js
index f8469accfe7..1f097bd4b09 100644
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -3633,7 +3633,7 @@ const BrowserSearch = {
loadSearchFromContext: function (terms) {
let engine = BrowserSearch._loadSearch(terms, true, "contextmenu");
if (engine) {
- BrowserSearch.recordSearchInHealthReport(engine, "contextmenu");
+ BrowserSearch.recordSearchInTelemetry(engine, "contextmenu");
}
},
@@ -3657,10 +3657,26 @@ const BrowserSearch = {
openUILinkIn(searchEnginesURL, where);
},
+ _getSearchEngineId: function (engine) {
+ if (!engine) {
+ return "other";
+ }
+
+ if (engine.identifier) {
+ return engine.identifier;
+ }
+
+ if (!("name" in engine) || engine.name === undefined) {
+ return "other";
+ }
+
+ return "other-" + engine.name;
+ },
+
/**
- * Helper to record a search with Firefox Health Report.
+ * Helper to record a search with Telemetry.
*
- * FHR records only search counts and nothing pertaining to the search itself.
+ * Telemetry records only search counts and nothing pertaining to the search itself.
*
* @param engine
* (nsISearchEngine) The engine handling the search.
@@ -3672,45 +3688,7 @@ const BrowserSearch = {
* the search was a suggested search, this indicates where the
* item was in the suggestion list and how the user selected it.
*/
- recordSearchInHealthReport: function (engine, source, selection) {
- BrowserUITelemetry.countSearchEvent(source, null, selection);
- this.recordSearchInTelemetry(engine, source);
-
- let reporter = AppConstants.MOZ_SERVICES_HEALTHREPORT
- ? Cc["@mozilla.org/datareporting/service;1"]
- .getService()
- .wrappedJSObject
- .healthReporter
- : null;
-
- // This can happen if the FHR component of the data reporting service is
- // disabled. This is controlled by a pref that most will never use.
- if (!reporter) {
- return;
- }
-
- reporter.onInit().then(function record() {
- try {
- reporter.getProvider("org.mozilla.searches").recordSearch(engine, source);
- } catch (ex) {
- Cu.reportError(ex);
- }
- });
- },
-
- _getSearchEngineId: function (engine) {
- if (!engine) {
- return "other";
- }
-
- if (engine.identifier) {
- return engine.identifier;
- }
-
- return "other-" + engine.name;
- },
-
- recordSearchInTelemetry: function (engine, source) {
+ recordSearchInTelemetry: function (engine, source, selection) {
const SOURCES = [
"abouthome",
"contextmenu",
@@ -3719,6 +3697,8 @@ const BrowserSearch = {
"urlbar",
];
+ BrowserUITelemetry.countSearchEvent(source, null, selection);
+
if (SOURCES.indexOf(source) == -1) {
Cu.reportError("Unknown source for search: " + source);
return;
diff --git a/browser/base/content/test/general/browser.ini b/browser/base/content/test/general/browser.ini
index 3723d391d20..5c75c85458d 100644
--- a/browser/base/content/test/general/browser.ini
+++ b/browser/base/content/test/general/browser.ini
@@ -286,8 +286,6 @@ skip-if = e10s # Bug 1094510 - test hits the network in e10s mode only
[browser_contextSearchTabPosition.js]
skip-if = os == "mac" || e10s # bug 967013; e10s: bug 1094761 - test hits the network in e10s, causing next test to crash
[browser_ctrlTab.js]
-[browser_datareporting_notification.js]
-skip-if = !datareporting
[browser_datachoices_notification.js]
skip-if = !datareporting
[browser_devedition.js]
@@ -480,7 +478,6 @@ skip-if = os == "linux" # Bug 1073339 - Investigate autocomplete test unreliabil
[browser_urlbarStop.js]
[browser_urlbarTrimURLs.js]
[browser_urlbar_autoFill_backspaced.js]
-[browser_urlbar_search_healthreport.js]
[browser_urlbar_searchsettings.js]
[browser_utilityOverlay.js]
[browser_viewSourceInTabOnViewSource.js]
diff --git a/browser/base/content/test/general/browser_aboutHealthReport.js b/browser/base/content/test/general/browser_aboutHealthReport.js
index d22497fc2cd..33d1a1c5840 100644
--- a/browser/base/content/test/general/browser_aboutHealthReport.js
+++ b/browser/base/content/test/general/browser_aboutHealthReport.js
@@ -1,154 +1,143 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
-
-XPCOMUtils.defineLazyModuleGetter(this, "Promise",
- "resource://gre/modules/Promise.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "Task",
- "resource://gre/modules/Task.jsm");
-
-const CHROME_BASE = "chrome://mochitests/content/browser/browser/base/content/test/general/";
-const HTTPS_BASE = "https://example.com/browser/browser/base/content/test/general/";
-
-const TELEMETRY_LOG_PREF = "toolkit.telemetry.log.level";
-const telemetryOriginalLogPref = Preferences.get(TELEMETRY_LOG_PREF, null);
-
-const originalReportUrl = Services.prefs.getCharPref("datareporting.healthreport.about.reportUrl");
-const originalReportUrlUnified = Services.prefs.getCharPref("datareporting.healthreport.about.reportUrlUnified");
-
-registerCleanupFunction(function() {
- // Ensure we don't pollute prefs for next tests.
- if (telemetryOriginalLogPref) {
- Preferences.set(TELEMETRY_LOG_PREF, telemetryOriginalLogPref);
- } else {
- Preferences.reset(TELEMETRY_LOG_PREF);
- }
-
- try {
- Services.prefs.setCharPref("datareporting.healthreport.about.reportUrl", originalReportUrl);
- Services.prefs.setCharPref("datareporting.healthreport.about.reportUrlUnified", originalReportUrlUnified);
- let policy = Cc["@mozilla.org/datareporting/service;1"]
- .getService(Ci.nsISupports)
- .wrappedJSObject
- .policy;
- policy.recordHealthReportUploadEnabled(true,
- "Resetting after tests.");
- } catch (ex) {}
-});
-
-function fakeTelemetryNow(...args) {
- let date = new Date(...args);
- let scope = {};
- const modules = [
- Cu.import("resource://gre/modules/TelemetrySession.jsm", scope),
- Cu.import("resource://gre/modules/TelemetryEnvironment.jsm", scope),
- Cu.import("resource://gre/modules/TelemetryController.jsm", scope),
- ];
-
- for (let m of modules) {
- m.Policy.now = () => new Date(date);
- }
-
- return date;
-}
-
-function setupPingArchive() {
- let scope = {};
- Cu.import("resource://gre/modules/TelemetryController.jsm", scope);
- Cc["@mozilla.org/moz/jssubscript-loader;1"].getService(Ci.mozIJSSubScriptLoader)
- .loadSubScript(CHROME_BASE + "healthreport_pingData.js", scope);
-
- for (let p of scope.TEST_PINGS) {
- fakeTelemetryNow(p.date);
- p.id = yield scope.TelemetryController.submitExternalPing(p.type, p.payload);
- }
-}
-
-var gTests = [
-
-{
- desc: "Test the remote commands",
- setup: Task.async(function*()
- {
- Preferences.set(TELEMETRY_LOG_PREF, "Trace");
- yield setupPingArchive();
- Preferences.set("datareporting.healthreport.about.reportUrl",
- HTTPS_BASE + "healthreport_testRemoteCommands.html");
- Preferences.set("datareporting.healthreport.about.reportUrlUnified",
- HTTPS_BASE + "healthreport_testRemoteCommands.html");
- }),
- run: function (iframe)
- {
- let deferred = Promise.defer();
-
- let policy = Cc["@mozilla.org/datareporting/service;1"]
- .getService(Ci.nsISupports)
- .wrappedJSObject
- .policy;
-
- let results = 0;
- try {
- iframe.contentWindow.addEventListener("FirefoxHealthReportTestResponse", function evtHandler(event) {
- let data = event.detail.data;
- if (data.type == "testResult") {
- ok(data.pass, data.info);
- results++;
- }
- else if (data.type == "testsComplete") {
- is(results, data.count, "Checking number of results received matches the number of tests that should have run");
- iframe.contentWindow.removeEventListener("FirefoxHealthReportTestResponse", evtHandler, true);
- deferred.resolve();
- }
- }, true);
-
- } catch(e) {
- ok(false, "Failed to get all commands");
- deferred.reject();
- }
- return deferred.promise;
- }
-},
-
-]; // gTests
-
-function test()
-{
- waitForExplicitFinish();
-
- // xxxmpc leaving this here until we resolve bug 854038 and bug 854060
- requestLongerTimeout(10);
-
- Task.spawn(function () {
- for (let test of gTests) {
- info(test.desc);
- yield test.setup();
-
- let iframe = yield promiseNewTabLoadEvent("about:healthreport");
-
- yield test.run(iframe);
-
- gBrowser.removeCurrentTab();
- }
-
- finish();
- });
-}
-
-function promiseNewTabLoadEvent(aUrl, aEventType="load")
-{
- let deferred = Promise.defer();
- let tab = gBrowser.selectedTab = gBrowser.addTab(aUrl);
- tab.linkedBrowser.addEventListener(aEventType, function load(event) {
- tab.linkedBrowser.removeEventListener(aEventType, load, true);
- let iframe = tab.linkedBrowser.contentDocument.getElementById("remote-report");
- iframe.addEventListener("load", function frameLoad(e) {
- if (iframe.contentWindow.location.href == "about:blank" ||
- e.target != iframe) {
- return;
- }
- iframe.removeEventListener("load", frameLoad, false);
- deferred.resolve(iframe);
- }, false);
- }, true);
- return deferred.promise;
-}
+/* Any copyright is dedicated to the Public Domain.
+ * http://creativecommons.org/publicdomain/zero/1.0/
+ */
+
+XPCOMUtils.defineLazyModuleGetter(this, "Promise",
+ "resource://gre/modules/Promise.jsm");
+XPCOMUtils.defineLazyModuleGetter(this, "Task",
+ "resource://gre/modules/Task.jsm");
+
+const CHROME_BASE = "chrome://mochitests/content/browser/browser/base/content/test/general/";
+const HTTPS_BASE = "https://example.com/browser/browser/base/content/test/general/";
+
+const TELEMETRY_LOG_PREF = "toolkit.telemetry.log.level";
+const telemetryOriginalLogPref = Preferences.get(TELEMETRY_LOG_PREF, null);
+
+const originalReportUrl = Services.prefs.getCharPref("datareporting.healthreport.about.reportUrl");
+const originalReportUrlUnified = Services.prefs.getCharPref("datareporting.healthreport.about.reportUrlUnified");
+
+registerCleanupFunction(function() {
+ // Ensure we don't pollute prefs for next tests.
+ if (telemetryOriginalLogPref) {
+ Preferences.set(TELEMETRY_LOG_PREF, telemetryOriginalLogPref);
+ } else {
+ Preferences.reset(TELEMETRY_LOG_PREF);
+ }
+
+ try {
+ Services.prefs.setCharPref("datareporting.healthreport.about.reportUrl", originalReportUrl);
+ Services.prefs.setCharPref("datareporting.healthreport.about.reportUrlUnified", originalReportUrlUnified);
+ Services.prefs.setBoolPref("datareporting.healthreport.uploadEnabled", true);
+ } catch (ex) {}
+});
+
+function fakeTelemetryNow(...args) {
+ let date = new Date(...args);
+ let scope = {};
+ const modules = [
+ Cu.import("resource://gre/modules/TelemetrySession.jsm", scope),
+ Cu.import("resource://gre/modules/TelemetryEnvironment.jsm", scope),
+ Cu.import("resource://gre/modules/TelemetryController.jsm", scope),
+ ];
+
+ for (let m of modules) {
+ m.Policy.now = () => new Date(date);
+ }
+
+ return date;
+}
+
+function setupPingArchive() {
+ let scope = {};
+ Cu.import("resource://gre/modules/TelemetryController.jsm", scope);
+ Cc["@mozilla.org/moz/jssubscript-loader;1"].getService(Ci.mozIJSSubScriptLoader)
+ .loadSubScript(CHROME_BASE + "healthreport_pingData.js", scope);
+
+ for (let p of scope.TEST_PINGS) {
+ fakeTelemetryNow(p.date);
+ p.id = yield scope.TelemetryController.submitExternalPing(p.type, p.payload);
+ }
+}
+
+var gTests = [
+
+{
+ desc: "Test the remote commands",
+ setup: Task.async(function*()
+ {
+ Preferences.set(TELEMETRY_LOG_PREF, "Trace");
+ yield setupPingArchive();
+ Preferences.set("datareporting.healthreport.about.reportUrl",
+ HTTPS_BASE + "healthreport_testRemoteCommands.html");
+ Preferences.set("datareporting.healthreport.about.reportUrlUnified",
+ HTTPS_BASE + "healthreport_testRemoteCommands.html");
+ }),
+ run: function (iframe)
+ {
+ let deferred = Promise.defer();
+ let results = 0;
+ try {
+ iframe.contentWindow.addEventListener("FirefoxHealthReportTestResponse", function evtHandler(event) {
+ let data = event.detail.data;
+ if (data.type == "testResult") {
+ ok(data.pass, data.info);
+ results++;
+ }
+ else if (data.type == "testsComplete") {
+ is(results, data.count, "Checking number of results received matches the number of tests that should have run");
+ iframe.contentWindow.removeEventListener("FirefoxHealthReportTestResponse", evtHandler, true);
+ deferred.resolve();
+ }
+ }, true);
+
+ } catch(e) {
+ ok(false, "Failed to get all commands");
+ deferred.reject();
+ }
+ return deferred.promise;
+ }
+},
+
+]; // gTests
+
+function test()
+{
+ waitForExplicitFinish();
+
+ // xxxmpc leaving this here until we resolve bug 854038 and bug 854060
+ requestLongerTimeout(10);
+
+ Task.spawn(function () {
+ for (let test of gTests) {
+ info(test.desc);
+ yield test.setup();
+
+ let iframe = yield promiseNewTabLoadEvent("about:healthreport");
+
+ yield test.run(iframe);
+
+ gBrowser.removeCurrentTab();
+ }
+
+ finish();
+ });
+}
+
+function promiseNewTabLoadEvent(aUrl, aEventType="load")
+{
+ let deferred = Promise.defer();
+ let tab = gBrowser.selectedTab = gBrowser.addTab(aUrl);
+ tab.linkedBrowser.addEventListener(aEventType, function load(event) {
+ tab.linkedBrowser.removeEventListener(aEventType, load, true);
+ let iframe = tab.linkedBrowser.contentDocument.getElementById("remote-report");
+ iframe.addEventListener("load", function frameLoad(e) {
+ if (iframe.contentWindow.location.href == "about:blank" ||
+ e.target != iframe) {
+ return;
+ }
+ iframe.removeEventListener("load", frameLoad, false);
+ deferred.resolve(iframe);
+ }, false);
+ }, true);
+ return deferred.promise;
+}
diff --git a/browser/base/content/test/general/browser_aboutHome.js b/browser/base/content/test/general/browser_aboutHome.js
index c32eb95ebd7..74696e0cdc3 100644
--- a/browser/base/content/test/general/browser_aboutHome.js
+++ b/browser/base/content/test/general/browser_aboutHome.js
@@ -78,24 +78,11 @@ var gTests = [
}
},
-// Disabled on Linux for intermittent issues with FHR, see Bug 945667.
{
desc: "Check that performing a search fires a search event and records to " +
- "Firefox Health Report.",
+ "Telemetry.",
setup: function () { },
run: function* () {
- // Skip this test on Linux.
- if (navigator.platform.indexOf("Linux") == 0) {
- return Promise.resolve();
- }
-
- try {
- let cm = Cc["@mozilla.org/categorymanager;1"].getService(Ci.nsICategoryManager);
- cm.getCategoryEntry("healthreport-js-provider-default", "SearchesProvider");
- } catch (ex) {
- // Health Report disabled, or no SearchesProvider.
- return Promise.resolve();
- }
let engine = yield promiseNewEngine("searchSuggestionEngine.xml");
// Make this actually work in healthreport by giving it an ID:
@@ -113,23 +100,32 @@ var gTests = [
is(engine.name, engineName, "Engine name in DOM should match engine we just added");
// Get the current number of recorded searches.
- let searchStr = "a search";
- getNumberOfSearchesInFHR(engineName, "abouthome").then(num => {
- numSearchesBefore = num;
+ let histogramKey = engine.identifier + ".abouthome";
+ try {
+ let hs = Services.telemetry.getKeyedHistogramById("SEARCH_COUNTS").snapshot();
+ if (histogramKey in hs) {
+ numSearchesBefore = hs[histogramKey].sum;
+ }
+ } catch (ex) {
+ // No searches performed yet, not a problem, |numSearchesBefore| is 0.
+ }
- info("Perform a search.");
- doc.getElementById("searchText").value = searchStr;
- doc.getElementById("searchSubmit").click();
- });
+ // Perform a search to increase the SEARCH_COUNT histogram.
+ let searchStr = "a search";
+ info("Perform a search.");
+ doc.getElementById("searchText").value = searchStr;
+ doc.getElementById("searchSubmit").click();
let expectedURL = Services.search.currentEngine.
getSubmission(searchStr, null, "homepage").
uri.spec;
let loadPromise = waitForDocLoadAndStopIt(expectedURL).then(() => {
- getNumberOfSearchesInFHR(engineName, "abouthome").then(num => {
- is(num, numSearchesBefore + 1, "One more search recorded.");
- searchEventDeferred.resolve();
- });
+ // Make sure the SEARCH_COUNTS histogram has the right key and count.
+ let hs = Services.telemetry.getKeyedHistogramById("SEARCH_COUNTS").snapshot();
+ Assert.ok(histogramKey in hs, "histogram with key should be recorded");
+ Assert.equal(hs[histogramKey].sum, numSearchesBefore + 1,
+ "histogram sum should be incremented");
+ searchEventDeferred.resolve();
});
try {
diff --git a/browser/base/content/test/general/browser_contextSearchTabPosition.js b/browser/base/content/test/general/browser_contextSearchTabPosition.js
index b8ac3c04356..76646789000 100644
--- a/browser/base/content/test/general/browser_contextSearchTabPosition.js
+++ b/browser/base/content/test/general/browser_contextSearchTabPosition.js
@@ -2,15 +2,34 @@
* 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/. */
-function test() {
- waitForExplicitFinish();
+add_task(function* test() {
+
+ // Will need to be changed if Google isn't the default search engine.
+ // Note: geoSpecificDefaults are disabled for mochitests, so this is the
+ // non-US en-US default.
+ let histogramKey = "google.contextmenu";
+ let numSearchesBefore = 0;
+ try {
+ let hs = Services.telemetry.getKeyedHistogramById("SEARCH_COUNTS").snapshot();
+ if (histogramKey in hs) {
+ numSearchesBefore = hs[histogramKey].sum;
+ }
+ } catch (ex) {
+ // No searches performed yet, not a problem, |numSearchesBefore| is 0.
+ }
+
+ let tabs = [];
+ let tabsLoadedDeferred = Promise.defer();
function tabAdded(event) {
let tab = event.target;
tabs.push(tab);
- }
- let tabs = [];
+ // We wait for the blank tab and the two context searches tabs to open.
+ if (tabs.length == 3) {
+ tabsLoadedDeferred.resolve();
+ }
+ }
let container = gBrowser.tabContainer;
container.addEventListener("TabOpen", tabAdded, false);
@@ -19,6 +38,9 @@ function test() {
BrowserSearch.loadSearchFromContext("mozilla");
BrowserSearch.loadSearchFromContext("firefox");
+ // Wait for all the tabs to open.
+ yield tabsLoadedDeferred.promise;
+
is(tabs[0], gBrowser.tabs[3], "blank tab has been pushed to the end");
is(tabs[1], gBrowser.tabs[1], "first search tab opens next to the current tab");
is(tabs[2], gBrowser.tabs[2], "second search tab opens next to the first search tab");
@@ -26,45 +48,9 @@ function test() {
container.removeEventListener("TabOpen", tabAdded, false);
tabs.forEach(gBrowser.removeTab, gBrowser);
- try {
- let cm = Components.classes["@mozilla.org/categorymanager;1"]
- .getService(Components.interfaces.nsICategoryManager);
- cm.getCategoryEntry("healthreport-js-provider-default", "SearchesProvider");
- } catch (ex) {
- // Health Report disabled, or no SearchesProvider.
- finish();
- return;
- }
-
- let reporter = Components.classes["@mozilla.org/datareporting/service;1"]
- .getService()
- .wrappedJSObject
- .healthReporter;
-
- // reporter should always be available in automation.
- ok(reporter, "Health Reporter available.");
- reporter.onInit().then(function onInit() {
- let provider = reporter.getProvider("org.mozilla.searches");
- ok(provider, "Searches provider is available.");
-
- let m = provider.getMeasurement("counts", 3);
- m.getValues().then(function onValues(data) {
- let now = new Date();
- ok(data.days.hasDay(now), "Have data for today.");
- let day = data.days.getDay(now);
-
- // Will need to be changed if Google isn't the default search engine.
- // Note: geoSpecificDefaults are disabled for mochitests, so this is the
- // non-US en-US default.
- let defaultProviderID = "google";
- let field = defaultProviderID + ".contextmenu";
- ok(day.has(field), "Have search recorded for context menu.");
-
- // If any other mochitests perform a context menu search, this will fail.
- // The solution will be to look up count at test start and ensure it is
- // incremented by two.
- is(day.get(field), 2, "2 searches recorded in FHR.");
- finish();
- });
- });
-}
+ // Make sure that the context searches are correctly recorded.
+ let hs = Services.telemetry.getKeyedHistogramById("SEARCH_COUNTS").snapshot();
+ Assert.ok(histogramKey in hs, "The histogram must contain the correct key");
+ Assert.equal(hs[histogramKey].sum, numSearchesBefore + 2,
+ "The histogram must contain the correct search count");
+});
diff --git a/browser/base/content/test/general/browser_datachoices_notification.js b/browser/base/content/test/general/browser_datachoices_notification.js
index 729a29e3f12..17fa14ea860 100644
--- a/browser/base/content/test/general/browser_datachoices_notification.js
+++ b/browser/base/content/test/general/browser_datachoices_notification.js
@@ -10,13 +10,7 @@ var Preferences = Cu.import("resource://gre/modules/Preferences.jsm", {}).Prefer
var TelemetryReportingPolicy =
Cu.import("resource://gre/modules/TelemetryReportingPolicy.jsm", {}).TelemetryReportingPolicy;
-XPCOMUtils.defineLazyGetter(this, "gDatareportingService",
- () => Cc["@mozilla.org/datareporting/service;1"]
- .getService(Ci.nsISupports)
- .wrappedJSObject);
-
const PREF_BRANCH = "datareporting.policy.";
-const PREF_DRS_ENABLED = "datareporting.healthreport.service.enabled";
const PREF_BYPASS_NOTIFICATION = PREF_BRANCH + "dataSubmissionPolicyBypassNotification";
const PREF_CURRENT_POLICY_VERSION = PREF_BRANCH + "currentPolicyVersion";
const PREF_ACCEPTED_POLICY_VERSION = PREF_BRANCH + "dataSubmissionPolicyAcceptedVersion";
@@ -103,31 +97,21 @@ var checkInfobarButton = Task.async(function* (aNotification) {
});
add_task(function* setup(){
- const drsEnabled = Preferences.get(PREF_DRS_ENABLED, true);
const bypassNotification = Preferences.get(PREF_BYPASS_NOTIFICATION, true);
const currentPolicyVersion = Preferences.get(PREF_CURRENT_POLICY_VERSION, 1);
// Register a cleanup function to reset our preferences.
registerCleanupFunction(() => {
- Preferences.set(PREF_DRS_ENABLED, drsEnabled);
Preferences.set(PREF_BYPASS_NOTIFICATION, bypassNotification);
Preferences.set(PREF_CURRENT_POLICY_VERSION, currentPolicyVersion);
- // Start polling again.
- gDatareportingService.policy.startPolling();
-
return closeAllNotifications();
});
- // Disable Healthreport/Data reporting service.
- Preferences.set(PREF_DRS_ENABLED, false);
// Don't skip the infobar visualisation.
Preferences.set(PREF_BYPASS_NOTIFICATION, false);
// Set the current policy version.
Preferences.set(PREF_CURRENT_POLICY_VERSION, TEST_POLICY_VERSION);
-
- // Stop the polling to make sure no policy gets displayed by FHR.
- gDatareportingService.policy.stopPolling();
});
function clearAcceptedPolicy() {
diff --git a/browser/base/content/test/general/browser_datareporting_notification.js b/browser/base/content/test/general/browser_datareporting_notification.js
deleted file mode 100644
index ce18a5f5a0d..00000000000
--- a/browser/base/content/test/general/browser_datareporting_notification.js
+++ /dev/null
@@ -1,213 +0,0 @@
-/* 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/. */
-
-var originalPolicy = null;
-
-/**
- * Display a datareporting notification to the user.
- *
- * @param {String} name
- */
-function sendNotifyRequest(name) {
- let ns = {};
- Cu.import("resource://gre/modules/services/datareporting/policy.jsm", ns);
- Cu.import("resource://gre/modules/Preferences.jsm", ns);
-
- let service = Cc["@mozilla.org/datareporting/service;1"]
- .getService(Ci.nsISupports)
- .wrappedJSObject;
- ok(service.healthReporter, "Health Reporter instance is available.");
-
- Cu.import("resource://gre/modules/Promise.jsm", ns);
- let deferred = ns.Promise.defer();
-
- if (!originalPolicy) {
- originalPolicy = service.policy;
- }
-
- let policyPrefs = new ns.Preferences("testing." + name + ".");
- ok(service._prefs, "Health Reporter prefs are available.");
- let hrPrefs = service._prefs;
-
- let policy = new ns.DataReportingPolicy(policyPrefs, hrPrefs, service);
- policy.dataSubmissionPolicyBypassNotification = false;
- service.policy = policy;
- policy.firstRunDate = new Date(Date.now() - 24 * 60 * 60 * 1000);
-
- service.healthReporter.onInit().then(function onSuccess () {
- is(policy.ensureUserNotified(), false, "User not notified about data policy on init.");
- ok(policy._userNotifyPromise, "_userNotifyPromise defined.");
- policy._userNotifyPromise.then(
- deferred.resolve.bind(deferred),
- deferred.reject.bind(deferred)
- );
- }.bind(this), deferred.reject.bind(deferred));
-
- return [policy, deferred.promise];
-}
-
-var dumpAppender, rootLogger;
-
-function test() {
- registerCleanupFunction(cleanup);
- waitForExplicitFinish();
-
- let ns = {};
- Components.utils.import("resource://gre/modules/Log.jsm", ns);
- rootLogger = ns.Log.repository.rootLogger;
- dumpAppender = new ns.Log.DumpAppender();
- dumpAppender.level = ns.Log.Level.All;
- rootLogger.addAppender(dumpAppender);
-
- closeAllNotifications().then(function onSuccess () {
- let notification = document.getElementById("global-notificationbox");
-
- notification.addEventListener("AlertActive", function active() {
- notification.removeEventListener("AlertActive", active, true);
- is(notification.allNotifications.length, 1, "Notification Displayed.");
-
- executeSoon(function afterNotification() {
- waitForNotificationClose(notification.currentNotification, function onClose() {
- is(notification.allNotifications.length, 0, "No notifications remain.");
- is(policy.dataSubmissionPolicyAcceptedVersion, 1, "Version pref set.");
- ok(policy.dataSubmissionPolicyNotifiedDate.getTime() > -1, "Date pref set.");
- test_multiple_windows();
- });
- notification.currentNotification.close();
- });
- }, true);
-
- let [policy, promise] = sendNotifyRequest("single_window_notified");
-
- is(policy.dataSubmissionPolicyAcceptedVersion, 0, "No version should be set on init.");
- is(policy.dataSubmissionPolicyNotifiedDate.getTime(), 0, "No date should be set on init.");
- is(policy.userNotifiedOfCurrentPolicy, false, "User not notified about datareporting policy.");
-
- promise.then(function () {
- is(policy.dataSubmissionPolicyAcceptedVersion, 1, "Policy version set.");
- is(policy.dataSubmissionPolicyNotifiedDate.getTime() > 0, true, "Policy date set.");
- is(policy.userNotifiedOfCurrentPolicy, true, "User notified about datareporting policy.");
- }.bind(this), function (err) {
- throw err;
- });
-
- }.bind(this), function onError (err) {
- throw err;
- });
-}
-
-function test_multiple_windows() {
- // Ensure we see the notification on all windows and that action on one window
- // results in dismiss on every window.
- let window2 = OpenBrowserWindow();
- whenDelayedStartupFinished(window2, function onWindow() {
- let notification1 = document.getElementById("global-notificationbox");
- let notification2 = window2.document.getElementById("global-notificationbox");
- ok(notification2, "2nd window has a global notification box.");
-
- let [policy, promise] = sendNotifyRequest("multiple_window_behavior");
- let displayCount = 0;
- let prefWindowOpened = false;
- let mutationObserversRemoved = false;
-
- function onAlertDisplayed() {
- displayCount++;
-
- if (displayCount != 2) {
- return;
- }
-
- ok(true, "Data reporting info bar displayed on all open windows.");
-
- // We register two independent observers and we need both to clean up
- // properly. This handles gating for test completion.
- function maybeFinish() {
- if (!prefWindowOpened) {
- dump("Not finishing test yet because pref pane hasn't yet appeared.\n");
- return;
- }
-
- if (!mutationObserversRemoved) {
- dump("Not finishing test yet because mutation observers haven't been removed yet.\n");
- return;
- }
-
- window2.close();
-
- dump("Finishing multiple window test.\n");
- rootLogger.removeAppender(dumpAppender);
- dumpAppender = null;
- rootLogger = null;
- finish();
- }
- let closeCount = 0;
-
- function onAlertClose() {
- closeCount++;
-
- if (closeCount != 2) {
- return;
- }
-
- ok(true, "Closing info bar on one window closed them on all.");
- is(policy.userNotifiedOfCurrentPolicy, true, "Data submission policy accepted.");
-
- is(notification1.allNotifications.length, 0, "No notifications remain on main window.");
- is(notification2.allNotifications.length, 0, "No notifications remain on 2nd window.");
-
- mutationObserversRemoved = true;
- maybeFinish();
- }
-
- waitForNotificationClose(notification1.currentNotification, onAlertClose);
- waitForNotificationClose(notification2.currentNotification, onAlertClose);
-
- // While we're here, we dual purpose this test to check that pressing the
- // button does the right thing.
- let buttons = notification2.currentNotification.getElementsByTagName("button");
- is(buttons.length, 1, "There is 1 button in the data reporting notification.");
- let button = buttons[0];
-
- // Add an observer to ensure the "advanced" pane opened (but don't bother
- // closing it - we close the entire window when done.)
- Services.obs.addObserver(function observer(prefWin, topic, data) {
- Services.obs.removeObserver(observer, "advanced-pane-loaded");
-
- ok(true, "Advanced preferences opened on info bar button press.");
- executeSoon(function soon() {
- prefWindowOpened = true;
- maybeFinish();
- });
- }, "advanced-pane-loaded", false);
-
- button.click();
- }
-
- notification1.addEventListener("AlertActive", function active1() {
- notification1.removeEventListener("AlertActive", active1, true);
- executeSoon(onAlertDisplayed);
- }, true);
-
- notification2.addEventListener("AlertActive", function active2() {
- notification2.removeEventListener("AlertActive", active2, true);
- executeSoon(onAlertDisplayed);
- }, true);
-
- promise.then(null, function onError(err) {
- throw err;
- });
- });
-}
-
-function cleanup () {
- // In case some test fails.
- if (originalPolicy) {
- let service = Cc["@mozilla.org/datareporting/service;1"]
- .getService(Ci.nsISupports)
- .wrappedJSObject;
- service.policy = originalPolicy;
- }
-
- return closeAllNotifications();
-}
diff --git a/browser/base/content/test/general/browser_urlbarSearchTelemetry.js b/browser/base/content/test/general/browser_urlbarSearchTelemetry.js
index 21a8ed7e19c..98243ac9d25 100644
--- a/browser/base/content/test/general/browser_urlbarSearchTelemetry.js
+++ b/browser/base/content/test/general/browser_urlbarSearchTelemetry.js
@@ -103,7 +103,6 @@ function* compareCounts(clickCallback) {
// FHR -- first make sure the engine has an identifier so that FHR is happy.
Object.defineProperty(engine.wrappedJSObject, "identifier",
{ value: engineID });
- let fhrCount = yield getNumberOfSearchesInFHR(engine.name, "urlbar");
gURLBar.focus();
yield clickCallback();
@@ -126,10 +125,6 @@ function* compareCounts(clickCallback) {
Assert.ok(histogramKey in snapshot, "histogram with key should be recorded");
Assert.equal(snapshot[histogramKey].sum, histogramCount + 1,
"histogram sum should be incremented");
-
- // FHR
- let newFHRCount = yield getNumberOfSearchesInFHR(engine.name, "urlbar");
- Assert.equal(newFHRCount, fhrCount + 1, "should be recorded in FHR");
}
/**
diff --git a/browser/base/content/test/general/browser_urlbar_search_healthreport.js b/browser/base/content/test/general/browser_urlbar_search_healthreport.js
deleted file mode 100644
index 6a37a80fb5d..00000000000
--- a/browser/base/content/test/general/browser_urlbar_search_healthreport.js
+++ /dev/null
@@ -1,85 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-"use strict";
-
-add_task(function* test_healthreport_search_recording() {
- try {
- let cm = Cc["@mozilla.org/categorymanager;1"].getService(Ci.nsICategoryManager);
- cm.getCategoryEntry("healthreport-js-provider-default", "SearchesProvider");
- } catch (ex) {
- // Health Report disabled, or no SearchesProvider.
- ok(true, "Firefox Health Report is not enabled.");
- return;
- }
-
- let reporter = Cc["@mozilla.org/datareporting/service;1"]
- .getService()
- .wrappedJSObject
- .healthReporter;
- ok(reporter, "Health Reporter available.");
- yield reporter.onInit();
- let provider = reporter.getProvider("org.mozilla.searches");
- ok(provider, "Searches provider is available.");
- let m = provider.getMeasurement("counts", 3);
-
- let data = yield m.getValues();
- let now = new Date();
- let oldCount = 0;
-
- // This will to be need changed if default search engine is not Google.
- // Note: geoSpecificDefaults are disabled for mochitests, so this is the
- // non-US en-US default.
- let defaultEngineID = "google";
-
- let field = defaultEngineID + ".urlbar";
-
- if (data.days.hasDay(now)) {
- let day = data.days.getDay(now);
- if (day.has(field)) {
- oldCount = day.get(field);
- }
- }
-
- let tab = gBrowser.addTab("about:blank");
- yield BrowserTestUtils.browserLoaded(tab.linkedBrowser);
- gBrowser.selectedTab = tab;
-
- let searchStr = "firefox health report";
- let expectedURL = Services.search.currentEngine.
- getSubmission(searchStr, "", "keyword").uri.spec;
-
- // Expect the search URL to load but stop it as soon as it starts.
- let docLoadPromise = waitForDocLoadAndStopIt(expectedURL);
-
- // Trigger the search.
- gURLBar.value = searchStr;
- gURLBar.handleCommand();
-
- yield docLoadPromise;
-
- data = yield m.getValues();
- ok(data.days.hasDay(now), "We have a search measurement for today.");
- let day = data.days.getDay(now);
- ok(day.has(field), "Have a search count for the urlbar.");
- let newCount = day.get(field);
- is(newCount, oldCount + 1, "We recorded one new search.");
-
- // We should record the default search engine if Telemetry is enabled.
- let oldTelemetry = Services.prefs.getBoolPref("toolkit.telemetry.enabled");
- Services.prefs.setBoolPref("toolkit.telemetry.enabled", true);
-
- m = provider.getMeasurement("engines", 2);
- yield provider.collectDailyData();
- data = yield m.getValues();
-
- ok(data.days.hasDay(now), "Have engines data when Telemetry is enabled.");
- day = data.days.getDay(now);
- ok(day.has("default"), "We have default engine data.");
- is(day.get("default"), defaultEngineID, "The default engine is reported properly.");
-
- // Restore.
- Services.prefs.setBoolPref("toolkit.telemetry.enabled", oldTelemetry);
-
- gBrowser.removeTab(tab);
-});
diff --git a/browser/base/content/test/general/head.js b/browser/base/content/test/general/head.js
index 4e5f98f5a07..2f20399e19a 100644
--- a/browser/base/content/test/general/head.js
+++ b/browser/base/content/test/general/head.js
@@ -1202,61 +1202,3 @@ function promiseCrashReport(expectedExtra) {
}
});
}
-
-/**
- * Retrieves the number of searches recorded in FHR for the current day.
- *
- * @param aEngineName
- * name of the setup search engine.
- * @param aSource
- * The FHR "source" name for the search, like "abouthome" or "urlbar".
- *
- * @return {Promise} Returns a promise resolving to the number of searches.
- */
-function getNumberOfSearchesInFHR(aEngineName, aSource) {
- let reporter = Components.classes["@mozilla.org/datareporting/service;1"]
- .getService()
- .wrappedJSObject
- .healthReporter;
- ok(reporter, "Health Reporter instance available.");
-
- return reporter.onInit().then(function onInit() {
- let provider = reporter.getProvider("org.mozilla.searches");
- ok(provider, "Searches provider is available.");
-
- let m = provider.getMeasurement("counts", 3);
- return m.getValues().then(data => {
- let now = new Date();
- let yday = new Date(now);
- yday.setDate(yday.getDate() - 1);
-
- // Add the number of searches recorded yesterday to the number of searches
- // recorded today. This makes the test not fail intermittently when it is
- // run at midnight and we accidentally compare the number of searches from
- // different days. Tests are always run with an empty profile so there
- // are no searches from yesterday, normally. Should the test happen to run
- // past midnight we make sure to count them in as well.
- return getNumberOfSearchesInFHRByDate(aEngineName, aSource, data, now) +
- getNumberOfSearchesInFHRByDate(aEngineName, aSource, data, yday);
- });
- });
-}
-
-/**
- * Helper for getNumberOfSearchesInFHR. You probably don't want to call this
- * directly.
- */
-function getNumberOfSearchesInFHRByDate(aEngineName, aSource, aData, aDate) {
- if (aData.days.hasDay(aDate)) {
- let id = Services.search.getEngineByName(aEngineName).identifier;
-
- let day = aData.days.getDay(aDate);
- let field = id + "." + aSource;
-
- if (day.has(field)) {
- return day.get(field) || 0;
- }
- }
-
- return 0; // No records found.
-}
diff --git a/browser/base/content/test/general/healthreport_testRemoteCommands.html b/browser/base/content/test/general/healthreport_testRemoteCommands.html
index cc9e7076708..7978914f2be 100644
--- a/browser/base/content/test/general/healthreport_testRemoteCommands.html
+++ b/browser/base/content/test/general/healthreport_testRemoteCommands.html
@@ -7,35 +7,14 @@