Bug 1369092 - Listen to onverified events in UIState. r?markh
MozReview-Commit-ID: 8nfmpaz9obF
--- a/services/sync/modules/UIState.jsm
+++ b/services/sync/modules/UIState.jsm
@@ -25,16 +25,17 @@ XPCOMUtils.defineLazyModuleGetter(this,
const TOPICS = [
"weave:service:login:change",
"weave:service:login:error",
"weave:service:ready",
"weave:service:sync:start",
"weave:service:sync:finish",
"weave:service:sync:error",
+ "fxaccounts:onverified",
"fxaccounts:onlogin", // Defined in FxAccountsCommon, pulling it is expensive.
"fxaccounts:onlogout",
"fxaccounts:profilechange",
];
const ON_UPDATE = "sync-ui-state:update"
const STATUS_NOT_CONFIGURED = "not_configured";
--- a/services/sync/tests/unit/test_uistate.js
+++ b/services/sync/tests/unit/test_uistate.js
@@ -164,18 +164,19 @@ add_task(async function test_refreshStat
loginFailed.restore();
UIStateInternal.fxAccounts = fxAccountsOrig;
});
add_task(async function test_observer_refreshState() {
let refreshState = sinon.spy(UIStateInternal, "refreshState");
let shouldRefresh = ["weave:service:login:change", "weave:service:login:error",
- "weave:service:ready", "fxaccounts:onlogin",
- "fxaccounts:onlogout", "fxaccounts:profilechange"];
+ "weave:service:ready", "fxaccounts:onverified",
+ "fxaccounts:onlogin", "fxaccounts:onlogout",
+ "fxaccounts:profilechange"];
for (let topic of shouldRefresh) {
let uiUpdateObserved = observeUIUpdate();
Services.obs.notifyObservers(null, topic);
await uiUpdateObserved;
ok(refreshState.calledOnce);
refreshState.reset();
}