• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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>
9testRunner.dumpAsText();
10testRunner.waitUntilDone();
11
12var iframe = document.querySelector('iframe');
13var count = 0;
14var totalRuns = 5;
15
16iframe.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.
28iframe.srcdoc = "<body><input autofocus></body>";
29</script>
30
31