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

Unified Diff: cc/animation/layer_animation_controller_unittest.cc

Issue 693883004: Make cc::animation::TrimTimeToCurrentIteration,cc::AnimationCurve::Duration use TimeTicks/TimeDelta (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/animation/layer_animation_controller.cc ('k') | cc/animation/scroll_offset_animation_curve.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/animation/layer_animation_controller_unittest.cc
diff --git a/cc/animation/layer_animation_controller_unittest.cc b/cc/animation/layer_animation_controller_unittest.cc
index 49ac0a5faef725289bcdfe3d68486de83daacaec..4fa3d848f3d20d35ef09a41ccfa3b5579a170b77 100644
--- a/cc/animation/layer_animation_controller_unittest.cc
+++ b/cc/animation/layer_animation_controller_unittest.cc
@@ -673,14 +673,11 @@ TEST(LayerAnimationControllerTest, ScrollOffsetTransition) {
controller->PushAnimationUpdatesTo(controller_impl.get());
controller_impl->ActivateAnimations();
EXPECT_TRUE(controller_impl->GetAnimation(Animation::ScrollOffset));
- double duration_in_seconds =
- controller_impl->GetAnimation(Animation::ScrollOffset)
- ->curve()
- ->Duration();
- TimeDelta duration = TimeDelta::FromMicroseconds(
- duration_in_seconds * base::Time::kMicrosecondsPerSecond);
+ TimeDelta duration = controller_impl->GetAnimation(Animation::ScrollOffset)
+ ->curve()
+ ->Duration();
EXPECT_EQ(
- duration_in_seconds,
+ duration,
controller->GetAnimation(Animation::ScrollOffset)->curve()->Duration());
controller->Animate(kInitialTickTime);
@@ -755,12 +752,11 @@ TEST(LayerAnimationControllerTest, ScrollOffsetTransitionNoImplProvider) {
controller->PushAnimationUpdatesTo(controller_impl.get());
controller_impl->ActivateAnimations();
EXPECT_TRUE(controller_impl->GetAnimation(Animation::ScrollOffset));
- double duration_in_seconds =
- controller_impl->GetAnimation(Animation::ScrollOffset)
- ->curve()
- ->Duration();
+ TimeDelta duration = controller_impl->GetAnimation(Animation::ScrollOffset)
+ ->curve()
+ ->Duration();
EXPECT_EQ(
- duration_in_seconds,
+ duration,
controller->GetAnimation(Animation::ScrollOffset)->curve()->Duration());
controller->Animate(kInitialTickTime);
@@ -776,8 +772,6 @@ TEST(LayerAnimationControllerTest, ScrollOffsetTransitionNoImplProvider) {
const AnimationEvent* event = GetMostRecentPropertyUpdateEvent(events.get());
EXPECT_FALSE(event);
- TimeDelta duration = TimeDelta::FromMicroseconds(
- duration_in_seconds * base::Time::kMicrosecondsPerSecond);
controller->NotifyAnimationStarted((*events)[0]);
controller->Animate(kInitialTickTime + duration / 2);
@@ -820,7 +814,7 @@ TEST(LayerAnimationControllerTest, ScrollOffsetTransitionOnImplOnly) {
target_value,
EaseInOutTimingFunction::Create().Pass()));
curve->SetInitialValue(initial_value);
- double duration_in_seconds = curve->Duration();
+ double duration_in_seconds = curve->Duration().InSecondsF();
scoped_ptr<Animation> animation(
Animation::Create(curve.Pass(), 1, 0, Animation::ScrollOffset));
« no previous file with comments | « cc/animation/layer_animation_controller.cc ('k') | cc/animation/scroll_offset_animation_curve.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698