| Index: base/memory/weak_ptr_unittest.cc
|
| diff --git a/base/memory/weak_ptr_unittest.cc b/base/memory/weak_ptr_unittest.cc
|
| index ebcf33c57ec3637407e4246de66159d033562d4e..e0a46a7feba8aa9ca3d6b51b524fef03d4479ef3 100644
|
| --- a/base/memory/weak_ptr_unittest.cc
|
| +++ b/base/memory/weak_ptr_unittest.cc
|
| @@ -12,6 +12,7 @@
|
| #include "base/location.h"
|
| #include "base/single_thread_task_runner.h"
|
| #include "base/synchronization/waitable_event.h"
|
| +#include "base/test/gtest_util.h"
|
| #include "base/threading/thread.h"
|
| #include "testing/gtest/include/gtest/gtest.h"
|
|
|
| @@ -563,8 +564,6 @@ TEST(WeakPtrTest, NonOwnerThreadCanDeleteWeakPtr) {
|
| background.DeleteArrow(arrow);
|
| }
|
|
|
| -#if (!defined(NDEBUG) || defined(DCHECK_ALWAYS_ON)) && GTEST_HAS_DEATH_TEST
|
| -
|
| TEST(WeakPtrDeathTest, WeakPtrCopyDoesNotChangeThreadBinding) {
|
| // The default style "fast" does not support multi-threaded tests
|
| // (introduces deadlock on Linux).
|
| @@ -588,7 +587,7 @@ TEST(WeakPtrDeathTest, WeakPtrCopyDoesNotChangeThreadBinding) {
|
|
|
| // Although background thread created the copy, it can not deref the copied
|
| // WeakPtr.
|
| - ASSERT_DEATH(background.DeRef(arrow_copy), "");
|
| + ASSERT_DCHECK_DEATH(background.DeRef(arrow_copy), "");
|
|
|
| background.DeleteArrow(arrow_copy);
|
| }
|
| @@ -610,7 +609,7 @@ TEST(WeakPtrDeathTest, NonOwnerThreadDereferencesWeakPtrAfterReference) {
|
| // Background thread tries to deref target, which violates thread ownership.
|
| BackgroundThread background;
|
| background.Start();
|
| - ASSERT_DEATH(background.DeRef(&arrow), "");
|
| + ASSERT_DCHECK_DEATH(background.DeRef(&arrow), "");
|
| }
|
|
|
| TEST(WeakPtrDeathTest, NonOwnerThreadDeletesWeakPtrAfterReference) {
|
| @@ -630,7 +629,7 @@ TEST(WeakPtrDeathTest, NonOwnerThreadDeletesWeakPtrAfterReference) {
|
| background.DeRef(&arrow);
|
|
|
| // Main thread deletes Target, violating thread binding.
|
| - ASSERT_DEATH(target.reset(), "");
|
| + ASSERT_DCHECK_DEATH(target.reset(), "");
|
|
|
| // |target.reset()| died so |target| still holds the object, so we
|
| // must pass it to the background thread to teardown.
|
| @@ -653,7 +652,7 @@ TEST(WeakPtrDeathTest, NonOwnerThreadDeletesObjectAfterReference) {
|
| // Background thread tries to delete target, volating thread binding.
|
| BackgroundThread background;
|
| background.Start();
|
| - ASSERT_DEATH(background.DeleteTarget(target.release()), "");
|
| + ASSERT_DCHECK_DEATH(background.DeleteTarget(target.release()), "");
|
| }
|
|
|
| TEST(WeakPtrDeathTest, NonOwnerThreadReferencesObjectAfterDeletion) {
|
| @@ -673,9 +672,7 @@ TEST(WeakPtrDeathTest, NonOwnerThreadReferencesObjectAfterDeletion) {
|
| background.DeleteTarget(target.release());
|
|
|
| // Main thread attempts to dereference the target, violating thread binding.
|
| - ASSERT_DEATH(arrow.target.get(), "");
|
| + ASSERT_DCHECK_DEATH(arrow.target.get(), "");
|
| }
|
|
|
| -#endif
|
| -
|
| } // namespace base
|
|
|