summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html/browsers/the-window-object/window-open-noreferrer.html
blob: 92b72cdb5f1ec07ad058ce5e25714130e6ceecfe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<!doctype html>
<meta charset=utf-8>
<title>window.open() with "noreferrer" tests</title>
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<script>
async_test(t => {
  const channelName = "343243423432",
        channel = new BroadcastChannel(channelName);
  window.open("support/noreferrer-target.html?" + channelName, "", "noreferrer");
  channel.onmessage = t.step_func_done(e => {
    // Send message first so if asserts throw the popup is still closed
    channel.postMessage(null);

    assert_equals(e.data.name, "");
    assert_equals(e.data.referrer, "");
    assert_equals(e.data.haveOpener, false);
  });
});
</script>