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

Unified Diff: net/http/http_util_unittest.cc

Issue 1149833014: Remove net::HttpUtil::PathForRequest (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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 | « net/http/http_util_icu.cc ('k') | net/spdy/spdy_http_utils.cc » ('j') | 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 3f4f6250bd49466e758e054935dc2686f16a77cb..71602844ad8d4054b08413c8d372a20ab83fc3d9 100644
--- a/net/http/http_util_unittest.cc
+++ b/net/http/http_util_unittest.cc
@@ -591,51 +591,44 @@ TEST(HttpUtilTest, AssembleRawHeaders) {
}
}
-// Test SpecForRequest() and PathForRequest().
+// Test SpecForRequest().
TEST(HttpUtilTest, RequestUrlSanitize) {
struct {
const char* const url;
const char* const expected_spec;
- const char* const expected_path;
} tests[] = {
{ // Check that #hash is removed.
"http://www.google.com:78/foobar?query=1#hash",
"http://www.google.com:78/foobar?query=1",
- "/foobar?query=1"
},
{ // The reference may itself contain # -- strip all of it.
"http://192.168.0.1?query=1#hash#10#11#13#14",
"http://192.168.0.1/?query=1",
- "/?query=1"
},
{ // Strip username/password.
"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(tests); ++i) {
+ SCOPED_TRACE(i);
+
GURL url(GURL(tests[i].url));
std::string expected_spec(tests[i].expected_spec);
- std::string expected_path(tests[i].expected_path);
EXPECT_EQ(expected_spec, HttpUtil::SpecForRequest(url));
- EXPECT_EQ(expected_path, HttpUtil::PathForRequest(url));
}
}
« no previous file with comments | « net/http/http_util_icu.cc ('k') | net/spdy/spdy_http_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698