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

Unified Diff: cc/input/scrollbar_animation_controller_thinning_unittest.cc

Issue 2345823003: Overlay scrollbars are painted onload. (Closed)
Patch Set: unittest added 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..df1adbf666e05bfb0259189a1ef72cf7fb12d36a 100644
--- a/cc/input/scrollbar_animation_controller_thinning_unittest.cc
+++ b/cc/input/scrollbar_animation_controller_thinning_unittest.cc
@@ -67,6 +67,7 @@ class ScrollbarAnimationControllerThinningTest
scrollbar_layer_->SetScrollLayerId(scroll_layer_ptr->id());
scrollbar_layer_->test_properties()->opacity_can_animate = true;
+
bokan 2016/09/23 20:15:17 Nit: spurious new line
clip_layer_->SetBounds(gfx::Size(100, 100));
scroll_layer_ptr->SetBounds(gfx::Size(200, 200));
host_impl_.active_tree()->BuildLayerListAndPropertyTreesForTesting();
@@ -97,6 +98,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);
bokan 2016/09/23 20:15:18 DidScrollUpdate gets called when we scroll though,
sahel 2016/09/23 20:25:11 It get's called when we are scrolling, AND during
bokan 2016/09/23 20:26:03 Got it. Thanks!
+ 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