|
1 <!-- |
|
2 Any copyright is dedicated to the Public Domain. |
|
3 http://creativecommons.org/publicdomain/zero/1.0/ |
|
4 --> |
|
5 <!DOCTYPE HTML> |
|
6 <html> |
|
7 <!-- |
|
8 Tests of DOM Worker Threads |
|
9 --> |
|
10 <head> |
|
11 <title>Test for DOM Worker Threads</title> |
|
12 <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> |
|
13 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" /> |
|
14 </head> |
|
15 <body> |
|
16 <pre id="test"> |
|
17 <script class="testbody" type="text/javascript"> |
|
18 |
|
19 var worker = new Worker("nonexistent_worker.js"); |
|
20 |
|
21 worker.onmessage = function(event) { |
|
22 ok(false, "Shouldn't ever get a message!"); |
|
23 SimpleTest.finish(); |
|
24 } |
|
25 |
|
26 worker.onerror = function(event) { |
|
27 is(event.target, worker); |
|
28 is(event.message, "Error: Script file not found: nonexistent_worker.js"); |
|
29 event.preventDefault(); |
|
30 SimpleTest.finish(); |
|
31 }; |
|
32 |
|
33 worker.postMessage("dummy"); |
|
34 |
|
35 SimpleTest.waitForExplicitFinish(); |
|
36 |
|
37 </script> |
|
38 </pre> |
|
39 </body> |
|
40 </html> |
|
41 |