Remove LayoutTestController and WebKitTestRunner support for Hixie76 WebSockets
[WebKit-https.git] / LayoutTests / http / tests / websocket / tests / hybi / handshake-fail-by-more-accept-header.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>
10 description("Test that WebSocket handshake fails if there are more one Sec-WebSocket-Accept header field in the response.");
11
12 window.jsTestIsAsync = true;
13
14 function endTest()
15 {
16     clearTimeout(timeoutID);
17     finishJSTest();
18 }
19
20 var url = "ws://localhost:8880/websocket/tests/hybi/handshake-fail-by-more-accept-header";
21 var ws = new WebSocket(url);
22
23 ws.onopen = function()
24 {
25     testFailed("Unexpectedly Connected.");
26 };
27
28 ws.onmessage = function(messageEvent)
29 {
30     testFailed("Unexpectedly Received: '" + messageEvent.data + "'");
31 };
32
33 ws.onclose = function()
34 {
35     endTest();
36 };
37
38 function timeOutCallback()
39 {
40     debug("Timed out in state: " + ws.readyState);
41     endTest();
42 }
43
44 var timeoutID = setTimeout(timeOutCallback, 3000);
45
46 </script>
47 <script src="../../../../js-test-resources/js-test-post.js"></script>
48 </body>
49 </html>