2 This page tests whether global declarations are cleared after a navigation.
3 If the test passes, you'll see a series of PASS messages below.
5 <pre id=
"console"></pre>
10 document
.getElementById("console").appendChild(document
.createTextNode(s
+ "\n"));
13 function shouldBe(evalA
, a
, b
)
16 log("PASS: " + a
+ " should be " + b
+ " and is.");
18 log("FAIL: " + a
+ " should be " + b
+ " but instead is " + evalA
+ ".");
23 function didFinishLoading(childWindow
) // called by subframes
25 log("\nPage " + count
+ ":");
27 shouldBe('x' in childWindow
, "'x' in childWindow", true);
28 shouldBe(childWindow
.x
, "childWindow.x", 1);
29 shouldBe('f' in childWindow
, "'f' in childWindow", true);
30 shouldBe(typeof childWindow
.f
, "childWindow.f", "function");
32 childWindow
.name
= "test";
34 childWindow
.location
= "window-property-clearing-iframe1.html";
38 shouldBe('x' in childWindow
, "'x' in childWindow", false);
39 shouldBe(childWindow
.x
, "childWindow.x", undefined);
40 shouldBe('f' in childWindow
, "'f' in childWindow", false);
41 shouldBe(typeof childWindow
.f
, "typeof childWindow.f", "undefined");
42 shouldBe('name' in childWindow
, "'name' in childWindow", true);
43 shouldBe(childWindow
.name
, "childWindow.name", "test");
45 if (window
.testRunner
)
46 testRunner
.notifyDone();
52 if (window
.testRunner
) {
53 testRunner
.dumpAsText();
54 testRunner
.waitUntilDone();
61 <iframe src=
"resources/window-property-clearing-iframe0.html"></iframe>