mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-08 08:48:39 +09:00
import FIREFOX_52_6_0esr_RELEASE from mozilla-esr52 hg repo
This commit is contained in:
commit
dcd9973243
150858 changed files with 23884658 additions and 0 deletions
31
testing/web-platform/tests/webstorage/storage_length.html
Normal file
31
testing/web-platform/tests/webstorage/storage_length.html
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
<!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>
|
||||
Loading…
Add table
Add a link
Reference in a new issue