summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html/browsers/windows/auxiliary-browsing-contexts/opener-noopener.html
blob: 086a96442dd09eb8c87802f0366bf1f3e8ebb01d (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
25
<!doctype html>
<html>
  <head>
    <title>Auxiliary Browsing Contexts: window.opener noopener</title>
    <script src="/resources/testharness.js"></script>
    <script src="/resources/testharnessreport.js"></script>
    <script src="/common/PrefixedLocalStorage.js"></script>
  </head>
  <body>
    <div id="log"></div>
    <script>
    var prefixedLocalStorage;
    setup(() => prefixedLocalStorage = new PrefixedLocalStorageTest());
    async_test(t => {
      t.add_cleanup(() => prefixedLocalStorage.cleanup());
      prefixedLocalStorage.onSet('openerIsNull', t.step_func_done(e => {
        assert_equals(e.newValue, 'true');
      }));
      window.open(prefixedLocalStorage.url('resources/no-opener.html'),
        'iShouldNotHaveAnOpener',
        'noopener');
    }, 'Auxiliary browsing context created via `window.open` setting `noopener` should report `window.opener` `null`');
    </script>
  </body>
</html>