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

Unified Diff: base/memory/weak_ptr_unittest.cc

Issue 19522006: GLInProcessContext: support async flushes and dedicated GPU thread (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove tls Created 7 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
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) {
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.

Powered by Google App Engine
This is Rietveld 408576698