Index: base/threading/non_thread_safe_unittest.cc |
diff --git a/base/threading/non_thread_safe_unittest.cc b/base/threading/non_thread_safe_unittest.cc |
index d523fc55b101904f601adb63b4dc09f01c540972..c503c1893384ab8118ce435146d1ecc8075da0d2 100644 |
--- a/base/threading/non_thread_safe_unittest.cc |
+++ b/base/threading/non_thread_safe_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" |
@@ -106,8 +107,6 @@ TEST(NonThreadSafeTest, DetachThenDestructOnDifferentThread) { |
delete_on_thread.Join(); |
} |
-#if GTEST_HAS_DEATH_TEST || !ENABLE_NON_THREAD_SAFE |
- |
void NonThreadSafeClass::MethodOnDifferentThreadImpl() { |
std::unique_ptr<NonThreadSafeClass> non_thread_safe_class( |
new NonThreadSafeClass); |
@@ -122,9 +121,8 @@ void NonThreadSafeClass::MethodOnDifferentThreadImpl() { |
#if ENABLE_NON_THREAD_SAFE |
TEST(NonThreadSafeDeathTest, MethodNotAllowedOnDifferentThreadInDebug) { |
- ASSERT_DEATH({ |
- NonThreadSafeClass::MethodOnDifferentThreadImpl(); |
- }, ""); |
+ ASSERT_DCHECK_DEATH({ NonThreadSafeClass::MethodOnDifferentThreadImpl(); }, |
+ ""); |
} |
#else |
TEST(NonThreadSafeTest, MethodAllowedOnDifferentThreadInRelease) { |
@@ -147,9 +145,8 @@ void NonThreadSafeClass::DestructorOnDifferentThreadImpl() { |
#if ENABLE_NON_THREAD_SAFE |
TEST(NonThreadSafeDeathTest, DestructorNotAllowedOnDifferentThreadInDebug) { |
- ASSERT_DEATH({ |
- NonThreadSafeClass::DestructorOnDifferentThreadImpl(); |
- }, ""); |
+ ASSERT_DCHECK_DEATH( |
+ { NonThreadSafeClass::DestructorOnDifferentThreadImpl(); }, ""); |
} |
#else |
TEST(NonThreadSafeTest, DestructorAllowedOnDifferentThreadInRelease) { |
@@ -157,8 +154,6 @@ TEST(NonThreadSafeTest, DestructorAllowedOnDifferentThreadInRelease) { |
} |
#endif // ENABLE_NON_THREAD_SAFE |
-#endif // GTEST_HAS_DEATH_TEST || !ENABLE_NON_THREAD_SAFE |
- |
// Just in case we ever get lumped together with other compilation units. |
#undef ENABLE_NON_THREAD_SAFE |