| testRunner.waitUntilDone(); |
| var gc_stuff = new Array(); |
| gc_and_crash = function() { |
| // V8 needs that many objects to run GC. |
| for(i = 0; i < 100000; i++) { |
| // If the bug 43140 is regressed, this will crash, at least in v8-based ports. |
| document.getElementById("log").innerText = "PASS"; |
| var iframe = document.getElementById("iframe"); |
| var channel = new iframe.contentWindow.MessageChannel(); |
| iframe.onload = function() { gc_and_crash(); } |
| iframe.src = "data:text/html,<body>Hello!" ; |
| <p>Test that MessagePort is properly closed when its owning context goes away. The test succeeds if it doesn't crash and prints "PASS" below. See https://bugs.webkit.org/show_bug.cgi?id=43140 for more details.</p> |
| <iframe style="display:none" id=iframe></iframe> |