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

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

Issue 182063005: Web Animations API: Refactor IDL input conversion out of Animation (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Review changes Created 6 years, 10 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/AnimationTest.cpp
diff --git a/Source/core/animation/AnimationTest.cpp b/Source/core/animation/AnimationTest.cpp
index beaae605149f07786aca0f6cc05fe5247f832345..497f93c42b8fd027549c1a806fc8812a0857f227 100644
--- a/Source/core/animation/AnimationTest.cpp
+++ b/Source/core/animation/AnimationTest.cpp
@@ -12,6 +12,7 @@
#include "core/animation/AnimationTestHelper.h"
#include "core/animation/DocumentTimeline.h"
#include "core/animation/KeyframeEffectModel.h"
+#include "core/animation/Timing.h"
#include "platform/animation/TimingFunctionTestHelper.h"
#include <gtest/gtest.h>
@@ -43,25 +44,20 @@ protected:
{
}
- v8::Isolate* isolate;
- v8::HandleScope scope;
- v8::Local<v8::Context> context;
- v8::Context::Scope contextScope;
-
- PassRefPtr<Animation> createAnimation(Element* element, Vector<Dictionary> keyframeDictionaryVector, Dictionary timingInput)
+ template<typename T>
+ static PassRefPtr<Animation> createAnimation(Element* element, Vector<Dictionary> keyframeDictionaryVector, T timingInput)
{
- return Animation::createUnsafe(element, keyframeDictionaryVector, timingInput);
+ return Animation::create(element, EffectInput::convert(element, keyframeDictionaryVector, true), timingInput);
}
-
- PassRefPtr<Animation> createAnimation(Element* element, Vector<Dictionary> keyframeDictionaryVector, double timingInput)
+ static PassRefPtr<Animation> createAnimation(Element* element, Vector<Dictionary> keyframeDictionaryVector)
{
- return Animation::createUnsafe(element, keyframeDictionaryVector, timingInput);
+ return Animation::create(element, EffectInput::convert(element, keyframeDictionaryVector, true));
}
- PassRefPtr<Animation> createAnimation(Element* element, Vector<Dictionary> keyframeDictionaryVector)
- {
- return Animation::createUnsafe(element, keyframeDictionaryVector);
- }
+ v8::Isolate* isolate;
+ v8::HandleScope scope;
+ v8::Local<v8::Context> context;
+ v8::Context::Scope contextScope;
};
TEST_F(AnimationAnimationV8Test, CanCreateAnAnimation)
@@ -131,11 +127,11 @@ TEST_F(AnimationAnimationV8Test, CanOmitSpecifiedDuration)
EXPECT_TRUE(std::isnan(animation->specifiedTiming().iterationDuration));
}
-TEST_F(AnimationAnimationV8Test, ClipNegativeDurationToZero)
+TEST_F(AnimationAnimationV8Test, NegativeDurationIsAuto)
{
Vector<Dictionary, 0> jsKeyframes;
RefPtr<Animation> animation = createAnimation(element.get(), jsKeyframes, -2);
- EXPECT_EQ(0, animation->specifiedTiming().iterationDuration);
+ EXPECT_TRUE(std::isnan(animation->specifiedTiming().iterationDuration));
}
TEST_F(AnimationAnimationV8Test, SpecifiedGetters)

Powered by Google App Engine
This is Rietveld 408576698