Chromium Code Reviews| 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); |