Bug 1392874 - Force gSync initialization in browser_sync.js test. r=markh
authorEdouard Oger <eoger@fastmail.com>
Fri, 15 Sep 2017 11:28:19 -0700
changeset 665715 9cc10d12de94bda1dee61a03e0681f5e73df5ee6
parent 665714 f083cad6e8e6e96157ea3648062d62869caf04ef
child 665716 a6d9e37a9122e0848b67c072b7a101fe4b058716
push id80148
push userbmo:emilio@crisal.io
push dateFri, 15 Sep 2017 20:59:22 +0000
reviewersmarkh
bugs1392874
milestone57.0a1
Bug 1392874 - Force gSync initialization in browser_sync.js test. r=markh MozReview-Commit-ID: 9ZEK4dc6QEe
browser/base/content/test/sync/browser_sync.js
--- a/browser/base/content/test/sync/browser_sync.js
+++ b/browser/base/content/test/sync/browser_sync.js
@@ -1,13 +1,18 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
 
+add_task(function setup() {
+  // gSync.init() is called in a requestIdleCallback. Force its initialization.
+  gSync.init();
+});
+
 add_task(async function test_ui_state_notification_calls_updateAllUI() {
   let called = false;
   let updateAllUI = gSync.updateAllUI;
   gSync.updateAllUI = () => { called = true; };
 
   Services.obs.notifyObservers(null, UIState.ON_UPDATE);
   ok(called);