mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-10 11:55:49 +00:00
Backed out changeset 0cd289fcea16 (bug 876936) for failing in test_alarm_add_date.html
This commit is contained in:
parent
286c6df2aa
commit
7181ea0687
@ -394,6 +394,13 @@ this.AlarmService = {
|
||||
}
|
||||
|
||||
aNewAlarm['timezoneOffset'] = this._currentTimezoneOffset;
|
||||
let aNewAlarmTime = this._getAlarmTime(aNewAlarm);
|
||||
if (aNewAlarmTime <= Date.now()) {
|
||||
debug("Adding a alarm that has past time.");
|
||||
this._debugCurrentAlarm();
|
||||
aErrorCb("InvalidStateError");
|
||||
return;
|
||||
}
|
||||
|
||||
this._db.add(
|
||||
aNewAlarm,
|
||||
@ -417,7 +424,6 @@ this.AlarmService = {
|
||||
// If the new alarm is earlier than the current alarm, swap them and
|
||||
// push the previous alarm back to queue.
|
||||
let alarmQueue = this._alarmQueue;
|
||||
let aNewAlarmTime = this._getAlarmTime(aNewAlarm);
|
||||
let currentAlarmTime = this._getAlarmTime(this._currentAlarm);
|
||||
if (aNewAlarmTime < currentAlarmTime) {
|
||||
alarmQueue.unshift(this._currentAlarm);
|
||||
|
@ -57,11 +57,11 @@
|
||||
domRequest.onsuccess = function(e) {
|
||||
navigator.mozAlarms.remove(e.target.result);
|
||||
|
||||
ok(true, "Should be able to add alarm for already past date, which should fire immediately.");
|
||||
ok(false, "Should not be able to add alarm for already past date.");
|
||||
testNull();
|
||||
};
|
||||
domRequest.onerror = function(e) {
|
||||
ok(false, "Unable to add alarm for yesterday.");
|
||||
ok(true, "Can't use past date when adding new alarm.");
|
||||
|
||||
// Errors as it should, on to the next test
|
||||
testNull();
|
||||
|
Loading…
Reference in New Issue
Block a user