Remove LayoutTestController and WebKitTestRunner support for Hixie76 WebSockets
[WebKit-https.git] / LayoutTests / http / tests / websocket / tests / hybi / workers / close-code-and-reason.html
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="../../../../../js-test-resources/js-test-pre.js"></script>
5 </head>
6 <body>
7 <div id="description"></div>
8 <div id="console"></div>
9 <script type="text/javascript">
10 description("Test CloseEvent code and reason property in Worker.");
11
12 window.jsTestIsAsync = true;
13
14 function startsWith(str, prefix)
15 {
16     return str.indexOf(prefix) == 0;
17 }
18
19 var worker = new Worker("resources/close-code-and-reason.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>
34 <script src="../../../../../js-test-resources/js-test-post.js"></script>
35 </body>
36 </html>