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

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

Issue 105273010: Web Animations API: Start implementation of timing input objects. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Change to use Dictionary instead of Object 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
Index: Source/core/animation/ElementAnimationTest.cpp
diff --git a/Source/core/animation/ElementAnimationTest.cpp b/Source/core/animation/ElementAnimationTest.cpp
index 241a26582d1127447aefb07d1427119203b952e7..7766f97ed03b2b83e6f71b2f874cda04aa21548c 100644
--- a/Source/core/animation/ElementAnimationTest.cpp
+++ b/Source/core/animation/ElementAnimationTest.cpp
@@ -75,10 +75,9 @@ protected:
{
ElementAnimation::startAnimation(element, keyframesDictionaryVector);
}
-
- void startAnimationWithSpecifiedDuration(Element* element, Vector<Dictionary> keyframesDictionaryVector, double duration)
+ void startAnimation(Element* element, Vector<Dictionary> keyframesDictionaryVector, v8::Handle<v8::Value> timingInput)
{
- ElementAnimation::startAnimation(element, keyframesDictionaryVector, duration);
+ ElementAnimation::startAnimation(element, keyframesDictionaryVector, timingInput);
}
};
@@ -109,7 +108,8 @@ TEST_F(AnimationElementAnimationTest, CanStartAnAnimation)
ASSERT_TRUE(jsKeyframes[1].get("width", value2));
ASSERT_EQ("0px", value2);
- startAnimationWithSpecifiedDuration(element.get(), jsKeyframes, 0);
+ v8::Handle<v8::Value> durationValue = v8::Handle<v8::Value>::Cast(v8::Number::New(isolate, 0));
+ startAnimation(element.get(), jsKeyframes, durationValue);
Player* player = document->timeline()->players().at(0).get();
@@ -156,9 +156,10 @@ TEST_F(AnimationElementAnimationTest, CanSetDuration)
v8::Context::Scope contextScope(context);
Vector<Dictionary, 0> jsKeyframes;
- double duration = 2;
- startAnimationWithSpecifiedDuration(element.get(), jsKeyframes, duration);
+ double duration = 2;
+ v8::Handle<v8::Value> durationValue = v8::Handle<v8::Value>::Cast(v8::Number::New(isolate, duration));
+ startAnimation(element.get(), jsKeyframes, durationValue);
Player* player = document->timeline()->players().at(0).get();
@@ -179,11 +180,7 @@ TEST_F(AnimationElementAnimationTest, CanOmitSpecifiedDuration)
Player* player = document->timeline()->players().at(0).get();
- // FIXME: This is correct for the moment, as using c++ default arguments means
- // there is no way to tell whether a duration has been specified by the user.
- // Once we implment timing object arguments we should be able to tell, and this
- // check should be changed to EXPECT_FALSE.
- EXPECT_TRUE(player->source()->specified().hasIterationDuration);
+ EXPECT_FALSE(player->source()->specified().hasIterationDuration);
EXPECT_EQ(0, player->source()->specified().iterationDuration);
}
@@ -195,9 +192,9 @@ TEST_F(AnimationElementAnimationTest, ClipNegativeDurationToZero)
v8::Context::Scope contextScope(context);
Vector<Dictionary, 0> jsKeyframes;
- double duration = -2;
- startAnimationWithSpecifiedDuration(element.get(), jsKeyframes, duration);
+ v8::Handle<v8::Value> durationValue = v8::Handle<v8::Value>::Cast(v8::Number::New(isolate, -2));
+ startAnimation(element.get(), jsKeyframes, durationValue);
Player* player = document->timeline()->players().at(0).get();
« Source/core/animation/ElementAnimation.idl ('K') | « Source/core/animation/ElementAnimation.idl ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698