summaryrefslogtreecommitdiff
path: root/Tools/TestWebKitAPI/Tests/WTF/MemoryInstrumentationTest.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2012-10-23 10:25:11 +0200
committerSimon Hausmann <simon.hausmann@digia.com>2012-10-23 10:25:11 +0200
commit5ea819f80c6840c492386bfafbffb059c7e2091f (patch)
tree42ad0b1d82eff090d14278a088ea0f4840a0f938 /Tools/TestWebKitAPI/Tests/WTF/MemoryInstrumentationTest.cpp
parent43a42f108af6bcbd91f2672731c3047c26213af1 (diff)
downloadqtwebkit-5ea819f80c6840c492386bfafbffb059c7e2091f.tar.gz
Imported WebKit commit 20434eb8eb95065803473139d8794e98a7672f75 (http://svn.webkit.org/repository/webkit/trunk@132191)
New snapshot that should fix build with latest qtbase and the QPlastiqueStyle removal
Diffstat (limited to 'Tools/TestWebKitAPI/Tests/WTF/MemoryInstrumentationTest.cpp')
-rw-r--r--Tools/TestWebKitAPI/Tests/WTF/MemoryInstrumentationTest.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/Tools/TestWebKitAPI/Tests/WTF/MemoryInstrumentationTest.cpp b/Tools/TestWebKitAPI/Tests/WTF/MemoryInstrumentationTest.cpp
index c6368bf3f..9a998da03 100644
--- a/Tools/TestWebKitAPI/Tests/WTF/MemoryInstrumentationTest.cpp
+++ b/Tools/TestWebKitAPI/Tests/WTF/MemoryInstrumentationTest.cpp
@@ -734,7 +734,15 @@ TEST(MemoryInstrumentationTest, arrayBuffer)
EXPECT_EQ(2u, helper.visitedObjects());
}
-class ClassWithTwoAncestors : public NotInstrumented, public Instrumented {
+class AncestorWithVirtualMethod {
+public:
+ virtual char* data() { return m_data; }
+
+private:
+ char m_data[10];
+};
+
+class ClassWithTwoAncestors : public AncestorWithVirtualMethod, public Instrumented {
public:
virtual void reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
{
@@ -751,10 +759,11 @@ TEST(MemoryInstrumentationTest, instrumentedWithMultipleAncestors)
InstrumentedOwner<ClassWithTwoAncestors*> descendantPointerOwner(descendantPointer);
Instrumented* ancestorPointer = descendantPointer;
InstrumentedOwner<Instrumented*> ancestorPointerOwner(ancestorPointer);
+ EXPECT_NE(static_cast<void*>(ancestorPointer), static_cast<void*>(descendantPointer));
helper.addRootObject(descendantPointerOwner);
helper.addRootObject(ancestorPointerOwner);
EXPECT_EQ(sizeof(ClassWithTwoAncestors), helper.reportedSizeForAllTypes());
- EXPECT_EQ(1u, helper.visitedObjects());
+ EXPECT_EQ(2u, helper.visitedObjects());
}
} // namespace