2011-07-05 Yuta Kitamura <yutak@chromium.org>
[WebKit-https.git] / LayoutTests / http / tests / websocket / tests / hixie76 / close-before-open.html
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2 <html>
3 <head>
4 <link rel="stylesheet" href="../../../../js-test-resources/js-test-style.css">
5 <script src="../../../../js-test-resources/js-test-pre.js"></script>
6 </head>
7 <body>
8 <div id="description"></div>
9 <div id="console"></div>
10 <script type="text/javascript">
11 description("Test if Web Socket fires close event when WebSocket is opened and closed fore open event is received.");
12
13 window.jsTestIsAsync = true;
14
15 var ws = new WebSocket("ws://127.0.0.1:8880/websocket/tests/hixie76/hanging-handshake");
16 ws.onclose = function() {
17     debug("closed");
18     finishJSTest();
19 };
20 var successfullyParsed = true;
21 ws.close();
22 </script>
23 <script src="../../../../js-test-resources/js-test-post.js"></script>
24 </body>
25 </html>