<!DOCTYPE html>
<script>
if (window.testRunner) {
    testRunner.dumpAsText();
    testRunner.dumpChildFramesAsText();
    testRunner.waitUntilDone();
}
</script>
<body>
<iframe id="frame1" name="frame1"></iframe>
<iframe id="frame2" name="frame2"></iframe>
<script>

(function() {
    var iframe1 = document.querySelector("#frame1").contentWindow;
    var iframe2Node = document.querySelector("#frame2");
    var iframe2 = iframe2Node.contentWindow;

    if(iframe2.internals)
        iframe2.internals.queueMicroTask(2);
    if(iframe1.internals)
        iframe1.internals.queueMicroTask(1);
    if(window.internals)
        internals.queueMicroTask(0);
    document.body.removeChild(iframe2Node);
}());

if (window.GCController)
    GCController.collect();

console.log("Finished queueing tests.");
requestAnimationFrame(function() {
    if (window.testRunner)
        testRunner.notifyDone();
});
</script>
</body>
