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

Unified Diff: cc/input/scrollbar_animation_controller_thinning_unittest.cc

Issue 2345823003: Overlay scrollbars are painted onload. (Closed)
Patch Set: nit fixed. 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/scrollbar_animation_controller_thinning.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/input/scrollbar_animation_controller_thinning_unittest.cc
diff --git a/cc/input/scrollbar_animation_controller_thinning_unittest.cc b/cc/input/scrollbar_animation_controller_thinning_unittest.cc
index e1a1aa3cd53a5b79aafd9cd8c544d86f539232cf..c320cd919eca45d320c2898a2ed4afbce0655faf 100644
--- a/cc/input/scrollbar_animation_controller_thinning_unittest.cc
+++ b/cc/input/scrollbar_animation_controller_thinning_unittest.cc
@@ -97,6 +97,19 @@ TEST_F(ScrollbarAnimationControllerThinningTest, Idle) {
EXPECT_FLOAT_EQ(0.4f, scrollbar_layer_->thumb_thickness_scale_factor());
}
+// Check that scrollbar appears again, when the layer becomes scrollable.
+TEST_F(ScrollbarAnimationControllerThinningTest, AppearOnResize) {
+ scrollbar_controller_->DidScrollUpdate(false);
+ // Make the Layer non-scrollable, scrollbar disappears.
+ clip_layer_->SetBounds(gfx::Size(200, 200));
+ scrollbar_controller_->DidScrollUpdate(false);
+ EXPECT_FLOAT_EQ(0.0f, scrollbar_layer_->Opacity());
+ // Make the layer scrollable, scrollbar appears again.
+ clip_layer_->SetBounds(gfx::Size(100, 100));
+ scrollbar_controller_->DidScrollUpdate(false);
+ EXPECT_FLOAT_EQ(0.7f, scrollbar_layer_->Opacity());
+}
+
// Check that scrollbar disappears when the layer becomes non-scrollable.
TEST_F(ScrollbarAnimationControllerThinningTest, HideOnResize) {
LayerImpl* scroll_layer = host_impl_.active_tree()->LayerById(1);
« no previous file with comments | « cc/input/scrollbar_animation_controller_thinning.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698