| Index: cc/trees/layer_tree_host_impl_unittest.cc
|
| diff --git a/cc/trees/layer_tree_host_impl_unittest.cc b/cc/trees/layer_tree_host_impl_unittest.cc
|
| index 8ecfcdf8e2f5f83e65b5b5aa56f58d0d72c72331..2cc071eae4a1e61158bb82c78ad4312c71068556 100644
|
| --- a/cc/trees/layer_tree_host_impl_unittest.cc
|
| +++ b/cc/trees/layer_tree_host_impl_unittest.cc
|
| @@ -750,7 +750,7 @@ TEST_F(LayerTreeHostImplTest, ScrollBlocksOnWheelEventHandlers) {
|
|
|
| // But gesture scrolls can still be handled.
|
| status = host_impl_->ScrollBegin(BeginState(gfx::Point()).get(),
|
| - InputHandler::GESTURE);
|
| + InputHandler::TOUCHSCREEN);
|
| EXPECT_EQ(InputHandler::SCROLL_ON_IMPL_THREAD, status.thread);
|
| EXPECT_EQ(MainThreadScrollingReason::kNotScrollingOnMain,
|
| status.main_thread_scrolling_reasons);
|
| @@ -793,7 +793,7 @@ TEST_F(LayerTreeHostImplTest, ScrollBlocksOnTouchEventHandlers) {
|
|
|
| // But they don't influence the actual handling of the scroll gestures.
|
| InputHandler::ScrollStatus status = host_impl_->ScrollBegin(
|
| - BeginState(gfx::Point()).get(), InputHandler::GESTURE);
|
| + BeginState(gfx::Point()).get(), InputHandler::TOUCHSCREEN);
|
| EXPECT_EQ(InputHandler::SCROLL_ON_IMPL_THREAD, status.thread);
|
| EXPECT_EQ(MainThreadScrollingReason::kNotScrollingOnMain,
|
| status.main_thread_scrolling_reasons);
|
| @@ -819,7 +819,7 @@ TEST_F(LayerTreeHostImplTest, FlingOnlyWhenScrollingTouchscreen) {
|
|
|
| // Start scrolling a layer
|
| status = host_impl_->ScrollBegin(BeginState(gfx::Point()).get(),
|
| - InputHandler::GESTURE);
|
| + InputHandler::TOUCHSCREEN);
|
| EXPECT_EQ(InputHandler::SCROLL_ON_IMPL_THREAD, status.thread);
|
| EXPECT_EQ(MainThreadScrollingReason::kNotScrollingOnMain,
|
| status.main_thread_scrolling_reasons);
|
| @@ -869,7 +869,7 @@ TEST_F(LayerTreeHostImplTest, NoFlingWhenScrollingOnMain) {
|
|
|
| // Start scrolling a layer
|
| InputHandler::ScrollStatus status = host_impl_->ScrollBegin(
|
| - BeginState(gfx::Point()).get(), InputHandler::GESTURE);
|
| + BeginState(gfx::Point()).get(), InputHandler::TOUCHSCREEN);
|
| EXPECT_EQ(InputHandler::SCROLL_ON_MAIN_THREAD, status.thread);
|
| EXPECT_EQ(MainThreadScrollingReason::kHasBackgroundAttachmentFixedObjects,
|
| status.main_thread_scrolling_reasons);
|
| @@ -898,7 +898,7 @@ TEST_F(LayerTreeHostImplTest, ShouldScrollOnMainThread) {
|
| status.main_thread_scrolling_reasons);
|
|
|
| status = host_impl_->ScrollBegin(BeginState(gfx::Point()).get(),
|
| - InputHandler::GESTURE);
|
| + InputHandler::TOUCHSCREEN);
|
| EXPECT_EQ(InputHandler::SCROLL_ON_MAIN_THREAD, status.thread);
|
| EXPECT_EQ(MainThreadScrollingReason::kHasBackgroundAttachmentFixedObjects,
|
| status.main_thread_scrolling_reasons);
|
| @@ -924,12 +924,12 @@ TEST_F(LayerTreeHostImplTest, NonFastScrollableRegionBasic) {
|
| InputHandler::WHEEL));
|
|
|
| status = host_impl_->ScrollBegin(BeginState(gfx::Point(25, 25)).get(),
|
| - InputHandler::GESTURE);
|
| + InputHandler::TOUCHSCREEN);
|
| EXPECT_EQ(InputHandler::SCROLL_ON_MAIN_THREAD, status.thread);
|
| EXPECT_EQ(MainThreadScrollingReason::kNonFastScrollableRegion,
|
| status.main_thread_scrolling_reasons);
|
| - EXPECT_FALSE(host_impl_->IsCurrentlyScrollingLayerAt(gfx::Point(25, 25),
|
| - InputHandler::GESTURE));
|
| + EXPECT_FALSE(host_impl_->IsCurrentlyScrollingLayerAt(
|
| + gfx::Point(25, 25), InputHandler::TOUCHSCREEN));
|
|
|
| // All scroll types outside this region should succeed.
|
| status = host_impl_->ScrollBegin(BeginState(gfx::Point(75, 75)).get(),
|
| @@ -938,26 +938,26 @@ TEST_F(LayerTreeHostImplTest, NonFastScrollableRegionBasic) {
|
| EXPECT_EQ(MainThreadScrollingReason::kNotScrollingOnMain,
|
| status.main_thread_scrolling_reasons);
|
|
|
| - EXPECT_TRUE(host_impl_->IsCurrentlyScrollingLayerAt(gfx::Point(75, 75),
|
| - InputHandler::GESTURE));
|
| + EXPECT_TRUE(host_impl_->IsCurrentlyScrollingLayerAt(
|
| + gfx::Point(75, 75), InputHandler::TOUCHSCREEN));
|
| host_impl_->ScrollBy(UpdateState(gfx::Point(), gfx::Vector2d(0, 10)).get());
|
| - EXPECT_FALSE(host_impl_->IsCurrentlyScrollingLayerAt(gfx::Point(25, 25),
|
| - InputHandler::GESTURE));
|
| + EXPECT_FALSE(host_impl_->IsCurrentlyScrollingLayerAt(
|
| + gfx::Point(25, 25), InputHandler::TOUCHSCREEN));
|
| host_impl_->ScrollEnd(EndState().get());
|
| - EXPECT_FALSE(host_impl_->IsCurrentlyScrollingLayerAt(gfx::Point(75, 75),
|
| - InputHandler::GESTURE));
|
| + EXPECT_FALSE(host_impl_->IsCurrentlyScrollingLayerAt(
|
| + gfx::Point(75, 75), InputHandler::TOUCHSCREEN));
|
|
|
| status = host_impl_->ScrollBegin(BeginState(gfx::Point(75, 75)).get(),
|
| - InputHandler::GESTURE);
|
| + InputHandler::TOUCHSCREEN);
|
| EXPECT_EQ(InputHandler::SCROLL_ON_IMPL_THREAD, status.thread);
|
| EXPECT_EQ(MainThreadScrollingReason::kNotScrollingOnMain,
|
| status.main_thread_scrolling_reasons);
|
| - EXPECT_TRUE(host_impl_->IsCurrentlyScrollingLayerAt(gfx::Point(75, 75),
|
| - InputHandler::GESTURE));
|
| + EXPECT_TRUE(host_impl_->IsCurrentlyScrollingLayerAt(
|
| + gfx::Point(75, 75), InputHandler::TOUCHSCREEN));
|
| host_impl_->ScrollBy(UpdateState(gfx::Point(), gfx::Vector2d(0, 10)).get());
|
| host_impl_->ScrollEnd(EndState().get());
|
| - EXPECT_FALSE(host_impl_->IsCurrentlyScrollingLayerAt(gfx::Point(75, 75),
|
| - InputHandler::GESTURE));
|
| + EXPECT_FALSE(host_impl_->IsCurrentlyScrollingLayerAt(
|
| + gfx::Point(75, 75), InputHandler::TOUCHSCREEN));
|
| }
|
|
|
| TEST_F(LayerTreeHostImplTest, NonFastScrollableRegionWithOffset) {
|
| @@ -1001,7 +1001,7 @@ TEST_F(LayerTreeHostImplTest, ScrollHandlerNotPresent) {
|
|
|
| EXPECT_FALSE(host_impl_->scroll_affects_scroll_handler());
|
| host_impl_->ScrollBegin(BeginState(gfx::Point()).get(),
|
| - InputHandler::GESTURE);
|
| + InputHandler::TOUCHSCREEN);
|
| EXPECT_FALSE(host_impl_->scroll_affects_scroll_handler());
|
| host_impl_->ScrollEnd(EndState().get());
|
| EXPECT_FALSE(host_impl_->scroll_affects_scroll_handler());
|
| @@ -1015,7 +1015,7 @@ TEST_F(LayerTreeHostImplTest, ScrollHandlerPresent) {
|
|
|
| EXPECT_FALSE(host_impl_->scroll_affects_scroll_handler());
|
| host_impl_->ScrollBegin(BeginState(gfx::Point()).get(),
|
| - InputHandler::GESTURE);
|
| + InputHandler::TOUCHSCREEN);
|
| EXPECT_TRUE(host_impl_->scroll_affects_scroll_handler());
|
| host_impl_->ScrollEnd(EndState().get());
|
| EXPECT_FALSE(host_impl_->scroll_affects_scroll_handler());
|
| @@ -1028,7 +1028,7 @@ TEST_F(LayerTreeHostImplTest, ScrollByReturnsCorrectValue) {
|
| DrawFrame();
|
|
|
| InputHandler::ScrollStatus status = host_impl_->ScrollBegin(
|
| - BeginState(gfx::Point()).get(), InputHandler::GESTURE);
|
| + BeginState(gfx::Point()).get(), InputHandler::TOUCHSCREEN);
|
| EXPECT_EQ(InputHandler::SCROLL_ON_IMPL_THREAD, status.thread);
|
| EXPECT_EQ(MainThreadScrollingReason::kNotScrollingOnMain,
|
| status.main_thread_scrolling_reasons);
|
| @@ -1483,7 +1483,7 @@ TEST_F(LayerTreeHostImplTest, ImplPinchZoom) {
|
| float page_scale_delta = 2.f;
|
|
|
| host_impl_->ScrollBegin(BeginState(gfx::Point(50, 50)).get(),
|
| - InputHandler::GESTURE);
|
| + InputHandler::TOUCHSCREEN);
|
| host_impl_->PinchGestureBegin();
|
| host_impl_->PinchGestureUpdate(page_scale_delta, gfx::Point(50, 50));
|
| host_impl_->PinchGestureEnd();
|
| @@ -1511,7 +1511,7 @@ TEST_F(LayerTreeHostImplTest, ImplPinchZoom) {
|
|
|
| float page_scale_delta = 2.f;
|
| host_impl_->ScrollBegin(BeginState(gfx::Point()).get(),
|
| - InputHandler::GESTURE);
|
| + InputHandler::TOUCHSCREEN);
|
| host_impl_->PinchGestureBegin();
|
| host_impl_->PinchGestureUpdate(page_scale_delta, gfx::Point());
|
| host_impl_->PinchGestureEnd();
|
| @@ -1554,7 +1554,7 @@ TEST_F(LayerTreeHostImplTest, ViewportScrollOrder) {
|
|
|
| RebuildPropertyTrees();
|
| host_impl_->ScrollBegin(BeginState(gfx::Point(250, 250)).get(),
|
| - InputHandler::GESTURE);
|
| + InputHandler::TOUCHSCREEN);
|
| host_impl_->PinchGestureBegin();
|
| host_impl_->PinchGestureUpdate(2.f, gfx::Point(0, 0));
|
| host_impl_->PinchGestureEnd();
|
| @@ -1570,7 +1570,7 @@ TEST_F(LayerTreeHostImplTest, ViewportScrollOrder) {
|
|
|
| // Scroll down - only the inner viewport should scroll.
|
| host_impl_->ScrollBegin(BeginState(gfx::Point(0, 0)).get(),
|
| - InputHandler::GESTURE);
|
| + InputHandler::TOUCHSCREEN);
|
| host_impl_->ScrollBy(
|
| UpdateState(gfx::Point(0, 0), gfx::Vector2dF(100.f, 100.f)).get());
|
| host_impl_->ScrollEnd(EndState().get());
|
| @@ -1585,7 +1585,7 @@ TEST_F(LayerTreeHostImplTest, ViewportScrollOrder) {
|
| // Scroll down - outer viewport should start scrolling after the inner is at
|
| // its maximum.
|
| host_impl_->ScrollBegin(BeginState(gfx::Point(0, 0)).get(),
|
| - InputHandler::GESTURE);
|
| + InputHandler::TOUCHSCREEN);
|
| host_impl_->ScrollBy(
|
| UpdateState(gfx::Point(0, 0), gfx::Vector2dF(1000.f, 1000.f)).get());
|
| host_impl_->ScrollEnd(EndState().get());
|
| @@ -1625,7 +1625,7 @@ TEST_F(LayerTreeHostImplTest, ScrollViewportWithFractionalAmounts) {
|
|
|
| // Scroll only the layout viewport.
|
| host_impl_->ScrollBegin(BeginState(gfx::Point(250, 250)).get(),
|
| - InputHandler::GESTURE);
|
| + InputHandler::TOUCHSCREEN);
|
| host_impl_->ScrollBy(
|
| UpdateState(gfx::Point(250, 250), gfx::Vector2dF(0.125f, 0.125f)).get());
|
| EXPECT_VECTOR2DF_EQ(
|
| @@ -1640,7 +1640,7 @@ TEST_F(LayerTreeHostImplTest, ScrollViewportWithFractionalAmounts) {
|
|
|
| // Now that we zoomed in, the scroll should be applied to the inner viewport.
|
| host_impl_->ScrollBegin(BeginState(gfx::Point(250, 250)).get(),
|
| - InputHandler::GESTURE);
|
| + InputHandler::TOUCHSCREEN);
|
| host_impl_->ScrollBy(
|
| UpdateState(gfx::Point(250, 250), gfx::Vector2dF(0.5f, 0.5f)).get());
|
| EXPECT_VECTOR2DF_EQ(
|
| @@ -1676,7 +1676,7 @@ TEST_F(LayerTreeHostImplTest, ScrollDuringPinchGesture) {
|
|
|
| RebuildPropertyTrees();
|
| host_impl_->ScrollBegin(BeginState(gfx::Point(250, 250)).get(),
|
| - InputHandler::GESTURE);
|
| + InputHandler::TOUCHSCREEN);
|
| host_impl_->PinchGestureBegin();
|
|
|
| host_impl_->PinchGestureUpdate(2, gfx::Point(250, 250));
|
| @@ -1734,7 +1734,7 @@ TEST_F(LayerTreeHostImplTest, PinchZoomSnapsToScreenEdge) {
|
| // Pinch in within the margins. The scroll should stay exactly locked to the
|
| // bottom and right.
|
| RebuildPropertyTrees();
|
| - host_impl_->ScrollBegin(BeginState(anchor).get(), InputHandler::GESTURE);
|
| + host_impl_->ScrollBegin(BeginState(anchor).get(), InputHandler::TOUCHSCREEN);
|
| host_impl_->PinchGestureBegin();
|
| host_impl_->PinchGestureUpdate(2, anchor);
|
| host_impl_->PinchGestureEnd();
|
| @@ -1752,7 +1752,7 @@ TEST_F(LayerTreeHostImplTest, PinchZoomSnapsToScreenEdge) {
|
| // Pinch in within the margins. The scroll should stay exactly locked to the
|
| // top and left.
|
| anchor = gfx::Point(offsetFromEdge, offsetFromEdge);
|
| - host_impl_->ScrollBegin(BeginState(anchor).get(), InputHandler::GESTURE);
|
| + host_impl_->ScrollBegin(BeginState(anchor).get(), InputHandler::TOUCHSCREEN);
|
| host_impl_->PinchGestureBegin();
|
| host_impl_->PinchGestureUpdate(2, anchor);
|
| host_impl_->PinchGestureEnd();
|
| @@ -1770,7 +1770,7 @@ TEST_F(LayerTreeHostImplTest, PinchZoomSnapsToScreenEdge) {
|
| // Pinch in just outside the margin. There should be no snapping.
|
| offsetFromEdge = Viewport::kPinchZoomSnapMarginDips;
|
| anchor = gfx::Point(offsetFromEdge, offsetFromEdge);
|
| - host_impl_->ScrollBegin(BeginState(anchor).get(), InputHandler::GESTURE);
|
| + host_impl_->ScrollBegin(BeginState(anchor).get(), InputHandler::TOUCHSCREEN);
|
| host_impl_->PinchGestureBegin();
|
| host_impl_->PinchGestureUpdate(2, anchor);
|
| host_impl_->PinchGestureEnd();
|
| @@ -1789,7 +1789,7 @@ TEST_F(LayerTreeHostImplTest, PinchZoomSnapsToScreenEdge) {
|
| offsetFromEdge = Viewport::kPinchZoomSnapMarginDips;
|
| anchor = gfx::Point(viewport_size.width() - offsetFromEdge,
|
| viewport_size.height() - offsetFromEdge);
|
| - host_impl_->ScrollBegin(BeginState(anchor).get(), InputHandler::GESTURE);
|
| + host_impl_->ScrollBegin(BeginState(anchor).get(), InputHandler::TOUCHSCREEN);
|
| host_impl_->PinchGestureBegin();
|
| host_impl_->PinchGestureUpdate(2, anchor);
|
| host_impl_->PinchGestureEnd();
|
| @@ -1871,8 +1871,9 @@ TEST_F(LayerTreeHostImplTest, ScrollWithSwapPromises) {
|
|
|
| SetupScrollAndContentsLayers(gfx::Size(100, 100));
|
| EXPECT_EQ(InputHandler::SCROLL_ON_IMPL_THREAD,
|
| - host_impl_->ScrollBegin(BeginState(gfx::Point()).get(),
|
| - InputHandler::GESTURE)
|
| + host_impl_
|
| + ->ScrollBegin(BeginState(gfx::Point()).get(),
|
| + InputHandler::TOUCHSCREEN)
|
| .thread);
|
| host_impl_->ScrollBy(UpdateState(gfx::Point(), gfx::Vector2d(0, 10)).get());
|
| host_impl_->QueueSwapPromiseForMainThreadScrollUpdate(
|
| @@ -1927,7 +1928,7 @@ TEST_F(LayerTreeHostImplTest, ScrollDoesntBubble) {
|
|
|
| {
|
| host_impl_->ScrollBegin(BeginState(gfx::Point(21, 21)).get(),
|
| - InputHandler::GESTURE);
|
| + InputHandler::TOUCHSCREEN);
|
| host_impl_->ScrollBy(
|
| UpdateState(gfx::Point(21, 21), gfx::Vector2d(5, 5)).get());
|
| host_impl_->ScrollBy(
|
| @@ -1951,7 +1952,7 @@ TEST_F(LayerTreeHostImplTest, ScrollDoesntBubble) {
|
|
|
| {
|
| host_impl_->ScrollBegin(BeginState(gfx::Point(21, 21)).get(),
|
| - InputHandler::GESTURE);
|
| + InputHandler::TOUCHSCREEN);
|
| host_impl_->ScrollBy(
|
| UpdateState(gfx::Point(21, 21), gfx::Vector2d(3, 4)).get());
|
| host_impl_->ScrollBy(
|
| @@ -1995,7 +1996,7 @@ TEST_F(LayerTreeHostImplTest, PinchGesture) {
|
|
|
| float page_scale_delta = 2.f;
|
| host_impl_->ScrollBegin(BeginState(gfx::Point(50, 50)).get(),
|
| - InputHandler::GESTURE);
|
| + InputHandler::TOUCHSCREEN);
|
| host_impl_->PinchGestureBegin();
|
| host_impl_->PinchGestureUpdate(page_scale_delta, gfx::Point(50, 50));
|
| host_impl_->PinchGestureEnd();
|
| @@ -2017,7 +2018,7 @@ TEST_F(LayerTreeHostImplTest, PinchGesture) {
|
| float page_scale_delta = 10.f;
|
|
|
| host_impl_->ScrollBegin(BeginState(gfx::Point(50, 50)).get(),
|
| - InputHandler::GESTURE);
|
| + InputHandler::TOUCHSCREEN);
|
| host_impl_->PinchGestureBegin();
|
| host_impl_->PinchGestureUpdate(page_scale_delta, gfx::Point(50, 50));
|
| host_impl_->PinchGestureEnd();
|
| @@ -2038,7 +2039,7 @@ TEST_F(LayerTreeHostImplTest, PinchGesture) {
|
|
|
| float page_scale_delta = 0.1f;
|
| host_impl_->ScrollBegin(BeginState(gfx::Point()).get(),
|
| - InputHandler::GESTURE);
|
| + InputHandler::TOUCHSCREEN);
|
| host_impl_->PinchGestureBegin();
|
| host_impl_->PinchGestureUpdate(page_scale_delta, gfx::Point());
|
| host_impl_->PinchGestureEnd();
|
| @@ -2061,7 +2062,7 @@ TEST_F(LayerTreeHostImplTest, PinchGesture) {
|
|
|
| float page_scale_delta = 1.f;
|
| host_impl_->ScrollBegin(BeginState(gfx::Point(10, 10)).get(),
|
| - InputHandler::GESTURE);
|
| + InputHandler::TOUCHSCREEN);
|
| host_impl_->PinchGestureBegin();
|
| host_impl_->PinchGestureUpdate(page_scale_delta, gfx::Point(10, 10));
|
| host_impl_->PinchGestureUpdate(page_scale_delta, gfx::Point(20, 20));
|
| @@ -2084,7 +2085,7 @@ TEST_F(LayerTreeHostImplTest, PinchGesture) {
|
|
|
| float page_scale_delta = 1.f;
|
| host_impl_->ScrollBegin(BeginState(gfx::Point(10, 10)).get(),
|
| - InputHandler::GESTURE);
|
| + InputHandler::TOUCHSCREEN);
|
| host_impl_->PinchGestureBegin();
|
| host_impl_->PinchGestureUpdate(page_scale_delta, gfx::Point(10, 10));
|
| host_impl_->ScrollBy(
|
| @@ -2108,7 +2109,7 @@ TEST_F(LayerTreeHostImplTest, PinchGesture) {
|
| scroll_layer->PushScrollOffsetFromMainThread(gfx::ScrollOffset(0, 0));
|
|
|
| host_impl_->ScrollBegin(BeginState(gfx::Point(0, 0)).get(),
|
| - InputHandler::GESTURE);
|
| + InputHandler::TOUCHSCREEN);
|
| host_impl_->PinchGestureBegin();
|
| host_impl_->PinchGestureUpdate(2.f, gfx::Point(0, 0));
|
| host_impl_->PinchGestureUpdate(1.f, gfx::Point(0, 0));
|
| @@ -3099,7 +3100,7 @@ TEST_F(LayerTreeHostImplTest, CompositorFrameMetadata) {
|
|
|
| // Page scale should update metadata correctly (shrinking only the viewport).
|
| host_impl_->ScrollBegin(BeginState(gfx::Point()).get(),
|
| - InputHandler::GESTURE);
|
| + InputHandler::TOUCHSCREEN);
|
| host_impl_->PinchGestureBegin();
|
| host_impl_->PinchGestureUpdate(2.f, gfx::Point());
|
| host_impl_->PinchGestureEnd();
|
| @@ -3821,8 +3822,9 @@ TEST_F(LayerTreeHostImplTopControlsTest,
|
| EXPECT_EQ(gfx::SizeF(50, 50), active_tree->ScrollableSize());
|
|
|
| EXPECT_EQ(InputHandler::SCROLL_ON_IMPL_THREAD,
|
| - host_impl_->ScrollBegin(BeginState(gfx::Point()).get(),
|
| - InputHandler::GESTURE)
|
| + host_impl_
|
| + ->ScrollBegin(BeginState(gfx::Point()).get(),
|
| + InputHandler::TOUCHSCREEN)
|
| .thread);
|
|
|
| host_impl_->top_controls_manager()->ScrollBegin();
|
| @@ -3865,8 +3867,9 @@ TEST_F(LayerTreeHostImplTopControlsTest, ScrollTopControlsByFractionalAmount) {
|
| DrawFrame();
|
|
|
| EXPECT_EQ(InputHandler::SCROLL_ON_IMPL_THREAD,
|
| - host_impl_->ScrollBegin(BeginState(gfx::Point()).get(),
|
| - InputHandler::GESTURE)
|
| + host_impl_
|
| + ->ScrollBegin(BeginState(gfx::Point()).get(),
|
| + InputHandler::TOUCHSCREEN)
|
| .thread);
|
|
|
| // Make the test scroll delta a fractional amount, to verify that the
|
| @@ -3910,8 +3913,9 @@ TEST_F(LayerTreeHostImplTopControlsTest,
|
| host_impl_->active_tree()->PushPageScaleFromMainThread(2.f, 1.f, 2.f);
|
|
|
| EXPECT_EQ(InputHandler::SCROLL_ON_IMPL_THREAD,
|
| - host_impl_->ScrollBegin(BeginState(gfx::Point()).get(),
|
| - InputHandler::GESTURE)
|
| + host_impl_
|
| + ->ScrollBegin(BeginState(gfx::Point()).get(),
|
| + InputHandler::TOUCHSCREEN)
|
| .thread);
|
| host_impl_->ScrollBy(
|
| UpdateState(gfx::Point(), gfx::Vector2dF(0.f, 50.f)).get());
|
| @@ -3933,8 +3937,9 @@ TEST_F(LayerTreeHostImplTopControlsTest,
|
| host_impl_->ScrollEnd(EndState().get());
|
|
|
| EXPECT_EQ(InputHandler::SCROLL_ON_IMPL_THREAD,
|
| - host_impl_->ScrollBegin(BeginState(gfx::Point()).get(),
|
| - InputHandler::GESTURE)
|
| + host_impl_
|
| + ->ScrollBegin(BeginState(gfx::Point()).get(),
|
| + InputHandler::TOUCHSCREEN)
|
| .thread);
|
| EXPECT_EQ(host_impl_->CurrentlyScrollingLayer(), inner_scroll);
|
|
|
| @@ -3987,8 +3992,9 @@ TEST_F(LayerTreeHostImplTopControlsTest, FixedContainerDelta) {
|
| host_impl_->active_tree()->PushPageScaleFromMainThread(page_scale, 1.f, 2.f);
|
|
|
| EXPECT_EQ(InputHandler::SCROLL_ON_IMPL_THREAD,
|
| - host_impl_->ScrollBegin(BeginState(gfx::Point()).get(),
|
| - InputHandler::GESTURE)
|
| + host_impl_
|
| + ->ScrollBegin(BeginState(gfx::Point()).get(),
|
| + InputHandler::TOUCHSCREEN)
|
| .thread);
|
|
|
| // Scroll down, the top controls hiding should expand the viewport size so
|
| @@ -4037,8 +4043,9 @@ TEST_F(LayerTreeHostImplTopControlsTest, TopControlsDontTriggerCommit) {
|
| // Scroll 25px to hide top controls
|
| gfx::Vector2dF scroll_delta(0.f, 25.f);
|
| EXPECT_EQ(InputHandler::SCROLL_ON_IMPL_THREAD,
|
| - host_impl_->ScrollBegin(BeginState(gfx::Point()).get(),
|
| - InputHandler::GESTURE)
|
| + host_impl_
|
| + ->ScrollBegin(BeginState(gfx::Point()).get(),
|
| + InputHandler::TOUCHSCREEN)
|
| .thread);
|
| host_impl_->ScrollBy(UpdateState(gfx::Point(), scroll_delta).get());
|
| EXPECT_FALSE(did_request_commit_);
|
| @@ -4082,8 +4089,9 @@ TEST_F(LayerTreeHostImplTopControlsTest, TopControlsScrollableSublayer) {
|
| host_impl_->active_tree()->property_trees()->needs_rebuild = true;
|
| host_impl_->active_tree()->BuildPropertyTreesForTesting();
|
| EXPECT_EQ(InputHandler::SCROLL_ON_IMPL_THREAD,
|
| - host_impl_->ScrollBegin(BeginState(gfx::Point()).get(),
|
| - InputHandler::GESTURE)
|
| + host_impl_
|
| + ->ScrollBegin(BeginState(gfx::Point()).get(),
|
| + InputHandler::TOUCHSCREEN)
|
| .thread);
|
| host_impl_->ScrollBy(UpdateState(gfx::Point(), scroll_delta).get());
|
| host_impl_->ScrollEnd(EndState().get());
|
| @@ -4243,8 +4251,9 @@ TEST_F(LayerTreeHostImplTopControlsTest, TopControlsViewportOffsetClamping) {
|
| // Hide the top controls by 25px.
|
| gfx::Vector2dF scroll_delta(0.f, 25.f);
|
| EXPECT_EQ(InputHandler::SCROLL_ON_IMPL_THREAD,
|
| - host_impl_->ScrollBegin(BeginState(gfx::Point()).get(),
|
| - InputHandler::GESTURE)
|
| + host_impl_
|
| + ->ScrollBegin(BeginState(gfx::Point()).get(),
|
| + InputHandler::TOUCHSCREEN)
|
| .thread);
|
| host_impl_->ScrollBy(UpdateState(gfx::Point(), scroll_delta).get());
|
|
|
| @@ -4271,8 +4280,9 @@ TEST_F(LayerTreeHostImplTopControlsTest, TopControlsViewportOffsetClamping) {
|
| // Bring the top controls down by 25px.
|
| scroll_delta = gfx::Vector2dF(0.f, -25.f);
|
| EXPECT_EQ(InputHandler::SCROLL_ON_IMPL_THREAD,
|
| - host_impl_->ScrollBegin(BeginState(gfx::Point()).get(),
|
| - InputHandler::GESTURE)
|
| + host_impl_
|
| + ->ScrollBegin(BeginState(gfx::Point()).get(),
|
| + InputHandler::TOUCHSCREEN)
|
| .thread);
|
| host_impl_->ScrollBy(UpdateState(gfx::Point(), scroll_delta).get());
|
| host_impl_->ScrollEnd(EndState().get());
|
| @@ -4301,8 +4311,9 @@ TEST_F(LayerTreeHostImplTopControlsTest, TopControlsAspectRatio) {
|
|
|
| gfx::Vector2dF scroll_delta(0.f, 25.f);
|
| EXPECT_EQ(InputHandler::SCROLL_ON_IMPL_THREAD,
|
| - host_impl_->ScrollBegin(BeginState(gfx::Point()).get(),
|
| - InputHandler::GESTURE)
|
| + host_impl_
|
| + ->ScrollBegin(BeginState(gfx::Point()).get(),
|
| + InputHandler::TOUCHSCREEN)
|
| .thread);
|
| host_impl_->ScrollBy(UpdateState(gfx::Point(), scroll_delta).get());
|
| host_impl_->ScrollEnd(EndState().get());
|
| @@ -4343,8 +4354,9 @@ TEST_F(LayerTreeHostImplTopControlsTest, TopControlsScrollOuterViewport) {
|
| // top controls get scrolled.
|
| gfx::Vector2dF scroll_delta(0.f, 15.f);
|
| EXPECT_EQ(InputHandler::SCROLL_ON_IMPL_THREAD,
|
| - host_impl_->ScrollBegin(BeginState(gfx::Point()).get(),
|
| - InputHandler::GESTURE)
|
| + host_impl_
|
| + ->ScrollBegin(BeginState(gfx::Point()).get(),
|
| + InputHandler::TOUCHSCREEN)
|
| .thread);
|
| host_impl_->ScrollBy(UpdateState(gfx::Point(), scroll_delta).get());
|
|
|
| @@ -4358,8 +4370,9 @@ TEST_F(LayerTreeHostImplTopControlsTest, TopControlsScrollOuterViewport) {
|
|
|
| scroll_delta = gfx::Vector2dF(0.f, 50.f);
|
| EXPECT_EQ(InputHandler::SCROLL_ON_IMPL_THREAD,
|
| - host_impl_->ScrollBegin(BeginState(gfx::Point()).get(),
|
| - InputHandler::GESTURE)
|
| + host_impl_
|
| + ->ScrollBegin(BeginState(gfx::Point()).get(),
|
| + InputHandler::TOUCHSCREEN)
|
| .thread);
|
| host_impl_->ScrollBy(UpdateState(gfx::Point(), scroll_delta).get());
|
|
|
| @@ -4376,8 +4389,9 @@ TEST_F(LayerTreeHostImplTopControlsTest, TopControlsScrollOuterViewport) {
|
|
|
| scroll_delta = gfx::Vector2dF(0.f, -65.f);
|
| EXPECT_EQ(InputHandler::SCROLL_ON_IMPL_THREAD,
|
| - host_impl_->ScrollBegin(BeginState(gfx::Point()).get(),
|
| - InputHandler::GESTURE)
|
| + host_impl_
|
| + ->ScrollBegin(BeginState(gfx::Point()).get(),
|
| + InputHandler::TOUCHSCREEN)
|
| .thread);
|
| host_impl_->ScrollBy(UpdateState(gfx::Point(), scroll_delta).get());
|
|
|
| @@ -4399,8 +4413,9 @@ TEST_F(LayerTreeHostImplTopControlsTest,
|
| DrawFrame();
|
|
|
| EXPECT_EQ(InputHandler::SCROLL_ON_IMPL_THREAD,
|
| - host_impl_->ScrollBegin(BeginState(gfx::Point()).get(),
|
| - InputHandler::GESTURE)
|
| + host_impl_
|
| + ->ScrollBegin(BeginState(gfx::Point()).get(),
|
| + InputHandler::TOUCHSCREEN)
|
| .thread);
|
|
|
| host_impl_->top_controls_manager()->ScrollBegin();
|
| @@ -4415,8 +4430,9 @@ TEST_F(LayerTreeHostImplTopControlsTest,
|
| host_impl_->ScrollEnd(EndState().get());
|
|
|
| EXPECT_EQ(InputHandler::SCROLL_ON_IMPL_THREAD,
|
| - host_impl_->ScrollBegin(BeginState(gfx::Point()).get(),
|
| - InputHandler::GESTURE)
|
| + host_impl_
|
| + ->ScrollBegin(BeginState(gfx::Point()).get(),
|
| + InputHandler::TOUCHSCREEN)
|
| .thread);
|
|
|
| float scroll_increment_y = -25.f;
|
| @@ -4446,8 +4462,9 @@ TEST_F(LayerTreeHostImplTopControlsTest,
|
| host_impl_->active_tree()->InnerViewportScrollLayer()->MaxScrollOffset());
|
|
|
| EXPECT_EQ(InputHandler::SCROLL_ON_IMPL_THREAD,
|
| - host_impl_->ScrollBegin(BeginState(gfx::Point()).get(),
|
| - InputHandler::GESTURE)
|
| + host_impl_
|
| + ->ScrollBegin(BeginState(gfx::Point()).get(),
|
| + InputHandler::TOUCHSCREEN)
|
| .thread);
|
| }
|
|
|
| @@ -4674,7 +4691,7 @@ TEST_F(LayerTreeHostImplTest, ScrollRootAndChangePageScaleOnImplThread) {
|
|
|
| // Set new page scale on impl thread by pinching.
|
| host_impl_->ScrollBegin(BeginState(gfx::Point()).get(),
|
| - InputHandler::GESTURE);
|
| + InputHandler::TOUCHSCREEN);
|
| host_impl_->PinchGestureBegin();
|
| host_impl_->PinchGestureUpdate(page_scale, gfx::Point());
|
| host_impl_->PinchGestureEnd();
|
| @@ -4724,7 +4741,7 @@ TEST_F(LayerTreeHostImplTest, PageScaleDeltaAppliedToRootScrollLayerOnly) {
|
| SetNeedsRebuildPropertyTrees();
|
| RebuildPropertyTrees();
|
| host_impl_->ScrollBegin(BeginState(gfx::Point()).get(),
|
| - InputHandler::GESTURE);
|
| + InputHandler::TOUCHSCREEN);
|
| host_impl_->PinchGestureBegin();
|
| host_impl_->PinchGestureUpdate(new_page_scale, gfx::Point());
|
| host_impl_->PinchGestureEnd();
|
| @@ -5080,8 +5097,9 @@ TEST_F(LayerTreeHostImplTest, ScrollAxisAlignedRotatedLayer) {
|
| // Scroll to the right in screen coordinates with a gesture.
|
| gfx::Vector2d gesture_scroll_delta(10, 0);
|
| EXPECT_EQ(InputHandler::SCROLL_ON_IMPL_THREAD,
|
| - host_impl_->ScrollBegin(BeginState(gfx::Point()).get(),
|
| - InputHandler::GESTURE)
|
| + host_impl_
|
| + ->ScrollBegin(BeginState(gfx::Point()).get(),
|
| + InputHandler::TOUCHSCREEN)
|
| .thread);
|
| host_impl_->ScrollBy(UpdateState(gfx::Point(), gesture_scroll_delta).get());
|
| host_impl_->ScrollEnd(EndState().get());
|
| @@ -5144,8 +5162,9 @@ TEST_F(LayerTreeHostImplTest, ScrollNonAxisAlignedRotatedLayer) {
|
| // Scroll down in screen coordinates with a gesture.
|
| gfx::Vector2d gesture_scroll_delta(0, 10);
|
| EXPECT_EQ(InputHandler::SCROLL_ON_IMPL_THREAD,
|
| - host_impl_->ScrollBegin(BeginState(gfx::Point(1, 1)).get(),
|
| - InputHandler::GESTURE)
|
| + host_impl_
|
| + ->ScrollBegin(BeginState(gfx::Point(1, 1)).get(),
|
| + InputHandler::TOUCHSCREEN)
|
| .thread);
|
| host_impl_->ScrollBy(UpdateState(gfx::Point(), gesture_scroll_delta).get());
|
| host_impl_->ScrollEnd(EndState().get());
|
| @@ -5169,8 +5188,9 @@ TEST_F(LayerTreeHostImplTest, ScrollNonAxisAlignedRotatedLayer) {
|
| child_ptr->SetScrollDelta(gfx::Vector2dF());
|
| gfx::Vector2d gesture_scroll_delta(10, 0);
|
| EXPECT_EQ(InputHandler::SCROLL_ON_IMPL_THREAD,
|
| - host_impl_->ScrollBegin(BeginState(gfx::Point(1, 1)).get(),
|
| - InputHandler::GESTURE)
|
| + host_impl_
|
| + ->ScrollBegin(BeginState(gfx::Point(1, 1)).get(),
|
| + InputHandler::TOUCHSCREEN)
|
| .thread);
|
| host_impl_->ScrollBy(UpdateState(gfx::Point(), gesture_scroll_delta).get());
|
| host_impl_->ScrollEnd(EndState().get());
|
| @@ -5250,8 +5270,9 @@ TEST_F(LayerTreeHostImplTest, ScrollPerspectiveTransformedLayer) {
|
| child_ptr->SetScrollDelta(gfx::Vector2dF());
|
| DrawFrame();
|
| EXPECT_EQ(InputHandler::SCROLL_ON_IMPL_THREAD,
|
| - host_impl_->ScrollBegin(BeginState(viewport_point).get(),
|
| - InputHandler::GESTURE)
|
| + host_impl_
|
| + ->ScrollBegin(BeginState(viewport_point).get(),
|
| + InputHandler::TOUCHSCREEN)
|
| .thread);
|
| host_impl_->ScrollBy(
|
| UpdateState(viewport_point, gesture_scroll_deltas[i]).get());
|
| @@ -5286,8 +5307,9 @@ TEST_F(LayerTreeHostImplTest, ScrollScaledLayer) {
|
| // Scroll down in screen coordinates with a gesture.
|
| gfx::Vector2d scroll_delta(0, 10);
|
| EXPECT_EQ(InputHandler::SCROLL_ON_IMPL_THREAD,
|
| - host_impl_->ScrollBegin(BeginState(gfx::Point()).get(),
|
| - InputHandler::GESTURE)
|
| + host_impl_
|
| + ->ScrollBegin(BeginState(gfx::Point()).get(),
|
| + InputHandler::TOUCHSCREEN)
|
| .thread);
|
| host_impl_->ScrollBy(UpdateState(gfx::Point(), scroll_delta).get());
|
| host_impl_->ScrollEnd(EndState().get());
|
| @@ -5449,7 +5471,7 @@ TEST_F(LayerTreeHostImplTest, RootLayerScrollOffsetDelegation) {
|
| // offset is outside of the scroll range. (this is verified by DCHECKs in the
|
| // delegate).
|
| host_impl_->ScrollBegin(BeginState(gfx::Point()).get(),
|
| - InputHandler::GESTURE);
|
| + InputHandler::TOUCHSCREEN);
|
| host_impl_->PinchGestureBegin();
|
| host_impl_->PinchGestureUpdate(2.f, gfx::Point());
|
| host_impl_->PinchGestureUpdate(.5f, gfx::Point());
|
| @@ -5461,8 +5483,9 @@ TEST_F(LayerTreeHostImplTest, RootLayerScrollOffsetDelegation) {
|
| gfx::ScrollOffset current_offset(7.f, 8.f);
|
|
|
| EXPECT_EQ(InputHandler::SCROLL_ON_IMPL_THREAD,
|
| - host_impl_->ScrollBegin(BeginState(gfx::Point()).get(),
|
| - InputHandler::GESTURE)
|
| + host_impl_
|
| + ->ScrollBegin(BeginState(gfx::Point()).get(),
|
| + InputHandler::TOUCHSCREEN)
|
| .thread);
|
| host_impl_->SetSynchronousInputHandlerRootScrollOffset(current_offset);
|
|
|
| @@ -7582,8 +7605,9 @@ TEST_F(LayerTreeHostImplTest, TouchFlingShouldNotBubble) {
|
| DrawFrame();
|
| {
|
| EXPECT_EQ(InputHandler::SCROLL_ON_IMPL_THREAD,
|
| - host_impl_->ScrollBegin(BeginState(gfx::Point()).get(),
|
| - InputHandler::GESTURE)
|
| + host_impl_
|
| + ->ScrollBegin(BeginState(gfx::Point()).get(),
|
| + InputHandler::TOUCHSCREEN)
|
| .thread);
|
|
|
| EXPECT_EQ(InputHandler::SCROLL_ON_IMPL_THREAD,
|
| @@ -7638,8 +7662,9 @@ TEST_F(LayerTreeHostImplTest, TouchFlingShouldContinueScrollingCurrentLayer) {
|
|
|
| gfx::Vector2d scroll_delta(0, -2);
|
| EXPECT_EQ(InputHandler::SCROLL_ON_IMPL_THREAD,
|
| - host_impl_->ScrollBegin(BeginState(gfx::Point()).get(),
|
| - InputHandler::GESTURE)
|
| + host_impl_
|
| + ->ScrollBegin(BeginState(gfx::Point()).get(),
|
| + InputHandler::TOUCHSCREEN)
|
| .thread);
|
| EXPECT_TRUE(
|
| host_impl_->ScrollBy(UpdateState(gfx::Point(), scroll_delta).get())
|
| @@ -8124,8 +8149,9 @@ TEST_F(LayerTreeHostImplTest, SimpleSwapPromiseMonitor) {
|
|
|
| // Scrolling normally should not trigger any forwarding.
|
| EXPECT_EQ(InputHandler::SCROLL_ON_IMPL_THREAD,
|
| - host_impl_->ScrollBegin(BeginState(gfx::Point()).get(),
|
| - InputHandler::GESTURE)
|
| + host_impl_
|
| + ->ScrollBegin(BeginState(gfx::Point()).get(),
|
| + InputHandler::TOUCHSCREEN)
|
| .thread);
|
| EXPECT_TRUE(
|
| host_impl_->ScrollBy(
|
| @@ -8141,8 +8167,9 @@ TEST_F(LayerTreeHostImplTest, SimpleSwapPromiseMonitor) {
|
| // thread.
|
| host_impl_->active_tree()->set_have_scroll_event_handlers(true);
|
| EXPECT_EQ(InputHandler::SCROLL_ON_IMPL_THREAD,
|
| - host_impl_->ScrollBegin(BeginState(gfx::Point()).get(),
|
| - InputHandler::GESTURE)
|
| + host_impl_
|
| + ->ScrollBegin(BeginState(gfx::Point()).get(),
|
| + InputHandler::TOUCHSCREEN)
|
| .thread);
|
| EXPECT_TRUE(
|
| host_impl_->ScrollBy(
|
| @@ -8225,8 +8252,9 @@ TEST_F(LayerTreeHostImplWithTopControlsTest, ScrollHandledByTopControls) {
|
| DrawFrame();
|
|
|
| EXPECT_EQ(InputHandler::SCROLL_ON_IMPL_THREAD,
|
| - host_impl_->ScrollBegin(BeginState(gfx::Point()).get(),
|
| - InputHandler::GESTURE)
|
| + host_impl_
|
| + ->ScrollBegin(BeginState(gfx::Point()).get(),
|
| + InputHandler::TOUCHSCREEN)
|
| .thread);
|
| EXPECT_EQ(0, host_impl_->top_controls_manager()->ControlsTopOffset());
|
| EXPECT_EQ(gfx::Vector2dF().ToString(),
|
| @@ -8334,8 +8362,9 @@ TEST_F(LayerTreeHostImplWithTopControlsTest, TopControlsAnimationAtOrigin) {
|
| DrawFrame();
|
|
|
| EXPECT_EQ(InputHandler::SCROLL_ON_IMPL_THREAD,
|
| - host_impl_->ScrollBegin(BeginState(gfx::Point()).get(),
|
| - InputHandler::GESTURE)
|
| + host_impl_
|
| + ->ScrollBegin(BeginState(gfx::Point()).get(),
|
| + InputHandler::TOUCHSCREEN)
|
| .thread);
|
| EXPECT_EQ(0, host_impl_->top_controls_manager()->ControlsTopOffset());
|
| EXPECT_EQ(gfx::Vector2dF().ToString(),
|
| @@ -8412,8 +8441,9 @@ TEST_F(LayerTreeHostImplWithTopControlsTest, TopControlsAnimationAfterScroll) {
|
| DrawFrame();
|
|
|
| EXPECT_EQ(InputHandler::SCROLL_ON_IMPL_THREAD,
|
| - host_impl_->ScrollBegin(BeginState(gfx::Point()).get(),
|
| - InputHandler::GESTURE)
|
| + host_impl_
|
| + ->ScrollBegin(BeginState(gfx::Point()).get(),
|
| + InputHandler::TOUCHSCREEN)
|
| .thread);
|
| EXPECT_EQ(0, host_impl_->top_controls_manager()->ControlsTopOffset());
|
| EXPECT_EQ(gfx::Vector2dF(0, initial_scroll_offset).ToString(),
|
| @@ -8483,8 +8513,9 @@ TEST_F(LayerTreeHostImplWithTopControlsTest,
|
| DrawFrame();
|
|
|
| EXPECT_EQ(InputHandler::SCROLL_ON_IMPL_THREAD,
|
| - host_impl_->ScrollBegin(BeginState(gfx::Point()).get(),
|
| - InputHandler::GESTURE)
|
| + host_impl_
|
| + ->ScrollBegin(BeginState(gfx::Point()).get(),
|
| + InputHandler::TOUCHSCREEN)
|
| .thread);
|
| EXPECT_EQ(0, host_impl_->top_controls_manager()->ControlsTopOffset());
|
| EXPECT_EQ(gfx::Vector2dF(0, initial_scroll_offset).ToString(),
|
| @@ -8552,8 +8583,9 @@ TEST_F(LayerTreeHostImplWithTopControlsTest,
|
| DrawFrame();
|
|
|
| EXPECT_EQ(InputHandler::SCROLL_ON_IMPL_THREAD,
|
| - host_impl_->ScrollBegin(BeginState(gfx::Point()).get(),
|
| - InputHandler::GESTURE)
|
| + host_impl_
|
| + ->ScrollBegin(BeginState(gfx::Point()).get(),
|
| + InputHandler::TOUCHSCREEN)
|
| .thread);
|
| EXPECT_EQ(0, host_impl_->top_controls_manager()->ControlsTopOffset());
|
|
|
| @@ -8730,8 +8762,9 @@ TEST_F(LayerTreeHostImplVirtualViewportTest, FlingScrollBubblesToInner) {
|
| // Scrolling the viewport always sets the outer scroll layer as the
|
| // currently scrolling layer.
|
| EXPECT_EQ(InputHandler::SCROLL_ON_IMPL_THREAD,
|
| - host_impl_->ScrollBegin(BeginState(gfx::Point()).get(),
|
| - InputHandler::GESTURE)
|
| + host_impl_
|
| + ->ScrollBegin(BeginState(gfx::Point()).get(),
|
| + InputHandler::TOUCHSCREEN)
|
| .thread);
|
| EXPECT_EQ(inner_scroll, host_impl_->CurrentlyScrollingLayer());
|
| EXPECT_EQ(InputHandler::SCROLL_ON_IMPL_THREAD,
|
| @@ -8752,8 +8785,9 @@ TEST_F(LayerTreeHostImplVirtualViewportTest, FlingScrollBubblesToInner) {
|
|
|
| // Fling past the inner viewport boundry, make sure outer viewport scrolls.
|
| EXPECT_EQ(InputHandler::SCROLL_ON_IMPL_THREAD,
|
| - host_impl_->ScrollBegin(BeginState(gfx::Point()).get(),
|
| - InputHandler::GESTURE)
|
| + host_impl_
|
| + ->ScrollBegin(BeginState(gfx::Point()).get(),
|
| + InputHandler::TOUCHSCREEN)
|
| .thread);
|
| EXPECT_EQ(inner_scroll, host_impl_->CurrentlyScrollingLayer());
|
| EXPECT_EQ(InputHandler::SCROLL_ON_IMPL_THREAD,
|
| @@ -8796,21 +8830,22 @@ TEST_F(LayerTreeHostImplVirtualViewportTest,
|
|
|
| // Make sure the scroll goes to the inner viewport first.
|
| EXPECT_EQ(InputHandler::SCROLL_ON_IMPL_THREAD,
|
| - host_impl_->ScrollBegin(BeginState(gfx::Point()).get(),
|
| - InputHandler::GESTURE)
|
| + host_impl_
|
| + ->ScrollBegin(BeginState(gfx::Point()).get(),
|
| + InputHandler::TOUCHSCREEN)
|
| .thread);
|
| EXPECT_EQ(InputHandler::SCROLL_ON_IMPL_THREAD,
|
| host_impl_->FlingScrollBegin().thread);
|
| - EXPECT_TRUE(host_impl_->IsCurrentlyScrollingLayerAt(gfx::Point(),
|
| - InputHandler::GESTURE));
|
| + EXPECT_TRUE(host_impl_->IsCurrentlyScrollingLayerAt(
|
| + gfx::Point(), InputHandler::TOUCHSCREEN));
|
|
|
| // Scroll near the edge of the outer viewport.
|
| gfx::Vector2d scroll_delta(inner_viewport.width() / 2.f,
|
| inner_viewport.height() / 2.f);
|
| host_impl_->ScrollBy(UpdateState(gfx::Point(), scroll_delta).get());
|
| inner_expected += scroll_delta;
|
| - EXPECT_TRUE(host_impl_->IsCurrentlyScrollingLayerAt(gfx::Point(),
|
| - InputHandler::GESTURE));
|
| + EXPECT_TRUE(host_impl_->IsCurrentlyScrollingLayerAt(
|
| + gfx::Point(), InputHandler::TOUCHSCREEN));
|
|
|
| EXPECT_VECTOR_EQ(inner_expected, inner_scroll->CurrentScrollOffset());
|
| EXPECT_VECTOR_EQ(outer_expected, outer_scroll->CurrentScrollOffset());
|
| @@ -8820,13 +8855,13 @@ TEST_F(LayerTreeHostImplVirtualViewportTest,
|
| // and outer viewport layers is perfect.
|
| host_impl_->ScrollBy(
|
| UpdateState(gfx::Point(), gfx::ScaleVector2d(scroll_delta, 2)).get());
|
| - EXPECT_TRUE(host_impl_->IsCurrentlyScrollingLayerAt(gfx::Point(),
|
| - InputHandler::GESTURE));
|
| + EXPECT_TRUE(host_impl_->IsCurrentlyScrollingLayerAt(
|
| + gfx::Point(), InputHandler::TOUCHSCREEN));
|
| outer_expected += scroll_delta;
|
| inner_expected += scroll_delta;
|
| host_impl_->ScrollEnd(EndState().get());
|
| EXPECT_FALSE(host_impl_->IsCurrentlyScrollingLayerAt(
|
| - gfx::Point(), InputHandler::GESTURE));
|
| + gfx::Point(), InputHandler::TOUCHSCREEN));
|
|
|
| EXPECT_VECTOR_EQ(inner_expected, inner_scroll->CurrentScrollOffset());
|
| EXPECT_VECTOR_EQ(outer_expected, outer_scroll->CurrentScrollOffset());
|
| @@ -8856,14 +8891,15 @@ TEST_F(LayerTreeHostImplVirtualViewportTest,
|
|
|
| gfx::Vector2d scroll_delta(0, inner_viewport.height());
|
| EXPECT_EQ(InputHandler::SCROLL_ON_IMPL_THREAD,
|
| - host_impl_->ScrollBegin(BeginState(gfx::Point()).get(),
|
| - InputHandler::GESTURE)
|
| + host_impl_
|
| + ->ScrollBegin(BeginState(gfx::Point()).get(),
|
| + InputHandler::TOUCHSCREEN)
|
| .thread);
|
| EXPECT_TRUE(
|
| host_impl_->ScrollBy(UpdateState(gfx::Point(), scroll_delta).get())
|
| .did_scroll);
|
| - EXPECT_TRUE(host_impl_->IsCurrentlyScrollingLayerAt(gfx::Point(),
|
| - InputHandler::GESTURE));
|
| + EXPECT_TRUE(host_impl_->IsCurrentlyScrollingLayerAt(
|
| + gfx::Point(), InputHandler::TOUCHSCREEN));
|
|
|
| // The child should have scrolled up to its limit.
|
| scroll_info = host_impl_->ProcessScrollDeltas();
|
| @@ -8879,8 +8915,8 @@ TEST_F(LayerTreeHostImplVirtualViewportTest,
|
| host_impl_->ScrollBy(UpdateState(gfx::Point(), scroll_delta).get())
|
| .did_scroll);
|
| EXPECT_EQ(host_impl_->CurrentlyScrollingLayer(), child_scroll);
|
| - EXPECT_TRUE(host_impl_->IsCurrentlyScrollingLayerAt(gfx::Point(),
|
| - InputHandler::GESTURE));
|
| + EXPECT_TRUE(host_impl_->IsCurrentlyScrollingLayerAt(
|
| + gfx::Point(), InputHandler::TOUCHSCREEN));
|
|
|
| // The inner viewport shouldn't have scrolled.
|
| scroll_info = host_impl_->ProcessScrollDeltas();
|
| @@ -8896,7 +8932,7 @@ TEST_F(LayerTreeHostImplVirtualViewportTest,
|
| EXPECT_EQ(host_impl_->CurrentlyScrollingLayer(), child_scroll);
|
| host_impl_->ScrollEnd(EndState().get());
|
| EXPECT_FALSE(host_impl_->IsCurrentlyScrollingLayerAt(
|
| - gfx::Point(), InputHandler::GESTURE));
|
| + gfx::Point(), InputHandler::TOUCHSCREEN));
|
| }
|
| }
|
|
|
| @@ -8920,14 +8956,16 @@ TEST_F(LayerTreeHostImplVirtualViewportTest,
|
| DrawFrame();
|
|
|
| EXPECT_EQ(InputHandler::SCROLL_ON_IMPL_THREAD,
|
| - host_impl_->RootScrollBegin(BeginState(gfx::Point()).get(),
|
| - InputHandler::GESTURE)
|
| + host_impl_
|
| + ->RootScrollBegin(BeginState(gfx::Point()).get(),
|
| + InputHandler::TOUCHSCREEN)
|
| .thread);
|
| EXPECT_EQ(host_impl_->CurrentlyScrollingLayer(), inner_scroll);
|
| host_impl_->ScrollEnd(EndState().get());
|
| EXPECT_EQ(InputHandler::SCROLL_ON_IMPL_THREAD,
|
| - host_impl_->ScrollBegin(BeginState(gfx::Point()).get(),
|
| - InputHandler::GESTURE)
|
| + host_impl_
|
| + ->ScrollBegin(BeginState(gfx::Point()).get(),
|
| + InputHandler::TOUCHSCREEN)
|
| .thread);
|
| EXPECT_EQ(host_impl_->CurrentlyScrollingLayer(), child_scroll);
|
| host_impl_->ScrollEnd(EndState().get());
|
| @@ -8951,8 +8989,9 @@ TEST_F(LayerTreeHostImplVirtualViewportTest,
|
| // Ensure inner viewport doesn't react to scrolls (test it's unscrollable).
|
| EXPECT_VECTOR_EQ(gfx::Vector2dF(), inner_scroll->CurrentScrollOffset());
|
| EXPECT_EQ(InputHandler::SCROLL_ON_IMPL_THREAD,
|
| - host_impl_->ScrollBegin(BeginState(gfx::Point()).get(),
|
| - InputHandler::GESTURE)
|
| + host_impl_
|
| + ->ScrollBegin(BeginState(gfx::Point()).get(),
|
| + InputHandler::TOUCHSCREEN)
|
| .thread);
|
| scroll_result = host_impl_->ScrollBy(
|
| UpdateState(gfx::Point(), gfx::Vector2dF(0, 100)).get());
|
| @@ -9756,7 +9795,7 @@ TEST_F(LayerTreeHostImplTest, WheelScrollWithPageScaleFactorOnInnerLayer) {
|
|
|
| float page_scale_delta = 2.f;
|
| host_impl_->ScrollBegin(BeginState(gfx::Point()).get(),
|
| - InputHandler::GESTURE);
|
| + InputHandler::TOUCHSCREEN);
|
| host_impl_->PinchGestureBegin();
|
| host_impl_->PinchGestureUpdate(page_scale_delta, gfx::Point());
|
| host_impl_->PinchGestureEnd();
|
| @@ -10172,7 +10211,7 @@ TEST_F(LayerTreeHostImplTest, JitterTest) {
|
| ++i) {
|
| host_impl_->ActivateSyncTree();
|
| host_impl_->ScrollBegin(BeginState(gfx::Point(5, 5)).get(),
|
| - InputHandler::GESTURE);
|
| + InputHandler::TOUCHSCREEN);
|
| host_impl_->ScrollBy(
|
| UpdateState(gfx::Point(), gfx::Vector2dF(0, scroll)).get());
|
| accumulated_scroll += scroll;
|
|
|