Threadsafety issues in WebScriptObject
[WebKit-https.git] / LayoutTests / http / tests / websocket / tests / hixie76 / error-detect.html
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
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("Make sure WebSocket correctly fire error event for unknown frame type.");
11
12 window.jsTestIsAsync = true;
13 if (window.layoutTestController)
14     layoutTestController.overridePreference("WebKitHixie76WebSocketProtocolEnabled", 1);
15
16 var errorCount = 0;
17
18 var ws = new WebSocket("ws://127.0.0.1:8880/websocket/tests/hixie76/unknown-frame-type");
19 ws.onopen = function () {
20     debug("WebSocket is open");
21 };
22 ws.onmessage = function (evt) {
23     debug("received:" + evt.data);
24 };
25 ws.onerror = function () {
26     errorCount += 1;
27 };
28 ws.onclose = function () {
29     debug("WebSocket is closed");
30     shouldBe("errorCount", "255");
31     finishJSTest();
32 };
33
34 </script>
35 <script src="../../../../js-test-resources/js-test-post.js"></script>
36 </body>
37 </html>