summaryrefslogtreecommitdiffstats
path: root/cc/trees/layer_tree_host_impl_unittest.cc
diff options
context:
space:
mode:
Diffstat (limited to 'cc/trees/layer_tree_host_impl_unittest.cc')
-rw-r--r--cc/trees/layer_tree_host_impl_unittest.cc601
1 files changed, 286 insertions, 315 deletions
diff --git a/cc/trees/layer_tree_host_impl_unittest.cc b/cc/trees/layer_tree_host_impl_unittest.cc
index 5f18538..70fa92b 100644
--- a/cc/trees/layer_tree_host_impl_unittest.cc
+++ b/cc/trees/layer_tree_host_impl_unittest.cc
@@ -502,16 +502,16 @@ TEST_F(LayerTreeHostImplTest, ScrollRootCallsCommitAndRedraw) {
host_impl_->SetViewportSize(gfx::Size(50, 50));
DrawFrame();
- EXPECT_EQ(InputHandler::ScrollStarted,
- host_impl_->ScrollBegin(gfx::Point(), InputHandler::Wheel));
+ EXPECT_EQ(InputHandler::SCROLL_STARTED,
+ host_impl_->ScrollBegin(gfx::Point(), InputHandler::WHEEL));
EXPECT_TRUE(host_impl_->IsCurrentlyScrollingLayerAt(gfx::Point(),
- InputHandler::Wheel));
+ InputHandler::WHEEL));
host_impl_->ScrollBy(gfx::Point(), gfx::Vector2d(0, 10));
EXPECT_TRUE(host_impl_->IsCurrentlyScrollingLayerAt(gfx::Point(0, 10),
- InputHandler::Wheel));
+ InputHandler::WHEEL));
host_impl_->ScrollEnd();
EXPECT_FALSE(host_impl_->IsCurrentlyScrollingLayerAt(gfx::Point(),
- InputHandler::Wheel));
+ InputHandler::WHEEL));
EXPECT_TRUE(did_request_redraw_);
EXPECT_TRUE(did_request_commit_);
}
@@ -521,8 +521,8 @@ TEST_F(LayerTreeHostImplTest, ScrollActiveOnlyAfterScrollMovement) {
host_impl_->SetViewportSize(gfx::Size(50, 50));
DrawFrame();
- EXPECT_EQ(InputHandler::ScrollStarted,
- host_impl_->ScrollBegin(gfx::Point(), InputHandler::Wheel));
+ EXPECT_EQ(InputHandler::SCROLL_STARTED,
+ host_impl_->ScrollBegin(gfx::Point(), InputHandler::WHEEL));
EXPECT_FALSE(host_impl_->IsActivelyScrolling());
host_impl_->ScrollBy(gfx::Point(), gfx::Vector2d(0, 10));
EXPECT_TRUE(host_impl_->IsActivelyScrolling());
@@ -532,8 +532,8 @@ TEST_F(LayerTreeHostImplTest, ScrollActiveOnlyAfterScrollMovement) {
TEST_F(LayerTreeHostImplTest, ScrollWithoutRootLayer) {
// We should not crash when trying to scroll an empty layer tree.
- EXPECT_EQ(InputHandler::ScrollIgnored,
- host_impl_->ScrollBegin(gfx::Point(), InputHandler::Wheel));
+ EXPECT_EQ(InputHandler::SCROLL_IGNORED,
+ host_impl_->ScrollBegin(gfx::Point(), InputHandler::WHEEL));
}
TEST_F(LayerTreeHostImplTest, ScrollWithoutRenderer) {
@@ -549,8 +549,8 @@ TEST_F(LayerTreeHostImplTest, ScrollWithoutRenderer) {
// We should not crash when trying to scroll after the renderer initialization
// fails.
- EXPECT_EQ(InputHandler::ScrollStarted,
- host_impl_->ScrollBegin(gfx::Point(), InputHandler::Wheel));
+ EXPECT_EQ(InputHandler::SCROLL_STARTED,
+ host_impl_->ScrollBegin(gfx::Point(), InputHandler::WHEEL));
}
TEST_F(LayerTreeHostImplTest, ReplaceTreeWhileScrolling) {
@@ -559,8 +559,8 @@ TEST_F(LayerTreeHostImplTest, ReplaceTreeWhileScrolling) {
DrawFrame();
// We should not crash if the tree is replaced while we are scrolling.
- EXPECT_EQ(InputHandler::ScrollStarted,
- host_impl_->ScrollBegin(gfx::Point(), InputHandler::Wheel));
+ EXPECT_EQ(InputHandler::SCROLL_STARTED,
+ host_impl_->ScrollBegin(gfx::Point(), InputHandler::WHEEL));
host_impl_->active_tree()->DetachLayerTree();
scroll_layer = SetupScrollAndContentsLayers(gfx::Size(100, 100));
@@ -583,25 +583,26 @@ TEST_F(LayerTreeHostImplTest, ScrollBlocksOnWheelEventHandlers) {
// With registered event handlers, wheel scrolls don't necessarily
// have to go to the main thread.
root->SetHaveWheelEventHandlers(true);
- EXPECT_EQ(InputHandler::ScrollStarted,
- host_impl_->ScrollBegin(gfx::Point(), InputHandler::Wheel));
+ EXPECT_EQ(InputHandler::SCROLL_STARTED,
+ host_impl_->ScrollBegin(gfx::Point(), InputHandler::WHEEL));
host_impl_->ScrollEnd();
// But typically the scroll-blocks-on mode will require them to.
- root->SetScrollBlocksOn(ScrollBlocksOnWheelEvent | ScrollBlocksOnStartTouch);
- EXPECT_EQ(InputHandler::ScrollOnMainThread,
- host_impl_->ScrollBegin(gfx::Point(), InputHandler::Wheel));
+ root->SetScrollBlocksOn(SCROLL_BLOCKS_ON_WHEEL_EVENT |
+ SCROLL_BLOCKS_ON_START_TOUCH);
+ EXPECT_EQ(InputHandler::SCROLL_ON_MAIN_THREAD,
+ host_impl_->ScrollBegin(gfx::Point(), InputHandler::WHEEL));
// But gesture scrolls can still be handled.
- EXPECT_EQ(InputHandler::ScrollStarted,
- host_impl_->ScrollBegin(gfx::Point(), InputHandler::Gesture));
+ EXPECT_EQ(InputHandler::SCROLL_STARTED,
+ host_impl_->ScrollBegin(gfx::Point(), InputHandler::GESTURE));
host_impl_->ScrollEnd();
// And if the handlers go away, wheel scrolls can again be processed
// on impl (despite the scroll-blocks-on mode).
root->SetHaveWheelEventHandlers(false);
- EXPECT_EQ(InputHandler::ScrollStarted,
- host_impl_->ScrollBegin(gfx::Point(), InputHandler::Wheel));
+ EXPECT_EQ(InputHandler::SCROLL_STARTED,
+ host_impl_->ScrollBegin(gfx::Point(), InputHandler::WHEEL));
host_impl_->ScrollEnd();
}
@@ -626,20 +627,21 @@ TEST_F(LayerTreeHostImplTest, ScrollBlocksOnTouchEventHandlers) {
// Touch handler regions determine whether touch events block scroll.
root->SetTouchEventHandlerRegion(gfx::Rect(0, 0, 100, 100));
EXPECT_FALSE(host_impl_->DoTouchEventsBlockScrollAt(gfx::Point(10, 10)));
- root->SetScrollBlocksOn(ScrollBlocksOnStartTouch | ScrollBlocksOnWheelEvent);
+ root->SetScrollBlocksOn(SCROLL_BLOCKS_ON_START_TOUCH |
+ SCROLL_BLOCKS_ON_WHEEL_EVENT);
EXPECT_TRUE(host_impl_->DoTouchEventsBlockScrollAt(gfx::Point(10, 10)));
// But they don't influence the actual handling of the scroll gestures.
- EXPECT_EQ(InputHandler::ScrollStarted,
- host_impl_->ScrollBegin(gfx::Point(), InputHandler::Gesture));
+ EXPECT_EQ(InputHandler::SCROLL_STARTED,
+ host_impl_->ScrollBegin(gfx::Point(), InputHandler::GESTURE));
host_impl_->ScrollEnd();
// It's the union of scroll-blocks-on mode bits across all layers in the
// scroll paret chain that matters.
EXPECT_TRUE(host_impl_->DoTouchEventsBlockScrollAt(gfx::Point(10, 30)));
- root->SetScrollBlocksOn(ScrollBlocksOnNone);
+ root->SetScrollBlocksOn(SCROLL_BLOCKS_ON_NONE);
EXPECT_FALSE(host_impl_->DoTouchEventsBlockScrollAt(gfx::Point(10, 30)));
- child->SetScrollBlocksOn(ScrollBlocksOnStartTouch);
+ child->SetScrollBlocksOn(SCROLL_BLOCKS_ON_START_TOUCH);
EXPECT_TRUE(host_impl_->DoTouchEventsBlockScrollAt(gfx::Point(10, 30)));
}
@@ -652,30 +654,31 @@ TEST_F(LayerTreeHostImplTest, ScrollBlocksOnScrollEventHandlers) {
// With registered scroll handlers, scrolls don't generally have to go
// to the main thread.
root->SetHaveScrollEventHandlers(true);
- EXPECT_EQ(InputHandler::ScrollStarted,
- host_impl_->ScrollBegin(gfx::Point(), InputHandler::Wheel));
+ EXPECT_EQ(InputHandler::SCROLL_STARTED,
+ host_impl_->ScrollBegin(gfx::Point(), InputHandler::WHEEL));
host_impl_->ScrollEnd();
// Even the default scroll blocks on mode doesn't require this.
- root->SetScrollBlocksOn(ScrollBlocksOnWheelEvent | ScrollBlocksOnStartTouch);
- EXPECT_EQ(InputHandler::ScrollStarted,
- host_impl_->ScrollBegin(gfx::Point(), InputHandler::Gesture));
+ root->SetScrollBlocksOn(SCROLL_BLOCKS_ON_WHEEL_EVENT |
+ SCROLL_BLOCKS_ON_START_TOUCH);
+ EXPECT_EQ(InputHandler::SCROLL_STARTED,
+ host_impl_->ScrollBegin(gfx::Point(), InputHandler::GESTURE));
host_impl_->ScrollEnd();
// But the page can opt in to blocking on scroll event handlers.
- root->SetScrollBlocksOn(ScrollBlocksOnScrollEvent);
- EXPECT_EQ(InputHandler::ScrollOnMainThread,
- host_impl_->ScrollBegin(gfx::Point(), InputHandler::Gesture));
+ root->SetScrollBlocksOn(SCROLL_BLOCKS_ON_SCROLL_EVENT);
+ EXPECT_EQ(InputHandler::SCROLL_ON_MAIN_THREAD,
+ host_impl_->ScrollBegin(gfx::Point(), InputHandler::GESTURE));
- // Gesture and Wheel scrolls behave identically in this regard.
- EXPECT_EQ(InputHandler::ScrollOnMainThread,
- host_impl_->ScrollBegin(gfx::Point(), InputHandler::Wheel));
+ // GESTURE and WHEEL scrolls behave identically in this regard.
+ EXPECT_EQ(InputHandler::SCROLL_ON_MAIN_THREAD,
+ host_impl_->ScrollBegin(gfx::Point(), InputHandler::WHEEL));
// And if the handlers go away, scrolls can again be processed on impl
// (despite the scroll-blocks-on mode).
root->SetHaveScrollEventHandlers(false);
- EXPECT_EQ(InputHandler::ScrollStarted,
- host_impl_->ScrollBegin(gfx::Point(), InputHandler::Gesture));
+ EXPECT_EQ(InputHandler::SCROLL_STARTED,
+ host_impl_->ScrollBegin(gfx::Point(), InputHandler::GESTURE));
host_impl_->ScrollEnd();
}
@@ -718,36 +721,36 @@ TEST_F(LayerTreeHostImplTest, ScrollBlocksOnLayerTopology) {
}
// Scroll-blocks-on on a layer affects scrolls that hit that layer.
- EXPECT_EQ(InputHandler::ScrollStarted,
- host_impl_->ScrollBegin(gfx::Point(10, 10), InputHandler::Gesture));
+ EXPECT_EQ(InputHandler::SCROLL_STARTED,
+ host_impl_->ScrollBegin(gfx::Point(10, 10), InputHandler::GESTURE));
host_impl_->ScrollEnd();
- child1->SetScrollBlocksOn(ScrollBlocksOnScrollEvent);
- EXPECT_EQ(InputHandler::ScrollOnMainThread,
- host_impl_->ScrollBegin(gfx::Point(10, 10), InputHandler::Gesture));
+ child1->SetScrollBlocksOn(SCROLL_BLOCKS_ON_SCROLL_EVENT);
+ EXPECT_EQ(InputHandler::SCROLL_ON_MAIN_THREAD,
+ host_impl_->ScrollBegin(gfx::Point(10, 10), InputHandler::GESTURE));
// But not those that hit only other layers.
- EXPECT_EQ(InputHandler::ScrollStarted,
- host_impl_->ScrollBegin(gfx::Point(10, 25), InputHandler::Gesture));
+ EXPECT_EQ(InputHandler::SCROLL_STARTED,
+ host_impl_->ScrollBegin(gfx::Point(10, 25), InputHandler::GESTURE));
host_impl_->ScrollEnd();
// It's the union of bits set across the scroll ancestor chain that matters.
- EXPECT_EQ(InputHandler::ScrollStarted,
- host_impl_->ScrollBegin(gfx::Point(10, 25), InputHandler::Gesture));
+ EXPECT_EQ(InputHandler::SCROLL_STARTED,
+ host_impl_->ScrollBegin(gfx::Point(10, 25), InputHandler::GESTURE));
host_impl_->ScrollEnd();
- EXPECT_EQ(InputHandler::ScrollStarted,
- host_impl_->ScrollBegin(gfx::Point(10, 25), InputHandler::Wheel));
+ EXPECT_EQ(InputHandler::SCROLL_STARTED,
+ host_impl_->ScrollBegin(gfx::Point(10, 25), InputHandler::WHEEL));
host_impl_->ScrollEnd();
- root->SetScrollBlocksOn(ScrollBlocksOnWheelEvent);
- EXPECT_EQ(InputHandler::ScrollStarted,
- host_impl_->ScrollBegin(gfx::Point(10, 25), InputHandler::Gesture));
+ root->SetScrollBlocksOn(SCROLL_BLOCKS_ON_WHEEL_EVENT);
+ EXPECT_EQ(InputHandler::SCROLL_STARTED,
+ host_impl_->ScrollBegin(gfx::Point(10, 25), InputHandler::GESTURE));
host_impl_->ScrollEnd();
- EXPECT_EQ(InputHandler::ScrollOnMainThread,
- host_impl_->ScrollBegin(gfx::Point(10, 25), InputHandler::Wheel));
- child2->SetScrollBlocksOn(ScrollBlocksOnScrollEvent);
- EXPECT_EQ(InputHandler::ScrollOnMainThread,
- host_impl_->ScrollBegin(gfx::Point(10, 25), InputHandler::Wheel));
- EXPECT_EQ(InputHandler::ScrollOnMainThread,
- host_impl_->ScrollBegin(gfx::Point(10, 25), InputHandler::Gesture));
+ EXPECT_EQ(InputHandler::SCROLL_ON_MAIN_THREAD,
+ host_impl_->ScrollBegin(gfx::Point(10, 25), InputHandler::WHEEL));
+ child2->SetScrollBlocksOn(SCROLL_BLOCKS_ON_SCROLL_EVENT);
+ EXPECT_EQ(InputHandler::SCROLL_ON_MAIN_THREAD,
+ host_impl_->ScrollBegin(gfx::Point(10, 25), InputHandler::WHEEL));
+ EXPECT_EQ(InputHandler::SCROLL_ON_MAIN_THREAD,
+ host_impl_->ScrollBegin(gfx::Point(10, 25), InputHandler::GESTURE));
}
TEST_F(LayerTreeHostImplTest, FlingOnlyWhenScrollingTouchscreen) {
@@ -756,16 +759,14 @@ TEST_F(LayerTreeHostImplTest, FlingOnlyWhenScrollingTouchscreen) {
DrawFrame();
// Ignore the fling since no layer is being scrolled
- EXPECT_EQ(InputHandler::ScrollIgnored,
- host_impl_->FlingScrollBegin());
+ EXPECT_EQ(InputHandler::SCROLL_IGNORED, host_impl_->FlingScrollBegin());
// Start scrolling a layer
- EXPECT_EQ(InputHandler::ScrollStarted,
- host_impl_->ScrollBegin(gfx::Point(), InputHandler::Gesture));
+ EXPECT_EQ(InputHandler::SCROLL_STARTED,
+ host_impl_->ScrollBegin(gfx::Point(), InputHandler::GESTURE));
// Now the fling should go ahead since we've started scrolling a layer
- EXPECT_EQ(InputHandler::ScrollStarted,
- host_impl_->FlingScrollBegin());
+ EXPECT_EQ(InputHandler::SCROLL_STARTED, host_impl_->FlingScrollBegin());
}
TEST_F(LayerTreeHostImplTest, FlingOnlyWhenScrollingTouchpad) {
@@ -774,16 +775,14 @@ TEST_F(LayerTreeHostImplTest, FlingOnlyWhenScrollingTouchpad) {
DrawFrame();
// Ignore the fling since no layer is being scrolled
- EXPECT_EQ(InputHandler::ScrollIgnored,
- host_impl_->FlingScrollBegin());
+ EXPECT_EQ(InputHandler::SCROLL_IGNORED, host_impl_->FlingScrollBegin());
// Start scrolling a layer
- EXPECT_EQ(InputHandler::ScrollStarted,
- host_impl_->ScrollBegin(gfx::Point(), InputHandler::Wheel));
+ EXPECT_EQ(InputHandler::SCROLL_STARTED,
+ host_impl_->ScrollBegin(gfx::Point(), InputHandler::WHEEL));
// Now the fling should go ahead since we've started scrolling a layer
- EXPECT_EQ(InputHandler::ScrollStarted,
- host_impl_->FlingScrollBegin());
+ EXPECT_EQ(InputHandler::SCROLL_STARTED, host_impl_->FlingScrollBegin());
}
TEST_F(LayerTreeHostImplTest, NoFlingWhenScrollingOnMain) {
@@ -795,12 +794,11 @@ TEST_F(LayerTreeHostImplTest, NoFlingWhenScrollingOnMain) {
root->SetShouldScrollOnMainThread(true);
// Start scrolling a layer
- EXPECT_EQ(InputHandler::ScrollOnMainThread,
- host_impl_->ScrollBegin(gfx::Point(), InputHandler::Gesture));
+ EXPECT_EQ(InputHandler::SCROLL_ON_MAIN_THREAD,
+ host_impl_->ScrollBegin(gfx::Point(), InputHandler::GESTURE));
// The fling should be ignored since there's no layer being scrolled impl-side
- EXPECT_EQ(InputHandler::ScrollIgnored,
- host_impl_->FlingScrollBegin());
+ EXPECT_EQ(InputHandler::SCROLL_IGNORED, host_impl_->FlingScrollBegin());
}
TEST_F(LayerTreeHostImplTest, ShouldScrollOnMainThread) {
@@ -811,10 +809,10 @@ TEST_F(LayerTreeHostImplTest, ShouldScrollOnMainThread) {
root->SetShouldScrollOnMainThread(true);
- EXPECT_EQ(InputHandler::ScrollOnMainThread,
- host_impl_->ScrollBegin(gfx::Point(), InputHandler::Wheel));
- EXPECT_EQ(InputHandler::ScrollOnMainThread,
- host_impl_->ScrollBegin(gfx::Point(), InputHandler::Gesture));
+ EXPECT_EQ(InputHandler::SCROLL_ON_MAIN_THREAD,
+ host_impl_->ScrollBegin(gfx::Point(), InputHandler::WHEEL));
+ EXPECT_EQ(InputHandler::SCROLL_ON_MAIN_THREAD,
+ host_impl_->ScrollBegin(gfx::Point(), InputHandler::GESTURE));
}
TEST_F(LayerTreeHostImplTest, NonFastScrollableRegionBasic) {
@@ -828,38 +826,34 @@ TEST_F(LayerTreeHostImplTest, NonFastScrollableRegionBasic) {
DrawFrame();
// All scroll types inside the non-fast scrollable region should fail.
- EXPECT_EQ(InputHandler::ScrollOnMainThread,
- host_impl_->ScrollBegin(gfx::Point(25, 25),
- InputHandler::Wheel));
+ EXPECT_EQ(InputHandler::SCROLL_ON_MAIN_THREAD,
+ host_impl_->ScrollBegin(gfx::Point(25, 25), InputHandler::WHEEL));
EXPECT_FALSE(host_impl_->IsCurrentlyScrollingLayerAt(gfx::Point(25, 25),
- InputHandler::Wheel));
- EXPECT_EQ(InputHandler::ScrollOnMainThread,
- host_impl_->ScrollBegin(gfx::Point(25, 25),
- InputHandler::Gesture));
+ InputHandler::WHEEL));
+ EXPECT_EQ(InputHandler::SCROLL_ON_MAIN_THREAD,
+ host_impl_->ScrollBegin(gfx::Point(25, 25), InputHandler::GESTURE));
EXPECT_FALSE(host_impl_->IsCurrentlyScrollingLayerAt(gfx::Point(25, 25),
- InputHandler::Gesture));
+ InputHandler::GESTURE));
// All scroll types outside this region should succeed.
- EXPECT_EQ(InputHandler::ScrollStarted,
- host_impl_->ScrollBegin(gfx::Point(75, 75),
- InputHandler::Wheel));
+ EXPECT_EQ(InputHandler::SCROLL_STARTED,
+ host_impl_->ScrollBegin(gfx::Point(75, 75), InputHandler::WHEEL));
EXPECT_TRUE(host_impl_->IsCurrentlyScrollingLayerAt(gfx::Point(75, 75),
- InputHandler::Gesture));
+ InputHandler::GESTURE));
host_impl_->ScrollBy(gfx::Point(), gfx::Vector2d(0, 10));
EXPECT_FALSE(host_impl_->IsCurrentlyScrollingLayerAt(gfx::Point(25, 25),
- InputHandler::Gesture));
+ InputHandler::GESTURE));
host_impl_->ScrollEnd();
EXPECT_FALSE(host_impl_->IsCurrentlyScrollingLayerAt(gfx::Point(75, 75),
- InputHandler::Gesture));
- EXPECT_EQ(InputHandler::ScrollStarted,
- host_impl_->ScrollBegin(gfx::Point(75, 75),
- InputHandler::Gesture));
+ InputHandler::GESTURE));
+ EXPECT_EQ(InputHandler::SCROLL_STARTED,
+ host_impl_->ScrollBegin(gfx::Point(75, 75), InputHandler::GESTURE));
EXPECT_TRUE(host_impl_->IsCurrentlyScrollingLayerAt(gfx::Point(75, 75),
- InputHandler::Gesture));
+ InputHandler::GESTURE));
host_impl_->ScrollBy(gfx::Point(), gfx::Vector2d(0, 10));
host_impl_->ScrollEnd();
EXPECT_FALSE(host_impl_->IsCurrentlyScrollingLayerAt(gfx::Point(75, 75),
- InputHandler::Gesture));
+ InputHandler::GESTURE));
}
TEST_F(LayerTreeHostImplTest, NonFastScrollableRegionWithOffset) {
@@ -875,18 +869,16 @@ TEST_F(LayerTreeHostImplTest, NonFastScrollableRegionWithOffset) {
// This point would fall into the non-fast scrollable region except that we've
// moved the layer down by 25 pixels.
- EXPECT_EQ(InputHandler::ScrollStarted,
- host_impl_->ScrollBegin(gfx::Point(40, 10),
- InputHandler::Wheel));
+ EXPECT_EQ(InputHandler::SCROLL_STARTED,
+ host_impl_->ScrollBegin(gfx::Point(40, 10), InputHandler::WHEEL));
EXPECT_TRUE(host_impl_->IsCurrentlyScrollingLayerAt(gfx::Point(40, 10),
- InputHandler::Wheel));
+ InputHandler::WHEEL));
host_impl_->ScrollBy(gfx::Point(), gfx::Vector2d(0, 1));
host_impl_->ScrollEnd();
// This point is still inside the non-fast region.
- EXPECT_EQ(InputHandler::ScrollOnMainThread,
- host_impl_->ScrollBegin(gfx::Point(10, 10),
- InputHandler::Wheel));
+ EXPECT_EQ(InputHandler::SCROLL_ON_MAIN_THREAD,
+ host_impl_->ScrollBegin(gfx::Point(10, 10), InputHandler::WHEEL));
}
TEST_F(LayerTreeHostImplTest, ScrollHandlerNotPresent) {
@@ -896,7 +888,7 @@ TEST_F(LayerTreeHostImplTest, ScrollHandlerNotPresent) {
DrawFrame();
EXPECT_FALSE(host_impl_->scroll_affects_scroll_handler());
- host_impl_->ScrollBegin(gfx::Point(), InputHandler::Gesture);
+ host_impl_->ScrollBegin(gfx::Point(), InputHandler::GESTURE);
EXPECT_FALSE(host_impl_->scroll_affects_scroll_handler());
host_impl_->ScrollEnd();
EXPECT_FALSE(host_impl_->scroll_affects_scroll_handler());
@@ -909,7 +901,7 @@ TEST_F(LayerTreeHostImplTest, ScrollHandlerPresent) {
DrawFrame();
EXPECT_FALSE(host_impl_->scroll_affects_scroll_handler());
- host_impl_->ScrollBegin(gfx::Point(), InputHandler::Gesture);
+ host_impl_->ScrollBegin(gfx::Point(), InputHandler::GESTURE);
EXPECT_TRUE(host_impl_->scroll_affects_scroll_handler());
host_impl_->ScrollEnd();
EXPECT_FALSE(host_impl_->scroll_affects_scroll_handler());
@@ -921,8 +913,8 @@ TEST_F(LayerTreeHostImplTest, ScrollByReturnsCorrectValue) {
DrawFrame();
- EXPECT_EQ(InputHandler::ScrollStarted,
- host_impl_->ScrollBegin(gfx::Point(), InputHandler::Gesture));
+ EXPECT_EQ(InputHandler::SCROLL_STARTED,
+ host_impl_->ScrollBegin(gfx::Point(), InputHandler::GESTURE));
// Trying to scroll to the left/top will not succeed.
EXPECT_FALSE(
@@ -967,9 +959,8 @@ TEST_F(LayerTreeHostImplTest, ScrollVerticallyByPageReturnsCorrectValue) {
DrawFrame();
- EXPECT_EQ(InputHandler::ScrollStarted,
- host_impl_->ScrollBegin(gfx::Point(),
- InputHandler::Wheel));
+ EXPECT_EQ(InputHandler::SCROLL_STARTED,
+ host_impl_->ScrollBegin(gfx::Point(), InputHandler::WHEEL));
// Trying to scroll without a vertical scrollbar will fail.
EXPECT_FALSE(host_impl_->ScrollVerticallyByPage(
@@ -1011,8 +1002,8 @@ TEST_F(LayerTreeHostImplTest, ScrollWithUserUnscrollableLayers) {
DrawFrame();
gfx::Point scroll_position(10, 10);
- EXPECT_EQ(InputHandler::ScrollStarted,
- host_impl_->ScrollBegin(scroll_position, InputHandler::Wheel));
+ EXPECT_EQ(InputHandler::SCROLL_STARTED,
+ host_impl_->ScrollBegin(scroll_position, InputHandler::WHEEL));
EXPECT_VECTOR_EQ(gfx::Vector2dF(), scroll_layer->CurrentScrollOffset());
EXPECT_VECTOR_EQ(gfx::Vector2dF(), overflow->CurrentScrollOffset());
@@ -1024,8 +1015,8 @@ TEST_F(LayerTreeHostImplTest, ScrollWithUserUnscrollableLayers) {
overflow->set_user_scrollable_horizontal(false);
- EXPECT_EQ(InputHandler::ScrollStarted,
- host_impl_->ScrollBegin(scroll_position, InputHandler::Wheel));
+ EXPECT_EQ(InputHandler::SCROLL_STARTED,
+ host_impl_->ScrollBegin(scroll_position, InputHandler::WHEEL));
EXPECT_VECTOR_EQ(gfx::Vector2dF(), scroll_layer->CurrentScrollOffset());
EXPECT_VECTOR_EQ(gfx::Vector2dF(10, 10), overflow->CurrentScrollOffset());
@@ -1036,8 +1027,8 @@ TEST_F(LayerTreeHostImplTest, ScrollWithUserUnscrollableLayers) {
overflow->set_user_scrollable_vertical(false);
- EXPECT_EQ(InputHandler::ScrollStarted,
- host_impl_->ScrollBegin(scroll_position, InputHandler::Wheel));
+ EXPECT_EQ(InputHandler::SCROLL_STARTED,
+ host_impl_->ScrollBegin(scroll_position, InputHandler::WHEEL));
EXPECT_VECTOR_EQ(gfx::Vector2dF(10, 0), scroll_layer->CurrentScrollOffset());
EXPECT_VECTOR_EQ(gfx::Vector2dF(10, 20), overflow->CurrentScrollOffset());
@@ -1068,7 +1059,7 @@ TEST_F(LayerTreeHostImplTest, ImplPinchZoom) {
float page_scale_delta = 2.f;
- host_impl_->ScrollBegin(gfx::Point(50, 50), InputHandler::Gesture);
+ host_impl_->ScrollBegin(gfx::Point(50, 50), InputHandler::GESTURE);
host_impl_->PinchGestureBegin();
host_impl_->PinchGestureUpdate(page_scale_delta, gfx::Point(50, 50));
host_impl_->PinchGestureEnd();
@@ -1095,16 +1086,15 @@ TEST_F(LayerTreeHostImplTest, ImplPinchZoom) {
scroll_layer->SetScrollDelta(gfx::Vector2d());
float page_scale_delta = 2.f;
- host_impl_->ScrollBegin(gfx::Point(), InputHandler::Gesture);
+ host_impl_->ScrollBegin(gfx::Point(), InputHandler::GESTURE);
host_impl_->PinchGestureBegin();
host_impl_->PinchGestureUpdate(page_scale_delta, gfx::Point());
host_impl_->PinchGestureEnd();
host_impl_->ScrollEnd();
gfx::Vector2d scroll_delta(0, 10);
- EXPECT_EQ(InputHandler::ScrollStarted,
- host_impl_->ScrollBegin(gfx::Point(5, 5),
- InputHandler::Wheel));
+ EXPECT_EQ(InputHandler::SCROLL_STARTED,
+ host_impl_->ScrollBegin(gfx::Point(5, 5), InputHandler::WHEEL));
host_impl_->ScrollBy(gfx::Point(), scroll_delta);
host_impl_->ScrollEnd();
@@ -1122,8 +1112,8 @@ TEST_F(LayerTreeHostImplTest, ScrollWithSwapPromises) {
new LatencyInfoSwapPromise(latency_info));
SetupScrollAndContentsLayers(gfx::Size(100, 100));
- EXPECT_EQ(InputHandler::ScrollStarted,
- host_impl_->ScrollBegin(gfx::Point(), InputHandler::Gesture));
+ EXPECT_EQ(InputHandler::SCROLL_STARTED,
+ host_impl_->ScrollBegin(gfx::Point(), InputHandler::GESTURE));
host_impl_->ScrollBy(gfx::Point(), gfx::Vector2d(0, 10));
host_impl_->QueueSwapPromiseForMainThreadScrollUpdate(swap_promise.Pass());
host_impl_->ScrollEnd();
@@ -1151,7 +1141,7 @@ TEST_F(LayerTreeHostImplTest, PinchGesture) {
scroll_layer->SetScrollDelta(gfx::Vector2d());
float page_scale_delta = 2.f;
- host_impl_->ScrollBegin(gfx::Point(50, 50), InputHandler::Gesture);
+ host_impl_->ScrollBegin(gfx::Point(50, 50), InputHandler::GESTURE);
host_impl_->PinchGestureBegin();
host_impl_->PinchGestureUpdate(page_scale_delta, gfx::Point(50, 50));
host_impl_->PinchGestureEnd();
@@ -1172,7 +1162,7 @@ TEST_F(LayerTreeHostImplTest, PinchGesture) {
scroll_layer->SetScrollDelta(gfx::Vector2d());
float page_scale_delta = 10.f;
- host_impl_->ScrollBegin(gfx::Point(50, 50), InputHandler::Gesture);
+ host_impl_->ScrollBegin(gfx::Point(50, 50), InputHandler::GESTURE);
host_impl_->PinchGestureBegin();
host_impl_->PinchGestureUpdate(page_scale_delta, gfx::Point(50, 50));
host_impl_->PinchGestureEnd();
@@ -1192,7 +1182,7 @@ TEST_F(LayerTreeHostImplTest, PinchGesture) {
scroll_layer->PushScrollOffsetFromMainThread(gfx::ScrollOffset(50, 50));
float page_scale_delta = 0.1f;
- host_impl_->ScrollBegin(gfx::Point(), InputHandler::Gesture);
+ host_impl_->ScrollBegin(gfx::Point(), InputHandler::GESTURE);
host_impl_->PinchGestureBegin();
host_impl_->PinchGestureUpdate(page_scale_delta, gfx::Point());
host_impl_->PinchGestureEnd();
@@ -1214,7 +1204,7 @@ TEST_F(LayerTreeHostImplTest, PinchGesture) {
scroll_layer->PushScrollOffsetFromMainThread(gfx::ScrollOffset(20, 20));
float page_scale_delta = 1.f;
- host_impl_->ScrollBegin(gfx::Point(10, 10), InputHandler::Gesture);
+ host_impl_->ScrollBegin(gfx::Point(10, 10), InputHandler::GESTURE);
host_impl_->PinchGestureBegin();
host_impl_->PinchGestureUpdate(page_scale_delta, gfx::Point(10, 10));
host_impl_->PinchGestureUpdate(page_scale_delta, gfx::Point(20, 20));
@@ -1236,7 +1226,7 @@ TEST_F(LayerTreeHostImplTest, PinchGesture) {
scroll_layer->PushScrollOffsetFromMainThread(gfx::ScrollOffset(20, 20));
float page_scale_delta = 1.f;
- host_impl_->ScrollBegin(gfx::Point(10, 10), InputHandler::Gesture);
+ host_impl_->ScrollBegin(gfx::Point(10, 10), InputHandler::GESTURE);
host_impl_->PinchGestureBegin();
host_impl_->PinchGestureUpdate(page_scale_delta, gfx::Point(10, 10));
host_impl_->ScrollBy(gfx::Point(10, 10), gfx::Vector2d(-10, -10));
@@ -1257,7 +1247,7 @@ TEST_F(LayerTreeHostImplTest, PinchGesture) {
scroll_layer->PullDeltaForMainThread();
scroll_layer->PushScrollOffsetFromMainThread(gfx::ScrollOffset(0, 0));
- host_impl_->ScrollBegin(gfx::Point(0, 0), InputHandler::Gesture);
+ host_impl_->ScrollBegin(gfx::Point(0, 0), InputHandler::GESTURE);
host_impl_->PinchGestureBegin();
host_impl_->PinchGestureUpdate(2.f, gfx::Point(0, 0));
host_impl_->PinchGestureUpdate(1.f, gfx::Point(0, 0));
@@ -1623,7 +1613,7 @@ class LayerTreeHostImplOverridePhysicalTime : public LayerTreeHostImpl {
TEST_F(LayerTreeHostImplTest, ScrollbarLinearFadeScheduling) {
LayerTreeSettings settings;
- settings.scrollbar_animator = LayerTreeSettings::LinearFade;
+ settings.scrollbar_animator = LayerTreeSettings::LINEAR_FADE;
settings.scrollbar_fade_delay_ms = 20;
settings.scrollbar_fade_duration_ms = 20;
@@ -1635,14 +1625,14 @@ TEST_F(LayerTreeHostImplTest, ScrollbarLinearFadeScheduling) {
EXPECT_FALSE(did_request_redraw_);
// If no scroll happened during a scroll gesture, it should have no effect.
- host_impl_->ScrollBegin(gfx::Point(), InputHandler::Wheel);
+ host_impl_->ScrollBegin(gfx::Point(), InputHandler::WHEEL);
host_impl_->ScrollEnd();
EXPECT_EQ(base::TimeDelta(), requested_scrollbar_animation_delay_);
EXPECT_FALSE(did_request_redraw_);
EXPECT_TRUE(scrollbar_fade_start_.Equals(base::Closure()));
// After a scroll, a fade animation should be scheduled about 20ms from now.
- host_impl_->ScrollBegin(gfx::Point(), InputHandler::Wheel);
+ host_impl_->ScrollBegin(gfx::Point(), InputHandler::WHEEL);
host_impl_->ScrollBy(gfx::Point(), gfx::Vector2dF(0, 5));
host_impl_->ScrollEnd();
did_request_redraw_ = false;
@@ -1673,7 +1663,7 @@ TEST_F(LayerTreeHostImplTest, ScrollbarLinearFadeScheduling) {
requested_scrollbar_animation_delay_ = base::TimeDelta();
// Unnecessarily Fade animation of solid color scrollbar is not triggered.
- host_impl_->ScrollBegin(gfx::Point(), InputHandler::Wheel);
+ host_impl_->ScrollBegin(gfx::Point(), InputHandler::WHEEL);
host_impl_->ScrollBy(gfx::Point(), gfx::Vector2dF(5, 0));
host_impl_->ScrollEnd();
EXPECT_EQ(base::TimeDelta(), requested_scrollbar_animation_delay_);
@@ -1681,7 +1671,7 @@ TEST_F(LayerTreeHostImplTest, ScrollbarLinearFadeScheduling) {
TEST_F(LayerTreeHostImplTest, ScrollbarFadePinchZoomScrollbars) {
LayerTreeSettings settings;
- settings.scrollbar_animator = LayerTreeSettings::LinearFade;
+ settings.scrollbar_animator = LayerTreeSettings::LINEAR_FADE;
settings.scrollbar_fade_delay_ms = 20;
settings.scrollbar_fade_duration_ms = 20;
settings.use_pinch_zoom_scrollbars = true;
@@ -1696,14 +1686,14 @@ TEST_F(LayerTreeHostImplTest, ScrollbarFadePinchZoomScrollbars) {
EXPECT_FALSE(did_request_animate_);
// If no scroll happened during a scroll gesture, it should have no effect.
- host_impl_->ScrollBegin(gfx::Point(), InputHandler::Wheel);
+ host_impl_->ScrollBegin(gfx::Point(), InputHandler::WHEEL);
host_impl_->ScrollEnd();
EXPECT_EQ(base::TimeDelta(), requested_scrollbar_animation_delay_);
EXPECT_FALSE(did_request_animate_);
EXPECT_TRUE(scrollbar_fade_start_.Equals(base::Closure()));
// After a scroll, no fade animation should be scheduled.
- host_impl_->ScrollBegin(gfx::Point(), InputHandler::Wheel);
+ host_impl_->ScrollBegin(gfx::Point(), InputHandler::WHEEL);
host_impl_->ScrollBy(gfx::Point(), gfx::Vector2dF(5, 0));
host_impl_->ScrollEnd();
did_request_redraw_ = false;
@@ -1720,7 +1710,7 @@ TEST_F(LayerTreeHostImplTest, ScrollbarFadePinchZoomScrollbars) {
host_impl_->SetPageScaleOnActiveTree(1.1f);
// After a scroll, a fade animation should be scheduled about 20ms from now.
- host_impl_->ScrollBegin(gfx::Point(), InputHandler::Wheel);
+ host_impl_->ScrollBegin(gfx::Point(), InputHandler::WHEEL);
host_impl_->ScrollBy(gfx::Point(), gfx::Vector2dF(5, 0));
host_impl_->ScrollEnd();
did_request_redraw_ = false;
@@ -1742,7 +1732,7 @@ void LayerTreeHostImplTest::SetupMouseMoveAtWithDeviceScale(
LayerTreeSettings settings;
settings.scrollbar_fade_delay_ms = 500;
settings.scrollbar_fade_duration_ms = 300;
- settings.scrollbar_animator = LayerTreeSettings::Thinning;
+ settings.scrollbar_animator = LayerTreeSettings::THINNING;
gfx::Size viewport_size(300, 200);
gfx::Size device_viewport_size = gfx::ToFlooredSize(
@@ -1849,8 +1839,8 @@ TEST_F(LayerTreeHostImplTest, CompositorFrameMetadata) {
}
// Scrolling should update metadata immediately.
- EXPECT_EQ(InputHandler::ScrollStarted,
- host_impl_->ScrollBegin(gfx::Point(), InputHandler::Wheel));
+ EXPECT_EQ(InputHandler::SCROLL_STARTED,
+ host_impl_->ScrollBegin(gfx::Point(), InputHandler::WHEEL));
host_impl_->ScrollBy(gfx::Point(), gfx::Vector2d(0, 10));
{
CompositorFrameMetadata metadata =
@@ -1883,7 +1873,7 @@ TEST_F(LayerTreeHostImplTest, CompositorFrameMetadata) {
}
// Page scale should update metadata correctly (shrinking only the viewport).
- host_impl_->ScrollBegin(gfx::Point(), InputHandler::Gesture);
+ host_impl_->ScrollBegin(gfx::Point(), InputHandler::GESTURE);
host_impl_->PinchGestureBegin();
host_impl_->PinchGestureUpdate(2.f, gfx::Point());
host_impl_->PinchGestureEnd();
@@ -2449,8 +2439,8 @@ TEST_F(LayerTreeHostImplTest, ScrollRootIgnored) {
DrawFrame();
// Scroll event is ignored because layer is not scrollable.
- EXPECT_EQ(InputHandler::ScrollIgnored,
- host_impl_->ScrollBegin(gfx::Point(), InputHandler::Wheel));
+ EXPECT_EQ(InputHandler::SCROLL_IGNORED,
+ host_impl_->ScrollBegin(gfx::Point(), InputHandler::WHEEL));
EXPECT_FALSE(did_request_redraw_);
EXPECT_FALSE(did_request_commit_);
}
@@ -2607,8 +2597,8 @@ TEST_F(LayerTreeHostImplTopControlsTest, ScrollTopControlsByFractionalAmount) {
gfx::Size(10, 10), gfx::Size(10, 10), gfx::Size(10, 10));
DrawFrame();
- EXPECT_EQ(InputHandler::ScrollStarted,
- host_impl_->ScrollBegin(gfx::Point(), InputHandler::Gesture));
+ EXPECT_EQ(InputHandler::SCROLL_STARTED,
+ host_impl_->ScrollBegin(gfx::Point(), InputHandler::GESTURE));
// Make the test scroll delta a fractional amount, to verify that the
// fixed container size delta is (1) non-zero, and (2) fractional, and
@@ -2648,8 +2638,8 @@ TEST_F(LayerTreeHostImplTopControlsTest,
outer_scroll->SetDrawsContent(true);
host_impl_->active_tree()->PushPageScaleFromMainThread(2.f, 1.f, 2.f);
- EXPECT_EQ(InputHandler::ScrollStarted,
- host_impl_->ScrollBegin(gfx::Point(), InputHandler::Gesture));
+ EXPECT_EQ(InputHandler::SCROLL_STARTED,
+ host_impl_->ScrollBegin(gfx::Point(), InputHandler::GESTURE));
host_impl_->ScrollBy(gfx::Point(), gfx::Vector2dF(0.f, 50.f));
// The entire scroll delta should have been used to hide the top controls.
@@ -2667,8 +2657,8 @@ TEST_F(LayerTreeHostImplTopControlsTest,
host_impl_->ScrollEnd();
- EXPECT_EQ(InputHandler::ScrollStarted,
- host_impl_->ScrollBegin(gfx::Point(), InputHandler::Gesture));
+ EXPECT_EQ(InputHandler::SCROLL_STARTED,
+ host_impl_->ScrollBegin(gfx::Point(), InputHandler::GESTURE));
EXPECT_EQ(host_impl_->CurrentlyScrollingLayer(), inner_scroll);
host_impl_->ScrollBy(gfx::Point(), gfx::Vector2dF(0.f, -50.f));
@@ -2714,8 +2704,8 @@ TEST_F(LayerTreeHostImplTopControlsTest, FixedContainerDelta) {
// not be scaled.
host_impl_->active_tree()->PushPageScaleFromMainThread(page_scale, 1.f, 2.f);
- EXPECT_EQ(InputHandler::ScrollStarted,
- host_impl_->ScrollBegin(gfx::Point(), InputHandler::Gesture));
+ EXPECT_EQ(InputHandler::SCROLL_STARTED,
+ host_impl_->ScrollBegin(gfx::Point(), InputHandler::GESTURE));
// Scroll down, the top controls hiding should expand the viewport size so
// the delta should be equal to the scroll distance.
@@ -2786,8 +2776,8 @@ TEST_F(LayerTreeHostImplTopControlsTest, TopControlsScrollableSublayer) {
// Scroll 25px to hide top controls
gfx::Vector2dF scroll_delta(0.f, 25.f);
- EXPECT_EQ(InputHandler::ScrollStarted,
- host_impl_->ScrollBegin(gfx::Point(), InputHandler::Gesture));
+ EXPECT_EQ(InputHandler::SCROLL_STARTED,
+ host_impl_->ScrollBegin(gfx::Point(), InputHandler::GESTURE));
host_impl_->ScrollBy(gfx::Point(), scroll_delta);
host_impl_->ScrollEnd();
@@ -2935,8 +2925,8 @@ TEST_F(LayerTreeHostImplTopControlsTest, TopControlsViewportOffsetClamping) {
// Hide the top controls by 25px.
gfx::Vector2dF scroll_delta(0.f, 25.f);
- EXPECT_EQ(InputHandler::ScrollStarted,
- host_impl_->ScrollBegin(gfx::Point(), InputHandler::Gesture));
+ EXPECT_EQ(InputHandler::SCROLL_STARTED,
+ host_impl_->ScrollBegin(gfx::Point(), InputHandler::GESTURE));
host_impl_->ScrollBy(gfx::Point(), scroll_delta);
// scrolling down at the max extents no longer hides the top controls
@@ -2961,8 +2951,8 @@ TEST_F(LayerTreeHostImplTopControlsTest, TopControlsViewportOffsetClamping) {
// Bring the top controls down by 25px.
scroll_delta = gfx::Vector2dF(0.f, -25.f);
- EXPECT_EQ(InputHandler::ScrollStarted,
- host_impl_->ScrollBegin(gfx::Point(), InputHandler::Gesture));
+ EXPECT_EQ(InputHandler::SCROLL_STARTED,
+ host_impl_->ScrollBegin(gfx::Point(), InputHandler::GESTURE));
host_impl_->ScrollBy(gfx::Point(), scroll_delta);
host_impl_->ScrollEnd();
@@ -2988,8 +2978,8 @@ TEST_F(LayerTreeHostImplTopControlsTest, TopControlsAspectRatio) {
host_impl_->top_controls_manager()->ContentTopOffset());
gfx::Vector2dF scroll_delta(0.f, 25.f);
- EXPECT_EQ(InputHandler::ScrollStarted,
- host_impl_->ScrollBegin(gfx::Point(), InputHandler::Gesture));
+ EXPECT_EQ(InputHandler::SCROLL_STARTED,
+ host_impl_->ScrollBegin(gfx::Point(), InputHandler::GESTURE));
host_impl_->ScrollBy(gfx::Point(), scroll_delta);
host_impl_->ScrollEnd();
@@ -3026,8 +3016,8 @@ TEST_F(LayerTreeHostImplTopControlsTest, TopControlsScrollOuterViewport) {
// Send a gesture scroll that will scroll the outer viewport, make sure the
// top controls get scrolled.
gfx::Vector2dF scroll_delta(0.f, 15.f);
- EXPECT_EQ(InputHandler::ScrollStarted,
- host_impl_->ScrollBegin(gfx::Point(), InputHandler::Gesture));
+ EXPECT_EQ(InputHandler::SCROLL_STARTED,
+ host_impl_->ScrollBegin(gfx::Point(), InputHandler::GESTURE));
host_impl_->ScrollBy(gfx::Point(), scroll_delta);
EXPECT_EQ(host_impl_->OuterViewportScrollLayer(),
host_impl_->CurrentlyScrollingLayer());
@@ -3038,8 +3028,8 @@ TEST_F(LayerTreeHostImplTopControlsTest, TopControlsScrollOuterViewport) {
host_impl_->top_controls_manager()->ContentTopOffset());
scroll_delta = gfx::Vector2dF(0.f, 50.f);
- EXPECT_EQ(InputHandler::ScrollStarted,
- host_impl_->ScrollBegin(gfx::Point(), InputHandler::Gesture));
+ EXPECT_EQ(InputHandler::SCROLL_STARTED,
+ host_impl_->ScrollBegin(gfx::Point(), InputHandler::GESTURE));
host_impl_->ScrollBy(gfx::Point(), scroll_delta);
EXPECT_EQ(0, host_impl_->top_controls_manager()->ContentTopOffset());
@@ -3054,8 +3044,8 @@ TEST_F(LayerTreeHostImplTopControlsTest, TopControlsScrollOuterViewport) {
host_impl_->InnerViewportScrollLayer()->SetScrollDelta(inner_viewport_offset);
scroll_delta = gfx::Vector2dF(0.f, -65.f);
- EXPECT_EQ(InputHandler::ScrollStarted,
- host_impl_->ScrollBegin(gfx::Point(), InputHandler::Gesture));
+ EXPECT_EQ(InputHandler::SCROLL_STARTED,
+ host_impl_->ScrollBegin(gfx::Point(), InputHandler::GESTURE));
host_impl_->ScrollBy(gfx::Point(), scroll_delta);
EXPECT_EQ(top_controls_height_,
@@ -3073,8 +3063,8 @@ TEST_F(LayerTreeHostImplTopControlsTest,
SetupTopControlsAndScrollLayer();
DrawFrame();
- EXPECT_EQ(InputHandler::ScrollStarted,
- host_impl_->ScrollBegin(gfx::Point(), InputHandler::Gesture));
+ EXPECT_EQ(InputHandler::SCROLL_STARTED,
+ host_impl_->ScrollBegin(gfx::Point(), InputHandler::GESTURE));
host_impl_->top_controls_manager()->ScrollBegin();
host_impl_->top_controls_manager()->ScrollBy(gfx::Vector2dF(0.f, 50.f));
@@ -3086,8 +3076,8 @@ TEST_F(LayerTreeHostImplTopControlsTest,
host_impl_->ScrollEnd();
- EXPECT_EQ(InputHandler::ScrollStarted,
- host_impl_->ScrollBegin(gfx::Point(), InputHandler::Gesture));
+ EXPECT_EQ(InputHandler::SCROLL_STARTED,
+ host_impl_->ScrollBegin(gfx::Point(), InputHandler::GESTURE));
float scroll_increment_y = -25.f;
host_impl_->top_controls_manager()->ScrollBegin();
@@ -3115,8 +3105,8 @@ TEST_F(LayerTreeHostImplTopControlsTest,
gfx::ScrollOffset(),
host_impl_->active_tree()->InnerViewportScrollLayer()->MaxScrollOffset());
- EXPECT_EQ(InputHandler::ScrollStarted,
- host_impl_->ScrollBegin(gfx::Point(), InputHandler::Gesture));
+ EXPECT_EQ(InputHandler::SCROLL_STARTED,
+ host_impl_->ScrollBegin(gfx::Point(), InputHandler::GESTURE));
}
TEST_F(LayerTreeHostImplTest, ScrollNonCompositedRoot) {
@@ -3151,9 +3141,8 @@ TEST_F(LayerTreeHostImplTest, ScrollNonCompositedRoot) {
host_impl_->SetViewportSize(surface_size);
DrawFrame();
- EXPECT_EQ(InputHandler::ScrollStarted,
- host_impl_->ScrollBegin(gfx::Point(5, 5),
- InputHandler::Wheel));
+ EXPECT_EQ(InputHandler::SCROLL_STARTED,
+ host_impl_->ScrollBegin(gfx::Point(5, 5), InputHandler::WHEEL));
host_impl_->ScrollBy(gfx::Point(), gfx::Vector2d(0, 10));
host_impl_->ScrollEnd();
EXPECT_TRUE(did_request_redraw_);
@@ -3172,9 +3161,8 @@ TEST_F(LayerTreeHostImplTest, ScrollChildCallsCommitAndRedraw) {
host_impl_->SetViewportSize(surface_size);
DrawFrame();
- EXPECT_EQ(InputHandler::ScrollStarted,
- host_impl_->ScrollBegin(gfx::Point(5, 5),
- InputHandler::Wheel));
+ EXPECT_EQ(InputHandler::SCROLL_STARTED,
+ host_impl_->ScrollBegin(gfx::Point(5, 5), InputHandler::WHEEL));
host_impl_->ScrollBy(gfx::Point(), gfx::Vector2d(0, 10));
host_impl_->ScrollEnd();
EXPECT_TRUE(did_request_redraw_);
@@ -3192,9 +3180,8 @@ TEST_F(LayerTreeHostImplTest, ScrollMissesChild) {
// Scroll event is ignored because the input coordinate is outside the layer
// boundaries.
- EXPECT_EQ(InputHandler::ScrollIgnored,
- host_impl_->ScrollBegin(gfx::Point(15, 5),
- InputHandler::Wheel));
+ EXPECT_EQ(InputHandler::SCROLL_IGNORED,
+ host_impl_->ScrollBegin(gfx::Point(15, 5), InputHandler::WHEEL));
EXPECT_FALSE(did_request_redraw_);
EXPECT_FALSE(did_request_commit_);
}
@@ -3218,9 +3205,8 @@ TEST_F(LayerTreeHostImplTest, ScrollMissesBackfacingChild) {
// Scroll event is ignored because the scrollable layer is not facing the
// viewer and there is nothing scrollable behind it.
- EXPECT_EQ(InputHandler::ScrollIgnored,
- host_impl_->ScrollBegin(gfx::Point(5, 5),
- InputHandler::Wheel));
+ EXPECT_EQ(InputHandler::SCROLL_IGNORED,
+ host_impl_->ScrollBegin(gfx::Point(5, 5), InputHandler::WHEEL));
EXPECT_FALSE(did_request_redraw_);
EXPECT_FALSE(did_request_commit_);
}
@@ -3248,9 +3234,8 @@ TEST_F(LayerTreeHostImplTest, ScrollBlockedByContentLayer) {
// Scrolling fails because the content layer is asking to be scrolled on the
// main thread.
- EXPECT_EQ(InputHandler::ScrollOnMainThread,
- host_impl_->ScrollBegin(gfx::Point(5, 5),
- InputHandler::Wheel));
+ EXPECT_EQ(InputHandler::SCROLL_ON_MAIN_THREAD,
+ host_impl_->ScrollBegin(gfx::Point(5, 5), InputHandler::WHEEL));
}
TEST_F(LayerTreeHostImplTest, ScrollRootAndChangePageScaleOnMainThread) {
@@ -3283,9 +3268,8 @@ TEST_F(LayerTreeHostImplTest, ScrollRootAndChangePageScaleOnMainThread) {
gfx::Vector2d scroll_delta(0, 10);
gfx::Vector2d expected_scroll_delta = scroll_delta;
gfx::ScrollOffset expected_max_scroll = root_scroll->MaxScrollOffset();
- EXPECT_EQ(InputHandler::ScrollStarted,
- host_impl_->ScrollBegin(gfx::Point(5, 5),
- InputHandler::Wheel));
+ EXPECT_EQ(InputHandler::SCROLL_STARTED,
+ host_impl_->ScrollBegin(gfx::Point(5, 5), InputHandler::WHEEL));
host_impl_->ScrollBy(gfx::Point(), scroll_delta);
host_impl_->ScrollEnd();
@@ -3335,14 +3319,13 @@ TEST_F(LayerTreeHostImplTest, ScrollRootAndChangePageScaleOnImplThread) {
gfx::Vector2d scroll_delta(0, 10);
gfx::Vector2d expected_scroll_delta = scroll_delta;
gfx::ScrollOffset expected_max_scroll = root_scroll->MaxScrollOffset();
- EXPECT_EQ(InputHandler::ScrollStarted,
- host_impl_->ScrollBegin(gfx::Point(5, 5),
- InputHandler::Wheel));
+ EXPECT_EQ(InputHandler::SCROLL_STARTED,
+ host_impl_->ScrollBegin(gfx::Point(5, 5), InputHandler::WHEEL));
host_impl_->ScrollBy(gfx::Point(), scroll_delta);
host_impl_->ScrollEnd();
// Set new page scale on impl thread by pinching.
- host_impl_->ScrollBegin(gfx::Point(), InputHandler::Gesture);
+ host_impl_->ScrollBegin(gfx::Point(), InputHandler::GESTURE);
host_impl_->PinchGestureBegin();
host_impl_->PinchGestureUpdate(page_scale, gfx::Point());
host_impl_->PinchGestureEnd();
@@ -3384,7 +3367,7 @@ TEST_F(LayerTreeHostImplTest, PageScaleDeltaAppliedToRootScrollLayerOnly) {
LayerImpl* grand_child = child->children()[0];
// Set new page scale on impl thread by pinching.
- host_impl_->ScrollBegin(gfx::Point(), InputHandler::Gesture);
+ host_impl_->ScrollBegin(gfx::Point(), InputHandler::GESTURE);
host_impl_->PinchGestureBegin();
host_impl_->PinchGestureUpdate(new_page_scale, gfx::Point());
host_impl_->PinchGestureEnd();
@@ -3447,9 +3430,8 @@ TEST_F(LayerTreeHostImplTest, ScrollChildAndChangePageScaleOnMainThread) {
gfx::Vector2d scroll_delta(0, 10);
gfx::Vector2d expected_scroll_delta(scroll_delta);
gfx::ScrollOffset expected_max_scroll(child->MaxScrollOffset());
- EXPECT_EQ(InputHandler::ScrollStarted,
- host_impl_->ScrollBegin(gfx::Point(5, 5),
- InputHandler::Wheel));
+ EXPECT_EQ(InputHandler::SCROLL_STARTED,
+ host_impl_->ScrollBegin(gfx::Point(5, 5), InputHandler::WHEEL));
host_impl_->ScrollBy(gfx::Point(), scroll_delta);
host_impl_->ScrollEnd();
@@ -3499,9 +3481,8 @@ TEST_F(LayerTreeHostImplTest, ScrollChildBeyondLimit) {
DrawFrame();
{
gfx::Vector2d scroll_delta(-8, -7);
- EXPECT_EQ(InputHandler::ScrollStarted,
- host_impl_->ScrollBegin(gfx::Point(),
- InputHandler::Wheel));
+ EXPECT_EQ(InputHandler::SCROLL_STARTED,
+ host_impl_->ScrollBegin(gfx::Point(), InputHandler::WHEEL));
host_impl_->ScrollBy(gfx::Point(), scroll_delta);
host_impl_->ScrollEnd();
@@ -3553,9 +3534,9 @@ TEST_F(LayerTreeHostImplTest, ScrollWithoutBubbling) {
DrawFrame();
{
gfx::Vector2d scroll_delta(0, -10);
- EXPECT_EQ(InputHandler::ScrollStarted,
+ EXPECT_EQ(InputHandler::SCROLL_STARTED,
host_impl_->ScrollBegin(gfx::Point(),
- InputHandler::NonBubblingGesture));
+ InputHandler::NON_BUBBLING_GESTURE));
host_impl_->ScrollBy(gfx::Point(), scroll_delta);
host_impl_->ScrollEnd();
@@ -3573,9 +3554,9 @@ TEST_F(LayerTreeHostImplTest, ScrollWithoutBubbling) {
// The next time we scroll we should only scroll the parent.
scroll_delta = gfx::Vector2d(0, -3);
- EXPECT_EQ(InputHandler::ScrollStarted,
+ EXPECT_EQ(InputHandler::SCROLL_STARTED,
host_impl_->ScrollBegin(gfx::Point(5, 5),
- InputHandler::NonBubblingGesture));
+ InputHandler::NON_BUBBLING_GESTURE));
EXPECT_EQ(host_impl_->CurrentlyScrollingLayer(), grand_child);
host_impl_->ScrollBy(gfx::Point(), scroll_delta);
EXPECT_EQ(host_impl_->CurrentlyScrollingLayer(), child);
@@ -3592,9 +3573,9 @@ TEST_F(LayerTreeHostImplTest, ScrollWithoutBubbling) {
// After scrolling the parent, another scroll on the opposite direction
// should still scroll the child.
scroll_delta = gfx::Vector2d(0, 7);
- EXPECT_EQ(InputHandler::ScrollStarted,
+ EXPECT_EQ(InputHandler::SCROLL_STARTED,
host_impl_->ScrollBegin(gfx::Point(5, 5),
- InputHandler::NonBubblingGesture));
+ InputHandler::NON_BUBBLING_GESTURE));
EXPECT_EQ(host_impl_->CurrentlyScrollingLayer(), grand_child);
host_impl_->ScrollBy(gfx::Point(), scroll_delta);
EXPECT_EQ(host_impl_->CurrentlyScrollingLayer(), grand_child);
@@ -3614,9 +3595,9 @@ TEST_F(LayerTreeHostImplTest, ScrollWithoutBubbling) {
host_impl_->SetPageScaleOnActiveTree(2.f);
scroll_delta = gfx::Vector2d(0, -2);
- EXPECT_EQ(InputHandler::ScrollStarted,
+ EXPECT_EQ(InputHandler::SCROLL_STARTED,
host_impl_->ScrollBegin(gfx::Point(1, 1),
- InputHandler::NonBubblingGesture));
+ InputHandler::NON_BUBBLING_GESTURE));
EXPECT_EQ(grand_child, host_impl_->CurrentlyScrollingLayer());
host_impl_->ScrollBy(gfx::Point(), scroll_delta);
host_impl_->ScrollEnd();
@@ -3656,9 +3637,8 @@ TEST_F(LayerTreeHostImplTest, ScrollEventBubbling) {
DrawFrame();
{
gfx::Vector2d scroll_delta(0, 4);
- EXPECT_EQ(InputHandler::ScrollStarted,
- host_impl_->ScrollBegin(gfx::Point(5, 5),
- InputHandler::Wheel));
+ EXPECT_EQ(InputHandler::SCROLL_STARTED,
+ host_impl_->ScrollBegin(gfx::Point(5, 5), InputHandler::WHEEL));
host_impl_->ScrollBy(gfx::Point(), scroll_delta);
host_impl_->ScrollEnd();
@@ -3703,9 +3683,8 @@ TEST_F(LayerTreeHostImplTest, ScrollBeforeRedraw) {
host_impl_->active_tree()->DidBecomeActive();
// Scrolling should still work even though we did not draw yet.
- EXPECT_EQ(InputHandler::ScrollStarted,
- host_impl_->ScrollBegin(gfx::Point(5, 5),
- InputHandler::Wheel));
+ EXPECT_EQ(InputHandler::SCROLL_STARTED,
+ host_impl_->ScrollBegin(gfx::Point(5, 5), InputHandler::WHEEL));
}
TEST_F(LayerTreeHostImplTest, ScrollAxisAlignedRotatedLayer) {
@@ -3722,9 +3701,8 @@ TEST_F(LayerTreeHostImplTest, ScrollAxisAlignedRotatedLayer) {
// Scroll to the right in screen coordinates with a gesture.
gfx::Vector2d gesture_scroll_delta(10, 0);
- EXPECT_EQ(InputHandler::ScrollStarted,
- host_impl_->ScrollBegin(gfx::Point(),
- InputHandler::Gesture));
+ EXPECT_EQ(InputHandler::SCROLL_STARTED,
+ host_impl_->ScrollBegin(gfx::Point(), InputHandler::GESTURE));
host_impl_->ScrollBy(gfx::Point(), gesture_scroll_delta);
host_impl_->ScrollEnd();
@@ -3736,9 +3714,8 @@ TEST_F(LayerTreeHostImplTest, ScrollAxisAlignedRotatedLayer) {
// Reset and scroll down with the wheel.
scroll_layer->SetScrollDelta(gfx::Vector2dF());
gfx::Vector2d wheel_scroll_delta(0, 10);
- EXPECT_EQ(InputHandler::ScrollStarted,
- host_impl_->ScrollBegin(gfx::Point(),
- InputHandler::Wheel));
+ EXPECT_EQ(InputHandler::SCROLL_STARTED,
+ host_impl_->ScrollBegin(gfx::Point(), InputHandler::WHEEL));
host_impl_->ScrollBy(gfx::Point(), wheel_scroll_delta);
host_impl_->ScrollEnd();
@@ -3784,9 +3761,8 @@ TEST_F(LayerTreeHostImplTest, ScrollNonAxisAlignedRotatedLayer) {
{
// Scroll down in screen coordinates with a gesture.
gfx::Vector2d gesture_scroll_delta(0, 10);
- EXPECT_EQ(InputHandler::ScrollStarted,
- host_impl_->ScrollBegin(gfx::Point(1, 1),
- InputHandler::Gesture));
+ EXPECT_EQ(InputHandler::SCROLL_STARTED,
+ host_impl_->ScrollBegin(gfx::Point(1, 1), InputHandler::GESTURE));
host_impl_->ScrollBy(gfx::Point(), gesture_scroll_delta);
host_impl_->ScrollEnd();
@@ -3807,9 +3783,8 @@ TEST_F(LayerTreeHostImplTest, ScrollNonAxisAlignedRotatedLayer) {
// Now reset and scroll the same amount horizontally.
child_ptr->SetScrollDelta(gfx::Vector2dF());
gfx::Vector2d gesture_scroll_delta(10, 0);
- EXPECT_EQ(InputHandler::ScrollStarted,
- host_impl_->ScrollBegin(gfx::Point(1, 1),
- InputHandler::Gesture));
+ EXPECT_EQ(InputHandler::SCROLL_STARTED,
+ host_impl_->ScrollBegin(gfx::Point(1, 1), InputHandler::GESTURE));
host_impl_->ScrollBy(gfx::Point(), gesture_scroll_delta);
host_impl_->ScrollEnd();
@@ -3850,8 +3825,8 @@ TEST_F(LayerTreeHostImplTest, ScrollScaledLayer) {
// Scroll down in screen coordinates with a gesture.
gfx::Vector2d scroll_delta(0, 10);
- EXPECT_EQ(InputHandler::ScrollStarted,
- host_impl_->ScrollBegin(gfx::Point(), InputHandler::Gesture));
+ EXPECT_EQ(InputHandler::SCROLL_STARTED,
+ host_impl_->ScrollBegin(gfx::Point(), InputHandler::GESTURE));
host_impl_->ScrollBy(gfx::Point(), scroll_delta);
host_impl_->ScrollEnd();
@@ -3865,8 +3840,8 @@ TEST_F(LayerTreeHostImplTest, ScrollScaledLayer) {
// Reset and scroll down with the wheel.
scroll_layer->SetScrollDelta(gfx::Vector2dF());
gfx::Vector2d wheel_scroll_delta(0, 10);
- EXPECT_EQ(InputHandler::ScrollStarted,
- host_impl_->ScrollBegin(gfx::Point(), InputHandler::Wheel));
+ EXPECT_EQ(InputHandler::SCROLL_STARTED,
+ host_impl_->ScrollBegin(gfx::Point(), InputHandler::WHEEL));
host_impl_->ScrollBy(gfx::Point(), wheel_scroll_delta);
host_impl_->ScrollEnd();
@@ -4005,7 +3980,7 @@ TEST_F(LayerTreeHostImplTest, RootLayerScrollOffsetDelegation) {
// The pinch gesture doesn't put the delegate into a state where the scroll
// offset is outside of the scroll range. (this is verified by DCHECKs in the
// delegate).
- host_impl_->ScrollBegin(gfx::Point(), InputHandler::Gesture);
+ host_impl_->ScrollBegin(gfx::Point(), InputHandler::GESTURE);
host_impl_->PinchGestureBegin();
host_impl_->PinchGestureUpdate(2.f, gfx::Point());
host_impl_->PinchGestureUpdate(.5f, gfx::Point());
@@ -4017,8 +3992,8 @@ TEST_F(LayerTreeHostImplTest, RootLayerScrollOffsetDelegation) {
gfx::ScrollOffset current_offset(7.f, 8.f);
scroll_delegate.set_getter_return_value(current_offset);
- EXPECT_EQ(InputHandler::ScrollStarted,
- host_impl_->ScrollBegin(gfx::Point(), InputHandler::Gesture));
+ EXPECT_EQ(InputHandler::SCROLL_STARTED,
+ host_impl_->ScrollBegin(gfx::Point(), InputHandler::GESTURE));
host_impl_->ScrollBy(gfx::Point(), scroll_delta);
EXPECT_EQ(ScrollOffsetWithDelta(current_offset, scroll_delta),
@@ -4099,8 +4074,8 @@ TEST_F(LayerTreeHostImplTest, OverscrollRoot) {
EXPECT_EQ(gfx::Vector2dF(), host_impl_->accumulated_root_overscroll());
// In-bounds scrolling does not affect overscroll.
- EXPECT_EQ(InputHandler::ScrollStarted,
- host_impl_->ScrollBegin(gfx::Point(), InputHandler::Wheel));
+ EXPECT_EQ(InputHandler::SCROLL_STARTED,
+ host_impl_->ScrollBegin(gfx::Point(), InputHandler::WHEEL));
scroll_result = host_impl_->ScrollBy(gfx::Point(), gfx::Vector2d(0, 10));
EXPECT_TRUE(scroll_result.did_scroll);
EXPECT_FALSE(scroll_result.did_overscroll_root);
@@ -4234,9 +4209,9 @@ TEST_F(LayerTreeHostImplTest, OverscrollChildWithoutBubbling) {
DrawFrame();
{
gfx::Vector2d scroll_delta(0, -10);
- EXPECT_EQ(InputHandler::ScrollStarted,
+ EXPECT_EQ(InputHandler::SCROLL_STARTED,
host_impl_->ScrollBegin(gfx::Point(),
- InputHandler::NonBubblingGesture));
+ InputHandler::NON_BUBBLING_GESTURE));
host_impl_->ScrollBy(gfx::Point(), scroll_delta);
EXPECT_EQ(gfx::Vector2dF(), host_impl_->accumulated_root_overscroll());
host_impl_->ScrollEnd();
@@ -4244,9 +4219,9 @@ TEST_F(LayerTreeHostImplTest, OverscrollChildWithoutBubbling) {
// The next time we scroll we should only scroll the parent, but overscroll
// should still not reach the root layer.
scroll_delta = gfx::Vector2d(0, -30);
- EXPECT_EQ(InputHandler::ScrollStarted,
+ EXPECT_EQ(InputHandler::SCROLL_STARTED,
host_impl_->ScrollBegin(gfx::Point(5, 5),
- InputHandler::NonBubblingGesture));
+ InputHandler::NON_BUBBLING_GESTURE));
EXPECT_EQ(host_impl_->CurrentlyScrollingLayer(), grand_child_layer);
EXPECT_EQ(gfx::Vector2dF(), host_impl_->accumulated_root_overscroll());
host_impl_->ScrollBy(gfx::Point(), scroll_delta);
@@ -4257,9 +4232,9 @@ TEST_F(LayerTreeHostImplTest, OverscrollChildWithoutBubbling) {
// After scrolling the parent, another scroll on the opposite direction
// should scroll the child.
scroll_delta = gfx::Vector2d(0, 70);
- EXPECT_EQ(InputHandler::ScrollStarted,
+ EXPECT_EQ(InputHandler::SCROLL_STARTED,
host_impl_->ScrollBegin(gfx::Point(5, 5),
- InputHandler::NonBubblingGesture));
+ InputHandler::NON_BUBBLING_GESTURE));
EXPECT_EQ(host_impl_->CurrentlyScrollingLayer(), grand_child_layer);
host_impl_->ScrollBy(gfx::Point(), scroll_delta);
EXPECT_EQ(host_impl_->CurrentlyScrollingLayer(), grand_child_layer);
@@ -4296,9 +4271,8 @@ TEST_F(LayerTreeHostImplTest, OverscrollChildEventBubbling) {
DrawFrame();
{
gfx::Vector2d scroll_delta(0, 8);
- EXPECT_EQ(InputHandler::ScrollStarted,
- host_impl_->ScrollBegin(gfx::Point(5, 5),
- InputHandler::Wheel));
+ EXPECT_EQ(InputHandler::SCROLL_STARTED,
+ host_impl_->ScrollBegin(gfx::Point(5, 5), InputHandler::WHEEL));
host_impl_->ScrollBy(gfx::Point(), scroll_delta);
EXPECT_EQ(gfx::Vector2dF(), host_impl_->accumulated_root_overscroll());
host_impl_->ScrollBy(gfx::Point(), scroll_delta);
@@ -4322,8 +4296,8 @@ TEST_F(LayerTreeHostImplTest, OverscrollAlways) {
EXPECT_EQ(gfx::Vector2dF(), host_impl_->accumulated_root_overscroll());
// Even though the layer can't scroll the overscroll still happens.
- EXPECT_EQ(InputHandler::ScrollStarted,
- host_impl_->ScrollBegin(gfx::Point(), InputHandler::Wheel));
+ EXPECT_EQ(InputHandler::SCROLL_STARTED,
+ host_impl_->ScrollBegin(gfx::Point(), InputHandler::WHEEL));
host_impl_->ScrollBy(gfx::Point(), gfx::Vector2d(0, 10));
EXPECT_EQ(gfx::Vector2dF(0, 10), host_impl_->accumulated_root_overscroll());
}
@@ -4360,8 +4334,8 @@ TEST_F(LayerTreeHostImplTest, NoOverscrollOnFractionalDeviceScale) {
// Horizontal & Vertical GlowEffect should not be applied when
// content size is less then view port size. For Example Horizontal &
// vertical GlowEffect should not be applied in about:blank page.
- EXPECT_EQ(InputHandler::ScrollStarted,
- host_impl_->ScrollBegin(gfx::Point(0, 0), InputHandler::Wheel));
+ EXPECT_EQ(InputHandler::SCROLL_STARTED,
+ host_impl_->ScrollBegin(gfx::Point(0, 0), InputHandler::WHEEL));
host_impl_->ScrollBy(gfx::Point(), gfx::Vector2dF(0, -1));
EXPECT_EQ(gfx::Vector2dF().ToString(),
host_impl_->accumulated_root_overscroll().ToString());
@@ -4397,8 +4371,8 @@ TEST_F(LayerTreeHostImplTest, NoOverscrollWhenNotAtEdge) {
// Edge glow effect should be applicable only upon reaching Edges
// of the content. unnecessary glow effect calls shouldn't be
// called while scrolling up without reaching the edge of the content.
- EXPECT_EQ(InputHandler::ScrollStarted,
- host_impl_->ScrollBegin(gfx::Point(0, 0), InputHandler::Wheel));
+ EXPECT_EQ(InputHandler::SCROLL_STARTED,
+ host_impl_->ScrollBegin(gfx::Point(0, 0), InputHandler::WHEEL));
host_impl_->ScrollBy(gfx::Point(), gfx::Vector2dF(0, 100));
EXPECT_EQ(gfx::Vector2dF().ToString(),
host_impl_->accumulated_root_overscroll().ToString());
@@ -4408,10 +4382,10 @@ TEST_F(LayerTreeHostImplTest, NoOverscrollWhenNotAtEdge) {
host_impl_->ScrollEnd();
// unusedrootDelta should be subtracted from applied delta so that
// unwanted glow effect calls are not called.
- EXPECT_EQ(InputHandler::ScrollStarted,
+ EXPECT_EQ(InputHandler::SCROLL_STARTED,
host_impl_->ScrollBegin(gfx::Point(0, 0),
- InputHandler::NonBubblingGesture));
- EXPECT_EQ(InputHandler::ScrollStarted, host_impl_->FlingScrollBegin());
+ InputHandler::NON_BUBBLING_GESTURE));
+ EXPECT_EQ(InputHandler::SCROLL_STARTED, host_impl_->FlingScrollBegin());
host_impl_->ScrollBy(gfx::Point(), gfx::Vector2dF(0, 20));
EXPECT_EQ(gfx::Vector2dF(0.000000f, 17.699997f).ToString(),
host_impl_->accumulated_root_overscroll().ToString());
@@ -4422,8 +4396,8 @@ TEST_F(LayerTreeHostImplTest, NoOverscrollWhenNotAtEdge) {
host_impl_->ScrollEnd();
// TestCase to check kEpsilon, which prevents minute values to trigger
// gloweffect without reaching edge.
- EXPECT_EQ(InputHandler::ScrollStarted,
- host_impl_->ScrollBegin(gfx::Point(0, 0), InputHandler::Wheel));
+ EXPECT_EQ(InputHandler::SCROLL_STARTED,
+ host_impl_->ScrollBegin(gfx::Point(0, 0), InputHandler::WHEEL));
host_impl_->ScrollBy(gfx::Point(), gfx::Vector2dF(-0.12f, 0.1f));
EXPECT_EQ(gfx::Vector2dF().ToString(),
host_impl_->accumulated_root_overscroll().ToString());
@@ -4498,7 +4472,7 @@ class BlendStateCheckLayer : public LayerImpl {
resource_id_(resource_provider->CreateResource(
gfx::Size(1, 1),
GL_CLAMP_TO_EDGE,
- ResourceProvider::TextureHintImmutable,
+ ResourceProvider::TEXTURE_HINT_IMMUTABLE,
RGBA_8888)) {
resource_provider->AllocateForTesting(resource_id_);
SetBounds(gfx::Size(10, 10));
@@ -6945,12 +6919,10 @@ TEST_F(LayerTreeHostImplTest, TouchFlingShouldNotBubble) {
host_impl_->active_tree()->DidBecomeActive();
DrawFrame();
{
- EXPECT_EQ(InputHandler::ScrollStarted,
- host_impl_->ScrollBegin(gfx::Point(),
- InputHandler::Gesture));
+ EXPECT_EQ(InputHandler::SCROLL_STARTED,
+ host_impl_->ScrollBegin(gfx::Point(), InputHandler::GESTURE));
- EXPECT_EQ(InputHandler::ScrollStarted,
- host_impl_->FlingScrollBegin());
+ EXPECT_EQ(InputHandler::SCROLL_STARTED, host_impl_->FlingScrollBegin());
gfx::Vector2d scroll_delta(0, 100);
host_impl_->ScrollBy(gfx::Point(), scroll_delta);
@@ -6998,8 +6970,8 @@ TEST_F(LayerTreeHostImplTest, TouchFlingShouldLockToFirstScrolledLayer) {
LayerImpl* grand_child = child->children()[0];
gfx::Vector2d scroll_delta(0, -2);
- EXPECT_EQ(InputHandler::ScrollStarted,
- host_impl_->ScrollBegin(gfx::Point(), InputHandler::Gesture));
+ EXPECT_EQ(InputHandler::SCROLL_STARTED,
+ host_impl_->ScrollBegin(gfx::Point(), InputHandler::GESTURE));
EXPECT_TRUE(host_impl_->ScrollBy(gfx::Point(), scroll_delta).did_scroll);
// The grand child should have scrolled up to its limit.
@@ -7019,7 +6991,7 @@ TEST_F(LayerTreeHostImplTest, TouchFlingShouldLockToFirstScrolledLayer) {
// The first |ScrollBy| after the fling should re-lock the scrolling
// layer to the first layer that scrolled, which is the child.
- EXPECT_EQ(InputHandler::ScrollStarted, host_impl_->FlingScrollBegin());
+ EXPECT_EQ(InputHandler::SCROLL_STARTED, host_impl_->FlingScrollBegin());
EXPECT_TRUE(host_impl_->ScrollBy(gfx::Point(), scroll_delta).did_scroll);
EXPECT_EQ(host_impl_->CurrentlyScrollingLayer(), child);
@@ -7058,11 +7030,10 @@ TEST_F(LayerTreeHostImplTest, WheelFlingShouldBubble) {
host_impl_->active_tree()->DidBecomeActive();
DrawFrame();
{
- EXPECT_EQ(InputHandler::ScrollStarted,
- host_impl_->ScrollBegin(gfx::Point(), InputHandler::Wheel));
+ EXPECT_EQ(InputHandler::SCROLL_STARTED,
+ host_impl_->ScrollBegin(gfx::Point(), InputHandler::WHEEL));
- EXPECT_EQ(InputHandler::ScrollStarted,
- host_impl_->FlingScrollBegin());
+ EXPECT_EQ(InputHandler::SCROLL_STARTED, host_impl_->FlingScrollBegin());
gfx::Vector2d scroll_delta(0, 100);
host_impl_->ScrollBy(gfx::Point(), scroll_delta);
@@ -7081,7 +7052,7 @@ TEST_F(LayerTreeHostImplTest, WheelFlingShouldBubble) {
TEST_F(LayerTreeHostImplTest, ScrollUnknownNotOnAncestorChain) {
// If we ray cast a scroller that is not on the first layer's ancestor chain,
- // we should return ScrollUnknown.
+ // we should return SCROLL_UNKNOWN.
gfx::Size content_size(100, 100);
SetupScrollAndContentsLayers(content_size);
@@ -7107,14 +7078,14 @@ TEST_F(LayerTreeHostImplTest, ScrollUnknownNotOnAncestorChain) {
DrawFrame();
- EXPECT_EQ(InputHandler::ScrollUnknown,
- host_impl_->ScrollBegin(gfx::Point(), InputHandler::Wheel));
+ EXPECT_EQ(InputHandler::SCROLL_UNKNOWN,
+ host_impl_->ScrollBegin(gfx::Point(), InputHandler::WHEEL));
}
TEST_F(LayerTreeHostImplTest, ScrollUnknownScrollAncestorMismatch) {
// If we ray cast a scroller this is on the first layer's ancestor chain, but
// is not the first scroller we encounter when walking up from the layer, we
- // should also return ScrollUnknown.
+ // should also return SCROLL_UNKNOWN.
gfx::Size content_size(100, 100);
SetupScrollAndContentsLayers(content_size);
@@ -7146,8 +7117,8 @@ TEST_F(LayerTreeHostImplTest, ScrollUnknownScrollAncestorMismatch) {
DrawFrame();
- EXPECT_EQ(InputHandler::ScrollUnknown,
- host_impl_->ScrollBegin(gfx::Point(), InputHandler::Wheel));
+ EXPECT_EQ(InputHandler::SCROLL_UNKNOWN,
+ host_impl_->ScrollBegin(gfx::Point(), InputHandler::WHEEL));
}
TEST_F(LayerTreeHostImplTest, ScrollInvisibleScroller) {
@@ -7173,10 +7144,10 @@ TEST_F(LayerTreeHostImplTest, ScrollInvisibleScroller) {
// it. The reason for this is that if the scrolling the scroll would not move
// any layer that is a drawn RSLL member, then we can ignore the hit.
//
- // Why ScrollStarted? In this case, it's because we've bubbled out and started
- // overscrolling the inner viewport.
- EXPECT_EQ(InputHandler::ScrollStarted,
- host_impl_->ScrollBegin(gfx::Point(), InputHandler::Wheel));
+ // Why SCROLL_STARTED? In this case, it's because we've bubbled out and
+ // started overscrolling the inner viewport.
+ EXPECT_EQ(InputHandler::SCROLL_STARTED,
+ host_impl_->ScrollBegin(gfx::Point(), InputHandler::WHEEL));
EXPECT_EQ(2, host_impl_->CurrentlyScrollingLayer()->id());
}
@@ -7230,10 +7201,10 @@ TEST_F(LayerTreeHostImplTest, ScrollInvisibleScrollerWithVisibleScrollChild) {
// it. The reason for this is that if the scrolling the scroll would not move
// any layer that is a drawn RSLL member, then we can ignore the hit.
//
- // Why ScrollStarted? In this case, it's because we've bubbled out and started
- // overscrolling the inner viewport.
- EXPECT_EQ(InputHandler::ScrollStarted,
- host_impl_->ScrollBegin(gfx::Point(), InputHandler::Wheel));
+ // Why SCROLL_STARTED? In this case, it's because we've bubbled out and
+ // started overscrolling the inner viewport.
+ EXPECT_EQ(InputHandler::SCROLL_STARTED,
+ host_impl_->ScrollBegin(gfx::Point(), InputHandler::WHEEL));
EXPECT_EQ(7, host_impl_->CurrentlyScrollingLayer()->id());
}
@@ -7429,8 +7400,8 @@ TEST_F(LayerTreeHostImplTest, SimpleSwapPromiseMonitor) {
LayerImpl* scroll_layer = SetupScrollAndContentsLayers(gfx::Size(100, 100));
// Scrolling normally should not trigger any forwarding.
- EXPECT_EQ(InputHandler::ScrollStarted,
- host_impl_->ScrollBegin(gfx::Point(), InputHandler::Gesture));
+ EXPECT_EQ(InputHandler::SCROLL_STARTED,
+ host_impl_->ScrollBegin(gfx::Point(), InputHandler::GESTURE));
EXPECT_TRUE(
host_impl_->ScrollBy(gfx::Point(), gfx::Vector2d(0, 10)).did_scroll);
host_impl_->ScrollEnd();
@@ -7442,8 +7413,8 @@ TEST_F(LayerTreeHostImplTest, SimpleSwapPromiseMonitor) {
// Scrolling with a scroll handler should defer the swap to the main
// thread.
scroll_layer->SetHaveScrollEventHandlers(true);
- EXPECT_EQ(InputHandler::ScrollStarted,
- host_impl_->ScrollBegin(gfx::Point(), InputHandler::Gesture));
+ EXPECT_EQ(InputHandler::SCROLL_STARTED,
+ host_impl_->ScrollBegin(gfx::Point(), InputHandler::GESTURE));
EXPECT_TRUE(
host_impl_->ScrollBy(gfx::Point(), gfx::Vector2d(0, 10)).did_scroll);
host_impl_->ScrollEnd();
@@ -7518,8 +7489,8 @@ TEST_F(LayerTreeHostImplWithTopControlsTest, ScrollHandledByTopControls) {
BOTH, SHOWN, false);
DrawFrame();
- EXPECT_EQ(InputHandler::ScrollStarted,
- host_impl_->ScrollBegin(gfx::Point(), InputHandler::Gesture));
+ EXPECT_EQ(InputHandler::SCROLL_STARTED,
+ host_impl_->ScrollBegin(gfx::Point(), InputHandler::GESTURE));
EXPECT_EQ(0, host_impl_->top_controls_manager()->ControlsTopOffset());
EXPECT_EQ(gfx::Vector2dF().ToString(),
scroll_layer->CurrentScrollOffset().ToString());
@@ -7577,8 +7548,8 @@ TEST_F(LayerTreeHostImplWithTopControlsTest, TopControlsAnimationAtOrigin) {
BOTH, SHOWN, false);
DrawFrame();
- EXPECT_EQ(InputHandler::ScrollStarted,
- host_impl_->ScrollBegin(gfx::Point(), InputHandler::Gesture));
+ EXPECT_EQ(InputHandler::SCROLL_STARTED,
+ host_impl_->ScrollBegin(gfx::Point(), InputHandler::GESTURE));
EXPECT_EQ(0, host_impl_->top_controls_manager()->ControlsTopOffset());
EXPECT_EQ(gfx::Vector2dF().ToString(),
scroll_layer->CurrentScrollOffset().ToString());
@@ -7647,8 +7618,8 @@ TEST_F(LayerTreeHostImplWithTopControlsTest, TopControlsAnimationAfterScroll) {
gfx::ScrollOffset(0, initial_scroll_offset));
DrawFrame();
- EXPECT_EQ(InputHandler::ScrollStarted,
- host_impl_->ScrollBegin(gfx::Point(), InputHandler::Gesture));
+ EXPECT_EQ(InputHandler::SCROLL_STARTED,
+ host_impl_->ScrollBegin(gfx::Point(), InputHandler::GESTURE));
EXPECT_EQ(0, host_impl_->top_controls_manager()->ControlsTopOffset());
EXPECT_EQ(gfx::Vector2dF(0, initial_scroll_offset).ToString(),
scroll_layer->CurrentScrollOffset().ToString());
@@ -7708,8 +7679,8 @@ TEST_F(LayerTreeHostImplWithTopControlsTest,
false);
DrawFrame();
- EXPECT_EQ(InputHandler::ScrollStarted,
- host_impl_->ScrollBegin(gfx::Point(), InputHandler::Gesture));
+ EXPECT_EQ(InputHandler::SCROLL_STARTED,
+ host_impl_->ScrollBegin(gfx::Point(), InputHandler::GESTURE));
EXPECT_EQ(0, host_impl_->top_controls_manager()->ControlsTopOffset());
float offset = 50;
@@ -7841,9 +7812,9 @@ TEST_F(LayerTreeHostImplVirtualViewportTest, FlingScrollBubblesToInner) {
EXPECT_VECTOR_EQ(outer_expected, outer_scroll->CurrentScrollOffset());
// Make sure the fling goes to the outer viewport first
- EXPECT_EQ(InputHandler::ScrollStarted,
- host_impl_->ScrollBegin(gfx::Point(), InputHandler::Gesture));
- EXPECT_EQ(InputHandler::ScrollStarted, host_impl_->FlingScrollBegin());
+ EXPECT_EQ(InputHandler::SCROLL_STARTED,
+ host_impl_->ScrollBegin(gfx::Point(), InputHandler::GESTURE));
+ EXPECT_EQ(InputHandler::SCROLL_STARTED, host_impl_->FlingScrollBegin());
gfx::Vector2d scroll_delta(inner_viewport.width(), inner_viewport.height());
host_impl_->ScrollBy(gfx::Point(), scroll_delta);
@@ -7855,9 +7826,9 @@ TEST_F(LayerTreeHostImplVirtualViewportTest, FlingScrollBubblesToInner) {
EXPECT_VECTOR_EQ(outer_expected, outer_scroll->CurrentScrollOffset());
// Fling past the outer viewport boundry, make sure inner viewport scrolls.
- EXPECT_EQ(InputHandler::ScrollStarted,
- host_impl_->ScrollBegin(gfx::Point(), InputHandler::Gesture));
- EXPECT_EQ(InputHandler::ScrollStarted, host_impl_->FlingScrollBegin());
+ EXPECT_EQ(InputHandler::SCROLL_STARTED,
+ host_impl_->ScrollBegin(gfx::Point(), InputHandler::GESTURE));
+ EXPECT_EQ(InputHandler::SCROLL_STARTED, host_impl_->FlingScrollBegin());
host_impl_->ScrollBy(gfx::Point(), scroll_delta);
outer_expected += gfx::Vector2dF(scroll_delta.x(), scroll_delta.y());
@@ -7890,9 +7861,9 @@ TEST_F(LayerTreeHostImplVirtualViewportTest,
EXPECT_VECTOR_EQ(outer_expected, outer_scroll->CurrentScrollOffset());
// Make sure the scroll goes to the outer viewport first.
- EXPECT_EQ(InputHandler::ScrollStarted,
- host_impl_->ScrollBegin(gfx::Point(), InputHandler::Gesture));
- EXPECT_EQ(InputHandler::ScrollStarted, host_impl_->FlingScrollBegin());
+ EXPECT_EQ(InputHandler::SCROLL_STARTED,
+ host_impl_->ScrollBegin(gfx::Point(), InputHandler::GESTURE));
+ EXPECT_EQ(InputHandler::SCROLL_STARTED, host_impl_->FlingScrollBegin());
// Scroll near the edge of the outer viewport.
gfx::Vector2d scroll_delta(inner_viewport.width(), inner_viewport.height());
@@ -7936,8 +7907,8 @@ TEST_F(LayerTreeHostImplVirtualViewportTest,
scoped_ptr<ScrollAndScaleSet> scroll_info;
gfx::Vector2d scroll_delta(0, inner_viewport.height());
- EXPECT_EQ(InputHandler::ScrollStarted,
- host_impl_->ScrollBegin(gfx::Point(), InputHandler::Gesture));
+ EXPECT_EQ(InputHandler::SCROLL_STARTED,
+ host_impl_->ScrollBegin(gfx::Point(), InputHandler::GESTURE));
EXPECT_TRUE(host_impl_->ScrollBy(gfx::Point(), scroll_delta).did_scroll);
// The child should have scrolled up to its limit.
@@ -7948,7 +7919,7 @@ TEST_F(LayerTreeHostImplVirtualViewportTest,
// The first |ScrollBy| after the fling should re-lock the scrolling
// layer to the first layer that scrolled, the inner viewport scroll layer.
- EXPECT_EQ(InputHandler::ScrollStarted, host_impl_->FlingScrollBegin());
+ EXPECT_EQ(InputHandler::SCROLL_STARTED, host_impl_->FlingScrollBegin());
EXPECT_TRUE(host_impl_->ScrollBy(gfx::Point(), scroll_delta).did_scroll);
EXPECT_EQ(host_impl_->CurrentlyScrollingLayer(), inner_scroll);
@@ -8024,7 +7995,7 @@ TEST_F(LayerTreeHostImplTest, ScrollAnimated) {
base::TimeTicks start_time =
base::TimeTicks() + base::TimeDelta::FromMilliseconds(100);
- EXPECT_EQ(InputHandler::ScrollStarted,
+ EXPECT_EQ(InputHandler::SCROLL_STARTED,
host_impl_->ScrollAnimated(gfx::Point(), gfx::Vector2d(0, 50)));
LayerImpl* scrolling_layer = host_impl_->CurrentlyScrollingLayer();
@@ -8041,7 +8012,7 @@ TEST_F(LayerTreeHostImplTest, ScrollAnimated) {
EXPECT_TRUE(y > 1 && y < 49);
// Update target.
- EXPECT_EQ(InputHandler::ScrollStarted,
+ EXPECT_EQ(InputHandler::SCROLL_STARTED,
host_impl_->ScrollAnimated(gfx::Point(), gfx::Vector2d(0, 50)));
host_impl_->Animate(start_time + base::TimeDelta::FromMilliseconds(200));
@@ -8384,15 +8355,15 @@ TEST_F(LayerTreeHostImplTest, WheelScrollWithPageScaleFactorOnInnerLayer) {
scroll_layer->SetScrollDelta(gfx::Vector2d());
float page_scale_delta = 2.f;
- host_impl_->ScrollBegin(gfx::Point(), InputHandler::Gesture);
+ host_impl_->ScrollBegin(gfx::Point(), InputHandler::GESTURE);
host_impl_->PinchGestureBegin();
host_impl_->PinchGestureUpdate(page_scale_delta, gfx::Point());
host_impl_->PinchGestureEnd();
host_impl_->ScrollEnd();
gfx::Vector2dF scroll_delta(0, 5);
- EXPECT_EQ(InputHandler::ScrollStarted,
- host_impl_->ScrollBegin(gfx::Point(), InputHandler::Wheel));
+ EXPECT_EQ(InputHandler::SCROLL_STARTED,
+ host_impl_->ScrollBegin(gfx::Point(), InputHandler::WHEEL));
EXPECT_VECTOR_EQ(gfx::Vector2dF(), scroll_layer->CurrentScrollOffset());
host_impl_->ScrollBy(gfx::Point(), scroll_delta);