DXR is a code search and navigation tool aimed at making sense of large projects. It supports full-text and regex searches as well as structural queries.

Mercurial (c68fe15a81fc)

VCS Links

Line Code
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 26 27 28 29 30 31 32
<!DOCTYPE html>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<body>
<script>
  function openPortalAndReceiveMessage(portalSrc) {
    assert_implements("HTMLPortalElement" in self);
    let portal = document.createElement('portal');
    portal.src = portalSrc;
    let received = new Promise((resolve, reject) => {
      portal.onmessage = resolve;
      document.body.appendChild(portal);
    });
    return received;
  }

  promise_test(() => {
    return openPortalAndReceiveMessage("resources/portal-host.html");
  }, "window.portalHost should be exposed in same-origin portal");

  promise_test(() => {
    return openPortalAndReceiveMessage(
        "http://{{hosts[alt][www]}}:{{ports[http][0]}}/portals/resources/portal-host.html");
  }, "window.portalHost should be exposed in cross-origin portal");

  promise_test(() => {
    return openPortalAndReceiveMessage(
        'resources/portal-host-cross-origin-navigate.sub.html');
  }, "window.portalHost should be exposed in portal after cross-origin navigation");

</script>
</body>