JS Test Harness: Remove successfullyParsed from more tests
[WebKit-https.git] / LayoutTests / http / tests / websocket / tests / hybi / handshake-error.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("Handshake error test");
11
12 window.jsTestIsAsync = true;
13 if (window.layoutTestController)
14     layoutTestController.overridePreference("WebKitHixie76WebSocketProtocolEnabled", 0);
15
16 function endTest()
17 {
18     clearTimeout(timeoutID);
19     finishJSTest();
20 }
21
22 var ws = new WebSocket("ws://127.0.0.1:8880/websocket/tests/hybi/handshake-error");
23
24 ws.onopen = function()
25 {
26     testFailed("Unexpectedly Connected.");
27 };
28
29 ws.onmessage = function(messageEvent)
30 {
31     testFailed("Unexpectedly Received: '" + messageEvent.data + "'");
32 };
33
34 ws.onclose = function()
35 {
36     debug("Closed.");
37     shouldBe("ws.readyState", "3")
38     endTest();
39 };
40
41 function timeOutCallback()
42 {
43     testFailed("Timed out in state: " + ws.readyState);
44     endTest();
45 }
46
47 var timeoutID = setTimeout(timeOutCallback, 3000);
48
49 </script>
50 <script src="../../../../js-test-resources/js-test-post.js"></script>
51 </body>
52 </html>