summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html/cross-origin-opener-policy/no-https.html
blob: db15d5c676efb6f5761dec52ad56580fdfc1acbf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<!doctype html>
<meta name=timeout content=long>
<title>Cross-Origin-Opener-Policy requires secure contexts</title>
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<script>
async_test(t => {
  const popup = window.open("resources/call-functionCalledByOpenee.html");
  t.add_cleanup(() => {
    popup.close();
  });
  window.functionCalledByOpenee = t.step_func_done(() => {
    assert_false(popup.closed);
  });
  assert_equals(window, popup.opener);
}, "Cross-Origin-Opener-Policy only works over secure contexts");

test(() => {
  assert_false(window.crossOriginIsolated);
}, "Bonus: window.crossOriginIsolated");
</script>