Chromium Code Reviews| Index: ui/views/animation/ink_drop_ripple_unittest.cc |
| diff --git a/ui/views/animation/ink_drop_ripple_unittest.cc b/ui/views/animation/ink_drop_ripple_unittest.cc |
| index add5baf5dae7062f88589f384cdc5f34e0d14f49..1e243964791e2e22fdf8a31b670ed0868ce8117a 100644 |
| --- a/ui/views/animation/ink_drop_ripple_unittest.cc |
| +++ b/ui/views/animation/ink_drop_ripple_unittest.cc |
| @@ -21,6 +21,19 @@ |
| namespace views { |
| namespace test { |
| +namespace { |
| + |
| +std::string InkDropStatesToString(const std::vector<InkDropState>& states) { |
| + std::string result; |
| + for (size_t i = 0; i < states.size(); i++) { |
| + if (i) |
| + result += " "; |
| + result += ToString(states[i]); |
| + } |
| + return result; |
| +} |
| + |
| +} |
| const float kVisibleOpacity = 0.175f; |
| @@ -358,5 +371,19 @@ TEST_P(InkDropRippleTest, TargetInkDropStateOnAnimationEnded) { |
| observer_.target_state_at_last_animation_ended()); |
| } |
| +// Verifies that when an we ink drop transitions from ACTION_PENDING to |
| +// ACTIVATED state, animation observers are called in order. |
| +TEST_P(InkDropRippleTest, RipplePendingToActivatedObserverOrder) { |
| + ink_drop_ripple_->AnimateToState(views::InkDropState::ACTION_PENDING); |
| + ink_drop_ripple_->AnimateToState(views::InkDropState::ACTIVATED); |
| + test_api_->CompleteAnimations(); |
| + |
| + EXPECT_EQ( |
| + "ACTION_PENDING ACTIVATED", |
|
bruthig
2017/01/10 17:08:03
How come you are building concatenated strings her
mohsen
2017/01/10 22:28:16
Yeah, I also prefer gmock matchers, but gmock is f
bruthig
2017/01/11 00:41:07
Hmm that's unfortunate. Is that documented somewh
mohsen
2017/01/11 15:59:44
It is explicitly banned in ui/views/DEPS file (see
bruthig
2017/01/11 18:22:30
Thx
|
| + InkDropStatesToString(observer_.GetAndResetAnimationStartedStates())); |
| + EXPECT_EQ("ACTION_PENDING ACTIVATED", |
| + InkDropStatesToString(observer_.GetAndResetAnimationEndedStates())); |
| +} |
| + |
| } // namespace test |
| } // namespace views |