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

Unified Diff: ui/gfx/animation/multi_animation_unittest.cc

Issue 26880010: gfx: Add FrameTime and DisplayTime classes (Closed) Base URL: http://git.chromium.org/chromium/src.git@checkHighResNow4
Patch Set: WIP Created 7 years, 2 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/gfx/animation/multi_animation.cc ('k') | ui/gfx/animation/slide_animation_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/animation/multi_animation_unittest.cc
diff --git a/ui/gfx/animation/multi_animation_unittest.cc b/ui/gfx/animation/multi_animation_unittest.cc
index b8a11fdacf2bfa2c5bb18d7f57f2f1a448ec7f8b..30da2ee8c0b489a5255a252d64c5523166a54e4e 100644
--- a/ui/gfx/animation/multi_animation_unittest.cc
+++ b/ui/gfx/animation/multi_animation_unittest.cc
@@ -18,20 +18,20 @@ TEST(MultiAnimationTest, Basic) {
MultiAnimation animation(parts, MultiAnimation::GetDefaultTimerInterval());
AnimationContainerElement* as_element =
static_cast<AnimationContainerElement*>(&animation);
- as_element->SetStartTime(base::TimeTicks());
+ as_element->SetStartTime(gfx::FrameTime());
// Step to 50, which is half way through the first part.
- as_element->Step(base::TimeTicks() + base::TimeDelta::FromMilliseconds(50));
+ as_element->Step(gfx::FrameTime() + base::TimeDelta::FromMilliseconds(50));
EXPECT_EQ(.5, animation.GetCurrentValue());
// Step to 120, which is 20% through the second part.
- as_element->Step(base::TimeTicks() +
+ as_element->Step(gfx::FrameTime() +
base::TimeDelta::FromMilliseconds(120));
EXPECT_DOUBLE_EQ(Tween::CalculateValue(Tween::EASE_OUT, .2),
animation.GetCurrentValue());
// Step to 320, which is 20% through the second part.
- as_element->Step(base::TimeTicks() +
+ as_element->Step(gfx::FrameTime() +
base::TimeDelta::FromMilliseconds(320));
EXPECT_DOUBLE_EQ(Tween::CalculateValue(Tween::EASE_OUT, .2),
animation.GetCurrentValue());
@@ -47,15 +47,15 @@ TEST(MultiAnimationTest, DifferingStartAndEnd) {
MultiAnimation animation(parts, MultiAnimation::GetDefaultTimerInterval());
AnimationContainerElement* as_element =
static_cast<AnimationContainerElement*>(&animation);
- as_element->SetStartTime(base::TimeTicks());
+ as_element->SetStartTime(gfx::FrameTime());
// Step to 0. Because the start_time is 100, this should be 100ms into the
// animation
- as_element->Step(base::TimeTicks());
+ as_element->Step(gfx::FrameTime());
EXPECT_EQ(.25, animation.GetCurrentValue());
// Step to 100, which is effectively 200ms into the animation.
- as_element->Step(base::TimeTicks() + base::TimeDelta::FromMilliseconds(100));
+ as_element->Step(gfx::FrameTime() + base::TimeDelta::FromMilliseconds(100));
EXPECT_EQ(.5, animation.GetCurrentValue());
}
@@ -66,11 +66,11 @@ TEST(MultiAnimationTest, DontCycle) {
MultiAnimation animation(parts, MultiAnimation::GetDefaultTimerInterval());
AnimationContainerElement* as_element =
static_cast<AnimationContainerElement*>(&animation);
- as_element->SetStartTime(base::TimeTicks());
+ as_element->SetStartTime(gfx::FrameTime());
animation.set_continuous(false);
// Step to 300, which is greater than the cycle time.
- as_element->Step(base::TimeTicks() + base::TimeDelta::FromMilliseconds(300));
+ as_element->Step(gfx::FrameTime() + base::TimeDelta::FromMilliseconds(300));
EXPECT_EQ(1.0, animation.GetCurrentValue());
EXPECT_FALSE(animation.is_animating());
}
@@ -82,10 +82,10 @@ TEST(MultiAnimationTest, Cycle) {
MultiAnimation animation(parts, MultiAnimation::GetDefaultTimerInterval());
AnimationContainerElement* as_element =
static_cast<AnimationContainerElement*>(&animation);
- as_element->SetStartTime(base::TimeTicks());
+ as_element->SetStartTime(gfx::FrameTime());
// Step to 300, which is greater than the cycle time.
- as_element->Step(base::TimeTicks() + base::TimeDelta::FromMilliseconds(300));
+ as_element->Step(gfx::FrameTime() + base::TimeDelta::FromMilliseconds(300));
EXPECT_EQ(.5, animation.GetCurrentValue());
}
« no previous file with comments | « ui/gfx/animation/multi_animation.cc ('k') | ui/gfx/animation/slide_animation_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698