Index: base/memory/weak_ptr_unittest.cc |
=================================================================== |
--- base/memory/weak_ptr_unittest.cc (revision 85147) |
+++ base/memory/weak_ptr_unittest.cc (working copy) |
@@ -80,6 +80,20 @@ |
EXPECT_TRUE(b.get() == NULL); |
} |
+TEST(WeakPtrTest, MultipleStaged) { |
+ WeakPtr<int> a; |
+ { |
+ int data; |
+ WeakPtrFactory<int> factory(&data); |
+ a = factory.GetWeakPtr(); |
+ { |
+ WeakPtr<int> b = factory.GetWeakPtr(); |
willchan no longer on Chromium
2011/05/24 22:29:24
Maybe you should also add EXPECTs for b? Up to you
|
+ } |
+ EXPECT_TRUE(a.get() != NULL); |
+ } |
+ EXPECT_TRUE(a.get() == NULL); |
+} |
+ |
TEST(WeakPtrTest, UpCast) { |
Derived data; |
WeakPtrFactory<Derived> factory(&data); |