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

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

Issue 732153003: Update a result vector when sampling animation effects. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 1 month 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 | « Source/core/animation/InterpolationEffect.cpp ('k') | Source/core/animation/KeyframeEffectModel.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/animation/InterpolationEffectTest.cpp
diff --git a/Source/core/animation/InterpolationEffectTest.cpp b/Source/core/animation/InterpolationEffectTest.cpp
index 1d5c5d6daf6e3934277dae189f426cbf4e528ef3..e13ef629e6662f5d751a7489e9800b6e3e6f24d9 100644
--- a/Source/core/animation/InterpolationEffectTest.cpp
+++ b/Source/core/animation/InterpolationEffectTest.cpp
@@ -34,22 +34,23 @@ TEST_F(AnimationInterpolationEffectTest, SingleInterpolation)
interpolationEffect->addInterpolation(Interpolation::create(InterpolableNumber::create(0), InterpolableNumber::create(10)),
RefPtr<TimingFunction>(), 0, 1, -1, 2);
- OwnPtrWillBeRawPtr<WillBeHeapVector<RefPtrWillBeMember<Interpolation> > > activeInterpolations = interpolationEffect->getActiveInterpolations(-2, duration);
+ OwnPtrWillBeRawPtr<WillBeHeapVector<RefPtrWillBeMember<Interpolation> > > activeInterpolations = nullptr;
+ interpolationEffect->getActiveInterpolations(-2, duration, activeInterpolations);
EXPECT_EQ(0ul, activeInterpolations->size());
- activeInterpolations = interpolationEffect->getActiveInterpolations(-0.5, duration);
+ interpolationEffect->getActiveInterpolations(-0.5, duration, activeInterpolations);
EXPECT_EQ(1ul, activeInterpolations->size());
EXPECT_EQ(-5, getInterpolableNumber(activeInterpolations->at(0)));
- activeInterpolations = interpolationEffect->getActiveInterpolations(0.5, duration);
+ interpolationEffect->getActiveInterpolations(0.5, duration, activeInterpolations);
EXPECT_EQ(1ul, activeInterpolations->size());
EXPECT_FLOAT_EQ(5, getInterpolableNumber(activeInterpolations->at(0)));
- activeInterpolations = interpolationEffect->getActiveInterpolations(1.5, duration);
+ interpolationEffect->getActiveInterpolations(1.5, duration, activeInterpolations);
EXPECT_EQ(1ul, activeInterpolations->size());
EXPECT_FLOAT_EQ(15, getInterpolableNumber(activeInterpolations->at(0)));
- activeInterpolations = interpolationEffect->getActiveInterpolations(3, duration);
+ interpolationEffect->getActiveInterpolations(3, duration, activeInterpolations);
EXPECT_EQ(0ul, activeInterpolations->size());
}
@@ -63,36 +64,36 @@ TEST_F(AnimationInterpolationEffectTest, MultipleInterpolations)
interpolationEffect->addInterpolation(Interpolation::create(InterpolableNumber::create(1), InterpolableNumber::create(6)),
CubicBezierTimingFunction::preset(CubicBezierTimingFunction::Ease), 0.5, 1.5, 0.5, 1.5);
- OwnPtrWillBeRawPtr<WillBeHeapVector<RefPtrWillBeMember<Interpolation> > > activeInterpolations = interpolationEffect->getActiveInterpolations(-0.5, duration);
+ OwnPtrWillBeRawPtr<WillBeHeapVector<RefPtrWillBeMember<Interpolation> > > activeInterpolations = nullptr;
+ interpolationEffect->getActiveInterpolations(-0.5, duration, activeInterpolations);
EXPECT_EQ(0ul, activeInterpolations->size());
- activeInterpolations = interpolationEffect->getActiveInterpolations(0, duration);
+ interpolationEffect->getActiveInterpolations(0, duration, activeInterpolations);
EXPECT_EQ(1ul, activeInterpolations->size());
EXPECT_FLOAT_EQ(0, getInterpolableNumber(activeInterpolations->at(0)));
- activeInterpolations = interpolationEffect->getActiveInterpolations(0.5, duration);
+ interpolationEffect->getActiveInterpolations(0.5, duration, activeInterpolations);
EXPECT_EQ(2ul, activeInterpolations->size());
EXPECT_FLOAT_EQ(0.5f, getInterpolableNumber(activeInterpolations->at(0)));
EXPECT_FLOAT_EQ(1, getInterpolableNumber(activeInterpolations->at(1)));
- activeInterpolations = interpolationEffect->getActiveInterpolations(1, duration);
+ interpolationEffect->getActiveInterpolations(1, duration, activeInterpolations);
EXPECT_EQ(2ul, activeInterpolations->size());
EXPECT_FLOAT_EQ(10, getInterpolableNumber(activeInterpolations->at(0)));
EXPECT_FLOAT_EQ(5.0282884f, getInterpolableNumber(activeInterpolations->at(1)));
- activeInterpolations = interpolationEffect->getActiveInterpolations(1, duration * 1000);
+ interpolationEffect->getActiveInterpolations(1, duration * 1000, activeInterpolations);
EXPECT_EQ(2ul, activeInterpolations->size());
EXPECT_FLOAT_EQ(10, getInterpolableNumber(activeInterpolations->at(0)));
EXPECT_FLOAT_EQ(5.0120168f, getInterpolableNumber(activeInterpolations->at(1)));
- activeInterpolations = interpolationEffect->getActiveInterpolations(1.5, duration);
+ interpolationEffect->getActiveInterpolations(1.5, duration, activeInterpolations);
EXPECT_EQ(1ul, activeInterpolations->size());
EXPECT_FLOAT_EQ(12.5f, getInterpolableNumber(activeInterpolations->at(0)));
- activeInterpolations = interpolationEffect->getActiveInterpolations(2, duration);
+ interpolationEffect->getActiveInterpolations(2, duration, activeInterpolations);
EXPECT_EQ(1ul, activeInterpolations->size());
EXPECT_FLOAT_EQ(15, getInterpolableNumber(activeInterpolations->at(0)));
}
}
-
« no previous file with comments | « Source/core/animation/InterpolationEffect.cpp ('k') | Source/core/animation/KeyframeEffectModel.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698