summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html/browsers/windows/post-message/third-party-to-third-party-cross-partition-same-origin.sub.html
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/html/browsers/windows/post-message/third-party-to-third-party-cross-partition-same-origin.sub.html')
-rw-r--r--testing/web-platform/tests/html/browsers/windows/post-message/third-party-to-third-party-cross-partition-same-origin.sub.html30
1 files changed, 30 insertions, 0 deletions
diff --git a/testing/web-platform/tests/html/browsers/windows/post-message/third-party-to-third-party-cross-partition-same-origin.sub.html b/testing/web-platform/tests/html/browsers/windows/post-message/third-party-to-third-party-cross-partition-same-origin.sub.html
new file mode 100644
index 0000000000..9caf6c11e4
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/windows/post-message/third-party-to-third-party-cross-partition-same-origin.sub.html
@@ -0,0 +1,30 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>postMessage: Third-Party to Third-Party, Cross-Partition, Same-Origin</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<body>
+<script>
+// Here's the set-up for this test:
+// Step 1. (Site 1 Window) set up listener and open Site 2 Frame A.
+// Step 2. (Site 2 Frame A) set up listener and open Site 3 Window.
+// Step 3. (Site 3 Window) open Site 2 Frame B.
+// Step 4. (Site 2 Frame B) send "Site 2 Frame B" message to Site 2 Frame A.
+// Step 5. (Site 2 Frame A) receive "Site 2 Frame B" message and send "Site 2 Frame A" message to Site 1 Window.
+// Step 6. (Site 1 Window) receive "Site 2 Frame A" message and exit.
+
+async_test(t => {
+ // Step 6
+ const listener = t.step_func(e => {
+ if (e.data === "Site 2 Frame A") {
+ t.done();
+ }
+ });
+ // Step 1
+ window.addEventListener("message", listener);
+ const site2FrameA = document.createElement("iframe");
+ site2FrameA.src = "https://{{hosts[alt][]}}:{{ports[https][0]}}/html/browsers/windows/post-message/resources/third-party-to-third-party-cross-partition-same-origin-iframe-a.sub.https.html";
+ document.body.appendChild(site2FrameA);
+}, "postMessage: Third-Party to Third-Party, Cross-Partition, Same-Origin");
+</script>
+</body>