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

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

Issue 1998563002: Fix URLSearchParams to use the right encoding algorithm (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 7 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/LayoutTests/fast/domurl/urlsearchparams-stringifier-expected.txt » ('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-stringifier.html
diff --git a/third_party/WebKit/LayoutTests/fast/domurl/urlsearchparams-stringifier.html b/third_party/WebKit/LayoutTests/fast/domurl/urlsearchparams-stringifier.html
index 495a1ac37d774972f5e627543799f885f79026c9..e0b7d5efa73a7b6b2fb72992111b37620276e0d5 100644
--- a/third_party/WebKit/LayoutTests/fast/domurl/urlsearchparams-stringifier.html
+++ b/third_party/WebKit/LayoutTests/fast/domurl/urlsearchparams-stringifier.html
@@ -96,15 +96,34 @@ function urlEncodedSerialize(n) {
for (var i = 0x00; i < 0xFF; i++) {
// Not all bytes can appear in valid UTF-8, so some bytes aren't covered.
// TODO(mkwst): We fail to properly encode a few bytes: https://crbug.com/557063
+ var expected = urlEncodedSerialize(i);
test(function() {
var params = new URLSearchParams();
params.append('' + i, String.fromCodePoint(i));
- assert_equals(params + '', '' + i + '=' + urlEncodedSerialize(i));
- }, "Serialize U+00" + intToHex(i) + " -> '" + String.fromCodePoint(i) + "'");
+ assert_equals(params + '', '' + i + '=' + expected);
+ }, "Serialize U+00" + intToHex(i) + " -> '" + expected + "'");
}
test(function() {
var params = new URLSearchParams();
+ params.append('a', '\r');
+ assert_equals(params + '', 'a=%0D');
+}, 'Serialize \\r');
+
+test(function() {
+ var params = new URLSearchParams();
+ params.append('a', '\n');
+ assert_equals(params + '', 'a=%0A');
+}, 'Serialize \\n');
+
+test(function() {
+ var params = new URLSearchParams();
+ params.append('a', '\r\n');
+ assert_equals(params + '', 'a=%0D%0A');
+}, 'Serialize \\r\\n');
+
+test(function() {
+ var params = new URLSearchParams();
params.append('a', 'b%c');
assert_equals(params + '', 'a=b%25c');
params.delete('a');
@@ -143,4 +162,3 @@ test(function() {
</script>
</head>
</html>
-
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/domurl/urlsearchparams-stringifier-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698