3 <script src=
"resources/clearSessionStorage.js"></script>
6 if (window
.testRunner
) {
7 testRunner
.dumpAsText();
8 testRunner
.waitUntilDone();
13 document
.getElementById("logger").innerHTML
+= a
+ "<br>";
18 if (window
.testRunner
)
19 testRunner
.notifyDone()
24 if (!window
.sessionStorage
) {
25 log("window.sessionStorage DOES NOT exist");
30 log("Setting FOO using the index setter.");
31 sessionStorage
["FOO"] = "BAR";
33 log(sessionStorage
.FOO
);
34 log(sessionStorage
["FOO"]);
35 log(sessionStorage
.getItem("FOO"));
38 log("Setting FOO again, using setItem.");
39 sessionStorage
.setItem("FOO", "BAZ");
41 log(sessionStorage
.FOO
);
42 log(sessionStorage
["FOO"]);
43 log(sessionStorage
.getItem("FOO"));
46 log("Setting FOO again, using the index setter.");
47 sessionStorage
["FOO"] = "BAT";
49 log(sessionStorage
.FOO
);
50 log(sessionStorage
["FOO"]);
51 log(sessionStorage
.getItem("FOO"));
54 log("Setting FOO again, using property-slot syntax");
55 sessionStorage
.FOO
= "BATMAN";
57 log(sessionStorage
.FOO
);
58 log(sessionStorage
["FOO"]);
59 log(sessionStorage
.getItem("FOO"));
62 log("Removing FOO, then trying to read it");
63 sessionStorage
.removeItem("FOO");
65 log(sessionStorage
.FOO
);
66 log(sessionStorage
["FOO"]);
67 log(sessionStorage
.getItem("FOO"));
75 <body onload=
"runTest();">
76 This is a test to make sure you can get and set values in SessionStorage by index.
<br>
77 <div id=
"logger"></div>