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

Unified Diff: base/message_loop/message_pump_io_ios_unittest.cc

Issue 2162053006: Move EXPECT_DCHECK_DEATH from base/task_scheduler and use it in relevant base/ tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge up to r408965 Created 4 years, 5 months 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 | « base/memory/weak_ptr_unittest.cc ('k') | base/message_loop/message_pump_libevent_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/message_loop/message_pump_io_ios_unittest.cc
diff --git a/base/message_loop/message_pump_io_ios_unittest.cc b/base/message_loop/message_pump_io_ios_unittest.cc
index 9aadc6bbfc2624ff380c950017114c47fb016581..cde10958bfbe52303d10ce8fea08ae285adebba0 100644
--- a/base/message_loop/message_pump_io_ios_unittest.cc
+++ b/base/message_loop/message_pump_io_ios_unittest.cc
@@ -9,6 +9,7 @@
#include "base/macros.h"
#include "base/message_loop/message_loop.h"
#include "base/posix/eintr_wrapper.h"
+#include "base/test/gtest_util.h"
#include "base/threading/thread.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -72,22 +73,20 @@ class StupidWatcher : public MessagePumpIOSForIO::Watcher {
void OnFileCanWriteWithoutBlocking(int fd) override {}
};
-#if GTEST_HAS_DEATH_TEST && !defined(NDEBUG)
-
-// Test to make sure that we catch calling WatchFileDescriptor off of the
-// wrong thread.
+// Test to make sure that we catch calling WatchFileDescriptor off of the wrong
+// thread.
TEST_F(MessagePumpIOSForIOTest, TestWatchingFromBadThread) {
MessagePumpIOSForIO::FileDescriptorWatcher watcher;
StupidWatcher delegate;
- ASSERT_DEBUG_DEATH(io_loop()->WatchFileDescriptor(
- STDOUT_FILENO, false, MessageLoopForIO::WATCH_READ, &watcher, &delegate),
+ ASSERT_DCHECK_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 && !defined(NDEBUG)
-
class BaseWatcher : public MessagePumpIOSForIO::Watcher {
public:
BaseWatcher(MessagePumpIOSForIO::FileDescriptorWatcher* controller)
« no previous file with comments | « base/memory/weak_ptr_unittest.cc ('k') | base/message_loop/message_pump_libevent_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698