| Index: Source/core/animation/AnimationStackTest.cpp
|
| diff --git a/Source/core/animation/AnimationStackTest.cpp b/Source/core/animation/AnimationStackTest.cpp
|
| index a2e44e9125cb94bf054abe3a1b1b252506da8804..cfe0e210418e57f8b23cf0241bcb29ad8d9ba70d 100644
|
| --- a/Source/core/animation/AnimationStackTest.cpp
|
| +++ b/Source/core/animation/AnimationStackTest.cpp
|
| @@ -25,12 +25,12 @@ protected:
|
| element = document->createElement("foo", ASSERT_NO_EXCEPTION);
|
| }
|
|
|
| - AnimationPlayer* play(Animation* animation, double startTime)
|
| + Animation* play(KeyframeEffect* effect, double startTime)
|
| {
|
| - AnimationPlayer* player = timeline->play(animation);
|
| - player->setStartTime(startTime * 1000);
|
| - player->update(TimingUpdateOnDemand);
|
| - return player;
|
| + Animation* animation = timeline->play(effect);
|
| + animation->setStartTime(startTime * 1000);
|
| + animation->update(TimingUpdateOnDemand);
|
| + return animation;
|
| }
|
|
|
| void updateTimeline(double time)
|
| @@ -44,7 +44,7 @@ protected:
|
| return element->ensureElementAnimations().defaultStack().m_effects;
|
| }
|
|
|
| - PassRefPtrWillBeRawPtr<AnimationEffect> makeAnimationEffect(CSSPropertyID id, PassRefPtrWillBeRawPtr<AnimatableValue> value)
|
| + PassRefPtrWillBeRawPtr<EffectModel> makeEffectModel(CSSPropertyID id, PassRefPtrWillBeRawPtr<AnimatableValue> value)
|
| {
|
| AnimatableValueKeyframeVector keyframes(2);
|
| keyframes[0] = AnimatableValueKeyframe::create();
|
| @@ -56,19 +56,19 @@ protected:
|
| return AnimatableValueKeyframeEffectModel::create(keyframes);
|
| }
|
|
|
| - PassRefPtrWillBeRawPtr<InertAnimation> makeInertAnimation(PassRefPtrWillBeRawPtr<AnimationEffect> effect)
|
| + PassRefPtrWillBeRawPtr<InertAnimation> makeInertAnimation(PassRefPtrWillBeRawPtr<EffectModel> effect)
|
| {
|
| Timing timing;
|
| timing.fillMode = Timing::FillModeBoth;
|
| return InertAnimation::create(effect, timing, false, 0);
|
| }
|
|
|
| - PassRefPtrWillBeRawPtr<Animation> makeAnimation(PassRefPtrWillBeRawPtr<AnimationEffect> effect, double duration = 10)
|
| + PassRefPtrWillBeRawPtr<KeyframeEffect> makeKeyframeEffect(PassRefPtrWillBeRawPtr<EffectModel> effect, double duration = 10)
|
| {
|
| Timing timing;
|
| timing.fillMode = Timing::FillModeBoth;
|
| timing.iterationDuration = duration;
|
| - return Animation::create(element.get(), effect, timing);
|
| + return KeyframeEffect::create(element.get(), effect, timing);
|
| }
|
|
|
| AnimatableValue* interpolationValue(const ActiveInterpolationMap& activeInterpolations, CSSPropertyID id)
|
| @@ -84,49 +84,49 @@ protected:
|
|
|
| TEST_F(AnimationAnimationStackTest, ElementAnimationsSorted)
|
| {
|
| - play(makeAnimation(makeAnimationEffect(CSSPropertyFontSize, AnimatableDouble::create(1))).get(), 10);
|
| - play(makeAnimation(makeAnimationEffect(CSSPropertyFontSize, AnimatableDouble::create(2))).get(), 15);
|
| - play(makeAnimation(makeAnimationEffect(CSSPropertyFontSize, AnimatableDouble::create(3))).get(), 5);
|
| - ActiveInterpolationMap result = AnimationStack::activeInterpolations(&element->elementAnimations()->defaultStack(), 0, 0, Animation::DefaultPriority, 0);
|
| + play(makeKeyframeEffect(makeEffectModel(CSSPropertyFontSize, AnimatableDouble::create(1))).get(), 10);
|
| + play(makeKeyframeEffect(makeEffectModel(CSSPropertyFontSize, AnimatableDouble::create(2))).get(), 15);
|
| + play(makeKeyframeEffect(makeEffectModel(CSSPropertyFontSize, AnimatableDouble::create(3))).get(), 5);
|
| + ActiveInterpolationMap result = AnimationStack::activeInterpolations(&element->elementAnimations()->defaultStack(), 0, 0, KeyframeEffect::DefaultPriority, 0);
|
| EXPECT_EQ(1u, result.size());
|
| EXPECT_TRUE(interpolationValue(result, CSSPropertyFontSize)->equals(AnimatableDouble::create(3).get()));
|
| }
|
|
|
| TEST_F(AnimationAnimationStackTest, NewAnimations)
|
| {
|
| - play(makeAnimation(makeAnimationEffect(CSSPropertyFontSize, AnimatableDouble::create(1))).get(), 15);
|
| - play(makeAnimation(makeAnimationEffect(CSSPropertyZIndex, AnimatableDouble::create(2))).get(), 10);
|
| + play(makeKeyframeEffect(makeEffectModel(CSSPropertyFontSize, AnimatableDouble::create(1))).get(), 15);
|
| + play(makeKeyframeEffect(makeEffectModel(CSSPropertyZIndex, AnimatableDouble::create(2))).get(), 10);
|
| WillBeHeapVector<RawPtrWillBeMember<InertAnimation>> newAnimations;
|
| - RefPtrWillBeRawPtr<InertAnimation> inert1 = makeInertAnimation(makeAnimationEffect(CSSPropertyFontSize, AnimatableDouble::create(3)));
|
| - RefPtrWillBeRawPtr<InertAnimation> inert2 = makeInertAnimation(makeAnimationEffect(CSSPropertyZIndex, AnimatableDouble::create(4)));
|
| + RefPtrWillBeRawPtr<InertAnimation> inert1 = makeInertAnimation(makeEffectModel(CSSPropertyFontSize, AnimatableDouble::create(3)));
|
| + RefPtrWillBeRawPtr<InertAnimation> inert2 = makeInertAnimation(makeEffectModel(CSSPropertyZIndex, AnimatableDouble::create(4)));
|
| newAnimations.append(inert1.get());
|
| newAnimations.append(inert2.get());
|
| - ActiveInterpolationMap result = AnimationStack::activeInterpolations(&element->elementAnimations()->defaultStack(), &newAnimations, 0, Animation::DefaultPriority, 10);
|
| + ActiveInterpolationMap result = AnimationStack::activeInterpolations(&element->elementAnimations()->defaultStack(), &newAnimations, 0, KeyframeEffect::DefaultPriority, 10);
|
| EXPECT_EQ(2u, result.size());
|
| EXPECT_TRUE(interpolationValue(result, CSSPropertyFontSize)->equals(AnimatableDouble::create(3).get()));
|
| EXPECT_TRUE(interpolationValue(result, CSSPropertyZIndex)->equals(AnimatableDouble::create(4).get()));
|
| }
|
|
|
| -TEST_F(AnimationAnimationStackTest, CancelledAnimationPlayers)
|
| +TEST_F(AnimationAnimationStackTest, CancelledAnimations)
|
| {
|
| - WillBeHeapHashSet<RawPtrWillBeMember<const AnimationPlayer>> cancelledAnimationPlayers;
|
| - RefPtrWillBeRawPtr<AnimationPlayer> player = play(makeAnimation(makeAnimationEffect(CSSPropertyFontSize, AnimatableDouble::create(1))).get(), 0);
|
| - cancelledAnimationPlayers.add(player.get());
|
| - play(makeAnimation(makeAnimationEffect(CSSPropertyZIndex, AnimatableDouble::create(2))).get(), 0);
|
| - ActiveInterpolationMap result = AnimationStack::activeInterpolations(&element->elementAnimations()->defaultStack(), 0, &cancelledAnimationPlayers, Animation::DefaultPriority, 0);
|
| + WillBeHeapHashSet<RawPtrWillBeMember<const Animation>> cancelledAnimations;
|
| + RefPtrWillBeRawPtr<Animation> animation = play(makeKeyframeEffect(makeEffectModel(CSSPropertyFontSize, AnimatableDouble::create(1))).get(), 0);
|
| + cancelledAnimations.add(animation.get());
|
| + play(makeKeyframeEffect(makeEffectModel(CSSPropertyZIndex, AnimatableDouble::create(2))).get(), 0);
|
| + ActiveInterpolationMap result = AnimationStack::activeInterpolations(&element->elementAnimations()->defaultStack(), 0, &cancelledAnimations, KeyframeEffect::DefaultPriority, 0);
|
| EXPECT_EQ(1u, result.size());
|
| EXPECT_TRUE(interpolationValue(result, CSSPropertyZIndex)->equals(AnimatableDouble::create(2).get()));
|
| }
|
|
|
| TEST_F(AnimationAnimationStackTest, ClearedEffectsRemoved)
|
| {
|
| - RefPtrWillBeRawPtr<AnimationPlayer> player = play(makeAnimation(makeAnimationEffect(CSSPropertyFontSize, AnimatableDouble::create(1))).get(), 10);
|
| - ActiveInterpolationMap result = AnimationStack::activeInterpolations(&element->elementAnimations()->defaultStack(), 0, 0, Animation::DefaultPriority, 0);
|
| + RefPtrWillBeRawPtr<Animation> animation = play(makeKeyframeEffect(makeEffectModel(CSSPropertyFontSize, AnimatableDouble::create(1))).get(), 10);
|
| + ActiveInterpolationMap result = AnimationStack::activeInterpolations(&element->elementAnimations()->defaultStack(), 0, 0, KeyframeEffect::DefaultPriority, 0);
|
| EXPECT_EQ(1u, result.size());
|
| EXPECT_TRUE(interpolationValue(result, CSSPropertyFontSize)->equals(AnimatableDouble::create(1).get()));
|
|
|
| - player->setSource(0);
|
| - result = AnimationStack::activeInterpolations(&element->elementAnimations()->defaultStack(), 0, 0, Animation::DefaultPriority, 0);
|
| + animation->setSource(0);
|
| + result = AnimationStack::activeInterpolations(&element->elementAnimations()->defaultStack(), 0, 0, KeyframeEffect::DefaultPriority, 0);
|
| EXPECT_EQ(0u, result.size());
|
| }
|
|
|
|
|