mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 953282 - Fix idle observer notification, after Bug 715041 broke in-tree consumers. r=gps
This commit is contained in:
parent
0667d316ba
commit
959f982c17
@ -218,7 +218,7 @@ SyncScheduler.prototype = {
|
||||
// were just active.)
|
||||
this.adjustSyncInterval();
|
||||
break;
|
||||
case "back":
|
||||
case "active":
|
||||
this._log.trace("Received notification that we're back from idle.");
|
||||
this.idle = false;
|
||||
Utils.namedTimer(function onBack() {
|
||||
|
@ -270,7 +270,7 @@ add_identity_test(this, function test_back_triggers_sync() {
|
||||
|
||||
// Single device: no sync triggered.
|
||||
scheduler.idle = true;
|
||||
scheduler.observe(null, "back", Svc.Prefs.get("scheduler.idleTime"));
|
||||
scheduler.observe(null, "active", Svc.Prefs.get("scheduler.idleTime"));
|
||||
do_check_false(scheduler.idle);
|
||||
|
||||
// Multiple devices: sync is triggered.
|
||||
@ -291,7 +291,7 @@ add_identity_test(this, function test_back_triggers_sync() {
|
||||
});
|
||||
|
||||
scheduler.idle = true;
|
||||
scheduler.observe(null, "back", Svc.Prefs.get("scheduler.idleTime"));
|
||||
scheduler.observe(null, "active", Svc.Prefs.get("scheduler.idleTime"));
|
||||
do_check_false(scheduler.idle);
|
||||
yield deferred.promise;
|
||||
});
|
||||
|
@ -638,12 +638,12 @@ add_identity_test(this, function test_back_triggersSync() {
|
||||
cleanUpAndGo().then(deferred.resolve);
|
||||
});
|
||||
|
||||
// Send a 'back' event to trigger sync soonish.
|
||||
scheduler.observe(null, "back", Svc.Prefs.get("scheduler.idleTime"));
|
||||
// Send an 'active' event to trigger sync soonish.
|
||||
scheduler.observe(null, "active", Svc.Prefs.get("scheduler.idleTime"));
|
||||
yield deferred.promise;
|
||||
});
|
||||
|
||||
add_identity_test(this, function test_back_triggersSync_observesBackoff() {
|
||||
add_identity_test(this, function test_active_triggersSync_observesBackoff() {
|
||||
// Confirm defaults.
|
||||
do_check_false(scheduler.idle);
|
||||
|
||||
@ -669,8 +669,8 @@ add_identity_test(this, function test_back_triggersSync_observesBackoff() {
|
||||
cleanUpAndGo().then(deferred.resolve);
|
||||
}, IDLE_OBSERVER_BACK_DELAY * 1.5, {}, "timer");
|
||||
|
||||
// Send a 'back' event to try to trigger sync soonish.
|
||||
scheduler.observe(null, "back", Svc.Prefs.get("scheduler.idleTime"));
|
||||
// Send an 'active' event to try to trigger sync soonish.
|
||||
scheduler.observe(null, "active", Svc.Prefs.get("scheduler.idleTime"));
|
||||
yield deferred.promise;
|
||||
});
|
||||
|
||||
@ -691,7 +691,7 @@ add_identity_test(this, function test_back_debouncing() {
|
||||
Svc.Obs.add("weave:service:login:start", onLoginStart);
|
||||
|
||||
// Create spurious back-then-idle events as observed on OS X:
|
||||
scheduler.observe(null, "back", Svc.Prefs.get("scheduler.idleTime"));
|
||||
scheduler.observe(null, "active", Svc.Prefs.get("scheduler.idleTime"));
|
||||
scheduler.observe(null, "idle", Svc.Prefs.get("scheduler.idleTime"));
|
||||
|
||||
let deferred = Promise.defer();
|
||||
|
Loading…
Reference in New Issue
Block a user