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

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

Issue 1164573002: CSSValue Immediates: Change CSSValue to an object instead of a pointer (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase Created 5 years, 5 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/LengthPairStyleInterpolationTest.cpp
diff --git a/Source/core/animation/LengthPairStyleInterpolationTest.cpp b/Source/core/animation/LengthPairStyleInterpolationTest.cpp
index b7856aff8b3d5ad34e79464ba641497b34278844..a4a4373cba0861c442c1e09d6aa886006edb3942 100644
--- a/Source/core/animation/LengthPairStyleInterpolationTest.cpp
+++ b/Source/core/animation/LengthPairStyleInterpolationTest.cpp
@@ -22,21 +22,21 @@ protected:
return LengthPairStyleInterpolation::lengthPairToInterpolableValue(value);
}
- static PassRefPtrWillBeRawPtr<CSSValue> interpolableValueToLengthPair(InterpolableValue* value, InterpolationRange range)
+ static CSSValue interpolableValueToLengthPair(InterpolableValue* value, InterpolationRange range)
{
return LengthPairStyleInterpolation::interpolableValueToLengthPair(value, range);
}
- static PassRefPtrWillBeRawPtr<CSSValue> roundTrip(PassRefPtrWillBeRawPtr<CSSValue> value, InterpolationRange range)
+ static CSSValue roundTrip(CSSValue value, InterpolationRange range)
{
- return interpolableValueToLengthPair(lengthPairToInterpolableValue(*value).get(), range);
+ return interpolableValueToLengthPair(lengthPairToInterpolableValue(value).get(), range);
}
- static void testPrimitiveValue(RefPtrWillBeRawPtr<CSSValue> value, double first, double second, CSSPrimitiveValue::UnitType unitType)
+ static void testPrimitiveValue(CSSValue value, double first, double second, CSSPrimitiveValue::UnitType unitType)
{
- EXPECT_TRUE(value->isPrimitiveValue());
+ EXPECT_TRUE(value.isPrimitiveValue());
- Pair* pair = toCSSPrimitiveValue(value.get())->getPairValue();
+ Pair* pair = toCSSPrimitiveValue(value).getPairValue();
ASSERT_TRUE(pair);
EXPECT_EQ(pair->first()->getDoubleValue(), first);
@@ -52,25 +52,25 @@ TEST_F(LengthPairStyleInterpolationTest, ZeroTest)
RefPtrWillBeRawPtr<CSSPrimitiveValue> firstPx = CSSPrimitiveValue::create(0, CSSPrimitiveValue::CSS_PX);
RefPtrWillBeRawPtr<CSSPrimitiveValue> secondPx = CSSPrimitiveValue::create(0, CSSPrimitiveValue::CSS_PX);
RefPtrWillBeRawPtr<Pair> pairPx = Pair::create(firstPx, secondPx, Pair::KeepIdenticalValues);
- RefPtrWillBeRawPtr<CSSValue> value1 = roundTrip(CSSPrimitiveValue::create(pairPx.release()), RangeNonNegative);
+ CSSValue value1 = roundTrip(CSSPrimitiveValue::create(pairPx.release()), RangeNonNegative);
testPrimitiveValue(value1, 0, 0, CSSPrimitiveValue::CSS_PX);
RefPtrWillBeRawPtr<CSSPrimitiveValue> firstPc = CSSPrimitiveValue::create(0, CSSPrimitiveValue::CSS_PERCENTAGE);
RefPtrWillBeRawPtr<CSSPrimitiveValue> secondPc = CSSPrimitiveValue::create(0, CSSPrimitiveValue::CSS_PERCENTAGE);
RefPtrWillBeRawPtr<Pair> pairPc = Pair::create(firstPc, secondPc, Pair::KeepIdenticalValues);
- RefPtrWillBeRawPtr<CSSValue> value2 = roundTrip(CSSPrimitiveValue::create(pairPc.release()), RangeNonNegative);
+ CSSValue value2 = roundTrip(CSSPrimitiveValue::create(pairPc.release()), RangeNonNegative);
testPrimitiveValue(value2, 0, 0, CSSPrimitiveValue::CSS_PERCENTAGE);
RefPtrWillBeRawPtr<CSSPrimitiveValue> firstEms = CSSPrimitiveValue::create(0, CSSPrimitiveValue::CSS_EMS);
RefPtrWillBeRawPtr<CSSPrimitiveValue> secondEms = CSSPrimitiveValue::create(0, CSSPrimitiveValue::CSS_EMS);
RefPtrWillBeRawPtr<Pair> pairEms = Pair::create(firstEms, secondEms, Pair::KeepIdenticalValues);
- RefPtrWillBeRawPtr<CSSValue> value3 = roundTrip(CSSPrimitiveValue::create(pairEms.release()), RangeNonNegative);
+ CSSValue value3 = roundTrip(CSSPrimitiveValue::create(pairEms.release()), RangeNonNegative);
testPrimitiveValue(value3, 0, 0, CSSPrimitiveValue::CSS_EMS);
RefPtrWillBeRawPtr<CSSPrimitiveValue> firstPcNeg = CSSPrimitiveValue::create(0, CSSPrimitiveValue::CSS_PERCENTAGE);
RefPtrWillBeRawPtr<CSSPrimitiveValue> secondPcNeg = CSSPrimitiveValue::create(0, CSSPrimitiveValue::CSS_PERCENTAGE);
RefPtrWillBeRawPtr<Pair> pairPcNeg = Pair::create(firstPcNeg, secondPcNeg, Pair::KeepIdenticalValues);
- RefPtrWillBeRawPtr<CSSValue> value4 = roundTrip(CSSPrimitiveValue::create(pairPcNeg.release()), RangeAll);
+ CSSValue value4 = roundTrip(CSSPrimitiveValue::create(pairPcNeg.release()), RangeAll);
testPrimitiveValue(value4, 0, 0, CSSPrimitiveValue::CSS_PERCENTAGE);
}
@@ -79,13 +79,13 @@ TEST_F(LengthPairStyleInterpolationTest, MultipleValueTest)
RefPtrWillBeRawPtr<CSSPrimitiveValue> firstPx = CSSPrimitiveValue::create(10, CSSPrimitiveValue::CSS_PX);
RefPtrWillBeRawPtr<CSSPrimitiveValue> secondPx = CSSPrimitiveValue::create(20, CSSPrimitiveValue::CSS_PX);
RefPtrWillBeRawPtr<Pair> pairPx = Pair::create(firstPx, secondPx, Pair::KeepIdenticalValues);
- RefPtrWillBeRawPtr<CSSValue> value5 = roundTrip(CSSPrimitiveValue::create(pairPx.release()), RangeNonNegative);
+ CSSValue value5 = roundTrip(CSSPrimitiveValue::create(pairPx.release()), RangeNonNegative);
testPrimitiveValue(value5, 10, 20, CSSPrimitiveValue::CSS_PX);
RefPtrWillBeRawPtr<CSSPrimitiveValue> firstPc = CSSPrimitiveValue::create(30, CSSPrimitiveValue::CSS_PERCENTAGE);
RefPtrWillBeRawPtr<CSSPrimitiveValue> secondPc = CSSPrimitiveValue::create(-30, CSSPrimitiveValue::CSS_PERCENTAGE);
RefPtrWillBeRawPtr<Pair> pairPc = Pair::create(firstPc, secondPc, Pair::KeepIdenticalValues);
- RefPtrWillBeRawPtr<CSSValue> value6 = roundTrip(CSSPrimitiveValue::create(pairPc.release()), RangeNonNegative);
+ CSSValue value6 = roundTrip(CSSPrimitiveValue::create(pairPc.release()), RangeNonNegative);
testPrimitiveValue(value6, 30, 0, CSSPrimitiveValue::CSS_PERCENTAGE);
}
« no previous file with comments | « Source/core/animation/LengthPairStyleInterpolation.cpp ('k') | Source/core/animation/LengthStyleInterpolation.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698