summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/webmessaging/message-channels/basics.any.js
blob: 5732fb268a0faa029262cfc360bf140123b707c2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
// 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();
});