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

Unified Diff: components/proximity_auth/logging/logging_unittest.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: components/proximity_auth/logging/logging_unittest.cc
diff --git a/components/proximity_auth/logging/logging_unittest.cc b/components/proximity_auth/logging/logging_unittest.cc
index ea40af1d43899644ea18e43f330e4625b5ee6e17..69bf3e7780b5ae0b664bee251d97c0acd5bedf11 100644
--- a/components/proximity_auth/logging/logging_unittest.cc
+++ b/components/proximity_auth/logging/logging_unittest.cc
@@ -37,20 +37,14 @@ bool HandleStandardLogMessage(int severity,
class ProximityAuthLoggingTest : public testing::Test {
public:
- ProximityAuthLoggingTest() : previous_handler_(NULL) {}
-
void SetUp() override {
LogBuffer::GetInstance()->Clear();
g_standard_logs.Get().clear();
- previous_handler_ = logging::GetLogMessageHandler();
- logging::SetLogMessageHandler(&HandleStandardLogMessage);
+ logging::PushLogMessageHandler(&HandleStandardLogMessage);
}
- void TearDown() override { logging::SetLogMessageHandler(previous_handler_); }
-
- private:
- logging::LogMessageHandlerFunction previous_handler_;
+ void TearDown() override { logging::PopLogMessageHandler(); }
};
TEST_F(ProximityAuthLoggingTest, LogsSavedToBuffer) {

Powered by Google App Engine
This is Rietveld 408576698