Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / storage / domstorage / sessionstorage / simple-usage.html
blobe3efe90a222fbd378e835ff199fad194fa7ced10
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 " + window.sessionStorage.length);
22 log("Value for FOO is " + window.sessionStorage.getItem("FOO"));
24 window.sessionStorage.setItem("FOO", "BAR");
26 log("Length is " + window.sessionStorage.length);
27 log("Value for FOO is " + window.sessionStorage.getItem("FOO"));
28 log("Key for index 0 is " + window.sessionStorage.key(0));
29 log("Key for index 1 is " + window.sessionStorage.key(1));
30 log("Key for index -1 is " + window.sessionStorage.key(-1));
32 window.sessionStorage.setItem("FOO", "BAZ");
34 log("Length is " + window.sessionStorage.length);
35 log("Value for FOO is " + window.sessionStorage.getItem("FOO"));
37 window.sessionStorage.removeItem("FOO");
39 log("Length is " + window.sessionStorage.length);
40 log("Value for FOO is " + window.sessionStorage.getItem("FOO"));
43 </script>
44 </head>
45 <body onload="runTest();">
46 This test trys simple operations on SessionStorage<br>
47 <div id="logger"></div>
48 </body>
49 </html>