Index: net/http/http_util_unittest.cc |
diff --git a/net/http/http_util_unittest.cc b/net/http/http_util_unittest.cc |
index fe2d8b47496ea29b529596d65dd3e22e9e54e8e7..cf4a1f715f6f1d7c654f046f6f7f3e4148463edb 100644 |
--- a/net/http/http_util_unittest.cc |
+++ b/net/http/http_util_unittest.cc |
@@ -612,7 +612,22 @@ TEST(HttpUtilTest, RequestUrlSanitize) { |
"http://user:pass@google.com", |
"http://google.com/", |
"/" |
- } |
+ }, |
+ { // https scheme |
+ "https://www.google.com:78/foobar?query=1#hash", |
+ "https://www.google.com:78/foobar?query=1", |
+ "/foobar?query=1" |
+ }, |
+ { // WebSocket's ws scheme |
+ "ws://www.google.com:78/foobar?query=1#hash", |
+ "ws://www.google.com:78/foobar?query=1", |
+ "/foobar?query=1" |
+ }, |
+ { // WebSocket's wss scheme |
+ "wss://www.google.com:78/foobar?query=1#hash", |
+ "wss://www.google.com:78/foobar?query=1", |
+ "/foobar?query=1" |
+ }, |
}; |
for (size_t i = 0; i < ARRAYSIZE_UNSAFE(tests); ++i) { |
GURL url(GURL(tests[i].url)); |
@@ -622,6 +637,11 @@ TEST(HttpUtilTest, RequestUrlSanitize) { |
EXPECT_EQ(expected_spec, HttpUtil::SpecForRequest(url)); |
EXPECT_EQ(expected_path, HttpUtil::PathForRequest(url)); |
} |
+ |
+ // ftp scheme |
Adam Rice
2013/11/15 08:01:44
I would prefer to have this as a separate test cas
tyoshino (SeeGerritForStatus)
2013/11/15 13:35:50
Done.
|
+ GURL ftp_url("ftp://user:pass@google.com/pub/chromium/"); |
+ EXPECT_EQ("ftp://google.com/pub/chromium/", |
+ HttpUtil::SpecForRequest(ftp_url)); |
} |
TEST(HttpUtilTest, GenerateAcceptLanguageHeader) { |