Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement Storage::SupportedPropertyNames
- Loading branch information
1 parent
f30f40b
commit e7a3220
Showing
5 changed files
with
50 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
tests/wpt/web-platform-tests/dom/collections/storage-supported-property-names.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> |