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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 const gfx::Point top_mid(kHalfDrawnSize, 0); | 107 const gfx::Point top_mid(kHalfDrawnSize, 0); |
108 const gfx::Point bottom_mid(kHalfDrawnSize, kDrawnSize); | 108 const gfx::Point bottom_mid(kHalfDrawnSize, kDrawnSize); |
109 | 109 |
110 scoped_ptr<InkDropAnimation> ink_drop_animation( | 110 scoped_ptr<InkDropAnimation> ink_drop_animation( |
111 new InkDropAnimation(gfx::Size(kDrawnSize, kDrawnSize), 2, | 111 new InkDropAnimation(gfx::Size(kDrawnSize, kDrawnSize), 2, |
112 gfx::Size(kHalfDrawnSize, kHalfDrawnSize), 1)); | 112 gfx::Size(kHalfDrawnSize, kHalfDrawnSize), 1)); |
113 InkDropAnimationTestApi test_api(ink_drop_animation.get()); | 113 InkDropAnimationTestApi test_api(ink_drop_animation.get()); |
114 | 114 |
115 InkDropAnimationTestApi::InkDropTransforms transforms; | 115 InkDropAnimationTestApi::InkDropTransforms transforms; |
116 test_api.CalculateCircleTransforms( | 116 test_api.CalculateCircleTransforms( |
117 gfx::SizeF(kTransformedSize, kTransformedSize), &transforms); | 117 gfx::Size(kTransformedSize, kTransformedSize), &transforms); |
118 | 118 |
119 // Transform variables to reduce verbosity of actual verification code. | 119 // Transform variables to reduce verbosity of actual verification code. |
120 const gfx::Transform kTopLeftTransform = | 120 const gfx::Transform kTopLeftTransform = |
121 transforms[InkDropAnimationTestApi::PaintedShape::TOP_LEFT_CIRCLE]; | 121 transforms[InkDropAnimationTestApi::PaintedShape::TOP_LEFT_CIRCLE]; |
122 const gfx::Transform kTopRightTransform = | 122 const gfx::Transform kTopRightTransform = |
123 transforms[InkDropAnimationTestApi::PaintedShape::TOP_RIGHT_CIRCLE]; | 123 transforms[InkDropAnimationTestApi::PaintedShape::TOP_RIGHT_CIRCLE]; |
124 const gfx::Transform kBottomRightTransform = | 124 const gfx::Transform kBottomRightTransform = |
125 transforms[InkDropAnimationTestApi::PaintedShape::BOTTOM_RIGHT_CIRCLE]; | 125 transforms[InkDropAnimationTestApi::PaintedShape::BOTTOM_RIGHT_CIRCLE]; |
126 const gfx::Transform kBottomLeftTransform = | 126 const gfx::Transform kBottomLeftTransform = |
127 transforms[InkDropAnimationTestApi::PaintedShape::BOTTOM_LEFT_CIRCLE]; | 127 transforms[InkDropAnimationTestApi::PaintedShape::BOTTOM_LEFT_CIRCLE]; |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 const gfx::Point top_mid(kHalfDrawnSize, 0); | 213 const gfx::Point top_mid(kHalfDrawnSize, 0); |
214 const gfx::Point bottom_mid(kHalfDrawnSize, kDrawnSize); | 214 const gfx::Point bottom_mid(kHalfDrawnSize, kDrawnSize); |
215 | 215 |
216 scoped_ptr<InkDropAnimation> ink_drop_animation( | 216 scoped_ptr<InkDropAnimation> ink_drop_animation( |
217 new InkDropAnimation(gfx::Size(kDrawnSize, kDrawnSize), 2, | 217 new InkDropAnimation(gfx::Size(kDrawnSize, kDrawnSize), 2, |
218 gfx::Size(kHalfDrawnSize, kHalfDrawnSize), 1)); | 218 gfx::Size(kHalfDrawnSize, kHalfDrawnSize), 1)); |
219 InkDropAnimationTestApi test_api(ink_drop_animation.get()); | 219 InkDropAnimationTestApi test_api(ink_drop_animation.get()); |
220 | 220 |
221 InkDropAnimationTestApi::InkDropTransforms transforms; | 221 InkDropAnimationTestApi::InkDropTransforms transforms; |
222 test_api.CalculateRectTransforms( | 222 test_api.CalculateRectTransforms( |
223 gfx::SizeF(kTransformedWidth, kTransformedHeight), kTransformedRadius, | 223 gfx::Size(kTransformedWidth, kTransformedHeight), kTransformedRadius, |
224 &transforms); | 224 &transforms); |
225 | 225 |
226 // Transform variables to reduce verbosity of actual verification code. | 226 // Transform variables to reduce verbosity of actual verification code. |
227 const gfx::Transform kTopLeftTransform = | 227 const gfx::Transform kTopLeftTransform = |
228 transforms[InkDropAnimationTestApi::PaintedShape::TOP_LEFT_CIRCLE]; | 228 transforms[InkDropAnimationTestApi::PaintedShape::TOP_LEFT_CIRCLE]; |
229 const gfx::Transform kTopRightTransform = | 229 const gfx::Transform kTopRightTransform = |
230 transforms[InkDropAnimationTestApi::PaintedShape::TOP_RIGHT_CIRCLE]; | 230 transforms[InkDropAnimationTestApi::PaintedShape::TOP_RIGHT_CIRCLE]; |
231 const gfx::Transform kBottomRightTransform = | 231 const gfx::Transform kBottomRightTransform = |
232 transforms[InkDropAnimationTestApi::PaintedShape::BOTTOM_RIGHT_CIRCLE]; | 232 transforms[InkDropAnimationTestApi::PaintedShape::BOTTOM_RIGHT_CIRCLE]; |
233 const gfx::Transform kBottomLeftTransform = | 233 const gfx::Transform kBottomLeftTransform = |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
292 EXPECT_EQ(gfx::Point(0, -kHalfTransformedHeight), | 292 EXPECT_EQ(gfx::Point(0, -kHalfTransformedHeight), |
293 TransformPoint(kVerticalTransform, top_mid)); | 293 TransformPoint(kVerticalTransform, top_mid)); |
294 EXPECT_EQ(gfx::Point(0, kHalfTransformedHeight), | 294 EXPECT_EQ(gfx::Point(0, kHalfTransformedHeight), |
295 TransformPoint(kVerticalTransform, bottom_mid)); | 295 TransformPoint(kVerticalTransform, bottom_mid)); |
296 } | 296 } |
297 | 297 |
298 } // namespace test | 298 } // namespace test |
299 } // namespace views | 299 } // namespace views |
300 | 300 |
301 #endif // UI_VIEWS_ANIMATION_INK_DROP_ANIMATION_UNITTEST_H_ | 301 #endif // UI_VIEWS_ANIMATION_INK_DROP_ANIMATION_UNITTEST_H_ |
OLD | NEW |