Index: webkit/compositor_bindings/WebLayerTest.cpp |
diff --git a/webkit/compositor_bindings/WebLayerTest.cpp b/webkit/compositor_bindings/WebLayerTest.cpp |
index 18dc0442118e536304d8e4147cf38a1ab3fecbc7..09b26f47d68f185bedca61f4b53db8763a0127d0 100644 |
--- a/webkit/compositor_bindings/WebLayerTest.cpp |
+++ b/webkit/compositor_bindings/WebLayerTest.cpp |
@@ -14,6 +14,7 @@ |
#include <public/WebExternalTextureLayer.h> |
#include <public/WebFloatPoint.h> |
#include <public/WebFloatRect.h> |
+#include <public/WebLayerScrollClient.h> |
#include <public/WebLayerTreeView.h> |
#include <public/WebLayerTreeViewClient.h> |
#include <public/WebRect.h> |
@@ -152,4 +153,28 @@ TEST_F(WebLayerTest, Client) |
EXPECT_FALSE(contentLayer->layer()->drawsContent()); |
} |
+class MockScrollClient : public WebLayerScrollClient { |
+public: |
+ MOCK_METHOD0(didScroll, void()); |
+}; |
+ |
+TEST_F(WebLayerTest, notifyScrollClient) |
+{ |
+ MockScrollClient scrollClient; |
+ |
+ EXPECT_CALL(scrollClient, didScroll()).Times(0); |
+ m_rootLayer->setScrollClient(&scrollClient); |
+ Mock::VerifyAndClearExpectations(&scrollClient); |
+ |
+ EXPECT_CALL(scrollClient, didScroll()).Times(1); |
+ m_rootLayer->setScrollPosition(WebPoint(14, 19)); |
+ Mock::VerifyAndClearExpectations(&scrollClient); |
+ |
+ EXPECT_CALL(scrollClient, didScroll()).Times(0); |
+ m_rootLayer->setScrollPosition(WebPoint(14, 19)); |
+ Mock::VerifyAndClearExpectations(&scrollClient); |
+ |
+ m_rootLayer->setScrollClient(0); |
+} |
+ |
} |