OLD | NEW |
1 <html> | 1 <html> |
2 <head> | 2 <head> |
3 <script src="../../../resources/js-test.js"></script> | 3 <script src="../../../resources/js-test.js"></script> |
4 <script src="resources/window-property-collector.js"></script> | 4 <script src="resources/window-property-collector.js"></script> |
5 <script> | 5 <script> |
6 var jsTestIsAsync = true; | 6 var jsTestIsAsync = true; |
7 | 7 |
8 var childWindow; | 8 var childWindow; |
9 var propertiesToVerify = []; | 9 var propertiesToVerify = []; |
10 | 10 |
(...skipping 11 matching lines...) Expand all Loading... |
22 } | 22 } |
23 | 23 |
24 function runTest() | 24 function runTest() |
25 { | 25 { |
26 description("Tests access of cached DOMWindow properties after the associate
d frame is removed from a web page and garbage collected. Test should not crash
and properties should be set to sane defaults."); | 26 description("Tests access of cached DOMWindow properties after the associate
d frame is removed from a web page and garbage collected. Test should not crash
and properties should be set to sane defaults."); |
27 var frame = document.getElementById("frame"); | 27 var frame = document.getElementById("frame"); |
28 childWindow = frame.contentWindow; | 28 childWindow = frame.contentWindow; |
29 // Have expected results assume that the frame has been closed (=> window.cl
osed = true.) | 29 // Have expected results assume that the frame has been closed (=> window.cl
osed = true.) |
30 collectProperties(true); | 30 collectProperties(true); |
31 frame.parentNode.removeChild(frame); | 31 frame.parentNode.removeChild(frame); |
32 window.setTimeout(verifyResults, 0); | 32 asyncGC(function () { |
33 } | 33 for (var i = 0; i < propertiesToVerify.length; ++i) |
34 | 34 shouldBe(propertiesToVerify[i].property, propertiesToVerify[i].expec
ted); |
35 function verifyResults() | 35 finishJSTest(); |
36 { | 36 }); |
37 if (window.gc) | |
38 gc(); | |
39 for (var i = 0; i < propertiesToVerify.length; ++i) | |
40 shouldBe(propertiesToVerify[i].property, propertiesToVerify[i].expected)
; | |
41 finishJSTest(); | |
42 } | 37 } |
43 </script> | 38 </script> |
44 </head> | 39 </head> |
45 <body> | 40 <body> |
46 <iframe id="frame" src="about:blank" onload="runTest()"></iframe> | 41 <iframe id="frame" src="about:blank" onload="runTest()"></iframe> |
47 </body> | 42 </body> |
48 </html> | 43 </html> |
OLD | NEW |