| 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/Animation.h" | 6 #include "core/animation/Animation.h" |
| 7 | 7 |
| 8 #include "bindings/v8/Dictionary.h" | 8 #include "bindings/v8/Dictionary.h" |
| 9 #include "core/animation/AnimatableLength.h" | 9 #include "core/animation/AnimatableLength.h" |
| 10 #include "core/animation/AnimationClock.h" | 10 #include "core/animation/AnimationClock.h" |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 | 81 |
| 82 String value2; | 82 String value2; |
| 83 ASSERT_TRUE(jsKeyframes[1].get("width", value2)); | 83 ASSERT_TRUE(jsKeyframes[1].get("width", value2)); |
| 84 ASSERT_EQ("0px", value2); | 84 ASSERT_EQ("0px", value2); |
| 85 | 85 |
| 86 RefPtr<Animation> animation = createAnimation(element.get(), jsKeyframes, 0,
exceptionState); | 86 RefPtr<Animation> animation = createAnimation(element.get(), jsKeyframes, 0,
exceptionState); |
| 87 | 87 |
| 88 Element* target = animation->target(); | 88 Element* target = animation->target(); |
| 89 EXPECT_EQ(*element.get(), *target); | 89 EXPECT_EQ(*element.get(), *target); |
| 90 | 90 |
| 91 const KeyframeVector keyframes = toKeyframeEffectModelBase(animation->effect
())->getFrames(); | 91 const KeyframeEffectModel::KeyframeVector keyframes = |
| 92 toKeyframeEffectModel(animation->effect())->getFrames(); |
| 92 | 93 |
| 93 EXPECT_EQ(0, keyframes[0]->offset()); | 94 EXPECT_EQ(0, keyframes[0]->offset()); |
| 94 EXPECT_EQ(1, keyframes[1]->offset()); | 95 EXPECT_EQ(1, keyframes[1]->offset()); |
| 95 | 96 |
| 96 const AnimatableValue* keyframe1Width = toAnimatableValueKeyframe(keyframes[
0].get())->propertyValue(CSSPropertyWidth); | 97 const AnimatableValue* keyframe1Width = keyframes[0]->propertyValue(CSSPrope
rtyWidth); |
| 97 const AnimatableValue* keyframe2Width = toAnimatableValueKeyframe(keyframes[
1].get())->propertyValue(CSSPropertyWidth); | 98 const AnimatableValue* keyframe2Width = keyframes[1]->propertyValue(CSSPrope
rtyWidth); |
| 98 ASSERT(keyframe1Width); | 99 ASSERT(keyframe1Width); |
| 99 ASSERT(keyframe2Width); | 100 ASSERT(keyframe2Width); |
| 100 | 101 |
| 101 EXPECT_TRUE(keyframe1Width->isLength()); | 102 EXPECT_TRUE(keyframe1Width->isLength()); |
| 102 EXPECT_TRUE(keyframe2Width->isLength()); | 103 EXPECT_TRUE(keyframe2Width->isLength()); |
| 103 | 104 |
| 104 EXPECT_EQ("100px", toAnimatableLength(keyframe1Width)->toCSSValue()->cssText
()); | 105 EXPECT_EQ("100px", toAnimatableLength(keyframe1Width)->toCSSValue()->cssText
()); |
| 105 EXPECT_EQ("0px", toAnimatableLength(keyframe2Width)->toCSSValue()->cssText()
); | 106 EXPECT_EQ("0px", toAnimatableLength(keyframe2Width)->toCSSValue()->cssText()
); |
| 106 | 107 |
| 107 EXPECT_EQ(*(CubicBezierTimingFunction::preset(CubicBezierTimingFunction::Eas
eInOut)), *keyframes[0]->easing()); | 108 EXPECT_EQ(*(CubicBezierTimingFunction::preset(CubicBezierTimingFunction::Eas
eInOut)), *keyframes[0]->easing()); |
| (...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 446 player->setCurrentTime(150); | 447 player->setCurrentTime(150); |
| 447 EXPECT_EQ(inf, animation->timeToForwardsEffectChange()); | 448 EXPECT_EQ(inf, animation->timeToForwardsEffectChange()); |
| 448 EXPECT_EQ(0, animation->timeToReverseEffectChange()); | 449 EXPECT_EQ(0, animation->timeToReverseEffectChange()); |
| 449 | 450 |
| 450 player->setCurrentTime(200); | 451 player->setCurrentTime(200); |
| 451 EXPECT_EQ(inf, animation->timeToForwardsEffectChange()); | 452 EXPECT_EQ(inf, animation->timeToForwardsEffectChange()); |
| 452 EXPECT_EQ(50, animation->timeToReverseEffectChange()); | 453 EXPECT_EQ(50, animation->timeToReverseEffectChange()); |
| 453 } | 454 } |
| 454 | 455 |
| 455 } // namespace WebCore | 456 } // namespace WebCore |
| OLD | NEW |