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

Unified Diff: components/url_formatter/url_fixer_unittest.cc

Issue 2378213002: Mark URLs with empty schemes as invalid. (Closed)
Patch Set: Comments Created 4 years, 2 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 | « components/url_formatter/url_fixer.cc ('k') | url/gurl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/url_formatter/url_fixer_unittest.cc
diff --git a/components/url_formatter/url_fixer_unittest.cc b/components/url_formatter/url_fixer_unittest.cc
index 3bb3fde8aa492602d2333543291360c3f430737c..48ad0e6666e3e466e7fb9b3d455bf8ec77286f51 100644
--- a/components/url_formatter/url_fixer_unittest.cc
+++ b/components/url_formatter/url_fixer_unittest.cc
@@ -182,12 +182,11 @@ static const SegmentCase segment_cases[] = {
url::Component(), // query
url::Component(), // ref
},
- // Can't do anything useful with this.
- { ":b005::68]", "",
- url::Component(0, 0), // scheme
+ { ":b005::68]", "http",
+ url::Component(), // scheme
url::Component(), // username
url::Component(), // password
- url::Component(), // host
+ url::Component(1, 9), // host
url::Component(), // port
url::Component(), // path
url::Component(), // query
@@ -297,8 +296,10 @@ struct FixupCase {
{"[::]:80", "http://[::]/"},
{"[::]:80/path", "http://[::]/path"},
{"[::]:180/path", "http://[::]:180/path"},
- // TODO(pmarks): Maybe we should parse bare IPv6 literals someday.
- {"::1", "::1"},
+ // TODO(pmarks): Maybe we should parse bare IPv6 literals someday. Currently
+ // the first colon is treated as a scheme separator, and we default
+ // unspecified schemes to "http".
+ {"::1", "http://:1/"},
// Semicolon as scheme separator for standard schemes.
{"http;//www.google.com/", "http://www.google.com/"},
{"about;chrome", "chrome://chrome/"},
« no previous file with comments | « components/url_formatter/url_fixer.cc ('k') | url/gurl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698