Upstream version 5.34.92.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / http / tests / websocket / workers / close-code-and-reason.html
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="/js-test-resources/js-test.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 </body>
35 </html>