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

Side by Side Diff: net/http/http_log_util_unittest.cc

Issue 382313003: Add data reduction functionality to all platforms. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove incorrect DCHECK from drp_statistics_prefs.cc Created 6 years, 3 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 unified diff | Download patch
« no previous file with comments | « net/http/http_log_util.cc ('k') | net/http/http_network_transaction.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/http/http_log_util.h" 5 #include "net/http/http_log_util.h"
6 #include "testing/gtest/include/gtest/gtest.h" 6 #include "testing/gtest/include/gtest/gtest.h"
7 7
8 namespace net { 8 namespace net {
9 9
10 TEST(HttpLogUtilTest, ElideHeaderValueForNetLog) { 10 TEST(HttpLogUtilTest, ElideHeaderValueForNetLog) {
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 46
47 // Multi-round mechanisms partially elided. 47 // Multi-round mechanisms partially elided.
48 EXPECT_EQ("NTLM [4 bytes were stripped]", ElideHeaderValueForNetLog( 48 EXPECT_EQ("NTLM [4 bytes were stripped]", ElideHeaderValueForNetLog(
49 NetLog::LOG_STRIP_PRIVATE_DATA, "WWW-Authenticate", "NTLM 1234")); 49 NetLog::LOG_STRIP_PRIVATE_DATA, "WWW-Authenticate", "NTLM 1234"));
50 EXPECT_EQ("NTLM [4 bytes were stripped]", ElideHeaderValueForNetLog( 50 EXPECT_EQ("NTLM [4 bytes were stripped]", ElideHeaderValueForNetLog(
51 NetLog::LOG_STRIP_PRIVATE_DATA, "Proxy-Authenticate", "NTLM 1234")); 51 NetLog::LOG_STRIP_PRIVATE_DATA, "Proxy-Authenticate", "NTLM 1234"));
52 52
53 // Leave whitespace intact. 53 // Leave whitespace intact.
54 EXPECT_EQ("NTLM [4 bytes were stripped] ", ElideHeaderValueForNetLog( 54 EXPECT_EQ("NTLM [4 bytes were stripped] ", ElideHeaderValueForNetLog(
55 NetLog::LOG_STRIP_PRIVATE_DATA, "WWW-Authenticate", "NTLM 1234 ")); 55 NetLog::LOG_STRIP_PRIVATE_DATA, "WWW-Authenticate", "NTLM 1234 "));
56
57 // Extra elisions for SPDY_PROXY_AUTH_ORIGIN.
58 #if defined(SPDY_PROXY_AUTH_ORIGIN)
59 EXPECT_EQ("ps=123, [7 bytes were stripped], c=foo, v=bar",
60 ElideHeaderValueForNetLog(
61 NetLog::LOG_STRIP_PRIVATE_DATA,
62 "Chrome-Proxy", "ps=123, sid=456, c=foo, v=bar"));
63 EXPECT_EQ("[7 bytes were stripped], ps=123, c=foo, v=bar",
64 ElideHeaderValueForNetLog(
65 NetLog::LOG_STRIP_PRIVATE_DATA,
66 "Chrome-Proxy", "sid=456, ps=123, c=foo, v=bar"));
67 EXPECT_EQ("ps=123, c=foo, v=bar, [7 bytes were stripped]",
68 ElideHeaderValueForNetLog(
69 NetLog::LOG_STRIP_PRIVATE_DATA,
70 "Chrome-Proxy", "ps=123, c=foo, v=bar, sid=456"));
71 #endif
72 } 56 }
73 57
74 } // namspace net 58 } // namspace net
OLDNEW
« no previous file with comments | « net/http/http_log_util.cc ('k') | net/http/http_network_transaction.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698