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

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

Issue 22707006: Web Animations CSS: Assert underlying value is not used (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Changed to assert Created 7 years, 4 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
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

Powered by Google App Engine
This is Rietveld 408576698