Bug 1342298 - Synchronize with the loaded event for the newly added tab then start the test. r=ckerschb

MozReview-Commit-ID: J6SqlfaOKGz

--HG--
extra : rebase_source : cb8a7307b3be020bca015ecb8f070bc8ce3fd9ff
extra : source : b55b540784eed360c07cda18336a58c0c078a88e
This commit is contained in:
Henry Chang 2017-08-21 10:49:15 +08:00
parent 4950f839d2
commit 1e70c180b1

View File

@ -29,11 +29,13 @@ function test() {
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