| Index: ui/views/animation/test/test_ink_drop_animation_observer.cc
|
| diff --git a/ui/views/animation/test/test_ink_drop_animation_observer.cc b/ui/views/animation/test/test_ink_drop_animation_observer.cc
|
| index 0dd5a7791af9878ae9c63578a5b051e1e2dd27fb..8b35faab2ae57713e631db0861a30e7ed7146638 100644
|
| --- a/ui/views/animation/test/test_ink_drop_animation_observer.cc
|
| +++ b/ui/views/animation/test/test_ink_drop_animation_observer.cc
|
| @@ -10,75 +10,29 @@ namespace views {
|
| namespace test {
|
|
|
| TestInkDropAnimationObserver::TestInkDropAnimationObserver()
|
| - : last_animation_started_ordinal_(-1),
|
| - last_animation_ended_ordinal_(-1),
|
| - last_animation_state_started_(InkDropState::HIDDEN),
|
| - last_animation_state_ended_(InkDropState::HIDDEN),
|
| - last_animation_ended_reason_(InkDropAnimationEndedReason::SUCCESS),
|
| - target_state_at_last_animation_started_(InkDropState::HIDDEN),
|
| + : target_state_at_last_animation_started_(InkDropState::HIDDEN),
|
| target_state_at_last_animation_ended_(InkDropState::HIDDEN) {}
|
|
|
| TestInkDropAnimationObserver::~TestInkDropAnimationObserver() {}
|
|
|
| -testing::AssertionResult TestInkDropAnimationObserver::AnimationHasStarted() {
|
| - if (last_animation_started_ordinal() > 0) {
|
| - return testing::AssertionSuccess() << "Animations were started at ordinal="
|
| - << last_animation_started_ordinal()
|
| - << ".";
|
| - }
|
| - return testing::AssertionFailure() << "Animations have not started.";
|
| -}
|
| -
|
| -testing::AssertionResult
|
| -TestInkDropAnimationObserver::AnimationHasNotStarted() {
|
| - if (last_animation_started_ordinal() < 0)
|
| - return testing::AssertionSuccess();
|
| - return testing::AssertionFailure() << "Animations were started at ordinal="
|
| - << last_animation_started_ordinal() << ".";
|
| -}
|
| -
|
| -testing::AssertionResult TestInkDropAnimationObserver::AnimationHasEnded() {
|
| - if (last_animation_ended_ordinal() > 0) {
|
| - return testing::AssertionSuccess() << "Animations were ended at ordinal="
|
| - << last_animation_ended_ordinal() << ".";
|
| - }
|
| - return testing::AssertionFailure() << "Animations have not ended.";
|
| -}
|
| -
|
| -testing::AssertionResult TestInkDropAnimationObserver::AnimationHasNotEnded() {
|
| - if (last_animation_ended_ordinal() < 0)
|
| - return testing::AssertionSuccess();
|
| - return testing::AssertionFailure() << "Animations were ended at ordinal="
|
| - << last_animation_ended_ordinal() << ".";
|
| -}
|
| -
|
| -void TestInkDropAnimationObserver::InkDropAnimationStarted(
|
| +void TestInkDropAnimationObserver::AnimationStarted(
|
| InkDropState ink_drop_state) {
|
| - last_animation_started_ordinal_ = GetNextOrdinal();
|
| - last_animation_state_started_ = ink_drop_state;
|
| + ObserverHelper::OnAnimationStarted(ink_drop_state);
|
| if (ink_drop_animation_) {
|
| target_state_at_last_animation_started_ =
|
| ink_drop_animation_->target_ink_drop_state();
|
| }
|
| }
|
|
|
| -void TestInkDropAnimationObserver::InkDropAnimationEnded(
|
| +void TestInkDropAnimationObserver::AnimationEnded(
|
| InkDropState ink_drop_state,
|
| InkDropAnimationEndedReason reason) {
|
| - last_animation_ended_ordinal_ = GetNextOrdinal();
|
| - last_animation_state_ended_ = ink_drop_state;
|
| - last_animation_ended_reason_ = reason;
|
| + ObserverHelper::OnAnimationEnded(ink_drop_state, reason);
|
| if (ink_drop_animation_) {
|
| target_state_at_last_animation_ended_ =
|
| ink_drop_animation_->target_ink_drop_state();
|
| }
|
| }
|
|
|
| -int TestInkDropAnimationObserver::GetNextOrdinal() const {
|
| - return std::max(1, std::max(last_animation_started_ordinal_,
|
| - last_animation_ended_ordinal_) +
|
| - 1);
|
| -}
|
| -
|
| } // namespace test
|
| } // namespace views
|
|
|