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
13ad4befe8
commit
be3a852b60
@ -218,7 +218,7 @@ SyncScheduler.prototype = {
|
|||||||
// were just active.)
|
// were just active.)
|
||||||
this.adjustSyncInterval();
|
this.adjustSyncInterval();
|
||||||
break;
|
break;
|
||||||
case "back":
|
case "active":
|
||||||
this._log.trace("Received notification that we're back from idle.");
|
this._log.trace("Received notification that we're back from idle.");
|
||||||
this.idle = false;
|
this.idle = false;
|
||||||
Utils.namedTimer(function onBack() {
|
Utils.namedTimer(function onBack() {
|
||||||
|
@ -270,7 +270,7 @@ add_identity_test(this, function test_back_triggers_sync() {
|
|||||||
|
|
||||||
// Single device: no sync triggered.
|
// Single device: no sync triggered.
|
||||||
scheduler.idle = true;
|
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);
|
do_check_false(scheduler.idle);
|
||||||
|
|
||||||
// Multiple devices: sync is triggered.
|
// Multiple devices: sync is triggered.
|
||||||
@ -291,7 +291,7 @@ add_identity_test(this, function test_back_triggers_sync() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
scheduler.idle = true;
|
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);
|
do_check_false(scheduler.idle);
|
||||||
yield deferred.promise;
|
yield deferred.promise;
|
||||||
});
|
});
|
||||||
|
@ -638,12 +638,12 @@ add_identity_test(this, function test_back_triggersSync() {
|
|||||||
cleanUpAndGo().then(deferred.resolve);
|
cleanUpAndGo().then(deferred.resolve);
|
||||||
});
|
});
|
||||||
|
|
||||||
// Send a 'back' event to trigger sync soonish.
|
// Send an 'active' event to trigger sync soonish.
|
||||||
scheduler.observe(null, "back", Svc.Prefs.get("scheduler.idleTime"));
|
scheduler.observe(null, "active", Svc.Prefs.get("scheduler.idleTime"));
|
||||||
yield deferred.promise;
|
yield deferred.promise;
|
||||||
});
|
});
|
||||||
|
|
||||||
add_identity_test(this, function test_back_triggersSync_observesBackoff() {
|
add_identity_test(this, function test_active_triggersSync_observesBackoff() {
|
||||||
// Confirm defaults.
|
// Confirm defaults.
|
||||||
do_check_false(scheduler.idle);
|
do_check_false(scheduler.idle);
|
||||||
|
|
||||||
@ -669,8 +669,8 @@ add_identity_test(this, function test_back_triggersSync_observesBackoff() {
|
|||||||
cleanUpAndGo().then(deferred.resolve);
|
cleanUpAndGo().then(deferred.resolve);
|
||||||
}, IDLE_OBSERVER_BACK_DELAY * 1.5, {}, "timer");
|
}, IDLE_OBSERVER_BACK_DELAY * 1.5, {}, "timer");
|
||||||
|
|
||||||
// Send a 'back' event to try to trigger sync soonish.
|
// Send an 'active' event to try to trigger sync soonish.
|
||||||
scheduler.observe(null, "back", Svc.Prefs.get("scheduler.idleTime"));
|
scheduler.observe(null, "active", Svc.Prefs.get("scheduler.idleTime"));
|
||||||
yield deferred.promise;
|
yield deferred.promise;
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -691,7 +691,7 @@ add_identity_test(this, function test_back_debouncing() {
|
|||||||
Svc.Obs.add("weave:service:login:start", onLoginStart);
|
Svc.Obs.add("weave:service:login:start", onLoginStart);
|
||||||
|
|
||||||
// Create spurious back-then-idle events as observed on OS X:
|
// 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"));
|
scheduler.observe(null, "idle", Svc.Prefs.get("scheduler.idleTime"));
|
||||||
|
|
||||||
let deferred = Promise.defer();
|
let deferred = Promise.defer();
|
||||||
|
Loading…
Reference in New Issue
Block a user