blob: db5b3d148c35b4086526fc1b69f45e0162e6c06b [file] [log] [blame]
<!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 CSS 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;
gc();
setTimeout(function () {
debug("The iframe has been destroyed.");
shouldBe("internals.numberOfLiveDocuments()", "numberOfLiveDocumentsAfterIframeLoaded - 1");
debug("");
finishJSTest();
});
}
frame.src = 'resources/animation-leak-iframe.html';
}
</script>
<script src="../resources/js-test-post.js"></script>
</body>
</html>