| 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_UNITTEST_H_ | 5 #ifndef UI_VIEWS_ANIMATION_INK_DROP_ANIMATION_UNITTEST_H_ |
| 6 #define UI_VIEWS_ANIMATION_INK_DROP_ANIMATION_UNITTEST_H_ | 6 #define UI_VIEWS_ANIMATION_INK_DROP_ANIMATION_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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 TEST_F(InkDropAnimationTest, AnimateToActionPending) { | 56 TEST_F(InkDropAnimationTest, AnimateToActionPending) { |
| 57 scoped_ptr<InkDropAnimation> ink_drop_animation = CreateInkDropAnimation(); | 57 scoped_ptr<InkDropAnimation> ink_drop_animation = CreateInkDropAnimation(); |
| 58 ink_drop_animation->AnimateToState(views::InkDropState::ACTION_PENDING); | 58 ink_drop_animation->AnimateToState(views::InkDropState::ACTION_PENDING); |
| 59 EXPECT_EQ(views::InkDropState::ACTION_PENDING, | 59 EXPECT_EQ(views::InkDropState::ACTION_PENDING, |
| 60 ink_drop_animation->ink_drop_state()); | 60 ink_drop_animation->ink_drop_state()); |
| 61 } | 61 } |
| 62 | 62 |
| 63 TEST_F(InkDropAnimationTest, AnimateToQuickAction) { | 63 TEST_F(InkDropAnimationTest, AnimateToQuickAction) { |
| 64 scoped_ptr<InkDropAnimation> ink_drop_animation = CreateInkDropAnimation(); | 64 scoped_ptr<InkDropAnimation> ink_drop_animation = CreateInkDropAnimation(); |
| 65 ink_drop_animation->AnimateToState(views::InkDropState::QUICK_ACTION); | 65 ink_drop_animation->AnimateToState(views::InkDropState::QUICK_ACTION); |
| 66 EXPECT_EQ(views::InkDropState::HIDDEN, ink_drop_animation->ink_drop_state()); | 66 EXPECT_EQ(views::InkDropState::QUICK_ACTION, |
| 67 ink_drop_animation->ink_drop_state()); |
| 67 } | 68 } |
| 68 | 69 |
| 69 TEST_F(InkDropAnimationTest, AnimateToSlowActionPending) { | 70 TEST_F(InkDropAnimationTest, AnimateToSlowActionPending) { |
| 70 scoped_ptr<InkDropAnimation> ink_drop_animation = CreateInkDropAnimation(); | 71 scoped_ptr<InkDropAnimation> ink_drop_animation = CreateInkDropAnimation(); |
| 71 ink_drop_animation->AnimateToState(views::InkDropState::SLOW_ACTION_PENDING); | 72 ink_drop_animation->AnimateToState(views::InkDropState::SLOW_ACTION_PENDING); |
| 72 EXPECT_EQ(views::InkDropState::SLOW_ACTION_PENDING, | 73 EXPECT_EQ(views::InkDropState::SLOW_ACTION_PENDING, |
| 73 ink_drop_animation->ink_drop_state()); | 74 ink_drop_animation->ink_drop_state()); |
| 74 } | 75 } |
| 75 | 76 |
| 76 TEST_F(InkDropAnimationTest, AnimateToSlowAction) { | 77 TEST_F(InkDropAnimationTest, AnimateToSlowAction) { |
| 77 scoped_ptr<InkDropAnimation> ink_drop_animation = CreateInkDropAnimation(); | 78 scoped_ptr<InkDropAnimation> ink_drop_animation = CreateInkDropAnimation(); |
| 78 ink_drop_animation->AnimateToState(views::InkDropState::SLOW_ACTION); | 79 ink_drop_animation->AnimateToState(views::InkDropState::SLOW_ACTION); |
| 79 EXPECT_EQ(views::InkDropState::HIDDEN, ink_drop_animation->ink_drop_state()); | 80 EXPECT_EQ(views::InkDropState::SLOW_ACTION, |
| 81 ink_drop_animation->ink_drop_state()); |
| 80 } | 82 } |
| 81 | 83 |
| 82 TEST_F(InkDropAnimationTest, AnimateToActivated) { | 84 TEST_F(InkDropAnimationTest, AnimateToActivated) { |
| 83 scoped_ptr<InkDropAnimation> ink_drop_animation = CreateInkDropAnimation(); | 85 scoped_ptr<InkDropAnimation> ink_drop_animation = CreateInkDropAnimation(); |
| 84 ink_drop_animation->AnimateToState(views::InkDropState::ACTIVATED); | 86 ink_drop_animation->AnimateToState(views::InkDropState::ACTIVATED); |
| 85 EXPECT_EQ(views::InkDropState::ACTIVATED, | 87 EXPECT_EQ(views::InkDropState::ACTIVATED, |
| 86 ink_drop_animation->ink_drop_state()); | 88 ink_drop_animation->ink_drop_state()); |
| 87 } | 89 } |
| 88 | 90 |
| 89 TEST_F(InkDropAnimationTest, AnimateToDeactivated) { | 91 TEST_F(InkDropAnimationTest, AnimateToDeactivated) { |
| 90 scoped_ptr<InkDropAnimation> ink_drop_animation = CreateInkDropAnimation(); | 92 scoped_ptr<InkDropAnimation> ink_drop_animation = CreateInkDropAnimation(); |
| 91 ink_drop_animation->AnimateToState(views::InkDropState::DEACTIVATED); | 93 ink_drop_animation->AnimateToState(views::InkDropState::DEACTIVATED); |
| 92 EXPECT_EQ(views::InkDropState::HIDDEN, ink_drop_animation->ink_drop_state()); | 94 EXPECT_EQ(views::InkDropState::DEACTIVATED, |
| 95 ink_drop_animation->ink_drop_state()); |
| 93 } | 96 } |
| 94 | 97 |
| 95 TEST_F(InkDropAnimationTest, | 98 TEST_F(InkDropAnimationTest, |
| 96 TransformedPointsUsingTransformsFromCalculateCircleTransforms) { | 99 TransformedPointsUsingTransformsFromCalculateCircleTransforms) { |
| 97 const int kHalfDrawnSize = 5; | 100 const int kHalfDrawnSize = 5; |
| 98 const int kDrawnSize = 2 * kHalfDrawnSize; | 101 const int kDrawnSize = 2 * kHalfDrawnSize; |
| 99 | 102 |
| 100 const int kHalfTransformedSize = 100; | 103 const int kHalfTransformedSize = 100; |
| 101 const int kTransformedSize = 2 * kHalfTransformedSize; | 104 const int kTransformedSize = 2 * kHalfTransformedSize; |
| 102 | 105 |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 292 EXPECT_EQ(gfx::Point(0, -kHalfTransformedHeight), | 295 EXPECT_EQ(gfx::Point(0, -kHalfTransformedHeight), |
| 293 TransformPoint(kVerticalTransform, top_mid)); | 296 TransformPoint(kVerticalTransform, top_mid)); |
| 294 EXPECT_EQ(gfx::Point(0, kHalfTransformedHeight), | 297 EXPECT_EQ(gfx::Point(0, kHalfTransformedHeight), |
| 295 TransformPoint(kVerticalTransform, bottom_mid)); | 298 TransformPoint(kVerticalTransform, bottom_mid)); |
| 296 } | 299 } |
| 297 | 300 |
| 298 } // namespace test | 301 } // namespace test |
| 299 } // namespace views | 302 } // namespace views |
| 300 | 303 |
| 301 #endif // UI_VIEWS_ANIMATION_INK_DROP_ANIMATION_UNITTEST_H_ | 304 #endif // UI_VIEWS_ANIMATION_INK_DROP_ANIMATION_UNITTEST_H_ |
| OLD | NEW |