Chromium Code Reviews| Index: Source/heap/HeapTest.cpp |
| diff --git a/Source/heap/HeapTest.cpp b/Source/heap/HeapTest.cpp |
| index a9922c199fdb7c3a3baa1ba074a99632bcf1b69a..e2963bd521c8db99371236ddc9e9eb02e1f5b069 100644 |
| --- a/Source/heap/HeapTest.cpp |
| +++ b/Source/heap/HeapTest.cpp |
| @@ -339,7 +339,7 @@ public: |
| visitor->trace(m_bar); |
| } |
| - void clear() { m_bar.clear(); } |
| + void clear() { m_bar.release(); } |
| private: |
| explicit Baz(Bar* bar) |
| @@ -654,8 +654,8 @@ TEST(HeapTest, TypedHeapSanity) |
| // We use TraceCounter for allocating an object on the general heap. |
| Persistent<TraceCounter> generalHeapObject = TraceCounter::create(); |
| Persistent<TestTypedHeapClass> typedHeapObject = TestTypedHeapClass::create(); |
| - EXPECT_NE(pageHeaderAddress(reinterpret_cast<Address>(generalHeapObject.raw())), |
| - pageHeaderAddress(reinterpret_cast<Address>(typedHeapObject.raw()))); |
| + EXPECT_NE(pageHeaderAddress(reinterpret_cast<Address>(generalHeapObject.get())), |
| + pageHeaderAddress(reinterpret_cast<Address>(typedHeapObject.get()))); |
| } |
| Heap::shutdown(); |
| @@ -995,7 +995,7 @@ TEST(HeapTest, WeakMembers) |
| EXPECT_FALSE(h4->weakIsThere()); // h3 is gone from weak pointer. |
| EXPECT_TRUE(h5->strongIsThere()); |
| EXPECT_FALSE(h5->weakIsThere()); // h3 is gone from weak pointer. |
| - h1.clear(); // Zero out h1. |
| + h1.release(); // Zero out h1. |
| Heap::collectGarbage(ThreadState::NoHeapPointersOnStack); |
| EXPECT_EQ(3u, Bar::s_live); // Only h4, h5 and h2 are left. |
| EXPECT_TRUE(h4->strongIsThere()); // h2 is still pointed to from h4. |
| @@ -1008,6 +1008,21 @@ TEST(HeapTest, WeakMembers) |
| Heap::shutdown(); |
| } |
| +TEST(HeapTest, Comparisons) |
| +{ |
| + Heap::init(); |
|
haraken
2014/01/14 13:57:10
This will be removed in wibling's CL, which is cur
Mads Ager (chromium)
2014/01/14 14:03:13
Yes. I'll wait for Gustav's changes, rebase and pu
|
| + |
| + { |
| + Persistent<Bar> barPersistent = Bar::create(); |
| + Persistent<Foo> fooPersistent = Foo::create(barPersistent); |
| + EXPECT_TRUE(barPersistent != fooPersistent); |
| + barPersistent = fooPersistent; |
| + EXPECT_TRUE(barPersistent == fooPersistent); |
| + } |
| + |
| + Heap::shutdown(); |
|
haraken
2014/01/14 13:57:10
Ditto.
|
| +} |
| + |
| DEFINE_GC_INFO(Bar); |
| DEFINE_GC_INFO(Baz); |
| DEFINE_GC_INFO(ClassWithMember); |