OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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 | 6 |
7 #include "cc/keyframed_animation_curve.h" | 7 #include "cc/keyframed_animation_curve.h" |
8 | 8 |
9 #include "testing/gmock/include/gmock/gmock.h" | 9 #include "testing/gmock/include/gmock/gmock.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
11 #include <public/WebTransformOperations.h> | 11 #include <public/WebTransformOperations.h> |
12 #include <public/WebTransformationMatrix.h> | 12 #include <public/WebTransformationMatrix.h> |
13 | 13 |
14 using namespace cc; | |
15 using WebKit::WebTransformationMatrix; | 14 using WebKit::WebTransformationMatrix; |
16 | 15 |
| 16 namespace cc { |
17 namespace { | 17 namespace { |
18 | 18 |
19 void expectTranslateX(double translateX, const WebTransformationMatrix& matrix) | 19 void expectTranslateX(double translateX, const WebTransformationMatrix& matrix) |
20 { | 20 { |
21 EXPECT_FLOAT_EQ(translateX, matrix.m41()); | 21 EXPECT_FLOAT_EQ(translateX, matrix.m41()); |
22 } | 22 } |
23 | 23 |
24 // Tests that a float animation with one keyframe works as expected. | 24 // Tests that a float animation with one keyframe works as expected. |
25 TEST(KeyframedAnimationCurveTest, OneFloatKeyframe) | 25 TEST(KeyframedAnimationCurveTest, OneFloatKeyframe) |
26 { | 26 { |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 | 196 |
197 EXPECT_FLOAT_EQ(0, curve->getValue(0)); | 197 EXPECT_FLOAT_EQ(0, curve->getValue(0)); |
198 EXPECT_LT(0, curve->getValue(0.25)); | 198 EXPECT_LT(0, curve->getValue(0.25)); |
199 EXPECT_GT(0.25, curve->getValue(0.25)); | 199 EXPECT_GT(0.25, curve->getValue(0.25)); |
200 EXPECT_NEAR(curve->getValue(0.5), 0.5, 0.00015); | 200 EXPECT_NEAR(curve->getValue(0.5), 0.5, 0.00015); |
201 EXPECT_LT(0.75, curve->getValue(0.75)); | 201 EXPECT_LT(0.75, curve->getValue(0.75)); |
202 EXPECT_GT(1, curve->getValue(0.75)); | 202 EXPECT_GT(1, curve->getValue(0.75)); |
203 EXPECT_FLOAT_EQ(1, curve->getValue(1)); | 203 EXPECT_FLOAT_EQ(1, curve->getValue(1)); |
204 } | 204 } |
205 | 205 |
206 } // anonymous namespace | 206 } // namespace |
| 207 } // namespace cc |
OLD | NEW |