Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / storage / domstorage / sessionstorage / string-conversion.html
blob53fc828bcaa29d98d6f491dd4d394555ad9d2841
1 <html>
2 <head>
3 <script src="resources/clearSessionStorage.js"></script>
4 <script>
6 if (window.testRunner)
7 testRunner.dumpAsText();
9 function log(a)
11 document.getElementById("logger").innerHTML += a + "<br>";
14 function runTest()
16 if (!window.sessionStorage) {
17 log("window.sessionStorage DOES NOT exist");
18 return;
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);
26 sessionStorage.b = 0;
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);
48 </script>
49 </head>
50 <body onload="runTest();">
51 This test case verifies that session storage only stores strings.
52 <div id="logger"></div>
53 </body>
54 </html>