blob: d355f563f63b48075c4fd5cae7a676ede9344f1e [file] [log] [blame]
<script src="/js-test-resources/js-test-pre.js"></script>
<script>
if (window.testRunner) {
testRunner.waitUntilDone();
testRunner.dumpAsText();
}
function loaded() {
// If the garbage collection causes the image load to stop and therefore causes the load event to fire on the main frame, we failed.
alert("FAIL: The load event fired");
if (window.testRunner)
testRunner.notifyDone();
}
</script>
<body onload="loaded();">
This test has an image inside a div. It removes the div, forces garbage collection, and makes sure that the window load event does not fire. It also makes sure there is no crash.<br>
<div id="thediv">
<img src="resources/slowimage.php">
</div>
</body>
<script>
function finished() {
window.stop()
if (window.testRunner)
testRunner.notifyDone();
}
function forceGC() {
gc();
setTimeout("finished();", 0);
}
function removeTheDiv() {
var element = window.document.getElementById("thediv");
element.parentNode.removeChild(element);
element = null;
setTimeout("forceGC();", 0);
}
setTimeout("removeTheDiv();", 0);
</script>