3 <script src=
"../../../resources/js-test.js"></script>
4 <script src=
"resources/window-property-collector.js"></script>
7 var propertiesToVerify
= [];
9 function insertExpectedResult(path
, expected
)
13 var propertyDir
= path
.slice(0, -1).join('.');
14 var cachedPropertyDir
= "cached_" + propertyDir
.replace('.', '_');
15 window
[cachedPropertyDir
] = eval("childWindow." + propertyDir
);
16 propertiesToVerify
.push({
17 'property': ["window", cachedPropertyDir
, path
[path
.length
- 1]].join("."),
24 description("Tests access of cached DOMWindow properties after the associated frame is no longer in a web page. Test should not crash and properties should be set to sane defaults.");
25 var frame
= document
.getElementById("frame");
26 childWindow
= frame
.contentWindow
;
27 // Have expected results assume that the frame hasn't been closed (=> window.closed = false.)
28 collectProperties(false);
29 frame
.parentNode
.removeChild(frame
);
30 for (var i
= 0; i
< propertiesToVerify
.length
; ++i
)
31 shouldBe(propertiesToVerify
[i
].property
, propertiesToVerify
[i
].expected
);
36 <iframe id=
"frame" src=
"about:blank" onload=
"runTest()"></iframe>