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

Unified Diff: third_party/WebKit/Source/platform/animation/WebCompositorAnimationTest.cpp

Issue 1616653002: CC Animation: Move files from cc_blink to Source/platform/animation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix ScrollAnimatorCompositorCoordinator for MSVC. Created 4 years, 11 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: third_party/WebKit/Source/platform/animation/WebCompositorAnimationTest.cpp
diff --git a/third_party/WebKit/Source/platform/animation/WebCompositorAnimationTest.cpp b/third_party/WebKit/Source/platform/animation/WebCompositorAnimationTest.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..8327ce706825a8b9c41b1aaa9ba0c5c54460630d
--- /dev/null
+++ b/third_party/WebKit/Source/platform/animation/WebCompositorAnimationTest.cpp
@@ -0,0 +1,41 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "platform/animation/WebCompositorAnimation.h"
+
+#include "platform/animation/WebFloatAnimationCurve.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+namespace blink {
+
+TEST(WebCompositorAnimationTest, DefaultSettings)
+{
+ scoped_ptr<WebCompositorAnimationCurve> curve(new WebFloatAnimationCurve());
+ scoped_ptr<WebCompositorAnimation> animation(new WebCompositorAnimation(
+ *curve, WebCompositorAnimation::TargetPropertyOpacity, 1, 0));
+
+ // Ensure that the defaults are correct.
+ EXPECT_EQ(1, animation->iterations());
+ EXPECT_EQ(0, animation->startTime());
+ EXPECT_EQ(0, animation->timeOffset());
+ EXPECT_EQ(WebCompositorAnimation::DirectionNormal, animation->direction());
+}
+
+TEST(WebCompositorAnimationTest, ModifiedSettings)
+{
+ scoped_ptr<WebFloatAnimationCurve> curve(new WebFloatAnimationCurve());
+ scoped_ptr<WebCompositorAnimation> animation(new WebCompositorAnimation(
+ *curve, WebCompositorAnimation::TargetPropertyOpacity, 1, 0));
+ animation->setIterations(2);
+ animation->setStartTime(2);
+ animation->setTimeOffset(2);
+ animation->setDirection(WebCompositorAnimation::DirectionReverse);
+
+ EXPECT_EQ(2, animation->iterations());
+ EXPECT_EQ(2, animation->startTime());
+ EXPECT_EQ(2, animation->timeOffset());
+ EXPECT_EQ(WebCompositorAnimation::DirectionReverse, animation->direction());
+}
+
+} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698