mirror of
https://github.com/servo/servo.git
synced 2025-08-09 23:45:35 +01:00
Implement Storage::SupportedPropertyNames
This commit is contained in:
parent
f30f40b12d
commit
e7a3220bc1
5 changed files with 50 additions and 3 deletions
|
@ -13139,6 +13139,10 @@
|
|||
"path": "dom/collections/HTMLCollection-supported-property-names.html",
|
||||
"url": "/dom/collections/HTMLCollection-supported-property-names.html"
|
||||
},
|
||||
{
|
||||
"path": "dom/collections/storage-supported-property-names.html",
|
||||
"url": "/dom/collections/storage-supported-property-names.html"
|
||||
},
|
||||
{
|
||||
"path": "dom/events/Event-constants.html",
|
||||
"url": "/dom/events/Event-constants.html"
|
||||
|
@ -34616,4 +34620,4 @@
|
|||
"rev": "0159b3ec9ba5355a3340621226e02ae026effd7f",
|
||||
"url_base": "/",
|
||||
"version": 2
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,23 @@
|
|||
<!DOCTYPE HTML>
|
||||
<meta charset=utf-8>
|
||||
<title>Storage Test: Supported property names</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";
|
||||
assert_array_equals(Object.getOwnPropertyNames(storage), ['name']);
|
||||
}, "Object.getOwnPropertyNames on " + name + " Storage");
|
||||
|
||||
test(function() {
|
||||
var storage = window[name];
|
||||
storage.clear();
|
||||
assert_array_equals(Object.getOwnPropertyNames(storage), []);
|
||||
}, "Object.getOwnPropertyNames on " + name + " storage with empty collection");
|
||||
});
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue