| Index: Source/core/animation/KeyframeEffectModelTest.cpp
|
| diff --git a/Source/core/animation/KeyframeEffectModelTest.cpp b/Source/core/animation/KeyframeEffectModelTest.cpp
|
| index 85e5db4c4ee50d9900978d442f529e1e11022f96..a29d15dd5f6c55109df7162c85e9e198a96b2f38 100644
|
| --- a/Source/core/animation/KeyframeEffectModelTest.cpp
|
| +++ b/Source/core/animation/KeyframeEffectModelTest.cpp
|
| @@ -42,17 +42,17 @@ namespace blink {
|
|
|
| const double duration = 1.0;
|
|
|
| -PassRefPtrWillBeRawPtr<AnimatableValue> unknownAnimatableValue(double n)
|
| +PassRefPtr<AnimatableValue> unknownAnimatableValue(double n)
|
| {
|
| return AnimatableUnknown::create(CSSPrimitiveValue::create(n, CSSPrimitiveValue::UnitType::Unknown).get());
|
| }
|
|
|
| -PassRefPtrWillBeRawPtr<AnimatableValue> pixelAnimatableValue(double n)
|
| +PassRefPtr<AnimatableValue> pixelAnimatableValue(double n)
|
| {
|
| return AnimatableLength::create(Length(n, Fixed), 1);
|
| }
|
|
|
| -AnimatableValueKeyframeVector keyframesAtZeroAndOne(PassRefPtrWillBeRawPtr<AnimatableValue> zeroValue, PassRefPtrWillBeRawPtr<AnimatableValue> oneValue)
|
| +AnimatableValueKeyframeVector keyframesAtZeroAndOne(PassRefPtr<AnimatableValue> zeroValue, PassRefPtr<AnimatableValue> oneValue)
|
| {
|
| AnimatableValueKeyframeVector keyframes(2);
|
| keyframes[0] = AnimatableValueKeyframe::create();
|
| @@ -64,16 +64,16 @@ AnimatableValueKeyframeVector keyframesAtZeroAndOne(PassRefPtrWillBeRawPtr<Anima
|
| return keyframes;
|
| }
|
|
|
| -void expectProperty(CSSPropertyID property, PassRefPtrWillBeRawPtr<Interpolation> interpolationValue)
|
| +void expectProperty(CSSPropertyID property, PassRefPtr<Interpolation> interpolationValue)
|
| {
|
| LegacyStyleInterpolation* interpolation = toLegacyStyleInterpolation(interpolationValue.get());
|
| ASSERT_EQ(property, interpolation->id());
|
| }
|
|
|
| -void expectDoubleValue(double expectedValue, PassRefPtrWillBeRawPtr<Interpolation> interpolationValue)
|
| +void expectDoubleValue(double expectedValue, PassRefPtr<Interpolation> interpolationValue)
|
| {
|
| LegacyStyleInterpolation* interpolation = toLegacyStyleInterpolation(interpolationValue.get());
|
| - RefPtrWillBeRawPtr<AnimatableValue> value = interpolation->currentValue();
|
| + RefPtr<AnimatableValue> value = interpolation->currentValue();
|
|
|
| ASSERT_TRUE(value->isLength() || value->isUnknown());
|
|
|
| @@ -86,7 +86,7 @@ void expectDoubleValue(double expectedValue, PassRefPtrWillBeRawPtr<Interpolatio
|
| EXPECT_FLOAT_EQ(static_cast<float>(expectedValue), actualValue);
|
| }
|
|
|
| -Interpolation* findValue(WillBeHeapVector<RefPtrWillBeMember<Interpolation>>& values, CSSPropertyID id)
|
| +Interpolation* findValue(Vector<RefPtr<Interpolation>>& values, CSSPropertyID id)
|
| {
|
| for (auto& value : values) {
|
| if (toLegacyStyleInterpolation(value.get())->id() == id)
|
| @@ -100,7 +100,7 @@ TEST(AnimationKeyframeEffectModel, BasicOperation)
|
| {
|
| AnimatableValueKeyframeVector keyframes = keyframesAtZeroAndOne(unknownAnimatableValue(3.0), unknownAnimatableValue(5.0));
|
| AnimatableValueKeyframeEffectModel* effect = AnimatableValueKeyframeEffectModel::create(keyframes);
|
| - OwnPtrWillBeRawPtr<WillBeHeapVector<RefPtrWillBeMember<Interpolation>>> values = nullptr;
|
| + OwnPtr<Vector<RefPtr<Interpolation>>> values = nullptr;
|
| effect->sample(0, 0.6, duration, values);
|
| ASSERT_EQ(1UL, values->size());
|
| expectProperty(CSSPropertyLeft, values->at(0));
|
| @@ -113,7 +113,7 @@ TEST(AnimationKeyframeEffectModel, CompositeReplaceNonInterpolable)
|
| keyframes[0]->setComposite(EffectModel::CompositeReplace);
|
| keyframes[1]->setComposite(EffectModel::CompositeReplace);
|
| AnimatableValueKeyframeEffectModel* effect = AnimatableValueKeyframeEffectModel::create(keyframes);
|
| - OwnPtrWillBeRawPtr<WillBeHeapVector<RefPtrWillBeMember<Interpolation>>> values = nullptr;
|
| + OwnPtr<Vector<RefPtr<Interpolation>>> values = nullptr;
|
| effect->sample(0, 0.6, duration, values);
|
| expectDoubleValue(5.0, values->at(0));
|
| }
|
| @@ -124,7 +124,7 @@ TEST(AnimationKeyframeEffectModel, CompositeReplace)
|
| keyframes[0]->setComposite(EffectModel::CompositeReplace);
|
| keyframes[1]->setComposite(EffectModel::CompositeReplace);
|
| AnimatableValueKeyframeEffectModel* effect = AnimatableValueKeyframeEffectModel::create(keyframes);
|
| - OwnPtrWillBeRawPtr<WillBeHeapVector<RefPtrWillBeMember<Interpolation>>> values = nullptr;
|
| + OwnPtr<Vector<RefPtr<Interpolation>>> values = nullptr;
|
| effect->sample(0, 0.6, duration, values);
|
| expectDoubleValue(3.0 * 0.4 + 5.0 * 0.6, values->at(0));
|
| }
|
| @@ -136,7 +136,7 @@ TEST(AnimationKeyframeEffectModel, DISABLED_CompositeAdd)
|
| keyframes[0]->setComposite(EffectModel::CompositeAdd);
|
| keyframes[1]->setComposite(EffectModel::CompositeAdd);
|
| AnimatableValueKeyframeEffectModel* effect = AnimatableValueKeyframeEffectModel::create(keyframes);
|
| - OwnPtrWillBeRawPtr<WillBeHeapVector<RefPtrWillBeMember<Interpolation>>> values = nullptr;
|
| + OwnPtr<Vector<RefPtr<Interpolation>>> values = nullptr;
|
| effect->sample(0, 0.6, duration, values);
|
| expectDoubleValue((7.0 + 3.0) * 0.4 + (7.0 + 5.0) * 0.6, values->at(0));
|
| }
|
| @@ -148,7 +148,7 @@ TEST(AnimationKeyframeEffectModel, CompositeEaseIn)
|
| keyframes[0]->setEasing(CubicBezierTimingFunction::preset(CubicBezierTimingFunction::EaseIn));
|
| keyframes[1]->setComposite(EffectModel::CompositeReplace);
|
| AnimatableValueKeyframeEffectModel* effect = AnimatableValueKeyframeEffectModel::create(keyframes);
|
| - OwnPtrWillBeRawPtr<WillBeHeapVector<RefPtrWillBeMember<Interpolation>>> values = nullptr;
|
| + OwnPtr<Vector<RefPtr<Interpolation>>> values = nullptr;
|
| effect->sample(0, 0.6, duration, values);
|
| expectDoubleValue(3.8579516, values->at(0));
|
| effect->sample(0, 0.6, duration * 100, values);
|
| @@ -162,7 +162,7 @@ TEST(AnimationKeyframeEffectModel, CompositeCubicBezier)
|
| keyframes[0]->setEasing(CubicBezierTimingFunction::create(0.42, 0, 0.58, 1));
|
| keyframes[1]->setComposite(EffectModel::CompositeReplace);
|
| AnimatableValueKeyframeEffectModel* effect = AnimatableValueKeyframeEffectModel::create(keyframes);
|
| - OwnPtrWillBeRawPtr<WillBeHeapVector<RefPtrWillBeMember<Interpolation>>> values = nullptr;
|
| + OwnPtr<Vector<RefPtr<Interpolation>>> values = nullptr;
|
| effect->sample(0, 0.6, duration, values);
|
| expectDoubleValue(4.3363357, values->at(0));
|
| effect->sample(0, 0.6, duration * 1000, values);
|
| @@ -175,7 +175,7 @@ TEST(AnimationKeyframeEffectModel, ExtrapolateReplaceNonInterpolable)
|
| keyframes[0]->setComposite(EffectModel::CompositeReplace);
|
| keyframes[1]->setComposite(EffectModel::CompositeReplace);
|
| AnimatableValueKeyframeEffectModel* effect = AnimatableValueKeyframeEffectModel::create(keyframes);
|
| - OwnPtrWillBeRawPtr<WillBeHeapVector<RefPtrWillBeMember<Interpolation>>> values = nullptr;
|
| + OwnPtr<Vector<RefPtr<Interpolation>>> values = nullptr;
|
| effect->sample(0, 1.6, duration, values);
|
| expectDoubleValue(5.0, values->at(0));
|
| }
|
| @@ -186,7 +186,7 @@ TEST(AnimationKeyframeEffectModel, ExtrapolateReplace)
|
| AnimatableValueKeyframeEffectModel* effect = AnimatableValueKeyframeEffectModel::create(keyframes);
|
| keyframes[0]->setComposite(EffectModel::CompositeReplace);
|
| keyframes[1]->setComposite(EffectModel::CompositeReplace);
|
| - OwnPtrWillBeRawPtr<WillBeHeapVector<RefPtrWillBeMember<Interpolation>>> values = nullptr;
|
| + OwnPtr<Vector<RefPtr<Interpolation>>> values = nullptr;
|
| effect->sample(0, 1.6, duration, values);
|
| expectDoubleValue(3.0 * -0.6 + 5.0 * 1.6, values->at(0));
|
| }
|
| @@ -198,7 +198,7 @@ TEST(AnimationKeyframeEffectModel, DISABLED_ExtrapolateAdd)
|
| keyframes[0]->setComposite(EffectModel::CompositeAdd);
|
| keyframes[1]->setComposite(EffectModel::CompositeAdd);
|
| AnimatableValueKeyframeEffectModel* effect = AnimatableValueKeyframeEffectModel::create(keyframes);
|
| - OwnPtrWillBeRawPtr<WillBeHeapVector<RefPtrWillBeMember<Interpolation>>> values = nullptr;
|
| + OwnPtr<Vector<RefPtr<Interpolation>>> values = nullptr;
|
| effect->sample(0, 1.6, duration, values);
|
| expectDoubleValue((7.0 + 3.0) * -0.6 + (7.0 + 5.0) * 1.6, values->at(0));
|
| }
|
| @@ -206,7 +206,7 @@ TEST(AnimationKeyframeEffectModel, DISABLED_ExtrapolateAdd)
|
| TEST(AnimationKeyframeEffectModel, ZeroKeyframes)
|
| {
|
| AnimatableValueKeyframeEffectModel* effect = AnimatableValueKeyframeEffectModel::create(AnimatableValueKeyframeVector());
|
| - OwnPtrWillBeRawPtr<WillBeHeapVector<RefPtrWillBeMember<Interpolation>>> values = nullptr;
|
| + OwnPtr<Vector<RefPtr<Interpolation>>> values = nullptr;
|
| effect->sample(0, 0.5, duration, values);
|
| EXPECT_TRUE(values->isEmpty());
|
| }
|
| @@ -220,7 +220,7 @@ TEST(AnimationKeyframeEffectModel, DISABLED_SingleKeyframeAtOffsetZero)
|
| keyframes[0]->setPropertyValue(CSSPropertyLeft, unknownAnimatableValue(3.0).get());
|
|
|
| AnimatableValueKeyframeEffectModel* effect = AnimatableValueKeyframeEffectModel::create(keyframes);
|
| - OwnPtrWillBeRawPtr<WillBeHeapVector<RefPtrWillBeMember<Interpolation>>> values = nullptr;
|
| + OwnPtr<Vector<RefPtr<Interpolation>>> values = nullptr;
|
| effect->sample(0, 0.6, duration, values);
|
| expectDoubleValue(3.0, values->at(0));
|
| }
|
| @@ -234,7 +234,7 @@ TEST(AnimationKeyframeEffectModel, DISABLED_SingleKeyframeAtOffsetOne)
|
| keyframes[0]->setPropertyValue(CSSPropertyLeft, pixelAnimatableValue(5.0).get());
|
|
|
| AnimatableValueKeyframeEffectModel* effect = AnimatableValueKeyframeEffectModel::create(keyframes);
|
| - OwnPtrWillBeRawPtr<WillBeHeapVector<RefPtrWillBeMember<Interpolation>>> values = nullptr;
|
| + OwnPtr<Vector<RefPtr<Interpolation>>> values = nullptr;
|
| effect->sample(0, 0.6, duration, values);
|
| expectDoubleValue(7.0 * 0.4 + 5.0 * 0.6, values->at(0));
|
| }
|
| @@ -253,7 +253,7 @@ TEST(AnimationKeyframeEffectModel, MoreThanTwoKeyframes)
|
| keyframes[2]->setPropertyValue(CSSPropertyLeft, unknownAnimatableValue(5.0).get());
|
|
|
| AnimatableValueKeyframeEffectModel* effect = AnimatableValueKeyframeEffectModel::create(keyframes);
|
| - OwnPtrWillBeRawPtr<WillBeHeapVector<RefPtrWillBeMember<Interpolation>>> values = nullptr;
|
| + OwnPtr<Vector<RefPtr<Interpolation>>> values = nullptr;
|
| effect->sample(0, 0.3, duration, values);
|
| expectDoubleValue(4.0, values->at(0));
|
| effect->sample(0, 0.8, duration, values);
|
| @@ -272,7 +272,7 @@ TEST(AnimationKeyframeEffectModel, EndKeyframeOffsetsUnspecified)
|
| keyframes[2]->setPropertyValue(CSSPropertyLeft, unknownAnimatableValue(5.0).get());
|
|
|
| AnimatableValueKeyframeEffectModel* effect = AnimatableValueKeyframeEffectModel::create(keyframes);
|
| - OwnPtrWillBeRawPtr<WillBeHeapVector<RefPtrWillBeMember<Interpolation>>> values = nullptr;
|
| + OwnPtr<Vector<RefPtr<Interpolation>>> values = nullptr;
|
| effect->sample(0, 0.1, duration, values);
|
| expectDoubleValue(3.0, values->at(0));
|
| effect->sample(0, 0.6, duration, values);
|
| @@ -295,7 +295,7 @@ TEST(AnimationKeyframeEffectModel, SampleOnKeyframe)
|
| keyframes[2]->setPropertyValue(CSSPropertyLeft, unknownAnimatableValue(5.0).get());
|
|
|
| AnimatableValueKeyframeEffectModel* effect = AnimatableValueKeyframeEffectModel::create(keyframes);
|
| - OwnPtrWillBeRawPtr<WillBeHeapVector<RefPtrWillBeMember<Interpolation>>> values = nullptr;
|
| + OwnPtr<Vector<RefPtr<Interpolation>>> values = nullptr;
|
| effect->sample(0, 0.0, duration, values);
|
| expectDoubleValue(3.0, values->at(0));
|
| effect->sample(0, 0.5, duration, values);
|
| @@ -336,7 +336,7 @@ TEST(AnimationKeyframeEffectModel, MultipleKeyframesWithSameOffset)
|
| keyframes[8]->setPropertyValue(CSSPropertyLeft, unknownAnimatableValue(7.0).get());
|
|
|
| AnimatableValueKeyframeEffectModel* effect = AnimatableValueKeyframeEffectModel::create(keyframes);
|
| - OwnPtrWillBeRawPtr<WillBeHeapVector<RefPtrWillBeMember<Interpolation>>> values = nullptr;
|
| + OwnPtr<Vector<RefPtr<Interpolation>>> values = nullptr;
|
| effect->sample(0, 0.0, duration, values);
|
| expectDoubleValue(0.0, values->at(0));
|
| effect->sample(0, 0.2, duration, values);
|
| @@ -366,7 +366,7 @@ TEST(AnimationKeyframeEffectModel, DISABLED_PerKeyframeComposite)
|
| keyframes[1]->setComposite(EffectModel::CompositeAdd);
|
|
|
| AnimatableValueKeyframeEffectModel* effect = AnimatableValueKeyframeEffectModel::create(keyframes);
|
| - OwnPtrWillBeRawPtr<WillBeHeapVector<RefPtrWillBeMember<Interpolation>>> values = nullptr;
|
| + OwnPtr<Vector<RefPtr<Interpolation>>> values = nullptr;
|
| effect->sample(0, 0.6, duration, values);
|
| expectDoubleValue(3.0 * 0.4 + (7.0 + 5.0) * 0.6, values->at(0));
|
| }
|
| @@ -384,7 +384,7 @@ TEST(AnimationKeyframeEffectModel, MultipleProperties)
|
| keyframes[1]->setPropertyValue(CSSPropertyRight, unknownAnimatableValue(6.0).get());
|
|
|
| AnimatableValueKeyframeEffectModel* effect = AnimatableValueKeyframeEffectModel::create(keyframes);
|
| - OwnPtrWillBeRawPtr<WillBeHeapVector<RefPtrWillBeMember<Interpolation>>> values = nullptr;
|
| + OwnPtr<Vector<RefPtr<Interpolation>>> values = nullptr;
|
| effect->sample(0, 0.6, duration, values);
|
| EXPECT_EQ(2UL, values->size());
|
| Interpolation* leftValue = findValue(*values.get(), CSSPropertyLeft);
|
| @@ -402,7 +402,7 @@ TEST(AnimationKeyframeEffectModel, DISABLED_RecompositeCompositableValue)
|
| keyframes[0]->setComposite(EffectModel::CompositeAdd);
|
| keyframes[1]->setComposite(EffectModel::CompositeAdd);
|
| AnimatableValueKeyframeEffectModel* effect = AnimatableValueKeyframeEffectModel::create(keyframes);
|
| - OwnPtrWillBeRawPtr<WillBeHeapVector<RefPtrWillBeMember<Interpolation>>> values = nullptr;
|
| + OwnPtr<Vector<RefPtr<Interpolation>>> values = nullptr;
|
| effect->sample(0, 0.6, duration, values);
|
| expectDoubleValue((7.0 + 3.0) * 0.4 + (7.0 + 5.0) * 0.6, values->at(0));
|
| expectDoubleValue((9.0 + 3.0) * 0.4 + (9.0 + 5.0) * 0.6, values->at(0));
|
| @@ -412,7 +412,7 @@ TEST(AnimationKeyframeEffectModel, MultipleIterations)
|
| {
|
| AnimatableValueKeyframeVector keyframes = keyframesAtZeroAndOne(pixelAnimatableValue(1.0), pixelAnimatableValue(3.0));
|
| AnimatableValueKeyframeEffectModel* effect = AnimatableValueKeyframeEffectModel::create(keyframes);
|
| - OwnPtrWillBeRawPtr<WillBeHeapVector<RefPtrWillBeMember<Interpolation>>> values = nullptr;
|
| + OwnPtr<Vector<RefPtr<Interpolation>>> values = nullptr;
|
| effect->sample(0, 0.5, duration, values);
|
| expectDoubleValue(2.0, values->at(0));
|
| effect->sample(1, 0.5, duration, values);
|
| @@ -437,7 +437,7 @@ TEST(AnimationKeyframeEffectModel, DISABLED_DependsOnUnderlyingValue)
|
| keyframes[2]->setPropertyValue(CSSPropertyLeft, pixelAnimatableValue(1.0).get());
|
|
|
| AnimatableValueKeyframeEffectModel* effect = AnimatableValueKeyframeEffectModel::create(keyframes);
|
| - OwnPtrWillBeRawPtr<WillBeHeapVector<RefPtrWillBeMember<Interpolation>>> values = nullptr;
|
| + OwnPtr<Vector<RefPtr<Interpolation>>> values = nullptr;
|
| effect->sample(0, 0, duration, values);
|
| EXPECT_TRUE(values->at(0));
|
| effect->sample(0, 0.1, duration, values);
|
|
|