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

Side by Side Diff: LayoutTests/imported/web-platform-tests/webstorage/storage_length.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 - length</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 storage["name"] = "user1";
15 storage["age"] = "20";
16
17 assert_equals(storage.length, 2, "storage.length")
18 }, name + ".length (method access)");
19
20 test(function() {
21 var storage = window[name];
22 storage.clear();
23 assert_equals(storage.length, 0, "storage.length")
24
25 storage.setItem("name", "user1");
26 storage.setItem("age", "20");
27
28 assert_equals(storage.length, 2, "storage.length")
29 }, name + ".length (proprty access)");
30 });
31 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698