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

Unified Diff: chrome/test/base/web_ui_browser_test.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
« no previous file with comments | « chrome/browser/ui/webui/ntp/new_tab_ui_browsertest.cc ('k') | chrome/test/chromedriver/logging.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/base/web_ui_browser_test.cc
diff --git a/chrome/test/base/web_ui_browser_test.cc b/chrome/test/base/web_ui_browser_test.cc
index c50a43458e417ea7807b06f0105ac1e20acec35d..e8734458d8ae71193874e8f5a4962a3445c80e86 100644
--- a/chrome/test/base/web_ui_browser_test.cc
+++ b/chrome/test/base/web_ui_browser_test.cc
@@ -55,12 +55,10 @@ base::LazyInstance<std::vector<std::string> > error_messages_ =
// Intercepts all log messages.
bool LogHandler(int severity,
- const char* file,
+ const std::string& file,
int line,
- size_t message_start,
const std::string& str) {
- if (severity == logging::LOG_ERROR && file &&
- std::string("CONSOLE") == file) {
+ if (severity == logging::LOG_ERROR && std::string("CONSOLE") == file) {
error_messages_.Get().push_back(str);
}
@@ -383,7 +381,7 @@ base::LazyInstance<MockWebUIProvider> mock_provider_ =
void WebUIBrowserTest::SetUpOnMainThread() {
JavaScriptBrowserTest::SetUpOnMainThread();
- logging::SetLogMessageHandler(&LogHandler);
+ logging::AddLogMessageHandler(&LogHandler);
AddLibrary(base::FilePath(kA11yAuditLibraryJSPath));
@@ -401,7 +399,7 @@ void WebUIBrowserTest::SetUpOnMainThread() {
}
void WebUIBrowserTest::TearDownOnMainThread() {
- logging::SetLogMessageHandler(NULL);
+ logging::RemoveLogMessageHandler(&LogHandler);
test_factory_->RemoveFactoryOverride(GURL(kDummyURL).host());
content::WebUIControllerFactory::UnregisterFactoryForTesting(
« no previous file with comments | « chrome/browser/ui/webui/ntp/new_tab_ui_browsertest.cc ('k') | chrome/test/chromedriver/logging.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698