| <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 an object element with an invalid data URL in its beforeload listener without causing a crash.</p> |
| <object data="does-not-exist.png">FAIL</object> |
| <object data="does-not-exist">FAIL</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> |
| |