diff options
Diffstat (limited to 'testing/web-platform/tests/portals/resources/portals-adopt-predecessor.html')
-rw-r--r-- | testing/web-platform/tests/portals/resources/portals-adopt-predecessor.html | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/testing/web-platform/tests/portals/resources/portals-adopt-predecessor.html b/testing/web-platform/tests/portals/resources/portals-adopt-predecessor.html new file mode 100644 index 0000000000..66d47d12ac --- /dev/null +++ b/testing/web-platform/tests/portals/resources/portals-adopt-predecessor.html @@ -0,0 +1,20 @@ +<!doctype html> +<body> +</body> +<script> + var searchParams = new URL(location).searchParams; + var test = searchParams.get("test"); + var portal = document.createElement("portal"); + portal.src = `portals-adopt-predecessor-portal.html?test=${test}`; + portal.onload = () => { + portal.activate().then(() => { + window.addEventListener("portalactivate", e => { + window.opener.postMessage({test, message: "passed"}, "*"); + }); + window.portalHost.addEventListener("message", e => { + window.opener.postMessage({test, message: e.data}, "*"); + }); + }); + } + document.body.appendChild(portal); +</script> |