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 384dbf244b096b98179faadbf722f162e1aa54f0..d240b4bfecafdadb87b4bbdc356be05b9faa1847 100644 |
| --- a/cc/input/scrollbar_animation_controller_thinning_unittest.cc |
| +++ b/cc/input/scrollbar_animation_controller_thinning_unittest.cc |
| @@ -946,5 +946,30 @@ TEST_F(ScrollbarAnimationControllerThinningTest, |
| EXPECT_EQ(kDelayBeforeStarting, client_.delay()); |
| } |
| +// Ensure we have a delay fadeout animation after mouse leave. |
|
bokan
2017/02/10 15:50:58
The key is there's a mouse leave without a mouse m
|
| +TEST_F(ScrollbarAnimationControllerThinningTest, MouseLeaveFadeOut) { |
| + base::TimeTicks time; |
| + time += base::TimeDelta::FromSeconds(1); |
| + |
| + // Move mouse near scrollbar. |
| + scrollbar_controller_->DidMouseMoveNear(VERTICAL, 1); |
| + |
| + // Scroll to make the scrollbars visible. |
| + scrollbar_controller_->DidScrollBegin(); |
| + scrollbar_controller_->DidScrollUpdate(false); |
| + scrollbar_controller_->DidScrollEnd(); |
| + |
| + // Should not have delay fadeout animation. |
| + EXPECT_TRUE(client_.start_fade().is_null() || |
| + client_.start_fade().IsCancelled()); |
| + |
| + // Mouse leave. |
| + scrollbar_controller_->DidMouseLeave(); |
| + |
| + // An animation should have been enqueued. |
| + EXPECT_FALSE(client_.start_fade().is_null()); |
| + EXPECT_EQ(kDelayBeforeStarting, client_.delay()); |
| +} |
| + |
| } // namespace |
| } // namespace cc |