Bug 1397744 - Show the Sync animation immediately after clicking the manual sync button. r=markh

MozReview-Commit-ID: AIBjAZZlYX6
This commit is contained in:
Edouard Oger
2017-09-20 13:16:19 -04:00
parent 47b6d7b390
commit 84e93c925e
2 changed files with 6 additions and 0 deletions

View File

@@ -524,6 +524,7 @@ var gSync = {
}
const state = UIState.get();
if (state.status == UIState.STATUS_SIGNED_IN) {
this.updateSyncStatus({ syncing: true });
setTimeout(() => Weave.Service.errorHandler.syncAndReportErrors(), 0);
}
},

View File

@@ -7,6 +7,7 @@
requestLongerTimeout(2);
let {SyncedTabs} = Cu.import("resource://services-sync/SyncedTabs.jsm", {});
Cu.import("resource://services-sync/UIState.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "UITour", "resource:///modules/UITour.jsm");
@@ -48,8 +49,12 @@ add_task(async function setup() {
for (let id of ["sync-reauth-state", "sync-setup-state", "sync-syncnow-state"]) {
initialObserverStates[id] = document.getElementById(id).hidden;
}
let origNotifyStateUpdated = UIState._internal.notifyStateUpdated;
// Sync start-up will interfere with our tests, don't let UIState send UI updates.
UIState._internal.notifyStateUpdated = () => {};
registerCleanupFunction(() => {
UIState._internal.notifyStateUpdated = origNotifyStateUpdated;
SyncedTabs._internal = oldInternal;
for (let [id, initial] of Object.entries(initialObserverStates)) {
document.getElementById(id).hidden = initial;