Revision 0b94ea95c4e0639d9363cee4603545324f047456 authored by James Graham on 11 April 2018, 14:49:07 UTC, committed by James Graham on 11 April 2018, 14:49:07 UTC
1 parent 72160f1
storage_length.html
<!DOCTYPE HTML>
<meta charset=utf-8>
<title>WebStorage Test: Storage - length</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
<script>
["localStorage", "sessionStorage"].forEach(function(name) {
test(function() {
var storage = window[name];
storage.clear();
assert_equals(storage.length, 0, "storage.length")
storage["name"] = "user1";
storage["age"] = "20";
assert_equals(storage.length, 2, "storage.length")
}, name + ".length (method access)");
test(function() {
var storage = window[name];
storage.clear();
assert_equals(storage.length, 0, "storage.length")
storage.setItem("name", "user1");
storage.setItem("age", "20");
assert_equals(storage.length, 2, "storage.length")
}, name + ".length (proprty access)");
});
</script>
![swh spinner](/static/img/swh-spinner.gif)
Computing file changes ...