Chromium Code Reviews| Index: third_party/WebKit/Source/platform/heap/HeapTest.cpp |
| diff --git a/third_party/WebKit/Source/platform/heap/HeapTest.cpp b/third_party/WebKit/Source/platform/heap/HeapTest.cpp |
| index c3d0aa58ecde03ca0c071339ef8076e59a984131..10bcac901bb2204a7d9acabe1f56e30a9a8f49b3 100644 |
| --- a/third_party/WebKit/Source/platform/heap/HeapTest.cpp |
| +++ b/third_party/WebKit/Source/platform/heap/HeapTest.cpp |
| @@ -3922,6 +3922,26 @@ TEST(HeapTest, Comparisons) { |
| EXPECT_TRUE(barPersistent == fooPersistent); |
| } |
| +TEST(HeapTest, CheckConstObjectAlive) { |
| + SimpleObject* object = SimpleObject::create(); |
| + const SimpleObject* constObject = object; |
| + |
| + EXPECT_FALSE(ThreadHeap::isHeapObjectAlive(object)); |
| + EXPECT_FALSE(ThreadHeap::isHeapObjectAlive(constObject)); |
| + |
| + // { |
| + // TestGCScope scope(BlinkGC::HeapPointersOnStack); |
| + // ThreadHeap& heap = ThreadState::current()->heap(); |
| + // CountingVisitor visitor(ThreadState::current()); |
| + |
| + // Address objectAddress = reinterpret_cast<Address>(object); |
| + // EXPECT_TRUE(heap.checkAndMarkPointer(&visitor, objectAddress)); |
| + |
| + // EXPECT_TRUE(ThreadHeap::isHeapObjectAlive(object)); |
| + // EXPECT_TRUE(ThreadHeap::isHeapObjectAlive(constObject)); |
| + // } |
|
haraken
2016/11/02 01:12:47
Can we remove this comment? It's not worth adding
chcunningham
2016/11/02 01:19:06
Sorry, I mean to uncomment it actually, but it doe
haraken
2016/11/02 01:22:30
Ah, actually this test doesn't make sense in the f
|
| +} |
| + |
| TEST(HeapTest, CheckAndMarkPointer) { |
| ThreadHeap& heap = ThreadState::current()->heap(); |
| clearOutOldGarbage(); |