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

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

Issue 2771033005: Split out spdy_log_util from http_log_util. (Closed)
Patch Set: Remove http_log_util.h include from two files that do not use ElideHeaderValueForNetLog(). Created 3 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 unified diff | Download patch
« no previous file with comments | « net/http/http_log_util.cc ('k') | net/quic/chromium/quic_chromium_client_session.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 6
7 #include "net/log/net_log_capture_mode.h"
8 #include "testing/gtest/include/gtest/gtest.h" 7 #include "testing/gtest/include/gtest/gtest.h"
9 8
10 namespace net { 9 namespace net {
11 10
12 TEST(HttpLogUtilTest, ElideHeaderValueForNetLog) { 11 TEST(HttpLogUtilTest, ElideHeaderValueForNetLog) {
13 // Only elide for appropriate log level. 12 // Only elide for appropriate log level.
14 EXPECT_EQ("[10 bytes were stripped]", 13 EXPECT_EQ("[10 bytes were stripped]",
15 ElideHeaderValueForNetLog(NetLogCaptureMode::Default(), "Cookie", 14 ElideHeaderValueForNetLog(NetLogCaptureMode::Default(), "Cookie",
16 "name=value")); 15 "name=value"));
17 EXPECT_EQ("name=value", ElideHeaderValueForNetLog( 16 EXPECT_EQ("name=value", ElideHeaderValueForNetLog(
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 EXPECT_EQ("NTLM [4 bytes were stripped]", 62 EXPECT_EQ("NTLM [4 bytes were stripped]",
64 ElideHeaderValueForNetLog(NetLogCaptureMode::Default(), 63 ElideHeaderValueForNetLog(NetLogCaptureMode::Default(),
65 "Proxy-Authenticate", "NTLM 1234")); 64 "Proxy-Authenticate", "NTLM 1234"));
66 65
67 // Leave whitespace intact. 66 // Leave whitespace intact.
68 EXPECT_EQ("NTLM [4 bytes were stripped] ", 67 EXPECT_EQ("NTLM [4 bytes were stripped] ",
69 ElideHeaderValueForNetLog(NetLogCaptureMode::Default(), 68 ElideHeaderValueForNetLog(NetLogCaptureMode::Default(),
70 "WWW-Authenticate", "NTLM 1234 ")); 69 "WWW-Authenticate", "NTLM 1234 "));
71 } 70 }
72 71
73 TEST(HttpLogUtilTest, ElideGoAwayDebugDataForNetLog) { 72 } // namespace net
74 // Only elide for appropriate log level.
75 EXPECT_EQ(
76 "[6 bytes were stripped]",
77 ElideGoAwayDebugDataForNetLog(NetLogCaptureMode::Default(), "foobar"));
78 EXPECT_EQ("foobar",
79 ElideGoAwayDebugDataForNetLog(
80 NetLogCaptureMode::IncludeCookiesAndCredentials(), "foobar"));
81 }
82
83 } // namspace net
OLDNEW
« no previous file with comments | « net/http/http_log_util.cc ('k') | net/quic/chromium/quic_chromium_client_session.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698