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

Unified Diff: third_party/WebKit/Source/core/animation/AnimationTest.cpp

Issue 1410313004: Web Animations: Use a single animation clock (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 5 years, 1 month 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
Index: third_party/WebKit/Source/core/animation/AnimationTest.cpp
diff --git a/third_party/WebKit/Source/core/animation/AnimationTest.cpp b/third_party/WebKit/Source/core/animation/AnimationTest.cpp
index 61beaff8f4b797058a4d5a699213293442e4b793..78db28ed2b93f58666e23d04996165556ba8625f 100644
--- a/third_party/WebKit/Source/core/animation/AnimationTest.cpp
+++ b/third_party/WebKit/Source/core/animation/AnimationTest.cpp
@@ -38,6 +38,7 @@
#include "core/dom/Document.h"
#include "core/dom/ExceptionCode.h"
#include "core/dom/QualifiedName.h"
+#include "core/testing/DummyPageHolder.h"
#include "platform/weborigin/KURL.h"
#include <gtest/gtest.h>
@@ -53,9 +54,11 @@ protected:
void setUpWithoutStartingTimeline()
{
- document = Document::create();
+ pageHolder = DummyPageHolder::create();
+ document = &pageHolder->document();
document->animationClock().resetTimeForTesting();
timeline = AnimationTimeline::create(document.get());
+ timeline->resetForTesting();
animation = timeline->play(0);
animation->setStartTime(0);
animation->setEffect(makeAnimation());
@@ -86,6 +89,7 @@ protected:
Persistent<AnimationTimeline> timeline;
Persistent<Animation> animation;
TrackExceptionState exceptionState;
+ OwnPtr<DummyPageHolder> pageHolder;
};
TEST_F(AnimationAnimationTest, InitialState)
@@ -183,26 +187,6 @@ TEST_F(AnimationAnimationTest, SetCurrentTimePastContentEnd)
EXPECT_EQ(10, animation->currentTimeInternal());
}
-TEST_F(AnimationAnimationTest, SetCurrentTimeBeforeTimelineStarted)
-{
- setUpWithoutStartingTimeline();
- animation->setCurrentTimeInternal(5);
- EXPECT_EQ(5, animation->currentTimeInternal());
- startTimeline();
- simulateFrame(10);
- EXPECT_EQ(15, animation->currentTimeInternal());
-}
-
-TEST_F(AnimationAnimationTest, SetCurrentTimePastContentEndBeforeTimelineStarted)
-{
- setUpWithoutStartingTimeline();
- animation->setCurrentTime(250 * 1000);
- EXPECT_EQ(250, animation->currentTimeInternal());
- startTimeline();
- simulateFrame(10);
- EXPECT_EQ(250, animation->currentTimeInternal());
-}
-
TEST_F(AnimationAnimationTest, SetCurrentTimeMax)
{
animation->setCurrentTimeInternal(std::numeric_limits<double>::max());
@@ -320,21 +304,6 @@ TEST_F(AnimationAnimationTest, PausePlay)
EXPECT_EQ(20, animation->currentTimeInternal());
}
-TEST_F(AnimationAnimationTest, PauseBeforeTimelineStarted)
-{
- setUpWithoutStartingTimeline();
- animation->pause();
- EXPECT_TRUE(animation->paused());
- animation->play();
- EXPECT_FALSE(animation->paused());
-
- animation->pause();
- startTimeline();
- simulateFrame(100);
- EXPECT_TRUE(animation->paused());
- EXPECT_EQ(0, animation->currentTimeInternal());
-}
-
TEST_F(AnimationAnimationTest, PlayRewindsToStart)
{
animation->setCurrentTimeInternal(30);
@@ -555,17 +524,6 @@ TEST_F(AnimationAnimationTest, SetPlaybackRate)
EXPECT_EQ(20, animation->currentTimeInternal());
}
-TEST_F(AnimationAnimationTest, SetPlaybackRateBeforeTimelineStarted)
-{
- setUpWithoutStartingTimeline();
- animation->setPlaybackRate(2);
- EXPECT_EQ(2, animation->playbackRate());
- EXPECT_EQ(0, animation->currentTimeInternal());
- startTimeline();
- simulateFrame(10);
- EXPECT_EQ(20, animation->currentTimeInternal());
-}
-
TEST_F(AnimationAnimationTest, SetPlaybackRateWhilePaused)
{
simulateFrame(10);

Powered by Google App Engine
This is Rietveld 408576698