Bug 1484373: Follow-up: Work around a new race in browser_webext_options. r=bustage
authorKris Maglione <maglione.k@gmail.com>
Thu, 23 Aug 2018 17:23:11 -0700
changeset 488350 602fa2f2e75da226a632f65700c9a1db8baf89ae
parent 488349 d1049dde16ddb13fbb7b05d362a028a9aa24839f
child 488351 701ceb33e3d751be2faa8bf1b99bd14d51f3eadb
push id9719
push userffxbld-merge
push dateFri, 24 Aug 2018 17:49:46 +0000
treeherdermozilla-beta@719ec98fba77 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbustage
bugs1484373
milestone63.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1484373: Follow-up: Work around a new race in browser_webext_options. r=bustage
toolkit/mozapps/extensions/test/browser/browser_webext_options.js
--- a/toolkit/mozapps/extensions/test/browser/browser_webext_options.js
+++ b/toolkit/mozapps/extensions/test/browser/browser_webext_options.js
@@ -26,23 +26,27 @@ async function runTest(installer) {
   await TestUtils.topicObserved(AddonManager.OPTIONS_NOTIFICATION_DISPLAYED,
                                 (subject, data) => data == id);
 
   is(mgrWindow.gViewController.currentViewId,
      `addons://detail/${encodeURIComponent(id)}/preferences`,
      "Current view should scroll to preferences");
 
   var browser = mgrWindow.document.querySelector("#detail-grid > rows > stack > .inline-options-browser");
+  ok(browser, "Grid should have a browser descendant");
+  is(browser.localName, "browser", "Grid should have a browser descendant");
+
   var rows = browser.parentNode;
 
-  let url = await ContentTask.spawn(browser, {}, () => content.location.href);
-
-  ok(browser, "Grid should have a browser descendant");
-  is(browser.localName, "browser", "Grid should have a browser descendant");
-  is(url, element.mAddon.optionsURL, "Browser has the expected options URL loaded");
+  await ContentTask.spawn(browser, element.mAddon.optionsURL,
+                          async url => {
+    await ContentTaskUtils.waitForCondition(() =>
+      content.location.href == url,
+      "Browser has the expected options URL loaded");
+  });
 
   is(browser.clientWidth, browser.parentNode.clientWidth,
      "Browser should be the same width as its direct parent");
   is(browser.clientWidth, rows.clientWidth,
      "Browser should be the same width as its rows ancestor");
 
   button = mgrWindow.document.getElementById("detail-prefs-btn");
   is_element_hidden(button, "Preferences button should not be visible");