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

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

Issue 847283004: Web Animations: Simplify mutable AnimationTimeline currentTime and playbackRate (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Invalidate compositor animations. Created 5 years, 11 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/AnimationTimeline.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/AnimationTimelineTest.cpp
diff --git a/Source/core/animation/AnimationTimelineTest.cpp b/Source/core/animation/AnimationTimelineTest.cpp
index cd660cc6a201531d38132e9eb5f90d621a3f4205..07656513616ce4f05a4e3151f02244e90bae9298 100644
--- a/Source/core/animation/AnimationTimelineTest.cpp
+++ b/Source/core/animation/AnimationTimelineTest.cpp
@@ -211,11 +211,10 @@ TEST_F(AnimationAnimationTimelineTest, PlaybackRateNormal)
TEST_F(AnimationAnimationTimelineTest, PlaybackRatePause)
{
timeline = AnimationTimeline::create(document.get());
- double zeroTime = timeline->zeroTime();
bool isNull;
document->animationClock().updateTime(100);
- EXPECT_EQ(zeroTime, timeline->zeroTime());
+ EXPECT_EQ(0, timeline->zeroTime());
EXPECT_EQ(100, timeline->currentTimeInternal());
EXPECT_EQ(100, timeline->currentTimeInternal(isNull));
EXPECT_FALSE(isNull);
@@ -223,14 +222,14 @@ TEST_F(AnimationAnimationTimelineTest, PlaybackRatePause)
timeline->setPlaybackRate(0.0);
EXPECT_EQ(0.0, timeline->playbackRate());
document->animationClock().updateTime(200);
- EXPECT_EQ(zeroTime, timeline->zeroTime());
+ EXPECT_EQ(100, timeline->zeroTime());
EXPECT_EQ(100, timeline->currentTimeInternal());
EXPECT_EQ(100, timeline->currentTimeInternal(isNull));
timeline->setPlaybackRate(1.0);
EXPECT_EQ(1.0, timeline->playbackRate());
document->animationClock().updateTime(400);
- EXPECT_EQ(zeroTime + 100, timeline->zeroTime());
+ EXPECT_EQ(100, timeline->zeroTime());
EXPECT_EQ(300, timeline->currentTimeInternal());
EXPECT_EQ(300, timeline->currentTimeInternal(isNull));
@@ -240,11 +239,10 @@ TEST_F(AnimationAnimationTimelineTest, PlaybackRatePause)
TEST_F(AnimationAnimationTimelineTest, PlaybackRateSlow)
{
timeline = AnimationTimeline::create(document.get());
- double zeroTime = timeline->zeroTime();
bool isNull;
document->animationClock().updateTime(100);
- EXPECT_EQ(zeroTime, timeline->zeroTime());
+ EXPECT_EQ(0, timeline->zeroTime());
EXPECT_EQ(100, timeline->currentTimeInternal());
EXPECT_EQ(100, timeline->currentTimeInternal(isNull));
EXPECT_FALSE(isNull);
@@ -252,14 +250,14 @@ TEST_F(AnimationAnimationTimelineTest, PlaybackRateSlow)
timeline->setPlaybackRate(0.5);
EXPECT_EQ(0.5, timeline->playbackRate());
document->animationClock().updateTime(300);
- EXPECT_EQ(zeroTime, timeline->zeroTime());
+ EXPECT_EQ(-100, timeline->zeroTime());
EXPECT_EQ(200, timeline->currentTimeInternal());
EXPECT_EQ(200, timeline->currentTimeInternal(isNull));
timeline->setPlaybackRate(1.0);
EXPECT_EQ(1.0, timeline->playbackRate());
document->animationClock().updateTime(400);
- EXPECT_EQ(zeroTime + 100, timeline->zeroTime());
+ EXPECT_EQ(100, timeline->zeroTime());
EXPECT_EQ(300, timeline->currentTimeInternal());
EXPECT_EQ(300, timeline->currentTimeInternal(isNull));
@@ -269,11 +267,10 @@ TEST_F(AnimationAnimationTimelineTest, PlaybackRateSlow)
TEST_F(AnimationAnimationTimelineTest, PlaybackRateFast)
{
timeline = AnimationTimeline::create(document.get());
- double zeroTime = timeline->zeroTime();
bool isNull;
document->animationClock().updateTime(100);
- EXPECT_EQ(zeroTime, timeline->zeroTime());
+ EXPECT_EQ(0, timeline->zeroTime());
EXPECT_EQ(100, timeline->currentTimeInternal());
EXPECT_EQ(100, timeline->currentTimeInternal(isNull));
EXPECT_FALSE(isNull);
@@ -281,14 +278,14 @@ TEST_F(AnimationAnimationTimelineTest, PlaybackRateFast)
timeline->setPlaybackRate(2.0);
EXPECT_EQ(2.0, timeline->playbackRate());
document->animationClock().updateTime(300);
- EXPECT_EQ(zeroTime, timeline->zeroTime());
+ EXPECT_EQ(50, timeline->zeroTime());
EXPECT_EQ(500, timeline->currentTimeInternal());
EXPECT_EQ(500, timeline->currentTimeInternal(isNull));
timeline->setPlaybackRate(1.0);
EXPECT_EQ(1.0, timeline->playbackRate());
document->animationClock().updateTime(400);
- EXPECT_EQ(zeroTime - 200, timeline->zeroTime());
+ EXPECT_EQ(-200, timeline->zeroTime());
EXPECT_EQ(600, timeline->currentTimeInternal());
EXPECT_EQ(600, timeline->currentTimeInternal(isNull));
« no previous file with comments | « Source/core/animation/AnimationTimeline.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698