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

Unified Diff: Source/core/animation/LengthStyleInterpolationTest.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: (Hopefully) Builds with oilpan now Created 5 years, 6 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/LengthStyleInterpolationTest.cpp
diff --git a/Source/core/animation/LengthStyleInterpolationTest.cpp b/Source/core/animation/LengthStyleInterpolationTest.cpp
index d89505efda48ff55afbebd3c75c9cfb20f1c6ab5..b233cdaadc78a47af5c2cda4c0949bb87c5a29dd 100644
--- a/Source/core/animation/LengthStyleInterpolationTest.cpp
+++ b/Source/core/animation/LengthStyleInterpolationTest.cpp
@@ -19,21 +19,21 @@ protected:
return LengthStyleInterpolation::toInterpolableValue(value);
}
- static PassRefPtrWillBeRawPtr<CSSValue> interpolableValueToLength(InterpolableValue* value, InterpolationRange range)
+ static CSSValue interpolableValueToLength(InterpolableValue* value, InterpolationRange range)
{
return LengthStyleInterpolation::fromInterpolableValue(*value, range);
}
- static PassRefPtrWillBeRawPtr<CSSValue> roundTrip(PassRefPtrWillBeRawPtr<CSSValue> value)
+ static CSSValue roundTrip(CSSValue value)
{
- return interpolableValueToLength(lengthToInterpolableValue(*value).get(), RangeAll);
+ return interpolableValueToLength(lengthToInterpolableValue(value).get(), RangeAll);
}
- static void testPrimitiveValue(RefPtrWillBeRawPtr<CSSValue> value, double doubleValue, CSSPrimitiveValue::UnitType unitType)
+ static void testPrimitiveValue(CSSValue value, double doubleValue, CSSPrimitiveValue::UnitType unitType)
{
- EXPECT_TRUE(value->isPrimitiveValue());
- EXPECT_EQ(doubleValue, toCSSPrimitiveValue(value.get())->getDoubleValue());
- EXPECT_EQ(unitType, toCSSPrimitiveValue(value.get())->primitiveType());
+ EXPECT_TRUE(value.isPrimitiveValue());
+ EXPECT_EQ(doubleValue, toCSSPrimitiveValue(value).getDoubleValue());
+ EXPECT_EQ(unitType, toCSSPrimitiveValue(value).primitiveType());
}
static PassOwnPtrWillBeRawPtr<InterpolableList> createInterpolableLength(double a, double b, double c, double d, double e, double f, double g, double h, double i, double j)
@@ -66,7 +66,7 @@ protected:
initLengthArray(lengthArray);
RefPtrWillBeRawPtr<MutableStylePropertySet> propertySet = MutableStylePropertySet::create();
propertySet->setProperty(CSSPropertyLeft, text);
- toCSSPrimitiveValue(propertySet->getPropertyCSSValue(CSSPropertyLeft).get())->accumulateLengthArray(lengthArray);
+ toCSSPrimitiveValue(propertySet->getPropertyCSSValue(CSSPropertyLeft))->accumulateLengthArray(lengthArray);
return lengthArray;
}
@@ -82,20 +82,20 @@ protected:
TEST_F(AnimationLengthStyleInterpolationTest, ZeroLength)
{
- RefPtrWillBeRawPtr<CSSValue> value1 = roundTrip(CSSPrimitiveValue::create(0, CSSPrimitiveValue::CSS_PX));
+ CSSValue value1 = roundTrip(CSSPrimitiveValue::create(0, CSSPrimitiveValue::CSS_PX));
testPrimitiveValue(value1, 0, CSSPrimitiveValue::CSS_PX);
- RefPtrWillBeRawPtr<CSSValue> value2 = roundTrip(CSSPrimitiveValue::create(0, CSSPrimitiveValue::CSS_PERCENTAGE));
+ CSSValue value2 = roundTrip(CSSPrimitiveValue::create(0, CSSPrimitiveValue::CSS_PERCENTAGE));
testPrimitiveValue(value2, 0, CSSPrimitiveValue::CSS_PERCENTAGE);
- RefPtrWillBeRawPtr<CSSValue> value3 = roundTrip(CSSPrimitiveValue::create(0, CSSPrimitiveValue::CSS_EMS));
+ CSSValue value3 = roundTrip(CSSPrimitiveValue::create(0, CSSPrimitiveValue::CSS_EMS));
testPrimitiveValue(value3, 0, CSSPrimitiveValue::CSS_EMS);
}
TEST_F(AnimationLengthStyleInterpolationTest, SingleUnit)
{
- RefPtrWillBeRawPtr<CSSValue> value = roundTrip(CSSPrimitiveValue::create(10, CSSPrimitiveValue::CSS_PX));
+ CSSValue value = roundTrip(CSSPrimitiveValue::create(10, CSSPrimitiveValue::CSS_PX));
testPrimitiveValue(value, 10, CSSPrimitiveValue::CSS_PX);
value = roundTrip(CSSPrimitiveValue::create(30, CSSPrimitiveValue::CSS_PERCENTAGE));
@@ -107,12 +107,12 @@ TEST_F(AnimationLengthStyleInterpolationTest, SingleUnit)
TEST_F(AnimationLengthStyleInterpolationTest, SingleClampedUnit)
{
- RefPtrWillBeRawPtr<CSSValue> value1 = CSSPrimitiveValue::create(-10, CSSPrimitiveValue::CSS_PX);
- value1 = interpolableValueToLength(lengthToInterpolableValue(*value1).get(), RangeNonNegative);
+ CSSValue value1 = CSSPrimitiveValue::create(-10, CSSPrimitiveValue::CSS_PX);
+ value1 = interpolableValueToLength(lengthToInterpolableValue(value1).get(), RangeNonNegative);
testPrimitiveValue(value1, 0, CSSPrimitiveValue::CSS_PX);
- RefPtrWillBeRawPtr<CSSValue> value2 = CSSPrimitiveValue::create(-10, CSSPrimitiveValue::CSS_EMS);
- value2 = interpolableValueToLength(lengthToInterpolableValue(*value2).get(), RangeNonNegative);
+ CSSValue value2 = CSSPrimitiveValue::create(-10, CSSPrimitiveValue::CSS_EMS);
+ value2 = interpolableValueToLength(lengthToInterpolableValue(value2).get(), RangeNonNegative);
testPrimitiveValue(value2, 0, CSSPrimitiveValue::CSS_EMS);
}
@@ -123,7 +123,7 @@ TEST_F(AnimationLengthStyleInterpolationTest, MultipleUnits)
OwnPtrWillBeRawPtr<InterpolableList> result = InterpolableList::create(2);
result->set(0, createInterpolableLength(0, 10, 0, 10, 0, 10, 0, 10, 0, 10));
result->set(1, createInterpolableLength(0, 1, 0, 1, 0, 1, 0, 1, 0, 1));
- toCSSPrimitiveValue(interpolableValueToLength(result.get(), RangeAll).get())->accumulateLengthArray(expectation);
+ toCSSPrimitiveValue(interpolableValueToLength(result.get(), RangeAll)).accumulateLengthArray(expectation);
EXPECT_TRUE(lengthArraysEqual(expectation, setLengthArray(actual, "calc(10% + 10ex + 10ch + 10vh + 10vmax)")));
}
@@ -134,7 +134,7 @@ TEST_F(AnimationLengthStyleInterpolationTest, MultipleUnitsWithSingleValues)
OwnPtrWillBeRawPtr<InterpolableList> result = InterpolableList::create(2);
result->set(0, createInterpolableLength(0, 10, 0, 10, 0, 10, 0, 10, 0, 10));
result->set(1, createInterpolableLength(0, 1, 0, 1, 0, 1, 0, 1, 0, 1));
- toCSSPrimitiveValue(interpolableValueToLength(result.get(), RangeAll).get())->accumulateLengthArray(expectation);
+ toCSSPrimitiveValue(interpolableValueToLength(result.get(), RangeAll)).accumulateLengthArray(expectation);
EXPECT_TRUE(lengthArraysEqual(expectation, setLengthArray(actual, "calc(10% + 10ex + 10ch + 10vh + 10vmax)")));
}
@@ -146,7 +146,7 @@ TEST_F(AnimationLengthStyleInterpolationTest, MultipleUnitsWithMultipleValues)
OwnPtrWillBeRawPtr<InterpolableList> result = InterpolableList::create(2);
result->set(0, createInterpolableLength(0, 20, 0, 30, 0, 8, 0, 10, 0, 7));
result->set(1, createInterpolableLength(0, 1, 0, 1, 0, 1, 0, 1, 0, 1));
- toCSSPrimitiveValue(interpolableValueToLength(result.get(), RangeAll).get())->accumulateLengthArray(expectation);
+ toCSSPrimitiveValue(interpolableValueToLength(result.get(), RangeAll)).accumulateLengthArray(expectation);
EXPECT_TRUE(lengthArraysEqual(expectation, setLengthArray(actual, "calc(20% + 30ex + 8ch + 10vh + 7vmax)")));
}
@@ -158,7 +158,7 @@ TEST_F(AnimationLengthStyleInterpolationTest, MultipleUnitsWithZeroValue)
OwnPtrWillBeRawPtr<InterpolableList> result = InterpolableList::create(2);
result->set(0, createInterpolableLength(0, 10, 0, 10, 0, 10, 0, 10, 0, 10));
result->set(1, createInterpolableLength(1, 1, 0, 1, 0, 1, 0, 1, 0, 1));
- toCSSPrimitiveValue(interpolableValueToLength(result.get(), RangeAll).get())->accumulateLengthArray(expectation);
+ toCSSPrimitiveValue(interpolableValueToLength(result.get(), RangeAll)).accumulateLengthArray(expectation);
EXPECT_TRUE(lengthArraysEqual(expectation, setLengthArray(actual, "calc(0px + 10% + 10ex + 10ch + 10vh + 10vmax)")));
}
@@ -169,7 +169,7 @@ TEST_F(AnimationLengthStyleInterpolationTest, MultipleUnitsWithZeroValues)
OwnPtrWillBeRawPtr<InterpolableList> result = InterpolableList::create(2);
result->set(0, createInterpolableLength(0, 10, 0, 10, 0, 10, 0, 10, 0, 10));
result->set(1, createInterpolableLength(1, 1, 1, 1, 0, 1, 0, 1, 1, 1));
- toCSSPrimitiveValue(interpolableValueToLength(result.get(), RangeAll).get())->accumulateLengthArray(expectation);
+ toCSSPrimitiveValue(interpolableValueToLength(result.get(), RangeAll)).accumulateLengthArray(expectation);
EXPECT_TRUE(lengthArraysEqual(expectation, setLengthArray(actual, "calc(0px + 10% + 0em + 10ex + 10ch + 10vh + 0vmin + 10vmax)")));
}

Powered by Google App Engine
This is Rietveld 408576698