| OLD | NEW |
| 1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> | 1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <script src="../../fast/js/resources/js-test-pre.js"></script> | 4 <script src="../../fast/js/resources/js-test-pre.js"></script> |
| 5 </head> | 5 </head> |
| 6 <body> | 6 <body> |
| 7 <script> | 7 <script> |
| 8 description("Test that a plugin that fails to release the window script object d
oesn't result in the window's document being leaked"); | 8 description("Test that a plugin that fails to release the window script object d
oesn't result in the window's document being leaked"); |
| 9 | 9 |
| 10 if (window.internals) { | 10 if (window.internals) { |
| 11 // Test that the live document count returns to the initial value, rather th
an to a specific value, so this test is robust to leaks in preceding tests. | 11 // Test that the live document count returns to the initial value, rather th
an to a specific value, so this test is robust to leaks in preceding tests. |
| 12 gc(); | 12 gc(); |
| 13 gc(); // FIXME: Unclear why this is needed, see crbug.com/307614 | 13 gc(); // FIXME: Unclear why this is needed, see crbug.com/307614 |
| 14 var initialLiveDocumentCount = window.internals.numberOfLiveDocuments(); | 14 var initialLiveDocumentCount = window.internals.numberOfLiveDocuments(); |
| 15 | 15 |
| 16 var iframe = document.createElement('iframe'); | 16 var iframe = document.createElement('iframe'); |
| 17 document.body.appendChild(iframe); | 17 document.body.appendChild(iframe); |
| 18 iframe.contentWindow.document.documentElement.innerHTML = '<embed id="plugin
" type="application/x-webkit-test-netscape" test="leak-window-scriptable-object"
></embed>'; | 18 iframe.contentWindow.document.documentElement.innerHTML = '<embed id="plugin
" type="application/x-webkit-test-netscape" test="leak-window-scriptable-object"
></embed>'; |
| 19 | 19 |
| 20 shouldBeTrue("window.internals.numberOfLiveDocuments() > initialLiveDocument
Count"); | 20 shouldBeTrue("window.internals.numberOfLiveDocuments() > initialLiveDocument
Count"); |
| 21 | 21 |
| 22 document.body.removeChild(iframe); | 22 document.body.removeChild(iframe); |
| 23 | 23 |
| 24 gc(); | 24 gc(); |
| 25 shouldBeTrue("window.internals.numberOfLiveDocuments() == initialLiveDocumen
tCount"); | 25 shouldBeTrue("window.internals.numberOfLiveDocuments() == initialLiveDocumen
tCount"); |
| 26 } | 26 } |
| 27 | 27 |
| 28 var successfullyParsed = true; | 28 var successfullyParsed = true; |
| 29 </script> | 29 </script> |
| 30 <script src="../../fast/js/resources/js-test-post.js"></script> | |
| 31 </body> | 30 </body> |
| 32 </html> | 31 </html> |
| OLD | NEW |