blob: 2115051ee77a91b4cc123a5a86469f5ab533aeb5 [file] [log] [blame]
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: InvalidStateError: DOM Exception 11.
PASS channel.port1.postMessage("entangled port", [channel.port2]) threw exception Error: InvalidStateError: DOM Exception 11.
PASS channel.port1.postMessage("null port", [channel3.port1, null, channel3.port2]) threw exception Error: InvalidStateError: DOM Exception 11.
PASS channel.port1.postMessage("notAPort", [channel3.port1, {}, channel3.port2]) threw exception TypeError: Type error.
PASS channel.port1.postMessage("duplicate port", [channel3.port1, channel3.port1]) threw exception Error: InvalidStateError: DOM Exception 11.
PASS channel.port1.postMessage("notAnArray", channel3.port1) threw exception TypeError: Value is not a sequence.
PASS channel.port1.postMessage("notASequence", [{length: 3}]) threw exception TypeError: Type error.
PASS channel.port1.postMessage("largeSequence", largePortArray) threw exception Error: InvalidStateError: DOM Exception 11.
PASS event.ports is non-null and zero length when no port sent
PASS event.ports is non-null and zero length 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
PASS Sending host object has thrown Error: DataCloneError: DOM Exception 25
PASS Sending host object has thrown Error: DataCloneError: DOM Exception 25
PASS Sending Function object has thrown Error: DataCloneError: DOM Exception 25
PASS Sending Error object has thrown Error: DataCloneError: DOM Exception 25
PASS send-port: transferred one port
PASS send-port-twice: transferred one port twice
PASS send-two-ports: transferred two ports
TEST COMPLETE