OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <script src="../../../../../js-test-resources/js-test-pre.js"></script> | 4 <script src="../../../../../js-test-resources/js-test-pre.js"></script> |
5 </head> | 5 </head> |
6 <body> | 6 <body> |
7 <div id="description"></div> | 7 <div id="description"></div> |
8 <div id="console"></div> | 8 <div id="console"></div> |
9 <script type="text/javascript"> | 9 <script type="text/javascript"> |
10 description("Test WebSocket subprotocol negotiation in workers."); | 10 description("Verify firing error event behaviors in Worker."); |
11 | 11 |
12 window.jsTestIsAsync = true; | 12 window.jsTestIsAsync = true; |
13 | 13 |
14 function startsWith(str, prefix) | 14 function startsWith(str, prefix) |
15 { | 15 { |
16 return str.indexOf(prefix) == 0; | 16 return str.indexOf(prefix) == 0; |
17 } | 17 } |
18 | 18 |
19 var worker = new Worker("resources/multiple-subprotocols.js"); | 19 var worker = new Worker("resources/connect-error-by-no-websocket-server.js"); |
20 worker.onmessage = function (event) | 20 worker.onmessage = function (event) |
21 { | 21 { |
22 var message = event.data; | 22 var message = event.data; |
23 if (startsWith(message, "PASS")) | 23 if (startsWith(message, "PASS")) |
24 testPassed(message); | 24 testPassed(message); |
25 else if (startsWith(message, "FAIL")) | 25 else if (startsWith(message, "FAIL")) |
26 testFailed(message) | 26 testFailed(message) |
27 else | 27 else |
28 debug(message); | 28 debug(message); |
29 if (message === "DONE") | 29 if (message === "DONE") |
30 finishJSTest(); | 30 finishJSTest(); |
31 }; | 31 }; |
32 | 32 |
33 </script> | 33 </script> |
34 <script src="../../../../../js-test-resources/js-test-post.js"></script> | 34 <script src="../../../../../js-test-resources/js-test-post.js"></script> |
35 </body> | 35 </body> |
36 </html> | 36 </html> |
OLD | NEW |