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

Unified Diff: base/threading/thread_checker_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/threading/non_thread_safe_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/threading/thread_checker_unittest.cc
diff --git a/base/threading/thread_checker_unittest.cc b/base/threading/thread_checker_unittest.cc
index bc5b1e473a5fdc21ee01496a1e19f3fd66bde7c6..12454c87859248311e2d301e4f0d00f86a2a274e 100644
--- a/base/threading/thread_checker_unittest.cc
+++ b/base/threading/thread_checker_unittest.cc
@@ -8,6 +8,7 @@
#include "base/logging.h"
#include "base/macros.h"
+#include "base/test/gtest_util.h"
#include "base/threading/simple_thread.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -118,8 +119,6 @@ TEST(ThreadCheckerTest, DetachFromThread) {
call_on_thread.Join();
}
-#if GTEST_HAS_DEATH_TEST || !ENABLE_THREAD_CHECKER
-
void ThreadCheckerClass::MethodOnDifferentThreadImpl() {
std::unique_ptr<ThreadCheckerClass> thread_checker_class(
new ThreadCheckerClass);
@@ -134,9 +133,8 @@ void ThreadCheckerClass::MethodOnDifferentThreadImpl() {
#if ENABLE_THREAD_CHECKER
TEST(ThreadCheckerDeathTest, MethodNotAllowedOnDifferentThreadInDebug) {
- ASSERT_DEATH({
- ThreadCheckerClass::MethodOnDifferentThreadImpl();
- }, "");
+ ASSERT_DCHECK_DEATH({ ThreadCheckerClass::MethodOnDifferentThreadImpl(); },
+ "");
}
#else
TEST(ThreadCheckerTest, MethodAllowedOnDifferentThreadInRelease) {
@@ -163,9 +161,8 @@ void ThreadCheckerClass::DetachThenCallFromDifferentThreadImpl() {
#if ENABLE_THREAD_CHECKER
TEST(ThreadCheckerDeathTest, DetachFromThreadInDebug) {
- ASSERT_DEATH({
- ThreadCheckerClass::DetachThenCallFromDifferentThreadImpl();
- }, "");
+ ASSERT_DCHECK_DEATH(
+ { ThreadCheckerClass::DetachThenCallFromDifferentThreadImpl(); }, "");
}
#else
TEST(ThreadCheckerTest, DetachFromThreadInRelease) {
@@ -173,8 +170,6 @@ TEST(ThreadCheckerTest, DetachFromThreadInRelease) {
}
#endif // ENABLE_THREAD_CHECKER
-#endif // GTEST_HAS_DEATH_TEST || !ENABLE_THREAD_CHECKER
-
// Just in case we ever get lumped together with other compilation units.
#undef ENABLE_THREAD_CHECKER
« no previous file with comments | « base/threading/non_thread_safe_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698