Chromium Code Reviews| Index: Source/core/animation/KeyframeAnimationEffectTest.cpp |
| diff --git a/Source/core/animation/KeyframeAnimationEffectTest.cpp b/Source/core/animation/KeyframeAnimationEffectTest.cpp |
| index 9975981cddd3a54ab0cd02c51b5051df2b163f4d..07f1a5e734b8b3a7158d46da48116dce25a89433 100644 |
| --- a/Source/core/animation/KeyframeAnimationEffectTest.cpp |
| +++ b/Source/core/animation/KeyframeAnimationEffectTest.cpp |
| @@ -341,4 +341,26 @@ TEST(KeyframeAnimationEffect, MultipleIterations) |
| expectDoubleValue(2.0, effect->sample(2, 0.5)->begin()->value->compositeOnto(unknownAnimatableValue(0.0))); |
| } |
| +TEST(KeyframeAnimationEffect, DependsOnUnderlyingValue) |
| +{ |
| + KeyframeAnimationEffect::KeyframeVector keyframes(3); |
| + keyframes[0] = Keyframe::create(); |
| + keyframes[0]->setOffset(0.0); |
| + keyframes[0]->setPropertyValue(CSSPropertyLeft, pixelAnimatableValue(1.0)); |
| + keyframes[0]->setComposite(AnimationEffect::CompositeAdd); |
| + keyframes[1] = Keyframe::create(); |
| + keyframes[1]->setOffset(0.5); |
| + keyframes[1]->setPropertyValue(CSSPropertyLeft, pixelAnimatableValue(1.0)); |
| + keyframes[2] = Keyframe::create(); |
| + keyframes[2]->setOffset(1.0); |
| + keyframes[2]->setPropertyValue(CSSPropertyLeft, pixelAnimatableValue(1.0)); |
| + |
| + RefPtr<KeyframeAnimationEffect> effect = KeyframeAnimationEffect::create(keyframes); |
| + EXPECT_TRUE(effect->sample(0, 0)->begin()->value->dependsOnUnderlyingValue()); |
| + EXPECT_TRUE(effect->sample(0, 0.25)->begin()->value->dependsOnUnderlyingValue()); |
|
Steve Block
2013/08/09 04:32:31
Testing at 0.25 is a little confusing - it implies
alancutter (OOO until 2018)
2013/08/09 05:46:31
Added more stops to test.
|
| + EXPECT_FALSE(effect->sample(0, 0.5)->begin()->value->dependsOnUnderlyingValue()); |
| + EXPECT_FALSE(effect->sample(0, 0.75)->begin()->value->dependsOnUnderlyingValue()); |
| + EXPECT_FALSE(effect->sample(0, 1)->begin()->value->dependsOnUnderlyingValue()); |
| +} |
| + |
| } // namespace |