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

Unified Diff: cc/trees/layer_tree_host_impl_unittest.cc

Issue 2611013002: Show Overlay Scrollbar when GestureScrollUpdate (Closed)
Patch Set: ScrollingGestureUpdate should only effect Aura Overlay Scrollbar Created 3 years, 9 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
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 d271d40b131de04e2908229200b696e8ad110d9c..58206fe0146de71d604d2559ffb89db3326a3979 100644
--- a/cc/trees/layer_tree_host_impl_unittest.cc
+++ b/cc/trees/layer_tree_host_impl_unittest.cc
@@ -2810,6 +2810,8 @@ class LayerTreeHostImplTestScrollbarAnimation : public LayerTreeHostImplTest {
settings.scrollbar_animator = animator;
settings.scrollbar_show_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);
@@ -2843,6 +2845,25 @@ class LayerTreeHostImplTestScrollbarAnimation : public LayerTreeHostImplTest {
EXPECT_EQ(base::TimeDelta(), requested_animation_delay_);
EXPECT_TRUE(animation_task_.Equals(base::Closure()));
+ // For Aura Overlay Scrollbar, if no scroll happened during a scroll
+ // gesture, it appears scrollbars and schedules a delay fade out.
bokan 2017/03/09 15:57:58 nit: "it appears scrollbars and schedules" -> "sho
+ 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 (animator == LayerTreeSettings::AURA_OVERLAY) {
+ 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);
@@ -2950,7 +2971,9 @@ class LayerTreeHostImplTestScrollbarAnimation : public LayerTreeHostImplTest {
host_impl_->DidFinishImplFrame();
}
- // Scrollbar animation is not triggered unnecessarily.
+ // For Andrdoid, scrollbar animation is not triggered unnecessarily.
+ // For Aura Overlay Scrollbar, scrollbar appears even scroll offset not
bokan 2017/03/09 15:57:58 nit: "even scroll offset not change" -> "even if s
+ // change.
host_impl_->ScrollBegin(BeginState(gfx::Point()).get(),
InputHandler::WHEEL);
host_impl_->ScrollBy(UpdateState(gfx::Point(), gfx::Vector2dF(5, 0)).get());
@@ -2963,8 +2986,16 @@ 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 (animator == LayerTreeSettings::AURA_OVERLAY) {
+ 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);

Powered by Google App Engine
This is Rietveld 408576698