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

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: Review changes 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
« no previous file with comments | « Source/core/animation/KeyframeAnimationEffect.cpp ('k') | Source/core/css/resolver/StyleResolver.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/animation/KeyframeAnimationEffectTest.cpp
diff --git a/Source/core/animation/KeyframeAnimationEffectTest.cpp b/Source/core/animation/KeyframeAnimationEffectTest.cpp
index 9975981cddd3a54ab0cd02c51b5051df2b163f4d..03787a517985a9e2c3335ba7e55c9968fcb95a12 100644
--- a/Source/core/animation/KeyframeAnimationEffectTest.cpp
+++ b/Source/core/animation/KeyframeAnimationEffectTest.cpp
@@ -341,4 +341,30 @@ 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.1)->begin()->value->dependsOnUnderlyingValue());
+ EXPECT_TRUE(effect->sample(0, 0.25)->begin()->value->dependsOnUnderlyingValue());
+ EXPECT_TRUE(effect->sample(0, 0.4)->begin()->value->dependsOnUnderlyingValue());
+ EXPECT_FALSE(effect->sample(0, 0.5)->begin()->value->dependsOnUnderlyingValue());
+ EXPECT_FALSE(effect->sample(0, 0.6)->begin()->value->dependsOnUnderlyingValue());
+ EXPECT_FALSE(effect->sample(0, 0.75)->begin()->value->dependsOnUnderlyingValue());
+ EXPECT_FALSE(effect->sample(0, 0.8)->begin()->value->dependsOnUnderlyingValue());
+ EXPECT_FALSE(effect->sample(0, 1)->begin()->value->dependsOnUnderlyingValue());
+}
+
} // namespace
« no previous file with comments | « Source/core/animation/KeyframeAnimationEffect.cpp ('k') | Source/core/css/resolver/StyleResolver.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698