Index: cc/trees/layer_tree_host_impl_unittest.cc |
diff --git a/cc/trees/layer_tree_host_impl_unittest.cc b/cc/trees/layer_tree_host_impl_unittest.cc |
index 9363993b1b235d12e33e6e6a4e73e4fe502fc9df..193ac57768176005dc5bc21ad78800b5764796ed 100644 |
--- a/cc/trees/layer_tree_host_impl_unittest.cc |
+++ b/cc/trees/layer_tree_host_impl_unittest.cc |
@@ -2737,6 +2737,8 @@ class LayerTreeHostImplTestScrollbarAnimation : public LayerTreeHostImplTest { |
settings.scrollbar_animator = animator; |
settings.scrollbar_fade_in_delay = base::TimeDelta::FromMilliseconds(20); |
settings.scrollbar_fade_out_delay = base::TimeDelta::FromMilliseconds(20); |
+ settings.scrollbar_fade_out_resize_delay = |
+ base::TimeDelta::FromMilliseconds(20); |
settings.scrollbar_fade_out_duration = |
base::TimeDelta::FromMilliseconds(20); |
@@ -2770,6 +2772,25 @@ class LayerTreeHostImplTestScrollbarAnimation : public LayerTreeHostImplTest { |
EXPECT_EQ(base::TimeDelta(), requested_animation_delay_); |
EXPECT_TRUE(animation_task_.Equals(base::Closure())); |
+ // If no scroll happened during a scroll gesture, it fades in scrollbars and |
+ // schedules a delay fade out. |
+ host_impl_->ScrollBegin(BeginState(gfx::Point()).get(), |
+ InputHandler::WHEEL); |
+ host_impl_->ScrollBy(UpdateState(gfx::Point(), gfx::Vector2dF(0, 0)).get()); |
+ host_impl_->ScrollEnd(EndState().get()); |
+ EXPECT_FALSE(did_request_next_frame_); |
+ EXPECT_FALSE(did_request_redraw_); |
+ if (expecting_animations) { |
+ EXPECT_EQ(base::TimeDelta::FromMilliseconds(20), |
+ requested_animation_delay_); |
+ EXPECT_FALSE(animation_task_.Equals(base::Closure())); |
+ requested_animation_delay_ = base::TimeDelta(); |
+ animation_task_ = base::Closure(); |
+ } else { |
+ EXPECT_EQ(base::TimeDelta(), requested_animation_delay_); |
+ EXPECT_TRUE(animation_task_.Equals(base::Closure())); |
+ } |
+ |
// Before the scrollbar animation exists, we should not get redraws. |
BeginFrameArgs begin_frame_args = |
CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE, 0, 2, fake_now); |
@@ -2890,8 +2911,17 @@ class LayerTreeHostImplTestScrollbarAnimation : public LayerTreeHostImplTest { |
host_impl_->ScrollEnd(EndState().get()); |
EXPECT_FALSE(did_request_next_frame_); |
EXPECT_FALSE(did_request_redraw_); |
- EXPECT_EQ(base::TimeDelta(), requested_animation_delay_); |
- EXPECT_TRUE(animation_task_.Equals(base::Closure())); |
+ |
+ if (expecting_animations) { |
+ EXPECT_EQ(base::TimeDelta::FromMilliseconds(20), |
+ requested_animation_delay_); |
+ EXPECT_FALSE(animation_task_.Equals(base::Closure())); |
+ requested_animation_delay_ = base::TimeDelta(); |
+ animation_task_ = base::Closure(); |
+ } else { |
+ EXPECT_EQ(base::TimeDelta(), requested_animation_delay_); |
+ EXPECT_TRUE(animation_task_.Equals(base::Closure())); |
+ } |
// Changing page scale triggers scrollbar animation. |
host_impl_->active_tree()->PushPageScaleFromMainThread(1.f, 1.f, 4.f); |
@@ -3926,9 +3956,7 @@ class LayerTreeHostImplBrowserControlsTest : public LayerTreeHostImplTest { |
LayerTreeHostImplBrowserControlsTest() |
// Make the clip size the same as the layer (content) size so the layer is |
// non-scrollable. |
- : layer_size_(10, 10), |
- clip_size_(layer_size_), |
- top_controls_height_(50) { |
+ : layer_size_(10, 10), clip_size_(layer_size_), top_controls_height_(50) { |
viewport_size_ = gfx::Size(clip_size_.width(), |
clip_size_.height() + top_controls_height_); |
} |