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

Unified Diff: base/message_loop/message_pump_libevent_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/message_loop/message_pump_io_ios_unittest.cc ('k') | base/metrics/field_trial_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_libevent_unittest.cc
diff --git a/base/message_loop/message_pump_libevent_unittest.cc b/base/message_loop/message_pump_libevent_unittest.cc
index 6d1cf7ef31f9a9ab55da3de7730148bb8de4aacb..b4b946e59469f225d370a6a64baa7b2fb9a98e3c 100644
--- a/base/message_loop/message_pump_libevent_unittest.cc
+++ b/base/message_loop/message_pump_libevent_unittest.cc
@@ -18,6 +18,7 @@
#include "base/single_thread_task_runner.h"
#include "base/synchronization/waitable_event.h"
#include "base/synchronization/waitable_event_watcher.h"
+#include "base/test/gtest_util.h"
#include "base/third_party/libevent/event.h"
#include "base/threading/thread.h"
#include "build/build_config.h"
@@ -77,8 +78,6 @@ class StupidWatcher : public MessagePumpLibevent::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.
#if defined(OS_CHROMEOS) || defined(OS_LINUX)
@@ -91,20 +90,21 @@ TEST_F(MessagePumpLibeventTest, MAYBE_TestWatchingFromBadThread) {
MessagePumpLibevent::FileDescriptorWatcher watcher;
StupidWatcher delegate;
- ASSERT_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\\(\\)");
}
TEST_F(MessagePumpLibeventTest, QuitOutsideOfRun) {
std::unique_ptr<MessagePumpLibevent> pump(new MessagePumpLibevent);
- ASSERT_DEATH(pump->Quit(), "Check failed: in_run_. "
- "Quit was called outside of Run!");
+ ASSERT_DCHECK_DEATH(pump->Quit(),
+ "Check failed: in_run_. "
+ "Quit was called outside of Run!");
}
-#endif // GTEST_HAS_DEATH_TEST && !defined(NDEBUG)
-
class BaseWatcher : public MessagePumpLibevent::Watcher {
public:
explicit BaseWatcher(MessagePumpLibevent::FileDescriptorWatcher* controller)
« no previous file with comments | « base/message_loop/message_pump_io_ios_unittest.cc ('k') | base/metrics/field_trial_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698