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

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

Issue 176903004: Have Document::timeline() / Document::transitionTimeline() return a reference (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 = nullptr; 279 element = nullptr;
280 document = nullptr; 280 document = nullptr;
281 281
282 RefPtr<Animation> anim = Animation::create(nullptr, nullptr, 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/DocumentAnimations.cpp ('k') | Source/core/animation/ElementAnimation.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698