blob: 9b02026e47e83208c25f1c33f3f73d7ee054a5fd [file] [log] [blame]
<!DOCTYPE html>
<script src = "../../resources/testharness.js"></script>
<script src = "../../resources/testharnessreport.js"></script>
<script>
var t = async_test("Don't reuse disposed FrameView for <embed>");
onload = t.unreached_func("window load should not fire before embed load");
function embedLoaded() {
var video = document.createElement("video");
video.poster = "foo";
document.querySelector('iframe').srcdoc = "data:text/html,bar";
setTimeout(function() {
var embed = document.querySelector('embed');
embed.align = "right";
embed.height = "28";
embed.type = "foo";
onload = t.step_func(function () {
var object = document.createElement("object");
// Trying to access a named property on <object> will run post layout tasks
// synchronously from HTMLPluginElement::layoutPartForJSBindings(). Make sure
// it doesn't try to re-load a persisted FrameView for a detached frame.
object.whatever = "anything";
// Getting here without crashing implies the test passed.
t.done();
});
// This will cause detach the embed and iframe element, which will cause the
// window load event to fire, since all loading subframes will have been
// detached.
document.body.innerText = "";
}, 0);
};
</script>
<embed onload="embedLoaded()" src="foo"></embed>
<iframe></iframe>