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

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

Issue 186463002: Web Animations: define distance for AnimatableColor (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 10 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/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()));
+}
+
}

Powered by Google App Engine
This is Rietveld 408576698