| <!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> |