| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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 "cc/animation/layer_animation_controller.h" | 5 #include "cc/animation/layer_animation_controller.h" |
| 6 | 6 |
| 7 #include "cc/animation/animation.h" | 7 #include "cc/animation/animation.h" |
| 8 #include "cc/animation/animation_curve.h" | 8 #include "cc/animation/animation_curve.h" |
| 9 #include "cc/animation/animation_delegate.h" | 9 #include "cc/animation/animation_delegate.h" |
| 10 #include "cc/animation/keyframed_animation_curve.h" | 10 #include "cc/animation/keyframed_animation_curve.h" |
| 11 #include "cc/animation/transform_operations.h" | 11 #include "cc/animation/transform_operations.h" |
| 12 #include "cc/test/animation_test_common.h" | 12 #include "cc/test/animation_test_common.h" |
| 13 #include "testing/gmock/include/gmock/gmock.h" | 13 #include "testing/gmock/include/gmock/gmock.h" |
| 14 #include "testing/gtest/include/gtest/gtest.h" | 14 #include "testing/gtest/include/gtest/gtest.h" |
| 15 #include "ui/gfx/box_f.h" | 15 #include "ui/gfx/box_f.h" |
| 16 #include "ui/gfx/transform.h" | 16 #include "ui/gfx/transform.h" |
| 17 | 17 |
| 18 namespace cc { | 18 namespace cc { |
| 19 namespace { | 19 namespace { |
| 20 | 20 |
| 21 void ExpectTranslateX(double translate_x, const gfx::Transform& matrix) { | |
| 22 EXPECT_FLOAT_EQ(translate_x, matrix.matrix().getDouble(0, 3)); } | |
| 23 | |
| 24 scoped_ptr<Animation> CreateAnimation(scoped_ptr<AnimationCurve> curve, | 21 scoped_ptr<Animation> CreateAnimation(scoped_ptr<AnimationCurve> curve, |
| 25 int id, | 22 int id, |
| 26 Animation::TargetProperty property) { | 23 Animation::TargetProperty property) { |
| 27 return Animation::Create(curve.Pass(), 0, id, property); | 24 return Animation::Create(curve.Pass(), 0, id, property); |
| 28 } | 25 } |
| 29 | 26 |
| 30 TEST(LayerAnimationControllerTest, SyncNewAnimation) { | 27 TEST(LayerAnimationControllerTest, SyncNewAnimation) { |
| 31 FakeLayerAnimationValueObserver dummy_impl; | 28 FakeLayerAnimationValueObserver dummy_impl; |
| 32 scoped_refptr<LayerAnimationController> controller_impl( | 29 scoped_refptr<LayerAnimationController> controller_impl( |
| 33 LayerAnimationController::Create(0)); | 30 LayerAnimationController::Create(0)); |
| (...skipping 1148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1182 curve3->AddKeyframe(TransformKeyframe::Create( | 1179 curve3->AddKeyframe(TransformKeyframe::Create( |
| 1183 1.0, operations3, scoped_ptr<TimingFunction>())); | 1180 1.0, operations3, scoped_ptr<TimingFunction>())); |
| 1184 animation = Animation::Create( | 1181 animation = Animation::Create( |
| 1185 curve3.PassAs<AnimationCurve>(), 3, 3, Animation::Transform); | 1182 curve3.PassAs<AnimationCurve>(), 3, 3, Animation::Transform); |
| 1186 controller_impl->AddAnimation(animation.Pass()); | 1183 controller_impl->AddAnimation(animation.Pass()); |
| 1187 EXPECT_FALSE(controller_impl->AnimatedBoundsForBox(box, &bounds)); | 1184 EXPECT_FALSE(controller_impl->AnimatedBoundsForBox(box, &bounds)); |
| 1188 } | 1185 } |
| 1189 | 1186 |
| 1190 } // namespace | 1187 } // namespace |
| 1191 } // namespace cc | 1188 } // namespace cc |
| OLD | NEW |