| 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 |
| 7 #include "net/log/net_log_capture_mode.h" |
| 6 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
| 7 | 9 |
| 8 namespace net { | 10 namespace net { |
| 9 | 11 |
| 10 TEST(HttpLogUtilTest, ElideHeaderValueForNetLog) { | 12 TEST(HttpLogUtilTest, ElideHeaderValueForNetLog) { |
| 11 // Only elide for appropriate log level. | 13 // Only elide for appropriate log level. |
| 12 EXPECT_EQ("[10 bytes were stripped]", | 14 EXPECT_EQ("[10 bytes were stripped]", |
| 13 ElideHeaderValueForNetLog(NetLogCaptureMode::Default(), "Cookie", | 15 ElideHeaderValueForNetLog(NetLogCaptureMode::Default(), "Cookie", |
| 14 "name=value")); | 16 "name=value")); |
| 15 EXPECT_EQ("name=value", ElideHeaderValueForNetLog( | 17 EXPECT_EQ("name=value", ElideHeaderValueForNetLog( |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 // Only elide for appropriate log level. | 74 // Only elide for appropriate log level. |
| 73 EXPECT_EQ( | 75 EXPECT_EQ( |
| 74 "[6 bytes were stripped]", | 76 "[6 bytes were stripped]", |
| 75 ElideGoAwayDebugDataForNetLog(NetLogCaptureMode::Default(), "foobar")); | 77 ElideGoAwayDebugDataForNetLog(NetLogCaptureMode::Default(), "foobar")); |
| 76 EXPECT_EQ("foobar", | 78 EXPECT_EQ("foobar", |
| 77 ElideGoAwayDebugDataForNetLog( | 79 ElideGoAwayDebugDataForNetLog( |
| 78 NetLogCaptureMode::IncludeCookiesAndCredentials(), "foobar")); | 80 NetLogCaptureMode::IncludeCookiesAndCredentials(), "foobar")); |
| 79 } | 81 } |
| 80 | 82 |
| 81 } // namspace net | 83 } // namspace net |
| OLD | NEW |