Bug 1300884 follow-up: Remove browser_alarms.js, landed on a CLOSED TREE
authorEhsan Akhgari <ehsan@mozilla.com>
Wed, 07 Sep 2016 15:21:46 -0400
changeset 313088 7452e706f98556cec41158761f700b84d726ec98
parent 313087 319788a816f33f7275ba129977cb0378b26ed6a5
child 313089 3f6286f7ce480c890cfe5a97149dfc86bff797b7
child 313148 b931a44e54db7ca114b54c2333efcaef9dcc0f2c
push id20479
push userkwierso@gmail.com
push dateThu, 08 Sep 2016 01:08:46 +0000
treeherderfx-team@fb7c6b034329 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1300884
milestone51.0a1
Bug 1300884 follow-up: Remove browser_alarms.js, landed on a CLOSED TREE
hal/moz.build
hal/tests/browser.ini
hal/tests/browser_alarms.js
hal/tests/moz.build
--- a/hal/moz.build
+++ b/hal/moz.build
@@ -15,17 +15,16 @@ EXPORTS.mozilla += [
     'HalImpl.h',
     'HalSandbox.h',
     'HalScreenConfiguration.h',
     'HalSensor.h',
     'HalTypes.h',
     'HalWakeLock.h',
 ]
 
-TEST_DIRS += ['tests']
 UNIFIED_SOURCES += [
     'HalWakeLock.cpp',
     'sandbox/SandboxHal.cpp',
     'WindowIdentifier.cpp',
 ]
 
 # Hal.cpp cannot be built in unified mode because it relies on HalImpl.h.
 SOURCES += [
deleted file mode 100644
--- a/hal/tests/browser.ini
+++ /dev/null
@@ -1,3 +0,0 @@
-[DEFAULT]
-
-[browser_alarms.js]
deleted file mode 100644
--- a/hal/tests/browser_alarms.js
+++ /dev/null
@@ -1,187 +0,0 @@
-XPCOMUtils.defineLazyModuleGetter(this, "AlarmService",
-                                  "resource://gre/modules/AlarmService.jsm");
-
-/*
- * Tests for Bug 867868 and related Alarm API bugs.
- *
- * NOTE: These tests pass the alarm time to AlarmService as a number and not as
- * a date. See bug 810973 about Date truncating milliseconds. AlarmService does
- * not officially allow a integer, but nor does it disallow it. Of course this
- * test will break if AlarmService adds a type check, hence this note.
- * FIXME: when bug 810973 is fixed.
- */
-
-function add_alarm_future(cb) {
-  let alarmId = undefined;
-  AlarmService.add({
-    date: new Date(Date.now() + 143),
-    ignoreTimezone: true
-  },
-  function onAlarmFired(aAlarm) {
-    ok(alarmId === aAlarm.id, "Future alarm fired successfully.");
-    cb();
-  },
-  function onSuccess(aAlarmId) {
-    alarmId = aAlarmId;
-  },
-  function onError(error) {
-    ok(false, "Unexpected error adding future alarm " + error);
-    cb();
-  });
-}
-
-function add_alarm_present(cb) {
-  let self = this;
-  let alarmId = undefined;
-  AlarmService.add({
-    date: new Date(),
-    ignoreTimezone: true
-  },
-  function onAlarmFired(aAlarm) {
-    ok(alarmId === aAlarm.id, "Present alarm fired successfully.");
-    cb();
-  },
-  function onSuccess(aAlarmId) {
-    alarmId = aAlarmId;
-  }, function onError(error) {
-    ok(false, "Unexpected error adding alarm for current time " + error);
-    cb();
-  });
-}
-
-function add_alarm_past(cb) {
-  let self = this;
-  let alarmId = undefined;
-  AlarmService.add({
-    date: new Date(Date.now() - 5),
-    ignoreTimezone: true
-  },
-  function onAlarmFired(aAlarm) {
-    ok(alarmId === aAlarm.id, "Past alarm fired successfully.");
-    cb();
-  },
-  function onSuccess(aAlarmId) {
-    alarmId = aAlarmId;
-  },
-  function onError(error) {
-    ok(false, "Unexpected error adding alarm for time in the past " + error);
-    cb();
-  });
-}
-
-function trigger_all_alarms(cb) {
-  let n = 10;
-  let counter = 0;
-  let date = new Date(Date.now() + 57);
-  function onAlarmFired() {
-    counter++;
-    info("trigger_all_alarms count " + counter);
-    if (counter == n) {
-      ok(true, "All " + n + " alarms set to a particular time fired.");
-      cb();
-    }
-  }
-
-  for (let i = 0; i < n; i++) {
-    AlarmService.add(
-      {
-        date: date,
-        ignoreTimezone: true
-      },
-      onAlarmFired
-    );
-  }
-}
-
-function multiple_handlers(cb) {
-  let d = new Date(Date.now() + 100);
-  let called = 0;
-
-  function done() {
-    if (called == 2) {
-      ok(true, "Two alarms for the same time fired.");
-      cb();
-    }
-  }
-
-  function handler1() {
-    called++;
-    done();
-  }
-
-  function handler2() {
-    called++;
-    done();
-  }
-
-  AlarmService.add(
-    {
-      date: d,
-      ignoreTimezone: true
-    },
-    handler1
-  );
-  AlarmService.add(
-    {
-      date: d,
-      ignoreTimezone: true
-    },
-    handler2
-  );
-}
-
-function same_time_alarms(cb) {
-  var fired = 0;
-  var delay = new Date(Date.now() + 100);
-
-  function check() {
-    fired++;
-    if (fired == 4) {
-      ok(true, "All alarms set for the same time fired.");
-      cb();
-    }
-  }
-
-  function addImmediateAlarm() {
-    fired++;
-    AlarmService.add({
-      date: delay,
-      ignoreTimezone: true
-    }, check);
-  }
-
-  AlarmService.add({
-    date: delay,
-    ignoreTimezone: true
-  }, addImmediateAlarm);
-
-  AlarmService.add({
-    date: delay,
-    ignoreTimezone: true
-  }, addImmediateAlarm);
-}
-
-function test() {
-  var tests = [
-    add_alarm_future,
-    add_alarm_present,
-    add_alarm_past,
-    trigger_all_alarms,
-    multiple_handlers,
-    same_time_alarms
-  ]
-
-  var testIndex = -1;
-  function nextTest() {
-    testIndex++;
-    if (testIndex >= tests.length)
-      return;
-
-    waitForExplicitFinish();
-    tests[testIndex](function() {
-      finish();
-      nextTest();
-    });
-  }
-  nextTest();
-}
deleted file mode 100644
--- a/hal/tests/moz.build
+++ /dev/null
@@ -1,6 +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/.
-
-BROWSER_CHROME_MANIFESTS += ['browser.ini']
-