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

Unified Diff: base/message_pump_libevent_unittest.cc

Issue 9020008: Enable ThreadChecker in non-debug builds if DCHECK_ALWAYS_ON is (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add IsEnabled function, use in one test. Created 9 years 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 | « no previous file | base/threading/thread_checker.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/message_pump_libevent_unittest.cc
diff --git a/base/message_pump_libevent_unittest.cc b/base/message_pump_libevent_unittest.cc
index 9ec78de587d31f73ca4873a02713e4380fd91826..407aa121fdf28a76aa7d54c250f624bdf9b5cf15 100644
--- a/base/message_pump_libevent_unittest.cc
+++ b/base/message_pump_libevent_unittest.cc
@@ -8,6 +8,7 @@
#include "base/message_loop.h"
#include "base/threading/thread.h"
+#include "base/threading/thread_checker.h"
#include "testing/gtest/include/gtest/gtest.h"
#if defined(USE_SYSTEM_LIBEVENT)
@@ -67,10 +68,16 @@ TEST_F(MessagePumpLibeventTest, TestWatchingFromBadThread) {
MessagePumpLibevent::FileDescriptorWatcher watcher;
StupidWatcher delegate;
- ASSERT_DEBUG_DEATH(io_loop()->WatchFileDescriptor(
Nico 2011/12/21 18:10:11 How is ASSERT_DEBUG_DEATH a useful test? I think w
- STDOUT_FILENO, false, MessageLoopForIO::WATCH_READ, &watcher, &delegate),
- "Check failed: "
- "watch_file_descriptor_caller_checker_.CalledOnValidThread()");
+ if (base::ThreadChecker::IsEnabled()) {
+ ASSERT_DEATH(
+ io_loop()->WatchFileDescriptor(STDOUT_FILENO,
+ false,
+ MessageLoopForIO::WATCH_READ,
+ &watcher,
+ &delegate),
+ "Check failed: "
+ "watch_file_descriptor_caller_checker_.CalledOnValidThread()");
+ }
}
#endif // GTEST_HAS_DEATH_TEST
« no previous file with comments | « no previous file | base/threading/thread_checker.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698