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

Side by Side Diff: cc/blink/web_float_animation_curve_unittest.cc

Issue 470983004: Move blink<->cc bindings to cc/blink (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « cc/blink/web_float_animation_curve_impl.cc ('k') | cc/blink/web_image_layer_impl.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 "base/memory/scoped_ptr.h" 5 #include "base/memory/scoped_ptr.h"
6 #include "cc/animation/timing_function.h" 6 #include "cc/animation/timing_function.h"
7 #include "content/renderer/compositor_bindings/web_float_animation_curve_impl.h" 7 #include "cc/blink/web_float_animation_curve_impl.h"
8 #include "testing/gtest/include/gtest/gtest.h" 8 #include "testing/gtest/include/gtest/gtest.h"
9 9
10 using blink::WebCompositorAnimationCurve; 10 using blink::WebCompositorAnimationCurve;
11 using blink::WebFloatAnimationCurve; 11 using blink::WebFloatAnimationCurve;
12 using blink::WebFloatKeyframe; 12 using blink::WebFloatKeyframe;
13 13
14 namespace content { 14 namespace cc_blink {
15 namespace { 15 namespace {
16 16
17 // Tests that a float animation with one keyframe works as expected. 17 // Tests that a float animation with one keyframe works as expected.
18 TEST(WebFloatAnimationCurveTest, OneFloatKeyframe) { 18 TEST(WebFloatAnimationCurveTest, OneFloatKeyframe) {
19 scoped_ptr<WebFloatAnimationCurve> curve(new WebFloatAnimationCurveImpl); 19 scoped_ptr<WebFloatAnimationCurve> curve(new WebFloatAnimationCurveImpl);
20 curve->add(WebFloatKeyframe(0, 2), 20 curve->add(WebFloatKeyframe(0, 2),
21 WebCompositorAnimationCurve::TimingFunctionTypeLinear); 21 WebCompositorAnimationCurve::TimingFunctionTypeLinear);
22 EXPECT_FLOAT_EQ(2, curve->getValue(-1)); 22 EXPECT_FLOAT_EQ(2, curve->getValue(-1));
23 EXPECT_FLOAT_EQ(2, curve->getValue(0)); 23 EXPECT_FLOAT_EQ(2, curve->getValue(0));
24 EXPECT_FLOAT_EQ(2, curve->getValue(0.5)); 24 EXPECT_FLOAT_EQ(2, curve->getValue(0.5));
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 224
225 scoped_ptr<cc::TimingFunction> timing_function( 225 scoped_ptr<cc::TimingFunction> timing_function(
226 cc::EaseTimingFunction::Create()); 226 cc::EaseTimingFunction::Create());
227 for (int i = 0; i <= 4; ++i) { 227 for (int i = 0; i <= 4; ++i) {
228 const double time = i * 0.25; 228 const double time = i * 0.25;
229 EXPECT_FLOAT_EQ(timing_function->GetValue(time), curve->getValue(time)); 229 EXPECT_FLOAT_EQ(timing_function->GetValue(time), curve->getValue(time));
230 } 230 }
231 } 231 }
232 232
233 } // namespace 233 } // namespace
234 } // namespace content 234 } // namespace cc_blink
235
OLDNEW
« no previous file with comments | « cc/blink/web_float_animation_curve_impl.cc ('k') | cc/blink/web_image_layer_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698