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

Unified Diff: cc/layers/layer_impl_unittest.cc

Issue 30793002: cc: Do not allow gesture-scrolling 'overflow[-{x|y}]:hidden' layers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: needs-commit Created 7 years, 2 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/layers/layer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/layer_impl_unittest.cc
diff --git a/cc/layers/layer_impl_unittest.cc b/cc/layers/layer_impl_unittest.cc
index 83cd346e4778fe5bae9ec11bcbd1d50949c5b37b..2d3305c57c4add80fe5840b8fe30627a50547edf 100644
--- a/cc/layers/layer_impl_unittest.cc
+++ b/cc/layers/layer_impl_unittest.cc
@@ -547,5 +547,19 @@ TEST_F(LayerImplScrollTest, ApplySentScrollsWithAcceptingDelegate) {
EXPECT_VECTOR_EQ(gfx::Vector2d(), layer()->sent_scroll_delta());
}
+TEST_F(LayerImplScrollTest, ScrollUserUnscrollableLayer) {
+ gfx::Vector2d max_scroll_offset(50, 80);
+ gfx::Vector2d scroll_offset(10, 5);
+ gfx::Vector2dF scroll_delta(20.5f, 8.5f);
+
+ layer()->set_user_scrollable_vertical(false);
+ layer()->SetMaxScrollOffset(max_scroll_offset);
+ layer()->SetScrollOffset(scroll_offset);
+ gfx::Vector2dF unscrolled = layer()->ScrollBy(scroll_delta);
+
+ EXPECT_VECTOR_EQ(gfx::Vector2dF(0, 8.5f), unscrolled);
+ EXPECT_VECTOR_EQ(gfx::Vector2dF(30.5f, 5), layer()->TotalScrollOffset());
+}
+
} // namespace
} // namespace cc
« no previous file with comments | « cc/layers/layer_impl.cc ('k') | cc/layers/layer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698