Chromium Code Reviews| Index: base/memory/weak_ptr_unittest.cc |
| diff --git a/base/memory/weak_ptr_unittest.cc b/base/memory/weak_ptr_unittest.cc |
| index be3b6dbf6d1e6104435bc8a29e1cbda42621e946..4fc311f51275e67978594fc66af67f48175b0bfa 100644 |
| --- a/base/memory/weak_ptr_unittest.cc |
| +++ b/base/memory/weak_ptr_unittest.cc |
| @@ -336,21 +336,6 @@ TEST(WeakPtrTest, MoveOwnershipImplicitly) { |
| background.DeleteArrow(arrow); |
| } |
| -TEST(WeakPtrTest, MoveOwnershipExplicitlyObjectNotReferenced) { |
| - // Case 1: The target is not bound to any thread yet. So calling |
| - // DetachFromThread() is a no-op. |
| - Target target; |
| - target.DetachFromThreadHack(); |
| - |
| - // Case 2: The target is bound to main thread but no WeakPtr is pointing to |
| - // it. In this case, it will be re-bound to any thread trying to get a |
| - // WeakPtr pointing to it. So detach function call is again no-op. |
| - { |
| - WeakPtr<Target> weak_ptr = target.AsWeakPtr(); |
| - } |
| - target.DetachFromThreadHack(); |
| -} |
| - |
| TEST(WeakPtrTest, MoveOwnershipExplicitly) { |
|
Wez
2013/07/31 19:06:26
The process for "moving" ownership is now:
1. Tak
|
| BackgroundThread background; |
| background.Start(); |
| @@ -358,14 +343,10 @@ TEST(WeakPtrTest, MoveOwnershipExplicitly) { |
| Arrow* arrow; |
| { |
| Target target; |
| - // Background thread creates WeakPtr(and implicitly owns the object). |
| + // Background thread creates WeakPtr. |
| background.CreateArrowFromTarget(&arrow, &target); |
| - EXPECT_EQ(&target, background.DeRef(arrow)); |
| - |
| - // Detach from background thread. |
| - target.DetachFromThreadHack(); |
| - // Re-bind to main thread. |
| + // Bind to main thread. |
| EXPECT_EQ(&target, arrow->target.get()); |
| // Main thread can now delete the target. |