| Index: Source/core/animation/AnimationStackTest.cpp
|
| diff --git a/Source/core/animation/AnimationStackTest.cpp b/Source/core/animation/AnimationStackTest.cpp
|
| index 177a795961b449e6c46b0abfd22f50c7ed6a85bd..e5e37305783b72078b85b04cff997fde093f4a04 100644
|
| --- a/Source/core/animation/AnimationStackTest.cpp
|
| +++ b/Source/core/animation/AnimationStackTest.cpp
|
| @@ -39,31 +39,31 @@ protected:
|
| timeline->serviceAnimations(TimingUpdateForAnimationFrame);
|
| }
|
|
|
| - const WillBeHeapVector<OwnPtrWillBeMember<SampledEffect>>& effects()
|
| + const HeapVector<Member<SampledEffect>>& effects()
|
| {
|
| return element->ensureElementAnimations().defaultStack().m_effects;
|
| }
|
|
|
| - PassRefPtrWillBeRawPtr<AnimationEffect> makeAnimationEffect(CSSPropertyID id, PassRefPtrWillBeRawPtr<AnimatableValue> value)
|
| + AnimationEffect* makeAnimationEffect(CSSPropertyID id, AnimatableValue* value)
|
| {
|
| AnimatableValueKeyframeVector keyframes(2);
|
| keyframes[0] = AnimatableValueKeyframe::create();
|
| keyframes[0]->setOffset(0.0);
|
| - keyframes[0]->setPropertyValue(id, value.get());
|
| + keyframes[0]->setPropertyValue(id, value);
|
| keyframes[1] = AnimatableValueKeyframe::create();
|
| keyframes[1]->setOffset(1.0);
|
| - keyframes[1]->setPropertyValue(id, value.get());
|
| + keyframes[1]->setPropertyValue(id, value);
|
| return AnimatableValueKeyframeEffectModel::create(keyframes);
|
| }
|
|
|
| - PassRefPtrWillBeRawPtr<InertAnimation> makeInertAnimation(PassRefPtrWillBeRawPtr<AnimationEffect> effect)
|
| + InertAnimation* makeInertAnimation(AnimationEffect* effect)
|
| {
|
| Timing timing;
|
| timing.fillMode = Timing::FillModeBoth;
|
| return InertAnimation::create(effect, timing, false, 0);
|
| }
|
|
|
| - PassRefPtrWillBeRawPtr<Animation> makeAnimation(PassRefPtrWillBeRawPtr<AnimationEffect> effect, double duration = 10)
|
| + Animation* makeAnimation(AnimationEffect* effect, double duration = 10)
|
| {
|
| Timing timing;
|
| timing.fillMode = Timing::FillModeBoth;
|
| @@ -74,48 +74,48 @@ protected:
|
| AnimatableValue* interpolationValue(const ActiveInterpolationMap& activeInterpolations, CSSPropertyID id)
|
| {
|
| Interpolation& interpolation = *activeInterpolations.get(PropertyHandle(id));
|
| - return toLegacyStyleInterpolation(interpolation).currentValue().get();
|
| + return toLegacyStyleInterpolation(interpolation).currentValue();
|
| }
|
|
|
| RefPtrWillBePersistent<Document> document;
|
| - RefPtrWillBePersistent<AnimationTimeline> timeline;
|
| + Persistent<AnimationTimeline> timeline;
|
| RefPtrWillBePersistent<Element> element;
|
| };
|
|
|
| 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);
|
| + play(makeAnimation(makeAnimationEffect(CSSPropertyFontSize, AnimatableDouble::create(1))), 10);
|
| + play(makeAnimation(makeAnimationEffect(CSSPropertyFontSize, AnimatableDouble::create(2))), 15);
|
| + play(makeAnimation(makeAnimationEffect(CSSPropertyFontSize, AnimatableDouble::create(3))), 5);
|
| ActiveInterpolationMap result = AnimationStack::activeInterpolations(&element->elementAnimations()->defaultStack(), 0, 0, Animation::DefaultPriority, 0);
|
| EXPECT_EQ(1u, result.size());
|
| - EXPECT_TRUE(interpolationValue(result, CSSPropertyFontSize)->equals(AnimatableDouble::create(3).get()));
|
| + EXPECT_TRUE(interpolationValue(result, CSSPropertyFontSize)->equals(AnimatableDouble::create(3)));
|
| }
|
|
|
| TEST_F(AnimationAnimationStackTest, NewAnimations)
|
| {
|
| - play(makeAnimation(makeAnimationEffect(CSSPropertyFontSize, AnimatableDouble::create(1))).get(), 15);
|
| - play(makeAnimation(makeAnimationEffect(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)));
|
| - newAnimations.append(inert1.get());
|
| - newAnimations.append(inert2.get());
|
| + play(makeAnimation(makeAnimationEffect(CSSPropertyFontSize, AnimatableDouble::create(1))), 15);
|
| + play(makeAnimation(makeAnimationEffect(CSSPropertyZIndex, AnimatableDouble::create(2))), 10);
|
| + HeapVector<Member<InertAnimation>> newAnimations;
|
| + InertAnimation* inert1 = makeInertAnimation(makeAnimationEffect(CSSPropertyFontSize, AnimatableDouble::create(3)));
|
| + InertAnimation* inert2 = makeInertAnimation(makeAnimationEffect(CSSPropertyZIndex, AnimatableDouble::create(4)));
|
| + newAnimations.append(inert1);
|
| + newAnimations.append(inert2);
|
| ActiveInterpolationMap result = AnimationStack::activeInterpolations(&element->elementAnimations()->defaultStack(), &newAnimations, 0, Animation::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()));
|
| + EXPECT_TRUE(interpolationValue(result, CSSPropertyFontSize)->equals(AnimatableDouble::create(3)));
|
| + EXPECT_TRUE(interpolationValue(result, CSSPropertyZIndex)->equals(AnimatableDouble::create(4)));
|
| }
|
|
|
| TEST_F(AnimationAnimationStackTest, CancelledAnimationPlayers)
|
| {
|
| WillBeHeapHashSet<RawPtrWillBeMember<const AnimationPlayer>> cancelledAnimationPlayers;
|
| - RefPtrWillBeRawPtr<AnimationPlayer> player = play(makeAnimation(makeAnimationEffect(CSSPropertyFontSize, AnimatableDouble::create(1))).get(), 0);
|
| + RefPtrWillBeRawPtr<AnimationPlayer> player = play(makeAnimation(makeAnimationEffect(CSSPropertyFontSize, AnimatableDouble::create(1))), 0);
|
| cancelledAnimationPlayers.add(player.get());
|
| - play(makeAnimation(makeAnimationEffect(CSSPropertyZIndex, AnimatableDouble::create(2))).get(), 0);
|
| + play(makeAnimation(makeAnimationEffect(CSSPropertyZIndex, AnimatableDouble::create(2))), 0);
|
| ActiveInterpolationMap result = AnimationStack::activeInterpolations(&element->elementAnimations()->defaultStack(), 0, &cancelledAnimationPlayers, Animation::DefaultPriority, 0);
|
| EXPECT_EQ(1u, result.size());
|
| - EXPECT_TRUE(interpolationValue(result, CSSPropertyZIndex)->equals(AnimatableDouble::create(2).get()));
|
| + EXPECT_TRUE(interpolationValue(result, CSSPropertyZIndex)->equals(AnimatableDouble::create(2)));
|
| }
|
|
|
| }
|
|
|