blob: e8765b91dd427b6b4cc45c8aeea6749c8de95be7 [file] [log] [blame]
<body>
<p>Test that delivering a message to a port that was never referenced from JS doesn't cause a crash.</p>
<pre id=log></pre>
<script>
function gc()
{
if (window.GCController)
return GCController.collect();
for (var i = 0; i < 10000; i++) { // > force garbage collection (FF requires about 9K allocations before a collect)
var s = new String("abc");
}
}
function log(message)
{
document.getElementById("log").innerHTML += message + "<br>";
}
if (window.layoutTestController) {
layoutTestController.dumpAsText();
layoutTestController.waitUntilDone();
}
var channel = new MessageChannel;
channel.port1.postMessage("msg");
channel.port1.start();
channel = 0;
gc();
setTimeout("log('PASS'); if (window.layoutTestController) layoutTestController.notifyDone()", 100);
</script>
</body>