mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-11 08:13:35 +00:00
Bug 1443964: Follow-up: Another attempt at fixing intermittent timing issue after removal of sync messaging from shims. r=bustage
MozReview-Commit-ID: 2WUsb7DIqk7 --HG-- extra : rebase_source : 77fece9b202594887d6bfde8ae1c43c6caf15301
This commit is contained in:
parent
0e2f1f5ab8
commit
7a34beaa0f
@ -31,13 +31,21 @@ function promiseNewTabSwitched() {
|
||||
});
|
||||
}
|
||||
|
||||
function promiseLoaded(browser) {
|
||||
return ContentTask.spawn(browser, undefined, async () => {
|
||||
if (!["interactive", "complete"].includes(content.document.readyState)) {
|
||||
await new Promise(resolve => addEventListener(
|
||||
"DOMContentLoaded", resolve, {once: true, capture: true}));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
async function testURL(url, loadFunc, endFunc) {
|
||||
let tabSwitchedPromise = promiseNewTabSwitched();
|
||||
let tab = gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser, undefined,
|
||||
{preferredRemoteType: "web"});
|
||||
let tab = gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser);
|
||||
let browser = gBrowser.selectedBrowser;
|
||||
|
||||
let pageshowPromise = BrowserTestUtils.waitForContentEvent(browser, "pageshow");
|
||||
let pageshowPromise = promiseLoaded(browser);
|
||||
|
||||
await tabSwitchedPromise;
|
||||
await pageshowPromise;
|
||||
|
Loading…
Reference in New Issue
Block a user