summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/forms/associatedFormControls-leak-nodes.html
blob: 40612b1c2fff41b453594618acc6694dc6d81454 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<!DOCTYPE html>
<html>
<body>
<iframe id="frame"></iframe>

<script src="../../resources/js-test.js"></script>
<script>
if (!window.internals) {
    debug("This test only runs on \"content_shell --run-layout-test\", as it requires existence of window.internals.");
} else {
    testRunner.waitUntilDone();
    window.jsTestIsAsync = true;
    var documentsBefore;
    var documentsAfter;
    asyncGC(function() {
        documentsBefore = window.internals.numberOfLiveDocuments();

        var frame = document.getElementById('frame');
        frame.contentDocument.body.innerHTML = '<form></form>';
        document.body.removeChild(frame);
        frame = null;

        asyncGC(function() {
            documentsAfter = window.internals.numberOfLiveDocuments();

            // -1 is from removing frame itself.
            shouldBe('documentsBefore - 1', 'documentsAfter');
            finishJSTest();
        });
    });
}
</script>
</body>
</html>