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

Unified Diff: third_party/WebKit/Source/platform/animation/CompositorAnimationPlayerTest.cpp

Issue 2338803003: Blink Compositor Animation: CompositorPlayer::addAnimation to use unique_ptr. (Closed)
Patch Set: Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/platform/animation/CompositorAnimationPlayerTest.cpp
diff --git a/third_party/WebKit/Source/platform/animation/CompositorAnimationPlayerTest.cpp b/third_party/WebKit/Source/platform/animation/CompositorAnimationPlayerTest.cpp
index 0798867b4933473cebe1a5e01d40326bb7c8114e..1938fd553009874cc8324b628ea37566bf6d6525 100644
--- a/third_party/WebKit/Source/platform/animation/CompositorAnimationPlayerTest.cpp
+++ b/third_party/WebKit/Source/platform/animation/CompositorAnimationPlayerTest.cpp
@@ -59,13 +59,12 @@ TEST_F(CompositorAnimationPlayerTest, NullDelegate)
std::unique_ptr<CompositorAnimationDelegateForTesting> delegate(new CompositorAnimationDelegateForTesting);
std::unique_ptr<CompositorAnimationPlayer> player = CompositorAnimationPlayer::create();
- cc::AnimationPlayer* ccPlayer = player->animationPlayer();
+ cc::AnimationPlayer* ccPlayer = player->ccAnimationPlayer();
std::unique_ptr<CompositorAnimationCurve> curve = CompositorFloatAnimationCurve::create();
std::unique_ptr<CompositorAnimation> animation = CompositorAnimation::create(
*curve, CompositorTargetProperty::TRANSFORM, 1, 0);
- // TODO(loyso): CompositorPlayer::addAnimation should consume unique_ptr.
- player->addAnimation(animation.release());
+ player->addAnimation(std::move(animation));
player->setAnimationDelegate(delegate.get());
EXPECT_FALSE(delegate->m_finished);
@@ -85,13 +84,12 @@ TEST_F(CompositorAnimationPlayerTest, NotifyFromCCAfterCompositorPlayerDeletion)
std::unique_ptr<CompositorAnimationDelegateForTesting> delegate(new CompositorAnimationDelegateForTesting);
std::unique_ptr<CompositorAnimationPlayer> player = CompositorAnimationPlayer::create();
- scoped_refptr<cc::AnimationPlayer> ccPlayer = player->animationPlayer();
+ scoped_refptr<cc::AnimationPlayer> ccPlayer = player->ccAnimationPlayer();
std::unique_ptr<CompositorAnimationCurve> curve = CompositorFloatAnimationCurve::create();
std::unique_ptr<CompositorAnimation> animation = CompositorAnimation::create(
*curve, CompositorTargetProperty::OPACITY, 1, 0);
- // TODO(loyso): CompositorPlayer::addAnimation should consume unique_ptr.
- player->addAnimation(animation.release());
+ player->addAnimation(std::move(animation));
player->setAnimationDelegate(delegate.get());
EXPECT_FALSE(delegate->m_finished);
@@ -114,7 +112,7 @@ TEST_F(CompositorAnimationPlayerTest, CompositorPlayerDeletionDetachesFromCCTime
std::unique_ptr<CompositorAnimationPlayerTestClient> client(new CompositorAnimationPlayerTestClient);
scoped_refptr<cc::AnimationTimeline> ccTimeline = timeline->animationTimeline();
- scoped_refptr<cc::AnimationPlayer> ccPlayer = client->m_player->animationPlayer();
+ scoped_refptr<cc::AnimationPlayer> ccPlayer = client->m_player->ccAnimationPlayer();
EXPECT_FALSE(ccPlayer->animation_timeline());
timeline->playerAttached(*client);

Powered by Google App Engine
This is Rietveld 408576698