summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/workers/constructors/SharedWorker/connect-event.html
blob: a9719d9dea651f75858e652389ae905a4d1b2a32 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<!--
onconnect = function(e) {
  e.ports[0].postMessage([e.data === '', e instanceof MessageEvent, e.ports.length == 1]);
};
/*
-->
<!doctype html>
<title>connect event</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
<script>
(async_test()).step(function() {
  var worker = new SharedWorker('#');
  worker.port.addEventListener('message', this.step_func(function(e) {
    assert_true(e.data[0], "e.data === ''");
    assert_true(e.data[1], "e instanceof MessageEvent");
    assert_true(e.data[2], "e.ports.length == 1");
    this.done();
  }), false);
  worker.port.start();
});
</script>
<!--
*/
//-->