Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
32 lines (27 sloc) 1.03 KB
<!DOCTYPE html>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<body>
<script>
function openPortalAndReceiveMessage(portalSrc) {
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>
You can’t perform that action at this time.