summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/infrastructure/channels/test_postMessage.html
blob: 473c8630a695ff4b438f7920a2ea1a2905d82d16 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<!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>