JS Test Harness: Remove more link tags
[WebKit-https.git] / LayoutTests / http / tests / websocket / tests / hixie76 / close-on-unload.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 on unload");
11
12 window.jsTestIsAsync = true;
13
14 var frameDiv;
15 var closedSocket;
16
17 var ws = new WebSocket("ws://127.0.0.1:8880/websocket/tests/hixie76/close-on-unload");
18 ws.onopen = function()
19 {
20     debug("PASS ws on master document is ready.");
21     frameDiv = document.createElement("iframe");
22     frameDiv.src = "resources/close-on-unload-iframe.html";
23     document.body.appendChild(frameDiv);
24     debug("PASS insert a iframe, where open ws called 'socket1'");
25 };
26 ws.onmessage = function(evt)
27 {
28     closedSocket = evt.data;
29     ws.close();
30 };
31 ws.onclose = function()
32 {
33     shouldBe("closedSocket", '"socket1"');
34     finishJSTest();
35 };
36
37 document.iframeReady = function()
38 {
39     debug("PASS 'socket1' is sent to the server. unload the iframe. expect receiving 'socket1' on ws...");
40     document.body.removeChild(frameDiv);
41 }; 
42
43 var successfullyParsed = true;
44 </script>
45 <script src="../../../../js-test-resources/js-test-post.js"></script>
46 </body>
47 </html>