| Index: Source/core/animation/animatable/AnimatableDoubleAndBoolTest.cpp
|
| diff --git a/Source/core/animation/animatable/AnimatableDoubleAndBoolTest.cpp b/Source/core/animation/animatable/AnimatableDoubleAndBoolTest.cpp
|
| index 0217949e859f647e0e2973c3c7f8b2eaa9f40762..1dea80485e1706cd5a2e8266ebdbba3ecaab2c7a 100644
|
| --- a/Source/core/animation/animatable/AnimatableDoubleAndBoolTest.cpp
|
| +++ b/Source/core/animation/animatable/AnimatableDoubleAndBoolTest.cpp
|
| @@ -13,17 +13,17 @@ namespace {
|
|
|
| TEST(AnimationAnimatableDoubleAndBoolTest, Create)
|
| {
|
| - EXPECT_TRUE(static_cast<bool>(AnimatableDoubleAndBool::create(30, false).get()));
|
| - EXPECT_TRUE(static_cast<bool>(AnimatableDoubleAndBool::create(270, true).get()));
|
| + EXPECT_TRUE(static_cast<bool>(AnimatableDoubleAndBool::create(30, false)));
|
| + EXPECT_TRUE(static_cast<bool>(AnimatableDoubleAndBool::create(270, true)));
|
| }
|
|
|
| TEST(AnimationAnimatableDoubleAndBoolTest, Equal)
|
| {
|
| - EXPECT_TRUE(AnimatableDoubleAndBool::create(30, false)->equals(AnimatableDoubleAndBool::create(30, false).get()));
|
| - EXPECT_TRUE(AnimatableDoubleAndBool::create(270, true)->equals(AnimatableDoubleAndBool::create(270, true).get()));
|
| - EXPECT_FALSE(AnimatableDoubleAndBool::create(30, false)->equals(AnimatableDoubleAndBool::create(270, true).get()));
|
| - EXPECT_FALSE(AnimatableDoubleAndBool::create(30, false)->equals(AnimatableDoubleAndBool::create(270, false).get()));
|
| - EXPECT_FALSE(AnimatableDoubleAndBool::create(30, false)->equals(AnimatableDoubleAndBool::create(30, true).get()));
|
| + EXPECT_TRUE(AnimatableDoubleAndBool::create(30, false)->equals(AnimatableDoubleAndBool::create(30, false)));
|
| + EXPECT_TRUE(AnimatableDoubleAndBool::create(270, true)->equals(AnimatableDoubleAndBool::create(270, true)));
|
| + EXPECT_FALSE(AnimatableDoubleAndBool::create(30, false)->equals(AnimatableDoubleAndBool::create(270, true)));
|
| + EXPECT_FALSE(AnimatableDoubleAndBool::create(30, false)->equals(AnimatableDoubleAndBool::create(270, false)));
|
| + EXPECT_FALSE(AnimatableDoubleAndBool::create(30, false)->equals(AnimatableDoubleAndBool::create(30, true)));
|
| }
|
|
|
| TEST(AnimationAnimatableDoubleAndBoolTest, ToDouble)
|
| @@ -40,49 +40,49 @@ TEST(AnimationAnimatableDoubleAndBoolTest, Flag)
|
|
|
| TEST(AnimationAnimatableDoubleAndBoolTest, InterpolateFalse)
|
| {
|
| - RefPtrWillBeRawPtr<AnimatableDoubleAndBool> from10 = AnimatableDoubleAndBool::create(10, false);
|
| - RefPtrWillBeRawPtr<AnimatableDoubleAndBool> to20 = AnimatableDoubleAndBool::create(20, false);
|
| - EXPECT_FALSE(toAnimatableDoubleAndBool(AnimatableValue::interpolate(from10.get(), to20.get(), -0.5).get())->flag());
|
| - EXPECT_EQ(5, toAnimatableDoubleAndBool(AnimatableValue::interpolate(from10.get(), to20.get(), -0.5).get())->toDouble());
|
| - EXPECT_EQ(10, toAnimatableDoubleAndBool(AnimatableValue::interpolate(from10.get(), to20.get(), 0).get())->toDouble());
|
| - EXPECT_EQ(14, toAnimatableDoubleAndBool(AnimatableValue::interpolate(from10.get(), to20.get(), 0.4).get())->toDouble());
|
| - EXPECT_EQ(15, toAnimatableDoubleAndBool(AnimatableValue::interpolate(from10.get(), to20.get(), 0.5).get())->toDouble());
|
| - EXPECT_EQ(16, toAnimatableDoubleAndBool(AnimatableValue::interpolate(from10.get(), to20.get(), 0.6).get())->toDouble());
|
| - EXPECT_EQ(20, toAnimatableDoubleAndBool(AnimatableValue::interpolate(from10.get(), to20.get(), 1).get())->toDouble());
|
| - EXPECT_EQ(25, toAnimatableDoubleAndBool(AnimatableValue::interpolate(from10.get(), to20.get(), 1.5).get())->toDouble());
|
| - EXPECT_FALSE(toAnimatableDoubleAndBool(AnimatableValue::interpolate(from10.get(), to20.get(), 1.5).get())->flag());
|
| + AnimatableDoubleAndBool* from10 = AnimatableDoubleAndBool::create(10, false);
|
| + AnimatableDoubleAndBool* to20 = AnimatableDoubleAndBool::create(20, false);
|
| + EXPECT_FALSE(toAnimatableDoubleAndBool(AnimatableValue::interpolate(from10, to20, -0.5))->flag());
|
| + EXPECT_EQ(5, toAnimatableDoubleAndBool(AnimatableValue::interpolate(from10, to20, -0.5))->toDouble());
|
| + EXPECT_EQ(10, toAnimatableDoubleAndBool(AnimatableValue::interpolate(from10, to20, 0))->toDouble());
|
| + EXPECT_EQ(14, toAnimatableDoubleAndBool(AnimatableValue::interpolate(from10, to20, 0.4))->toDouble());
|
| + EXPECT_EQ(15, toAnimatableDoubleAndBool(AnimatableValue::interpolate(from10, to20, 0.5))->toDouble());
|
| + EXPECT_EQ(16, toAnimatableDoubleAndBool(AnimatableValue::interpolate(from10, to20, 0.6))->toDouble());
|
| + EXPECT_EQ(20, toAnimatableDoubleAndBool(AnimatableValue::interpolate(from10, to20, 1))->toDouble());
|
| + EXPECT_EQ(25, toAnimatableDoubleAndBool(AnimatableValue::interpolate(from10, to20, 1.5))->toDouble());
|
| + EXPECT_FALSE(toAnimatableDoubleAndBool(AnimatableValue::interpolate(from10, to20, 1.5))->flag());
|
| }
|
|
|
| TEST(AnimationAnimatableDoubleAndBoolTest, InterpolateTrue)
|
| {
|
| - RefPtrWillBeRawPtr<AnimatableDoubleAndBool> from10 = AnimatableDoubleAndBool::create(10, true);
|
| - RefPtrWillBeRawPtr<AnimatableDoubleAndBool> to20 = AnimatableDoubleAndBool::create(20, true);
|
| - EXPECT_TRUE(toAnimatableDoubleAndBool(AnimatableValue::interpolate(from10.get(), to20.get(), -0.5).get())->flag());
|
| - EXPECT_EQ(5, toAnimatableDoubleAndBool(AnimatableValue::interpolate(from10.get(), to20.get(), -0.5).get())->toDouble());
|
| - EXPECT_EQ(10, toAnimatableDoubleAndBool(AnimatableValue::interpolate(from10.get(), to20.get(), 0).get())->toDouble());
|
| - EXPECT_EQ(14, toAnimatableDoubleAndBool(AnimatableValue::interpolate(from10.get(), to20.get(), 0.4).get())->toDouble());
|
| - EXPECT_EQ(15, toAnimatableDoubleAndBool(AnimatableValue::interpolate(from10.get(), to20.get(), 0.5).get())->toDouble());
|
| - EXPECT_EQ(16, toAnimatableDoubleAndBool(AnimatableValue::interpolate(from10.get(), to20.get(), 0.6).get())->toDouble());
|
| - EXPECT_EQ(20, toAnimatableDoubleAndBool(AnimatableValue::interpolate(from10.get(), to20.get(), 1).get())->toDouble());
|
| - EXPECT_EQ(25, toAnimatableDoubleAndBool(AnimatableValue::interpolate(from10.get(), to20.get(), 1.5).get())->toDouble());
|
| - EXPECT_TRUE(toAnimatableDoubleAndBool(AnimatableValue::interpolate(from10.get(), to20.get(), 1.5).get())->flag());
|
| + AnimatableDoubleAndBool* from10 = AnimatableDoubleAndBool::create(10, true);
|
| + AnimatableDoubleAndBool* to20 = AnimatableDoubleAndBool::create(20, true);
|
| + EXPECT_TRUE(toAnimatableDoubleAndBool(AnimatableValue::interpolate(from10, to20, -0.5))->flag());
|
| + EXPECT_EQ(5, toAnimatableDoubleAndBool(AnimatableValue::interpolate(from10, to20, -0.5))->toDouble());
|
| + EXPECT_EQ(10, toAnimatableDoubleAndBool(AnimatableValue::interpolate(from10, to20, 0))->toDouble());
|
| + EXPECT_EQ(14, toAnimatableDoubleAndBool(AnimatableValue::interpolate(from10, to20, 0.4))->toDouble());
|
| + EXPECT_EQ(15, toAnimatableDoubleAndBool(AnimatableValue::interpolate(from10, to20, 0.5))->toDouble());
|
| + EXPECT_EQ(16, toAnimatableDoubleAndBool(AnimatableValue::interpolate(from10, to20, 0.6))->toDouble());
|
| + EXPECT_EQ(20, toAnimatableDoubleAndBool(AnimatableValue::interpolate(from10, to20, 1))->toDouble());
|
| + EXPECT_EQ(25, toAnimatableDoubleAndBool(AnimatableValue::interpolate(from10, to20, 1.5))->toDouble());
|
| + EXPECT_TRUE(toAnimatableDoubleAndBool(AnimatableValue::interpolate(from10, to20, 1.5))->flag());
|
| }
|
|
|
| TEST(AnimationAnimatableDoubleAndBoolTest, Step)
|
| {
|
| - RefPtrWillBeRawPtr<AnimatableDoubleAndBool> from10 = AnimatableDoubleAndBool::create(10, true);
|
| - RefPtrWillBeRawPtr<AnimatableDoubleAndBool> to20 = AnimatableDoubleAndBool::create(20, false);
|
| - EXPECT_TRUE(toAnimatableDoubleAndBool(AnimatableValue::interpolate(from10.get(), to20.get(), -0.5).get())->flag());
|
| - EXPECT_EQ(10, toAnimatableDoubleAndBool(AnimatableValue::interpolate(from10.get(), to20.get(), -0.5).get())->toDouble());
|
| - EXPECT_EQ(10, toAnimatableDoubleAndBool(AnimatableValue::interpolate(from10.get(), to20.get(), 0).get())->toDouble());
|
| - EXPECT_EQ(10, toAnimatableDoubleAndBool(AnimatableValue::interpolate(from10.get(), to20.get(), 0.4).get())->toDouble());
|
| - EXPECT_TRUE(toAnimatableDoubleAndBool(AnimatableValue::interpolate(from10.get(), to20.get(), 0.4).get())->flag());
|
| + AnimatableDoubleAndBool* from10 = AnimatableDoubleAndBool::create(10, true);
|
| + AnimatableDoubleAndBool* to20 = AnimatableDoubleAndBool::create(20, false);
|
| + EXPECT_TRUE(toAnimatableDoubleAndBool(AnimatableValue::interpolate(from10, to20, -0.5))->flag());
|
| + EXPECT_EQ(10, toAnimatableDoubleAndBool(AnimatableValue::interpolate(from10, to20, -0.5))->toDouble());
|
| + EXPECT_EQ(10, toAnimatableDoubleAndBool(AnimatableValue::interpolate(from10, to20, 0))->toDouble());
|
| + EXPECT_EQ(10, toAnimatableDoubleAndBool(AnimatableValue::interpolate(from10, to20, 0.4))->toDouble());
|
| + EXPECT_TRUE(toAnimatableDoubleAndBool(AnimatableValue::interpolate(from10, to20, 0.4))->flag());
|
|
|
| - EXPECT_FALSE(toAnimatableDoubleAndBool(AnimatableValue::interpolate(from10.get(), to20.get(), 0.6).get())->flag());
|
| - EXPECT_EQ(20, toAnimatableDoubleAndBool(AnimatableValue::interpolate(from10.get(), to20.get(), 0.6).get())->toDouble());
|
| - EXPECT_EQ(20, toAnimatableDoubleAndBool(AnimatableValue::interpolate(from10.get(), to20.get(), 1).get())->toDouble());
|
| - EXPECT_EQ(20, toAnimatableDoubleAndBool(AnimatableValue::interpolate(from10.get(), to20.get(), 1.5).get())->toDouble());
|
| - EXPECT_FALSE(toAnimatableDoubleAndBool(AnimatableValue::interpolate(from10.get(), to20.get(), 1.5).get())->flag());
|
| + EXPECT_FALSE(toAnimatableDoubleAndBool(AnimatableValue::interpolate(from10, to20, 0.6))->flag());
|
| + EXPECT_EQ(20, toAnimatableDoubleAndBool(AnimatableValue::interpolate(from10, to20, 0.6))->toDouble());
|
| + EXPECT_EQ(20, toAnimatableDoubleAndBool(AnimatableValue::interpolate(from10, to20, 1))->toDouble());
|
| + EXPECT_EQ(20, toAnimatableDoubleAndBool(AnimatableValue::interpolate(from10, to20, 1.5))->toDouble());
|
| + EXPECT_FALSE(toAnimatableDoubleAndBool(AnimatableValue::interpolate(from10, to20, 1.5))->flag());
|
| }
|
|
|
| }
|
|
|