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

Unified Diff: content/common/database_identifier_unittest.cc

Issue 2397873002: Reject some previuosly-escaped chars in hostnames.
Patch Set: Some tests fixed Created 4 years, 1 month 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 | « components/search_engines/template_url_unittest.cc ('k') | net/base/filename_util_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/database_identifier_unittest.cc
diff --git a/content/common/database_identifier_unittest.cc b/content/common/database_identifier_unittest.cc
index dac125a9bbadfcb8c6d51572aaf98e297990390f..fbfa777923c0fee7ca0b5598f7cc8f765087e0ef 100644
--- a/content/common/database_identifier_unittest.cc
+++ b/content/common/database_identifier_unittest.cc
@@ -58,19 +58,19 @@ TEST(DatabaseIdentifierTest, CreateIdentifierAllHostChars) {
bool shouldRoundTrip;
} cases[] = {
{"x\x1Fx", "__0", false},
- {"x\x20x", "http_x%20x_0", false},
- {"x\x21x", "http_x%21x_0", false},
- {"x\x22x", "http_x%22x_0", false},
+ {"x\x20x", "__0", false},
+ {"x\x21x", "__0", false},
+ {"x\x22x", "__0", false},
{"x\x23x", "http_x_0", false}, // 'x#x', the # and following are ignored.
- {"x\x24x", "http_x%24x_0", false},
+ {"x\x24x", "__0", false},
{"x\x25x", "__0", false},
- {"x\x26x", "http_x%26x_0", false},
- {"x\x27x", "http_x%27x_0", false},
- {"x\x28x", "http_x%28x_0", false},
- {"x\x29x", "http_x%29x_0", false},
- {"x\x2ax", "http_x%2ax_0", false},
- {"x\x2bx", "http_x+x_0", false},
- {"x\x2cx", "http_x%2cx_0", false},
+ {"x\x26x", "__0", false},
+ {"x\x27x", "__0", false},
+ {"x\x28x", "__0", false},
+ {"x\x29x", "__0", false},
+ {"x\x2ax", "__0", false},
+ {"x\x2bx", "__0", false},
+ {"x\x2cx", "__0", false},
{"x\x2dx", "http_x-x_0", true},
{"x\x2ex", "http_x.x_0", true},
{"x\x2fx", "http_x_0", false}, // 'x/x', the / and following are ignored.
@@ -86,9 +86,9 @@ TEST(DatabaseIdentifierTest, CreateIdentifierAllHostChars) {
{"x\x39x", "http_x9x_0", true},
{"x\x3ax", "__0", false},
{"x\x3bx", "__0", false},
- {"x\x3cx", "http_x%3cx_0", false},
- {"x\x3dx", "http_x%3dx_0", false},
- {"x\x3ex", "http_x%3ex_0", false},
+ {"x\x3cx", "__0", false},
+ {"x\x3dx", "__0", false},
+ {"x\x3ex", "__0", false},
{"x\x3fx", "http_x_0", false}, // 'x?x', the ? and following are ignored.
{"x\x40x", "http_x_0", false}, // 'x@x', the @ and following are ignored.
{"x\x41x", "http_xax_0", true},
@@ -122,7 +122,7 @@ TEST(DatabaseIdentifierTest, CreateIdentifierAllHostChars) {
{"x\x5dx", "__0", false},
{"x\x5ex", "__0", false},
{"x\x5fx", "http_x_x_0", true},
- {"x\x60x", "http_x%60x_0", false},
+ {"x\x60x", "__0", false},
{"x\x61x", "http_xax_0", true},
{"x\x62x", "http_xbx_0", true},
{"x\x63x", "http_xcx_0", true},
@@ -149,9 +149,9 @@ TEST(DatabaseIdentifierTest, CreateIdentifierAllHostChars) {
{"x\x78x", "http_xxx_0", true},
{"x\x79x", "http_xyx_0", true},
{"x\x7ax", "http_xzx_0", true},
- {"x\x7bx", "http_x%7bx_0", false},
- {"x\x7cx", "http_x%7cx_0", false},
- {"x\x7dx", "http_x%7dx_0", false},
+ {"x\x7bx", "__0", false},
+ {"x\x7cx", "__0", false},
+ {"x\x7dx", "__0", false},
{"x\x7ex", "__0", false},
{"x\x7fx", "__0", false},
{"x\x80x", "__0", false},
@@ -204,8 +204,6 @@ TEST(DatabaseIdentifierTest, ExtractOriginDataFromIdentifier) {
"http", "xn--n3h.unicode.com", 0,
GURL("http://xn--n3h.unicode.com"), false},
{"http_dot.com_0", "http", "dot.com", 0, GURL("http://dot.com"), false},
- {"http_escaped%3Dfun.com_0", "http", "escaped%3dfun.com", 0,
- GURL("http://escaped%3dfun.com"), false},
{"http_[__1]_8080",
"http", "[::1]", 8080, GURL("http://[::1]:8080"), false},
{"http_[3ffe_2a00_100_7031__1]_0",
« no previous file with comments | « components/search_engines/template_url_unittest.cc ('k') | net/base/filename_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698