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

Unified Diff: chrome/browser/ui/webui/ntp/new_tab_ui_browsertest.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/ui/webui/ntp/new_tab_ui_browsertest.cc
diff --git a/chrome/browser/ui/webui/ntp/new_tab_ui_browsertest.cc b/chrome/browser/ui/webui/ntp/new_tab_ui_browsertest.cc
index 0e019c935b099b00359b0daccabdb2f02aa572db..3e18263f44cb0d9f95f09dd8e1d68f98151619e5 100644
--- a/chrome/browser/ui/webui/ntp/new_tab_ui_browsertest.cc
+++ b/chrome/browser/ui/webui/ntp/new_tab_ui_browsertest.cc
@@ -28,11 +28,10 @@ namespace {
static bool had_console_errors = false;
bool HandleMessage(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 && file == std::string("CONSOLE"))
+ if (severity == logging::LOG_ERROR && file == std::string("CONSOLE"))
had_console_errors = true;
return false;
}
@@ -42,10 +41,12 @@ bool HandleMessage(int severity,
class NewTabUIBrowserTest : public InProcessBrowserTest {
public:
NewTabUIBrowserTest() {
- logging::SetLogMessageHandler(&HandleMessage);
+ logging::AddLogMessageHandler(&HandleMessage);
}
- ~NewTabUIBrowserTest() override { logging::SetLogMessageHandler(NULL); }
+ ~NewTabUIBrowserTest() override {
+ logging::RemoveLogMessageHandler(&HandleMessage);
+ }
void TearDown() override {
InProcessBrowserTest::TearDown();
« no previous file with comments | « chrome/browser/safe_browsing/safe_browsing_database_unittest.cc ('k') | chrome/test/base/web_ui_browser_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698