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

Side by Side Diff: ui/views/animation/ink_drop_animation_controller_factory_unittest.cc

Issue 1832963002: MD - add ripples to DL shelf items (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix another TODO Created 4 years, 8 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 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 "base/macros.h" 5 #include "base/macros.h"
6 #include "base/memory/scoped_ptr.h" 6 #include "base/memory/scoped_ptr.h"
7 #include "base/test/test_mock_time_task_runner.h" 7 #include "base/test/test_mock_time_task_runner.h"
8 #include "base/thread_task_runner_handle.h" 8 #include "base/thread_task_runner_handle.h"
9 #include "base/timer/timer.h" 9 #include "base/timer/timer.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 EXPECT_EQ(0, test_ink_drop_host_.num_ink_drop_layers()); 103 EXPECT_EQ(0, test_ink_drop_host_.num_ink_drop_layers());
104 } 104 }
105 105
106 TEST_P(InkDropAnimationControllerFactoryTest, StateIsHiddenInitially) { 106 TEST_P(InkDropAnimationControllerFactoryTest, StateIsHiddenInitially) {
107 EXPECT_EQ(InkDropState::HIDDEN, 107 EXPECT_EQ(InkDropState::HIDDEN,
108 ink_drop_animation_controller_->GetTargetInkDropState()); 108 ink_drop_animation_controller_->GetTargetInkDropState());
109 } 109 }
110 110
111 TEST_P(InkDropAnimationControllerFactoryTest, TypicalQuickAction) { 111 TEST_P(InkDropAnimationControllerFactoryTest, TypicalQuickAction) {
112 ink_drop_animation_controller_->AnimateToState(InkDropState::ACTION_PENDING); 112 ink_drop_animation_controller_->AnimateToState(InkDropState::ACTION_PENDING);
113 ink_drop_animation_controller_->AnimateToState(InkDropState::QUICK_ACTION); 113 ink_drop_animation_controller_->AnimateToState(
114 InkDropState::ACTION_TRIGGERED);
114 EXPECT_EQ(InkDropState::HIDDEN, 115 EXPECT_EQ(InkDropState::HIDDEN,
115 ink_drop_animation_controller_->GetTargetInkDropState()); 116 ink_drop_animation_controller_->GetTargetInkDropState());
116 } 117 }
117 118
118 TEST_P(InkDropAnimationControllerFactoryTest, CancelQuickAction) { 119 TEST_P(InkDropAnimationControllerFactoryTest, CancelQuickAction) {
119 ink_drop_animation_controller_->AnimateToState(InkDropState::ACTION_PENDING); 120 ink_drop_animation_controller_->AnimateToState(InkDropState::ACTION_PENDING);
120 ink_drop_animation_controller_->AnimateToState(InkDropState::HIDDEN); 121 ink_drop_animation_controller_->AnimateToState(InkDropState::HIDDEN);
121 EXPECT_EQ(InkDropState::HIDDEN, 122 EXPECT_EQ(InkDropState::HIDDEN,
122 ink_drop_animation_controller_->GetTargetInkDropState()); 123 ink_drop_animation_controller_->GetTargetInkDropState());
123 } 124 }
124 125
125 TEST_P(InkDropAnimationControllerFactoryTest, TypicalSlowAction) { 126 TEST_P(InkDropAnimationControllerFactoryTest, TypicalSlowAction) {
126 ink_drop_animation_controller_->AnimateToState(InkDropState::ACTION_PENDING); 127 ink_drop_animation_controller_->AnimateToState(InkDropState::ACTION_PENDING);
127 ink_drop_animation_controller_->AnimateToState( 128 ink_drop_animation_controller_->AnimateToState(
128 InkDropState::SLOW_ACTION_PENDING); 129 InkDropState::ALTERNATE_ACTION_PENDING);
129 ink_drop_animation_controller_->AnimateToState(InkDropState::SLOW_ACTION); 130 ink_drop_animation_controller_->AnimateToState(
131 InkDropState::ALTERNATE_ACTION_TRIGGERED);
130 EXPECT_EQ(InkDropState::HIDDEN, 132 EXPECT_EQ(InkDropState::HIDDEN,
131 ink_drop_animation_controller_->GetTargetInkDropState()); 133 ink_drop_animation_controller_->GetTargetInkDropState());
132 } 134 }
133 135
134 TEST_P(InkDropAnimationControllerFactoryTest, CancelSlowAction) { 136 TEST_P(InkDropAnimationControllerFactoryTest, CancelSlowAction) {
135 ink_drop_animation_controller_->AnimateToState(InkDropState::ACTION_PENDING); 137 ink_drop_animation_controller_->AnimateToState(InkDropState::ACTION_PENDING);
136 ink_drop_animation_controller_->AnimateToState( 138 ink_drop_animation_controller_->AnimateToState(
137 InkDropState::SLOW_ACTION_PENDING); 139 InkDropState::ALTERNATE_ACTION_PENDING);
138 ink_drop_animation_controller_->AnimateToState(InkDropState::HIDDEN); 140 ink_drop_animation_controller_->AnimateToState(InkDropState::HIDDEN);
139 EXPECT_EQ(InkDropState::HIDDEN, 141 EXPECT_EQ(InkDropState::HIDDEN,
140 ink_drop_animation_controller_->GetTargetInkDropState()); 142 ink_drop_animation_controller_->GetTargetInkDropState());
141 } 143 }
142 144
143 TEST_P(InkDropAnimationControllerFactoryTest, TypicalQuickActivated) { 145 TEST_P(InkDropAnimationControllerFactoryTest, TypicalQuickActivated) {
144 ink_drop_animation_controller_->AnimateToState(InkDropState::ACTION_PENDING); 146 ink_drop_animation_controller_->AnimateToState(InkDropState::ACTION_PENDING);
145 ink_drop_animation_controller_->AnimateToState(InkDropState::ACTIVATED); 147 ink_drop_animation_controller_->AnimateToState(InkDropState::ACTIVATED);
146 ink_drop_animation_controller_->AnimateToState(InkDropState::DEACTIVATED); 148 ink_drop_animation_controller_->AnimateToState(InkDropState::DEACTIVATED);
147 EXPECT_EQ(InkDropState::HIDDEN, 149 EXPECT_EQ(InkDropState::HIDDEN,
148 ink_drop_animation_controller_->GetTargetInkDropState()); 150 ink_drop_animation_controller_->GetTargetInkDropState());
149 } 151 }
150 152
151 TEST_P(InkDropAnimationControllerFactoryTest, TypicalSlowActivated) { 153 TEST_P(InkDropAnimationControllerFactoryTest, TypicalSlowActivated) {
152 ink_drop_animation_controller_->AnimateToState(InkDropState::ACTION_PENDING); 154 ink_drop_animation_controller_->AnimateToState(InkDropState::ACTION_PENDING);
153 ink_drop_animation_controller_->AnimateToState( 155 ink_drop_animation_controller_->AnimateToState(
154 InkDropState::SLOW_ACTION_PENDING); 156 InkDropState::ALTERNATE_ACTION_PENDING);
155 ink_drop_animation_controller_->AnimateToState(InkDropState::ACTIVATED); 157 ink_drop_animation_controller_->AnimateToState(InkDropState::ACTIVATED);
156 ink_drop_animation_controller_->AnimateToState(InkDropState::DEACTIVATED); 158 ink_drop_animation_controller_->AnimateToState(InkDropState::DEACTIVATED);
157 EXPECT_EQ(InkDropState::HIDDEN, 159 EXPECT_EQ(InkDropState::HIDDEN,
158 ink_drop_animation_controller_->GetTargetInkDropState()); 160 ink_drop_animation_controller_->GetTargetInkDropState());
159 } 161 }
160 162
161 } // namespace views 163 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/animation/flood_fill_ink_drop_animation.cc ('k') | ui/views/animation/ink_drop_animation_controller_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698