From f8c04474bfc8d3c8bdf4d37ab39e946dbf1072d5 Mon Sep 17 00:00:00 2001 From: Ryan VanderMeulen Date: Wed, 7 Jan 2015 14:02:22 -0500 Subject: [PATCH] Backed out changeset 63f90f467985 (bug 1106122) for xpcshell orange. CLOSED TREE --- .../datareporting/DataReportingService.js | 9 -------- .../components/telemetry/TelemetryPing.jsm | 11 --------- .../tests/unit/test_TelemetryPing.js | 23 ------------------- 3 files changed, 43 deletions(-) diff --git a/services/datareporting/DataReportingService.js b/services/datareporting/DataReportingService.js index 25b3abfee14..8f41632114d 100644 --- a/services/datareporting/DataReportingService.js +++ b/services/datareporting/DataReportingService.js @@ -391,15 +391,6 @@ DataReportingService.prototype = Object.freeze({ return this._clientID; }), - /** - * Returns the SessionRecorder instance associated with the data reporting service. - * Returns an actual object only if FHR is enabled and after initialization, - * else returns undefined. - */ - getSessionRecorder: function() { - return this.sessionRecorder; - }, - /* * Simulate a restart of the service. This is for testing only. */ diff --git a/toolkit/components/telemetry/TelemetryPing.jsm b/toolkit/components/telemetry/TelemetryPing.jsm index 54a2dd9d20d..0c3603c28cf 100644 --- a/toolkit/components/telemetry/TelemetryPing.jsm +++ b/toolkit/components/telemetry/TelemetryPing.jsm @@ -372,17 +372,6 @@ let Impl = { ret.savedPings = TelemetryFile.pingsLoaded; } - ret.activeTicks = -1; - if ("@mozilla.org/datareporting/service;1" in Cc) { - let drs = Cc["@mozilla.org/datareporting/service;1"] - .getService(Ci.nsISupports) - .wrappedJSObject; - - let sr = drs.getSessionRecorder(); - if (sr) - ret.activeTicks = sr.activeTicks; - } - ret.pingsOverdue = TelemetryFile.pingsOverdue; ret.pingsDiscarded = TelemetryFile.pingsDiscarded; diff --git a/toolkit/components/telemetry/tests/unit/test_TelemetryPing.js b/toolkit/components/telemetry/tests/unit/test_TelemetryPing.js index 750dadb962b..f23cd42c3e8 100644 --- a/toolkit/components/telemetry/tests/unit/test_TelemetryPing.js +++ b/toolkit/components/telemetry/tests/unit/test_TelemetryPing.js @@ -45,7 +45,6 @@ let gNumberOfThreadsLaunched = 0; const PREF_BRANCH = "toolkit.telemetry."; const PREF_ENABLED = PREF_BRANCH + "enabled"; const PREF_FHR_UPLOAD_ENABLED = "datareporting.healthreport.uploadEnabled"; -const PREF_FHR_SERVICE_ENABLED = "datareporting.healthreport.service.enabled"; const Telemetry = Cc["@mozilla.org/base/telemetry;1"].getService(Ci.nsITelemetry); @@ -220,7 +219,6 @@ function checkPayload(request, reason, successfulPings) { do_check_eq(payload.simpleMeasurements.savedPings, 1); do_check_true("maximalNumberOfConcurrentThreads" in payload.simpleMeasurements); do_check_true(payload.simpleMeasurements.maximalNumberOfConcurrentThreads >= gNumberOfThreadsLaunched); - do_check_true(payload.simpleMeasurements.activeTicks >= 0); do_check_eq(payload.simpleMeasurements.failedProfileLockCount, FAILED_PROFILE_LOCK_ATTEMPTS); @@ -434,11 +432,6 @@ function run_test() { // If we can't test gfxInfo, that's fine, we'll note it later. } - // make sure getSessionRecorder() can be called before the DRS init. - // It's not a requirement that it returns undefined, but that's how it behaves - // now - so just let this test fail if this behavior changes. - do_check_true(gDatareportingService.getSessionRecorder() === undefined); - // Addon manager needs a profile directory do_get_profile(); createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1.9.2"); @@ -446,9 +439,6 @@ function run_test() { Services.prefs.setBoolPref(PREF_ENABLED, true); Services.prefs.setBoolPref(PREF_FHR_UPLOAD_ENABLED, true); - // Initially disable FHR to verify that activeTicks ends up as -1 - Services.prefs.setBoolPref(PREF_FHR_SERVICE_ENABLED, false); - // Send the needed startup notifications to the datareporting service // to ensure that it has been initialized. if ("@mozilla.org/datareporting/service;1" in Cc) { @@ -505,19 +495,6 @@ function actualTest() { add_task(function* asyncSetup() { yield TelemetryPing.setup(); - // When FHR is disabled, the payload's activeTicks should be -1. - do_check_true(TelemetryPing.getPayload().simpleMeasurements.activeTicks == -1); - - // re-enable FHR and re-init the DRS. - // Note: this relies on the fact that the data reporting service reinitializes - // itself when calling its 'observe' method, without checking if it's already - // initialized. If this DRS behavior changes, this test would need to be adapted. - Services.prefs.setBoolPref(PREF_FHR_SERVICE_ENABLED, true); - if ("@mozilla.org/datareporting/service;1" in Cc) { - gDatareportingService.observe(null, "app-startup", null); - gDatareportingService.observe(null, "profile-after-change", null); - } - if ("@mozilla.org/datareporting/service;1" in Cc) { gDataReportingClientID = yield gDatareportingService.getClientID();