OLD | NEW |
| (Empty) |
1 <html> | |
2 <script> | |
3 if (window.layoutTestController) | |
4 layoutTestController.dumpAsText(); | |
5 | |
6 function CollectGarbage() { | |
7 if (window.gc) { | |
8 // Chrome code | |
9 window.gc(); | |
10 } else { | |
11 // Safari hack | |
12 for (var i = 0; i < 50000; i++) | |
13 new Object(); | |
14 } | |
15 } | |
16 | |
17 | |
18 function check(name) { | |
19 if (!window[name]) return; | |
20 | |
21 window[name].myProp = 10; | |
22 CollectGarbage(); | |
23 var r = document.getElementById("result"); | |
24 if (window[name].myProp) { | |
25 r.innerHTML += name + ".myProp survived GC.<br>"; | |
26 } else { | |
27 r.innerHTML += name + ".myProp did not survive GC.<br>"; | |
28 } | |
29 } | |
30 | |
31 function runTest() { | |
32 check("screen"); | |
33 check("history"); | |
34 check("locationbar"); | |
35 check("menubar"); | |
36 check("personalbar"); | |
37 check("scrollbars"); | |
38 check("statusbar"); | |
39 check("toolbar"); | |
40 check("location"); | |
41 check("navigator"); | |
42 } | |
43 </script> | |
44 | |
45 <body onload="runTest()"> | |
46 This tests that customized properties on window.location and window.navigator | |
47 won't get lost after a GC. | |
48 <div id="result">TEST running.<br></div> | |
49 </body> | |
50 </html> | |
OLD | NEW |