| 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 "ui/views/animation/square_ink_drop_animation.h" | 8 #include "ui/views/animation/square_ink_drop_animation.h" |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
| 13 #include "ui/gfx/geometry/point.h" |
| 13 #include "ui/gfx/geometry/size.h" | 14 #include "ui/gfx/geometry/size.h" |
| 14 #include "ui/gfx/geometry/size_f.h" | 15 #include "ui/gfx/geometry/size_f.h" |
| 15 #include "ui/views/animation/ink_drop_animation_observer.h" | 16 #include "ui/views/animation/ink_drop_animation_observer.h" |
| 16 #include "ui/views/animation/ink_drop_state.h" | 17 #include "ui/views/animation/ink_drop_state.h" |
| 17 #include "ui/views/animation/test/square_ink_drop_animation_test_api.h" | 18 #include "ui/views/animation/test/square_ink_drop_animation_test_api.h" |
| 18 #include "ui/views/animation/test/test_ink_drop_animation_observer.h" | 19 #include "ui/views/animation/test/test_ink_drop_animation_observer.h" |
| 19 | 20 |
| 20 namespace views { | 21 namespace views { |
| 21 namespace test { | 22 namespace test { |
| 22 | 23 |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 | 104 |
| 104 const gfx::Point | 105 const gfx::Point |
| 105 SquareInkDropAnimationCalculateTransformsTest::kDrawnBottomMidPoint = | 106 SquareInkDropAnimationCalculateTransformsTest::kDrawnBottomMidPoint = |
| 106 gfx::Point(kHalfDrawnSize, kDrawnSize); | 107 gfx::Point(kHalfDrawnSize, kDrawnSize); |
| 107 | 108 |
| 108 SquareInkDropAnimationCalculateTransformsTest:: | 109 SquareInkDropAnimationCalculateTransformsTest:: |
| 109 SquareInkDropAnimationCalculateTransformsTest() | 110 SquareInkDropAnimationCalculateTransformsTest() |
| 110 : ink_drop_animation_(gfx::Size(kDrawnSize, kDrawnSize), | 111 : ink_drop_animation_(gfx::Size(kDrawnSize, kDrawnSize), |
| 111 2, | 112 2, |
| 112 gfx::Size(kHalfDrawnSize, kHalfDrawnSize), | 113 gfx::Size(kHalfDrawnSize, kHalfDrawnSize), |
| 113 1), | 114 1, |
| 115 gfx::Point(), |
| 116 SK_ColorBLACK), |
| 114 test_api_(&ink_drop_animation_) {} | 117 test_api_(&ink_drop_animation_) {} |
| 115 | 118 |
| 116 SquareInkDropAnimationCalculateTransformsTest:: | 119 SquareInkDropAnimationCalculateTransformsTest:: |
| 117 ~SquareInkDropAnimationCalculateTransformsTest() {} | 120 ~SquareInkDropAnimationCalculateTransformsTest() {} |
| 118 | 121 |
| 119 } // namespace | 122 } // namespace |
| 120 | 123 |
| 121 TEST_F(SquareInkDropAnimationCalculateTransformsTest, | 124 TEST_F(SquareInkDropAnimationCalculateTransformsTest, |
| 122 TransformedPointsUsingTransformsFromCalculateCircleTransforms) { | 125 TransformedPointsUsingTransformsFromCalculateCircleTransforms) { |
| 123 test_api_.CalculateCircleTransforms( | 126 test_api_.CalculateCircleTransforms( |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 236 TransformPoint(transform, kDrawnTopMidPoint)); | 239 TransformPoint(transform, kDrawnTopMidPoint)); |
| 237 EXPECT_EQ(test_cases[i].bottom_mid_point, | 240 EXPECT_EQ(test_cases[i].bottom_mid_point, |
| 238 TransformPoint(transform, kDrawnBottomMidPoint)); | 241 TransformPoint(transform, kDrawnBottomMidPoint)); |
| 239 } | 242 } |
| 240 } | 243 } |
| 241 | 244 |
| 242 } // namespace test | 245 } // namespace test |
| 243 } // namespace views | 246 } // namespace views |
| 244 | 247 |
| 245 #endif // UI_VIEWS_ANIMATION_INK_DROP_ANIMATION_UNITTEST_H_ | 248 #endif // UI_VIEWS_ANIMATION_INK_DROP_ANIMATION_UNITTEST_H_ |
| OLD | NEW |