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

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

Issue 1906773002: Have (new URLSearchParams(initString)) skip initial '?'. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix misguided comment Created 4 years, 8 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/URLSearchParams.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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() {
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/URLSearchParams.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698