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 "CCKeyframedAnimationCurve.h" | 7 #include "CCKeyframedAnimationCurve.h" |
8 | 8 |
9 #include <gmock/gmock.h> | 9 #include <gmock/gmock.h> |
10 #include <gtest/gtest.h> | 10 #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 #include <wtf/OwnPtr.h> | 13 #include <wtf/OwnPtr.h> |
14 #include <wtf/Vector.h> | 14 #include <wtf/Vector.h> |
15 | 15 |
16 using namespace WebCore; | 16 using namespace cc; |
17 using WebKit::WebTransformationMatrix; | 17 using WebKit::WebTransformationMatrix; |
18 | 18 |
19 namespace { | 19 namespace { |
20 | 20 |
21 void expectTranslateX(double translateX, const WebTransformationMatrix& matrix) | 21 void expectTranslateX(double translateX, const WebTransformationMatrix& matrix) |
22 { | 22 { |
23 EXPECT_FLOAT_EQ(translateX, matrix.m41()); | 23 EXPECT_FLOAT_EQ(translateX, matrix.m41()); |
24 } | 24 } |
25 | 25 |
26 // Tests that a float animation with one keyframe works as expected. | 26 // Tests that a float animation with one keyframe works as expected. |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 EXPECT_FLOAT_EQ(0, curve->getValue(0)); | 199 EXPECT_FLOAT_EQ(0, curve->getValue(0)); |
200 EXPECT_LT(0, curve->getValue(0.25)); | 200 EXPECT_LT(0, curve->getValue(0.25)); |
201 EXPECT_GT(0.25, curve->getValue(0.25)); | 201 EXPECT_GT(0.25, curve->getValue(0.25)); |
202 EXPECT_FLOAT_EQ(0.5, curve->getValue(0.5)); | 202 EXPECT_FLOAT_EQ(0.5, curve->getValue(0.5)); |
203 EXPECT_LT(0.75, curve->getValue(0.75)); | 203 EXPECT_LT(0.75, curve->getValue(0.75)); |
204 EXPECT_GT(1, curve->getValue(0.75)); | 204 EXPECT_GT(1, curve->getValue(0.75)); |
205 EXPECT_FLOAT_EQ(1, curve->getValue(1)); | 205 EXPECT_FLOAT_EQ(1, curve->getValue(1)); |
206 } | 206 } |
207 | 207 |
208 } // namespace | 208 } // namespace |
OLD | NEW |