summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/beforeunload-sticky-activation-popup.html
blob: 23bf8a440d6212f0fb610e09f5e13b9529fdc982 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<!DOCTYPE html>
<meta charset="utf-8">
<title>Beforeunload must be gated behind sticky activation: auxiliary browsing context</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>

<p>If you happen to be running this test as a human, then be sure not to interact with any part of the page; that would invalidate the results!

<script>
setup({ single_test: true });

const w = window.open('support/beforeunload-sticky-start.html');

window.onmessage = e => {
  assert_equals(e.data, 'navigated successfully');

  const desiredURL = (new URL('support/beforeunload-sticky-destination.html', location.href)).href;
  assert_equals(w.location.href, desiredURL);

  w.close();

  done();
};
</script>