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

Unified Diff: Source/heap/HeapTest.cpp

Issue 138203002: Rename a few Member and Persistent methods to make the transition (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase Created 6 years, 11 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
« no previous file with comments | « Source/heap/Heap.h ('k') | Source/heap/Visitor.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/heap/HeapTest.cpp
diff --git a/Source/heap/HeapTest.cpp b/Source/heap/HeapTest.cpp
index a1d3512127e22c51391a26ee5b91cd081c1a63b0..51743f74e7b6095730eb24ecc12d3da687bad6bc 100644
--- a/Source/heap/HeapTest.cpp
+++ b/Source/heap/HeapTest.cpp
@@ -338,7 +338,7 @@ public:
visitor->trace(m_bar);
}
- void clear() { m_bar.clear(); }
+ void clear() { m_bar.release(); }
private:
explicit Baz(Bar* bar)
@@ -653,8 +653,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();
@@ -994,7 +994,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.
@@ -1007,6 +1007,21 @@ TEST(HeapTest, WeakMembers)
Heap::shutdown();
}
+TEST(HeapTest, Comparisons)
+{
+ Heap::init();
+
+ {
+ Persistent<Bar> barPersistent = Bar::create();
+ Persistent<Foo> fooPersistent = Foo::create(barPersistent);
+ EXPECT_TRUE(barPersistent != fooPersistent);
+ barPersistent = fooPersistent;
+ EXPECT_TRUE(barPersistent == fooPersistent);
+ }
+
+ Heap::shutdown();
+}
+
DEFINE_GC_INFO(Bar);
DEFINE_GC_INFO(Baz);
DEFINE_GC_INFO(ClassWithMember);
« no previous file with comments | « Source/heap/Heap.h ('k') | Source/heap/Visitor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698