summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/portals/xfo/portals-xfo-sameorigin.html
blob: 24824767826af4f7a7789400bc0b3a58a3a2fc8e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<!DOCTYPE html>
<meta name="timeout" content="long">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/common/get-host-info.sub.js"></script>
<body>
<script>
async_test(t => {
  assert_implements("HTMLPortalElement" in self);
  var portal = document.createElement('portal');
  portal.src = get_host_info().HTTP_REMOTE_HOST + "/portals/xfo/resources/xfo-sameorigin.asis";
  portal.onmessage = t.unreached_func("should not have received a message");
  document.body.appendChild(portal);
  t.add_cleanup(() => portal.remove());
  t.step_timeout(() => t.done(), 2000);
}, "`XFO: SAMEORIGIN` blocks cross-origin portals.");
</script>
</body>