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

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: 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
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);
« Source/heap/Handle.h ('K') | « Source/heap/Heap.h ('k') | Source/heap/Visitor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698