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

Unified Diff: cc/CCLayerAnimationControllerTest.cpp

Issue 11085029: [cc] Use base ptr types for cc's CSS animation classes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/CCLayerAnimationController.cpp ('k') | cc/CCLayerImpl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/CCLayerAnimationControllerTest.cpp
diff --git a/cc/CCLayerAnimationControllerTest.cpp b/cc/CCLayerAnimationControllerTest.cpp
index b6004a044ef95e18d2604d182b33f2de2b1dbd59..4d9e57546ab3634741092da6dfd130e4f01633db 100644
--- a/cc/CCLayerAnimationControllerTest.cpp
+++ b/cc/CCLayerAnimationControllerTest.cpp
@@ -24,17 +24,17 @@ void expectTranslateX(double translateX, const WebTransformationMatrix& matrix)
EXPECT_FLOAT_EQ(translateX, matrix.m41());
}
-PassOwnPtr<CCActiveAnimation> createActiveAnimation(PassOwnPtr<CCAnimationCurve> curve, int id, CCActiveAnimation::TargetProperty property)
+scoped_ptr<CCActiveAnimation> createActiveAnimation(scoped_ptr<CCAnimationCurve> curve, int id, CCActiveAnimation::TargetProperty property)
{
- return CCActiveAnimation::create(curve, 0, id, property);
+ return CCActiveAnimation::create(curve.Pass(), 0, id, property);
}
TEST(CCLayerAnimationControllerTest, syncNewAnimation)
{
FakeLayerAnimationControllerClient dummyImpl;
- OwnPtr<CCLayerAnimationController> controllerImpl(CCLayerAnimationController::create(&dummyImpl));
+ scoped_ptr<CCLayerAnimationController> controllerImpl(CCLayerAnimationController::create(&dummyImpl));
FakeLayerAnimationControllerClient dummy;
- OwnPtr<CCLayerAnimationController> controller(CCLayerAnimationController::create(&dummy));
+ scoped_ptr<CCLayerAnimationController> controller(CCLayerAnimationController::create(&dummy));
EXPECT_FALSE(controllerImpl->getActiveAnimation(0, CCActiveAnimation::Opacity));
@@ -51,9 +51,9 @@ TEST(CCLayerAnimationControllerTest, syncNewAnimation)
TEST(CCLayerAnimationControllerTest, doNotClobberStartTimes)
{
FakeLayerAnimationControllerClient dummyImpl;
- OwnPtr<CCLayerAnimationController> controllerImpl(CCLayerAnimationController::create(&dummyImpl));
+ scoped_ptr<CCLayerAnimationController> controllerImpl(CCLayerAnimationController::create(&dummyImpl));
FakeLayerAnimationControllerClient dummy;
- OwnPtr<CCLayerAnimationController> controller(CCLayerAnimationController::create(&dummy));
+ scoped_ptr<CCLayerAnimationController> controller(CCLayerAnimationController::create(&dummy));
EXPECT_FALSE(controllerImpl->getActiveAnimation(0, CCActiveAnimation::Opacity));
@@ -80,9 +80,9 @@ TEST(CCLayerAnimationControllerTest, doNotClobberStartTimes)
TEST(CCLayerAnimationControllerTest, syncPauseAndResume)
{
FakeLayerAnimationControllerClient dummyImpl;
- OwnPtr<CCLayerAnimationController> controllerImpl(CCLayerAnimationController::create(&dummyImpl));
+ scoped_ptr<CCLayerAnimationController> controllerImpl(CCLayerAnimationController::create(&dummyImpl));
FakeLayerAnimationControllerClient dummy;
- OwnPtr<CCLayerAnimationController> controller(CCLayerAnimationController::create(&dummy));
+ scoped_ptr<CCLayerAnimationController> controller(CCLayerAnimationController::create(&dummy));
EXPECT_FALSE(controllerImpl->getActiveAnimation(0, CCActiveAnimation::Opacity));
@@ -120,9 +120,9 @@ TEST(CCLayerAnimationControllerTest, syncPauseAndResume)
TEST(CCLayerAnimationControllerTest, doNotSyncFinishedAnimation)
{
FakeLayerAnimationControllerClient dummyImpl;
- OwnPtr<CCLayerAnimationController> controllerImpl(CCLayerAnimationController::create(&dummyImpl));
+ scoped_ptr<CCLayerAnimationController> controllerImpl(CCLayerAnimationController::create(&dummyImpl));
FakeLayerAnimationControllerClient dummy;
- OwnPtr<CCLayerAnimationController> controller(CCLayerAnimationController::create(&dummy));
+ scoped_ptr<CCLayerAnimationController> controller(CCLayerAnimationController::create(&dummy));
EXPECT_FALSE(controllerImpl->getActiveAnimation(0, CCActiveAnimation::Opacity));
@@ -151,14 +151,14 @@ TEST(CCLayerAnimationControllerTest, doNotSyncFinishedAnimation)
// Tests that transitioning opacity from 0 to 1 works as expected.
TEST(CCLayerAnimationControllerTest, TrivialTransition)
{
- OwnPtr<CCAnimationEventsVector> events(adoptPtr(new CCAnimationEventsVector));
+ scoped_ptr<CCAnimationEventsVector> events(make_scoped_ptr(new CCAnimationEventsVector));
FakeLayerAnimationControllerClient dummy;
- OwnPtr<CCLayerAnimationController> controller(
+ scoped_ptr<CCLayerAnimationController> controller(
CCLayerAnimationController::create(&dummy));
- OwnPtr<CCActiveAnimation> toAdd(createActiveAnimation(adoptPtr(new FakeFloatTransition(1, 0, 1)), 1, CCActiveAnimation::Opacity));
+ scoped_ptr<CCActiveAnimation> toAdd(createActiveAnimation(make_scoped_ptr(new FakeFloatTransition(1, 0, 1)).PassAs<CCAnimationCurve>(), 1, CCActiveAnimation::Opacity));
- controller->addAnimation(toAdd.release());
+ controller->addAnimation(toAdd.Pass());
controller->animate(0, events.get());
EXPECT_TRUE(controller->hasActiveAnimation());
EXPECT_EQ(0, dummy.opacity());
@@ -170,16 +170,16 @@ TEST(CCLayerAnimationControllerTest, TrivialTransition)
// Tests animations that are waiting for a synchronized start time do not finish.
TEST(CCLayerAnimationControllerTest, AnimationsWaitingForStartTimeDoNotFinishIfTheyWaitLongerToStartThanTheirDuration)
{
- OwnPtr<CCAnimationEventsVector> events(adoptPtr(new CCAnimationEventsVector));
+ scoped_ptr<CCAnimationEventsVector> events(make_scoped_ptr(new CCAnimationEventsVector));
FakeLayerAnimationControllerClient dummy;
- OwnPtr<CCLayerAnimationController> controller(
+ scoped_ptr<CCLayerAnimationController> controller(
CCLayerAnimationController::create(&dummy));
- OwnPtr<CCActiveAnimation> toAdd(createActiveAnimation(adoptPtr(new FakeFloatTransition(1, 0, 1)), 1, CCActiveAnimation::Opacity));
+ scoped_ptr<CCActiveAnimation> toAdd(createActiveAnimation(make_scoped_ptr(new FakeFloatTransition(1, 0, 1)).PassAs<CCAnimationCurve>(), 1, CCActiveAnimation::Opacity));
toAdd->setNeedsSynchronizedStartTime(true);
// We should pause at the first keyframe indefinitely waiting for that animation to start.
- controller->addAnimation(toAdd.release());
+ controller->addAnimation(toAdd.Pass());
controller->animate(0, events.get());
EXPECT_TRUE(controller->hasActiveAnimation());
EXPECT_EQ(0, dummy.opacity());
@@ -200,13 +200,13 @@ TEST(CCLayerAnimationControllerTest, AnimationsWaitingForStartTimeDoNotFinishIfT
// Tests that two queued animations affecting the same property run in sequence.
TEST(CCLayerAnimationControllerTest, TrivialQueuing)
{
- OwnPtr<CCAnimationEventsVector> events(adoptPtr(new CCAnimationEventsVector));
+ scoped_ptr<CCAnimationEventsVector> events(make_scoped_ptr(new CCAnimationEventsVector));
FakeLayerAnimationControllerClient dummy;
- OwnPtr<CCLayerAnimationController> controller(
+ scoped_ptr<CCLayerAnimationController> controller(
CCLayerAnimationController::create(&dummy));
- controller->addAnimation(createActiveAnimation(adoptPtr(new FakeFloatTransition(1, 0, 1)), 1, CCActiveAnimation::Opacity));
- controller->addAnimation(createActiveAnimation(adoptPtr(new FakeFloatTransition(1, 1, 0.5)), 2, CCActiveAnimation::Opacity));
+ controller->addAnimation(createActiveAnimation(make_scoped_ptr(new FakeFloatTransition(1, 0, 1)).PassAs<CCAnimationCurve>(), 1, CCActiveAnimation::Opacity));
+ controller->addAnimation(createActiveAnimation(make_scoped_ptr(new FakeFloatTransition(1, 1, 0.5)).PassAs<CCAnimationCurve>(), 2, CCActiveAnimation::Opacity));
controller->animate(0, events.get());
EXPECT_TRUE(controller->hasActiveAnimation());
@@ -222,18 +222,18 @@ TEST(CCLayerAnimationControllerTest, TrivialQueuing)
// Tests interrupting a transition with another transition.
TEST(CCLayerAnimationControllerTest, Interrupt)
{
- OwnPtr<CCAnimationEventsVector> events(adoptPtr(new CCAnimationEventsVector));
+ scoped_ptr<CCAnimationEventsVector> events(make_scoped_ptr(new CCAnimationEventsVector));
FakeLayerAnimationControllerClient dummy;
- OwnPtr<CCLayerAnimationController> controller(
+ scoped_ptr<CCLayerAnimationController> controller(
CCLayerAnimationController::create(&dummy));
- controller->addAnimation(createActiveAnimation(adoptPtr(new FakeFloatTransition(1, 0, 1)), 1, CCActiveAnimation::Opacity));
+ controller->addAnimation(createActiveAnimation(make_scoped_ptr(new FakeFloatTransition(1, 0, 1)).PassAs<CCAnimationCurve>(), 1, CCActiveAnimation::Opacity));
controller->animate(0, events.get());
EXPECT_TRUE(controller->hasActiveAnimation());
EXPECT_EQ(0, dummy.opacity());
- OwnPtr<CCActiveAnimation> toAdd(createActiveAnimation(adoptPtr(new FakeFloatTransition(1, 1, 0.5)), 2, CCActiveAnimation::Opacity));
+ scoped_ptr<CCActiveAnimation> toAdd(createActiveAnimation(make_scoped_ptr(new FakeFloatTransition(1, 1, 0.5)).PassAs<CCAnimationCurve>(), 2, CCActiveAnimation::Opacity));
toAdd->setRunState(CCActiveAnimation::WaitingForNextTick, 0);
- controller->addAnimation(toAdd.release());
+ controller->addAnimation(toAdd.Pass());
// Since the animation was in the WaitingForNextTick state, it should start right in
// this call to animate.
@@ -248,14 +248,14 @@ TEST(CCLayerAnimationControllerTest, Interrupt)
// Tests scheduling two animations to run together when only one property is free.
TEST(CCLayerAnimationControllerTest, ScheduleTogetherWhenAPropertyIsBlocked)
{
- OwnPtr<CCAnimationEventsVector> events(adoptPtr(new CCAnimationEventsVector));
+ scoped_ptr<CCAnimationEventsVector> events(make_scoped_ptr(new CCAnimationEventsVector));
FakeLayerAnimationControllerClient dummy;
- OwnPtr<CCLayerAnimationController> controller(
+ scoped_ptr<CCLayerAnimationController> controller(
CCLayerAnimationController::create(&dummy));
- controller->addAnimation(createActiveAnimation(adoptPtr(new FakeTransformTransition(1)), 1, CCActiveAnimation::Transform));
- controller->addAnimation(createActiveAnimation(adoptPtr(new FakeTransformTransition(1)), 2, CCActiveAnimation::Transform));
- controller->addAnimation(createActiveAnimation(adoptPtr(new FakeFloatTransition(1, 0, 1)), 2, CCActiveAnimation::Opacity));
+ controller->addAnimation(createActiveAnimation(make_scoped_ptr(new FakeTransformTransition(1)).PassAs<CCAnimationCurve>(), 1, CCActiveAnimation::Transform));
+ controller->addAnimation(createActiveAnimation(make_scoped_ptr(new FakeTransformTransition(1)).PassAs<CCAnimationCurve>(), 2, CCActiveAnimation::Transform));
+ controller->addAnimation(createActiveAnimation(make_scoped_ptr(new FakeFloatTransition(1, 0, 1)).PassAs<CCAnimationCurve>(), 2, CCActiveAnimation::Opacity));
controller->animate(0, events.get());
EXPECT_EQ(0, dummy.opacity());
@@ -275,14 +275,14 @@ TEST(CCLayerAnimationControllerTest, ScheduleTogetherWhenAPropertyIsBlocked)
// for both to finish).
TEST(CCLayerAnimationControllerTest, ScheduleTogetherWithAnAnimWaiting)
{
- OwnPtr<CCAnimationEventsVector> events(adoptPtr(new CCAnimationEventsVector));
+ scoped_ptr<CCAnimationEventsVector> events(make_scoped_ptr(new CCAnimationEventsVector));
FakeLayerAnimationControllerClient dummy;
- OwnPtr<CCLayerAnimationController> controller(
+ scoped_ptr<CCLayerAnimationController> controller(
CCLayerAnimationController::create(&dummy));
- controller->addAnimation(createActiveAnimation(adoptPtr(new FakeTransformTransition(2)), 1, CCActiveAnimation::Transform));
- controller->addAnimation(createActiveAnimation(adoptPtr(new FakeFloatTransition(1, 0, 1)), 1, CCActiveAnimation::Opacity));
- controller->addAnimation(createActiveAnimation(adoptPtr(new FakeFloatTransition(1, 1, 0.5)), 2, CCActiveAnimation::Opacity));
+ controller->addAnimation(createActiveAnimation(make_scoped_ptr(new FakeTransformTransition(2)).PassAs<CCAnimationCurve>(), 1, CCActiveAnimation::Transform));
+ controller->addAnimation(createActiveAnimation(make_scoped_ptr(new FakeFloatTransition(1, 0, 1)).PassAs<CCAnimationCurve>(), 1, CCActiveAnimation::Opacity));
+ controller->addAnimation(createActiveAnimation(make_scoped_ptr(new FakeFloatTransition(1, 1, 0.5)).PassAs<CCAnimationCurve>(), 2, CCActiveAnimation::Opacity));
// Animations with id 1 should both start now.
controller->animate(0, events.get());
@@ -305,15 +305,15 @@ TEST(CCLayerAnimationControllerTest, ScheduleTogetherWithAnAnimWaiting)
// Tests scheduling an animation to start in the future.
TEST(CCLayerAnimationControllerTest, ScheduleAnimation)
{
- OwnPtr<CCAnimationEventsVector> events(adoptPtr(new CCAnimationEventsVector));
+ scoped_ptr<CCAnimationEventsVector> events(make_scoped_ptr(new CCAnimationEventsVector));
FakeLayerAnimationControllerClient dummy;
- OwnPtr<CCLayerAnimationController> controller(
+ scoped_ptr<CCLayerAnimationController> controller(
CCLayerAnimationController::create(&dummy));
- OwnPtr<CCActiveAnimation> toAdd(createActiveAnimation(adoptPtr(new FakeFloatTransition(1, 0, 1)), 1, CCActiveAnimation::Opacity));
+ scoped_ptr<CCActiveAnimation> toAdd(createActiveAnimation(make_scoped_ptr(new FakeFloatTransition(1, 0, 1)).PassAs<CCAnimationCurve>(), 1, CCActiveAnimation::Opacity));
toAdd->setRunState(CCActiveAnimation::WaitingForStartTime, 0);
toAdd->setStartTime(1);
- controller->addAnimation(toAdd.release());
+ controller->addAnimation(toAdd.Pass());
controller->animate(0, events.get());
EXPECT_TRUE(controller->hasActiveAnimation());
@@ -329,17 +329,17 @@ TEST(CCLayerAnimationControllerTest, ScheduleAnimation)
// Tests scheduling an animation to start in the future that's interrupting a running animation.
TEST(CCLayerAnimationControllerTest, ScheduledAnimationInterruptsRunningAnimation)
{
- OwnPtr<CCAnimationEventsVector> events(adoptPtr(new CCAnimationEventsVector));
+ scoped_ptr<CCAnimationEventsVector> events(make_scoped_ptr(new CCAnimationEventsVector));
FakeLayerAnimationControllerClient dummy;
- OwnPtr<CCLayerAnimationController> controller(
+ scoped_ptr<CCLayerAnimationController> controller(
CCLayerAnimationController::create(&dummy));
- controller->addAnimation(createActiveAnimation(adoptPtr(new FakeFloatTransition(2, 0, 1)), 1, CCActiveAnimation::Opacity));
+ controller->addAnimation(createActiveAnimation(make_scoped_ptr(new FakeFloatTransition(2, 0, 1)).PassAs<CCAnimationCurve>(), 1, CCActiveAnimation::Opacity));
- OwnPtr<CCActiveAnimation> toAdd(createActiveAnimation(adoptPtr(new FakeFloatTransition(1, 0.5, 0)), 2, CCActiveAnimation::Opacity));
+ scoped_ptr<CCActiveAnimation> toAdd(createActiveAnimation(make_scoped_ptr(new FakeFloatTransition(1, 0.5, 0)).PassAs<CCAnimationCurve>(), 2, CCActiveAnimation::Opacity));
toAdd->setRunState(CCActiveAnimation::WaitingForStartTime, 0);
toAdd->setStartTime(1);
- controller->addAnimation(toAdd.release());
+ controller->addAnimation(toAdd.Pass());
// First 2s opacity transition should start immediately.
controller->animate(0, events.get());
@@ -360,19 +360,19 @@ TEST(CCLayerAnimationControllerTest, ScheduledAnimationInterruptsRunningAnimatio
// and there is yet another animation queued to start later.
TEST(CCLayerAnimationControllerTest, ScheduledAnimationInterruptsRunningAnimationWithAnimInQueue)
{
- OwnPtr<CCAnimationEventsVector> events(adoptPtr(new CCAnimationEventsVector));
+ scoped_ptr<CCAnimationEventsVector> events(make_scoped_ptr(new CCAnimationEventsVector));
FakeLayerAnimationControllerClient dummy;
- OwnPtr<CCLayerAnimationController> controller(
+ scoped_ptr<CCLayerAnimationController> controller(
CCLayerAnimationController::create(&dummy));
- controller->addAnimation(createActiveAnimation(adoptPtr(new FakeFloatTransition(2, 0, 1)), 1, CCActiveAnimation::Opacity));
+ controller->addAnimation(createActiveAnimation(make_scoped_ptr(new FakeFloatTransition(2, 0, 1)).PassAs<CCAnimationCurve>(), 1, CCActiveAnimation::Opacity));
- OwnPtr<CCActiveAnimation> toAdd(createActiveAnimation(adoptPtr(new FakeFloatTransition(2, 0.5, 0)), 2, CCActiveAnimation::Opacity));
+ scoped_ptr<CCActiveAnimation> toAdd(createActiveAnimation(make_scoped_ptr(new FakeFloatTransition(2, 0.5, 0)).PassAs<CCAnimationCurve>(), 2, CCActiveAnimation::Opacity));
toAdd->setRunState(CCActiveAnimation::WaitingForStartTime, 0);
toAdd->setStartTime(1);
- controller->addAnimation(toAdd.release());
+ controller->addAnimation(toAdd.Pass());
- controller->addAnimation(createActiveAnimation(adoptPtr(new FakeFloatTransition(1, 0, 0.75)), 3, CCActiveAnimation::Opacity));
+ controller->addAnimation(createActiveAnimation(make_scoped_ptr(new FakeFloatTransition(1, 0, 0.75)).PassAs<CCAnimationCurve>(), 3, CCActiveAnimation::Opacity));
// First 2s opacity transition should start immediately.
controller->animate(0, events.get());
@@ -396,14 +396,14 @@ TEST(CCLayerAnimationControllerTest, ScheduledAnimationInterruptsRunningAnimatio
// Test that a looping animation loops and for the correct number of iterations.
TEST(CCLayerAnimationControllerTest, TrivialLooping)
{
- OwnPtr<CCAnimationEventsVector> events(adoptPtr(new CCAnimationEventsVector));
+ scoped_ptr<CCAnimationEventsVector> events(make_scoped_ptr(new CCAnimationEventsVector));
FakeLayerAnimationControllerClient dummy;
- OwnPtr<CCLayerAnimationController> controller(
+ scoped_ptr<CCLayerAnimationController> controller(
CCLayerAnimationController::create(&dummy));
- OwnPtr<CCActiveAnimation> toAdd(createActiveAnimation(adoptPtr(new FakeFloatTransition(1, 0, 1)), 1, CCActiveAnimation::Opacity));
+ scoped_ptr<CCActiveAnimation> toAdd(createActiveAnimation(make_scoped_ptr(new FakeFloatTransition(1, 0, 1)).PassAs<CCAnimationCurve>(), 1, CCActiveAnimation::Opacity));
toAdd->setIterations(3);
- controller->addAnimation(toAdd.release());
+ controller->addAnimation(toAdd.Pass());
controller->animate(0, events.get());
EXPECT_TRUE(controller->hasActiveAnimation());
@@ -432,15 +432,15 @@ TEST(CCLayerAnimationControllerTest, TrivialLooping)
// Test that an infinitely looping animation does indeed go until aborted.
TEST(CCLayerAnimationControllerTest, InfiniteLooping)
{
- OwnPtr<CCAnimationEventsVector> events(adoptPtr(new CCAnimationEventsVector));
+ scoped_ptr<CCAnimationEventsVector> events(make_scoped_ptr(new CCAnimationEventsVector));
FakeLayerAnimationControllerClient dummy;
- OwnPtr<CCLayerAnimationController> controller(
+ scoped_ptr<CCLayerAnimationController> controller(
CCLayerAnimationController::create(&dummy));
const int id = 1;
- OwnPtr<CCActiveAnimation> toAdd(createActiveAnimation(adoptPtr(new FakeFloatTransition(1, 0, 1)), id, CCActiveAnimation::Opacity));
+ scoped_ptr<CCActiveAnimation> toAdd(createActiveAnimation(make_scoped_ptr(new FakeFloatTransition(1, 0, 1)).PassAs<CCAnimationCurve>(), id, CCActiveAnimation::Opacity));
toAdd->setIterations(-1);
- controller->addAnimation(toAdd.release());
+ controller->addAnimation(toAdd.Pass());
controller->animate(0, events.get());
EXPECT_TRUE(controller->hasActiveAnimation());
@@ -468,13 +468,13 @@ TEST(CCLayerAnimationControllerTest, InfiniteLooping)
// Test that pausing and resuming work as expected.
TEST(CCLayerAnimationControllerTest, PauseResume)
{
- OwnPtr<CCAnimationEventsVector> events(adoptPtr(new CCAnimationEventsVector));
+ scoped_ptr<CCAnimationEventsVector> events(make_scoped_ptr(new CCAnimationEventsVector));
FakeLayerAnimationControllerClient dummy;
- OwnPtr<CCLayerAnimationController> controller(
+ scoped_ptr<CCLayerAnimationController> controller(
CCLayerAnimationController::create(&dummy));
const int id = 1;
- controller->addAnimation(createActiveAnimation(adoptPtr(new FakeFloatTransition(1, 0, 1)), id, CCActiveAnimation::Opacity));
+ controller->addAnimation(createActiveAnimation(make_scoped_ptr(new FakeFloatTransition(1, 0, 1)).PassAs<CCAnimationCurve>(), id, CCActiveAnimation::Opacity));
controller->animate(0, events.get());
EXPECT_TRUE(controller->hasActiveAnimation());
@@ -503,15 +503,15 @@ TEST(CCLayerAnimationControllerTest, PauseResume)
TEST(CCLayerAnimationControllerTest, AbortAGroupedAnimation)
{
- OwnPtr<CCAnimationEventsVector> events(adoptPtr(new CCAnimationEventsVector));
+ scoped_ptr<CCAnimationEventsVector> events(make_scoped_ptr(new CCAnimationEventsVector));
FakeLayerAnimationControllerClient dummy;
- OwnPtr<CCLayerAnimationController> controller(
+ scoped_ptr<CCLayerAnimationController> controller(
CCLayerAnimationController::create(&dummy));
const int id = 1;
- controller->addAnimation(createActiveAnimation(adoptPtr(new FakeTransformTransition(1)), id, CCActiveAnimation::Transform));
- controller->addAnimation(createActiveAnimation(adoptPtr(new FakeFloatTransition(2, 0, 1)), id, CCActiveAnimation::Opacity));
- controller->addAnimation(createActiveAnimation(adoptPtr(new FakeFloatTransition(1, 1, 0.75)), 2, CCActiveAnimation::Opacity));
+ controller->addAnimation(createActiveAnimation(make_scoped_ptr(new FakeTransformTransition(1)).PassAs<CCAnimationCurve>(), id, CCActiveAnimation::Transform));
+ controller->addAnimation(createActiveAnimation(make_scoped_ptr(new FakeFloatTransition(2, 0, 1)).PassAs<CCAnimationCurve>(), id, CCActiveAnimation::Opacity));
+ controller->addAnimation(createActiveAnimation(make_scoped_ptr(new FakeFloatTransition(1, 1, 0.75)).PassAs<CCAnimationCurve>(), 2, CCActiveAnimation::Opacity));
controller->animate(0, events.get());
EXPECT_TRUE(controller->hasActiveAnimation());
@@ -533,15 +533,15 @@ TEST(CCLayerAnimationControllerTest, AbortAGroupedAnimation)
TEST(CCLayerAnimationControllerTest, ForceSyncWhenSynchronizedStartTimeNeeded)
{
FakeLayerAnimationControllerClient dummyImpl;
- OwnPtr<CCLayerAnimationController> controllerImpl(CCLayerAnimationController::create(&dummyImpl));
- OwnPtr<CCAnimationEventsVector> events(adoptPtr(new CCAnimationEventsVector));
+ scoped_ptr<CCLayerAnimationController> controllerImpl(CCLayerAnimationController::create(&dummyImpl));
+ scoped_ptr<CCAnimationEventsVector> events(make_scoped_ptr(new CCAnimationEventsVector));
FakeLayerAnimationControllerClient dummy;
- OwnPtr<CCLayerAnimationController> controller(
+ scoped_ptr<CCLayerAnimationController> controller(
CCLayerAnimationController::create(&dummy));
- OwnPtr<CCActiveAnimation> toAdd(createActiveAnimation(adoptPtr(new FakeFloatTransition(2, 0, 1)), 0, CCActiveAnimation::Opacity));
+ scoped_ptr<CCActiveAnimation> toAdd(createActiveAnimation(make_scoped_ptr(new FakeFloatTransition(2, 0, 1)).PassAs<CCAnimationCurve>(), 0, CCActiveAnimation::Opacity));
toAdd->setNeedsSynchronizedStartTime(true);
- controller->addAnimation(toAdd.release());
+ controller->addAnimation(toAdd.Pass());
controller->animate(0, 0);
EXPECT_TRUE(controller->hasActiveAnimation());
« no previous file with comments | « cc/CCLayerAnimationController.cpp ('k') | cc/CCLayerImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698