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 "core/animation/InterpolableValue.h" | 5 #include "core/animation/InterpolableValue.h" |
6 | 6 |
| 7 #include <memory> |
7 #include "core/animation/LegacyStyleInterpolation.h" | 8 #include "core/animation/LegacyStyleInterpolation.h" |
8 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
9 #include <memory> | |
10 | 10 |
11 namespace blink { | 11 namespace blink { |
12 | 12 |
13 namespace { | 13 namespace { |
14 | 14 |
15 class SampleInterpolation : public LegacyStyleInterpolation { | 15 class SampleInterpolation : public LegacyStyleInterpolation { |
16 public: | 16 public: |
17 static PassRefPtr<LegacyStyleInterpolation> create( | 17 static PassRefPtr<LegacyStyleInterpolation> create( |
18 std::unique_ptr<InterpolableValue> start, | 18 std::unique_ptr<InterpolableValue> start, |
19 std::unique_ptr<InterpolableValue> end) { | 19 std::unique_ptr<InterpolableValue> end) { |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 addList->set(0, InterpolableNumber::create(1)); | 137 addList->set(0, InterpolableNumber::create(1)); |
138 addList->set(1, InterpolableNumber::create(2)); | 138 addList->set(1, InterpolableNumber::create(2)); |
139 addList->set(2, InterpolableNumber::create(3)); | 139 addList->set(2, InterpolableNumber::create(3)); |
140 scaleAndAdd(*baseList, 2, *addList); | 140 scaleAndAdd(*baseList, 2, *addList); |
141 EXPECT_FLOAT_EQ(11, toInterpolableNumber(baseList->get(0))->value()); | 141 EXPECT_FLOAT_EQ(11, toInterpolableNumber(baseList->get(0))->value()); |
142 EXPECT_FLOAT_EQ(22, toInterpolableNumber(baseList->get(1))->value()); | 142 EXPECT_FLOAT_EQ(22, toInterpolableNumber(baseList->get(1))->value()); |
143 EXPECT_FLOAT_EQ(33, toInterpolableNumber(baseList->get(2))->value()); | 143 EXPECT_FLOAT_EQ(33, toInterpolableNumber(baseList->get(2))->value()); |
144 } | 144 } |
145 | 145 |
146 } // namespace blink | 146 } // namespace blink |
OLD | NEW |