| 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 "config.h" | 5 #include "config.h" |
| 6 #include "core/animation/KeyframeEffect.h" | 6 #include "core/animation/KeyframeEffect.h" |
| 7 | 7 |
| 8 #include "bindings/core/v8/Dictionary.h" | 8 #include "bindings/core/v8/Dictionary.h" |
| 9 #include "bindings/core/v8/UnionTypesCore.h" | 9 #include "bindings/core/v8/UnionTypesCore.h" |
| 10 #include "bindings/core/v8/V8BindingForTesting.h" | 10 #include "bindings/core/v8/V8BindingForTesting.h" |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 RefPtrWillBeRawPtr<KeyframeEffect> animation = createAnimation(element.get()
, jsKeyframes, 0, exceptionState); | 92 RefPtrWillBeRawPtr<KeyframeEffect> animation = createAnimation(element.get()
, jsKeyframes, 0, exceptionState); |
| 93 | 93 |
| 94 Element* target = animation->target(); | 94 Element* target = animation->target(); |
| 95 EXPECT_EQ(*element.get(), *target); | 95 EXPECT_EQ(*element.get(), *target); |
| 96 | 96 |
| 97 const KeyframeVector keyframes = toKeyframeEffectModelBase(animation->model(
))->getFrames(); | 97 const KeyframeVector keyframes = toKeyframeEffectModelBase(animation->model(
))->getFrames(); |
| 98 | 98 |
| 99 EXPECT_EQ(0, keyframes[0]->offset()); | 99 EXPECT_EQ(0, keyframes[0]->offset()); |
| 100 EXPECT_EQ(1, keyframes[1]->offset()); | 100 EXPECT_EQ(1, keyframes[1]->offset()); |
| 101 | 101 |
| 102 const CSSValue* keyframe1Width = toStringKeyframe(keyframes[0].get())->cssPr
opertyValue(CSSPropertyWidth); | 102 const CSSValue keyframe1Width = toStringKeyframe(keyframes[0].get())->cssPro
pertyValue(CSSPropertyWidth); |
| 103 const CSSValue* keyframe2Width = toStringKeyframe(keyframes[1].get())->cssPr
opertyValue(CSSPropertyWidth); | 103 const CSSValue keyframe2Width = toStringKeyframe(keyframes[1].get())->cssPro
pertyValue(CSSPropertyWidth); |
| 104 ASSERT(keyframe1Width); | |
| 105 ASSERT(keyframe2Width); | |
| 106 | 104 |
| 107 EXPECT_EQ("100px", keyframe1Width->cssText()); | 105 EXPECT_EQ("100px", keyframe1Width.cssText()); |
| 108 EXPECT_EQ("0px", keyframe2Width->cssText()); | 106 EXPECT_EQ("0px", keyframe2Width.cssText()); |
| 109 | 107 |
| 110 EXPECT_EQ(*(CubicBezierTimingFunction::preset(CubicBezierTimingFunction::Eas
eInOut)), keyframes[0]->easing()); | 108 EXPECT_EQ(*(CubicBezierTimingFunction::preset(CubicBezierTimingFunction::Eas
eInOut)), keyframes[0]->easing()); |
| 111 EXPECT_EQ(*(CubicBezierTimingFunction::create(1, 1, 0.3, 0.3).get()), keyfra
mes[1]->easing()); | 109 EXPECT_EQ(*(CubicBezierTimingFunction::create(1, 1, 0.3, 0.3).get()), keyfra
mes[1]->easing()); |
| 112 } | 110 } |
| 113 | 111 |
| 114 TEST_F(AnimationKeyframeEffectV8Test, CanSetDuration) | 112 TEST_F(AnimationKeyframeEffectV8Test, CanSetDuration) |
| 115 { | 113 { |
| 116 Vector<Dictionary, 0> jsKeyframes; | 114 Vector<Dictionary, 0> jsKeyframes; |
| 117 double duration = 2000; | 115 double duration = 2000; |
| 118 | 116 |
| (...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 456 EXPECT_EQ(element.get(), animation->target()); | 454 EXPECT_EQ(element.get(), animation->target()); |
| 457 document.timeline().play(animation.get()); | 455 document.timeline().play(animation.get()); |
| 458 pageHolder.clear(); | 456 pageHolder.clear(); |
| 459 element.clear(); | 457 element.clear(); |
| 460 #if !ENABLE(OILPAN) | 458 #if !ENABLE(OILPAN) |
| 461 EXPECT_EQ(0, animation->target()); | 459 EXPECT_EQ(0, animation->target()); |
| 462 #endif | 460 #endif |
| 463 } | 461 } |
| 464 | 462 |
| 465 } // namespace blink | 463 } // namespace blink |
| OLD | NEW |