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/AnimationStack.h" | 6 #include "core/animation/AnimationStack.h" |
7 | 7 |
8 #include "core/animation/ActiveAnimations.h" | 8 #include "core/animation/ActiveAnimations.h" |
9 #include "core/animation/AnimationClock.h" | 9 #include "core/animation/AnimationClock.h" |
10 #include "core/animation/AnimationTimeline.h" | 10 #include "core/animation/AnimationTimeline.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 { | 21 { |
22 document = Document::create(); | 22 document = Document::create(); |
23 document->animationClock().resetTimeForTesting(); | 23 document->animationClock().resetTimeForTesting(); |
24 timeline = AnimationTimeline::create(document.get()); | 24 timeline = AnimationTimeline::create(document.get()); |
25 element = document->createElement("foo", ASSERT_NO_EXCEPTION); | 25 element = document->createElement("foo", ASSERT_NO_EXCEPTION); |
26 } | 26 } |
27 | 27 |
28 AnimationPlayer* play(Animation* animation, double startTime) | 28 AnimationPlayer* play(Animation* animation, double startTime) |
29 { | 29 { |
30 AnimationPlayer* player = timeline->createAnimationPlayer(animation); | 30 AnimationPlayer* player = timeline->createAnimationPlayer(animation); |
31 player->setStartTimeInternal(startTime); | 31 player->setStartTime(startTime * 1000); |
32 player->update(TimingUpdateOnDemand); | 32 player->update(TimingUpdateOnDemand); |
33 return player; | 33 return player; |
34 } | 34 } |
35 | 35 |
36 void updateTimeline(double time) | 36 void updateTimeline(double time) |
37 { | 37 { |
38 document->animationClock().updateTime(time); | 38 document->animationClock().updateTime(time); |
39 timeline->serviceAnimations(TimingUpdateForAnimationFrame); | 39 timeline->serviceAnimations(TimingUpdateForAnimationFrame); |
40 } | 40 } |
41 | 41 |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 EXPECT_EQ(2u, effects().size()); | 145 EXPECT_EQ(2u, effects().size()); |
146 | 146 |
147 updateTimeline(17); | 147 updateTimeline(17); |
148 Heap::collectAllGarbage(); | 148 Heap::collectAllGarbage(); |
149 interpolations = AnimationStack::activeInterpolations(&element->activeAnimat
ions()->defaultStack(), 0, 0, Animation::DefaultPriority, 0); | 149 interpolations = AnimationStack::activeInterpolations(&element->activeAnimat
ions()->defaultStack(), 0, 0, Animation::DefaultPriority, 0); |
150 EXPECT_TRUE(interpolationValue(interpolations.get(CSSPropertyFontSize))->equ
als(AnimatableDouble::create(3).get())); | 150 EXPECT_TRUE(interpolationValue(interpolations.get(CSSPropertyFontSize))->equ
als(AnimatableDouble::create(3).get())); |
151 EXPECT_EQ(1u, effects().size()); | 151 EXPECT_EQ(1u, effects().size()); |
152 } | 152 } |
153 | 153 |
154 } | 154 } |
OLD | NEW |