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

Unified Diff: net/http/http_util_unittest.cc

Issue 73633002: Add more test cases for HttpUtil::PathForRequest() and SpecForRequest() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 | « net/http/http_util_icu.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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) {
« no previous file with comments | « net/http/http_util_icu.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698