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

Side by Side Diff: LayoutTests/imported/web-platform-tests/webstorage/storage_indexing.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 - indexed getter</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 storage["name"] = "user1";
13 storage["age"] = "42";
14
15 test(function() {
16 assert_equals(storage[-1], undefined);
17 assert_equals(storage[0], undefined);
18 assert_equals(storage[1], undefined);
19 assert_equals(storage[2], undefined);
20 }, "Getting number properties on " + name);
21
22 test(function() {
23 assert_equals(storage["-1"], undefined);
24 assert_equals(storage["0"], undefined);
25 assert_equals(storage["1"], undefined);
26 assert_equals(storage["2"], undefined);
27 }, "Getting number-valued string properties on " + name);
28
29 test(function() {
30 storage.setItem(1, "number");
31 assert_equals(storage[1], "number");
32 assert_equals(storage["1"], "number");
33 }, "Getting existing number-valued properties on " + name);
34 }, "Indexed getter on " + name);
35 });
36 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698