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 |