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
Родитель f90a2a6d1e
Коммит 52ff3841e4
2 изменённых файлов: 9 добавлений и 1 удалений

Просмотреть файл

@ -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;
}

Просмотреть файл

@ -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);
}