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

Unified Diff: cc/animation/animation_unittest.cc

Issue 652813003: CC: Fix issue for animations with fill and iteration start specified (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update comment Created 6 years, 2 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/animation/animation.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/animation/animation_unittest.cc
diff --git a/cc/animation/animation_unittest.cc b/cc/animation/animation_unittest.cc
index 7b701784f8246cbcdb3bbf3e94ebbdf44fe0940a..b1592d690f4ba6aa36c2f4608b6fde4af280172c 100644
--- a/cc/animation/animation_unittest.cc
+++ b/cc/animation/animation_unittest.cc
@@ -619,6 +619,7 @@ TEST(AnimationTest,
TEST(AnimationTest, TrimTimeIterationStart) {
scoped_ptr<Animation> anim(CreateAnimation(2, 1, 1));
anim->set_iteration_start(0.5);
+ EXPECT_EQ(0.5, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(-1.0)));
EXPECT_EQ(0.5, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(0.0)));
EXPECT_EQ(0.0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(0.5)));
EXPECT_EQ(0.5, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(1.0)));
@@ -631,6 +632,7 @@ TEST(AnimationTest, TrimTimeIterationStartAlternate) {
scoped_ptr<Animation> anim(CreateAnimation(2, 1, 1));
anim->set_direction(Animation::Alternate);
anim->set_iteration_start(0.3);
+ EXPECT_EQ(0.3, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(-1.0)));
EXPECT_EQ(0.3, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(0.0)));
EXPECT_EQ(0.8, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(0.5)));
EXPECT_EQ(1.0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(0.7)));
@@ -643,6 +645,7 @@ TEST(AnimationTest, TrimTimeIterationStartAlternateThreeIterations) {
scoped_ptr<Animation> anim(CreateAnimation(3, 1, 1));
anim->set_direction(Animation::Alternate);
anim->set_iteration_start(1);
+ EXPECT_EQ(1.0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(-1.0)));
EXPECT_EQ(1.0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(0.0)));
EXPECT_EQ(0.5, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(0.5)));
EXPECT_EQ(0.0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(1.0)));
« no previous file with comments | « cc/animation/animation.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698