summaryrefslogtreecommitdiffstats
path: root/dom/messagechannel/tests/test_messageChannel_worker_forceClose.html
blob: 8de3450fb5bbceafd7395da2e00622766f9aa50a (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
27
<!DOCTYPE HTML>
<html>
<head>
  <meta charset="utf-8">
  <title>Test for forcing the closing of the port in workers</title>
  <script src="/tests/SimpleTest/SimpleTest.js"></script>
  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
</head>
<body>
<div id="content"></div>
<pre id="test">
</pre>
  <script type="application/javascript">

  var worker = new Worker('data:javascript,onmessage = function(e) { "doing nothing with this port"; }');

  var mc = new MessageChannel();
  worker.postMessage(42, [mc.port2]);

  for (var i = 0; i < 10; ++i) {
    mc.port1.postMessage(i);
  }

  ok(true, "All the messages are sent! We should shutdown correctly.");
  </script>
</body>
</html>