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

Side by Side 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, 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "platform/animation/WebCompositorAnimation.h"
6
7 #include "platform/animation/WebFloatAnimationCurve.h"
8 #include "testing/gtest/include/gtest/gtest.h"
9
10 namespace blink {
11
12 TEST(WebCompositorAnimationTest, DefaultSettings)
13 {
14 scoped_ptr<WebCompositorAnimationCurve> curve(new WebFloatAnimationCurve());
15 scoped_ptr<WebCompositorAnimation> animation(new WebCompositorAnimation(
16 *curve, WebCompositorAnimation::TargetPropertyOpacity, 1, 0));
17
18 // Ensure that the defaults are correct.
19 EXPECT_EQ(1, animation->iterations());
20 EXPECT_EQ(0, animation->startTime());
21 EXPECT_EQ(0, animation->timeOffset());
22 EXPECT_EQ(WebCompositorAnimation::DirectionNormal, animation->direction());
23 }
24
25 TEST(WebCompositorAnimationTest, ModifiedSettings)
26 {
27 scoped_ptr<WebFloatAnimationCurve> curve(new WebFloatAnimationCurve());
28 scoped_ptr<WebCompositorAnimation> animation(new WebCompositorAnimation(
29 *curve, WebCompositorAnimation::TargetPropertyOpacity, 1, 0));
30 animation->setIterations(2);
31 animation->setStartTime(2);
32 animation->setTimeOffset(2);
33 animation->setDirection(WebCompositorAnimation::DirectionReverse);
34
35 EXPECT_EQ(2, animation->iterations());
36 EXPECT_EQ(2, animation->startTime());
37 EXPECT_EQ(2, animation->timeOffset());
38 EXPECT_EQ(WebCompositorAnimation::DirectionReverse, animation->direction());
39 }
40
41 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698