Bug 1453723 - ensure we wait for the correct load, r=bgrins
authorGijs Kruitbosch <gijskruitbosch@gmail.com>
Fri, 24 Aug 2018 16:30:11 +0000
changeset 491093 6617fb3e1363b3c67c9d9223297f68c003840614
parent 491092 17ffad06d94fa4b2753fd7324c96303d50b78c7f
child 491094 f83d8d85c94f2d1cab19085ec1662808def93fe9
push id1815
push userffxbld-merge
push dateMon, 15 Oct 2018 10:40:45 +0000
treeherdermozilla-release@18d4c09e9378 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbgrins
bugs1453723
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 1453723 - ensure we wait for the correct load, r=bgrins Waiting for the browser to have switched remoteness before waiting for it to load the non-about:preferences page should be enough to address this orange. Differential Revision: https://phabricator.services.mozilla.com/D4208
browser/base/content/test/urlbar/browser_urlbarAboutHomeLoading.js
--- a/browser/base/content/test/urlbar/browser_urlbarAboutHomeLoading.js
+++ b/browser/base/content/test/urlbar/browser_urlbarAboutHomeLoading.js
@@ -11,16 +11,19 @@ add_task(async function clearURLBarAfter
   let tab = await new Promise(resolve => {
     gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser, "about:preferences");
     let newTabBrowser = gBrowser.getBrowserForTab(gBrowser.selectedTab);
     newTabBrowser.addEventListener("Initialized", async function() {
       resolve(gBrowser.selectedTab);
     }, {capture: true, once: true});
   });
   document.getElementById("home-button").click();
+  if (!tab.linkedBrowser.isRemoteBrowser) {
+    await BrowserTestUtils.waitForEvent(tab.linkedBrowser, "XULFrameLoaderCreated");
+  }
   await BrowserTestUtils.browserLoaded(tab.linkedBrowser);
   is(gURLBar.value, "", "URL bar should be empty");
   is(tab.linkedBrowser.userTypedValue, null, "The browser should have no recorded userTypedValue");
   BrowserTestUtils.removeTab(tab);
 });
 
 /**
  * Same as above, but open the tab without passing the URL immediately
@@ -31,16 +34,19 @@ add_task(async function clearURLBarAfter
     gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser);
     let newTabBrowser = gBrowser.getBrowserForTab(gBrowser.selectedTab);
     newTabBrowser.addEventListener("Initialized", async function() {
       resolve(gBrowser.selectedTab);
     }, {capture: true, once: true});
     newTabBrowser.loadURI("about:preferences");
   });
   document.getElementById("home-button").click();
+  if (!tab.linkedBrowser.isRemoteBrowser) {
+    await BrowserTestUtils.waitForEvent(tab.linkedBrowser, "XULFrameLoaderCreated");
+  }
   await BrowserTestUtils.browserLoaded(tab.linkedBrowser);
   is(gURLBar.value, "", "URL bar should be empty");
   is(tab.linkedBrowser.userTypedValue, null, "The browser should have no recorded userTypedValue");
   BrowserTestUtils.removeTab(tab);
 });
 
 /**
  * Load about:home directly from an about:newtab page. Because it is an