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

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: Rebased 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
« no previous file with comments | « Source/core/animation/Animation.cpp ('k') | Source/core/animation/AnimationTimingInputTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/animation/AnimationTest.cpp
diff --git a/Source/core/animation/AnimationTest.cpp b/Source/core/animation/AnimationTest.cpp
index e118578b3b6896aa62910eaa024bd7f92404b8b8..ed8d86b4ec296734a220f9a6f23d475a485a82a7 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 <gtest/gtest.h>
@@ -40,19 +41,14 @@ protected:
{
}
- 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);
- }
-
- PassRefPtr<Animation> createAnimation(Element* element, Vector<Dictionary> keyframeDictionaryVector)
- {
- return Animation::createUnsafe(element, keyframeDictionaryVector);
+ return Animation::create(element, EffectInput::convert(element, keyframeDictionaryVector, true));
}
v8::Isolate* m_isolate;
@@ -128,11 +124,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)
« no previous file with comments | « Source/core/animation/Animation.cpp ('k') | Source/core/animation/AnimationTimingInputTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698