summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/webmessaging/message-channels/implied-start.any.js
blob: 460d26b7e401c301b7f7e18ade6eb9bf1870b4c1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// META: title=onmessage implied start()

async_test(function(t) {
  var channel = new MessageChannel();
  channel.port1.postMessage(1);
  channel.port2.onmessage = function() {
    setTimeout(t.step_func(function() {
      t.done();
    }), 50);
    channel.port2.onmessage = t.step_func(function() {
      assert_unreached();
    });
  }; // implies start()
});