OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #ifndef BASE_TEST_MOCK_LOG_H_ | 5 #ifndef BASE_TEST_MOCK_LOG_H_ |
6 #define BASE_TEST_MOCK_LOG_H_ | 6 #define BASE_TEST_MOCK_LOG_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <string> | 10 #include <string> |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 // Called once for each message. | 81 // Called once for each message. |
82 static bool LogMessageHandler(int severity, | 82 static bool LogMessageHandler(int severity, |
83 const char* file, | 83 const char* file, |
84 int line, | 84 int line, |
85 size_t message_start, | 85 size_t message_start, |
86 const std::string& str); | 86 const std::string& str); |
87 | 87 |
88 // True if this object is currently capturing logs. | 88 // True if this object is currently capturing logs. |
89 bool is_capturing_logs_; | 89 bool is_capturing_logs_; |
90 | 90 |
91 // The previous handler to restore when the MockLog is destroyed. | |
92 logging::LogMessageHandlerFunction previous_handler_; | |
93 | |
94 DISALLOW_COPY_AND_ASSIGN(MockLog); | 91 DISALLOW_COPY_AND_ASSIGN(MockLog); |
95 }; | 92 }; |
96 | 93 |
97 } // namespace test | 94 } // namespace test |
98 } // namespace base | 95 } // namespace base |
99 | 96 |
100 #endif // BASE_TEST_MOCK_LOG_H_ | 97 #endif // BASE_TEST_MOCK_LOG_H_ |
OLD | NEW |