summaryrefslogtreecommitdiffstats
path: root/cc/top_controls_manager_unittest.cc
diff options
context:
space:
mode:
Diffstat (limited to 'cc/top_controls_manager_unittest.cc')
-rw-r--r--cc/top_controls_manager_unittest.cc13
1 files changed, 13 insertions, 0 deletions
diff --git a/cc/top_controls_manager_unittest.cc b/cc/top_controls_manager_unittest.cc
index 1418be3..d201454 100644
--- a/cc/top_controls_manager_unittest.cc
+++ b/cc/top_controls_manager_unittest.cc
@@ -180,6 +180,19 @@ TEST(TopControlsManagerTest, ensureScrollThresholdApplied) {
EXPECT_EQ(0.f, manager->content_top_offset());
client.rootScrollLayer()->setScrollOffset(gfx::Vector2d(0, 240));
+ // Reset the scroll threshold by going further up the page than the initial
+ // threshold.
+ manager->ScrollBy(gfx::Vector2dF(0.f, -100.f));
+ EXPECT_EQ(0.f, manager->controls_top_offset());
+ EXPECT_EQ(0.f, manager->content_top_offset());
+ client.rootScrollLayer()->setScrollOffset(gfx::Vector2d(0, 140));
+
+ // See that scrolling down the page now will result in the controls hiding.
+ manager->ScrollBy(gfx::Vector2dF(0.f, 20.f));
+ EXPECT_EQ(-20.f, manager->controls_top_offset());
+ EXPECT_EQ(0.f, manager->content_top_offset());
+ client.rootScrollLayer()->setScrollOffset(gfx::Vector2d(0, 160));
+
manager->ScrollEnd();
}