| <!DOCTYPE html> |
| <html> |
| <body onload="runTest()"> |
| <script src="../resources/js-test-pre.js"></script> |
| <script> |
| description("This test asserts that Document doesn't leak when a Web Animation is created."); |
| |
| if (window.internals) |
| jsTestIsAsync = true; |
| |
| gc(); |
| |
| var numberOfLiveDocumentsAfterIframeLoaded = 0; |
| |
| function runTest() { |
| if (!window.internals) |
| return; |
| |
| var frame = document.body.appendChild(document.createElement("iframe")); |
| |
| frame.onload = function() { |
| if (frame.src === 'about:blank') |
| return true; |
| |
| numberOfLiveDocumentsAfterIframeLoaded = internals.numberOfLiveDocuments(); |
| debug("The iframe has finished loading."); |
| |
| frame.remove(); |
| frame = null; |
| |
| setTimeout(() => { |
| gc(); |
| setTimeout(function () { |
| debug("The iframe has been destroyed."); |
| shouldBe("internals.numberOfLiveDocuments()", "numberOfLiveDocumentsAfterIframeLoaded - 1"); |
| debug(""); |
| finishJSTest(); |
| }); |
| }); |
| } |
| |
| frame.src = 'resources/web-animation-leak-iframe.html'; |
| } |
| |
| </script> |
| <script src="../resources/js-test-post.js"></script> |
| </body> |
| </html> |