#include "cc/input/scrollbar_animation_controller.h"
#include <utility>
#include "base/memory/raw_ptr.h"
#include "base/time/time.h"
#include "cc/layers/solid_color_scrollbar_layer_impl.h"
#include "cc/test/layer_tree_impl_test_base.h"
#include "cc/trees/layer_tree_impl.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
_;
AtLeast;
Bool;
Mock;
NiceMock;
namespace cc {
namespace {
const float kIdleThicknessScale = …;
const int kThumbThickness = …;
class MockScrollbarAnimationControllerClient
: public ScrollbarAnimationControllerClient { … };
class ScrollbarAnimationControllerOverlayTest
: public LayerTreeImplTestBase,
public testing::Test,
public testing::WithParamInterface<bool> { … };
class ScrollbarAnimationControllerAuraOverlayTest
: public ScrollbarAnimationControllerOverlayTest { … };
class ScrollbarAnimationControllerFluentOverlayTest
: public ScrollbarAnimationControllerOverlayTest { … };
TEST_P(ScrollbarAnimationControllerOverlayTest, Idle) { … }
TEST_P(ScrollbarAnimationControllerOverlayTest, AppearOnResize) { … }
TEST_P(ScrollbarAnimationControllerOverlayTest, HideOnResize) { … }
TEST_P(ScrollbarAnimationControllerOverlayTest, BasicAppearAndFadeOut) { … }
TEST_P(ScrollbarAnimationControllerOverlayTest,
BasicAppearByWillUpdateScrollThenFadeOut) { … }
TEST_F(ScrollbarAnimationControllerAuraOverlayTest,
MoveNearTrackThenNearThumb) { … }
TEST_F(ScrollbarAnimationControllerAuraOverlayTest, MoveNearAndDontFadeOut) { … }
TEST_P(ScrollbarAnimationControllerOverlayTest, MoveOverAndDontFadeOut) { … }
TEST_P(ScrollbarAnimationControllerOverlayTest,
DontFadeWhileCapturedBeforeThick) { … }
TEST_P(ScrollbarAnimationControllerOverlayTest, DontFadeWhileCapturedThenAway) { … }
TEST_P(ScrollbarAnimationControllerOverlayTest, DontFadeWhileCaptured) { … }
TEST_P(ScrollbarAnimationControllerOverlayTest, FadeAfterReleasedFar) { … }
TEST_P(ScrollbarAnimationControllerOverlayTest, DontFadeAfterReleasedNear) { … }
TEST_P(ScrollbarAnimationControllerOverlayTest, MoveNearScrollbarWhileFading) { … }
TEST_F(ScrollbarAnimationControllerAuraOverlayTest, TestCantCaptureWhenFaded) { … }
TEST_F(ScrollbarAnimationControllerAuraOverlayTest, ScrollWithMouseNear) { … }
TEST_P(ScrollbarAnimationControllerOverlayTest, MainThreadScrollQueuesFade) { … }
TEST_P(ScrollbarAnimationControllerOverlayTest, FadeAnimated) { … }
TEST_P(ScrollbarAnimationControllerOverlayTest, NotifyChangedVisibility) { … }
TEST_F(ScrollbarAnimationControllerAuraOverlayTest, MouseNearEach) { … }
TEST_F(ScrollbarAnimationControllerAuraOverlayTest, MouseNearBoth) { … }
TEST_P(ScrollbarAnimationControllerOverlayTest,
MouseNearOtherBeforeAnimationFinished) { … }
TEST_P(ScrollbarAnimationControllerOverlayTest, MouseLeaveFadeOut) { … }
TEST_F(ScrollbarAnimationControllerAuraOverlayTest, BasicMouseHoverFadeIn) { … }
TEST_F(ScrollbarAnimationControllerAuraOverlayTest,
MouseHoverScrollbarAndMoveInside) { … }
TEST_F(ScrollbarAnimationControllerAuraOverlayTest,
MouseHoverThenOutShouldCancelFadeIn) { … }
TEST_F(ScrollbarAnimationControllerAuraOverlayTest,
MouseHoverThenLeaveShouldCancelShowThenEnterShouldFadeIn) { … }
TEST_F(ScrollbarAnimationControllerAuraOverlayTest,
MouseHoverThenMouseDownShouldCancelFadeInThenReleaseNearShouldFadeIn) { … }
TEST_F(ScrollbarAnimationControllerAuraOverlayTest,
MouseReleaseFarShouldNotFadeIn) { … }
TEST_P(ScrollbarAnimationControllerOverlayTest, TickmarksShowHide) { … }
TEST_F(ScrollbarAnimationControllerFluentOverlayTest,
DidMouseMoveWithVisibleScrollbarQueuesAnimations) { … }
TEST_F(ScrollbarAnimationControllerFluentOverlayTest,
DidMouseMoveWithHiddenScrollbarRemainsHidden) { … }
TEST_F(ScrollbarAnimationControllerFluentOverlayTest,
ScrollAndMouseOverGoesToFullMode) { … }
TEST_F(ScrollbarAnimationControllerFluentOverlayTest, FadeWhenMouseLeaves) { … }
TEST_F(ScrollbarAnimationControllerFluentOverlayTest,
HidesWhenReleasedOutsideArea) { … }
class ScrollbarAnimationControllerAndroidTest
: public LayerTreeImplTestBase,
public testing::Test,
public ScrollbarAnimationControllerClient { … };
class VerticalScrollbarAnimationControllerAndroidTest
: public ScrollbarAnimationControllerAndroidTest { … };
TEST_F(ScrollbarAnimationControllerAndroidTest, HiddenInBegin) { … }
TEST_F(ScrollbarAnimationControllerAndroidTest,
HiddenAfterNonScrollingGesture) { … }
TEST_F(ScrollbarAnimationControllerAndroidTest,
WillUpdateScrollNotAppearScrollbar) { … }
TEST_F(ScrollbarAnimationControllerAndroidTest, HideOnResize) { … }
TEST_F(VerticalScrollbarAnimationControllerAndroidTest, HideOnResize) { … }
TEST_F(ScrollbarAnimationControllerAndroidTest, HideOnUserNonScrollableHorz) { … }
TEST_F(ScrollbarAnimationControllerAndroidTest, ShowOnUserNonScrollableVert) { … }
TEST_F(VerticalScrollbarAnimationControllerAndroidTest,
HideOnUserNonScrollableVert) { … }
TEST_F(VerticalScrollbarAnimationControllerAndroidTest,
ShowOnUserNonScrollableHorz) { … }
TEST_F(ScrollbarAnimationControllerAndroidTest, AwakenByScrollingGesture) { … }
TEST_F(ScrollbarAnimationControllerAndroidTest, AwakenByProgrammaticScroll) { … }
TEST_F(ScrollbarAnimationControllerAndroidTest,
AnimationPreservedByNonScrollingGesture) { … }
TEST_F(ScrollbarAnimationControllerAndroidTest,
AnimationOverriddenByScrollingGesture) { … }
INSTANTIATE_TEST_SUITE_P(…);
}
}