blob: 1610fc265208f2407606070596a883d807e791ec (
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 type="application/javascript" 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>
|