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

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

Issue 1317523002: Changed Pair to be a CSSValue (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@add_const_to_primvalue
Patch Set: Rebase Created 5 years, 4 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 | « Source/core/animation/LengthPairStyleInterpolation.cpp ('k') | Source/core/core.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/animation/LengthPairStyleInterpolationTest.cpp
diff --git a/Source/core/animation/LengthPairStyleInterpolationTest.cpp b/Source/core/animation/LengthPairStyleInterpolationTest.cpp
index e2cef4f9a2658231eb68cbcbc9b85d2008a22be9..6d3b8f140d531f3be0f4b086163a9fc431423d50 100644
--- a/Source/core/animation/LengthPairStyleInterpolationTest.cpp
+++ b/Source/core/animation/LengthPairStyleInterpolationTest.cpp
@@ -7,7 +7,7 @@
#include "core/css/CSSPrimitiveValue.h"
#include "core/css/CSSValue.h"
-#include "core/css/Pair.h"
+#include "core/css/CSSValuePair.h"
#include "core/css/StylePropertySet.h"
#include <gtest/gtest.h>
@@ -34,16 +34,16 @@ protected:
static void testPrimitiveValue(RefPtrWillBeRawPtr<CSSValue> value, double first, double second, CSSPrimitiveValue::UnitType unitType)
{
- EXPECT_TRUE(value->isPrimitiveValue());
+ EXPECT_TRUE(value->isValuePair());
- Pair* pair = toCSSPrimitiveValue(value.get())->getPairValue();
+ CSSValuePair* pair = toCSSValuePair(value.get());
ASSERT_TRUE(pair);
- EXPECT_EQ(pair->first()->getDoubleValue(), first);
- EXPECT_EQ(pair->second()->getDoubleValue(), second);
+ EXPECT_EQ(toCSSPrimitiveValue(pair->first())->getDoubleValue(), first);
+ EXPECT_EQ(toCSSPrimitiveValue(pair->second())->getDoubleValue(), second);
- EXPECT_EQ(pair->first()->typeWithCalcResolved(), unitType);
- EXPECT_EQ(pair->second()->typeWithCalcResolved(), unitType);
+ EXPECT_EQ(toCSSPrimitiveValue(pair->first())->typeWithCalcResolved(), unitType);
+ EXPECT_EQ(toCSSPrimitiveValue(pair->second())->typeWithCalcResolved(), unitType);
}
};
@@ -51,26 +51,26 @@ TEST_F(LengthPairStyleInterpolationTest, ZeroTest)
{
RefPtrWillBeRawPtr<CSSPrimitiveValue> firstPx = CSSPrimitiveValue::create(0, CSSPrimitiveValue::UnitType::Pixels);
RefPtrWillBeRawPtr<CSSPrimitiveValue> secondPx = CSSPrimitiveValue::create(0, CSSPrimitiveValue::UnitType::Pixels);
- RefPtrWillBeRawPtr<Pair> pairPx = Pair::create(firstPx, secondPx, Pair::KeepIdenticalValues);
- RefPtrWillBeRawPtr<CSSValue> value1 = roundTrip(CSSPrimitiveValue::create(pairPx.release()), RangeNonNegative);
+ RefPtrWillBeRawPtr<CSSValuePair> pairPx = CSSValuePair::create(firstPx.release(), secondPx.release(), CSSValuePair::KeepIdenticalValues);
+ RefPtrWillBeRawPtr<CSSValue> value1 = roundTrip(pairPx.release(), RangeNonNegative);
testPrimitiveValue(value1, 0, 0, CSSPrimitiveValue::UnitType::Pixels);
RefPtrWillBeRawPtr<CSSPrimitiveValue> firstPc = CSSPrimitiveValue::create(0, CSSPrimitiveValue::UnitType::Percentage);
RefPtrWillBeRawPtr<CSSPrimitiveValue> secondPc = CSSPrimitiveValue::create(0, CSSPrimitiveValue::UnitType::Percentage);
- RefPtrWillBeRawPtr<Pair> pairPc = Pair::create(firstPc, secondPc, Pair::KeepIdenticalValues);
- RefPtrWillBeRawPtr<CSSValue> value2 = roundTrip(CSSPrimitiveValue::create(pairPc.release()), RangeNonNegative);
+ RefPtrWillBeRawPtr<CSSValuePair> pairPc = CSSValuePair::create(firstPc.release(), secondPc.release(), CSSValuePair::KeepIdenticalValues);
+ RefPtrWillBeRawPtr<CSSValue> value2 = roundTrip(pairPc.release(), RangeNonNegative);
testPrimitiveValue(value2, 0, 0, CSSPrimitiveValue::UnitType::Percentage);
RefPtrWillBeRawPtr<CSSPrimitiveValue> firstEms = CSSPrimitiveValue::create(0, CSSPrimitiveValue::UnitType::Ems);
RefPtrWillBeRawPtr<CSSPrimitiveValue> secondEms = CSSPrimitiveValue::create(0, CSSPrimitiveValue::UnitType::Ems);
- RefPtrWillBeRawPtr<Pair> pairEms = Pair::create(firstEms, secondEms, Pair::KeepIdenticalValues);
- RefPtrWillBeRawPtr<CSSValue> value3 = roundTrip(CSSPrimitiveValue::create(pairEms.release()), RangeNonNegative);
+ RefPtrWillBeRawPtr<CSSValuePair> pairEms = CSSValuePair::create(firstEms.release(), secondEms.release(), CSSValuePair::KeepIdenticalValues);
+ RefPtrWillBeRawPtr<CSSValue> value3 = roundTrip(pairEms.release(), RangeNonNegative);
testPrimitiveValue(value3, 0, 0, CSSPrimitiveValue::UnitType::Ems);
RefPtrWillBeRawPtr<CSSPrimitiveValue> firstPcNeg = CSSPrimitiveValue::create(0, CSSPrimitiveValue::UnitType::Percentage);
RefPtrWillBeRawPtr<CSSPrimitiveValue> secondPcNeg = CSSPrimitiveValue::create(0, CSSPrimitiveValue::UnitType::Percentage);
- RefPtrWillBeRawPtr<Pair> pairPcNeg = Pair::create(firstPcNeg, secondPcNeg, Pair::KeepIdenticalValues);
- RefPtrWillBeRawPtr<CSSValue> value4 = roundTrip(CSSPrimitiveValue::create(pairPcNeg.release()), RangeAll);
+ RefPtrWillBeRawPtr<CSSValuePair> pairPcNeg = CSSValuePair::create(firstPcNeg.release(), secondPcNeg.release(), CSSValuePair::KeepIdenticalValues);
+ RefPtrWillBeRawPtr<CSSValue> value4 = roundTrip(pairPcNeg.release(), RangeAll);
testPrimitiveValue(value4, 0, 0, CSSPrimitiveValue::UnitType::Percentage);
}
@@ -78,14 +78,14 @@ TEST_F(LengthPairStyleInterpolationTest, MultipleValueTest)
{
RefPtrWillBeRawPtr<CSSPrimitiveValue> firstPx = CSSPrimitiveValue::create(10, CSSPrimitiveValue::UnitType::Pixels);
RefPtrWillBeRawPtr<CSSPrimitiveValue> secondPx = CSSPrimitiveValue::create(20, CSSPrimitiveValue::UnitType::Pixels);
- RefPtrWillBeRawPtr<Pair> pairPx = Pair::create(firstPx, secondPx, Pair::KeepIdenticalValues);
- RefPtrWillBeRawPtr<CSSValue> value5 = roundTrip(CSSPrimitiveValue::create(pairPx.release()), RangeNonNegative);
+ RefPtrWillBeRawPtr<CSSValuePair> pairPx = CSSValuePair::create(firstPx.release(), secondPx.release(), CSSValuePair::KeepIdenticalValues);
+ RefPtrWillBeRawPtr<CSSValue> value5 = roundTrip(pairPx.release(), RangeNonNegative);
testPrimitiveValue(value5, 10, 20, CSSPrimitiveValue::UnitType::Pixels);
RefPtrWillBeRawPtr<CSSPrimitiveValue> firstPc = CSSPrimitiveValue::create(30, CSSPrimitiveValue::UnitType::Percentage);
RefPtrWillBeRawPtr<CSSPrimitiveValue> secondPc = CSSPrimitiveValue::create(-30, CSSPrimitiveValue::UnitType::Percentage);
- RefPtrWillBeRawPtr<Pair> pairPc = Pair::create(firstPc, secondPc, Pair::KeepIdenticalValues);
- RefPtrWillBeRawPtr<CSSValue> value6 = roundTrip(CSSPrimitiveValue::create(pairPc.release()), RangeNonNegative);
+ RefPtrWillBeRawPtr<CSSValuePair> pairPc = CSSValuePair::create(firstPc.release(), secondPc.release(), CSSValuePair::KeepIdenticalValues);
+ RefPtrWillBeRawPtr<CSSValue> value6 = roundTrip(pairPc.release(), RangeNonNegative);
testPrimitiveValue(value6, 30, 0, CSSPrimitiveValue::UnitType::Percentage);
}
« no previous file with comments | « Source/core/animation/LengthPairStyleInterpolation.cpp ('k') | Source/core/core.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698