| 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 72a72b4552545cac9efb7fe390d349c8ddda55d7..206bbc376a7ecced5299838d60fe16ef86857d99 100644
|
| --- a/cc/trees/layer_tree_host_impl_unittest.cc
|
| +++ b/cc/trees/layer_tree_host_impl_unittest.cc
|
| @@ -602,6 +602,27 @@ TEST_F(LayerTreeHostImplTest, NoFlingWhenScrollingOnMain) {
|
| host_impl_->FlingScrollBegin());
|
| }
|
|
|
| +TEST_F(LayerTreeHostImplTest, IgnoreScrollOnMainThreadIfRootNotScrollable) {
|
| + SetupScrollAndContentsLayers(gfx::Size(100, 100));
|
| + host_impl_->SetViewportSize(gfx::Size(50, 50));
|
| + InitializeRendererAndDrawFrame();
|
| + LayerImpl* root = host_impl_->active_tree()->root_layer();
|
| +
|
| + root->SetShouldScrollOnMainThread(true);
|
| + root->SetScrollable(true);
|
| + root->SetMaxScrollOffset(gfx::Vector2d(10, 10));
|
| +
|
| + // Makes no different if this is a wheel input event or a gesture.
|
| + EXPECT_EQ(InputHandler::ScrollOnMainThread,
|
| + host_impl_->ScrollBegin(gfx::Point(), InputHandler::Wheel));
|
| +
|
| + // The root is no longer scrollable, so 'should scroll on main thread should
|
| + // no longer apply'. NB -- we are scrolling a descendant of the root.
|
| + root->SetMaxScrollOffset(gfx::Vector2d());
|
| + EXPECT_EQ(InputHandler::ScrollStarted,
|
| + host_impl_->ScrollBegin(gfx::Point(), InputHandler::Wheel));
|
| +}
|
| +
|
| TEST_F(LayerTreeHostImplTest, ShouldScrollOnMainThread) {
|
| SetupScrollAndContentsLayers(gfx::Size(100, 100));
|
| host_impl_->SetViewportSize(gfx::Size(50, 50));
|
| @@ -615,7 +636,6 @@ TEST_F(LayerTreeHostImplTest, ShouldScrollOnMainThread) {
|
| EXPECT_EQ(InputHandler::ScrollOnMainThread,
|
| host_impl_->ScrollBegin(gfx::Point(), InputHandler::Gesture));
|
| }
|
| -
|
| TEST_F(LayerTreeHostImplTest, NonFastScrollableRegionBasic) {
|
| SetupScrollAndContentsLayers(gfx::Size(200, 200));
|
| host_impl_->SetViewportSize(gfx::Size(100, 100));
|
|
|