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

Unified Diff: third_party/WebKit/LayoutTests/fast/domurl/urlsearchparams-constructor.html

Issue 2725593003: Construct URLSearchParams from sequence initializer. (Closed)
Patch Set: style update Created 3 years, 10 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: third_party/WebKit/LayoutTests/fast/domurl/urlsearchparams-constructor.html
diff --git a/third_party/WebKit/LayoutTests/fast/domurl/urlsearchparams-constructor.html b/third_party/WebKit/LayoutTests/fast/domurl/urlsearchparams-constructor.html
index 16cb9e7dfac5d651d01cf93e808f8b5052d179cd..5ced91c5e65ff53bf34c70dbd0e15bb5800f45d5 100644
--- a/third_party/WebKit/LayoutTests/fast/domurl/urlsearchparams-constructor.html
+++ b/third_party/WebKit/LayoutTests/fast/domurl/urlsearchparams-constructor.html
@@ -169,9 +169,17 @@ test(function() {
}, 'Parse =');
test(function() {
- var params = new URLSearchParams('foobar=a\nb');
- assert_equals(params.toString(), 'foobar=a%0Ab');
-}, 'Parse \\n');
+ let params = new URLSearchParams([]);
+ assert_true(params !== null, 'Empty sequence');
+ assert_equals(params.toString(), '');
+
+ params = new URLSearchParams([[1, 2], ['a', 'b']]);
+ assert_equals(params.toString(), '1=2&a=b');
+
+ assert_type_error(() => { new URLSearchParams([[1, 2, 3]]) },
+ "Sequence elements must be pairs");
+}, 'sequence initializer');
+
</script>
</head>
</html>

Powered by Google App Engine
This is Rietveld 408576698