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..54acf68d3c3d52c3bc28aa4b0f9ee3603ac098cd 100644 |
--- a/net/http/http_util_unittest.cc |
+++ b/net/http/http_util_unittest.cc |
@@ -612,6 +612,21 @@ 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) { |
@@ -624,6 +639,13 @@ TEST(HttpUtilTest, RequestUrlSanitize) { |
} |
} |
+// Test SpecForRequest() for "ftp" scheme. |
+TEST(HttpUtilTest, SpecForRequestForUrlWithFtpScheme) { |
+ GURL ftp_url("ftp://user:pass@google.com/pub/chromium/"); |
+ EXPECT_EQ("ftp://google.com/pub/chromium/", |
+ HttpUtil::SpecForRequest(ftp_url)); |
+} |
+ |
TEST(HttpUtilTest, GenerateAcceptLanguageHeader) { |
EXPECT_EQ(std::string("en-US,fr;q=0.8,de;q=0.6"), |
HttpUtil::GenerateAcceptLanguageHeader("en-US,fr,de")); |