| Index: Source/core/animation/AnimationStackTest.cpp
|
| diff --git a/Source/core/animation/AnimationStackTest.cpp b/Source/core/animation/AnimationStackTest.cpp
|
| index 7482ac6cbcf883e5b2a3cc02d1d71431139e688d..60a74ec5fa78e2758e1e3ef37eea789f66b1b632 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<EffectModel> makeEffectModel(CSSPropertyID id, PassRefPtrWillBeRawPtr<AnimatableValue> value)
|
| + EffectModel* makeEffectModel(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<InertEffect> makeInertEffect(PassRefPtrWillBeRawPtr<EffectModel> effect)
|
| + InertEffect* makeInertEffect(EffectModel* effect)
|
| {
|
| Timing timing;
|
| timing.fillMode = Timing::FillModeBoth;
|
| return InertEffect::create(effect, timing, false, 0);
|
| }
|
|
|
| - PassRefPtrWillBeRawPtr<KeyframeEffect> makeKeyframeEffect(PassRefPtrWillBeRawPtr<EffectModel> effect, double duration = 10)
|
| + KeyframeEffect* makeKeyframeEffect(EffectModel* effect, double duration = 10)
|
| {
|
| Timing timing;
|
| timing.fillMode = Timing::FillModeBoth;
|
| @@ -74,56 +74,56 @@ 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(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);
|
| + play(makeKeyframeEffect(makeEffectModel(CSSPropertyFontSize, AnimatableDouble::create(1))), 10);
|
| + play(makeKeyframeEffect(makeEffectModel(CSSPropertyFontSize, AnimatableDouble::create(2))), 15);
|
| + play(makeKeyframeEffect(makeEffectModel(CSSPropertyFontSize, AnimatableDouble::create(3))), 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()));
|
| + EXPECT_TRUE(interpolationValue(result, CSSPropertyFontSize)->equals(AnimatableDouble::create(3)));
|
| }
|
|
|
| TEST_F(AnimationAnimationStackTest, NewAnimations)
|
| {
|
| - play(makeKeyframeEffect(makeEffectModel(CSSPropertyFontSize, AnimatableDouble::create(1))).get(), 15);
|
| - play(makeKeyframeEffect(makeEffectModel(CSSPropertyZIndex, AnimatableDouble::create(2))).get(), 10);
|
| - WillBeHeapVector<RawPtrWillBeMember<InertEffect>> newAnimations;
|
| - RefPtrWillBeRawPtr<InertEffect> inert1 = makeInertEffect(makeEffectModel(CSSPropertyFontSize, AnimatableDouble::create(3)));
|
| - RefPtrWillBeRawPtr<InertEffect> inert2 = makeInertEffect(makeEffectModel(CSSPropertyZIndex, AnimatableDouble::create(4)));
|
| - newAnimations.append(inert1.get());
|
| - newAnimations.append(inert2.get());
|
| + play(makeKeyframeEffect(makeEffectModel(CSSPropertyFontSize, AnimatableDouble::create(1))), 15);
|
| + play(makeKeyframeEffect(makeEffectModel(CSSPropertyZIndex, AnimatableDouble::create(2))), 10);
|
| + HeapVector<Member<InertEffect>> newAnimations;
|
| + InertEffect* inert1 = makeInertEffect(makeEffectModel(CSSPropertyFontSize, AnimatableDouble::create(3)));
|
| + InertEffect* inert2 = makeInertEffect(makeEffectModel(CSSPropertyZIndex, AnimatableDouble::create(4)));
|
| + newAnimations.append(inert1);
|
| + newAnimations.append(inert2);
|
| 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()));
|
| + EXPECT_TRUE(interpolationValue(result, CSSPropertyFontSize)->equals(AnimatableDouble::create(3)));
|
| + EXPECT_TRUE(interpolationValue(result, CSSPropertyZIndex)->equals(AnimatableDouble::create(4)));
|
| }
|
|
|
| TEST_F(AnimationAnimationStackTest, CancelledAnimations)
|
| {
|
| - 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);
|
| + HeapHashSet<Member<const Animation>> cancelledAnimations;
|
| + Animation* animation = play(makeKeyframeEffect(makeEffectModel(CSSPropertyFontSize, AnimatableDouble::create(1))), 0);
|
| + cancelledAnimations.add(animation);
|
| + play(makeKeyframeEffect(makeEffectModel(CSSPropertyZIndex, AnimatableDouble::create(2))), 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()));
|
| + EXPECT_TRUE(interpolationValue(result, CSSPropertyZIndex)->equals(AnimatableDouble::create(2)));
|
| }
|
|
|
| TEST_F(AnimationAnimationStackTest, ClearedEffectsRemoved)
|
| {
|
| - RefPtrWillBeRawPtr<Animation> animation = play(makeKeyframeEffect(makeEffectModel(CSSPropertyFontSize, AnimatableDouble::create(1))).get(), 10);
|
| + Animation* animation = play(makeKeyframeEffect(makeEffectModel(CSSPropertyFontSize, AnimatableDouble::create(1))), 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()));
|
| + EXPECT_TRUE(interpolationValue(result, CSSPropertyFontSize)->equals(AnimatableDouble::create(1)));
|
|
|
| animation->setSource(0);
|
| result = AnimationStack::activeInterpolations(&element->elementAnimations()->defaultStack(), 0, 0, KeyframeEffect::DefaultPriority, 0);
|
|
|