1 This test checks the various use cases around sending multiple ports through MessagePort.postMessage
3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
6 PASS channel.port1.postMessage() threw exception TypeError: Failed to execute 'postMessage' on 'MessagePort': 1 argument required, but only 0 present..
7 PASS channel.port1.postMessage("same port", [channel.port1]) threw exception DataCloneError: Failed to execute 'postMessage' on 'MessagePort': Port at index 0 contains the source port..
8 PASS channel.port1.postMessage("null port", [channel3.port1, null, channel3.port2]) threw exception TypeError: Failed to execute 'postMessage' on 'MessagePort': Value at index 1 is an untransferable 'null' value..
9 PASS channel.port1.postMessage("notAPort", [channel3.port1, {}, channel3.port2]) threw exception TypeError: Failed to execute 'postMessage' on 'MessagePort': Value at index 1 does not have a transferable type..
10 PASS channel.port1.postMessage("duplicate port", [channel3.port1, channel3.port1]) threw exception DataCloneError: Failed to execute 'postMessage' on 'MessagePort': Message port at index 1 is a duplicate of an earlier port..
11 PASS channel.port1.postMessage("notAnArray", channel3.port1) threw exception TypeError: Failed to execute 'postMessage' on 'MessagePort': The 2nd argument is neither an array, nor does it have indexed properties..
12 PASS channel.port1.postMessage("notASequence", [{length: 3}]) threw exception TypeError: Failed to execute 'postMessage' on 'MessagePort': Value at index 0 does not have a transferable type..
13 PASS channel.port1.postMessage("duplicate buffer", [arrayBuffer, arrayBuffer]) threw exception DataCloneError: Failed to execute 'postMessage' on 'MessagePort': ArrayBuffer at index 1 is a duplicate of an earlier ArrayBuffer..
14 PASS channel.port1.postMessage("largeSequence", largePortArray) threw exception TypeError: Failed to execute 'postMessage' on 'MessagePort': Value at index 0 is an untransferable 'undefined' value..
15 PASS successfullyParsed is true
18 PASS event.ports is non-null and zero length when no port sent
19 PASS event.ports is non-null and zero length when empty array sent
20 PASS event.ports contains two ports when two ports sent
21 PASS event.ports contains two ports when two ports re-sent after error
22 PASS Sending host object has thrown DataCloneError: Failed to execute 'postMessage' on 'MessagePort': An object could not be cloned.
23 PASS Sending host object has thrown DataCloneError: Failed to execute 'postMessage' on 'MessagePort': An object could not be cloned.
24 PASS Sending Function object has thrown DataCloneError: Failed to execute 'postMessage' on 'MessagePort': An object could not be cloned.
25 PASS Sending Error object has thrown DataCloneError: Failed to execute 'postMessage' on 'MessagePort': An object could not be cloned.
26 PASS send-port: transferred one port
27 PASS send-port-twice: transferred one port twice
28 PASS send-two-ports: transferred two ports