3 <script src=
"resources/clearSessionStorage.js"></script>
7 testRunner
.dumpAsText();
11 document
.getElementById("logger").innerHTML
+= a
+ "<br>";
16 if (!window
.sessionStorage
) {
17 log("window.sessionStorage DOES NOT exist");
21 log("Length is " + sessionStorage
.length
);
23 log("Testing implicit setters");
24 sessionStorage
.a
= null;
25 log("Type/value for null is " + typeof sessionStorage
.a
+ "/" + sessionStorage
.a
);
27 log("Type/value for 0 is " + typeof sessionStorage
.b
+ "/" + sessionStorage
.b
);
28 sessionStorage
.c = function(){};
29 log("Type/value for function(){} is " + typeof sessionStorage
.c
+ "/" + sessionStorage
.c
);
31 log("Testing explicit setters");
32 sessionStorage
.setItem('d', null);
33 log("Type/value for null is " + typeof sessionStorage
.d
+ "/" + sessionStorage
.d
);
34 sessionStorage
.setItem('e', 0);
35 log("Type/value for 0 is " + typeof sessionStorage
.e
+ "/" + sessionStorage
.e
);
36 sessionStorage
.setItem('f', function(){});
37 log("Type/value for function(){} is " + typeof sessionStorage
.f
+ "/" + sessionStorage
.f
);
39 log("Testing index setters");
40 sessionStorage
['g'] = null;
41 log("Type/value for null is " + typeof sessionStorage
.g
+ "/" + sessionStorage
.g
);
42 sessionStorage
['h'] = 0;
43 log("Type/value for 0 is " + typeof sessionStorage
.h
+ "/" + sessionStorage
.h
);
44 sessionStorage
['i'] = function(){};
45 log("Type/value for function(){} is " + typeof sessionStorage
.i
+ "/" + sessionStorage
.i
);
50 <body onload=
"runTest();">
51 This test case verifies that session storage only stores strings.
52 <div id=
"logger"></div>