6 testRunner
.dumpAsText();
10 document
.getElementById("logger").innerHTML
+= a
+ "<br>";
15 if (document
.createElement
&& (iframe
= document
.createElement('iframe'))) {
16 document
.body
.appendChild(iframe
);
23 if (!window
.localStorage
) {
24 log("window.localStorage DOES NOT exist");
30 if (window
.testRunner
&& testRunner
.setStorageAllowed
)
31 testRunner
.setStorageAllowed(true);
33 log("This test requires testRunner.setStorageAllowed, so it be can't run in a browser.");
35 log("Length is " + localStorage
.length
);
36 log("Value for FOO is " + localStorage
.getItem("FOO"));
38 localStorage
.setItem("FOO", "BAR");
40 log("Length is " + localStorage
.length
);
41 log("Value for FOO is " + localStorage
.getItem("FOO"));
42 log("Key for index 0 is " + localStorage
.key(0));
44 log("Disabling localStorage access.");
45 if (window
.testRunner
&& testRunner
.setStorageAllowed
)
46 testRunner
.setStorageAllowed(false);
49 log("frame localStorage is accessible " + !!openIframe().contentDocument
.defaultView
.localStorage
);
51 log("Caught exception trying to get frame localStorage: " + e
);
57 <body onload=
"runTest();">
58 This test verifies that all access to localStorage can be blocked
<br>
59 <div id=
"logger"></div>