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