Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1303)

Side by Side Diff: ui/views/animation/test/test_ink_drop_ripple_observer.cc

Issue 2615613003: Fix double ripple on activated flood fill ripple (Closed)
Patch Set: Added tests Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/test/test_ink_drop_ripple_observer.h" 5 #include "ui/views/animation/test/test_ink_drop_ripple_observer.h"
6 6
7 #include "ui/views/animation/ink_drop_ripple.h" 7 #include "ui/views/animation/ink_drop_ripple.h"
8 8
9 namespace views { 9 namespace views {
10 namespace test { 10 namespace test {
11 11
12 TestInkDropRippleObserver::TestInkDropRippleObserver() 12 TestInkDropRippleObserver::TestInkDropRippleObserver()
13 : target_state_at_last_animation_started_(InkDropState::HIDDEN), 13 : target_state_at_last_animation_started_(InkDropState::HIDDEN),
14 target_state_at_last_animation_ended_(InkDropState::HIDDEN) {} 14 target_state_at_last_animation_ended_(InkDropState::HIDDEN) {}
15 15
16 TestInkDropRippleObserver::~TestInkDropRippleObserver() {} 16 TestInkDropRippleObserver::~TestInkDropRippleObserver() {}
17 17
18 std::vector<InkDropState>
19 TestInkDropRippleObserver::GetAndResetAnimationStartedStates() {
20 std::vector<InkDropState> started_states;
21 started_states.swap(animation_started_states_);
22 return started_states;
23 }
24
25 std::vector<InkDropState>
26 TestInkDropRippleObserver::GetAndResetAnimationEndedStates() {
27 std::vector<InkDropState> ended_states;
28 ended_states.swap(animation_ended_states_);
29 return ended_states;
30 }
31
18 void TestInkDropRippleObserver::AnimationStarted(InkDropState ink_drop_state) { 32 void TestInkDropRippleObserver::AnimationStarted(InkDropState ink_drop_state) {
19 ObserverHelper::OnAnimationStarted(ink_drop_state); 33 ObserverHelper::OnAnimationStarted(ink_drop_state);
34 animation_started_states_.push_back(ink_drop_state);
20 if (ink_drop_ripple_) { 35 if (ink_drop_ripple_) {
21 target_state_at_last_animation_started_ = 36 target_state_at_last_animation_started_ =
22 ink_drop_ripple_->target_ink_drop_state(); 37 ink_drop_ripple_->target_ink_drop_state();
23 } 38 }
24 } 39 }
25 40
26 void TestInkDropRippleObserver::AnimationEnded( 41 void TestInkDropRippleObserver::AnimationEnded(
27 InkDropState ink_drop_state, 42 InkDropState ink_drop_state,
28 InkDropAnimationEndedReason reason) { 43 InkDropAnimationEndedReason reason) {
29 ObserverHelper::OnAnimationEnded(ink_drop_state, reason); 44 ObserverHelper::OnAnimationEnded(ink_drop_state, reason);
45 animation_ended_states_.push_back(ink_drop_state);
30 if (ink_drop_ripple_) { 46 if (ink_drop_ripple_) {
31 target_state_at_last_animation_ended_ = 47 target_state_at_last_animation_ended_ =
32 ink_drop_ripple_->target_ink_drop_state(); 48 ink_drop_ripple_->target_ink_drop_state();
33 } 49 }
34 } 50 }
35 51
36 } // namespace test 52 } // namespace test
37 } // namespace views 53 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698