Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /infrastructure/channels/test_postMessage.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<meta charset="utf-8">
<title>postMessage method</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/channel.sub.js"></script>
<script>
setup({single_test: true});
(async () => {
let remote = await new RemoteGlobal();
let url = `child_message.html?uuid=${remote.uuid}`;
win = window.open(url, "_blank", "noopener");
let [recvChannel, sendChannel] = channel();
await remote.postMessage(sendChannel);
await recvChannel.connect();
let message = await recvChannel.nextMessage();
assert_equals(message, "PASS");
done();
})();
</script>