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

Unified Diff: ui/compositor/layer_animator_unittest.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
« no previous file with comments | « ui/compositor/layer_animator.cc ('k') | ui/compositor/test/layer_animator_test_controller.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/compositor/layer_animator_unittest.cc
diff --git a/ui/compositor/layer_animator_unittest.cc b/ui/compositor/layer_animator_unittest.cc
index 03800fdc2745ad074052c1321b04fa8b097545c2..66efca72ccf4bbc7845aa94097d0fbf072693c12 100644
--- a/ui/compositor/layer_animator_unittest.cc
+++ b/ui/compositor/layer_animator_unittest.cc
@@ -349,10 +349,10 @@ TEST(LayerAnimatorTest, ScheduleThreadedAnimationThatCanRunImmediately) {
test_controller.animator()->OnThreadedAnimationStarted(cc::AnimationEvent(
cc::AnimationEvent::Started,
0,
- test_controller.GetRunningSequence(LayerAnimationElement::OPACITY)->
- animation_group_id(),
+ test_controller.GetRunningSequence(LayerAnimationElement::OPACITY)
+ ->animation_group_id(),
cc::Animation::Opacity,
- (effective_start - base::TimeTicks()).InSecondsF()));
+ effective_start));
element->Step(effective_start + delta/2);
@@ -465,10 +465,10 @@ TEST(LayerAnimatorTest, ScheduleThreadedAndNonThreadedAnimations) {
test_controller.animator()->OnThreadedAnimationStarted(cc::AnimationEvent(
cc::AnimationEvent::Started,
0,
- test_controller.GetRunningSequence(LayerAnimationElement::OPACITY)->
- animation_group_id(),
+ test_controller.GetRunningSequence(LayerAnimationElement::OPACITY)
+ ->animation_group_id(),
cc::Animation::Opacity,
- (effective_start - base::TimeTicks()).InSecondsF()));
+ effective_start));
element->Step(effective_start + delta/2);
@@ -743,10 +743,10 @@ TEST(LayerAnimatorTest, StartThreadedAnimationThatCanRunImmediately) {
test_controller.animator()->OnThreadedAnimationStarted(cc::AnimationEvent(
cc::AnimationEvent::Started,
0,
- test_controller.GetRunningSequence(LayerAnimationElement::OPACITY)->
- animation_group_id(),
+ test_controller.GetRunningSequence(LayerAnimationElement::OPACITY)
+ ->animation_group_id(),
cc::Animation::Opacity,
- (effective_start - base::TimeTicks()).InSecondsF()));
+ effective_start));
element->Step(effective_start + delta/2);
@@ -876,10 +876,10 @@ TEST(LayerAnimatorTest, PreemptThreadedByImmediatelyAnimatingToNewTarget) {
test_controller.animator()->OnThreadedAnimationStarted(cc::AnimationEvent(
cc::AnimationEvent::Started,
0,
- test_controller.GetRunningSequence(LayerAnimationElement::OPACITY)->
- animation_group_id(),
+ test_controller.GetRunningSequence(LayerAnimationElement::OPACITY)
+ ->animation_group_id(),
cc::Animation::Opacity,
- (effective_start - base::TimeTicks()).InSecondsF()));
+ effective_start));
element->Step(effective_start + delta/2);
@@ -901,10 +901,10 @@ TEST(LayerAnimatorTest, PreemptThreadedByImmediatelyAnimatingToNewTarget) {
test_controller.animator()->OnThreadedAnimationStarted(cc::AnimationEvent(
cc::AnimationEvent::Started,
0,
- test_controller.GetRunningSequence(LayerAnimationElement::OPACITY)->
- animation_group_id(),
+ test_controller.GetRunningSequence(LayerAnimationElement::OPACITY)
+ ->animation_group_id(),
cc::Animation::Opacity,
- (second_effective_start - base::TimeTicks()).InSecondsF()));
+ second_effective_start));
element->Step(second_effective_start + delta/2);
@@ -1218,10 +1218,10 @@ TEST(LayerAnimatorTest, MultiPreemptThreadedByImmediatelyAnimatingToNewTarget) {
test_controller.animator()->OnThreadedAnimationStarted(cc::AnimationEvent(
cc::AnimationEvent::Started,
0,
- test_controller.GetRunningSequence(LayerAnimationElement::OPACITY)->
- animation_group_id(),
+ test_controller.GetRunningSequence(LayerAnimationElement::OPACITY)
+ ->animation_group_id(),
cc::Animation::Opacity,
- (effective_start - base::TimeTicks()).InSecondsF()));
+ effective_start));
element->Step(effective_start + delta/2);
@@ -1248,10 +1248,10 @@ TEST(LayerAnimatorTest, MultiPreemptThreadedByImmediatelyAnimatingToNewTarget) {
test_controller.animator()->OnThreadedAnimationStarted(cc::AnimationEvent(
cc::AnimationEvent::Started,
0,
- test_controller.GetRunningSequence(LayerAnimationElement::OPACITY)->
- animation_group_id(),
+ test_controller.GetRunningSequence(LayerAnimationElement::OPACITY)
+ ->animation_group_id(),
cc::Animation::Opacity,
- (second_effective_start - base::TimeTicks()).InSecondsF()));
+ second_effective_start));
element->Step(second_effective_start + delta/2);
@@ -1505,10 +1505,10 @@ TEST(LayerAnimatorTest, ThreadedCyclicSequences) {
test_controller.animator()->OnThreadedAnimationStarted(cc::AnimationEvent(
cc::AnimationEvent::Started,
0,
- test_controller.GetRunningSequence(LayerAnimationElement::OPACITY)->
- animation_group_id(),
+ test_controller.GetRunningSequence(LayerAnimationElement::OPACITY)
+ ->animation_group_id(),
cc::Animation::Opacity,
- (effective_start - base::TimeTicks()).InSecondsF()));
+ effective_start));
element->Step(effective_start + delta);
EXPECT_TRUE(test_controller.animator()->is_animating());
@@ -1518,10 +1518,10 @@ TEST(LayerAnimatorTest, ThreadedCyclicSequences) {
test_controller.animator()->OnThreadedAnimationStarted(cc::AnimationEvent(
cc::AnimationEvent::Started,
0,
- test_controller.GetRunningSequence(LayerAnimationElement::OPACITY)->
- animation_group_id(),
+ test_controller.GetRunningSequence(LayerAnimationElement::OPACITY)
+ ->animation_group_id(),
cc::Animation::Opacity,
- (second_effective_start - base::TimeTicks()).InSecondsF()));
+ second_effective_start));
element->Step(second_effective_start + delta);
@@ -1532,10 +1532,10 @@ TEST(LayerAnimatorTest, ThreadedCyclicSequences) {
test_controller.animator()->OnThreadedAnimationStarted(cc::AnimationEvent(
cc::AnimationEvent::Started,
0,
- test_controller.GetRunningSequence(LayerAnimationElement::OPACITY)->
- animation_group_id(),
+ test_controller.GetRunningSequence(LayerAnimationElement::OPACITY)
+ ->animation_group_id(),
cc::Animation::Opacity,
- (third_effective_start - base::TimeTicks()).InSecondsF()));
+ third_effective_start));
element->Step(third_effective_start + delta);
EXPECT_TRUE(test_controller.animator()->is_animating());
@@ -1545,10 +1545,10 @@ TEST(LayerAnimatorTest, ThreadedCyclicSequences) {
test_controller.animator()->OnThreadedAnimationStarted(cc::AnimationEvent(
cc::AnimationEvent::Started,
0,
- test_controller.GetRunningSequence(LayerAnimationElement::OPACITY)->
- animation_group_id(),
+ test_controller.GetRunningSequence(LayerAnimationElement::OPACITY)
+ ->animation_group_id(),
cc::Animation::Opacity,
- (fourth_effective_start - base::TimeTicks()).InSecondsF()));
+ fourth_effective_start));
// Skip ahead by a lot.
element->Step(fourth_effective_start + 1000 * delta);
@@ -1560,10 +1560,10 @@ TEST(LayerAnimatorTest, ThreadedCyclicSequences) {
test_controller.animator()->OnThreadedAnimationStarted(cc::AnimationEvent(
cc::AnimationEvent::Started,
0,
- test_controller.GetRunningSequence(LayerAnimationElement::OPACITY)->
- animation_group_id(),
+ test_controller.GetRunningSequence(LayerAnimationElement::OPACITY)
+ ->animation_group_id(),
cc::Animation::Opacity,
- (fifth_effective_start - base::TimeTicks()).InSecondsF()));
+ fifth_effective_start));
// Skip ahead by a lot.
element->Step(fifth_effective_start + 999 * delta);
« no previous file with comments | « ui/compositor/layer_animator.cc ('k') | ui/compositor/test/layer_animator_test_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698