diff options
Diffstat (limited to 'dom/messagechannel/tests/sharedWorker_messageChannel.js')
-rw-r--r-- | dom/messagechannel/tests/sharedWorker_messageChannel.js | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/dom/messagechannel/tests/sharedWorker_messageChannel.js b/dom/messagechannel/tests/sharedWorker_messageChannel.js new file mode 100644 index 0000000000..533d36270d --- /dev/null +++ b/dom/messagechannel/tests/sharedWorker_messageChannel.js @@ -0,0 +1,10 @@ +/* eslint-env worker */ + +onconnect = function(evt) { + var mc = new MessageChannel(); + + evt.ports[0].postMessage(42, [mc.port2]); + mc.port1.onmessage = function(e) { + mc.port1.postMessage(e.data); + }; +}; |