Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /webmessaging/message-channels/basics.any.html - WPT Dashboard Interop Dashboard
- /webmessaging/message-channels/basics.any.worker.html - WPT Dashboard Interop Dashboard
// META: title=basic messagechannel test
async_test(function(t) {
var channel = new MessageChannel();
channel.port1.postMessage(1);
channel.port2.onmessage = t.step_func(
function(e) {
assert_equals(e.data, 1);
t.done();
});
channel.port2.start();
});