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

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

Issue 1360253002: Log GOAWAY frame debug data. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Initialize |goaway_count_|. Created 5 years, 2 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
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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 EXPECT_EQ("NTLM [4 bytes were stripped]", 61 EXPECT_EQ("NTLM [4 bytes were stripped]",
62 ElideHeaderValueForNetLog(NetLogCaptureMode::Default(), 62 ElideHeaderValueForNetLog(NetLogCaptureMode::Default(),
63 "Proxy-Authenticate", "NTLM 1234")); 63 "Proxy-Authenticate", "NTLM 1234"));
64 64
65 // Leave whitespace intact. 65 // Leave whitespace intact.
66 EXPECT_EQ("NTLM [4 bytes were stripped] ", 66 EXPECT_EQ("NTLM [4 bytes were stripped] ",
67 ElideHeaderValueForNetLog(NetLogCaptureMode::Default(), 67 ElideHeaderValueForNetLog(NetLogCaptureMode::Default(),
68 "WWW-Authenticate", "NTLM 1234 ")); 68 "WWW-Authenticate", "NTLM 1234 "));
69 } 69 }
70 70
71 TEST(HttpLogUtilTest, ElideGoAwayDebugDataForNetLog) {
72 // Only elide for appropriate log level.
73 EXPECT_EQ(
74 "[6 bytes were stripped]",
75 ElideGoAwayDebugDataForNetLog(NetLogCaptureMode::Default(), "foobar"));
76 EXPECT_EQ("foobar",
77 ElideGoAwayDebugDataForNetLog(
78 NetLogCaptureMode::IncludeCookiesAndCredentials(), "foobar"));
79 }
80
71 } // namspace net 81 } // namspace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698