chromium/third_party/blink/web_tests/http/tests/misc/object-image-load-outlives-gc-without-crashing.html

<script src="/js-test-resources/js-test.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 has an object element representing an image.  That object element is wrapped in 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">
<object type="image/gif" data="resources/slowimage.php">
</object>
</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>