Index: Source/core/animation/CompositorAnimationsTest.cpp |
diff --git a/Source/core/animation/CompositorAnimationsTest.cpp b/Source/core/animation/CompositorAnimationsTest.cpp |
index f39ecf3da7b3e260e6e0e603fc878c684e64a141..c0705a3bfad45c256f4dbe52983b9e5ffc6d3413 100644 |
--- a/Source/core/animation/CompositorAnimationsTest.cpp |
+++ b/Source/core/animation/CompositorAnimationsTest.cpp |
@@ -392,20 +392,21 @@ TEST_F(AnimationCompositorAnimationsTest, ConvertTimingForCompositorPlaybackRate |
TEST_F(AnimationCompositorAnimationsTest, ConvertTimingForCompositorDirection) |
{ |
+ m_timing.direction = Timing::PlaybackDirectionNormal; |
+ EXPECT_TRUE(convertTimingForCompositor(m_timing, m_compositorTiming)); |
+ EXPECT_EQ(m_compositorTiming.direction, Timing::PlaybackDirectionNormal); |
+ |
m_timing.direction = Timing::PlaybackDirectionAlternate; |
EXPECT_TRUE(convertTimingForCompositor(m_timing, m_compositorTiming)); |
- EXPECT_TRUE(m_compositorTiming.alternate); |
- EXPECT_FALSE(m_compositorTiming.reverse); |
+ EXPECT_EQ(m_compositorTiming.direction, Timing::PlaybackDirectionAlternate); |
m_timing.direction = Timing::PlaybackDirectionAlternateReverse; |
EXPECT_TRUE(convertTimingForCompositor(m_timing, m_compositorTiming)); |
- EXPECT_TRUE(m_compositorTiming.alternate); |
- EXPECT_TRUE(m_compositorTiming.reverse); |
+ EXPECT_EQ(m_compositorTiming.direction, Timing::PlaybackDirectionAlternateReverse); |
m_timing.direction = Timing::PlaybackDirectionReverse; |
EXPECT_TRUE(convertTimingForCompositor(m_timing, m_compositorTiming)); |
- EXPECT_FALSE(m_compositorTiming.alternate); |
- EXPECT_TRUE(m_compositorTiming.reverse); |
+ EXPECT_EQ(m_compositorTiming.direction, Timing::PlaybackDirectionReverse); |
} |
TEST_F(AnimationCompositorAnimationsTest, ConvertTimingForCompositorDirectionIterationsAndStartDelay) |
@@ -417,8 +418,7 @@ TEST_F(AnimationCompositorAnimationsTest, ConvertTimingForCompositorDirectionIte |
EXPECT_TRUE(convertTimingForCompositor(m_timing, m_compositorTiming)); |
EXPECT_DOUBLE_EQ(6.0, m_compositorTiming.scaledTimeOffset); |
EXPECT_EQ(4, m_compositorTiming.adjustedIterationCount); |
- EXPECT_TRUE(m_compositorTiming.alternate); |
- EXPECT_FALSE(m_compositorTiming.reverse); |
+ EXPECT_EQ(m_compositorTiming.direction, Timing::PlaybackDirectionAlternate); |
m_timing.direction = Timing::PlaybackDirectionAlternate; |
m_timing.iterationCount = 4.0; |
@@ -427,8 +427,7 @@ TEST_F(AnimationCompositorAnimationsTest, ConvertTimingForCompositorDirectionIte |
EXPECT_TRUE(convertTimingForCompositor(m_timing, m_compositorTiming)); |
EXPECT_DOUBLE_EQ(11.0, m_compositorTiming.scaledTimeOffset); |
EXPECT_EQ(4, m_compositorTiming.adjustedIterationCount); |
- EXPECT_TRUE(m_compositorTiming.alternate); |
- EXPECT_FALSE(m_compositorTiming.reverse); |
+ EXPECT_EQ(m_compositorTiming.direction, Timing::PlaybackDirectionAlternate); |
m_timing.direction = Timing::PlaybackDirectionAlternateReverse; |
m_timing.iterationCount = 4.0; |
@@ -437,8 +436,7 @@ TEST_F(AnimationCompositorAnimationsTest, ConvertTimingForCompositorDirectionIte |
EXPECT_TRUE(convertTimingForCompositor(m_timing, m_compositorTiming)); |
EXPECT_DOUBLE_EQ(6.0, m_compositorTiming.scaledTimeOffset); |
EXPECT_EQ(4, m_compositorTiming.adjustedIterationCount); |
- EXPECT_TRUE(m_compositorTiming.alternate); |
- EXPECT_TRUE(m_compositorTiming.reverse); |
+ EXPECT_EQ(m_compositorTiming.direction, Timing::PlaybackDirectionAlternateReverse); |
m_timing.direction = Timing::PlaybackDirectionAlternateReverse; |
m_timing.iterationCount = 4.0; |
@@ -447,8 +445,7 @@ TEST_F(AnimationCompositorAnimationsTest, ConvertTimingForCompositorDirectionIte |
EXPECT_TRUE(convertTimingForCompositor(m_timing, m_compositorTiming)); |
EXPECT_DOUBLE_EQ(11.0, m_compositorTiming.scaledTimeOffset); |
EXPECT_EQ(4, m_compositorTiming.adjustedIterationCount); |
- EXPECT_TRUE(m_compositorTiming.alternate); |
- EXPECT_TRUE(m_compositorTiming.reverse); |
+ EXPECT_EQ(m_compositorTiming.direction, Timing::PlaybackDirectionAlternateReverse); |
} |
TEST_F(AnimationCompositorAnimationsTest, isCandidateForAnimationOnCompositorTimingTimingFunctionPassThru) |
@@ -613,7 +610,7 @@ TEST_F(AnimationCompositorAnimationsTest, createSimpleOpacityAnimation) |
usesMockAnimation += EXPECT_CALL(*mockAnimationPtr, setIterations(1)); |
usesMockAnimation += EXPECT_CALL(*mockAnimationPtr, setTimeOffset(0.0)); |
- usesMockAnimation += EXPECT_CALL(*mockAnimationPtr, setAlternatesDirection(false)); |
+ usesMockAnimation += EXPECT_CALL(*mockAnimationPtr, setDirection(blink::WebCompositorAnimation::DirectionNormal)); |
EXPECT_CALL(*mockAnimationPtr, delete_()) |
.Times(1) |
@@ -660,7 +657,7 @@ TEST_F(AnimationCompositorAnimationsTest, createSimpleOpacityAnimationDuration) |
usesMockAnimation += EXPECT_CALL(*mockAnimationPtr, setIterations(1)); |
usesMockAnimation += EXPECT_CALL(*mockAnimationPtr, setTimeOffset(0.0)); |
- usesMockAnimation += EXPECT_CALL(*mockAnimationPtr, setAlternatesDirection(false)); |
+ usesMockAnimation += EXPECT_CALL(*mockAnimationPtr, setDirection(blink::WebCompositorAnimation::DirectionNormal)); |
EXPECT_CALL(*mockAnimationPtr, delete_()) |
.Times(1) |
@@ -713,7 +710,7 @@ TEST_F(AnimationCompositorAnimationsTest, createMultipleKeyframeOpacityAnimation |
usesMockAnimation += EXPECT_CALL(*mockAnimationPtr, setIterations(5)); |
usesMockAnimation += EXPECT_CALL(*mockAnimationPtr, setTimeOffset(0.0)); |
- usesMockAnimation += EXPECT_CALL(*mockAnimationPtr, setAlternatesDirection(true)); |
+ usesMockAnimation += EXPECT_CALL(*mockAnimationPtr, setDirection(blink::WebCompositorAnimation::DirectionAlternate)); |
EXPECT_CALL(*mockAnimationPtr, delete_()) |
.Times(1) |
@@ -762,7 +759,7 @@ TEST_F(AnimationCompositorAnimationsTest, createSimpleOpacityAnimationStartDelay |
usesMockAnimation += EXPECT_CALL(*mockAnimationPtr, setIterations(5)); |
usesMockAnimation += EXPECT_CALL(*mockAnimationPtr, setTimeOffset(-3.25)); |
- usesMockAnimation += EXPECT_CALL(*mockAnimationPtr, setAlternatesDirection(false)); |
+ usesMockAnimation += EXPECT_CALL(*mockAnimationPtr, setDirection(blink::WebCompositorAnimation::DirectionNormal)); |
EXPECT_CALL(*mockAnimationPtr, delete_()) |
.Times(1) |
@@ -821,7 +818,7 @@ TEST_F(AnimationCompositorAnimationsTest, createMultipleKeyframeOpacityAnimation |
usesMockAnimation += EXPECT_CALL(*mockAnimationPtr, setIterations(10)); |
usesMockAnimation += EXPECT_CALL(*mockAnimationPtr, setTimeOffset(0.0)); |
- usesMockAnimation += EXPECT_CALL(*mockAnimationPtr, setAlternatesDirection(true)); |
+ usesMockAnimation += EXPECT_CALL(*mockAnimationPtr, setDirection(blink::WebCompositorAnimation::DirectionAlternate)); |
EXPECT_CALL(*mockAnimationPtr, delete_()) |
.Times(1) |
@@ -867,10 +864,10 @@ TEST_F(AnimationCompositorAnimationsTest, createReversedOpacityAnimation) |
EXPECT_CALL(mockCompositor, createFloatAnimationCurve()) |
.WillOnce(Return(mockCurvePtr)); |
- usesMockCurve += EXPECT_CALL(*mockCurvePtr, add(WebFloatKeyframe(0.0, 5.0), 1.0, 0.0, 1.0, 1.0)); |
- usesMockCurve += EXPECT_CALL(*mockCurvePtr, add(WebFloatKeyframe(0.5, 20.0), WebCompositorAnimationCurve::TimingFunctionTypeLinear)); |
- usesMockCurve += EXPECT_CALL(*mockCurvePtr, add(WebFloatKeyframe(0.75, -1.0), WebCompositorAnimationCurve::TimingFunctionTypeEaseOut)); |
- usesMockCurve += EXPECT_CALL(*mockCurvePtr, add(WebFloatKeyframe(1.0, 2.0))); |
+ usesMockCurve += EXPECT_CALL(*mockCurvePtr, add(blink::WebFloatKeyframe(0.0, 2.0), blink::WebCompositorAnimationCurve::TimingFunctionTypeEaseIn)); |
+ usesMockCurve += EXPECT_CALL(*mockCurvePtr, add(blink::WebFloatKeyframe(0.25, -1.0), blink::WebCompositorAnimationCurve::TimingFunctionTypeLinear)); |
+ usesMockCurve += EXPECT_CALL(*mockCurvePtr, add(blink::WebFloatKeyframe(0.5, 20.0), 0.0, 0.0, 0.0, 1.0)); |
+ usesMockCurve += EXPECT_CALL(*mockCurvePtr, add(blink::WebFloatKeyframe(1.0, 5.0))); |
// Create the animation |
WebCompositorAnimationMock* mockAnimationPtr = new WebCompositorAnimationMock(WebCompositorAnimation::TargetPropertyOpacity); |
@@ -881,7 +878,7 @@ TEST_F(AnimationCompositorAnimationsTest, createReversedOpacityAnimation) |
usesMockAnimation += EXPECT_CALL(*mockAnimationPtr, setIterations(10)); |
usesMockAnimation += EXPECT_CALL(*mockAnimationPtr, setTimeOffset(0.0)); |
- usesMockAnimation += EXPECT_CALL(*mockAnimationPtr, setAlternatesDirection(true)); |
+ usesMockAnimation += EXPECT_CALL(*mockAnimationPtr, setDirection(blink::WebCompositorAnimation::DirectionAlternateReverse)); |
EXPECT_CALL(*mockAnimationPtr, delete_()) |
.Times(1) |
@@ -919,8 +916,8 @@ TEST_F(AnimationCompositorAnimationsTest, createReversedOpacityAnimationNegative |
EXPECT_CALL(mockCompositor, createFloatAnimationCurve()) |
.WillOnce(Return(mockCurvePtr)); |
- usesMockCurve += EXPECT_CALL(*mockCurvePtr, add(WebFloatKeyframe(0.0, 5.0), WebCompositorAnimationCurve::TimingFunctionTypeLinear)); |
- usesMockCurve += EXPECT_CALL(*mockCurvePtr, add(WebFloatKeyframe(1.5, 2.0))); |
+ usesMockCurve += EXPECT_CALL(*mockCurvePtr, add(blink::WebFloatKeyframe(0.0, 2.0), blink::WebCompositorAnimationCurve::TimingFunctionTypeLinear)); |
+ usesMockCurve += EXPECT_CALL(*mockCurvePtr, add(blink::WebFloatKeyframe(1.5, 5.0))); |
// Create animation |
WebCompositorAnimationMock* mockAnimationPtr = new WebCompositorAnimationMock(WebCompositorAnimation::TargetPropertyOpacity); |
@@ -931,7 +928,7 @@ TEST_F(AnimationCompositorAnimationsTest, createReversedOpacityAnimationNegative |
usesMockAnimation += EXPECT_CALL(*mockAnimationPtr, setIterations(5)); |
usesMockAnimation += EXPECT_CALL(*mockAnimationPtr, setTimeOffset(3.0)); |
- usesMockAnimation += EXPECT_CALL(*mockAnimationPtr, setAlternatesDirection(true)); |
+ usesMockAnimation += EXPECT_CALL(*mockAnimationPtr, setDirection(blink::WebCompositorAnimation::DirectionAlternateReverse)); |
EXPECT_CALL(*mockAnimationPtr, delete_()) |
.Times(1) |