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

Side by Side Diff: third_party/WebKit/Source/core/animation/AnimationTimelineTest.cpp

Issue 2222313002: Implement DocumentTimeline (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update global-interface-listing-expected.txt Created 4 years, 4 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
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 321 matching lines...) Expand 10 before | Expand all | Expand 10 after
332 EXPECT_CALL(*platformTiming, wakeAfter(timing.startDelay - minimumDelay() - 1.5)); 332 EXPECT_CALL(*platformTiming, wakeAfter(timing.startDelay - minimumDelay() - 1.5));
333 updateClockAndService(1.5); 333 updateClockAndService(1.5);
334 334
335 EXPECT_CALL(*platformTiming, serviceOnNextFrame()); 335 EXPECT_CALL(*platformTiming, serviceOnNextFrame());
336 wake(); 336 wake();
337 337
338 EXPECT_CALL(*platformTiming, serviceOnNextFrame()); 338 EXPECT_CALL(*platformTiming, serviceOnNextFrame());
339 updateClockAndService(4.98); 339 updateClockAndService(4.98);
340 } 340 }
341 341
342 TEST_F(AnimationAnimationTimelineTest, PlayAfterDocumentDeref)
343 {
344 timing.iterationDuration = 2;
345 timing.startDelay = 5;
346
347 timeline = &document->timeline();
348 element = nullptr;
349 document = nullptr;
350
351 KeyframeEffect* keyframeEffect = KeyframeEffect::create(0, nullptr, timing);
352 // Test passes if this does not crash.
353 timeline->play(keyframeEffect);
354 }
355
356 TEST_F(AnimationAnimationTimelineTest, UseAnimationAfterTimelineDeref) 342 TEST_F(AnimationAnimationTimelineTest, UseAnimationAfterTimelineDeref)
357 { 343 {
358 Animation* animation = timeline->play(0); 344 Animation* animation = timeline->play(0);
359 timeline.clear(); 345 timeline.clear();
360 // Test passes if this does not crash. 346 // Test passes if this does not crash.
361 animation->setStartTime(0); 347 animation->setStartTime(0);
362 } 348 }
363 349
364 } // namespace blink 350 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698