summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/navigation-unload-same-origin.window.js
blob: 826af4b75b18dfc4406b5034a100a2caaa748d36 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// META: title=Same-origin navigation started from unload handler must be ignored
// META: script=../resources/helpers.js

promise_test(async () => {
  const iframe = await addIframe();

  iframe.contentWindow.addEventListener("unload", () => {
    iframe.contentWindow.location.href = "/common/blank.html?fail";
  });

  iframe.src = "/common/blank.html?pass";

  await waitForIframeLoad(iframe);
  assert_equals(iframe.contentWindow.location.search, "?pass");
});