Index: Source/core/animation/AnimatableDoubleTest.cpp |
diff --git a/Source/core/animation/AnimatableDoubleTest.cpp b/Source/core/animation/AnimatableDoubleTest.cpp |
index d6f9a5983e260fe0bcfac7005aedc47720391de8..973cd43ff8432581c8983012dddafd36224b3016 100644 |
--- a/Source/core/animation/AnimatableDoubleTest.cpp |
+++ b/Source/core/animation/AnimatableDoubleTest.cpp |
@@ -88,4 +88,15 @@ TEST(AnimationAnimatableDoubleTest, Add) |
EXPECT_EQ(30, toAnimatableDouble(AnimatableValue::add(AnimatableDouble::create(30).get(), AnimatableDouble::create(0).get()).get())->toDouble()); |
} |
+TEST(AnimationAnimatableDoubleTest, Distance) |
+{ |
+ RefPtrWillBeRawPtr<AnimatableDouble> first = AnimatableDouble::create(-1.5); |
+ RefPtrWillBeRawPtr<AnimatableDouble> second = AnimatableDouble::create(2.25); |
+ RefPtrWillBeRawPtr<AnimatableDouble> third = AnimatableDouble::create(3); |
+ |
+ EXPECT_DOUBLE_EQ(3.75, AnimatableValue::distance(first.get(), second.get())); |
+ EXPECT_DOUBLE_EQ(0.75, AnimatableValue::distance(second.get(), third.get())); |
+ EXPECT_DOUBLE_EQ(4.5, AnimatableValue::distance(third.get(), first.get())); |
+} |
+ |
} |