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

Side by Side Diff: LayoutTests/imported/web-platform-tests/webstorage/storage_enumerate.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 <html>
3 <head>
4 <title>WebStorage Test: Storage - enumerate and built-in properties</title>
5 <script src="../../../resources/testharness.js"></script>
6 <script src="../../../resources/testharnessreport.js"></script>
7 </head>
8 <body>
9 <div id="log"></div>
10 <script>
11 ["localStorage", "sessionStorage"].forEach(function(name) {
12 test(function() {
13 assert_true(name in window, name + " exist");
14
15 var storage = window[name];
16 storage.clear();
17
18 Storage.prototype.prototypeTestKey = "prototypeTestValue";
19 storage.foo = "bar";
20 storage.fu = "baz";
21 storage.batman = "bin suparman";
22 storage.bar = "foo";
23 storage.alpha = "beta";
24 storage.zeta = "gamma";
25
26 var enumeratedArray = new Array();
27 for (var n in storage)
28 enumeratedArray.push(n);
29
30 // Sort the array, since the storage order isn't guaranteed
31 enumeratedArray.sort();
32
33 var expectArray = ["alpha", "bar", "batman", "foo", "fu", "prototypeTest Key", "zeta"];
34 assert_array_equals(enumeratedArray, expectArray);
35
36 }, name + ": enumerate a Storage object and get only the keys as a result an d the built-in properties of the Storage object should be ignored");
37 });
38 </script>
39 </body>
40 </html>
41
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698