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

Side by Side Diff: third_party/WebKit/Source/core/animation/KeyframeEffectTest.cpp

Issue 2309873003: Extend PropertyHandle to include custom property identifiers (Closed)
Patch Set: Add unit tests Created 4 years, 2 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 unified diff | Download patch
OLDNEW
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/DictionarySequenceOrDictionary.h" 8 #include "bindings/core/v8/DictionarySequenceOrDictionary.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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 KeyframeEffect* animation = createAnimation(element.get(), jsKeyframes, 0); 83 KeyframeEffect* animation = createAnimation(element.get(), jsKeyframes, 0);
84 84
85 Element* target = animation->target(); 85 Element* target = animation->target();
86 EXPECT_EQ(*element.get(), *target); 86 EXPECT_EQ(*element.get(), *target);
87 87
88 const KeyframeVector keyframes = toKeyframeEffectModelBase(animation->model( ))->getFrames(); 88 const KeyframeVector keyframes = toKeyframeEffectModelBase(animation->model( ))->getFrames();
89 89
90 EXPECT_EQ(0, keyframes[0]->offset()); 90 EXPECT_EQ(0, keyframes[0]->offset());
91 EXPECT_EQ(1, keyframes[1]->offset()); 91 EXPECT_EQ(1, keyframes[1]->offset());
92 92
93 const CSSValue& keyframe1Width = toStringKeyframe(keyframes[0].get())->cssPr opertyValue(CSSPropertyWidth); 93 const CSSValue& keyframe1Width = toStringKeyframe(keyframes[0].get())->cssPr opertyValue(PropertyHandle(CSSPropertyWidth));
94 const CSSValue& keyframe2Width = toStringKeyframe(keyframes[1].get())->cssPr opertyValue(CSSPropertyWidth); 94 const CSSValue& keyframe2Width = toStringKeyframe(keyframes[1].get())->cssPr opertyValue(PropertyHandle(CSSPropertyWidth));
95 95
96 EXPECT_EQ("100px", keyframe1Width.cssText()); 96 EXPECT_EQ("100px", keyframe1Width.cssText());
97 EXPECT_EQ("0px", keyframe2Width.cssText()); 97 EXPECT_EQ("0px", keyframe2Width.cssText());
98 98
99 EXPECT_EQ(*(CubicBezierTimingFunction::preset(CubicBezierTimingFunction::Eas eType::EASE_IN_OUT)), keyframes[0]->easing()); 99 EXPECT_EQ(*(CubicBezierTimingFunction::preset(CubicBezierTimingFunction::Eas eType::EASE_IN_OUT)), keyframes[0]->easing());
100 EXPECT_EQ(*(CubicBezierTimingFunction::create(1, 1, 0.3, 0.3).get()), keyfra mes[1]->easing()); 100 EXPECT_EQ(*(CubicBezierTimingFunction::create(1, 1, 0.3, 0.3).get()), keyfra mes[1]->easing());
101 } 101 }
102 102
103 TEST_F(AnimationKeyframeEffectV8Test, CanSetDuration) 103 TEST_F(AnimationKeyframeEffectV8Test, CanSetDuration)
104 { 104 {
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
367 Timing timing; 367 Timing timing;
368 timing.iterationDuration = 5; 368 timing.iterationDuration = 5;
369 KeyframeEffect* animation = KeyframeEffect::create(element.get(), nullptr, t iming); 369 KeyframeEffect* animation = KeyframeEffect::create(element.get(), nullptr, t iming);
370 EXPECT_EQ(element.get(), animation->target()); 370 EXPECT_EQ(element.get(), animation->target());
371 document().timeline().play(animation); 371 document().timeline().play(animation);
372 pageHolder.reset(); 372 pageHolder.reset();
373 element.clear(); 373 element.clear();
374 } 374 }
375 375
376 } // namespace blink 376 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698