Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <!DOCTYPE html> | |
| 2 <script src = "../../resources/testharness.js"></script> | |
| 3 <script src = "../../resources/testharnessreport.js"></script> | |
| 4 <script> | |
| 5 var t = async_test("Don't reuse disposed FrameView for <embed>"); | |
| 6 | |
| 7 onload = t.unreached_func("window load should not fire before embed load"); | |
| 8 | |
| 9 function embedLoaded() { | |
| 10 var video = document.createElement("video"); | |
| 11 video.poster = "foo"; | |
|
dcheng
2016/12/17 09:09:43
I have no idea why this is necessary.
| |
| 12 | |
| 13 document.querySelector('iframe').srcdoc = "data:text/html,bar"; | |
| 14 | |
| 15 setTimeout(function() { | |
| 16 var embed = document.querySelector('embed'); | |
| 17 embed.align = "right"; | |
| 18 embed.height = "28"; | |
| 19 embed.type = "foo"; | |
|
dcheng
2016/12/17 09:09:43
Similarly, all three of these lines are necessary.
| |
| 20 | |
| 21 onload = t.step_func(function () { | |
| 22 var object = document.createElement("object"); | |
| 23 // Trying to access a named property on <object> will run post layout task s | |
| 24 // synchronously from HTMLPluginElement::layoutPartForJSBindings(). Make s ure | |
| 25 // it doesn't try to re-load a persisted FrameView for a detached frame. | |
| 26 object.whatever = "anything"; | |
| 27 | |
| 28 // Getting here without crashing implies the test passed. | |
| 29 t.done(); | |
| 30 }); | |
| 31 | |
| 32 // This will cause detach the embed and iframe element, which will cause the | |
| 33 // window load event to fire, since all loading subframes will have been | |
| 34 // detached. | |
| 35 document.body.innerText = ""; | |
| 36 }, 0); | |
| 37 }; | |
| 38 </script> | |
| 39 <embed onload="embedLoaded()" src="foo"></embed> | |
| 40 <iframe></iframe> | |
| OLD | NEW |