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 33a446e32332b7ce0cdd8c79d57ed0ff645dfe3b..16cb9e7dfac5d651d01cf93e808f8b5052d179cd 100644 |
--- a/third_party/WebKit/LayoutTests/fast/domurl/urlsearchparams-constructor.html |
+++ b/third_party/WebKit/LayoutTests/fast/domurl/urlsearchparams-constructor.html |
@@ -33,6 +33,20 @@ test(function() { |
assert_equals(params + '', 'a=b'); |
params = new URLSearchParams(params); |
assert_equals(params + '', 'a=b'); |
+ |
+ // Leading '?' should be ignored. |
+ params = new URLSearchParams('?a=b'); |
+ assert_equals(params + '', 'a=b'); |
+ |
+ // https://url.spec.whatwg.org/#concept-urlencoded-byte-serializer |
+ // is performed upon stringification of |params|, requiring that |
+ // '?' is percent encoded. |
+ params = new URLSearchParams('??a=b'); |
+ assert_equals(params + '', '%3Fa=b'); |
+ params = new URLSearchParams('?'); |
+ assert_equals(params + '', ''); |
+ params = new URLSearchParams('??'); |
+ assert_equals(params + '', '%3F='); |
}, 'Basic URLSearchParams construction'); |
test(function() { |