Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / http / tests / websocket / close-on-navigate-new-location.html
blob8feb489cd7237d090df09c8a8fa7b8176540581f
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 if WebSocket is closed when navigating to new location.");
12 window.jsTestIsAsync = true;
14 var frameDiv;
15 var closedSocket;
16 var closeCode;
18 document.wsUrl = "ws://127.0.0.1:8880/close-on-unload?p=close-on-navigate-new-location.html";
19 var ws = new WebSocket(document.wsUrl);
20 ws.onopen = function()
22 debug("PASS ws on master document is ready.");
23 frameDiv = document.createElement("iframe");
24 frameDiv.src = "resources/close-on-unload-iframe.html";
25 document.body.appendChild(frameDiv);
26 debug("PASS insert a iframe, where open ws called 'socket1'");
28 ws.onmessage = function(evt)
30 var messageData = JSON.parse(evt.data);
31 closedSocket = messageData.message;
32 closeCode = messageData.closeCode;
33 ws.close();
35 ws.onclose = function()
37 shouldBe("closedSocket", '"socket1"');
38 shouldBe("closeCode", '"1001"');
39 finishJSTest();
42 document.iframeReady = function()
44 debug("PASS 'socket1' is sent to the server. navigate to new location. expect receiving 'socket1' on ws...");
45 frameDiv.src = "../handler_map.txt";
48 </script>
49 </body>
50 </html>