Index: Source/core/animation/ElementAnimationTest.cpp |
diff --git a/Source/core/animation/ElementAnimationTest.cpp b/Source/core/animation/ElementAnimationTest.cpp |
index 1530c38fb700191dc041e05acc26c9f8d0d8b535..8cc8620ef87e027451302aec59df7335e5104788 100644 |
--- a/Source/core/animation/ElementAnimationTest.cpp |
+++ b/Source/core/animation/ElementAnimationTest.cpp |
@@ -76,10 +76,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); |
} |
}; |
@@ -110,7 +109,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(); |
@@ -157,9 +157,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(); |
@@ -180,11 +181,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); |
} |
@@ -196,9 +193,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(); |