blob: e3efe90a222fbd378e835ff199fad194fa7ced10 [file] [log] [blame]
<html>
<head>
<script src="resources/clearSessionStorage.js"></script>
<script>
if (window.testRunner)
testRunner.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>