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

Unified Diff: cc/CCActiveAnimationTest.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/CCActiveAnimation.cpp ('k') | cc/CCAnimationCurve.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/CCActiveAnimationTest.cpp
diff --git a/cc/CCActiveAnimationTest.cpp b/cc/CCActiveAnimationTest.cpp
index bac66c7f4cd1d7a94dc66ee2cf2258023441bfb8..c3076c9178ec1d3df9b7a7bdd049729918cf228c 100644
--- a/cc/CCActiveAnimationTest.cpp
+++ b/cc/CCActiveAnimationTest.cpp
@@ -15,21 +15,21 @@ using namespace cc;
namespace {
-PassOwnPtr<CCActiveAnimation> createActiveAnimation(int iterations, double duration)
+scoped_ptr<CCActiveAnimation> createActiveAnimation(int iterations, double duration)
{
- OwnPtr<CCActiveAnimation> toReturn(CCActiveAnimation::create(adoptPtr(new FakeFloatAnimationCurve(duration)), 0, 1, CCActiveAnimation::Opacity));
+ scoped_ptr<CCActiveAnimation> toReturn(CCActiveAnimation::create(make_scoped_ptr(new FakeFloatAnimationCurve(duration)).PassAs<CCAnimationCurve>(), 0, 1, CCActiveAnimation::Opacity));
toReturn->setIterations(iterations);
- return toReturn.release();
+ return toReturn.Pass();
}
-PassOwnPtr<CCActiveAnimation> createActiveAnimation(int iterations)
+scoped_ptr<CCActiveAnimation> createActiveAnimation(int iterations)
{
return createActiveAnimation(iterations, 1);
}
TEST(CCActiveAnimationTest, TrimTimeZeroIterations)
{
- OwnPtr<CCActiveAnimation> anim(createActiveAnimation(0));
+ scoped_ptr<CCActiveAnimation> anim(createActiveAnimation(0));
EXPECT_EQ(0, anim->trimTimeToCurrentIteration(-1));
EXPECT_EQ(0, anim->trimTimeToCurrentIteration(0));
EXPECT_EQ(0, anim->trimTimeToCurrentIteration(1));
@@ -37,7 +37,7 @@ TEST(CCActiveAnimationTest, TrimTimeZeroIterations)
TEST(CCActiveAnimationTest, TrimTimeOneIteration)
{
- OwnPtr<CCActiveAnimation> anim(createActiveAnimation(1));
+ scoped_ptr<CCActiveAnimation> anim(createActiveAnimation(1));
EXPECT_EQ(0, anim->trimTimeToCurrentIteration(-1));
EXPECT_EQ(0, anim->trimTimeToCurrentIteration(0));
EXPECT_EQ(1, anim->trimTimeToCurrentIteration(1));
@@ -46,7 +46,7 @@ TEST(CCActiveAnimationTest, TrimTimeOneIteration)
TEST(CCActiveAnimationTest, TrimTimeInfiniteIterations)
{
- OwnPtr<CCActiveAnimation> anim(createActiveAnimation(-1));
+ scoped_ptr<CCActiveAnimation> anim(createActiveAnimation(-1));
EXPECT_EQ(0, anim->trimTimeToCurrentIteration(0));
EXPECT_EQ(0.5, anim->trimTimeToCurrentIteration(0.5));
EXPECT_EQ(0, anim->trimTimeToCurrentIteration(1));
@@ -55,7 +55,7 @@ TEST(CCActiveAnimationTest, TrimTimeInfiniteIterations)
TEST(CCActiveAnimationTest, TrimTimeAlternating)
{
- OwnPtr<CCActiveAnimation> anim(createActiveAnimation(-1));
+ scoped_ptr<CCActiveAnimation> anim(createActiveAnimation(-1));
anim->setAlternatesDirection(true);
EXPECT_EQ(0, anim->trimTimeToCurrentIteration(0));
EXPECT_EQ(0.5, anim->trimTimeToCurrentIteration(0.5));
@@ -65,7 +65,7 @@ TEST(CCActiveAnimationTest, TrimTimeAlternating)
TEST(CCActiveAnimationTest, TrimTimeStartTime)
{
- OwnPtr<CCActiveAnimation> anim(createActiveAnimation(1));
+ scoped_ptr<CCActiveAnimation> anim(createActiveAnimation(1));
anim->setStartTime(4);
EXPECT_EQ(0, anim->trimTimeToCurrentIteration(0));
EXPECT_EQ(0, anim->trimTimeToCurrentIteration(4));
@@ -76,7 +76,7 @@ TEST(CCActiveAnimationTest, TrimTimeStartTime)
TEST(CCActiveAnimationTest, TrimTimeTimeOffset)
{
- OwnPtr<CCActiveAnimation> anim(createActiveAnimation(1));
+ scoped_ptr<CCActiveAnimation> anim(createActiveAnimation(1));
anim->setTimeOffset(4);
anim->setStartTime(4);
EXPECT_EQ(0, anim->trimTimeToCurrentIteration(0));
@@ -87,7 +87,7 @@ TEST(CCActiveAnimationTest, TrimTimeTimeOffset)
TEST(CCActiveAnimationTest, TrimTimePauseResume)
{
- OwnPtr<CCActiveAnimation> anim(createActiveAnimation(1));
+ scoped_ptr<CCActiveAnimation> anim(createActiveAnimation(1));
anim->setRunState(CCActiveAnimation::Running, 0);
EXPECT_EQ(0, anim->trimTimeToCurrentIteration(0));
EXPECT_EQ(0.5, anim->trimTimeToCurrentIteration(0.5));
@@ -100,7 +100,7 @@ TEST(CCActiveAnimationTest, TrimTimePauseResume)
TEST(CCActiveAnimationTest, TrimTimeSuspendResume)
{
- OwnPtr<CCActiveAnimation> anim(createActiveAnimation(1));
+ scoped_ptr<CCActiveAnimation> anim(createActiveAnimation(1));
anim->setRunState(CCActiveAnimation::Running, 0);
EXPECT_EQ(0, anim->trimTimeToCurrentIteration(0));
EXPECT_EQ(0.5, anim->trimTimeToCurrentIteration(0.5));
@@ -113,7 +113,7 @@ TEST(CCActiveAnimationTest, TrimTimeSuspendResume)
TEST(CCActiveAnimationTest, TrimTimeZeroDuration)
{
- OwnPtr<CCActiveAnimation> anim(createActiveAnimation(0, 0));
+ scoped_ptr<CCActiveAnimation> anim(createActiveAnimation(0, 0));
anim->setRunState(CCActiveAnimation::Running, 0);
EXPECT_EQ(0, anim->trimTimeToCurrentIteration(-1));
EXPECT_EQ(0, anim->trimTimeToCurrentIteration(0));
@@ -122,7 +122,7 @@ TEST(CCActiveAnimationTest, TrimTimeZeroDuration)
TEST(CCActiveAnimationTest, IsFinishedAtZeroIterations)
{
- OwnPtr<CCActiveAnimation> anim(createActiveAnimation(0));
+ scoped_ptr<CCActiveAnimation> anim(createActiveAnimation(0));
anim->setRunState(CCActiveAnimation::Running, 0);
EXPECT_FALSE(anim->isFinishedAt(-1));
EXPECT_TRUE(anim->isFinishedAt(0));
@@ -131,7 +131,7 @@ TEST(CCActiveAnimationTest, IsFinishedAtZeroIterations)
TEST(CCActiveAnimationTest, IsFinishedAtOneIteration)
{
- OwnPtr<CCActiveAnimation> anim(createActiveAnimation(1));
+ scoped_ptr<CCActiveAnimation> anim(createActiveAnimation(1));
anim->setRunState(CCActiveAnimation::Running, 0);
EXPECT_FALSE(anim->isFinishedAt(-1));
EXPECT_FALSE(anim->isFinishedAt(0));
@@ -141,7 +141,7 @@ TEST(CCActiveAnimationTest, IsFinishedAtOneIteration)
TEST(CCActiveAnimationTest, IsFinishedAtInfiniteIterations)
{
- OwnPtr<CCActiveAnimation> anim(createActiveAnimation(-1));
+ scoped_ptr<CCActiveAnimation> anim(createActiveAnimation(-1));
anim->setRunState(CCActiveAnimation::Running, 0);
EXPECT_FALSE(anim->isFinishedAt(0));
EXPECT_FALSE(anim->isFinishedAt(0.5));
@@ -151,7 +151,7 @@ TEST(CCActiveAnimationTest, IsFinishedAtInfiniteIterations)
TEST(CCActiveAnimationTest, IsFinishedAtNotRunning)
{
- OwnPtr<CCActiveAnimation> anim(createActiveAnimation(0));
+ scoped_ptr<CCActiveAnimation> anim(createActiveAnimation(0));
anim->setRunState(CCActiveAnimation::Running, 0);
EXPECT_TRUE(anim->isFinishedAt(0));
anim->setRunState(CCActiveAnimation::Paused, 0);
@@ -170,7 +170,7 @@ TEST(CCActiveAnimationTest, IsFinishedAtNotRunning)
TEST(CCActiveAnimationTest, IsFinished)
{
- OwnPtr<CCActiveAnimation> anim(createActiveAnimation(1));
+ scoped_ptr<CCActiveAnimation> anim(createActiveAnimation(1));
anim->setRunState(CCActiveAnimation::Running, 0);
EXPECT_FALSE(anim->isFinished());
anim->setRunState(CCActiveAnimation::Paused, 0);
@@ -189,7 +189,7 @@ TEST(CCActiveAnimationTest, IsFinished)
TEST(CCActiveAnimationTest, IsFinishedNeedsSynchronizedStartTime)
{
- OwnPtr<CCActiveAnimation> anim(createActiveAnimation(1));
+ scoped_ptr<CCActiveAnimation> anim(createActiveAnimation(1));
anim->setRunState(CCActiveAnimation::Running, 2);
EXPECT_FALSE(anim->isFinished());
anim->setRunState(CCActiveAnimation::Paused, 2);
@@ -208,7 +208,7 @@ TEST(CCActiveAnimationTest, IsFinishedNeedsSynchronizedStartTime)
TEST(CCActiveAnimationTest, RunStateChangesIgnoredWhileSuspended)
{
- OwnPtr<CCActiveAnimation> anim(createActiveAnimation(1));
+ scoped_ptr<CCActiveAnimation> anim(createActiveAnimation(1));
anim->suspend(0);
EXPECT_EQ(CCActiveAnimation::Paused, anim->runState());
anim->setRunState(CCActiveAnimation::Running, 0);
« no previous file with comments | « cc/CCActiveAnimation.cpp ('k') | cc/CCAnimationCurve.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698