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

Unified Diff: cc/trees/layer_tree_host_impl_unittest.cc

Issue 1038173002: Refactor delegated scrolling in LayerImpl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove "scrollOffsetDelegate" Created 5 years, 8 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
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 979f1a9dd30ee329fda804e14fbd409463e278f4..e4bb7dc55cd3bf093d754771713017b269c0f61d 100644
--- a/cc/trees/layer_tree_host_impl_unittest.cc
+++ b/cc/trees/layer_tree_host_impl_unittest.cc
@@ -3972,6 +3972,7 @@ TEST_F(LayerTreeHostImplTest, RootLayerScrollOffsetDelegation) {
scroll_delegate.set_getter_return_value(current_offset);
EXPECT_EQ(InputHandler::SCROLL_STARTED,
host_impl_->ScrollBegin(gfx::Point(), InputHandler::GESTURE));
+ host_impl_->OnRootLayerDelegatedScrollOffsetChanged();
host_impl_->ScrollBy(gfx::Point(), scroll_delta);
EXPECT_EQ(ScrollOffsetWithDelta(current_offset, scroll_delta),
@@ -3979,11 +3980,13 @@ TEST_F(LayerTreeHostImplTest, RootLayerScrollOffsetDelegation) {
current_offset = gfx::ScrollOffset(42.f, 41.f);
scroll_delegate.set_getter_return_value(current_offset);
+ host_impl_->OnRootLayerDelegatedScrollOffsetChanged();
host_impl_->ScrollBy(gfx::Point(), scroll_delta);
EXPECT_EQ(current_offset + gfx::ScrollOffset(scroll_delta),
scroll_delegate.last_set_scroll_offset());
host_impl_->ScrollEnd();
scroll_delegate.set_getter_return_value(gfx::ScrollOffset());
+ host_impl_->OnRootLayerDelegatedScrollOffsetChanged();
// Forces a full tree synchronization and ensures that the scroll delegate
// sees the correct size of the new tree.
@@ -3997,6 +4000,7 @@ TEST_F(LayerTreeHostImplTest, RootLayerScrollOffsetDelegation) {
// the root scrollable layer.
current_offset = gfx::ScrollOffset(13.f, 12.f);
scroll_delegate.set_getter_return_value(current_offset);
+ host_impl_->OnRootLayerDelegatedScrollOffsetChanged();
host_impl_->SetRootLayerScrollOffsetDelegate(NULL);
EXPECT_EQ(current_offset.ToString(),

Powered by Google App Engine
This is Rietveld 408576698