summaryrefslogtreecommitdiff
path: root/Source/WebKit/chromium/tests/AnimationTranslationUtilTest.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2012-09-10 19:10:20 +0200
committerSimon Hausmann <simon.hausmann@nokia.com>2012-09-10 19:10:20 +0200
commit284837daa07b29d6a63a748544a90b1f5842ac5c (patch)
treeecd258180bde91fe741e0cfd2638beb3c6da7e8e /Source/WebKit/chromium/tests/AnimationTranslationUtilTest.cpp
parent2e2ba8ff45915f40ed3e014101269c175f2a89a0 (diff)
downloadqtwebkit-284837daa07b29d6a63a748544a90b1f5842ac5c.tar.gz
Imported WebKit commit 68645295d2e3e09af2c942f092556f06aa5f8b0d (http://svn.webkit.org/repository/webkit/trunk@128073)
New snapshot
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;