leak-observer-nonmain-world.html 859 B

123456789101112131415161718192021222324252627282930
  1. <!DOCTYPE html>
  2. <p>Test that using mutation observers from the non-main world doesn't leak the document.</p>
  3. <p>Expected output of this test is LEAK: 28 WebCoreNode</p>
  4. <iframe></iframe>
  5. <script>
  6. testRunner.dumpAsText();
  7. testRunner.waitUntilDone();
  8. var iframe = document.querySelector('iframe');
  9. var count = 0;
  10. var totalRuns = 5;
  11. iframe.onload = function() {
  12. if (count++ < totalRuns) {
  13. testRunner.evaluateScriptInIsolatedWorld(1, 'new MutationObserver(function(){}).observe(document, {childList: true, subtree: true});');
  14. iframe.srcdoc = "<body><input autofocus></body>";
  15. GCController.collect();
  16. } else {
  17. GCController.collect();
  18. testRunner.notifyDone();
  19. }
  20. };
  21. // Need autofocus since evaluateScriptInIsolatedWorld runs in the focused frame.
  22. iframe.srcdoc = "<body><input autofocus></body>";
  23. </script>