| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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> |
| OLD | NEW |