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 childWindow; | 6 var childWindow; |
7 var propertiesToVerify = []; | 7 var propertiesToVerify = []; |
8 | 8 |
9 function insertExpectedResult(path, expected) | 9 function insertExpectedResult(path, expected) |
10 { | 10 { |
11 var propertyPath = path.join('.'); | 11 var propertyPath = path.join('.'); |
12 propertiesToVerify.push({'property': "childWindow." + propertyPath, 'expecte
d': expected}); | 12 propertiesToVerify.push({'property': "childWindow." + propertyPath, 'expecte
d': expected}); |
13 } | 13 } |
14 | 14 |
15 function runTest() | 15 function runTest() |
16 { | 16 { |
17 description("Tests property access on a cached DOMWindow after the associate
d frame is no longer in a web page. Test should not crash and properties should
be set to sane defaults."); | 17 description("Tests property access on a cached DOMWindow after the associate
d frame is no longer in a web page. Test should not crash and properties should
be set to sane defaults."); |
18 var frame = document.getElementById("frame"); | 18 var frame = document.getElementById("frame"); |
19 childWindow = frame.contentWindow; | 19 childWindow = frame.contentWindow; |
20 collectProperties(); | 20 // Have expected results assume that the frame has been closed (=> window.cl
osed = true.) |
| 21 collectProperties(true); |
21 frame.parentNode.removeChild(frame); | 22 frame.parentNode.removeChild(frame); |
22 for (var i = 0; i < propertiesToVerify.length; ++i) | 23 for (var i = 0; i < propertiesToVerify.length; ++i) |
23 shouldBe(propertiesToVerify[i].property, propertiesToVerify[i].expected)
; | 24 shouldBe(propertiesToVerify[i].property, propertiesToVerify[i].expected)
; |
24 } | 25 } |
25 </script> | 26 </script> |
26 </head> | 27 </head> |
27 <body> | 28 <body> |
28 <iframe id="frame" src="about:blank" onload="runTest()"></iframe> | 29 <iframe id="frame" src="about:blank" onload="runTest()"></iframe> |
29 </body> | 30 </body> |
30 </html> | 31 </html> |
OLD | NEW |