Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / plugins / plugin-remove-readystatechange.html
blob8b37b6abeae5bada19a4728c34c4a3f00a6bad7d
1 <!DOCTYPE html>
2 <html>
3 <body>
4 <div>
5 This test passes if it does not trip an assert in debug builds.
6 It ensures a readystatechange event can't get dispatched until after a plugin is fully removed.
7 </div>
8 <embed id="viewer" src="resources/simple_blank.swf"></embed>
9 <script>
10 if (window.testRunner)
11 testRunner.dumpAsText();
13 var i = 0;
14 document.addEventListener('readystatechange', function() {
15 if (i == 1) {
16 try {
17 document.body.appendChild(document.getElementById('viewer'));
19 catch (e) {
20 alert('PASS: element could not be re-appended');
23 i++;
24 });
26 window.addEventListener('DOMContentLoaded', function() {
27 document.body.removeChild(document.getElementById('viewer'));
28 });
30 // FIXME: This shouldn't be needed, but it's here to make our whitespace text node
31 // creation deterministic in the face of lazily creating the render tree.
32 document.body.offsetHeight;
33 </script>
34 </body>
35 </html>