Bug 1392874 - Force gSync initialization in browser_sync.js test. r?markh draft
authorEdouard Oger <eoger@fastmail.com>
Fri, 15 Sep 2017 11:28:19 -0700
changeset 665598 b42a99aeb7fadfb2e41d2f75094da682b3afca3b
parent 665597 31992a5c3d64ade078accdaab8ac4ffb5e43a9d7
child 731831 a12d8cf6359d746fb6db15d676c3a3517ff3ed41
push id80115
push userbmo:eoger@fastmail.com
push dateFri, 15 Sep 2017 18:29:01 +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);