Bug 1589102 - Part 12: Fix file_scrollRestoration.html to wait for about:blank to load before proceeding, r=peterv

Differential Revision: https://phabricator.services.mozilla.com/D87933
This commit is contained in:
Anny Gakhokidze 2020-08-28 17:21:14 +00:00
parent f90a2a6d1e
commit 52ff3841e4
2 changed files with 9 additions and 1 deletions

View File

@ -39,7 +39,7 @@
opener.is(history.scrollRestoration, "manual", "Should have the same scrollRestoration as before reload.");
document.getElementById("bottom").scrollIntoView();
window.onunload = null; // Should get bfcache behavior.
opener.setTimeout("SpecialPowers.wrap(testWindow).history.back();", 250);
window.opener.case3WaitForBlank();
window.location.href = "about:blank";
break;
}

View File

@ -54,6 +54,14 @@ function nextTest_() {
}
}
async function case3WaitForBlank() {
let loaded = SimpleTest.promiseWaitForCondition(() => {
return testWindow.location.href == "about:blank";
});
await loaded;
SpecialPowers.wrap(testWindow).history.back();
}
function nextTest() {
setTimeout(nextTest_, 0);
}