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

Side by Side Diff: cc/animation/animation_unittest.cc

Issue 1700653002: CC Animation: Expose TargetProperty enum to be aliased in Blink Platform. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 years, 10 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 | « cc/animation/animation_player_unittest.cc ('k') | cc/animation/element_animations.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 "cc/animation/animation.h" 5 #include "cc/animation/animation.h"
6 6
7 #include "cc/test/animation_test_common.h" 7 #include "cc/test/animation_test_common.h"
8 #include "testing/gmock/include/gmock/gmock.h" 8 #include "testing/gmock/include/gmock/gmock.h"
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 10
11 namespace cc { 11 namespace cc {
12 namespace { 12 namespace {
13 13
14 using base::TimeDelta; 14 using base::TimeDelta;
15 15
16 static base::TimeTicks TicksFromSecondsF(double seconds) { 16 static base::TimeTicks TicksFromSecondsF(double seconds) {
17 return base::TimeTicks::FromInternalValue(seconds * 17 return base::TimeTicks::FromInternalValue(seconds *
18 base::Time::kMicrosecondsPerSecond); 18 base::Time::kMicrosecondsPerSecond);
19 } 19 }
20 20
21 scoped_ptr<Animation> CreateAnimation(double iterations, 21 scoped_ptr<Animation> CreateAnimation(double iterations,
22 double duration, 22 double duration,
23 double playback_rate) { 23 double playback_rate) {
24 scoped_ptr<Animation> to_return( 24 scoped_ptr<Animation> to_return(
25 Animation::Create(make_scoped_ptr(new FakeFloatAnimationCurve(duration)), 25 Animation::Create(make_scoped_ptr(new FakeFloatAnimationCurve(duration)),
26 0, 1, Animation::OPACITY)); 26 0, 1, TargetProperty::OPACITY));
27 to_return->set_iterations(iterations); 27 to_return->set_iterations(iterations);
28 to_return->set_playback_rate(playback_rate); 28 to_return->set_playback_rate(playback_rate);
29 return to_return; 29 return to_return;
30 } 30 }
31 31
32 scoped_ptr<Animation> CreateAnimation(double iterations, double duration) { 32 scoped_ptr<Animation> CreateAnimation(double iterations, double duration) {
33 return CreateAnimation(iterations, duration, 1); 33 return CreateAnimation(iterations, duration, 1);
34 } 34 }
35 35
36 scoped_ptr<Animation> CreateAnimation(double iterations) { 36 scoped_ptr<Animation> CreateAnimation(double iterations) {
(...skipping 959 matching lines...) Expand 10 before | Expand all | Expand 10 after
996 EXPECT_TRUE(anim->InEffect(TicksFromSecondsF(1.0))); 996 EXPECT_TRUE(anim->InEffect(TicksFromSecondsF(1.0)));
997 997
998 anim->set_fill_mode(Animation::FILL_MODE_BOTH); 998 anim->set_fill_mode(Animation::FILL_MODE_BOTH);
999 EXPECT_TRUE(anim->InEffect(TicksFromSecondsF(-1.0))); 999 EXPECT_TRUE(anim->InEffect(TicksFromSecondsF(-1.0)));
1000 EXPECT_TRUE(anim->InEffect(TicksFromSecondsF(0.0))); 1000 EXPECT_TRUE(anim->InEffect(TicksFromSecondsF(0.0)));
1001 EXPECT_TRUE(anim->InEffect(TicksFromSecondsF(1.0))); 1001 EXPECT_TRUE(anim->InEffect(TicksFromSecondsF(1.0)));
1002 } 1002 }
1003 1003
1004 } // namespace 1004 } // namespace
1005 } // namespace cc 1005 } // namespace cc
OLDNEW
« no previous file with comments | « cc/animation/animation_player_unittest.cc ('k') | cc/animation/element_animations.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698