summaryrefslogtreecommitdiff
path: root/Source/WebKit/chromium/tests/AnimationTranslationUtilTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebKit/chromium/tests/AnimationTranslationUtilTest.cpp')
-rw-r--r--Source/WebKit/chromium/tests/AnimationTranslationUtilTest.cpp28
1 files changed, 24 insertions, 4 deletions
diff --git a/Source/WebKit/chromium/tests/AnimationTranslationUtilTest.cpp b/Source/WebKit/chromium/tests/AnimationTranslationUtilTest.cpp
index 70da65ef6..7b184fa34 100644
--- a/Source/WebKit/chromium/tests/AnimationTranslationUtilTest.cpp
+++ b/Source/WebKit/chromium/tests/AnimationTranslationUtilTest.cpp
@@ -31,6 +31,7 @@
#include "IntSize.h"
#include "Matrix3DTransformOperation.h"
#include "RotateTransformOperation.h"
+#include "ScaleTransformOperation.h"
#include "TransformOperations.h"
#include "TranslateTransformOperation.h"
#include <gtest/gtest.h>
@@ -45,7 +46,7 @@ namespace {
bool animationCanBeTranslated(const KeyframeValueList& values, Animation* animation)
{
IntSize boxSize;
- return createWebAnimation(values, animation, 0, 0, 0, boxSize);
+ return createWebAnimation(values, animation, 0, 0, boxSize);
}
TEST(AnimationTranslationUtilTest, createOpacityAnimation)
@@ -96,7 +97,7 @@ TEST(AnimationTranslationUtilTest, createTransformAnimationWithBigRotation)
RefPtr<Animation> animation = Animation::create();
animation->setDuration(duration);
- EXPECT_FALSE(animationCanBeTranslated(values, animation.get()));
+ EXPECT_TRUE(animationCanBeTranslated(values, animation.get()));
}
TEST(AnimationTranslationUtilTest, createTransformAnimationWithBigRotationAndEmptyTransformOperationList)
@@ -114,7 +115,7 @@ TEST(AnimationTranslationUtilTest, createTransformAnimationWithBigRotationAndEmp
RefPtr<Animation> animation = Animation::create();
animation->setDuration(duration);
- EXPECT_FALSE(animationCanBeTranslated(values, animation.get()));
+ EXPECT_TRUE(animationCanBeTranslated(values, animation.get()));
}
TEST(AnimationTranslationUtilTest, createTransformAnimationWithRotationInvolvingNegativeAngles)
@@ -155,7 +156,7 @@ TEST(AnimationTranslationUtilTest, createTransformAnimationWithSmallRotationInvo
EXPECT_TRUE(animationCanBeTranslated(values, animation.get()));
}
-TEST(AnimationTranslationUtilTest, createTransformAnimationWithSingularMatrix)
+TEST(AnimationTranslationUtilTest, createTransformAnimationWithNonDecomposableMatrix)
{
const double duration = 1;
WebCore::KeyframeValueList values(AnimatedPropertyWebkitTransform);
@@ -177,6 +178,25 @@ TEST(AnimationTranslationUtilTest, createTransformAnimationWithSingularMatrix)
EXPECT_FALSE(animationCanBeTranslated(values, animation.get()));
}
+TEST(AnimationTranslationUtilTest, createTransformAnimationWithNonInvertibleTransform)
+{
+ const double duration = 1;
+ WebCore::KeyframeValueList values(AnimatedPropertyWebkitTransform);
+
+ TransformOperations operations1;
+ operations1.operations().append(ScaleTransformOperation::create(1, 1, 1, TransformOperation::SCALE_3D));
+ values.insert(new TransformAnimationValue(0, &operations1));
+
+ TransformOperations operations2;
+ operations2.operations().append(ScaleTransformOperation::create(1, 0, 1, TransformOperation::SCALE_3D));
+ values.insert(new TransformAnimationValue(duration, &operations2));
+
+ RefPtr<Animation> animation = Animation::create();
+ animation->setDuration(duration);
+
+ EXPECT_TRUE(animationCanBeTranslated(values, animation.get()));
+}
+
TEST(AnimationTranslationUtilTest, createReversedAnimation)
{
const double duration = 1;