Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(190)

Side by Side Diff: LayoutTests/http/tests/websocket/tests/hybi/close-on-unload-and-force-gc.html

Issue 101143002: Remove hybi sub directory for WebSocket layout tests (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
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 on unload and not crashed if garbage co llected");
11
12 window.jsTestIsAsync = true;
13
14 var frameDiv;
15 var closedSocket;
16 var closeCode;
17
18 var ws = new WebSocket("ws://127.0.0.1:8880/close-on-unload");
19 ws.onopen = function()
20 {
21 debug("PASS ws on master document is ready.");
22 frameDiv = document.createElement("iframe");
23 frameDiv.src = "resources/close-on-unload-iframe.html";
24 document.body.appendChild(frameDiv);
25 debug("PASS insert a iframe, where open ws called 'socket1'");
26 };
27 ws.onmessage = function(evt)
28 {
29 var messageData = JSON.parse(evt.data);
30 closedSocket = messageData.message;
31 closeCode = messageData.closeCode;
32 ws.close();
33 };
34 ws.onclose = function()
35 {
36 shouldBe("closedSocket", '"socket1"');
37 shouldBe("closeCode", '"1001"');
38 finishJSTest();
39 };
40
41 document.iframeReady = function()
42 {
43 debug("PASS 'socket1' is sent to the server. unload the iframe and force gar bage collection. expect receiving 'socket1' on ws and no crash...");
44 document.body.removeChild(frameDiv);
45 gc();
46 };
47
48 </script>
49 </body>
50 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698