tizen beta release
[framework/web/webkit-efl.git] / LayoutTests / http / tests / websocket / tests / hixie76 / handshake-fail-by-no-connection-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 Connection header field isn't reflected by the server.");
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/hixie76/handshake-fail-by-no-connection-header";
21 var ws = new WebSocket(url);
22
23 ws.onopen = function()
24 {
25     debug("FAIL: Connected");
26 };
27
28 ws.onmessage = function(messageEvent)
29 {
30     protocol = messageEvent.data;
31     ws.close();
32 };
33
34 ws.onclose = function()
35 {
36     endTest();
37 };
38
39 function timeOutCallback()
40 {
41     debug("Timed out in state: " + ws.readyState);
42     endTest();
43 }
44
45 var timeoutID = setTimeout(timeOutCallback, 3000);
46
47 </script>
48 <script src="../../../../js-test-resources/js-test-post.js"></script>
49 </body>
50 </html>