mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-03-03 23:30:46 +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("Test tabs added in first window");
|
||||||
|
|
||||||
info("Open a second window");
|
info("Open a second window");
|
||||||
|
const windowOpenedPromise = BrowserTestUtils.waitForNewWindow();
|
||||||
const win2 = OpenBrowserWindow();
|
const win2 = OpenBrowserWindow();
|
||||||
await new Promise(r => {
|
await windowOpenedPromise;
|
||||||
win2.addEventListener("load", r, { capture: true, once: true });
|
|
||||||
});
|
|
||||||
|
|
||||||
info("Add test tabs in second window");
|
info("Add test tabs in second window");
|
||||||
const tab3 = await addTab(TEST_URI, { window: win2 });
|
const tab3 = await addTab(TEST_URI, { window: win2 });
|
||||||
|
@ -55,8 +55,9 @@
|
|||||||
case 5: {
|
case 5: {
|
||||||
opener.isnot(Math.round(window.scrollY), 0, "Should have scrolled to #hash.");
|
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.");
|
opener.is(history.scrollRestoration, "manual", "Should have the same scrollRestoration mode as before fragment navigation.");
|
||||||
window.onunload = function() {}; // Disable bfcache.
|
window.onunload = function() {
|
||||||
opener.setTimeout("is(SpecialPowers.wrap(testWindow).history.scrollRestoration, 'auto'); SpecialPowers.wrap(testWindow).history.back();", 250);
|
opener.setTimeout("is(SpecialPowers.wrap(testWindow).history.scrollRestoration, 'auto'); SpecialPowers.wrap(testWindow).history.back();", 250);
|
||||||
|
}; // Disable bfcache.
|
||||||
window.location.href = "about:blank";
|
window.location.href = "about:blank";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -70,7 +70,10 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=386782
|
|||||||
is(gTest.window.document.body.innerHTML, gTest.expectedBodyAfterEdit, "Editing failed.");
|
is(gTest.window.document.body.innerHTML, gTest.expectedBodyAfterEdit, "Editing failed.");
|
||||||
|
|
||||||
gTest.window.location = "about:blank";
|
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() {
|
function goBack() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user