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 #ifndef UI_VIEWS_ANIMATION_INK_DROP_ANIMATION_CONTROLLER_FACTORY_UNITTEST_H_ | 5 #ifndef UI_VIEWS_ANIMATION_INK_DROP_ANIMATION_CONTROLLER_FACTORY_UNITTEST_H_ |
6 #define UI_VIEWS_ANIMATION_INK_DROP_ANIMATION_CONTROLLER_FACTORY_UNITTEST_H_ | 6 #define UI_VIEWS_ANIMATION_INK_DROP_ANIMATION_CONTROLLER_FACTORY_UNITTEST_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 private: | 72 private: |
73 DISALLOW_COPY_AND_ASSIGN(MDInkDropAnimationControllerFactoryTest); | 73 DISALLOW_COPY_AND_ASSIGN(MDInkDropAnimationControllerFactoryTest); |
74 }; | 74 }; |
75 | 75 |
76 void MDInkDropAnimationControllerFactoryTest::SetUp() { | 76 void MDInkDropAnimationControllerFactoryTest::SetUp() { |
77 ui::test::MaterialDesignControllerTestAPI::SetMode( | 77 ui::test::MaterialDesignControllerTestAPI::SetMode( |
78 ui::MaterialDesignController::MATERIAL_NORMAL); | 78 ui::MaterialDesignController::MATERIAL_NORMAL); |
79 InkDropAnimationControllerFactoryTest::SetUp(); | 79 InkDropAnimationControllerFactoryTest::SetUp(); |
80 } | 80 } |
81 | 81 |
82 TEST_ALL_INK_DROPS(StateIsHiddenInitially, | 82 TEST_ALL_INK_DROPS(InitialState, |
83 { | 83 { |
| 84 EXPECT_FALSE(ink_drop_animation_controller_->IsHovered()); |
84 EXPECT_EQ( | 85 EXPECT_EQ( |
85 InkDropState::HIDDEN, | 86 InkDropState::HIDDEN, |
86 ink_drop_animation_controller_->GetInkDropState()); | 87 ink_drop_animation_controller_->GetInkDropState()); |
87 }) | 88 }) |
88 | 89 |
| 90 TEST_ALL_INK_DROPS(SetHovered, |
| 91 { |
| 92 ink_drop_animation_controller_->SetHovered(true); |
| 93 EXPECT_TRUE(ink_drop_animation_controller_->IsHovered()); |
| 94 |
| 95 ink_drop_animation_controller_->SetHovered(false); |
| 96 EXPECT_FALSE(ink_drop_animation_controller_->IsHovered()); |
| 97 }) |
| 98 |
| 99 TEST_ALL_INK_DROPS(HoveredStateAfterAnimateToState, |
| 100 { |
| 101 ink_drop_animation_controller_->SetHovered(true); |
| 102 ink_drop_animation_controller_->AnimateToState( |
| 103 InkDropState::QUICK_ACTION); |
| 104 |
| 105 EXPECT_TRUE(ink_drop_animation_controller_->IsHovered()); |
| 106 }) |
| 107 |
89 TEST_ALL_INK_DROPS(TypicalQuickAction, | 108 TEST_ALL_INK_DROPS(TypicalQuickAction, |
90 { | 109 { |
91 ink_drop_animation_controller_->AnimateToState( | 110 ink_drop_animation_controller_->AnimateToState( |
92 InkDropState::ACTION_PENDING); | 111 InkDropState::ACTION_PENDING); |
93 ink_drop_animation_controller_->AnimateToState( | 112 ink_drop_animation_controller_->AnimateToState( |
94 InkDropState::QUICK_ACTION); | 113 InkDropState::QUICK_ACTION); |
95 EXPECT_EQ( | 114 EXPECT_EQ( |
96 InkDropState::HIDDEN, | 115 InkDropState::HIDDEN, |
97 ink_drop_animation_controller_->GetInkDropState()); | 116 ink_drop_animation_controller_->GetInkDropState()); |
98 }) | 117 }) |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 InkDropState::SLOW_ACTION_PENDING); | 173 InkDropState::SLOW_ACTION_PENDING); |
155 ink_drop_animation_controller_->AnimateToState(InkDropState::ACTIVATED); | 174 ink_drop_animation_controller_->AnimateToState(InkDropState::ACTIVATED); |
156 ink_drop_animation_controller_->AnimateToState(InkDropState::DEACTIVATED); | 175 ink_drop_animation_controller_->AnimateToState(InkDropState::DEACTIVATED); |
157 EXPECT_EQ(InkDropState::HIDDEN, | 176 EXPECT_EQ(InkDropState::HIDDEN, |
158 ink_drop_animation_controller_->GetInkDropState()); | 177 ink_drop_animation_controller_->GetInkDropState()); |
159 }) | 178 }) |
160 | 179 |
161 } // namespace views | 180 } // namespace views |
162 | 181 |
163 #endif // UI_VIEWS_ANIMATION_INK_DROP_ANIMATION_CONTROLLER_FACTORY_UNITTEST_H_ | 182 #endif // UI_VIEWS_ANIMATION_INK_DROP_ANIMATION_CONTROLLER_FACTORY_UNITTEST_H_ |
OLD | NEW |