This test checks the various use cases around sending multiple ports through MessagePort.postMessage

On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".


PASS channel.port1.postMessage("same port", [channel.port1]) threw exception Error: INVALID_STATE_ERR: DOM Exception 11.
PASS channel.port1.postMessage("entangled port", [channel.port2]) threw exception Error: INVALID_STATE_ERR: DOM Exception 11.
PASS channel.port1.postMessage("null port", [channel3.port1, null, channel3.port2]) threw exception Error: INVALID_STATE_ERR: DOM Exception 11.
PASS channel.port1.postMessage("notAPort", [channel3.port1, {}, channel3.port2]) threw exception TypeError: MessagePortArray argument must contain only MessagePorts.
PASS channel.port1.postMessage("notAnArray", channel3.port1) threw exception TypeError: MessagePortArray argument has no length attribute.
PASS channel.port1.postMessage("notASequence", [{length: 3}]) threw exception TypeError: MessagePortArray argument must contain only MessagePorts.
PASS event.ports is null when no port sent
PASS event.ports is null when empty array sent
PASS event.ports contains two ports when two ports sent
PASS event.ports contains two ports when two ports re-sent after error

TEST COMPLETE

