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