Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(114)

Side by Side Diff: cc/timing_function_unittest.cc

Issue 11411024: cc: Switch time_source.h and timing_function* to Chrome coding style. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« cc/timing_function.cc ('K') | « cc/timing_function.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "cc/timing_function.h" 5 #include "cc/timing_function.h"
6
6 #include "testing/gtest/include/gtest/gtest.h" 7 #include "testing/gtest/include/gtest/gtest.h"
7 8
8 namespace cc { 9 namespace cc {
9 namespace { 10 namespace {
10 11
11 TEST(TimingFunctionTest, CubicBezierTimingFunction) { 12 TEST(TimingFunctionTest, CubicBezierTimingFunction) {
12 scoped_ptr<CubicBezierTimingFunction> function = CubicBezierTimingFunction::cr eate(0.25, 0, 0.75, 1); 13 scoped_ptr<CubicBezierTimingFunction> function =
14 CubicBezierTimingFunction::create(0.25, 0, 0.75, 1);
13 15
14 double epsilon = 0.00015; 16 double epsilon = 0.00015;
15 17
16 EXPECT_NEAR(function->getValue(0), 0, epsilon); 18 EXPECT_NEAR(function->getValue(0), 0, epsilon);
17 EXPECT_NEAR(function->getValue(0.05), 0.01136, epsilon); 19 EXPECT_NEAR(function->getValue(0.05), 0.01136, epsilon);
18 EXPECT_NEAR(function->getValue(0.1), 0.03978, epsilon); 20 EXPECT_NEAR(function->getValue(0.1), 0.03978, epsilon);
19 EXPECT_NEAR(function->getValue(0.15), 0.079780, epsilon); 21 EXPECT_NEAR(function->getValue(0.15), 0.079780, epsilon);
20 EXPECT_NEAR(function->getValue(0.2), 0.12803, epsilon); 22 EXPECT_NEAR(function->getValue(0.2), 0.12803, epsilon);
21 EXPECT_NEAR(function->getValue(0.25), 0.18235, epsilon); 23 EXPECT_NEAR(function->getValue(0.25), 0.18235, epsilon);
22 EXPECT_NEAR(function->getValue(0.3), 0.24115, epsilon); 24 EXPECT_NEAR(function->getValue(0.3), 0.24115, epsilon);
23 EXPECT_NEAR(function->getValue(0.35), 0.30323, epsilon); 25 EXPECT_NEAR(function->getValue(0.35), 0.30323, epsilon);
24 EXPECT_NEAR(function->getValue(0.4), 0.36761, epsilon); 26 EXPECT_NEAR(function->getValue(0.4), 0.36761, epsilon);
25 EXPECT_NEAR(function->getValue(0.45), 0.43345, epsilon); 27 EXPECT_NEAR(function->getValue(0.45), 0.43345, epsilon);
26 EXPECT_NEAR(function->getValue(0.5), 0.5, epsilon); 28 EXPECT_NEAR(function->getValue(0.5), 0.5, epsilon);
27 EXPECT_NEAR(function->getValue(0.6), 0.63238, epsilon); 29 EXPECT_NEAR(function->getValue(0.6), 0.63238, epsilon);
28 EXPECT_NEAR(function->getValue(0.65), 0.69676, epsilon); 30 EXPECT_NEAR(function->getValue(0.65), 0.69676, epsilon);
29 EXPECT_NEAR(function->getValue(0.7), 0.75884, epsilon); 31 EXPECT_NEAR(function->getValue(0.7), 0.75884, epsilon);
30 EXPECT_NEAR(function->getValue(0.75), 0.81764, epsilon); 32 EXPECT_NEAR(function->getValue(0.75), 0.81764, epsilon);
31 EXPECT_NEAR(function->getValue(0.8), 0.87196, epsilon); 33 EXPECT_NEAR(function->getValue(0.8), 0.87196, epsilon);
32 EXPECT_NEAR(function->getValue(0.85), 0.92021, epsilon); 34 EXPECT_NEAR(function->getValue(0.85), 0.92021, epsilon);
33 EXPECT_NEAR(function->getValue(0.9), 0.96021, epsilon); 35 EXPECT_NEAR(function->getValue(0.9), 0.96021, epsilon);
34 EXPECT_NEAR(function->getValue(0.95), 0.98863, epsilon); 36 EXPECT_NEAR(function->getValue(0.95), 0.98863, epsilon);
35 EXPECT_NEAR(function->getValue(1), 1, epsilon); 37 EXPECT_NEAR(function->getValue(1), 1, epsilon);
36 } 38 }
37 39
38 } // namespace 40 } // namespace
39 } // namespace cc 41 } // namespace cc
OLDNEW
« cc/timing_function.cc ('K') | « cc/timing_function.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698