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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/events/message-port-inactive-document.html

Issue 1903873004: Deprecate window.postMessage(m, transferables, origin) overload. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased Created 4 years, 7 months 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
1 <body> 1 <body>
2 <p>Test that messaging an inactive frameless document works as expected.</p> 2 <p>Test that messaging an inactive frameless document works as expected.</p>
3 <pre id=log></pre> 3 <pre id=log></pre>
4 <script> 4 <script>
5 function gc() 5 function gc()
6 { 6 {
7 if (window.GCController) 7 if (window.GCController)
8 return GCController.collect(); 8 return GCController.collect();
9 9
10 for (var i = 0; i < 10000; i++) { // > force garbage collection (FF requires about 9K allocations before a collect) 10 for (var i = 0; i < 10000; i++) { // > force garbage collection (FF requires about 9K allocations before a collect)
(...skipping 11 matching lines...) Expand all
22 testRunner.waitUntilDone(); 22 testRunner.waitUntilDone();
23 } 23 }
24 24
25 var otherDocument; 25 var otherDocument;
26 var mainPort; 26 var mainPort;
27 27
28 function test() 28 function test()
29 { 29 {
30 otherDocument = window.frames[0].document; 30 otherDocument = window.frames[0].document;
31 var channel = new MessageChannel; 31 var channel = new MessageChannel;
32 window.frames[0].postMessage("msg", [channel.port2], "*"); 32 window.frames[0].postMessage("msg", "*", [channel.port2]);
33 mainPort = channel.port1; 33 mainPort = channel.port1;
34 mainPort.start(); 34 mainPort.start();
35 35
36 mainPort.postMessage("ping"); 36 mainPort.postMessage("ping");
37 mainPort.onmessage = test2; 37 mainPort.onmessage = test2;
38 } 38 }
39 39
40 function test2() 40 function test2()
41 { 41 {
42 var frameElement = document.getElementsByTagName("iframe")[0]; 42 var frameElement = document.getElementsByTagName("iframe")[0];
(...skipping 20 matching lines...) Expand all
63 63
64 log("Didn't crash, freeze or respond: SUCCESS"); 64 log("Didn't crash, freeze or respond: SUCCESS");
65 65
66 if (window.testRunner) 66 if (window.testRunner)
67 testRunner.notifyDone(); 67 testRunner.notifyDone();
68 } 68 }
69 69
70 </script> 70 </script>
71 <iframe src="resources/message-port-iframe.html" onload="test()" width=0 height= 0 frameborder=0></iframe> 71 <iframe src="resources/message-port-iframe.html" onload="test()" width=0 height= 0 frameborder=0></iframe>
72 </body> 72 </body>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698