summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoraelias@chromium.org <aelias@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-02-07 05:54:50 +0000
committeraelias@chromium.org <aelias@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-02-07 05:54:50 +0000
commitf493727c3f15c485fb92e6c1ea84fcf78060bddf (patch)
treee5ed81580f035f2e5c63cd028c818fcd507ecea9
parent08523a7f5f0bea076a5c3aee76c23003a2dda154 (diff)
downloadchromium_src-f493727c3f15c485fb92e6c1ea84fcf78060bddf.zip
chromium_src-f493727c3f15c485fb92e6c1ea84fcf78060bddf.tar.gz
chromium_src-f493727c3f15c485fb92e6c1ea84fcf78060bddf.tar.bz2
Add test for page scale adjustment for flings.
BUG=174695 Review URL: https://chromiumcodereview.appspot.com/12213057 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@181223 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--cc/layer_tree_host_impl_unittest.cc22
1 files changed, 22 insertions, 0 deletions
diff --git a/cc/layer_tree_host_impl_unittest.cc b/cc/layer_tree_host_impl_unittest.cc
index bab4511..c116d93 100644
--- a/cc/layer_tree_host_impl_unittest.cc
+++ b/cc/layer_tree_host_impl_unittest.cc
@@ -1448,6 +1448,9 @@ TEST_P(LayerTreeHostImplTest, scrollChildBeyondLimit)
TEST_P(LayerTreeHostImplTest, scrollWithoutBubbling)
{
+ if (!m_hostImpl->settings().pageScalePinchZoomEnabled)
+ return;
+
// Scroll a child layer beyond its maximum scroll range and make sure the
// the scroll doesn't bubble up to the parent layer.
gfx::Size surfaceSize(10, 10);
@@ -1513,6 +1516,25 @@ TEST_P(LayerTreeHostImplTest, scrollWithoutBubbling)
// The child should not have scrolled.
expectContains(*scrollInfo.get(), child->id(), gfx::Vector2d(0, -3));
+
+
+ // Scrolling should be adjusted from viewport space.
+ m_hostImpl->activeTree()->SetPageScaleFactorAndLimits(2, 2, 2);
+ m_hostImpl->activeTree()->SetPageScaleDelta(1);
+ gfx::Transform scaleTransform;
+ scaleTransform.Scale(2, 2);
+ m_hostImpl->activeTree()->RootLayer()->setImplTransform(scaleTransform);
+
+ scrollDelta = gfx::Vector2d(0, -2);
+ EXPECT_EQ(InputHandlerClient::ScrollStarted, m_hostImpl->scrollBegin(gfx::Point(1, 1), InputHandlerClient::NonBubblingGesture));
+ EXPECT_EQ(grandChild, m_hostImpl->currentlyScrollingLayer());
+ m_hostImpl->scrollBy(gfx::Point(), scrollDelta);
+ m_hostImpl->scrollEnd();
+
+ scrollInfo = m_hostImpl->processScrollDeltas();
+
+ // Should have scrolled by half the amount in layer space (5 - 2/2)
+ expectContains(*scrollInfo.get(), grandChild->id(), gfx::Vector2d(0, 4));
}
}