| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "ui/views/animation/ink_drop_ripple.h" | 5 #include "ui/views/animation/ink_drop_ripple.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
| (...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 351 | 351 |
| 352 ink_drop_ripple_->AnimateToState(views::InkDropState::HIDDEN); | 352 ink_drop_ripple_->AnimateToState(views::InkDropState::HIDDEN); |
| 353 | 353 |
| 354 test_api_->CompleteAnimations(); | 354 test_api_->CompleteAnimations(); |
| 355 | 355 |
| 356 EXPECT_TRUE(observer_.AnimationHasEnded()); | 356 EXPECT_TRUE(observer_.AnimationHasEnded()); |
| 357 EXPECT_EQ(views::InkDropState::HIDDEN, | 357 EXPECT_EQ(views::InkDropState::HIDDEN, |
| 358 observer_.target_state_at_last_animation_ended()); | 358 observer_.target_state_at_last_animation_ended()); |
| 359 } | 359 } |
| 360 | 360 |
| 361 // Verifies that when an we ink drop transitions from ACTION_PENDING to |
| 362 // ACTIVATED state, animation observers are called in order. |
| 363 TEST_P(InkDropRippleTest, RipplePendingToActivatedObserverOrder) { |
| 364 ink_drop_ripple_->AnimateToState(InkDropState::ACTION_PENDING); |
| 365 ink_drop_ripple_->AnimateToState(InkDropState::ACTIVATED); |
| 366 test_api_->CompleteAnimations(); |
| 367 |
| 368 EXPECT_TRUE(observer_.AnimationStartedContextsMatch( |
| 369 {InkDropState::ACTION_PENDING, InkDropState::ACTIVATED})); |
| 370 EXPECT_TRUE(observer_.AnimationEndedContextsMatch( |
| 371 {InkDropState::ACTION_PENDING, InkDropState::ACTIVATED})); |
| 372 } |
| 373 |
| 361 } // namespace test | 374 } // namespace test |
| 362 } // namespace views | 375 } // namespace views |
| OLD | NEW |