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

Unified Diff: cc/input/top_controls_manager_unittest.cc

Issue 2371223002: Keep top controls visible if SHOW is called right after HIDE. (Closed)
Patch Set: Created 4 years, 3 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/input/top_controls_manager.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/input/top_controls_manager_unittest.cc
diff --git a/cc/input/top_controls_manager_unittest.cc b/cc/input/top_controls_manager_unittest.cc
index 5074f478a75401f40f02ecef0828b17434d4873b..5ac2cafb9c486e6ecbee60d9a3733f71f7b20c62 100644
--- a/cc/input/top_controls_manager_unittest.cc
+++ b/cc/input/top_controls_manager_unittest.cc
@@ -512,5 +512,20 @@ TEST(TopControlsManagerTest, HideAndPeekBottomControls) {
manager->ScrollEnd();
}
+TEST(TopControlsManagerTest, HideAndImmediateShowKeepsControlsVisible) {
+ MockTopControlsManagerClient client(100.f, 0.5f, 0.5f);
+ client.SetBottomControlsHeight(100.f);
+ TopControlsManager* manager = client.manager();
+ EXPECT_FLOAT_EQ(1.f, client.CurrentTopControlsShownRatio());
+
+ manager->UpdateTopControlsState(BOTH, HIDDEN, true);
+ EXPECT_TRUE(manager->has_animation());
+ EXPECT_FLOAT_EQ(1.f, client.CurrentTopControlsShownRatio());
+
+ manager->UpdateTopControlsState(BOTH, SHOWN, true);
+ EXPECT_FALSE(manager->has_animation());
+ EXPECT_FLOAT_EQ(1.f, client.CurrentTopControlsShownRatio());
+}
+
} // namespace
} // namespace cc
« no previous file with comments | « cc/input/top_controls_manager.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698