blob: 0ecc46e1e39bb8c13e855fcb7f67e45c1d77e041 [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<script src="../resources/js-test-pre.js"></script>
</head>
<body>
<iframe id="testFrame" src="resources/performance-observer-no-document-leak-frame.html"></iframe>
<script>
description("Tests that using PerformanceObserver does not cause the document to get leaked.");
window.jsTestIsAsync = true;
function documentShouldDie(documentIdentifier)
{
return new Promise(function(resolve, reject) {
handle = setInterval(function() {
gc();
if (!internals.isDocumentAlive(documentIdentifier)) {
clearInterval(handle);
resolve();
}
}, 10);
});
}
onload = function() {
setTimeout(function() {
let frameDocumentIdentifier = internals.documentIdentifier(testFrame.contentDocument);
testFrame.remove();
documentShouldDie(frameDocumentIdentifier).then(function() {
testPassed("Document did not leak");
finishJSTest();
});
}, 10);
}
</script>
<script src="../resources/js-test-post.js"></script>
</body>
</html>