JS Test Harness: Remove more link tags
[WebKit-https.git] / LayoutTests / http / tests / websocket / tests / hybi / close-unref-websocket.html
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
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 type="text/javascript">
10 description("Test if Web Socket is closed while handshaking and unreferenced, it should fire close event at most once.");
11
12 window.jsTestIsAsync = true;
13 if (window.layoutTestController)
14     layoutTestController.overridePreference("WebKitHixie76WebSocketProtocolEnabled", 0);
15
16 var countCloseEvent = 0;
17
18 function endTest()
19 {
20     shouldBeGreaterThanOrEqual("1", "countCloseEvent");
21     finishJSTest();
22 };
23
24 var ws = new WebSocket("ws://127.0.0.1:8880/websocket/tests/hybi/echo");
25 ws.onclose = function() {
26     countCloseEvent += 1;
27 };
28 ws = null;
29 gc();
30 setTimeout("endTest()", 100);
31 var successfullyParsed = true;
32 </script>
33 <script src="../../../../js-test-resources/js-test-post.js"></script>
34 </body>
35 </html>