OLD | NEW |
(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 |
OLD | NEW |