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

Unified Diff: chrome/browser/media/webrtc/webrtc_browsertest_base.cc

Issue 2497833002: support multiple log message handlers in base/logging.h (Closed)
Patch Set: Created 4 years, 1 month 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: chrome/browser/media/webrtc/webrtc_browsertest_base.cc
diff --git a/chrome/browser/media/webrtc/webrtc_browsertest_base.cc b/chrome/browser/media/webrtc/webrtc_browsertest_base.cc
index 107b49f612b8ff72ad093d6ca6a5dc834688434b..29d4ec9a8b9f1415da46023e661f996cbdc25ce7 100644
--- a/chrome/browser/media/webrtc/webrtc_browsertest_base.cc
+++ b/chrome/browser/media/webrtc/webrtc_browsertest_base.cc
@@ -68,11 +68,10 @@ base::LazyInstance<bool> hit_javascript_errors_ =
// WebrtcTestBase-inheriting test cases do not run in parallel (if they did they
// would race to look at the log, which is global to all tests).
bool JavascriptErrorDetectingLogHandler(int severity,
- const char* file,
+ const std::string& file,
int line,
- size_t message_start,
const std::string& str) {
- if (file == NULL || std::string("CONSOLE") != file)
+ if (std::string("CONSOLE") != file)
return false;
bool contains_uncaught = str.find("\"Uncaught ") != std::string::npos;
@@ -125,7 +124,7 @@ class PermissionRequestObserver : public PermissionRequestManager::Observer {
WebRtcTestBase::WebRtcTestBase(): detect_errors_in_javascript_(false) {
// The handler gets set for each test method, but that's fine since this
// set operation is idempotent.
- logging::SetLogMessageHandler(&JavascriptErrorDetectingLogHandler);
+ logging::AddLogMessageHandler(&JavascriptErrorDetectingLogHandler);
hit_javascript_errors_.Get() = false;
EnablePixelOutput();
@@ -137,6 +136,7 @@ WebRtcTestBase::~WebRtcTestBase() {
<< "Encountered javascript errors during test execution (Search "
<< "for Uncaught or ERROR:CONSOLE in the test output).";
}
+ logging::RemoveLogMessageHandler(&JavascriptErrorDetectingLogHandler);
}
bool WebRtcTestBase::GetUserMediaAndAccept(
« no previous file with comments | « base/trace_event/trace_event_unittest.cc ('k') | chrome/browser/safe_browsing/safe_browsing_database_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698