| Index: Source/core/animation/AnimationTimelineTest.cpp
|
| diff --git a/Source/core/animation/AnimationTimelineTest.cpp b/Source/core/animation/AnimationTimelineTest.cpp
|
| index bcbe63d56812e58efb59586a0311e01ec854bc3b..3c5ade4c2cf86db24568706b7366cd6d4e2512ac 100644
|
| --- a/Source/core/animation/AnimationTimelineTest.cpp
|
| +++ b/Source/core/animation/AnimationTimelineTest.cpp
|
| @@ -45,7 +45,7 @@
|
|
|
| namespace blink {
|
|
|
| -class MockPlatformTiming : public AnimationTimeline::PlatformTiming {
|
| +class MockPlatformTiming final : public AnimationTimeline::PlatformTiming {
|
| public:
|
|
|
| MOCK_METHOD1(wakeAfter, void(double));
|
| @@ -92,7 +92,7 @@ protected:
|
| document->animationClock().resetTimeForTesting();
|
| element = Element::create(QualifiedName::null() , document.get());
|
| platformTiming = new MockPlatformTiming;
|
| - timeline = AnimationTimeline::create(document.get(), adoptPtrWillBeNoop(platformTiming.get()));
|
| + timeline = AnimationTimeline::create(document.get(), platformTiming);
|
| ASSERT_EQ(0, timeline->currentTimeInternal());
|
| }
|
|
|
| @@ -101,9 +101,7 @@ protected:
|
| document.release();
|
| element.release();
|
| timeline.release();
|
| -#if ENABLE(OILPAN)
|
| Heap::collectAllGarbage();
|
| -#endif
|
| }
|
|
|
| void updateClockAndService(double time)
|
| @@ -116,9 +114,9 @@ protected:
|
|
|
| RefPtrWillBePersistent<Document> document;
|
| RefPtrWillBePersistent<Element> element;
|
| - RefPtrWillBePersistent<AnimationTimeline> timeline;
|
| + Persistent<AnimationTimeline> timeline;
|
| Timing timing;
|
| - RawPtrWillBePersistent<MockPlatformTiming> platformTiming;
|
| + Persistent<MockPlatformTiming> platformTiming;
|
|
|
| void wake()
|
| {
|
| @@ -138,10 +136,10 @@ TEST_F(AnimationAnimationTimelineTest, HasStarted)
|
|
|
| TEST_F(AnimationAnimationTimelineTest, EmptyKeyframeAnimation)
|
| {
|
| - RefPtrWillBeRawPtr<AnimatableValueKeyframeEffectModel> effect = AnimatableValueKeyframeEffectModel::create(AnimatableValueKeyframeVector());
|
| - RefPtrWillBeRawPtr<KeyframeEffect> keyframeEffect = KeyframeEffect::create(element.get(), effect, timing);
|
| + AnimatableValueKeyframeEffectModel* effect = AnimatableValueKeyframeEffectModel::create(AnimatableValueKeyframeVector());
|
| + KeyframeEffect* keyframeEffect = KeyframeEffect::create(element.get(), effect, timing);
|
|
|
| - timeline->play(keyframeEffect.get());
|
| + timeline->play(keyframeEffect);
|
|
|
| platformTiming->expectNoMoreActions();
|
| updateClockAndService(0);
|
| @@ -155,11 +153,11 @@ TEST_F(AnimationAnimationTimelineTest, EmptyKeyframeAnimation)
|
|
|
| TEST_F(AnimationAnimationTimelineTest, EmptyForwardsKeyframeAnimation)
|
| {
|
| - RefPtrWillBeRawPtr<AnimatableValueKeyframeEffectModel> effect = AnimatableValueKeyframeEffectModel::create(AnimatableValueKeyframeVector());
|
| + AnimatableValueKeyframeEffectModel* effect = AnimatableValueKeyframeEffectModel::create(AnimatableValueKeyframeVector());
|
| timing.fillMode = Timing::FillModeForwards;
|
| - RefPtrWillBeRawPtr<KeyframeEffect> keyframeEffect = KeyframeEffect::create(element.get(), effect, timing);
|
| + KeyframeEffect* keyframeEffect = KeyframeEffect::create(element.get(), effect, timing);
|
|
|
| - timeline->play(keyframeEffect.get());
|
| + timeline->play(keyframeEffect);
|
|
|
| platformTiming->expectNoMoreActions();
|
| updateClockAndService(0);
|
| @@ -346,10 +344,10 @@ TEST_F(AnimationAnimationTimelineTest, PauseForTesting)
|
| {
|
| float seekTime = 1;
|
| timing.fillMode = Timing::FillModeForwards;
|
| - RefPtrWillBeRawPtr<KeyframeEffect> anim1 = KeyframeEffect::create(element.get(), AnimatableValueKeyframeEffectModel::create(AnimatableValueKeyframeVector()), timing);
|
| - RefPtrWillBeRawPtr<KeyframeEffect> anim2 = KeyframeEffect::create(element.get(), AnimatableValueKeyframeEffectModel::create(AnimatableValueKeyframeVector()), timing);
|
| - Animation* animation1 = timeline->play(anim1.get());
|
| - Animation* animation2 = timeline->play(anim2.get());
|
| + KeyframeEffect* anim1 = KeyframeEffect::create(element.get(), AnimatableValueKeyframeEffectModel::create(AnimatableValueKeyframeVector()), timing);
|
| + KeyframeEffect* anim2 = KeyframeEffect::create(element.get(), AnimatableValueKeyframeEffectModel::create(AnimatableValueKeyframeVector()), timing);
|
| + Animation* animation1 = timeline->play(anim1);
|
| + Animation* animation2 = timeline->play(anim2);
|
| timeline->pauseAnimationsForTesting(seekTime);
|
|
|
| EXPECT_FLOAT_EQ(seekTime, animation1->currentTime() / 1000.0);
|
| @@ -361,9 +359,9 @@ TEST_F(AnimationAnimationTimelineTest, DelayBeforeAnimationStart)
|
| timing.iterationDuration = 2;
|
| timing.startDelay = 5;
|
|
|
| - RefPtrWillBeRawPtr<KeyframeEffect> keyframeEffect = KeyframeEffect::create(element.get(), nullptr, timing);
|
| + KeyframeEffect* keyframeEffect = KeyframeEffect::create(element.get(), nullptr, timing);
|
|
|
| - timeline->play(keyframeEffect.get());
|
| + timeline->play(keyframeEffect);
|
|
|
| // TODO: Put the animation startTime in the future when we add the capability to change animation startTime
|
| platformTiming->expectDelayedAction(timing.startDelay - minimumDelay());
|
| @@ -388,14 +386,14 @@ TEST_F(AnimationAnimationTimelineTest, PlayAfterDocumentDeref)
|
| element = nullptr;
|
| document = nullptr;
|
|
|
| - RefPtrWillBeRawPtr<KeyframeEffect> keyframeEffect = KeyframeEffect::create(0, nullptr, timing);
|
| + KeyframeEffect* keyframeEffect = KeyframeEffect::create(0, nullptr, timing);
|
| // Test passes if this does not crash.
|
| - timeline->play(keyframeEffect.get());
|
| + timeline->play(keyframeEffect);
|
| }
|
|
|
| TEST_F(AnimationAnimationTimelineTest, UseAnimationAfterTimelineDeref)
|
| {
|
| - RefPtrWillBeRawPtr<Animation> animation = timeline->play(0);
|
| + Animation* animation = timeline->play(0);
|
| timeline.clear();
|
| // Test passes if this does not crash.
|
| animation->setStartTime(0);
|
|
|