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

Unified Diff: cc/CCLayerTreeHostImplTest.cpp

Issue 10909020: Enable webkit_compositor_unittests (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 4 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 | « cc/CCLayerTreeHostImpl.cpp ('k') | cc/CCLayerTreeHostTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/CCLayerTreeHostImplTest.cpp
diff --git a/cc/CCLayerTreeHostImplTest.cpp b/cc/CCLayerTreeHostImplTest.cpp
index a8c346aeeba4fbad15d843ae2a47ad0587ee2bde..bad57821197b53a9b0e5fe941754460dccc16855 100644
--- a/cc/CCLayerTreeHostImplTest.cpp
+++ b/cc/CCLayerTreeHostImplTest.cpp
@@ -380,6 +380,24 @@ TEST_F(CCLayerTreeHostImplTest, nonFastScrollableRegionWithOffset)
EXPECT_EQ(m_hostImpl->scrollBegin(IntPoint(10, 10), CCInputHandlerClient::Wheel), CCInputHandlerClient::ScrollOnMainThread);
}
+TEST_F(CCLayerTreeHostImplTest, maxScrollPositionChangedByDeviceScaleFactor)
+{
+ setupScrollAndContentsLayers(IntSize(100, 100));
+
+ float deviceScaleFactor = 2;
+ IntSize layoutViewport(25, 25);
+ IntSize deviceViewport(layoutViewport);
+ deviceViewport.scale(deviceScaleFactor);
+ m_hostImpl->setViewportSize(layoutViewport, deviceViewport);
+ m_hostImpl->setDeviceScaleFactor(deviceScaleFactor);
+ EXPECT_EQ(m_hostImpl->rootLayer()->maxScrollPosition(), IntSize(25, 25));
+
+ deviceScaleFactor = 1;
+ m_hostImpl->setViewportSize(layoutViewport, layoutViewport);
+ m_hostImpl->setDeviceScaleFactor(deviceScaleFactor);
+ EXPECT_EQ(m_hostImpl->rootLayer()->maxScrollPosition(), IntSize(75, 75));
+}
+
TEST_F(CCLayerTreeHostImplTest, pinchGesture)
{
setupScrollAndContentsLayers(IntSize(100, 100));
« no previous file with comments | « cc/CCLayerTreeHostImpl.cpp ('k') | cc/CCLayerTreeHostTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698