Bug 1234526 - Remove unused healthreporter prefs. r=gfritzsche
☠☠ backed out by 19a2342819e4 ☠ ☠
authorAlessio Placitelli <alessio.placitelli@gmail.com>
Tue, 05 Jan 2016 06:41:00 +0100
changeset 320138 3124025d114712f6717e6cf6a4ba930f0ab02ac3
parent 320137 096d46bdaf86112bc1bf350fec18d5d4063ab0c2
child 320139 c7689b72d3fa71043aa8601134b7bdc4581deb86
push id9143
push userahunt@mozilla.com
push dateFri, 08 Jan 2016 21:30:53 +0000
reviewersgfritzsche
bugs1234526
milestone46.0a1
Bug 1234526 - Remove unused healthreporter prefs. r=gfritzsche
browser/base/content/test/general/browser_datachoices_notification.js
browser/experiments/ExperimentsService.js
browser/modules/SelfSupportBackend.jsm
services/healthreport/healthreport-prefs.js
testing/marionette/driver/marionette_driver/geckoinstance.py
toolkit/components/telemetry/TelemetryController.jsm
toolkit/components/telemetry/healthreport-prefs.js
toolkit/components/telemetry/tests/unit/test_TelemetryController.js
toolkit/components/telemetry/tests/unit/test_TelemetryReportingPolicy.js
toolkit/components/telemetry/tests/unit/test_TelemetrySession.js
--- a/browser/base/content/test/general/browser_datachoices_notification.js
+++ b/browser/base/content/test/general/browser_datachoices_notification.js
@@ -6,17 +6,16 @@
 
 // Pass an empty scope object to the import to prevent "leaked window property"
 // errors in tests.
 var Preferences = Cu.import("resource://gre/modules/Preferences.jsm", {}).Preferences;
 var TelemetryReportingPolicy =
   Cu.import("resource://gre/modules/TelemetryReportingPolicy.jsm", {}).TelemetryReportingPolicy;
 
 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";
 const PREF_ACCEPTED_POLICY_DATE = PREF_BRANCH + "dataSubmissionPolicyNotifiedTime";
 
 const TEST_POLICY_VERSION = 37;
 
 function fakeShowPolicyTimeout(set, clear) {
@@ -93,31 +92,27 @@ var checkInfobarButton = Task.async(func
   button.click();
 
   // Wait for the preferences panel to open.
   let preferenceWindow = yield paneLoadedPromise;
   yield promiseNextTick();
 });
 
 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);
 
     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);
 });
 
 function clearAcceptedPolicy() {
   // Reset the accepted policy.
--- a/browser/experiments/ExperimentsService.js
+++ b/browser/experiments/ExperimentsService.js
@@ -14,17 +14,16 @@ XPCOMUtils.defineLazyModuleGetter(this, 
                                   "resource:///modules/experiments/Experiments.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "OS",
                                   "resource://gre/modules/osfile.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "CommonUtils",
                                   "resource://services-common/utils.js");
 
 const PREF_EXPERIMENTS_ENABLED  = "experiments.enabled";
 const PREF_ACTIVE_EXPERIMENT    = "experiments.activeExperiment"; // whether we have an active experiment
-const PREF_HEALTHREPORT_ENABLED = "datareporting.healthreport.service.enabled";
 const PREF_TELEMETRY_ENABLED    = "toolkit.telemetry.enabled";
 const PREF_TELEMETRY_UNIFIED    = "toolkit.telemetry.unified";
 const DELAY_INIT_MS             = 30 * 1000;
 
 // Whether the FHR/Telemetry unification features are enabled.
 // Changing this pref requires a restart.
 const IS_UNIFIED_TELEMETRY = Preferences.get(PREF_TELEMETRY_UNIFIED, false);
 
@@ -33,18 +32,17 @@ XPCOMUtils.defineLazyGetter(
     return new Preferences();
   });
 
 XPCOMUtils.defineLazyGetter(
   this, "gExperimentsEnabled", () => {
     // We can enable experiments if either unified Telemetry or FHR is on, and the user
     // has opted into Telemetry.
     return gPrefs.get(PREF_EXPERIMENTS_ENABLED, false) &&
-           (gPrefs.get(PREF_HEALTHREPORT_ENABLED, false) || IS_UNIFIED_TELEMETRY) &&
-           gPrefs.get(PREF_TELEMETRY_ENABLED, false);
+           IS_UNIFIED_TELEMETRY && gPrefs.get(PREF_TELEMETRY_ENABLED, false);
   });
 
 XPCOMUtils.defineLazyGetter(
   this, "gActiveExperiment", () => {
     return gPrefs.get(PREF_ACTIVE_EXPERIMENT);
   });
 
 function ExperimentsService() {
--- a/browser/modules/SelfSupportBackend.jsm
+++ b/browser/modules/SelfSupportBackend.jsm
@@ -18,18 +18,16 @@ Cu.import("resource://gre/modules/XPCOMU
 
 XPCOMUtils.defineLazyModuleGetter(this, "HiddenFrame",
   "resource:///modules/HiddenFrame.jsm");
 
 // Enables or disables the Self Support.
 const PREF_ENABLED = "browser.selfsupport.enabled";
 // Url to open in the Self Support browser, in the urlFormatter service format.
 const PREF_URL = "browser.selfsupport.url";
-// FHR status.
-const PREF_FHR_ENABLED = "datareporting.healthreport.service.enabled";
 // Unified Telemetry status.
 const PREF_TELEMETRY_UNIFIED = "toolkit.telemetry.unified";
 // UITour status.
 const PREF_UITOUR_ENABLED = "browser.uitour.enabled";
 
 // Controls the interval at which the self support page tries to reload in case of
 // errors.
 const RETRY_INTERVAL_MS = 30000;
@@ -79,18 +77,18 @@ var SelfSupportBackendInternal = {
    */
   init: function () {
     this._configureLogging();
 
     this._log.trace("init");
 
     Preferences.observe(PREF_BRANCH_LOG, this._configureLogging, this);
 
-    // Only allow to use SelfSupport if either FHR or Unified Telemetry is enabled.
-    let reportingEnabled = Preferences.get(PREF_FHR_ENABLED, false) || IS_UNIFIED_TELEMETRY;
+    // Only allow to use SelfSupport if Unified Telemetry is enabled.
+    let reportingEnabled = IS_UNIFIED_TELEMETRY;
     if (!reportingEnabled) {
       this._log.config("init - Disabling SelfSupport because FHR and Unified Telemetry are disabled.");
       return;
     }
 
     // Make sure UITour is enabled.
     let uiTourEnabled = Preferences.get(PREF_UITOUR_ENABLED, false);
     if (!uiTourEnabled) {
--- a/testing/marionette/driver/marionette_driver/geckoinstance.py
+++ b/testing/marionette/driver/marionette_driver/geckoinstance.py
@@ -26,20 +26,17 @@ class GeckoInstance(object):
         "browser.shell.checkDefaultBrowser": False,
         "browser.startup.page": 0,
         "browser.tabs.remote.autostart": False,
         "browser.tabs.remote.autostart.1": False,
         "browser.tabs.remote.autostart.2": False,
         "browser.urlbar.userMadeSearchSuggestionsChoice": True,
         "browser.warnOnQuit": False,
         "dom.ipc.reportProcessHangs": False,
-        "datareporting.healthreport.service.enabled": False,
         "datareporting.healthreport.uploadEnabled": False,
-        "datareporting.healthreport.service.firstRun": False,
-        "datareporting.healthreport.logging.consoleEnabled": False,
         "datareporting.policy.dataSubmissionEnabled": False,
         "datareporting.policy.dataSubmissionPolicyAccepted": False,
         "focusmanager.testmode": True,
         "startup.homepage_welcome_url": "about:blank",
         "toolkit.telemetry.enabled": False,
     }
 
     def __init__(self, host, port, bin, profile=None, addons=None,
--- a/toolkit/components/telemetry/TelemetryController.jsm
+++ b/toolkit/components/telemetry/TelemetryController.jsm
@@ -31,17 +31,16 @@ const LOGGER_NAME = "Toolkit.Telemetry";
 const LOGGER_PREFIX = "TelemetryController::";
 
 const PREF_BRANCH = "toolkit.telemetry.";
 const PREF_BRANCH_LOG = PREF_BRANCH + "log.";
 const PREF_SERVER = PREF_BRANCH + "server";
 const PREF_LOG_LEVEL = PREF_BRANCH_LOG + "level";
 const PREF_LOG_DUMP = PREF_BRANCH_LOG + "dump";
 const PREF_CACHED_CLIENTID = PREF_BRANCH + "cachedClientID";
-const PREF_FHR_ENABLED = "datareporting.healthreport.service.enabled";
 const PREF_FHR_UPLOAD_ENABLED = "datareporting.healthreport.uploadEnabled";
 const PREF_SESSIONS_BRANCH = "datareporting.sessions.";
 const PREF_UNIFIED = PREF_BRANCH + "unified";
 const PREF_UNIFIED_OPTIN = PREF_BRANCH + "unifiedIsOptIn";
 const PREF_OPTOUT_SAMPLE = PREF_BRANCH + "optoutSample";
 
 // Whether the FHR/Telemetry unification features are enabled.
 // Changing this pref requires a restart.
@@ -701,33 +700,30 @@ var Impl = {
       return this._delayedInitTaskDeferred.promise;
     }
 
     if (this._initialized && !this._testMode) {
       this._log.error("setupTelemetry - already initialized");
       return Promise.resolve();
     }
 
-    // Only initialize the session recorder if FHR is enabled.
-    // TODO: move this after the |enableTelemetryRecording| block and drop the
-    // PREF_FHR_ENABLED check once we permanently switch over to unified Telemetry.
-    if (!this._sessionRecorder &&
-        (Preferences.get(PREF_FHR_ENABLED, true) || IS_UNIFIED_TELEMETRY)) {
-      this._sessionRecorder = new SessionRecorder(PREF_SESSIONS_BRANCH);
-      this._sessionRecorder.onStartup();
-    }
-
     // This will trigger displaying the datachoices infobar.
     TelemetryReportingPolicy.setup();
 
     if (!this.enableTelemetryRecording()) {
       this._log.config("setupChromeProcess - Telemetry recording is disabled, skipping Chrome process setup.");
       return Promise.resolve();
     }
 
+    // Initialize the session recorder.
+    if (!this._sessionRecorder) {
+      this._sessionRecorder = new SessionRecorder(PREF_SESSIONS_BRANCH);
+      this._sessionRecorder.onStartup();
+    }
+
     this._attachObservers();
 
     // For very short session durations, we may never load the client
     // id from disk.
     // We try to cache it in prefs to avoid this, even though this may
     // lead to some stale client ids.
     this._clientID = ClientID.getCachedClientID();
 
rename from services/healthreport/healthreport-prefs.js
rename to toolkit/components/telemetry/healthreport-prefs.js
--- a/services/healthreport/healthreport-prefs.js
+++ b/toolkit/components/telemetry/healthreport-prefs.js
@@ -1,38 +1,12 @@
 #filter substitution
 /* 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/. */
 
-pref("datareporting.healthreport.currentDaySubmissionFailureCount", 0);
-pref("datareporting.healthreport.documentServerURI", "https://fhr.data.mozilla.com/");
-pref("datareporting.healthreport.documentServerNamespace", "metrics");
 pref("datareporting.healthreport.infoURL", "https://www.mozilla.org/legal/privacy/firefox.html#health-report");
-pref("datareporting.healthreport.logging.consoleEnabled", true);
-pref("datareporting.healthreport.logging.consoleLevel", "Warn");
-pref("datareporting.healthreport.logging.dumpEnabled", false);
-pref("datareporting.healthreport.logging.dumpLevel", "Debug");
-pref("datareporting.healthreport.lastDataSubmissionFailureTime", "0");
-pref("datareporting.healthreport.lastDataSubmissionRequestedTime", "0");
-pref("datareporting.healthreport.lastDataSubmissionSuccessfulTime", "0");
-pref("datareporting.healthreport.nextDataSubmissionTime", "0");
-pref("datareporting.healthreport.pendingDeleteRemoteData", false);
 
 // Health Report is enabled by default on all channels.
 pref("datareporting.healthreport.uploadEnabled", true);
 
-pref("datareporting.healthreport.service.enabled", true);
-pref("datareporting.healthreport.service.loadDelayMsec", 10000);
-pref("datareporting.healthreport.service.loadDelayFirstRunMsec", 60000);
-
-pref("datareporting.healthreport.service.providerCategories",
-#if MOZ_UPDATE_CHANNEL == release
-    "healthreport-js-provider-default"
-#elif MOZ_UPDATE_CHANNEL == default
-    "healthreport-js-provider-default"
-#else
-    "healthreport-js-provider-default,healthreport-js-provider-@MOZ_UPDATE_CHANNEL@"
-#endif
-    );
-
 pref("datareporting.healthreport.about.reportUrl", "https://fhr.cdn.mozilla.net/%LOCALE%/v4/");
 pref("datareporting.healthreport.about.reportUrlUnified", "https://fhr.cdn.mozilla.net/%LOCALE%/v4/");
--- a/toolkit/components/telemetry/tests/unit/test_TelemetryController.js
+++ b/toolkit/components/telemetry/tests/unit/test_TelemetryController.js
@@ -26,17 +26,16 @@ const TEST_PING_TYPE = "test-ping-type";
 const PLATFORM_VERSION = "1.9.2";
 const APP_VERSION = "1";
 const APP_NAME = "XPCShell";
 
 const PREF_BRANCH = "toolkit.telemetry.";
 const PREF_ENABLED = PREF_BRANCH + "enabled";
 const PREF_ARCHIVE_ENABLED = PREF_BRANCH + "archive.enabled";
 const PREF_FHR_UPLOAD_ENABLED = "datareporting.healthreport.uploadEnabled";
-const PREF_FHR_SERVICE_ENABLED = "datareporting.healthreport.service.enabled";
 const PREF_UNIFIED = PREF_BRANCH + "unified";
 const PREF_OPTOUT_SAMPLE = PREF_BRANCH + "optoutSample";
 
 var gClientID = null;
 
 function sendPing(aSendClientId, aSendEnvironment) {
   if (PingServer.started) {
     TelemetrySend.setServer("http://localhost:" + PingServer.port);
@@ -95,17 +94,16 @@ function run_test() {
   do_test_pending();
 
   // Addon manager needs a profile directory
   do_get_profile();
   loadAddonManager("xpcshell@tests.mozilla.org", "XPCShell", "1", "1.9.2");
 
   Services.prefs.setBoolPref(PREF_ENABLED, true);
   Services.prefs.setBoolPref(PREF_FHR_UPLOAD_ENABLED, true);
-  Services.prefs.setBoolPref(PREF_FHR_SERVICE_ENABLED, true);
 
   Telemetry.asyncFetchTelemetryData(wrapWithExceptionHandler(run_next_test));
 }
 
 add_task(function* asyncSetup() {
   yield TelemetryController.setup();
 
   gClientID = yield ClientID.getClientID();
--- a/toolkit/components/telemetry/tests/unit/test_TelemetryReportingPolicy.js
+++ b/toolkit/components/telemetry/tests/unit/test_TelemetryReportingPolicy.js
@@ -12,17 +12,16 @@ Cu.import("resource://gre/modules/Teleme
 Cu.import("resource://gre/modules/TelemetrySend.jsm", this);
 Cu.import("resource://gre/modules/TelemetryReportingPolicy.jsm", this);
 Cu.import("resource://gre/modules/TelemetryUtils.jsm", this);
 Cu.import("resource://gre/modules/Timer.jsm", this);
 Cu.import("resource://gre/modules/XPCOMUtils.jsm", this);
 
 const PREF_BRANCH = "toolkit.telemetry.";
 const PREF_SERVER = PREF_BRANCH + "server";
-const PREF_DRS_ENABLED = "datareporting.healthreport.service.enabled";
 
 const TEST_CHANNEL = "TestChannelABC";
 
 const PREF_POLICY_BRANCH = "datareporting.policy.";
 const PREF_BYPASS_NOTIFICATION = PREF_POLICY_BRANCH + "dataSubmissionPolicyBypassNotification";
 const PREF_DATA_SUBMISSION_ENABLED = PREF_POLICY_BRANCH + "dataSubmissionEnabled";
 const PREF_CURRENT_POLICY_VERSION = PREF_POLICY_BRANCH + "currentPolicyVersion";
 const PREF_MINIMUM_POLICY_VERSION = PREF_POLICY_BRANCH + "minimumPolicyVersion";
@@ -42,18 +41,16 @@ function fakeResetAcceptedPolicy() {
 }
 
 function run_test() {
   // Addon manager needs a profile directory
   do_get_profile(true);
   loadAddonManager("xpcshell@tests.mozilla.org", "XPCShell", "1", "1.9.2");
 
   Services.prefs.setBoolPref(PREF_TELEMETRY_ENABLED, true);
-  // We need to disable FHR in order to use the policy from telemetry.
-  Services.prefs.setBoolPref(PREF_DRS_ENABLED, false);
   // Don't bypass the notifications in this test, we'll fake it.
   Services.prefs.setBoolPref(PREF_BYPASS_NOTIFICATION, false);
 
   TelemetryReportingPolicy.setup();
 
   run_next_test();
 }
 
--- a/toolkit/components/telemetry/tests/unit/test_TelemetrySession.js
+++ b/toolkit/components/telemetry/tests/unit/test_TelemetrySession.js
@@ -58,17 +58,16 @@ const NUMBER_OF_THREADS_TO_LAUNCH = 30;
 var gNumberOfThreadsLaunched = 0;
 
 const MS_IN_ONE_HOUR  = 60 * 60 * 1000;
 const MS_IN_ONE_DAY   = 24 * MS_IN_ONE_HOUR;
 
 const PREF_BRANCH = "toolkit.telemetry.";
 const PREF_SERVER = PREF_BRANCH + "server";
 const PREF_FHR_UPLOAD_ENABLED = "datareporting.healthreport.uploadEnabled";
-const PREF_FHR_SERVICE_ENABLED = "datareporting.healthreport.service.enabled";
 
 const DATAREPORTING_DIR = "datareporting";
 const ABORTED_PING_FILE_NAME = "aborted-session-ping";
 const ABORTED_SESSION_UPDATE_INTERVAL_MS = 5 * 60 * 1000;
 
 XPCOMUtils.defineLazyGetter(this, "DATAREPORTING_PATH", function() {
   return OS.Path.join(OS.Constants.Path.profileDir, DATAREPORTING_DIR);
 });