mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-12 00:50:40 +00:00
Bug 1589102 - Part 5: Fix tests that relied on about:blank loads happening instantenously, r=mattwoodrow
Differential Revision: https://phabricator.services.mozilla.com/D85083
This commit is contained in:
parent
46b53bc947
commit
aa5ab9056f
@ -23,10 +23,9 @@ add_task(async function() {
|
||||
info("Test tabs added in first window");
|
||||
|
||||
info("Open a second window");
|
||||
const windowOpenedPromise = BrowserTestUtils.waitForNewWindow();
|
||||
const win2 = OpenBrowserWindow();
|
||||
await new Promise(r => {
|
||||
win2.addEventListener("load", r, { capture: true, once: true });
|
||||
});
|
||||
await windowOpenedPromise;
|
||||
|
||||
info("Add test tabs in second window");
|
||||
const tab3 = await addTab(TEST_URI, { window: win2 });
|
||||
|
@ -55,8 +55,9 @@
|
||||
case 5: {
|
||||
opener.isnot(Math.round(window.scrollY), 0, "Should have scrolled to #hash.");
|
||||
opener.is(history.scrollRestoration, "manual", "Should have the same scrollRestoration mode as before fragment navigation.");
|
||||
window.onunload = function() {}; // Disable bfcache.
|
||||
opener.setTimeout("is(SpecialPowers.wrap(testWindow).history.scrollRestoration, 'auto'); SpecialPowers.wrap(testWindow).history.back();", 250);
|
||||
window.onunload = function() {
|
||||
opener.setTimeout("is(SpecialPowers.wrap(testWindow).history.scrollRestoration, 'auto'); SpecialPowers.wrap(testWindow).history.back();", 250);
|
||||
}; // Disable bfcache.
|
||||
window.location.href = "about:blank";
|
||||
break;
|
||||
}
|
||||
|
@ -70,7 +70,10 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=386782
|
||||
is(gTest.window.document.body.innerHTML, gTest.expectedBodyAfterEdit, "Editing failed.");
|
||||
|
||||
gTest.window.location = "about:blank";
|
||||
SimpleTest.waitForFocus(goBack, gTest.window);
|
||||
let cond = () => gTest.window.location.href == "about:blank";
|
||||
SimpleTest.waitForCondition(cond, () => {
|
||||
SimpleTest.waitForFocus(goBack, gTest.window, true);
|
||||
}, "about:blank never loaded");
|
||||
}
|
||||
|
||||
function goBack() {
|
||||
|
Loading…
Reference in New Issue
Block a user