Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / storage / domstorage / sessionstorage / delete-removal.html
blobf35544aa4d86fd65e7c88d4b93bc90c7d8a6d34f
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').appendChild(document.createTextNode(a));
12 document.getElementById('logger').appendChild(document.createElement("br"));
15 function runTest()
17 if (!window.sessionStorage) {
18 log("window.sessionStorage DOES NOT exist");
19 return;
22 log("foo (before anything) is: " + sessionStorage.foo);
23 sessionStorage.foo = "bar";
24 log("foo (after a named property setter set) is: " + sessionStorage.foo);
25 delete sessionStorage.foo;
26 log("foo (after a delete) is: " + sessionStorage.foo);
27 sessionStorage["foo"] = "bar";
28 log("foo (after an indexed setter set) is: " + sessionStorage.foo);
29 delete sessionStorage.FOO;
30 log("foo (after deleting FOO (not foo)) is : " + sessionStorage.foo);
31 delete sessionStorage.foo;
32 log("foo (after a delete) is: " + sessionStorage.foo);
33 sessionStorage.setItem("foo", "bar");
34 log("foo (after calling setItem) is: " + sessionStorage.foo);
35 delete sessionStorage.foo;
36 log("foo (after a delete) is: " + sessionStorage.foo);
37 delete sessionStorage.foo;
38 log("foo (after a redundant delete) is: " + sessionStorage.foo);
39 sessionStorage.foo = "bar";
40 log("foo (after a named property setter set) is: " + sessionStorage.foo);
41 delete sessionStorage["foo"];
42 log("foo (after an indexed delete) is: " + sessionStorage.foo);
45 </script>
46 </head>
47 <body onload="runTest();">
48 This test makes sure that using the syntax `delete sessionStorage.keyName` works as an alias to `sessionStorage.removeItem(keyName).`<br><hr>
49 <div id="logger"></div>
50 </body>
51 </html>