| 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);
|
|
|