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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: LayoutTests/imported/web-platform-tests/webstorage/storage_length.html
diff --git a/LayoutTests/imported/web-platform-tests/webstorage/storage_length.html b/LayoutTests/imported/web-platform-tests/webstorage/storage_length.html
new file mode 100644
index 0000000000000000000000000000000000000000..11ab81d3b690827d50f62f7ed30c2ff5ac3837ea
--- /dev/null
+++ b/LayoutTests/imported/web-platform-tests/webstorage/storage_length.html
@@ -0,0 +1,31 @@
+<!DOCTYPE HTML>
+<mete charset=utf-8>
+<title>WebStorage Test: Storage - length</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")
+
+ storage["name"] = "user1";
+ storage["age"] = "20";
+
+ assert_equals(storage.length, 2, "storage.length")
+ }, name + ".length (method access)");
+
+ test(function() {
+ var storage = window[name];
+ storage.clear();
+ assert_equals(storage.length, 0, "storage.length")
+
+ storage.setItem("name", "user1");
+ storage.setItem("age", "20");
+
+ assert_equals(storage.length, 2, "storage.length")
+ }, name + ".length (proprty access)");
+});
+</script>

Powered by Google App Engine
This is Rietveld 408576698