Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(136)

Unified Diff: LayoutTests/imported/web-platform-tests/webstorage/storage_builtins.html

Issue 1220543007: Import web-platform-tests/webstorage (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebased Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: LayoutTests/imported/web-platform-tests/webstorage/storage_builtins.html
diff --git a/LayoutTests/imported/web-platform-tests/webstorage/storage_builtins.html b/LayoutTests/imported/web-platform-tests/webstorage/storage_builtins.html
new file mode 100644
index 0000000000000000000000000000000000000000..691805f6b4f10a4c8c80d583c20c2a8139338dc3
--- /dev/null
+++ b/LayoutTests/imported/web-platform-tests/webstorage/storage_builtins.html
@@ -0,0 +1,24 @@
+<!DOCTYPE HTML>
+<mete charset=utf-8>
+<title>WebStorage Test: Storage - builtins</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");
+
+ var builtins = ["key", "getItem", "setItem", "removeItem", "clear"];
+ var origBuiltins = builtins.map(function(b) { return Storage.prototype[b]; });
+ assert_array_equals(builtins.map(function(b) { return storage[b]; }), origBuiltins, "a");
+ builtins.forEach(function(b) { storage[b] = b; });
+ assert_array_equals(builtins.map(function(b) { return storage[b]; }), origBuiltins, "b");
+ assert_array_equals(builtins.map(function(b) { return storage.getItem(b); }), builtins, "c");
+
+ assert_equals(storage.length, builtins.length, "storage.length");
+ }, "Builtins in " + name);
+});
+</script>

Powered by Google App Engine
This is Rietveld 408576698