| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "core/animation/KeyframeEffect.h" | 5 #include "core/animation/KeyframeEffect.h" |
| 6 | 6 |
| 7 #include "bindings/core/v8/Dictionary.h" | 7 #include "bindings/core/v8/Dictionary.h" |
| 8 #include "bindings/core/v8/UnionTypesCore.h" | 8 #include "bindings/core/v8/UnionTypesCore.h" |
| 9 #include "bindings/core/v8/V8BindingForTesting.h" | 9 #include "bindings/core/v8/V8BindingForTesting.h" |
| 10 #include "bindings/core/v8/V8KeyframeEffectOptions.h" | 10 #include "bindings/core/v8/V8KeyframeEffectOptions.h" |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 | 229 |
| 230 EXPECT_EQ(1, specified->playbackRate()); | 230 EXPECT_EQ(1, specified->playbackRate()); |
| 231 specified->setPlaybackRate(2); | 231 specified->setPlaybackRate(2); |
| 232 EXPECT_EQ(2, specified->playbackRate()); | 232 EXPECT_EQ(2, specified->playbackRate()); |
| 233 | 233 |
| 234 EXPECT_EQ("normal", specified->direction()); | 234 EXPECT_EQ("normal", specified->direction()); |
| 235 specified->setDirection("reverse"); | 235 specified->setDirection("reverse"); |
| 236 EXPECT_EQ("reverse", specified->direction()); | 236 EXPECT_EQ("reverse", specified->direction()); |
| 237 | 237 |
| 238 EXPECT_EQ("linear", specified->easing()); | 238 EXPECT_EQ("linear", specified->easing()); |
| 239 specified->setEasing("step-start"); | 239 specified->setEasing("step-start", exceptionState); |
| 240 ASSERT_FALSE(exceptionState.hadException()); |
| 240 EXPECT_EQ("step-start", specified->easing()); | 241 EXPECT_EQ("step-start", specified->easing()); |
| 241 } | 242 } |
| 242 | 243 |
| 243 TEST_F(AnimationKeyframeEffectV8Test, SetSpecifiedDuration) | 244 TEST_F(AnimationKeyframeEffectV8Test, SetSpecifiedDuration) |
| 244 { | 245 { |
| 245 Vector<Dictionary, 0> jsKeyframes; | 246 Vector<Dictionary, 0> jsKeyframes; |
| 246 v8::Local<v8::Object> timingInput = v8::Object::New(m_isolate); | 247 v8::Local<v8::Object> timingInput = v8::Object::New(m_isolate); |
| 247 KeyframeEffectOptions timingInputDictionary; | 248 KeyframeEffectOptions timingInputDictionary; |
| 248 V8KeyframeEffectOptions::toImpl(m_isolate, timingInput, timingInputDictionar
y, exceptionState); | 249 V8KeyframeEffectOptions::toImpl(m_isolate, timingInput, timingInputDictionar
y, exceptionState); |
| 249 KeyframeEffect* animation = createAnimation(element.get(), jsKeyframes, timi
ngInputDictionary, exceptionState); | 250 KeyframeEffect* animation = createAnimation(element.get(), jsKeyframes, timi
ngInputDictionary, exceptionState); |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 370 Timing timing; | 371 Timing timing; |
| 371 timing.iterationDuration = 5; | 372 timing.iterationDuration = 5; |
| 372 KeyframeEffect* animation = KeyframeEffect::create(element.get(), nullptr, t
iming); | 373 KeyframeEffect* animation = KeyframeEffect::create(element.get(), nullptr, t
iming); |
| 373 EXPECT_EQ(element.get(), animation->target()); | 374 EXPECT_EQ(element.get(), animation->target()); |
| 374 document().timeline().play(animation); | 375 document().timeline().play(animation); |
| 375 pageHolder.clear(); | 376 pageHolder.clear(); |
| 376 element.clear(); | 377 element.clear(); |
| 377 } | 378 } |
| 378 | 379 |
| 379 } // namespace blink | 380 } // namespace blink |
| OLD | NEW |