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

Unified Diff: Source/core/animation/AnimationPlayerTest.cpp

Issue 235503010: Web Animations: Fix effect change calculation when player is cancelled but not held (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 8 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 | « Source/core/animation/AnimationPlayer.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/animation/AnimationPlayerTest.cpp
diff --git a/Source/core/animation/AnimationPlayerTest.cpp b/Source/core/animation/AnimationPlayerTest.cpp
index d3480835b4c28dea087425e48cd76203337c6095..d334474fbb1a950fae23c3c2b7bcddcf9e761e4b 100644
--- a/Source/core/animation/AnimationPlayerTest.cpp
+++ b/Source/core/animation/AnimationPlayerTest.cpp
@@ -686,6 +686,26 @@ TEST_F(AnimationAnimationPlayerTest, TimeToNextEffectWhenPaused)
EXPECT_EQ(std::numeric_limits<double>::infinity(), player->timeToEffectChange());
}
+TEST_F(AnimationAnimationPlayerTest, TimeToNextEffectWhenCancelledBeforeStart)
+{
+ EXPECT_EQ(0, player->timeToEffectChange());
+ player->setCurrentTime(-8);
+ player->setPlaybackRate(2);
+ player->cancel();
+ player->update(AnimationPlayer::UpdateOnDemand);
+ EXPECT_EQ(4, player->timeToEffectChange());
+}
+
+TEST_F(AnimationAnimationPlayerTest, TimeToNextEffectWhenCancelledBeforeStartReverse)
+{
+ EXPECT_EQ(0, player->timeToEffectChange());
+ player->setCurrentTime(9);
+ player->setPlaybackRate(-3);
+ player->cancel();
+ player->update(AnimationPlayer::UpdateOnDemand);
+ EXPECT_EQ(3, player->timeToEffectChange());
+}
+
TEST_F(AnimationAnimationPlayerTest, AttachedAnimationPlayers)
{
RefPtr<Element> element = document->createElement("foo", ASSERT_NO_EXCEPTION);
« no previous file with comments | « Source/core/animation/AnimationPlayer.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698