Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 <html> | 1 <html> |
| 2 <head> | 2 <head> |
| 3 <script src="../../fast/js/resources/js-test-pre.js"></script> | 3 <script src="../js/resources/js-test-pre.js"></script> |
| 4 </head> | 4 </head> |
| 5 <body> | 5 <body> |
| 6 <span>This test only runs on DumpRenderTree, as it requires existence of win dow.internals and cross-domain resource access check disabled.</span> | 6 <span>This test only runs on DumpRenderTree, as it requires existence of win dow.internals and cross-domain resource access check disabled.</span> |
| 7 <iframe id="f" src='about:blank'></iframe> | 7 <iframe id="f" src='about:blank'></iframe> |
| 8 <script> | 8 <script> |
| 9 description("This test asserts that document doesn't leak when a selecti on is created inside the document."); | 9 description("This test asserts that document doesn't leak when a NodeFil ter callback referencing the document is created."); |
| 10 | 10 |
| 11 jsTestIsAsync = true; | 11 jsTestIsAsync = true; |
| 12 if (!window.internals) | 12 if (!window.internals) |
| 13 finishJSTest(); | 13 finishJSTest(); |
| 14 | 14 |
| 15 function countNumberOfLiveDocuments() { | 15 function countNumberOfLiveDocuments() { |
| 16 gc(); | 16 gc(); |
| 17 return window.internals.numberOfLiveDocuments(); | 17 return window.internals.numberOfLiveDocuments(); |
| 18 } | 18 } |
| 19 | 19 |
| (...skipping 15 matching lines...) Expand all Loading... | |
| 35 | 35 |
| 36 frame.onload = function() { | 36 frame.onload = function() { |
| 37 // document unloaded... | 37 // document unloaded... |
| 38 | 38 |
| 39 numberOfDocumentsAfter = countNumberOfLiveDocuments(); | 39 numberOfDocumentsAfter = countNumberOfLiveDocuments(); |
| 40 shouldBe("numberOfDocumentsAfter", "numberOfDocumentsBefore"); | 40 shouldBe("numberOfDocumentsAfter", "numberOfDocumentsBefore"); |
| 41 finishJSTest(); | 41 finishJSTest(); |
| 42 } | 42 } |
| 43 frame.src = 'about:blank'; | 43 frame.src = 'about:blank'; |
| 44 } | 44 } |
| 45 frame.src='data:text/html;charset=utf-8,<span id="t"></span>'; | 45 var src = 'data:text/html;charset=utf-8,<script>' + |
| 46 'keepNodeIterator = document.createNodeIterator(document, Node Filter.SHOW_ELEMENT, function(node) { return NodeFilter.SHOW_ELEMENT; }, false); ' + | |
| 47 'keepTreeWalker = document.createTreeWalker(document, NodeFilt er.SHOW_ELEMENT, function(node) { return NodeFilter.SHOW_ELEMENT; }, false);' + | |
| 48 '</script'+'>'; | |
| 49 frame.src = src; | |
|
haraken
2013/08/01 13:32:20
I'm sorry I was misreading the tests in your previ
kouhei (in TOK)
2013/08/02 03:26:57
Done.
| |
| 46 </script> | 50 </script> |
| 47 <script src="../../fast/js/resources/js-test-post.js"></script> | 51 <script src="../js/resources/js-test-post.js"></script> |
| 48 </body> | 52 </body> |
| 49 </html> | 53 </html> |
| OLD | NEW |