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

Unified Diff: cc/layer_tree_host_impl_unittest.cc

Issue 11377006: LayerImpl::tryScroll must convert its content-space point to layer space before comparing to the no… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ToRoundedPoint Created 8 years, 1 month 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/layer_impl.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layer_tree_host_impl_unittest.cc
diff --git a/cc/layer_tree_host_impl_unittest.cc b/cc/layer_tree_host_impl_unittest.cc
index ddd393d1f036e0562ff26cb95dd614a3f69ddea8..61c7d272261ccc6f213e3cbf70dc62887af5f371 100644
--- a/cc/layer_tree_host_impl_unittest.cc
+++ b/cc/layer_tree_host_impl_unittest.cc
@@ -432,11 +432,13 @@ TEST_P(LayerTreeHostImplTest, nonFastScrollableRegionBasic)
{
setupScrollAndContentsLayers(gfx::Size(200, 200));
m_hostImpl->setViewportSize(gfx::Size(100, 100), gfx::Size(100, 100));
- initializeRendererAndDrawFrame();
- LayerImpl* root = m_hostImpl->rootLayer();
+ LayerImpl* root = m_hostImpl->rootLayer();
+ root->setContentsScale(2, 2);
root->setNonFastScrollableRegion(gfx::Rect(0, 0, 50, 50));
+ initializeRendererAndDrawFrame();
+
// All scroll types inside the non-fast scrollable region should fail.
EXPECT_EQ(m_hostImpl->scrollBegin(gfx::Point(25, 25), InputHandlerClient::Wheel), InputHandlerClient::ScrollOnMainThread);
EXPECT_EQ(m_hostImpl->scrollBegin(gfx::Point(25, 25), InputHandlerClient::Gesture), InputHandlerClient::ScrollOnMainThread);
@@ -454,10 +456,12 @@ TEST_P(LayerTreeHostImplTest, nonFastScrollableRegionWithOffset)
{
setupScrollAndContentsLayers(gfx::Size(200, 200));
m_hostImpl->setViewportSize(gfx::Size(100, 100), gfx::Size(100, 100));
- LayerImpl* root = m_hostImpl->rootLayer();
+ LayerImpl* root = m_hostImpl->rootLayer();
+ root->setContentsScale(2, 2);
root->setNonFastScrollableRegion(gfx::Rect(0, 0, 50, 50));
root->setPosition(gfx::PointF(-25, 0));
+
initializeRendererAndDrawFrame();
// This point would fall into the non-fast scrollable region except that we've moved the layer down by 25 pixels.
« no previous file with comments | « cc/layer_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698