| Index: Source/core/animation/KeyframeEffectModelTest.cpp
|
| diff --git a/Source/core/animation/KeyframeEffectModelTest.cpp b/Source/core/animation/KeyframeEffectModelTest.cpp
|
| index f6bfc705009f1526ff0a6377be45df21c222dc9f..75a6b21ce10ad2af21c4f67d1b8589710a68fc22 100644
|
| --- a/Source/core/animation/KeyframeEffectModelTest.cpp
|
| +++ b/Source/core/animation/KeyframeEffectModelTest.cpp
|
| @@ -34,6 +34,8 @@
|
| #include "core/animation/AnimatableLength.h"
|
| #include "core/animation/AnimatableUnknown.h"
|
| #include "core/css/CSSPrimitiveValue.h"
|
| +#include "core/css/parser/BisonCSSParser.h"
|
| +#include "core/css/resolver/CSSToStyleMap.h"
|
| #include <gtest/gtest.h>
|
|
|
| using namespace WebCore;
|
| @@ -123,6 +125,28 @@ TEST(AnimationKeyframeEffectModel, CompositeAdd)
|
| expectDoubleValue((7.0 + 3.0) * 0.4 + (7.0 + 5.0) * 0.6, effect->sample(0, 0.6)->at(0).second->compositeOnto(pixelAnimatableValue(7.0)));
|
| }
|
|
|
| +TEST(AnimationKeyframeEffectModel, CompositeEaseIn)
|
| +{
|
| + KeyframeEffectModel::KeyframeVector keyframes = keyframesAtZeroAndOne(pixelAnimatableValue(3.0), pixelAnimatableValue(5.0));
|
| + RefPtr<CSSValue> timingFunction = BisonCSSParser::parseAnimationTimingFunctionValue("ease-in");
|
| + keyframes[0]->setComposite(AnimationEffect::CompositeReplace);
|
| + keyframes[0]->setEasing(CSSToStyleMap::animationTimingFunction(timingFunction.get(), false));
|
| + keyframes[1]->setComposite(AnimationEffect::CompositeReplace);
|
| + RefPtr<KeyframeEffectModel> effect = KeyframeEffectModel::create(keyframes);
|
| + expectDoubleValue(3.8582394, effect->sample(0, 0.6)->at(0).second->compositeOnto(unknownAnimatableValue(7.0)));
|
| +}
|
| +
|
| +TEST(AnimationKeyframeEffectModel, CompositeCubicBezier)
|
| +{
|
| + KeyframeEffectModel::KeyframeVector keyframes = keyframesAtZeroAndOne(pixelAnimatableValue(3.0), pixelAnimatableValue(5.0));
|
| + RefPtr<CSSValue> timingFunction = BisonCSSParser::parseAnimationTimingFunctionValue("cubic-bezier(0.42, 0, 0.58, 1)");
|
| + keyframes[0]->setComposite(AnimationEffect::CompositeReplace);
|
| + keyframes[0]->setEasing(CSSToStyleMap::animationTimingFunction(timingFunction.get(), false));
|
| + keyframes[1]->setComposite(AnimationEffect::CompositeReplace);
|
| + RefPtr<KeyframeEffectModel> effect = KeyframeEffectModel::create(keyframes);
|
| + expectDoubleValue(4.3362322, effect->sample(0, 0.6)->at(0).second->compositeOnto(unknownAnimatableValue(7.0)));
|
| +}
|
| +
|
| TEST(AnimationKeyframeEffectModel, ExtrapolateReplaceNonInterpolable)
|
| {
|
| KeyframeEffectModel::KeyframeVector keyframes = keyframesAtZeroAndOne(unknownAnimatableValue(3.0), unknownAnimatableValue(5.0));
|
|
|