Index: Source/platform/heap/HeapTest.cpp |
diff --git a/Source/platform/heap/HeapTest.cpp b/Source/platform/heap/HeapTest.cpp |
index 1aafc8a11ed9fe2206c0b5e1b1d344df71588f18..488cc164eca77464018def6da3db5c4a398fdee8 100644 |
--- a/Source/platform/heap/HeapTest.cpp |
+++ b/Source/platform/heap/HeapTest.cpp |
@@ -5030,4 +5030,30 @@ TEST(HeapTest, TraceIfNeeded) |
} |
} |
+static bool allocateAndReturnBool() |
+{ |
+ Heap::collectGarbage(ThreadState::HeapPointersOnStack); |
+ return true; |
+} |
+ |
+class PartObjectWithVirtualMethod { |
+public: |
+ virtual void trace(Visitor*) { } |
+}; |
+ |
+class ObjectWithVirtualPartObject : public GarbageCollected<ObjectWithVirtualPartObject> { |
+public: |
+ ObjectWithVirtualPartObject() : m_dummy(allocateAndReturnBool()) { } |
+ void trace(Visitor* visitor) { visitor->trace(m_part); } |
+private: |
+ bool m_dummy; |
+ PartObjectWithVirtualMethod m_part; |
+}; |
+ |
+TEST(HeapTest, PartObjectWithVirtualMethod) |
+{ |
+ ObjectWithVirtualPartObject* object = new ObjectWithVirtualPartObject(); |
+ EXPECT_TRUE(object); |
+} |
+ |
} // namespace blink |