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

Unified Diff: base/test/mock_log.cc

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 side-by-side diff with in-line comments
Download patch
Index: base/test/mock_log.cc
diff --git a/base/test/mock_log.cc b/base/test/mock_log.cc
index a09000d8ed7f9e3080ff06a64cb060c76fa591f6..2f230affb83990586b9365f016005cbdb6769de9 100644
--- a/base/test/mock_log.cc
+++ b/base/test/mock_log.cc
@@ -31,8 +31,7 @@ void MockLog::StartCapturingLogs() {
is_capturing_logs_ = true;
g_instance_ = this;
- previous_handler_ = logging::GetLogMessageHandler();
- logging::SetLogMessageHandler(LogMessageHandler);
+ logging::PushLogMessageHandler(LogMessageHandler);
}
void MockLog::StopCapturingLogs() {
@@ -45,7 +44,7 @@ void MockLog::StopCapturingLogs() {
RAW_CHECK(g_instance_ == this);
is_capturing_logs_ = false;
- logging::SetLogMessageHandler(previous_handler_);
+ logging::PopLogMessageHandler();
g_instance_ = nullptr;
}

Powered by Google App Engine
This is Rietveld 408576698