Skip to content

Commit

Permalink
cross-origin-opener-policy/resource-popup.https.html makes incorrect …
Browse files Browse the repository at this point in the history
…assumption about win.location.href (#29769)

The test expects that win.location.href starts returning something else than "about:blank" after closing.
While this is true in Firefox and Blink, none of the browser engines actually agree on this (Firefox
returns the empty string, Chrome returns undefined and Safari returns "about:blank").

Per the specification, it seems returning "about:blank" after a window is closed is the expected behavior,
see whatwg/html#6899. I am fixing thus fixing the test so that it can run in
all browsers by checking if "the window is closed" OR "href is no longer about:blank because it was
navigated".
  • Loading branch information
cdumez authored Jul 26, 2021
1 parent a85b7d6 commit 1389ca3
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
close();
};
const id = setInterval(() => {
if (win.location.href !== 'about:blank') {
if (win.closed || win.location.href !== 'about:blank') {
clearInterval(id);
bc.postMessage({name: win.name || null, closed: win.closed});
}
Expand Down

0 comments on commit 1389ca3

Please sign in to comment.