Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <html> | 2 <html> |
| 3 <body> | 3 <body> |
| 4 <iframe id="frame"></iframe> | 4 <iframe id="frame"></iframe> |
| 5 | 5 |
| 6 <script src="../../resources/js-test.js"></script> | 6 <script src="../../resources/js-test.js"></script> |
| 7 <script> | 7 <script> |
| 8 if (!window.internals) { | 8 if (!window.internals) { |
| 9 debug("This test only runs on \"content_shell --dump-render-tree\", as it re quires existence of window.internals."); | 9 debug("This test only runs on \"content_shell --dump-render-tree\", as it re quires existence of window.internals."); |
| 10 } else { | 10 } else { |
| 11 gc(); | 11 testRunner.waitUntilDone(); |
|
wibling-chromium
2014/04/01 13:26:09
Can't we wait at the end to ensure we don't exit t
Mads Ager (chromium)
2014/04/01 13:45:38
This is setting a flag in the test runner that thi
| |
| 12 var documentsBefore = window.internals.numberOfLiveDocuments(); | 12 var documentsBefore; |
| 13 var documentsAfter; | |
| 14 collectGarbage(function() { | |
| 15 documentsBefore = window.internals.numberOfLiveDocuments(); | |
| 13 | 16 |
| 14 var frame = document.getElementById('frame'); | 17 var frame = document.getElementById('frame'); |
| 15 frame.contentDocument.body.innerHTML = '<form></form>'; | 18 frame.contentDocument.body.innerHTML = '<form></form>'; |
| 16 document.body.removeChild(frame); | 19 document.body.removeChild(frame); |
| 17 frame = null; | 20 frame = null; |
| 18 | 21 |
| 19 gc(); | 22 collectGarbage(function() { |
| 20 var documentsAfter = window.internals.numberOfLiveDocuments(); | 23 documentsAfter = window.internals.numberOfLiveDocuments(); |
| 21 | 24 |
| 22 // -1 is from removing frame itself. | 25 // -1 is from removing frame itself. |
| 23 shouldBe('documentsBefore - 1', 'documentsAfter'); | 26 shouldBe('documentsBefore - 1', 'documentsAfter'); |
| 27 testRunner.notifyDone(); | |
| 28 }); | |
| 29 }); | |
| 24 } | 30 } |
| 25 </script> | 31 </script> |
| 26 </body> | 32 </body> |
| 27 </html> | 33 </html> |
| OLD | NEW |