| 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 4824879f67af4f5436a0429e4bdf336051a84d3c..64096b7eae0e9581e152ef81d1602125be795b59 100644
|
| --- a/cc/input/scrollbar_animation_controller_thinning_unittest.cc
|
| +++ b/cc/input/scrollbar_animation_controller_thinning_unittest.cc
|
| @@ -518,5 +518,40 @@ TEST_F(ScrollbarAnimationControllerThinningTest, MouseCaptureAndReleaseOnBar) {
|
| }
|
| }
|
|
|
| +// Move mouse on scrollbar and capture then move out of window. Confirm that
|
| +// the bar stays thick and dark.
|
| +TEST_F(ScrollbarAnimationControllerThinningTest,
|
| + MouseCapturedAndExitWindowFromScrollbar) {
|
| + base::TimeTicks time;
|
| + time += base::TimeDelta::FromSeconds(1);
|
| +
|
| + // Move in
|
| + scrollbar_controller_->DidMouseMoveNear(0);
|
| +
|
| + scrollbar_controller_->Animate(time);
|
| + time += base::TimeDelta::FromSeconds(kDuration);
|
| + scrollbar_controller_->Animate(time);
|
| + EXPECT_FLOAT_EQ(1.0f, scrollbar_layer_->Opacity());
|
| + EXPECT_FLOAT_EQ(1.0f, scrollbar_layer_->thumb_thickness_scale_factor());
|
| +
|
| + // Capture
|
| + scrollbar_controller_->DidCaptureScrollbarBegin();
|
| + time += base::TimeDelta::FromSeconds(1);
|
| + scrollbar_controller_->Animate(time);
|
| + EXPECT_FLOAT_EQ(1.0f, scrollbar_layer_->Opacity());
|
| + EXPECT_FLOAT_EQ(1.0f, scrollbar_layer_->thumb_thickness_scale_factor());
|
| +
|
| + // move out of window
|
| + scrollbar_controller_->DidMouseMoveOffScrollbar();
|
| +
|
| + // test for 10 seconds, stay thick and dark
|
| + for (int i = 0; i < 10; ++i) {
|
| + time += base::TimeDelta::FromSeconds(1);
|
| + scrollbar_controller_->Animate(time);
|
| + EXPECT_FLOAT_EQ(1.0f, scrollbar_layer_->Opacity());
|
| + EXPECT_FLOAT_EQ(1.0f, scrollbar_layer_->thumb_thickness_scale_factor());
|
| + }
|
| +}
|
| +
|
| } // namespace
|
| } // namespace cc
|
|
|