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

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 default fill back to "forwards". Move timing input processing into method. Created 6 years, 11 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/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();
« Source/core/animation/ElementAnimation.cpp ('K') | « Source/core/animation/ElementAnimation.idl ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698