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

Unified Diff: net/http/http_log_util_unittest.cc

Issue 361053002: Elide data reduction proxy credentials from NetLog (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comment Created 6 years, 6 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
« net/http/http_log_util.cc ('K') | « net/http/http_log_util.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_log_util_unittest.cc
diff --git a/net/http/http_log_util_unittest.cc b/net/http/http_log_util_unittest.cc
index 1b0e9dbbfa255c403b181c760a47560532f4ee4e..f87c7c81053bb08895076ffd85a77634e3a768c9 100644
--- a/net/http/http_log_util_unittest.cc
+++ b/net/http/http_log_util_unittest.cc
@@ -25,11 +25,6 @@ TEST(HttpLogUtilTest, ElideHeaderValueForNetLog) {
net::NetLog::LOG_STRIP_PRIVATE_DATA, "Set-Cookie2", "name=value"));
EXPECT_EQ("[10 bytes were stripped]", ElideHeaderValueForNetLog(
net::NetLog::LOG_STRIP_PRIVATE_DATA, "Authorization", "Basic 1234"));
-#if !defined(SPDY_PROXY_AUTH_ORIGIN)
- EXPECT_EQ("[10 bytes were stripped]", ElideHeaderValueForNetLog(
- net::NetLog::LOG_STRIP_PRIVATE_DATA,
- "Proxy-Authorization", "Basic 1234"));
-#endif
// Unknown headers should pass through.
EXPECT_EQ("value", ElideHeaderValueForNetLog(
@@ -42,22 +37,10 @@ TEST(HttpLogUtilTest, ElideHeaderValueForNetLog) {
EXPECT_EQ("Digest realm=test", ElideHeaderValueForNetLog(
net::NetLog::LOG_STRIP_PRIVATE_DATA,
"WWW-Authenticate", "Digest realm=test"));
-#if !defined(SPDY_PROXY_AUTH_ORIGIN)
- EXPECT_EQ("Basic realm=test", ElideHeaderValueForNetLog(
- net::NetLog::LOG_STRIP_PRIVATE_DATA,
- "Proxy-Authenticate", "Basic realm=test"));
- EXPECT_EQ("Digest realm=test", ElideHeaderValueForNetLog(
- net::NetLog::LOG_STRIP_PRIVATE_DATA,
- "Proxy-Authenticate", "Digest realm=test"));
-#endif
// Multi-round mechanisms partially elided.
EXPECT_EQ("NTLM [4 bytes were stripped]", ElideHeaderValueForNetLog(
net::NetLog::LOG_STRIP_PRIVATE_DATA, "WWW-Authenticate", "NTLM 1234"));
-#if !defined(SPDY_PROXY_AUTH_ORIGIN)
mmenke 2014/07/02 18:34:25 These !defined cases shouldn't be deleted, but jus
bengr 2014/07/02 19:31:58 Done.
- EXPECT_EQ("NTLM [4 bytes were stripped]", ElideHeaderValueForNetLog(
- net::NetLog::LOG_STRIP_PRIVATE_DATA, "Proxy-Authenticate", "NTLM 1234"));
-#endif
// Leave whitespace intact.
EXPECT_EQ("NTLM [4 bytes were stripped] ", ElideHeaderValueForNetLog(
@@ -65,11 +48,10 @@ TEST(HttpLogUtilTest, ElideHeaderValueForNetLog) {
// Extra elisions for SPDY_PROXY_AUTH_ORIGIN.
#if defined(SPDY_PROXY_AUTH_ORIGIN)
- EXPECT_EQ("[elided]", ElideHeaderValueForNetLog(
- net::NetLog::LOG_ALL_BUT_BYTES,
- "Proxy-Authenticate", "Basic realm=test"));
- EXPECT_EQ("[elided]", ElideHeaderValueForNetLog(
- net::NetLog::LOG_ALL_BUT_BYTES, "Proxy-Authorization", "Basic 1234"));
+ EXPECT_EQ("ps=123, [7 bytes were stripped], c=foo, v=bar",
+ ElideHeaderValueForNetLog(
+ net::NetLog::LOG_STRIP_PRIVATE_DATA,
+ "Chrome-Proxy", "ps=123, sid=456, c=foo, v=bar"));
mmenke 2014/07/02 18:34:25 The indentation here is weird. Suggest indenting
mmenke 2014/07/02 18:34:25 Just for the sake of completeness, suggest tests w
bengr 2014/07/02 19:31:58 Done.
bengr 2014/07/02 19:31:58 Done.
#endif
}
« net/http/http_log_util.cc ('K') | « net/http/http_log_util.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698