OLD | NEW |
1 <html> | 1 <html> |
2 <head> | 2 <head> |
3 <script src="../../js/resources/js-test-pre.js"></script> | 3 <script src="../../../resources/js-test.js"></script> |
4 </head> | 4 </head> |
5 <body> | 5 <body> |
6 | 6 |
7 <script> | 7 <script> |
8 description("This tests that customized properties on window.location and window
.navigator won't get lost after garbage collection. Results may be different whe
n run manually, since forcing GC may not be exposed in all applications. Browser
s disagree about what happens to properties on window.screen, window.history, an
d others through 'toolbar' in the list below, but the behavior of window.locatio
n and window.navigator is consistent."); | 8 description("This tests that customized properties on window.location and window
.navigator won't get lost after garbage collection. Results may be different whe
n run manually, since forcing GC may not be exposed in all applications. Browser
s disagree about what happens to properties on window.screen, window.history, an
d others through 'toolbar' in the list below, but the behavior of window.locatio
n and window.navigator is consistent."); |
9 | 9 |
10 function check(name, shouldSurvive) { | 10 function check(name, shouldSurvive) { |
11 window[name].myProp = 10; | 11 window[name].myProp = 10; |
12 gc(); | 12 gc(); |
13 if (shouldSurvive) | 13 if (shouldSurvive) |
14 shouldBe("window." + name + ".myProp", "10"); | 14 shouldBe("window." + name + ".myProp", "10"); |
15 else | 15 else |
16 shouldBeUndefined("window." + name + ".myProp"); | 16 shouldBeUndefined("window." + name + ".myProp"); |
17 } | 17 } |
18 | 18 |
19 check("screen", true); | 19 check("screen", true); |
20 check("history", true); | 20 check("history", true); |
21 check("locationbar", true); | 21 check("locationbar", true); |
22 check("menubar", true); | 22 check("menubar", true); |
23 check("personalbar", true); | 23 check("personalbar", true); |
24 check("scrollbars", true); | 24 check("scrollbars", true); |
25 check("statusbar", true); | 25 check("statusbar", true); |
26 check("toolbar", true); | 26 check("toolbar", true); |
27 | 27 |
28 check("location", true); | 28 check("location", true); |
29 check("navigator", true); | 29 check("navigator", true); |
30 </script> | 30 </script> |
31 </body> | 31 </body> |
32 </html> | 32 </html> |
OLD | NEW |