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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 <!DOCTYPE HTML>
2 <mete charset=utf-8>
3 <title>WebStorage Test: Storage - builtins</title>
4 <script src="../../../resources/testharness.js"></script>
5 <script src="../../../resources/testharnessreport.js"></script>
6 <div id="log"></div>
7 <script>
8 ["localStorage", "sessionStorage"].forEach(function(name) {
9 test(function() {
10 var storage = window[name];
11 storage.clear();
12 assert_equals(storage.length, 0, "storage.length");
13
14 var builtins = ["key", "getItem", "setItem", "removeItem", "clear"];
15 var origBuiltins = builtins.map(function(b) { return Storage.prototype[b ]; });
16 assert_array_equals(builtins.map(function(b) { return storage[b]; }), or igBuiltins, "a");
17 builtins.forEach(function(b) { storage[b] = b; });
18 assert_array_equals(builtins.map(function(b) { return storage[b]; }), or igBuiltins, "b");
19 assert_array_equals(builtins.map(function(b) { return storage.getItem(b) ; }), builtins, "c");
20
21 assert_equals(storage.length, builtins.length, "storage.length");
22 }, "Builtins in " + name);
23 });
24 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698