Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / http / tests / websocket / handshake-fail-by-404.html
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2 <html>
3 <head>
4 <script src="/js-test-resources/js-test.js"></script>
5 </head>
6 <body>
7 <div id="description"></div>
8 <div id="console"></div>
9 <script>
10 description('Connection should fail immediately if the server returns a 404 error.');
11
12 window.jsTestIsAsync = true;
13
14 var url = 'ws://localhost:8880/handshake-fail-by-404';
15 var ws = new WebSocket(url);
16
17 var wasClean = null;
18
19 ws.onopen = function()
20 {
21     testFailed('onopen called');
22     ws.close();
23 }
24
25 ws.onclose = function(event)
26 {
27     wasClean = event.wasClean;
28     shouldBeFalse('wasClean');
29     finishJSTest();
30 }
31
32 </script>
33 </body>
34 </html>