blob: 4e07380f24ded7e92383951e671bc9dae452b034 [file] [log] [blame]
<html>
<head>
<script src="resources/print.js"></script>
<script>
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.waitUntilDone();
}
var count = 0;
var maxCount = 10;
var timeout = 100;
document.addEventListener("beforeload", function(event) {
if (event.target && event.target.parentElement)
event.target.parentElement.removeChild(event.target);
}, true);
</script>
</head>
<body>
<p>This page tests that you can correctly remove a flash object in a beforeload listener without causing a crash.</p>
<object type="application/x-shockwave-flash" data="../../../plugins/resources/simple_blank.swf"></object>
<embed type="application/x-shockwave-flash" src="../../../plugins/resources/simple_blank.swf"></object>
<div id="console"></div>
<script>
function checkObjectRemoval()
{
if (!document.getElementsByTagName("object").length) {
print("PASS", "green");
if (window.testRunner)
testRunner.notifyDone();
return;
}
if (++count > maxCount) {
print("FAIL", "red");
if (window.testRunner)
testRunner.notifyDone();
return;
}
setTimeout("checkObjectRemoval()", timeout);
}
setTimeout("checkObjectRemoval()", timeout);
</script>
</body>
</html>