blob: 88b4062b4d574c17a7a740a3f1cff5e519896e4a [file] [log] [blame]
This test checks the various use cases around sending multiple ports through Worker.postMessage
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS worker.postMessage("null port", [channel3.port1, null, channel3.port2]) threw exception Error: INVALID_STATE_ERR: DOM Exception 11.
PASS worker.postMessage("notAPort", [channel3.port1, {}, channel3.port2]) threw exception TypeError: Type error.
PASS worker.postMessage("notAnArray", channel3.port1) threw exception TypeError: Type error.
PASS worker.postMessage("notASequence", [{length: 3}]) threw exception TypeError: Type error.
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