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