Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(292)

Unified Diff: Source/core/animation/KeyframeEffectModelTest.cpp

Issue 552123003: Create timing functions directly instead of using parser in KeyframeEffectModelTest (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/animation/KeyframeEffectModelTest.cpp
diff --git a/Source/core/animation/KeyframeEffectModelTest.cpp b/Source/core/animation/KeyframeEffectModelTest.cpp
index 9a8dd458de7785585c3838d767856efa0237ef65..9c309d76a54da0107816198436abc2463f35fa6b 100644
--- a/Source/core/animation/KeyframeEffectModelTest.cpp
+++ b/Source/core/animation/KeyframeEffectModelTest.cpp
@@ -35,8 +35,6 @@
#include "core/animation/animatable/AnimatableLength.h"
#include "core/animation/animatable/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 blink;
@@ -141,9 +139,8 @@ TEST(AnimationKeyframeEffectModel, DISABLED_CompositeAdd)
TEST(AnimationKeyframeEffectModel, CompositeEaseIn)
{
AnimatableValueKeyframeVector keyframes = keyframesAtZeroAndOne(pixelAnimatableValue(3.0), pixelAnimatableValue(5.0));
- RefPtrWillBeRawPtr<CSSValue> timingFunction = BisonCSSParser::parseAnimationTimingFunctionValue("ease-in");
keyframes[0]->setComposite(AnimationEffect::CompositeReplace);
- keyframes[0]->setEasing(CSSToStyleMap::mapAnimationTimingFunction(timingFunction.get(), true));
+ keyframes[0]->setEasing(CubicBezierTimingFunction::preset(CubicBezierTimingFunction::EaseIn));
keyframes[1]->setComposite(AnimationEffect::CompositeReplace);
RefPtrWillBeRawPtr<AnimatableValueKeyframeEffectModel> effect = AnimatableValueKeyframeEffectModel::create(keyframes);
expectDoubleValue(3.8579516, effect->sample(0, 0.6, duration)->at(0));
@@ -153,9 +150,8 @@ TEST(AnimationKeyframeEffectModel, CompositeEaseIn)
TEST(AnimationKeyframeEffectModel, CompositeCubicBezier)
{
AnimatableValueKeyframeVector keyframes = keyframesAtZeroAndOne(pixelAnimatableValue(3.0), pixelAnimatableValue(5.0));
- RefPtrWillBeRawPtr<CSSValue> timingFunction = BisonCSSParser::parseAnimationTimingFunctionValue("cubic-bezier(0.42, 0, 0.58, 1)");
keyframes[0]->setComposite(AnimationEffect::CompositeReplace);
- keyframes[0]->setEasing(CSSToStyleMap::mapAnimationTimingFunction(timingFunction.get(), true));
+ keyframes[0]->setEasing(CubicBezierTimingFunction::create(0.42, 0, 0.58, 1));
keyframes[1]->setComposite(AnimationEffect::CompositeReplace);
RefPtrWillBeRawPtr<AnimatableValueKeyframeEffectModel> effect = AnimatableValueKeyframeEffectModel::create(keyframes);
expectDoubleValue(4.3363357, effect->sample(0, 0.6, duration)->at(0));
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698