| 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 --run-layout-test\", as it req
uires existence of window.internals."); | 9 debug("This test only runs on \"content_shell --run-layout-test\", as it req
uires existence of window.internals."); |
| 10 } else { | 10 } else { |
| 11 testRunner.waitUntilDone(); | 11 testRunner.waitUntilDone(); |
| 12 window.jsTestIsAsync = true; | 12 window.jsTestIsAsync = true; |
| 13 var documentsBefore; | 13 var documentsBefore; |
| 14 var documentsAfter; | 14 var documentsAfter; |
| 15 // FIXME(keishi): Calling asyncGC twice to fix flakiness. | 15 // FIXME(keishi): Calling asyncGC twice to fix flakiness, crbug.com/674194 |
| 16 asyncGC(function() { | 16 asyncGC(function() { |
| 17 asyncGC(function() { | 17 asyncGC(function() { |
| 18 documentsBefore = window.internals.numberOfLiveDocuments(); | 18 documentsBefore = window.internals.numberOfLiveDocuments(); |
| 19 | 19 |
| 20 var frame = document.getElementById('frame'); | 20 var frame = document.getElementById('frame'); |
| 21 frame.contentDocument.body.innerHTML = '<form></form>'; | 21 frame.contentDocument.body.innerHTML = '<form></form>'; |
| 22 document.body.removeChild(frame); | 22 document.body.removeChild(frame); |
| 23 frame = null; | 23 frame = null; |
| 24 | 24 |
| 25 // FIXME(keishi): crbug.com/674194 |
| 25 asyncGC(function() { | 26 asyncGC(function() { |
| 26 documentsAfter = window.internals.numberOfLiveDocuments(); | 27 asyncGC(function() { |
| 28 documentsAfter = window.internals.numberOfLiveDocuments(); |
| 27 | 29 |
| 28 // -1 is from removing frame itself. | 30 // -1 is from removing frame itself. |
| 29 shouldBe('documentsBefore - 1', 'documentsAfter'); | 31 shouldBe('documentsBefore - 1', 'documentsAfter'); |
| 30 finishJSTest(); | 32 finishJSTest(); |
| 33 }); |
| 31 }); | 34 }); |
| 32 }); | 35 }); |
| 33 }); | 36 }); |
| 34 } | 37 } |
| 35 </script> | 38 </script> |
| 36 </body> | 39 </body> |
| 37 </html> | 40 </html> |
| OLD | NEW |