Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(11)

Unified Diff: cc/keyframed_animation_curve_unittest.cc

Issue 11876016: Define cc::TransformOperations and webkit::WebTransformOperationsImpl (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Put TransformOperation into its own header Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/keyframed_animation_curve.cc ('k') | cc/test/animation_test_common.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/keyframed_animation_curve_unittest.cc
diff --git a/cc/keyframed_animation_curve_unittest.cc b/cc/keyframed_animation_curve_unittest.cc
index 0a0efdd5fcceece5673dca7ebf43fb0f447ebc69..b520dca4092cffaa7d1aa319c2a9b90fd884de2a 100644
--- a/cc/keyframed_animation_curve_unittest.cc
+++ b/cc/keyframed_animation_curve_unittest.cc
@@ -4,6 +4,7 @@
#include "cc/keyframed_animation_curve.h"
+#include "cc/transform_operations.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/WebKit/Source/Platform/chromium/public/WebTransformOperations.h"
@@ -87,8 +88,13 @@ TEST(KeyframedAnimationCurveTest, RepeatedFloatKeyTimes)
TEST(KeyframedAnimationCurveTest, OneTransformKeyframe)
{
scoped_ptr<KeyframedTransformAnimationCurve> curve(KeyframedTransformAnimationCurve::create());
+#if WEB_TRANSFORM_OPERATIONS_IS_VIRTUAL
+ TransformOperations operations;
+ operations.AppendTranslate(2, 0, 0);
+#else
WebKit::WebTransformOperations operations;
operations.appendTranslate(2, 0, 0);
+#endif
curve->addKeyframe(TransformKeyframe::create(0, operations, scoped_ptr<TimingFunction>()));
expectTranslateX(2, curve->getValue(-1));
@@ -102,10 +108,17 @@ TEST(KeyframedAnimationCurveTest, OneTransformKeyframe)
TEST(KeyframedAnimationCurveTest, TwoTransformKeyframe)
{
scoped_ptr<KeyframedTransformAnimationCurve> curve(KeyframedTransformAnimationCurve::create());
+#if WEB_TRANSFORM_OPERATIONS_IS_VIRTUAL
+ TransformOperations operations1;
+ operations1.AppendTranslate(2, 0, 0);
+ TransformOperations operations2;
+ operations2.AppendTranslate(4, 0, 0);
+#else
WebKit::WebTransformOperations operations1;
operations1.appendTranslate(2, 0, 0);
WebKit::WebTransformOperations operations2;
operations2.appendTranslate(4, 0, 0);
+#endif
curve->addKeyframe(TransformKeyframe::create(0, operations1, scoped_ptr<TimingFunction>()));
curve->addKeyframe(TransformKeyframe::create(1, operations2, scoped_ptr<TimingFunction>()));
@@ -120,12 +133,21 @@ TEST(KeyframedAnimationCurveTest, TwoTransformKeyframe)
TEST(KeyframedAnimationCurveTest, ThreeTransformKeyframe)
{
scoped_ptr<KeyframedTransformAnimationCurve> curve(KeyframedTransformAnimationCurve::create());
+#if WEB_TRANSFORM_OPERATIONS_IS_VIRTUAL
+ TransformOperations operations1;
+ operations1.AppendTranslate(2, 0, 0);
+ TransformOperations operations2;
+ operations2.AppendTranslate(4, 0, 0);
+ TransformOperations operations3;
+ operations3.AppendTranslate(8, 0, 0);
+#else
WebKit::WebTransformOperations operations1;
operations1.appendTranslate(2, 0, 0);
WebKit::WebTransformOperations operations2;
operations2.appendTranslate(4, 0, 0);
WebKit::WebTransformOperations operations3;
operations3.appendTranslate(8, 0, 0);
+#endif
curve->addKeyframe(TransformKeyframe::create(0, operations1, scoped_ptr<TimingFunction>()));
curve->addKeyframe(TransformKeyframe::create(1, operations2, scoped_ptr<TimingFunction>()));
curve->addKeyframe(TransformKeyframe::create(2, operations3, scoped_ptr<TimingFunction>()));
@@ -143,6 +165,16 @@ TEST(KeyframedAnimationCurveTest, RepeatedTransformKeyTimes)
{
scoped_ptr<KeyframedTransformAnimationCurve> curve(KeyframedTransformAnimationCurve::create());
// A step function.
+#if WEB_TRANSFORM_OPERATIONS_IS_VIRTUAL
+ TransformOperations operations1;
+ operations1.AppendTranslate(4, 0, 0);
+ TransformOperations operations2;
+ operations2.AppendTranslate(4, 0, 0);
+ TransformOperations operations3;
+ operations3.AppendTranslate(6, 0, 0);
+ TransformOperations operations4;
+ operations4.AppendTranslate(6, 0, 0);
+#else
WebKit::WebTransformOperations operations1;
operations1.appendTranslate(4, 0, 0);
WebKit::WebTransformOperations operations2;
@@ -151,6 +183,7 @@ TEST(KeyframedAnimationCurveTest, RepeatedTransformKeyTimes)
operations3.appendTranslate(6, 0, 0);
WebKit::WebTransformOperations operations4;
operations4.appendTranslate(6, 0, 0);
+#endif
curve->addKeyframe(TransformKeyframe::create(0, operations1, scoped_ptr<TimingFunction>()));
curve->addKeyframe(TransformKeyframe::create(1, operations2, scoped_ptr<TimingFunction>()));
curve->addKeyframe(TransformKeyframe::create(1, operations3, scoped_ptr<TimingFunction>()));
« no previous file with comments | « cc/keyframed_animation_curve.cc ('k') | cc/test/animation_test_common.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698