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

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

Issue 768653002: Revert "Animations: Pass animation timing function through to compositor." (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 1 month 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
Index: Source/core/animation/CompositorAnimationsTest.cpp
diff --git a/Source/core/animation/CompositorAnimationsTest.cpp b/Source/core/animation/CompositorAnimationsTest.cpp
index 4938c9e65eedd47885cb90e02b623f40e7c0f04e..2c8c6ec25a920a8f09e1f9efcd3c4aeb780f0596 100644
--- a/Source/core/animation/CompositorAnimationsTest.cpp
+++ b/Source/core/animation/CompositorAnimationsTest.cpp
@@ -472,11 +472,11 @@ TEST_F(AnimationCompositorAnimationsTest, isCandidateForAnimationOnCompositorTim
{
m_timing.timingFunction = m_cubicEaseTimingFunction;
EXPECT_TRUE(isCandidateForAnimationOnCompositor(m_timing, *m_keyframeAnimationEffect2.get()));
- EXPECT_TRUE(isCandidateForAnimationOnCompositor(m_timing, *m_keyframeAnimationEffect5.get()));
+ EXPECT_FALSE(isCandidateForAnimationOnCompositor(m_timing, *m_keyframeAnimationEffect5.get()));
m_timing.timingFunction = m_cubicCustomTimingFunction;
EXPECT_TRUE(isCandidateForAnimationOnCompositor(m_timing, *m_keyframeAnimationEffect2.get()));
- EXPECT_TRUE(isCandidateForAnimationOnCompositor(m_timing, *m_keyframeAnimationEffect5.get()));
+ EXPECT_FALSE(isCandidateForAnimationOnCompositor(m_timing, *m_keyframeAnimationEffect5.get()));
}
TEST_F(AnimationCompositorAnimationsTest, isCandidateForAnimationOnCompositorTimingFunctionSteps)
@@ -492,22 +492,15 @@ TEST_F(AnimationCompositorAnimationsTest, isCandidateForAnimationOnCompositorTim
EXPECT_TRUE(isCandidateForAnimationOnCompositor(m_timing, *m_keyframeAnimationEffect5.get()));
}
-TEST_F(AnimationCompositorAnimationsTest, isCandidateForAnimationOnCompositorNonLinearTimingFunctionOnFirstOrLastFrame)
+TEST_F(AnimationCompositorAnimationsTest, isCandidateForAnimationOnCompositorNonLinearTimingFunctionOnFirstFrame)
{
- (*m_keyframeVector2)[0]->setEasing(m_cubicEaseTimingFunction.get());
- m_keyframeAnimationEffect2 = AnimatableValueKeyframeEffectModel::create(*m_keyframeVector2);
-
- (*m_keyframeVector5)[3]->setEasing(m_cubicEaseTimingFunction.get());
- m_keyframeAnimationEffect5 = AnimatableValueKeyframeEffectModel::create(*m_keyframeVector5);
+ m_timing.timingFunction = m_cubicEaseTimingFunction;
- m_timing.timingFunction = m_cubicCustomTimingFunction;
+ EXPECT_TRUE(isCandidateForAnimationOnCompositor(m_timing, *m_keyframeAnimationEffect2.get()));
+ (*m_keyframeVector2)[0]->setEasing(m_cubicEaseTimingFunction.get());
+ m_keyframeAnimationEffect2 = AnimatableValueKeyframeEffectModel::create(*m_keyframeVector2);
EXPECT_FALSE(isCandidateForAnimationOnCompositor(m_timing, *m_keyframeAnimationEffect2.get()));
- EXPECT_FALSE(isCandidateForAnimationOnCompositor(m_timing, *m_keyframeAnimationEffect5.get()));
-
- m_timing.timingFunction = m_cubicEaseTimingFunction;
- EXPECT_TRUE(isCandidateForAnimationOnCompositor(m_timing, *m_keyframeAnimationEffect2.get()));
- EXPECT_TRUE(isCandidateForAnimationOnCompositor(m_timing, *m_keyframeAnimationEffect5.get()));
}
TEST_F(AnimationCompositorAnimationsTest, isCandidateForAnimationOnCompositorTimingFunctionChainedCubicMatchingOffsets)
@@ -1112,52 +1105,4 @@ TEST_F(AnimationCompositorAnimationsTest, createSimpleOpacityAnimationFillModeAu
result[0].clear();
}
-TEST_F(AnimationCompositorAnimationsTest, createSimpleOpacityAnimationWithTimingFunction)
-{
- // Animation to convert
- RefPtrWillBeRawPtr<AnimatableValueKeyframeEffectModel> effect = createKeyframeEffectModel(
- createReplaceOpKeyframe(CSSPropertyOpacity, AnimatableDouble::create(2.0).get(), 0),
- createReplaceOpKeyframe(CSSPropertyOpacity, AnimatableDouble::create(5.0).get(), 1.0));
-
- m_timing.timingFunction = m_cubicCustomTimingFunction;
-
- WebCompositorSupportMock mockCompositor;
-
- // Curve is created
- WebFloatAnimationCurveMock* mockCurvePtr = new WebFloatAnimationCurveMock;
- ExpectationSet usesMockCurve;
- EXPECT_CALL(mockCompositor, createFloatAnimationCurve())
- .WillOnce(Return(mockCurvePtr));
-
- usesMockCurve += EXPECT_CALL(*mockCurvePtr, add(WebFloatKeyframe(0.0, 2.0), WebCompositorAnimationCurve::TimingFunctionTypeLinear));
- usesMockCurve += EXPECT_CALL(*mockCurvePtr, add(WebFloatKeyframe(1.0, 5.0)));
- usesMockCurve += EXPECT_CALL(*mockCurvePtr, setTimingFunction(1, 2, 3, 4));
-
- // Create animation
- WebCompositorAnimationMock* mockAnimationPtr = new WebCompositorAnimationMock(WebCompositorAnimation::TargetPropertyOpacity);
- ExpectationSet usesMockAnimation;
-
- usesMockCurve += EXPECT_CALL(mockCompositor, createAnimation(Ref(*mockCurvePtr), WebCompositorAnimation::TargetPropertyOpacity, _, _))
- .WillOnce(Return(mockAnimationPtr));
-
- usesMockAnimation += EXPECT_CALL(*mockAnimationPtr, setIterations(1));
- usesMockAnimation += EXPECT_CALL(*mockAnimationPtr, setTimeOffset(0.0));
- usesMockAnimation += EXPECT_CALL(*mockAnimationPtr, setDirection(blink::WebCompositorAnimation::DirectionNormal));
- usesMockAnimation += EXPECT_CALL(*mockAnimationPtr, setPlaybackRate(1));
-
- EXPECT_CALL(*mockAnimationPtr, delete_())
- .Times(1)
- .After(usesMockAnimation);
- EXPECT_CALL(*mockCurvePtr, delete_())
- .Times(1)
- .After(usesMockCurve);
-
- // Go!
- setCompositorForTesting(mockCompositor);
- Vector<OwnPtr<WebCompositorAnimation> > result;
- getAnimationOnCompositor(m_timing, *effect.get(), result);
- EXPECT_EQ(1U, result.size());
- result[0].clear();
-}
-
} // namespace blink
« no previous file with comments | « Source/core/animation/CompositorAnimations.cpp ('k') | Source/core/animation/CompositorAnimationsTestHelper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698