| <body onload="runTest()"> |
| <p>This test only runs on DumpRenderTree, as it requires existence of window.internals and cross-domain resource access check disabled.</p> |
| <iframe id="frame" src='about:blank'></iframe> |
| <script src="../../resources/js-test-pre.js"></script> |
| description("This test asserts that document doesn't leak when a selection is created inside the document."); |
| var originalNumberOfLiveDocuments = 0; |
| var frame = document.getElementById('frame'); |
| frame.onload = function() { |
| if (frame.src === 'about:blank') |
| var contentWindow = frame.contentWindow; |
| var element = contentWindow.document.getElementById("t"); |
| contentWindow.getSelection().setPosition(element, 0); |
| frame.onload = function() { |
| shouldBe("internals.numberOfLiveDocuments()", "originalNumberOfLiveDocuments"); |
| frame.src = 'about:blank'; |
| originalNumberOfLiveDocuments = internals.numberOfLiveDocuments(); |
| frame.src = 'data:text/html;charset=utf-8,<span id="t"></span>'; |
| var successfullyParsed = true; |
| <script src="../../resources/js-test-post.js"></script> |