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

Side by Side Diff: base/test/mock_log.h

Issue 2034393004: Allow multiple logging::LogMessage{Handler,Listener}s Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix installation_validator_unittest Created 4 years, 6 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 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
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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698