Bug 1356507 - Workaround defineLazyServiceGetter() as described in bug 1361929, r=mikedeboer
authorTimothy Guan-tin Chien <timdream@gmail.com>
Thu, 04 May 2017 11:33:16 +0800
changeset 573143 7b179818adc232a404cc46edc8cbee994397bef1
parent 573142 28a9741054a2e3d03ea4a0d51c740462edb8167d
child 573144 68543862570f6c8f97754a4ba44cb17f7711ab38
push id57306
push userbmo:emilio+bugs@crisal.io
push dateFri, 05 May 2017 10:08:55 +0000
reviewersmikedeboer
bugs1356507, 1361929
milestone55.0a1
Bug 1356507 - Workaround defineLazyServiceGetter() as described in bug 1361929, r=mikedeboer MozReview-Commit-ID: Ixwr8RNwJzJ
browser/components/preferences/in-content/tests/browser_advanced_update.js
--- a/browser/components/preferences/in-content/tests/browser_advanced_update.js
+++ b/browser/components/preferences/in-content/tests/browser_advanced_update.js
@@ -105,24 +105,29 @@ add_task(function*() {
   ok(!enableSearchUpdate.checked, "Ensure search updates are disabled");
   Services.prefs.setBoolPref("browser.search.update", true);
   ok(enableSearchUpdate.checked, "Ensure search updates are enabled");
 
   gBrowser.removeCurrentTab();
 });
 
 add_task(function*() {
-  mockUpdateManager.register();
-
   yield openPreferencesViaOpenPreferencesAPI("advanced", { leaveOpen: true });
   let doc = gBrowser.selectedBrowser.contentDocument;
 
   let showBtn = doc.getElementById("showUpdateHistory");
   let dialogOverlay = doc.getElementById("dialogOverlay");
 
+  // XXX: For unknown reasons, this mock cannot be loaded by
+  // XPCOMUtils.defineLazyServiceGetter() called in aboutDialog-appUpdater.js.
+  // It is registered here so that we could assert update history subdialog
+  // without stopping the preferences advanced pane from loading.
+  // See bug 1361929.
+  mockUpdateManager.register();
+
   // Test the dialog window opens
   is(dialogOverlay.style.visibility, "", "The dialog should be invisible");
   showBtn.doCommand();
   yield promiseLoadSubDialog("chrome://mozapps/content/update/history.xul");
   is(dialogOverlay.style.visibility, "visible", "The dialog should be visible");
 
   let dialogFrame = doc.getElementById("dialogFrame");
   let frameDoc = dialogFrame.contentDocument;