3 <script src=
"../../../resources/js-test.js"></script>
4 <script src=
"resources/window-property-collector.js"></script>
6 var jsTestIsAsync
= true;
9 var propertiesToVerify
= [];
11 function insertExpectedResult(path
, expected
)
13 var propertyPath
= path
.join('.');
14 propertiesToVerify
.push({'property': "childWindow." + propertyPath
, 'expected': expected
});
19 description("Tests property access on a cached DOMWindow after the associated frame is removed from a web page and garbage collected. Test should not crash and properties should be set to sane defaults.");
20 var frame
= document
.getElementById("frame");
21 childWindow
= frame
.contentWindow
;
22 // Have expected results assume that the frame has been closed and GCed (=> window.closed = true.)
23 collectProperties(true);
24 frame
.parentNode
.removeChild(frame
);
26 for (var i
= 0; i
< propertiesToVerify
.length
; ++i
)
27 shouldBe(propertiesToVerify
[i
].property
, propertiesToVerify
[i
].expected
);
34 <iframe id=
"frame" src=
"about:blank" onload=
"runTest()"></iframe>