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

Unified Diff: net/http/http_log_util_unittest.cc

Issue 202113005: Fix HttpLogUtilTest.ElideHeaderValueForNetLog. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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 | « no previous file | 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 1b8cdf26609d72a4aee4a85c27beb131ff15a20e..263f622ec8d743319ad3f7925863662665a1e1ea 100644
--- a/net/http/http_log_util_unittest.cc
+++ b/net/http/http_log_util_unittest.cc
@@ -25,9 +25,15 @@ 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("[elided]", ElideHeaderValueForNetLog(
+ net::NetLog::LOG_STRIP_PRIVATE_DATA,
+ "Proxy-Authorization", "Basic 1234"));
+#else
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(
@@ -40,18 +46,32 @@ 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("[elided]", ElideHeaderValueForNetLog(
+ net::NetLog::LOG_STRIP_PRIVATE_DATA,
+ "Proxy-Authenticate", "Basic realm=test"));
+ EXPECT_EQ("[elided]", ElideHeaderValueForNetLog(
+ net::NetLog::LOG_STRIP_PRIVATE_DATA,
+ "Proxy-Authenticate", "Digest realm=test"));
+#else
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)
+ EXPECT_EQ("[elided]", ElideHeaderValueForNetLog(
+ net::NetLog::LOG_STRIP_PRIVATE_DATA, "Proxy-Authenticate", "NTLM 1234"));
+#else
EXPECT_EQ("NTLM [4 bytes were stripped]", ElideHeaderValueForNetLog(
net::NetLog::LOG_STRIP_PRIVATE_DATA, "Proxy-Authenticate", "NTLM 1234"));
+#endif
mmenke 2014/03/19 16:19:08 Wonder if we really need quite so many of these SP
// Leave whitespace intact.
EXPECT_EQ("NTLM [4 bytes were stripped] ", ElideHeaderValueForNetLog(
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698