diff options
Diffstat (limited to 'testing/web-platform/tests/portals/resources/portal-post-message-during-activate-window.html')
-rw-r--r-- | testing/web-platform/tests/portals/resources/portal-post-message-during-activate-window.html | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/testing/web-platform/tests/portals/resources/portal-post-message-during-activate-window.html b/testing/web-platform/tests/portals/resources/portal-post-message-during-activate-window.html new file mode 100644 index 0000000000..6e220277d9 --- /dev/null +++ b/testing/web-platform/tests/portals/resources/portal-post-message-during-activate-window.html @@ -0,0 +1,21 @@ +<!DOCTYPE html> +<body> + <script> + var portal = document.createElement("portal"); + portal.src = "simple-portal.html"; + document.body.appendChild(portal); + + portal.onload = () => { + portal.activate(); + error = ""; + try { + portal.postMessage("message"); + } catch (err) { + error = err.name; + } + bc = new BroadcastChannel("portals-post-message-during-activate"); + bc.postMessage(error); + bc.close(); + } + </script> +</body> |