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

Side by Side Diff: cc/keyframed_animation_curve_unittest.cc

Issue 11359077: cc: Replace the WebCore::UnitBezier class with the SkUnitCubicInterp() method from Skia. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix web unittests 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
« no previous file with comments | « cc/cc_tests.gyp ('k') | cc/stubs/UnitBezier.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 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"
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 // Tests that a cubic bezier timing function works as expected. 190 // Tests that a cubic bezier timing function works as expected.
191 TEST(KeyframedAnimationCurveTest, CubicBezierTimingFunction) 191 TEST(KeyframedAnimationCurveTest, CubicBezierTimingFunction)
192 { 192 {
193 scoped_ptr<KeyframedFloatAnimationCurve> curve(KeyframedFloatAnimationCurve: :create()); 193 scoped_ptr<KeyframedFloatAnimationCurve> curve(KeyframedFloatAnimationCurve: :create());
194 curve->addKeyframe(FloatKeyframe::create(0, 0, CubicBezierTimingFunction::cr eate(0.25, 0, 0.75, 1).PassAs<TimingFunction>())); 194 curve->addKeyframe(FloatKeyframe::create(0, 0, CubicBezierTimingFunction::cr eate(0.25, 0, 0.75, 1).PassAs<TimingFunction>()));
195 curve->addKeyframe(FloatKeyframe::create(1, 1, scoped_ptr<TimingFunction>()) ); 195 curve->addKeyframe(FloatKeyframe::create(1, 1, scoped_ptr<TimingFunction>()) );
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_FLOAT_EQ(0.5, curve->getValue(0.5)); 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 } // anonymous namespace
OLDNEW
« no previous file with comments | « cc/cc_tests.gyp ('k') | cc/stubs/UnitBezier.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698