Backed out changeset 208c445781e7 (bug 1143796)
authorWes Kocher <wkocher@mozilla.com>
Fri, 27 Mar 2015 15:31:09 -0700
changeset 236173 0088f4d79422d87f86073c266e22edf72da5203c
parent 236172 b482ca2ea198d4b80fa797fc50fc0d115243e4be
child 236174 f72e41028cf0c481638b63223be7195c552bce14
push id12053
push userkwierso@gmail.com
push dateFri, 27 Mar 2015 22:31:53 +0000
treeherderfx-team@ae8e6c0aea7e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1143796
milestone39.0a1
backs out208c445781e79f72d7a7a1261d03fbadda246d8b
Backed out changeset 208c445781e7 (bug 1143796)
toolkit/components/telemetry/tests/unit/test_TelemetrySession.js
--- a/toolkit/components/telemetry/tests/unit/test_TelemetrySession.js
+++ b/toolkit/components/telemetry/tests/unit/test_TelemetrySession.js
@@ -132,21 +132,16 @@ function wrapWithExceptionHandler(f) {
 }
 
 function fakeGenerateUUID(sessionFunc, subsessionFunc) {
   let session = Cu.import("resource://gre/modules/TelemetrySession.jsm");
   session.Policy.generateSessionUUID = sessionFunc;
   session.Policy.generateSubsessionUUID = subsessionFunc;
 }
 
-function fakeIdleNotification(topic) {
-  let session = Cu.import("resource://gre/modules/TelemetrySession.jsm");
-  session.TelemetryScheduler.observe(null, topic, null);
-}
-
 function registerPingHandler(handler) {
   gHttpServer.registerPrefixHandler("/submit/telemetry/",
 				   wrapWithExceptionHandler(handler));
 }
 
 function setupTestData() {
   Telemetry.newHistogram(IGNORE_HISTOGRAM, "never", Telemetry.HISTOGRAM_BOOLEAN);
   Telemetry.histogramFrom(IGNORE_CLONED_HISTOGRAM, IGNORE_HISTOGRAM_TO_CLONE);
@@ -1615,49 +1610,16 @@ add_task(function* test_pingExtendedStat
   }
 
   Assert.ok("addonManager" in ping.payload.simpleMeasurements,
             "addonManager must be sent if the extended set is on.");
   Assert.ok("UITelemetry" in ping.payload.simpleMeasurements,
             "UITelemetry must be sent if the extended set is on.");
 });
 
-add_task(function* test_schedulerUserIdle() {
-  if (gIsAndroid || gIsGonk) {
-    // We don't have the aborted session or the daily ping here.
-    return;
-  }
-
-  const SCHEDULER_TICK_INTERVAL_MS = 5 * 60 * 1000;
-  const SCHEDULER_TICK_IDLE_INTERVAL_MS = 60 * 60 * 1000;
-
-  let schedulerTimeout = 0;
-  fakeSchedulerTimer((callback, timeout) => {
-    schedulerTimeout = timeout;
-  }, () => {});
-  yield TelemetrySession.reset();
-
-  // When not idle, the scheduler should have a 5 minutes tick interval.
-  Assert.equal(schedulerTimeout, SCHEDULER_TICK_INTERVAL_MS);
-
-  // Send an "idle" notification to the scheduler.
-  fakeIdleNotification("idle");
-
-  // When idle, the scheduler should have a 1hr tick interval.
-  Assert.equal(schedulerTimeout, SCHEDULER_TICK_IDLE_INTERVAL_MS);
-
-  // Send an "active" notification to the scheduler.
-  fakeIdleNotification("active");
-
-  // When user is back active, the scheduler tick should be 5 minutes again.
-  Assert.equal(schedulerTimeout, SCHEDULER_TICK_INTERVAL_MS);
-
-  yield TelemetrySession.shutdown();
-});
-
 add_task(function* stopServer(){
   gHttpServer.stop(do_test_finished);
 });
 
 // An iterable sequence of http requests
 function Request() {
   let defers = [];
   let current = 0;