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

Side by Side Diff: Source/core/animation/AnimationStackTest.cpp

Issue 638313002: Web Animations: Overhaul and trace play state in AnimationPlayer (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Don't set compositor pending when paused for testing Created 6 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 | Annotate | Revision Log
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 "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
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
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 }
OLDNEW
« no previous file with comments | « Source/core/animation/AnimationPlayerTest.cpp ('k') | Source/core/animation/AnimationTimelineTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698