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

Unified Diff: cc/trees/layer_tree_host_unittest_animation.cc

Issue 231133002: CC::Animations should use TimeTicks & TimeDelta to represent time (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Code changed as per review comments. Created 6 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: cc/trees/layer_tree_host_unittest_animation.cc
diff --git a/cc/trees/layer_tree_host_unittest_animation.cc b/cc/trees/layer_tree_host_unittest_animation.cc
index 70610f7e6f9ec032cfc7dc07ad54e33666e810ba..92a66ed75c881fc4a249460800536173de17b23f 100644
--- a/cc/trees/layer_tree_host_unittest_animation.cc
+++ b/cc/trees/layer_tree_host_unittest_animation.cc
@@ -568,7 +568,8 @@ class LayerTreeHostAnimationTestSynchronizeAnimationStartTimes
layer_animation_controller();
Animation* animation =
controller->GetAnimation(Animation::Opacity);
- main_start_time_ = animation->start_time();
+ main_start_time_ =
+ (animation->start_time() - base::TimeTicks()).InSecondsF();
controller->RemoveAnimation(animation->id());
if (impl_start_time_ > 0.0)
@@ -586,7 +587,8 @@ class LayerTreeHostAnimationTestSynchronizeAnimationStartTimes
if (!animation)
return;
- impl_start_time_ = animation->start_time();
+ impl_start_time_ =
+ (animation->start_time() - base::TimeTicks()).InSecondsF();
controller->RemoveAnimation(animation->id());
if (main_start_time_ > 0.0)
@@ -1368,10 +1370,10 @@ class LayerTreeHostAnimationTestAddAnimationAfterAnimating
int id = ((*iter).second->id());
if (id == host_impl->RootLayer()->id()) {
Animation* anim = (*iter).second->GetAnimation(Animation::Transform);
- EXPECT_GT(anim->start_time(), 0);
+ EXPECT_GT((anim->start_time() - base::TimeTicks()).InSecondsF(), 0);
} else if (id == host_impl->RootLayer()->children()[0]->id()) {
Animation* anim = (*iter).second->GetAnimation(Animation::Opacity);
- EXPECT_GT(anim->start_time(), 0);
+ EXPECT_GT((anim->start_time() - base::TimeTicks()).InSecondsF(), 0);
}
}
}

Powered by Google App Engine
This is Rietveld 408576698