4 <script src="../../../../js-test-resources/js-test-pre.js"></script>
7 <div id="description"></div>
8 <div id="console"></div>
10 description("Test that WebSocket handshake fails if Connection header field isn't reflected by the server.");
12 window.jsTestIsAsync = true;
13 if (window.layoutTestController)
14 layoutTestController.overridePreference("WebKitHixie76WebSocketProtocolEnabled", 0);
18 clearTimeout(timeoutID);
22 var url = "ws://localhost:8880/websocket/tests/hybi/handshake-fail-by-no-connection-header";
23 var ws = new WebSocket(url);
25 ws.onopen = function()
27 debug("FAIL: Connected");
30 ws.onmessage = function(messageEvent)
32 protocol = messageEvent.data;
36 ws.onclose = function()
41 function timeOutCallback()
43 debug("Timed out in state: " + ws.readyState);
47 var timeoutID = setTimeout(timeOutCallback, 3000);
50 <script src="../../../../js-test-resources/js-test-post.js"></script>