mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-10 02:08:38 +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
36
testing/web-platform/tests/webstorage/storage_indexing.html
Normal file
36
testing/web-platform/tests/webstorage/storage_indexing.html
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
<!DOCTYPE HTML>
|
||||
<meta charset=utf-8>
|
||||
<title>WebStorage Test: Storage - indexed getter</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();
|
||||
storage["name"] = "user1";
|
||||
storage["age"] = "42";
|
||||
|
||||
test(function() {
|
||||
assert_equals(storage[-1], undefined);
|
||||
assert_equals(storage[0], undefined);
|
||||
assert_equals(storage[1], undefined);
|
||||
assert_equals(storage[2], undefined);
|
||||
}, "Getting number properties on " + name);
|
||||
|
||||
test(function() {
|
||||
assert_equals(storage["-1"], undefined);
|
||||
assert_equals(storage["0"], undefined);
|
||||
assert_equals(storage["1"], undefined);
|
||||
assert_equals(storage["2"], undefined);
|
||||
}, "Getting number-valued string properties on " + name);
|
||||
|
||||
test(function() {
|
||||
storage.setItem(1, "number");
|
||||
assert_equals(storage[1], "number");
|
||||
assert_equals(storage["1"], "number");
|
||||
}, "Getting existing number-valued properties on " + name);
|
||||
}, "Indexed getter on " + name);
|
||||
});
|
||||
</script>
|
||||
Loading…
Add table
Add a link
Reference in a new issue