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

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

Issue 170603003: Use nullptr_t for RefPtr, PassRefPtr and RawPtr. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Final rebase Created 6 years, 10 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 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 platformTiming->expectNoMoreActions(); 245 platformTiming->expectNoMoreActions();
246 updateClockAndService(3); 246 updateClockAndService(3);
247 EXPECT_EQ(1U, timeline->numberOfActiveAnimationsForTesting()); 247 EXPECT_EQ(1U, timeline->numberOfActiveAnimationsForTesting());
248 } 248 }
249 249
250 TEST_F(AnimationDocumentTimelineTest, DelayBeforeAnimationStart) 250 TEST_F(AnimationDocumentTimelineTest, DelayBeforeAnimationStart)
251 { 251 {
252 timing.iterationDuration = 2; 252 timing.iterationDuration = 2;
253 timing.startDelay = 5; 253 timing.startDelay = 5;
254 254
255 RefPtr<Animation> anim = Animation::create(element.get(), 0, timing); 255 RefPtr<Animation> anim = Animation::create(element.get(), nullptr, timing);
256 256
257 timeline->play(anim.get()); 257 timeline->play(anim.get());
258 258
259 // TODO: Put the player startTime in the future when we add the capability t o change player startTime 259 // TODO: Put the player startTime in the future when we add the capability t o change player startTime
260 platformTiming->expectDelayedAction(timing.startDelay - minimumDelay()); 260 platformTiming->expectDelayedAction(timing.startDelay - minimumDelay());
261 updateClockAndService(0); 261 updateClockAndService(0);
262 262
263 platformTiming->expectDelayedAction(timing.startDelay - minimumDelay() - 1.5 ); 263 platformTiming->expectDelayedAction(timing.startDelay - minimumDelay() - 1.5 );
264 updateClockAndService(1.5); 264 updateClockAndService(1.5);
265 265
266 EXPECT_CALL(*platformTiming, serviceOnNextFrame()); 266 EXPECT_CALL(*platformTiming, serviceOnNextFrame());
267 wake(); 267 wake();
268 268
269 platformTiming->expectNextFrameAction(); 269 platformTiming->expectNextFrameAction();
270 updateClockAndService(4.98); 270 updateClockAndService(4.98);
271 } 271 }
272 272
273 TEST_F(AnimationDocumentTimelineTest, PlayAfterDocumentDeref) 273 TEST_F(AnimationDocumentTimelineTest, PlayAfterDocumentDeref)
274 { 274 {
275 timing.iterationDuration = 2; 275 timing.iterationDuration = 2;
276 timing.startDelay = 5; 276 timing.startDelay = 5;
277 277
278 timeline = document->timeline(); 278 timeline = document->timeline();
279 element = 0; 279 element = nullptr;
280 document = 0; 280 document = nullptr;
281 281
282 RefPtr<Animation> anim = Animation::create(0, 0, timing); 282 RefPtr<Animation> anim = Animation::create(nullptr, nullptr, timing);
283 // Test passes if this does not crash. 283 // Test passes if this does not crash.
284 timeline->play(anim.get()); 284 timeline->play(anim.get());
285 } 285 }
286 286
287 TEST_F(AnimationDocumentTimelineTest, UsePlayerAfterTimelineDeref) 287 TEST_F(AnimationDocumentTimelineTest, UsePlayerAfterTimelineDeref)
288 { 288 {
289 RefPtr<Player> player = timeline->createPlayer(0); 289 RefPtr<Player> player = timeline->createPlayer(0);
290 timeline.clear(); 290 timeline.clear();
291 // Test passes if this does not crash. 291 // Test passes if this does not crash.
292 player->setStartTime(0); 292 player->setStartTime(0);
293 } 293 }
294 294
295 } 295 }
OLDNEW
« no previous file with comments | « Source/core/animation/CompositorAnimationsTest.cpp ('k') | Source/core/animation/KeyframeEffectModel.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698