mirror of
https://github.com/servo/servo.git
synced 2025-10-17 00:39:15 +01:00
Update web-platform-tests to revision 7cb66930f16381536cec572cd3f4f86c7bbb6787
This commit is contained in:
parent
c183f95297
commit
9cff065d01
80 changed files with 1357 additions and 359 deletions
|
@ -6,19 +6,11 @@ for (const ev of ["unload", "beforeunload", "pagehide"]) {
|
|||
t.add_cleanup(() => iframe.remove());
|
||||
iframe.src = "/common/blank.html";
|
||||
iframe.onload = t.step_func(() => {
|
||||
iframe.contentWindow.addEventListener(ev, t.step_func(() => {
|
||||
// Here, the entry settings object could still be the iframe's. Delay
|
||||
// it in such a way that ensures the entry settings object is the
|
||||
// top-level page's, but without delaying too much that the
|
||||
// ignore-opens-during-unload counter becomes decremented. A microtask
|
||||
// is perfect as it's executed immediately in "clean up after running
|
||||
// script".
|
||||
Promise.resolve().then(t.step_func_done(() => {
|
||||
const origURL = iframe.contentDocument.URL;
|
||||
assertDocumentIsReadyForSideEffectsTest(iframe.contentDocument, `ignore-opens-during-unload counter is greater than 0 during ${ev} event`);
|
||||
assert_equals(iframe.contentDocument.open(), iframe.contentDocument);
|
||||
assertOpenHasNoSideEffects(iframe.contentDocument, origURL, `ignore-opens-during-unload counter is greater than 0 during ${ev} event`);
|
||||
}));
|
||||
iframe.contentWindow.addEventListener(ev, t.step_func_done(() => {
|
||||
const origURL = iframe.contentDocument.URL;
|
||||
assertDocumentIsReadyForSideEffectsTest(iframe.contentDocument, `ignore-opens-during-unload counter is greater than 0 during ${ev} event`);
|
||||
assert_equals(iframe.contentDocument.open(), iframe.contentDocument);
|
||||
assertOpenHasNoSideEffects(iframe.contentDocument, origURL, `ignore-opens-during-unload counter is greater than 0 during ${ev} event`);
|
||||
}));
|
||||
iframe.src = "about:blank";
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue