#include "ui/views/animation/ink_drop_impl.h"
#include <memory>
#include "base/functional/bind.h"
#include "base/test/gtest_util.h"
#include "base/test/task_environment.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/compositor/layer.h"
#include "ui/compositor/scoped_animation_duration_scale_mode.h"
#include "ui/gfx/animation/animation.h"
#include "ui/gfx/animation/animation_test_api.h"
#include "ui/native_theme/test_native_theme.h"
#include "ui/views/animation/ink_drop.h"
#include "ui/views/animation/ink_drop_ripple.h"
#include "ui/views/animation/test/ink_drop_impl_test_api.h"
#include "ui/views/animation/test/test_ink_drop_host.h"
#include "ui/views/test/views_test_base.h"
namespace views {
class InkDropImplTest : public ViewsTestBase { … };
class InkDropImplAutoHighlightTest
: public InkDropImplTest,
public testing::WithParamInterface<
testing::tuple<InkDropImpl::AutoHighlightMode>> { … };
InkDropImplAutoHighlightTest::InkDropImplAutoHighlightTest()
: … { … }
InkDropImplAutoHighlightTest::~InkDropImplAutoHighlightTest() = default;
TEST_F(InkDropImplTest, ShouldHighlight) { … }
TEST_F(InkDropImplTest,
VerifyInkDropLayersRemovedWhenPresentDuringDestruction) { … }
TEST_F(InkDropImplTest, AlwaysHiddenInkDropHasNoLayers) { … }
TEST_F(InkDropImplTest, LayersRemovedFromHostAfterHighlight) { … }
TEST_F(InkDropImplTest, LayersRemovedFromHostAfterInkDrop) { … }
TEST_F(InkDropImplTest, LayersArentRemovedWhenPreemptingFadeOut) { … }
TEST_F(InkDropImplTest,
SettingHighlightStateDuringStateExitIsntAllowedDeathTest) { … }
TEST_F(InkDropImplTest,
TearingDownHighlightStateThatAccessesTheStateFactoryIsSafe) { … }
TEST_F(InkDropImplTest, SuccessfulAnimationEndedDuringDestruction) { … }
TEST_F(InkDropImplTest, RippleAndHighlightRecreatedOnSizeChange) { … }
TEST_F(InkDropImplTest, RippleAndHighlightRecreatedOnHostThemeChange) { … }
TEST_F(InkDropImplTest, HostTracksHighlightState) { … }
InkDropImplCommonAutoHighlightTest;
INSTANTIATE_TEST_SUITE_P(…);
TEST_P(InkDropImplCommonAutoHighlightTest,
ShouldHighlightCausesHighlightToBeVisible) { … }
TEST_P(InkDropImplCommonAutoHighlightTest,
HighlightVisibilityForFocusAndHoverStates) { … }
InkDropImplNoAutoHighlightTest;
INSTANTIATE_TEST_SUITE_P(…);
TEST_P(InkDropImplNoAutoHighlightTest, VisibleHighlightDuringRippleAnimations) { … }
TEST_P(InkDropImplNoAutoHighlightTest, HiddenHighlightDuringRippleAnimations) { … }
InkDropImplHideAutoHighlightTest;
INSTANTIATE_TEST_SUITE_P(…);
TEST_P(InkDropImplHideAutoHighlightTest,
VisibleHighlightDuringRippleAnimations) { … }
TEST_P(InkDropImplHideAutoHighlightTest,
HiddenHighlightDuringRippleAnimations) { … }
TEST_P(InkDropImplHideAutoHighlightTest, HighlightIsHiddenOnSnapToActivated) { … }
TEST_P(InkDropImplHideAutoHighlightTest,
HighlightDoesntFadeInAfterAnimationIfHighlightNotSet) { … }
TEST_P(InkDropImplHideAutoHighlightTest,
HighlightFadesInAfterAnimationIfHovered) { … }
TEST_P(InkDropImplHideAutoHighlightTest,
HighlightSnapsInAfterAnimationWhenHostIsFocused) { … }
TEST_P(InkDropImplHideAutoHighlightTest, DeactivatedAnimatesWhenNotFocused) { … }
TEST_P(InkDropImplHideAutoHighlightTest,
DeactivatedAnimationSkippedWhenFocused) { … }
TEST_P(InkDropImplHideAutoHighlightTest,
FocusAndHoverChangesDontShowHighlightWhenRippleIsVisible) { … }
TEST_P(InkDropImplHideAutoHighlightTest, NoCrashDuringRippleTearDown) { … }
InkDropImplShowAutoHighlightTest;
INSTANTIATE_TEST_SUITE_P(…);
TEST_P(InkDropImplShowAutoHighlightTest,
VisibleHighlightDuringRippleAnimations) { … }
TEST_P(InkDropImplShowAutoHighlightTest,
HiddenHighlightDuringRippleAnimations) { … }
TEST_P(InkDropImplShowAutoHighlightTest,
FocusAndHoverChangesDontHideHighlightWhenRippleIsVisible) { … }
}