diff options
Diffstat (limited to 'Source/WebKit/chromium/tests/CCActiveAnimationTest.cpp')
-rw-r--r-- | Source/WebKit/chromium/tests/CCActiveAnimationTest.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Source/WebKit/chromium/tests/CCActiveAnimationTest.cpp b/Source/WebKit/chromium/tests/CCActiveAnimationTest.cpp index a1ab770b7..af9fde1d5 100644 --- a/Source/WebKit/chromium/tests/CCActiveAnimationTest.cpp +++ b/Source/WebKit/chromium/tests/CCActiveAnimationTest.cpp @@ -69,6 +69,16 @@ TEST(CCActiveAnimationTest, TrimTimeInfiniteIterations) EXPECT_EQ(0.5, anim->trimTimeToCurrentIteration(1.5)); } +TEST(CCActiveAnimationTest, TrimTimeAlternating) +{ + OwnPtr<CCActiveAnimation> anim(createActiveAnimation(-1)); + anim->setAlternatesDirection(true); + EXPECT_EQ(0, anim->trimTimeToCurrentIteration(0)); + EXPECT_EQ(0.5, anim->trimTimeToCurrentIteration(0.5)); + EXPECT_EQ(1, anim->trimTimeToCurrentIteration(1)); + EXPECT_EQ(0.75, anim->trimTimeToCurrentIteration(1.25)); +} + TEST(CCActiveAnimationTest, TrimTimeStartTime) { OwnPtr<CCActiveAnimation> anim(createActiveAnimation(1)); |