summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/portals/resources/portal-post-message-after-activate-window.html
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/portals/resources/portal-post-message-after-activate-window.html')
-rw-r--r--testing/web-platform/tests/portals/resources/portal-post-message-after-activate-window.html23
1 files changed, 23 insertions, 0 deletions
diff --git a/testing/web-platform/tests/portals/resources/portal-post-message-after-activate-window.html b/testing/web-platform/tests/portals/resources/portal-post-message-after-activate-window.html
new file mode 100644
index 0000000000..73d2c11558
--- /dev/null
+++ b/testing/web-platform/tests/portals/resources/portal-post-message-after-activate-window.html
@@ -0,0 +1,23 @@
+<!DOCTYPE html>
+<body>
+ <script>
+ var portal = document.createElement("portal");
+ portal.src = "portal-post-message-portal.html";
+ document.body.appendChild(portal);
+
+ portal.onload = () => {
+ portal.activate().then(() => {
+ error = "";
+ try {
+ portal.postMessage("message");
+ }
+ catch(err) {
+ error = err.name;
+ }
+ bc = new BroadcastChannel("portals-post-message-after-activate");
+ bc.postMessage(error);
+ bc.close();
+ });
+ }
+ </script>
+</body>