Bug 1342298 - Synchronize with the loaded event for the newly added tab then start the test. r=ckerschb
authorHenry Chang <hchang@mozilla.com>
Mon, 21 Aug 2017 10:49:15 +0800
changeset 375882 c89420075a23c0a10460d7bdd0dab16431a748fc
parent 375881 dab947ebf3bbe70191899bdf8af19e6075ff165e
child 375883 e07f7098f5c80bf856c3c0df64b0f25a845ef959
push id49221
push userhchang@mozilla.com
push dateMon, 21 Aug 2017 08:04:51 +0000
treeherderautoland@c89420075a23 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersckerschb
bugs1342298
milestone57.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 1342298 - Synchronize with the loaded event for the newly added tab then start the test. r=ckerschb MozReview-Commit-ID: J6SqlfaOKGz
dom/base/test/browser_bug902350.js
--- a/dom/base/test/browser_bug902350.js
+++ b/dom/base/test/browser_bug902350.js
@@ -24,21 +24,23 @@ function test() {
 
   origBlockActive = Services.prefs.getBoolPref(PREF_ACTIVE);
 
   Services.prefs.setBoolPref(PREF_ACTIVE, true);
 
   var newTab = BrowserTestUtils.addTab(gBrowser);
   gBrowser.selectedTab = newTab;
   gTestBrowser = gBrowser.selectedBrowser;
-  newTab.linkedBrowser.stop()
 
-  BrowserTestUtils.browserLoaded(gTestBrowser, true /*includeSubFrames*/).then(MixedTest1A);
-  var url = gHttpTestRoot + "file_bug902350.html";
-  gTestBrowser.loadURI(url);
+  BrowserTestUtils.browserLoaded(gTestBrowser).then(() => {
+    // about:blank is expected to be loaded here.
+    var url = gHttpTestRoot + "file_bug902350.html";
+    BrowserTestUtils.browserLoaded(gTestBrowser, true /*includeSubFrames*/).then(MixedTest1A);
+    gTestBrowser.loadURI(url);
+  });
 }
 
 // Need to capture 2 loads, one for the main page and one for the iframe
 function MixedTest1A() {
   BrowserTestUtils.browserLoaded(gTestBrowser, true /*includeSubFrames*/).then(MixedTest1B);
 }
 
 // Find the iframe and click the link in it