Chromium Code Reviews| Index: Source/core/animation/AnimationStackTest.cpp |
| diff --git a/Source/core/animation/AnimationStackTest.cpp b/Source/core/animation/AnimationStackTest.cpp |
| index 177a795961b449e6c46b0abfd22f50c7ed6a85bd..d71b0bf7135190e755f70fcb83792ca57d9516db 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> makeAnimation(PassRefPtrWillBeRawPtr<EffectModel> effect, double duration = 10) |
|
alancutter (OOO until 2018)
2015/05/05 01:04:51
makeKeyframeEffect?
dstockwell
2015/05/05 03:33:25
Done.
|
| { |
| 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,36 +84,36 @@ 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(makeAnimation(makeEffectModel(CSSPropertyFontSize, AnimatableDouble::create(1))).get(), 10); |
| + play(makeAnimation(makeEffectModel(CSSPropertyFontSize, AnimatableDouble::create(2))).get(), 15); |
| + play(makeAnimation(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(makeAnimation(makeEffectModel(CSSPropertyFontSize, AnimatableDouble::create(1))).get(), 15); |
| + play(makeAnimation(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> player = play(makeAnimation(makeEffectModel(CSSPropertyFontSize, AnimatableDouble::create(1))).get(), 0); |
|
alancutter (OOO until 2018)
2015/05/05 01:04:51
s/player/animation/
dstockwell
2015/05/05 03:33:25
Done.
|
| + cancelledAnimations.add(player.get()); |
| + play(makeAnimation(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())); |
| } |