Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(28)

Unified Diff: webkit/compositor_bindings/WebLayerTest.cpp

Issue 10907075: Roll cc snapshot up to 127605 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webkit/compositor_bindings/WebLayerImpl.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
+}
+
}
« no previous file with comments | « webkit/compositor_bindings/WebLayerImpl.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698