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

Side by Side Diff: Source/core/animation/AnimationTimelineTest.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 /* 1 /*
2 * Copyright (c) 2013, Google Inc. All rights reserved. 2 * Copyright (c) 2013, Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 TEST_F(AnimationAnimationTimelineTest, PauseForTesting) 189 TEST_F(AnimationAnimationTimelineTest, PauseForTesting)
190 { 190 {
191 float seekTime = 1; 191 float seekTime = 1;
192 timing.fillMode = Timing::FillModeForwards; 192 timing.fillMode = Timing::FillModeForwards;
193 RefPtrWillBeRawPtr<Animation> anim1 = Animation::create(element.get(), Anima tableValueKeyframeEffectModel::create(AnimatableValueKeyframeVector()), timing); 193 RefPtrWillBeRawPtr<Animation> anim1 = Animation::create(element.get(), Anima tableValueKeyframeEffectModel::create(AnimatableValueKeyframeVector()), timing);
194 RefPtrWillBeRawPtr<Animation> anim2 = Animation::create(element.get(), Anim atableValueKeyframeEffectModel::create(AnimatableValueKeyframeVector()), timing) ; 194 RefPtrWillBeRawPtr<Animation> anim2 = Animation::create(element.get(), Anim atableValueKeyframeEffectModel::create(AnimatableValueKeyframeVector()), timing) ;
195 AnimationPlayer* player1 = timeline->play(anim1.get()); 195 AnimationPlayer* player1 = timeline->play(anim1.get());
196 AnimationPlayer* player2 = timeline->play(anim2.get()); 196 AnimationPlayer* player2 = timeline->play(anim2.get());
197 timeline->pauseAnimationsForTesting(seekTime); 197 timeline->pauseAnimationsForTesting(seekTime);
198 198
199 EXPECT_FLOAT_EQ(seekTime, player1->currentTimeInternal()); 199 EXPECT_FLOAT_EQ(seekTime, player1->currentTime() / 1000.0);
200 EXPECT_FLOAT_EQ(seekTime, player2->currentTimeInternal()); 200 EXPECT_FLOAT_EQ(seekTime, player2->currentTime() / 1000.0);
201 } 201 }
202 202
203 TEST_F(AnimationAnimationTimelineTest, DelayBeforeAnimationStart) 203 TEST_F(AnimationAnimationTimelineTest, DelayBeforeAnimationStart)
204 { 204 {
205 timing.iterationDuration = 2; 205 timing.iterationDuration = 2;
206 timing.startDelay = 5; 206 timing.startDelay = 5;
207 207
208 RefPtrWillBeRawPtr<Animation> anim = Animation::create(element.get(), nullpt r, timing); 208 RefPtrWillBeRawPtr<Animation> anim = Animation::create(element.get(), nullpt r, timing);
209 209
210 timeline->play(anim.get()); 210 timeline->play(anim.get());
(...skipping 28 matching lines...) Expand all
239 239
240 TEST_F(AnimationAnimationTimelineTest, UseAnimationPlayerAfterTimelineDeref) 240 TEST_F(AnimationAnimationTimelineTest, UseAnimationPlayerAfterTimelineDeref)
241 { 241 {
242 RefPtrWillBeRawPtr<AnimationPlayer> player = timeline->createAnimationPlayer (0); 242 RefPtrWillBeRawPtr<AnimationPlayer> player = timeline->createAnimationPlayer (0);
243 timeline.clear(); 243 timeline.clear();
244 // Test passes if this does not crash. 244 // Test passes if this does not crash.
245 player->setStartTime(0); 245 player->setStartTime(0);
246 } 246 }
247 247
248 } 248 }
OLDNEW
« no previous file with comments | « Source/core/animation/AnimationStackTest.cpp ('k') | Source/core/animation/CompositorPendingAnimations.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698