2011-07-06 Adam Barth <abarth@webkit.org>
[WebKit-https.git] / LayoutTests / http / tests / websocket / tests / hixie76 / workers / close-in-shared-worker.html
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2 <html>
3 <head></head>
4 <body>
5 <p>Test for Web Socket close in SharedWorker.</p>
6 <p></p>
7 <p>On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".</p>
8 <pre id=log>
9 </pre>
10 <script>
11 if (window.layoutTestController) {
12     layoutTestController.dumpAsText();
13     layoutTestController.waitUntilDone();
14 }
15
16 function log(message)
17 {
18     document.getElementById("log").innerHTML += message + "\n";
19 }
20
21 function endTest()
22 {
23     log("TEST COMPLETE");
24     if (window.layoutTestController)
25         layoutTestController.notifyDone();
26 }
27 var worker = new SharedWorker('resources/close-in-worker.js', 'websocketCloseInWorker');
28 worker.port.onmessage = function (evt) {
29     log(evt.data);
30     if (evt.data == "DONE")
31         endTest();
32 };
33 </script>
34 </body>
35 </html>