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

Unified Diff: Source/core/animation/AnimationTest.cpp

Issue 1120003002: [Oilpan] Migrate most classes under core/animations to Oilpan heap. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Intentional nullptr access Created 5 years, 7 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: Source/core/animation/AnimationTest.cpp
diff --git a/Source/core/animation/AnimationTest.cpp b/Source/core/animation/AnimationTest.cpp
index ff88caa4c60d870e4679d972d8f854f8a40f1c2e..7ea5c63b632e2cdd7731aabfef1b944b90152385 100644
--- a/Source/core/animation/AnimationTest.cpp
+++ b/Source/core/animation/AnimationTest.cpp
@@ -60,7 +60,7 @@ protected:
timeline = AnimationTimeline::create(document.get());
animation = timeline->play(0);
animation->setStartTime(0);
- animation->setSource(makeAnimation().get());
+ animation->setSource(makeAnimation());
}
void startTimeline()
@@ -68,7 +68,7 @@ protected:
simulateFrame(0);
}
- PassRefPtrWillBeRawPtr<KeyframeEffect> makeAnimation(double duration = 30, double playbackRate = 1)
+ KeyframeEffect* makeAnimation(double duration = 30, double playbackRate = 1)
{
Timing timing;
timing.iterationDuration = duration;
@@ -85,7 +85,7 @@ protected:
}
RefPtrWillBePersistent<Document> document;
- RefPtrWillBePersistent<AnimationTimeline> timeline;
+ Persistent<AnimationTimeline> timeline;
RefPtrWillBePersistent<Animation> animation;
TrackExceptionState exceptionState;
};
@@ -508,7 +508,7 @@ TEST_F(AnimationAnimationTest, FinishRaisesException)
Timing timing;
timing.iterationDuration = 1;
timing.iterationCount = std::numeric_limits<double>::infinity();
- animation->setSource(KeyframeEffect::create(0, nullptr, timing).get());
+ animation->setSource(KeyframeEffect::create(0, nullptr, timing));
animation->setCurrentTimeInternal(10);
animation->finish(exceptionState);
@@ -626,13 +626,13 @@ TEST_F(AnimationAnimationTest, SetSource)
{
animation = timeline->play(0);
animation->setStartTime(0);
- RefPtrWillBeRawPtr<AnimationEffect> source1 = makeAnimation();
- RefPtrWillBeRawPtr<AnimationEffect> source2 = makeAnimation();
- animation->setSource(source1.get());
+ AnimationEffect* source1 = makeAnimation();
+ AnimationEffect* source2 = makeAnimation();
+ animation->setSource(source1);
EXPECT_EQ(source1, animation->source());
EXPECT_EQ(0, animation->currentTimeInternal());
animation->setCurrentTimeInternal(15);
- animation->setSource(source2.get());
+ animation->setSource(source2);
EXPECT_EQ(15, animation->currentTimeInternal());
EXPECT_EQ(0, source1->animation());
EXPECT_EQ(animation.get(), source2->animation());
@@ -642,7 +642,7 @@ TEST_F(AnimationAnimationTest, SetSource)
TEST_F(AnimationAnimationTest, SetSourceLimitsAnimation)
{
animation->setCurrentTimeInternal(20);
- animation->setSource(makeAnimation(10).get());
+ animation->setSource(makeAnimation(10));
EXPECT_EQ(20, animation->currentTimeInternal());
EXPECT_TRUE(animation->limited());
simulateFrame(10);
@@ -652,7 +652,7 @@ TEST_F(AnimationAnimationTest, SetSourceLimitsAnimation)
TEST_F(AnimationAnimationTest, SetSourceUnlimitsAnimation)
{
animation->setCurrentTimeInternal(40);
- animation->setSource(makeAnimation(60).get());
+ animation->setSource(makeAnimation(60));
EXPECT_FALSE(animation->limited());
EXPECT_EQ(40, animation->currentTimeInternal());
simulateFrame(10);
@@ -685,8 +685,8 @@ TEST_F(AnimationAnimationTest, AnimationsReturnTimeToNextEffect)
timing.startDelay = 1;
timing.iterationDuration = 1;
timing.endDelay = 1;
- RefPtrWillBeRawPtr<KeyframeEffect> keyframeEffect = KeyframeEffect::create(0, nullptr, timing);
- animation = timeline->play(keyframeEffect.get());
+ KeyframeEffect* keyframeEffect = KeyframeEffect::create(0, nullptr, timing);
+ animation = timeline->play(keyframeEffect);
animation->setStartTime(0);
simulateFrame(0);
@@ -786,8 +786,8 @@ TEST_F(AnimationAnimationTest, AttachedAnimations)
RefPtrWillBePersistent<Element> element = document->createElement("foo", ASSERT_NO_EXCEPTION);
Timing timing;
- RefPtrWillBeRawPtr<KeyframeEffect> keyframeEffect = KeyframeEffect::create(element.get(), nullptr, timing);
- RefPtrWillBeRawPtr<Animation> animation = timeline->play(keyframeEffect.get());
+ KeyframeEffect* keyframeEffect = KeyframeEffect::create(element.get(), nullptr, timing);
+ RefPtrWillBeRawPtr<Animation> animation = timeline->play(keyframeEffect);
simulateFrame(0);
timeline->serviceAnimations(TimingUpdateForAnimationFrame);
EXPECT_EQ(1U, element->elementAnimations()->animations().find(animation.get())->value);

Powered by Google App Engine
This is Rietveld 408576698