summaryrefslogtreecommitdiffstats
path: root/LayoutTests/storage/domstorage/sessionstorage/simple-usage.html
diff options
context:
space:
mode:
Diffstat (limited to 'LayoutTests/storage/domstorage/sessionstorage/simple-usage.html')
-rw-r--r--LayoutTests/storage/domstorage/sessionstorage/simple-usage.html49
1 files changed, 49 insertions, 0 deletions
diff --git a/LayoutTests/storage/domstorage/sessionstorage/simple-usage.html b/LayoutTests/storage/domstorage/sessionstorage/simple-usage.html
new file mode 100644
index 0000000..8e45521
--- /dev/null
+++ b/LayoutTests/storage/domstorage/sessionstorage/simple-usage.html
@@ -0,0 +1,49 @@
+<html>
+<head>
+<script src="resources/clearSessionStorage.js"></script>
+<script>
+
+if (window.layoutTestController)
+ layoutTestController.dumpAsText();
+
+function log(a)
+{
+ document.getElementById("logger").innerHTML += a + "<br>";
+}
+
+function runTest()
+{
+ if (!window.sessionStorage) {
+ log("window.sessionStorage DOES NOT exist");
+ return;
+ }
+
+ log("Length is " + window.sessionStorage.length);
+ log("Value for FOO is " + window.sessionStorage.getItem("FOO"));
+
+ window.sessionStorage.setItem("FOO", "BAR");
+
+ log("Length is " + window.sessionStorage.length);
+ log("Value for FOO is " + window.sessionStorage.getItem("FOO"));
+ log("Key for index 0 is " + window.sessionStorage.key(0));
+ log("Key for index 1 is " + window.sessionStorage.key(1));
+ log("Key for index -1 is " + window.sessionStorage.key(-1));
+
+ window.sessionStorage.setItem("FOO", "BAZ");
+
+ log("Length is " + window.sessionStorage.length);
+ log("Value for FOO is " + window.sessionStorage.getItem("FOO"));
+
+ window.sessionStorage.removeItem("FOO");
+
+ log("Length is " + window.sessionStorage.length);
+ log("Value for FOO is " + window.sessionStorage.getItem("FOO"));
+}
+
+</script>
+</head>
+<body onload="runTest();">
+This test trys simple operations on SessionStorage<br>
+<div id="logger"></div>
+</body>
+</html>