| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "config.h" | 5 #include "config.h" |
| 6 #include "core/animation/animatable/AnimatableDoubleAndBool.h" | 6 #include "core/animation/animatable/AnimatableDoubleAndBool.h" |
| 7 | 7 |
| 8 #include <gtest/gtest.h> | 8 #include <gtest/gtest.h> |
| 9 | 9 |
| 10 using namespace blink; | 10 namespace blink { |
| 11 | |
| 12 namespace { | |
| 13 | 11 |
| 14 TEST(AnimationAnimatableDoubleAndBoolTest, Create) | 12 TEST(AnimationAnimatableDoubleAndBoolTest, Create) |
| 15 { | 13 { |
| 16 EXPECT_TRUE(static_cast<bool>(AnimatableDoubleAndBool::create(30, false).get
())); | 14 EXPECT_TRUE(static_cast<bool>(AnimatableDoubleAndBool::create(30, false).get
())); |
| 17 EXPECT_TRUE(static_cast<bool>(AnimatableDoubleAndBool::create(270, true).get
())); | 15 EXPECT_TRUE(static_cast<bool>(AnimatableDoubleAndBool::create(270, true).get
())); |
| 18 } | 16 } |
| 19 | 17 |
| 20 TEST(AnimationAnimatableDoubleAndBoolTest, Equal) | 18 TEST(AnimationAnimatableDoubleAndBoolTest, Equal) |
| 21 { | 19 { |
| 22 EXPECT_TRUE(AnimatableDoubleAndBool::create(30, false)->equals(AnimatableDou
bleAndBool::create(30, false).get())); | 20 EXPECT_TRUE(AnimatableDoubleAndBool::create(30, false)->equals(AnimatableDou
bleAndBool::create(30, false).get())); |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 EXPECT_EQ(10, toAnimatableDoubleAndBool(AnimatableValue::interpolate(from10.
get(), to20.get(), 0.4).get())->toDouble()); | 76 EXPECT_EQ(10, toAnimatableDoubleAndBool(AnimatableValue::interpolate(from10.
get(), to20.get(), 0.4).get())->toDouble()); |
| 79 EXPECT_TRUE(toAnimatableDoubleAndBool(AnimatableValue::interpolate(from10.ge
t(), to20.get(), 0.4).get())->flag()); | 77 EXPECT_TRUE(toAnimatableDoubleAndBool(AnimatableValue::interpolate(from10.ge
t(), to20.get(), 0.4).get())->flag()); |
| 80 | 78 |
| 81 EXPECT_FALSE(toAnimatableDoubleAndBool(AnimatableValue::interpolate(from10.g
et(), to20.get(), 0.6).get())->flag()); | 79 EXPECT_FALSE(toAnimatableDoubleAndBool(AnimatableValue::interpolate(from10.g
et(), to20.get(), 0.6).get())->flag()); |
| 82 EXPECT_EQ(20, toAnimatableDoubleAndBool(AnimatableValue::interpolate(from10.
get(), to20.get(), 0.6).get())->toDouble()); | 80 EXPECT_EQ(20, toAnimatableDoubleAndBool(AnimatableValue::interpolate(from10.
get(), to20.get(), 0.6).get())->toDouble()); |
| 83 EXPECT_EQ(20, toAnimatableDoubleAndBool(AnimatableValue::interpolate(from10.
get(), to20.get(), 1).get())->toDouble()); | 81 EXPECT_EQ(20, toAnimatableDoubleAndBool(AnimatableValue::interpolate(from10.
get(), to20.get(), 1).get())->toDouble()); |
| 84 EXPECT_EQ(20, toAnimatableDoubleAndBool(AnimatableValue::interpolate(from10.
get(), to20.get(), 1.5).get())->toDouble()); | 82 EXPECT_EQ(20, toAnimatableDoubleAndBool(AnimatableValue::interpolate(from10.
get(), to20.get(), 1.5).get())->toDouble()); |
| 85 EXPECT_FALSE(toAnimatableDoubleAndBool(AnimatableValue::interpolate(from10.g
et(), to20.get(), 1.5).get())->flag()); | 83 EXPECT_FALSE(toAnimatableDoubleAndBool(AnimatableValue::interpolate(from10.g
et(), to20.get(), 1.5).get())->flag()); |
| 86 } | 84 } |
| 87 | 85 |
| 88 } | 86 } // namespace blink |
| OLD | NEW |