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

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

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 #ifndef UI_VIEWS_ANIMATION_TEST_TEST_INK_DROP_RIPPLE_OBSERVER_H_ 5 #ifndef UI_VIEWS_ANIMATION_TEST_TEST_INK_DROP_RIPPLE_OBSERVER_H_
6 #define UI_VIEWS_ANIMATION_TEST_TEST_INK_DROP_RIPPLE_OBSERVER_H_ 6 #define UI_VIEWS_ANIMATION_TEST_TEST_INK_DROP_RIPPLE_OBSERVER_H_
7 7
8 #include "testing/gtest/include/gtest/gtest.h" 8 #include "testing/gtest/include/gtest/gtest.h"
9 #include "ui/views/animation/ink_drop_ripple_observer.h" 9 #include "ui/views/animation/ink_drop_ripple_observer.h"
10 #include "ui/views/animation/ink_drop_state.h" 10 #include "ui/views/animation/ink_drop_state.h"
(...skipping 18 matching lines...) Expand all
29 } 29 }
30 30
31 InkDropState target_state_at_last_animation_started() const { 31 InkDropState target_state_at_last_animation_started() const {
32 return target_state_at_last_animation_started_; 32 return target_state_at_last_animation_started_;
33 } 33 }
34 34
35 InkDropState target_state_at_last_animation_ended() const { 35 InkDropState target_state_at_last_animation_ended() const {
36 return target_state_at_last_animation_ended_; 36 return target_state_at_last_animation_ended_;
37 } 37 }
38 38
39 std::vector<InkDropState> GetAndResetAnimationStartedStates();
bruthig 2017/01/10 17:08:03 nit: Can these be pushed up into TestInkDropAnimat
mohsen 2017/01/10 22:28:16 Done.
40 std::vector<InkDropState> GetAndResetAnimationEndedStates();
41
39 // InkDropRippleObserver: 42 // InkDropRippleObserver:
40 void AnimationStarted(InkDropState ink_drop_state) override; 43 void AnimationStarted(InkDropState ink_drop_state) override;
41 void AnimationEnded(InkDropState ink_drop_state, 44 void AnimationEnded(InkDropState ink_drop_state,
42 InkDropAnimationEndedReason reason) override; 45 InkDropAnimationEndedReason reason) override;
43 46
44 private: 47 private:
45 // The type this inherits from. Reduces verbosity in .cc file. 48 // The type this inherits from. Reduces verbosity in .cc file.
46 using ObserverHelper = TestInkDropAnimationObserverHelper<InkDropState>; 49 using ObserverHelper = TestInkDropAnimationObserverHelper<InkDropState>;
47 50
51 // List of states for which animation is started since last reset.
52 std::vector<InkDropState> animation_started_states_;
53
54 // List of states for which animation is ended since last reset.
55 std::vector<InkDropState> animation_ended_states_;
56
48 // The value of InkDropRipple::GetTargetInkDropState() the last time an 57 // The value of InkDropRipple::GetTargetInkDropState() the last time an
49 // AnimationStarted() event was handled. This is only valid if 58 // AnimationStarted() event was handled. This is only valid if
50 // |ink_drop_ripple_| is not null. 59 // |ink_drop_ripple_| is not null.
51 InkDropState target_state_at_last_animation_started_; 60 InkDropState target_state_at_last_animation_started_;
52 61
53 // The value of InkDropRipple::GetTargetInkDropState() the last time an 62 // The value of InkDropRipple::GetTargetInkDropState() the last time an
54 // AnimationEnded() event was handled. This is only valid if 63 // AnimationEnded() event was handled. This is only valid if
55 // |ink_drop_ripple_| is not null. 64 // |ink_drop_ripple_| is not null.
56 InkDropState target_state_at_last_animation_ended_; 65 InkDropState target_state_at_last_animation_ended_;
57 66
58 // An InkDropRipple to spy info from when notifications are handled. 67 // An InkDropRipple to spy info from when notifications are handled.
59 InkDropRipple* ink_drop_ripple_; 68 InkDropRipple* ink_drop_ripple_;
60 69
61 DISALLOW_COPY_AND_ASSIGN(TestInkDropRippleObserver); 70 DISALLOW_COPY_AND_ASSIGN(TestInkDropRippleObserver);
62 }; 71 };
63 72
64 } // namespace test 73 } // namespace test
65 } // namespace views 74 } // namespace views
66 75
67 #endif // UI_VIEWS_ANIMATION_TEST_TEST_INK_DROP_RIPPLE_OBSERVER_H_ 76 #endif // UI_VIEWS_ANIMATION_TEST_TEST_INK_DROP_RIPPLE_OBSERVER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698