<!DOCTYPE html>
<script src="../../resources/js-test.js"></script>
<script>

description('Tests that we do not hold on to any nodes');

gc();

function numberOfLiveNodes() {
    return window.internals && window.internals.numberOfLiveNodes && window.internals.numberOfLiveNodes();
}

var beforeCount = numberOfLiveNodes();

var f = document.createElement('form');
var i = f.appendChild(document.createElement('input'));
i.setAttribute('onclick', '');
f.removeChild(i);
f = null;
i = null;
gc();

var afterCount = numberOfLiveNodes();

shouldBe('afterCount - beforeCount', '0');

</script>

<!DOCTYPE html>
<script src="../../resources/js-test.js"></script>
<script>

description('Tests that we do not hold on to any nodes');

jsTestIsAsync = true;

function numberOfLiveNodes() {
    return window.internals && window.internals.numberOfLiveNodes && window.internals.numberOfLiveNodes();
}

var afterCount;
var beforeCount;

asyncGC(function() {
    beforeCount = numberOfLiveNodes();
    var f = document.createElement('form');
    var i = f.appendChild(document.createElement('input'));
    i.setAttribute('onclick', '');
    f.removeChild(i);
    f = null;
    i = null;
    asyncGC(function() {
        afterCount = numberOfLiveNodes();
        shouldBe('afterCount - beforeCount', '0');
        finishJSTest();
    });
});


</script>

Make fast/dom/inline-attributes-release.html deterministic by making sure that we get precise GCs before testing that objects disappear.
Make fast/dom/inline-attributes-release.html deterministic by making
sure that we get precise GCs before testing that objects disappear.

This test is flaky on the buildbot because the GCs forced in the test
are conservative. Make the precise by using asyncGC.

R=haraken@chromium.org, zerny@chromium.org

Review URL: https://codereview.chromium.org/300783002

git-svn-id: bf5cd6ccde378db821296732a091cfbcf5285fbd@174861 bbb929c8-8fbe-4397-9dbb-9b2b20218538
