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

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: 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..9274ca5d2eab67ab3c9388175143c3761832cf39 100644
--- a/third_party/WebKit/LayoutTests/fast/domurl/urlsearchparams-constructor.html
+++ b/third_party/WebKit/LayoutTests/fast/domurl/urlsearchparams-constructor.html
@@ -33,6 +33,18 @@ 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');
+
+ // Encoding '?' aligns with Firefox, spec doesn't insist it is encoded.
philipj_slow 2016/04/21 13:13:50 '?' is 0x3F and I end up in https://url.spec.whatw
sof 2016/04/21 13:19:10 You want to consider parsing first, I think -- htt
philipj_slow 2016/04/21 13:38:07 Starting at the URLSearchParams constructor I end
+ 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