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

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

Issue 947923002: Add AnimationTimingProperties dictionary (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 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/TimingInputTest.cpp
diff --git a/Source/core/animation/TimingInputTest.cpp b/Source/core/animation/TimingInputTest.cpp
index ff66fbd0dd7ad3bba179e7bd510cdbcf49f485e7..1c631e40742907a7c4c18f865add98a022f2c258 100644
--- a/Source/core/animation/TimingInputTest.cpp
+++ b/Source/core/animation/TimingInputTest.cpp
@@ -5,7 +5,7 @@
#include "config.h"
#include "core/animation/TimingInput.h"
-#include "bindings/core/v8/Dictionary.h"
+#include "bindings/core/v8/V8AnimationTimingProperties.h"
#include "core/animation/AnimationNodeTiming.h"
#include "core/animation/AnimationTestHelper.h"
#include <gtest/gtest.h>
@@ -25,7 +25,8 @@ protected:
{
v8::Handle<v8::Object> timingInput = v8::Object::New(m_isolate);
setV8ObjectPropertyAsNumber(timingInput, timingProperty, timingPropertyValue);
- Dictionary timingInputDictionary = Dictionary(v8::Handle<v8::Value>::Cast(timingInput), m_isolate, exceptionState);
+ AnimationTimingProperties timingInputDictionary;
+ V8AnimationTimingProperties::toImpl(m_isolate, timingInput, timingInputDictionary, exceptionState);
return TimingInput::convert(timingInputDictionary);
}
@@ -33,7 +34,8 @@ protected:
{
v8::Handle<v8::Object> timingInput = v8::Object::New(m_isolate);
setV8ObjectPropertyAsString(timingInput, timingProperty, timingPropertyValue);
- Dictionary timingInputDictionary = Dictionary(v8::Handle<v8::Value>::Cast(timingInput), m_isolate, exceptionState);
+ AnimationTimingProperties timingInputDictionary;
+ V8AnimationTimingProperties::toImpl(m_isolate, timingInput, timingInputDictionary, exceptionState);
return TimingInput::convert(timingInputDictionary);
}
@@ -104,9 +106,9 @@ TEST_F(AnimationTimingInputTest, TimingInputIterationDuration)
{
EXPECT_EQ(1.1, applyTimingInputNumber("duration", 1100).iterationDuration);
EXPECT_TRUE(std::isnan(applyTimingInputNumber("duration", -1000).iterationDuration));
- EXPECT_EQ(1, applyTimingInputString("duration", "1000").iterationDuration);
+ EXPECT_TRUE(std::isnan(applyTimingInputString("duration", "1000").iterationDuration));
- Timing timing = applyTimingInputString("duration", "Infinity");
+ Timing timing = applyTimingInputNumber("duration", std::numeric_limits<double>::infinity());
EXPECT_TRUE(std::isinf(timing.iterationDuration));
EXPECT_GT(timing.iterationDuration, 0);
@@ -164,10 +166,7 @@ TEST_F(AnimationTimingInputTest, TimingInputTimingFunction)
TEST_F(AnimationTimingInputTest, TimingInputEmpty)
{
Timing controlTiming;
-
- v8::Handle<v8::Object> timingInput = v8::Object::New(m_isolate);
- Dictionary timingInputDictionary = Dictionary(v8::Handle<v8::Value>::Cast(timingInput), m_isolate, exceptionState);
- Timing updatedTiming = TimingInput::convert(timingInputDictionary);
+ Timing updatedTiming = TimingInput::convert(AnimationTimingProperties());
EXPECT_EQ(controlTiming.startDelay, updatedTiming.startDelay);
EXPECT_EQ(controlTiming.fillMode, updatedTiming.fillMode);

Powered by Google App Engine
This is Rietveld 408576698