blob: 1083071f7d2a21cca5dcb9b31621370a3c830bf4 [file] [log] [blame]
<!doctype html>
<meta charset=utf-8>
<title>postMessage: Third-Party to Third-Party, Cross-Partition, Cross-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.
// Step 2. (Site 2 Frame) set up listener and open Site 3 Window.
// Step 3. (Site 3 Window) open Site 4 Frame.
// Step 4. (Site 4 Frame) send "Site 4 Frame" message to Site 2 Frame.
// Step 5. (Site 2 Frame) receive "Site 4 Frame" message and send "Site 2 Frame" message to Site 1 Window.
// Step 6. (Site 1 Window) receive "Site 2 Frame" message and exit.
async_test(t => {
// Step 6
const listener = t.step_func(e => {
if (e.data === "Site 2 Frame") {
t.done();
}
});
// Step 1
window.addEventListener("message", listener);
const site2FrameA = document.createElement("iframe");
site2FrameA.src = "http://{{hosts[alt][]}}:{{ports[http][0]}}/html/browsers/windows/post-message/resources/third-party-to-third-party-cross-partition-cross-origin-iframe-a.sub.html";
document.body.appendChild(site2FrameA);
}, "postMessage: Third-Party to Third-Party, Cross-Partition, Cross-Origin");
</script>
</body>