summaryrefslogtreecommitdiffstats
path: root/ceee/testing
diff options
context:
space:
mode:
authorhansl@google.com <hansl@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-03 19:20:27 +0000
committerhansl@google.com <hansl@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-03 19:20:27 +0000
commit64e5cc08486a26556c03c92fe3f746c8a6eaacb6 (patch)
tree411860c3baf8fd339aa40fa49ef58ba40630daaa /ceee/testing
parent2bf2c3c8d64ba382286b6eadc7c5cd3444caf2f7 (diff)
downloadchromium_src-64e5cc08486a26556c03c92fe3f746c8a6eaacb6.zip
chromium_src-64e5cc08486a26556c03c92fe3f746c8a6eaacb6.tar.gz
chromium_src-64e5cc08486a26556c03c92fe3f746c8a6eaacb6.tar.bz2
Fix the testing::LogDisabler for the change r64883. See http://codereview.chromium.org/4262001/show
The r64883 broke most unit tests in CEEE that relied on disabling logs while testing error paths. BUG=None TEST=None Review URL: http://codereview.chromium.org/4390001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@64948 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ceee/testing')
-rw-r--r--ceee/testing/utils/test_utils.cc10
-rw-r--r--ceee/testing/utils/test_utils.h3
2 files changed, 9 insertions, 4 deletions
diff --git a/ceee/testing/utils/test_utils.cc b/ceee/testing/utils/test_utils.cc
index 29b0bd6..48e522a 100644
--- a/ceee/testing/utils/test_utils.cc
+++ b/ceee/testing/utils/test_utils.cc
@@ -58,13 +58,17 @@ HRESULT GetConnectionCount(IUnknown* container,
}
+bool LogDisabler::DropMessageHandler(int severity, const std::string& str) {
+ return true;
+}
+
LogDisabler::LogDisabler() {
- initial_log_level_ = logging::GetMinLogLevel();
- logging::SetMinLogLevel(logging::LOG_FATAL + 1);
+ old_handler_ = logging::GetLogMessageHandler();
+ logging::SetLogMessageHandler(DropMessageHandler);
}
LogDisabler::~LogDisabler() {
- logging::SetMinLogLevel(initial_log_level_);
+ logging::SetLogMessageHandler(old_handler_);
}
PathServiceOverrider::PathServiceOverrider(int key, const FilePath& path) {
diff --git a/ceee/testing/utils/test_utils.h b/ceee/testing/utils/test_utils.h
index 28ddb94..55582be 100644
--- a/ceee/testing/utils/test_utils.h
+++ b/ceee/testing/utils/test_utils.h
@@ -67,7 +67,8 @@ class LogDisabler {
~LogDisabler();
private:
- int initial_log_level_;
+ logging::LogMessageHandlerFunction old_handler_;
+ static bool DropMessageHandler(int severity, const std::string& str);
};
// Overrides a path in the PathService singleton, replacing the