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

Side by Side Diff: cc/input/scrollbar_animation_controller_thinning_unittest.cc

Issue 2688503003: Add FadeOut delay animation to MouseLeave (Closed)
Patch Set: fix Created 3 years, 10 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 unified diff | Download patch
« no previous file with comments | « cc/input/scrollbar_animation_controller.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/input/scrollbar_animation_controller_thinning.h" 5 #include "cc/input/scrollbar_animation_controller_thinning.h"
6 6
7 #include "cc/layers/solid_color_scrollbar_layer_impl.h" 7 #include "cc/layers/solid_color_scrollbar_layer_impl.h"
8 #include "cc/test/fake_impl_task_runner_provider.h" 8 #include "cc/test/fake_impl_task_runner_provider.h"
9 #include "cc/test/fake_layer_tree_host_impl.h" 9 #include "cc/test/fake_layer_tree_host_impl.h"
10 #include "cc/test/geometry_test_utils.h" 10 #include "cc/test/geometry_test_utils.h"
(...skipping 928 matching lines...) Expand 10 before | Expand all | Expand 10 after
939 EXPECT_FLOAT_EQ(kIdleThicknessScale, 939 EXPECT_FLOAT_EQ(kIdleThicknessScale,
940 v_scrollbar_layer_->thumb_thickness_scale_factor()); 940 v_scrollbar_layer_->thumb_thickness_scale_factor());
941 EXPECT_FLOAT_EQ(kIdleThicknessScale, 941 EXPECT_FLOAT_EQ(kIdleThicknessScale,
942 h_scrollbar_layer_->thumb_thickness_scale_factor()); 942 h_scrollbar_layer_->thumb_thickness_scale_factor());
943 943
944 // An animation should have been enqueued. 944 // An animation should have been enqueued.
945 EXPECT_FALSE(client_.start_fade().is_null()); 945 EXPECT_FALSE(client_.start_fade().is_null());
946 EXPECT_EQ(kDelayBeforeStarting, client_.delay()); 946 EXPECT_EQ(kDelayBeforeStarting, client_.delay());
947 } 947 }
948 948
949 // 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
950 TEST_F(ScrollbarAnimationControllerThinningTest, MouseLeaveFadeOut) {
951 base::TimeTicks time;
952 time += base::TimeDelta::FromSeconds(1);
953
954 // Move mouse near scrollbar.
955 scrollbar_controller_->DidMouseMoveNear(VERTICAL, 1);
956
957 // Scroll to make the scrollbars visible.
958 scrollbar_controller_->DidScrollBegin();
959 scrollbar_controller_->DidScrollUpdate(false);
960 scrollbar_controller_->DidScrollEnd();
961
962 // Should not have delay fadeout animation.
963 EXPECT_TRUE(client_.start_fade().is_null() ||
964 client_.start_fade().IsCancelled());
965
966 // Mouse leave.
967 scrollbar_controller_->DidMouseLeave();
968
969 // An animation should have been enqueued.
970 EXPECT_FALSE(client_.start_fade().is_null());
971 EXPECT_EQ(kDelayBeforeStarting, client_.delay());
972 }
973
949 } // namespace 974 } // namespace
950 } // namespace cc 975 } // namespace cc
OLDNEW
« no previous file with comments | « cc/input/scrollbar_animation_controller.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698