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

Side by Side Diff: ui/gfx/animation/cubic_bezier_unittest.cc

Issue 140253013: Define accelerated steps time function. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: updated patch: remove question about velocity Created 6 years, 3 months 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
« no previous file with comments | « ui/gfx/animation/cubic_bezier.cc ('k') | ui/gfx/animation/steps.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "ui/gfx/geometry/cubic_bezier.h" 5 #include "ui/gfx/animation/cubic_bezier.h"
6 6
7 #include "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "testing/gtest/include/gtest/gtest.h" 8 #include "testing/gtest/include/gtest/gtest.h"
9 9
10 namespace gfx { 10 namespace gfx {
11 namespace { 11 namespace {
12 12
13 TEST(CubicBezierTest, Basic) { 13 TEST(CubicBezierTest, Basic) {
14 CubicBezier function(0.25, 0.0, 0.75, 1.0); 14 CubicBezier function(0.25, 0.0, 0.75, 1.0);
15 15
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 EXPECT_NEAR(function.Slope(0.75), 1.13576, epsilon); 159 EXPECT_NEAR(function.Slope(0.75), 1.13576, epsilon);
160 EXPECT_NEAR(function.Slope(0.8), 1.03184, epsilon); 160 EXPECT_NEAR(function.Slope(0.8), 1.03184, epsilon);
161 EXPECT_NEAR(function.Slope(0.85), 0.89121, epsilon); 161 EXPECT_NEAR(function.Slope(0.85), 0.89121, epsilon);
162 EXPECT_NEAR(function.Slope(0.9), 0.69778, epsilon); 162 EXPECT_NEAR(function.Slope(0.9), 0.69778, epsilon);
163 EXPECT_NEAR(function.Slope(0.95), 0.42170, epsilon); 163 EXPECT_NEAR(function.Slope(0.95), 0.42170, epsilon);
164 EXPECT_NEAR(function.Slope(1), 0, epsilon); 164 EXPECT_NEAR(function.Slope(1), 0, epsilon);
165 } 165 }
166 166
167 } // namespace 167 } // namespace
168 } // namespace gfx 168 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/gfx/animation/cubic_bezier.cc ('k') | ui/gfx/animation/steps.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698