summaryrefslogtreecommitdiff
path: root/Source/WebKit/chromium/tests/LayerChromiumTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebKit/chromium/tests/LayerChromiumTest.cpp')
-rw-r--r--Source/WebKit/chromium/tests/LayerChromiumTest.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/Source/WebKit/chromium/tests/LayerChromiumTest.cpp b/Source/WebKit/chromium/tests/LayerChromiumTest.cpp
index cd4fcc340..4a92b1509 100644
--- a/Source/WebKit/chromium/tests/LayerChromiumTest.cpp
+++ b/Source/WebKit/chromium/tests/LayerChromiumTest.cpp
@@ -813,4 +813,20 @@ TEST(LayerChromiumLayerTreeHostTest, replaceMaskAndReplicaLayer)
WebKit::WebCompositor::shutdown();
}
+class MockLayerChromium : public LayerChromium {
+public:
+ bool needsDisplay() const { return m_needsDisplay; }
+};
+
+TEST(LayerChromiumTestWithoutFixture, setBoundsTriggersSetNeedsRedrawAfterGettingNonEmptyBounds)
+{
+ RefPtr<MockLayerChromium> layer(adoptRef(new MockLayerChromium));
+ EXPECT_FALSE(layer->needsDisplay());
+ layer->setBounds(IntSize(0, 10));
+ EXPECT_FALSE(layer->needsDisplay());
+ layer->setBounds(IntSize(10, 10));
+ EXPECT_TRUE(layer->needsDisplay());
+}
+
+
} // namespace