OLD | NEW |
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 Loading... |
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 |
OLD | NEW |