2 if (window.layoutTestController) {
3 layoutTestController.dumpAsText();
4 layoutTestController.waitUntilDone();
8 var gc_stuff = new Array();
10 gc_and_crash = function() {
11 if (this.GCController)
12 GCController.collect();
14 // V8 needs that many objects to run GC.
15 for(i = 0; i < 100000; i++) {
22 // If the bug 43140 is regressed, this will crash, at least in v8-based ports.
25 document.getElementById("log").innerText = "PASS";
26 if (window.layoutTestController)
27 layoutTestController.notifyDone();
31 var iframe = document.getElementById("iframe");
32 var channel = new iframe.contentWindow.MessageChannel();
35 iframe.onload = function() { gc_and_crash(); }
36 iframe.src = "data:text/html,<body>Hello!" ;
39 <body onload="test()">
40 <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>
42 <iframe style="display:none" id=iframe></iframe>