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

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

Issue 111683005: Fix AnimationKeyframeEffectModel.MultipleProperties to not depend on the order of CSS prope… (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebased Created 7 years 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/animation/KeyframeEffectModelTest.cpp
diff --git a/Source/core/animation/KeyframeEffectModelTest.cpp b/Source/core/animation/KeyframeEffectModelTest.cpp
index 4599b547cee4cbda0ffb96f307a45e56ac0a9b43..1a44659fbb403c3460fdbeb15b0f82a0c19451ef 100644
--- a/Source/core/animation/KeyframeEffectModelTest.cpp
+++ b/Source/core/animation/KeyframeEffectModelTest.cpp
@@ -75,6 +75,16 @@ void expectDoubleValue(double expectedValue, PassRefPtr<AnimatableValue> value)
EXPECT_FLOAT_EQ(static_cast<float>(expectedValue), actualValue);
}
+const AnimationEffect::CompositableValue* findValue(const AnimationEffect::CompositableValueList& values, CSSPropertyID id)
+{
+ for (size_t i = 0; i < values.size(); ++i) {
+ const std::pair<CSSPropertyID, RefPtr<AnimationEffect::CompositableValue> >& value = values.at(i);
+ if (value.first == id)
+ return value.second.get();
+ }
+ return 0;
+}
+
TEST(AnimationKeyframeEffectModel, BasicOperation)
{
@@ -314,11 +324,13 @@ TEST(AnimationKeyframeEffectModel, MultipleProperties)
RefPtr<KeyframeEffectModel> effect = KeyframeEffectModel::create(keyframes);
OwnPtr<AnimationEffect::CompositableValueList> values = effect->sample(0, 0.6);
- ASSERT_EQ(2UL, values->size());
- EXPECT_TRUE(values->at(0).first == CSSPropertyLeft);
- expectDoubleValue(5.0, values->at(0).second->compositeOnto(unknownAnimatableValue(7.0)));
- EXPECT_TRUE(values->at(1).first == CSSPropertyRight);
- expectDoubleValue(6.0, values->at(1).second->compositeOnto(unknownAnimatableValue(7.0)));
+ EXPECT_EQ(2UL, values->size());
+ const AnimationEffect::CompositableValue* leftValue = findValue(*values.get(), CSSPropertyLeft);
+ ASSERT_TRUE(leftValue);
+ expectDoubleValue(5.0, leftValue->compositeOnto(unknownAnimatableValue(7.0)));
+ const AnimationEffect::CompositableValue* rightValue = findValue(*values.get(), CSSPropertyRight);
+ ASSERT_TRUE(rightValue);
+ expectDoubleValue(6.0, rightValue->compositeOnto(unknownAnimatableValue(7.0)));
}
TEST(AnimationKeyframeEffectModel, RecompositeCompositableValue)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698