OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 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/CompositorAnimation.h" |
| 6 |
| 7 #include "platform/animation/CompositorFloatAnimationCurve.h" |
| 8 #include "testing/gtest/include/gtest/gtest.h" |
| 9 |
| 10 namespace blink { |
| 11 |
| 12 TEST(WebCompositorAnimationTest, DefaultSettings) |
| 13 { |
| 14 scoped_ptr<CompositorAnimationCurve> curve(new CompositorFloatAnimationCurve
()); |
| 15 scoped_ptr<CompositorAnimation> animation(new CompositorAnimation( |
| 16 *curve, CompositorAnimation::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(CompositorAnimation::DirectionNormal, animation->direction()); |
| 23 } |
| 24 |
| 25 TEST(WebCompositorAnimationTest, ModifiedSettings) |
| 26 { |
| 27 scoped_ptr<CompositorFloatAnimationCurve> curve(new CompositorFloatAnimation
Curve()); |
| 28 scoped_ptr<CompositorAnimation> animation(new CompositorAnimation( |
| 29 *curve, CompositorAnimation::TargetPropertyOpacity, 1, 0)); |
| 30 animation->setIterations(2); |
| 31 animation->setStartTime(2); |
| 32 animation->setTimeOffset(2); |
| 33 animation->setDirection(CompositorAnimation::DirectionReverse); |
| 34 |
| 35 EXPECT_EQ(2, animation->iterations()); |
| 36 EXPECT_EQ(2, animation->startTime()); |
| 37 EXPECT_EQ(2, animation->timeOffset()); |
| 38 EXPECT_EQ(CompositorAnimation::DirectionReverse, animation->direction()); |
| 39 } |
| 40 |
| 41 } // namespace blink |
OLD | NEW |