OLD | NEW |
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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" | |
6 | |
7 #include "cc/timing_function.h" | 5 #include "cc/timing_function.h" |
8 #include "testing/gtest/include/gtest/gtest.h" | 6 #include "testing/gtest/include/gtest/gtest.h" |
9 | 7 |
10 using namespace cc; | 8 using namespace cc; |
11 | 9 |
12 namespace { | 10 namespace { |
13 | 11 |
14 TEST(TimingFunctionTest, CubicBezierTimingFunction) { | 12 TEST(TimingFunctionTest, CubicBezierTimingFunction) { |
15 scoped_ptr<CubicBezierTimingFunction> function = CubicBezierTimingFunction::cr
eate(0.25, 0, 0.75, 1); | 13 scoped_ptr<CubicBezierTimingFunction> function = CubicBezierTimingFunction::cr
eate(0.25, 0, 0.75, 1); |
16 | 14 |
(...skipping 15 matching lines...) Expand all Loading... |
32 EXPECT_NEAR(function->getValue(0.7), 0.75884, epsilon); | 30 EXPECT_NEAR(function->getValue(0.7), 0.75884, epsilon); |
33 EXPECT_NEAR(function->getValue(0.75), 0.81764, epsilon); | 31 EXPECT_NEAR(function->getValue(0.75), 0.81764, epsilon); |
34 EXPECT_NEAR(function->getValue(0.8), 0.87196, epsilon); | 32 EXPECT_NEAR(function->getValue(0.8), 0.87196, epsilon); |
35 EXPECT_NEAR(function->getValue(0.85), 0.92021, epsilon); | 33 EXPECT_NEAR(function->getValue(0.85), 0.92021, epsilon); |
36 EXPECT_NEAR(function->getValue(0.9), 0.96021, epsilon); | 34 EXPECT_NEAR(function->getValue(0.9), 0.96021, epsilon); |
37 EXPECT_NEAR(function->getValue(0.95), 0.98863, epsilon); | 35 EXPECT_NEAR(function->getValue(0.95), 0.98863, epsilon); |
38 EXPECT_NEAR(function->getValue(1), 1, epsilon); | 36 EXPECT_NEAR(function->getValue(1), 1, epsilon); |
39 } | 37 } |
40 | 38 |
41 } // anonymous namespace | 39 } // anonymous namespace |
OLD | NEW |