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

Unified Diff: url/url_canon_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 | « url/url_canon_etc.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: url/url_canon_unittest.cc
diff --git a/url/url_canon_unittest.cc b/url/url_canon_unittest.cc
index f5fedfc52edac9ac2c71dfbf9b5f14dc7a3fd6e5..dfb3dfe1c4dd63ac05fab67cfac244bfcfc0e952 100644
--- a/url/url_canon_unittest.cc
+++ b/url/url_canon_unittest.cc
@@ -240,6 +240,7 @@ TEST(URLCanonTest, Scheme) {
// Don't re-escape something already escaped. Note that it will
// "canonicalize" the 'A' to 'a', but that's OK.
{"ht%3Atp", "ht%3atp:", Component(0, 7), false},
+ {"", ":", Component(0, 0), false},
};
std::string out_str;
@@ -282,7 +283,7 @@ TEST(URLCanonTest, Scheme) {
out_str.clear();
StdStringCanonOutput output(&out_str);
- EXPECT_TRUE(CanonicalizeScheme("", Component(0, -1), &output, &out_comp));
+ EXPECT_FALSE(CanonicalizeScheme("", Component(0, -1), &output, &out_comp));
output.Complete();
EXPECT_EQ(std::string(":"), out_str);
@@ -1303,7 +1304,7 @@ TEST(URLCanonTest, CanonicalizeStandardURL) {
{"http://[www.google.com]/", "http://[www.google.com]/", false},
{"ht\ttp:@www.google.com:80/;p?#", "ht%09tp://www.google.com:80/;p?#", false},
{"http:////////user:@google.com:99?foo", "http://user@google.com:99/?foo", true},
- {"www.google.com", ":www.google.com/", true},
+ {"www.google.com", ":www.google.com/", false},
{"http://192.0x00A80001", "http://192.168.0.1/", true},
{"http://www/foo%2Ehtml", "http://www/foo.html", true},
{"http://user:pass@/", "http://user:pass@/", false},
@@ -1758,7 +1759,7 @@ TEST(URLCanonTest, CanonicalizePathURL) {
} path_cases[] = {
{"javascript:", "javascript:"},
{"JavaScript:Foo", "javascript:Foo"},
- {":\":This /is interesting;?#", ":\":This /is interesting;?#"},
+ {"Foo:\":This /is interesting;?#", "foo:\":This /is interesting;?#"},
};
for (size_t i = 0; i < arraysize(path_cases); i++) {
« no previous file with comments | « url/url_canon_etc.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698