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

Unified Diff: LayoutTests/imported/web-platform-tests/webstorage/storage_string_conversion.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_string_conversion.html
diff --git a/LayoutTests/imported/web-platform-tests/webstorage/storage_string_conversion.html b/LayoutTests/imported/web-platform-tests/webstorage/storage_string_conversion.html
new file mode 100644
index 0000000000000000000000000000000000000000..f9c96550e50b2a38f91bee239b972bae7210076b
--- /dev/null
+++ b/LayoutTests/imported/web-platform-tests/webstorage/storage_string_conversion.html
@@ -0,0 +1,46 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+<title>WebStorage Test: Storage only store strings</title>
+<script src="../../../resources/testharness.js"></script>
+<script src="../../../resources/testharnessreport.js"></script>
+</head>
+<body>
+<div id="log"></div>
+<script>
+["localStorage", "sessionStorage"].forEach(function(name) {
+ test(function() {
+ assert_true(name in window, name + " exist");
+
+ var storage = window[name];
+ storage.clear();
+
+ assert_equals(storage.length, 0);
+
+ storage.a = null;
+ assert_equals(storage.a, "null");
+ storage.b = 0;
+ assert_equals(storage.b, "0");
+ storage.c = function(){};
+ assert_equals(storage.c, "function (){}");
+
+ storage.setItem('d', null);
+ assert_equals(storage.d, "null");
+ storage.setItem('e', 0);
+ assert_equals(storage.e, "0");
+ storage.setItem('f', function(){});
+ assert_equals(storage.f, "function (){}");
+
+ storage['g'] = null;
+ assert_equals(storage.g, "null");
+ storage['h'] = 0;
+ assert_equals(storage.h, "0");
+ storage['i'] = function(){};
+ assert_equals(storage.f, "function (){}");
+
+ }, name + " only stores strings");
+});
+
+</script>
+</body>
+</html>
« no previous file with comments | « LayoutTests/imported/web-platform-tests/webstorage/storage_setitem.html ('k') | LayoutTests/resources/testharnessreport.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698