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

Unified Diff: cc/layers/scrollbar_layer_unittest.cc

Issue 1689293002: cc: Move TryScroll from LayerImpl to LayerTreeHostImpl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merge with master and fix unit test failures. Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/layers/layer_impl.cc ('k') | cc/proto/property_tree.proto » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/scrollbar_layer_unittest.cc
diff --git a/cc/layers/scrollbar_layer_unittest.cc b/cc/layers/scrollbar_layer_unittest.cc
index 53e0392bfc48fd7130934519d788449e7e7e585d..01da2d95ee670417b1bf14ed13d4d81c16835a4a 100644
--- a/cc/layers/scrollbar_layer_unittest.cc
+++ b/cc/layers/scrollbar_layer_unittest.cc
@@ -158,12 +158,17 @@ TEST_F(ScrollbarLayerTest, ShouldScrollNonOverlayOnMainThread) {
PaintedScrollbarLayerImpl* scrollbar_layer_impl =
static_cast<PaintedScrollbarLayerImpl*>(
layer_impl_tree_root->children()[1].get());
+ layer_impl_tree_root->layer_tree_impl()->BuildPropertyTreesForTesting();
+ ScrollTree& scroll_tree =
+ layer_impl_tree_root->layer_tree_impl()->property_trees()->scroll_tree;
+ ScrollNode* scroll_node =
+ scroll_tree.Node(scrollbar_layer_impl->scroll_tree_index());
// When the scrollbar is not an overlay scrollbar, the scroll should be
// responded to on the main thread as the compositor does not yet implement
// scrollbar scrolling.
- InputHandler::ScrollStatus status =
- scrollbar_layer_impl->TryScroll(gfx::PointF(), InputHandler::GESTURE);
+ InputHandler::ScrollStatus status = layer_tree_host_->host_impl()->TryScroll(
+ gfx::PointF(), InputHandler::GESTURE, scroll_tree, scroll_node);
EXPECT_EQ(InputHandler::SCROLL_ON_MAIN_THREAD, status.thread);
EXPECT_EQ(MainThreadScrollingReason::kScrollbarScrolling,
status.main_thread_scrolling_reasons);
@@ -176,11 +181,15 @@ TEST_F(ScrollbarLayerTest, ShouldScrollNonOverlayOnMainThread) {
false, 0, 0);
scrollbar_layer_impl = static_cast<PaintedScrollbarLayerImpl*>(
layer_impl_tree_root->children()[1].get());
+ layer_impl_tree_root->layer_tree_impl()->BuildPropertyTreesForTesting();
+ scroll_tree =
+ layer_impl_tree_root->layer_tree_impl()->property_trees()->scroll_tree;
+ scroll_node = scroll_tree.Node(scrollbar_layer_impl->scroll_tree_index());
// The user shouldn't be able to drag an overlay scrollbar and the scroll
// may be handled in the compositor.
- status =
- scrollbar_layer_impl->TryScroll(gfx::PointF(), InputHandler::GESTURE);
+ status = layer_tree_host_->host_impl()->TryScroll(
+ gfx::PointF(), InputHandler::GESTURE, scroll_tree, scroll_node);
EXPECT_EQ(InputHandler::SCROLL_IGNORED, status.thread);
EXPECT_EQ(MainThreadScrollingReason::kNotScrollable,
status.main_thread_scrolling_reasons);
« no previous file with comments | « cc/layers/layer_impl.cc ('k') | cc/proto/property_tree.proto » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698