Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / http / tests / websocket / close-on-unload-reference-in-parent.html
blob13e0cd01f4d3601ebcd50430b371e6713dc7c919
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 type="text/javascript">
10 description("Test that WebSocket opened in iframe is closed when the iframe is unloaded even if the WebSocket is referred by the parent frame.");
12 window.jsTestIsAsync = true;
14 var frameDiv;
15 var closedSocket;
16 var closeCode;
17 document.childWebSocket = null;
19 document.wsUrl = "ws://127.0.0.1:8880/close-on-unload?p=close-on-unload-reference-in-parent.html";
20 var ws = new WebSocket(document.wsUrl);
21 ws.onopen = function()
23 debug("PASS ws on master document is ready.");
24 frameDiv = document.createElement("iframe");
25 frameDiv.src = "resources/close-on-unload-iframe-reference-in-parent.html";
26 document.body.appendChild(frameDiv);
27 debug("PASS insert a iframe, where open ws called 'socket1'");
29 ws.onmessage = function(evt)
31 var messageData = JSON.parse(evt.data);
32 closedSocket = messageData.message;
33 closeCode = messageData.closeCode;
34 ws.close();
36 ws.onclose = function()
38 shouldBe("closedSocket", '"socket1"');
39 shouldBe("closeCode", '"1001"');
40 shouldBe("document.childWebSocket.readyState", "3");
41 finishJSTest();
44 document.iframeReady = function()
46 shouldBeNonNull("document.childWebSocket");
47 debug("PASS 'socket1' is sent to the server. unload the iframe. expect receiving 'socket1' on ws...");
48 document.body.removeChild(frameDiv);
51 </script>
52 </body>
53 </html>