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

Unified Diff: app/multi_animation_unittest.cc

Issue 3041006: Tweaks the pinned background tab title change animation per Nicholas's (Closed)
Patch Set: Created 10 years, 5 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 | « app/multi_animation.cc ('k') | chrome/browser/views/tabs/tab.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: app/multi_animation_unittest.cc
diff --git a/app/multi_animation_unittest.cc b/app/multi_animation_unittest.cc
index c399059110e53e9f83a17e0661e3bbb91b35ece4..fbbf1b00d0cd41b7e6205ffe010111ef55ed5c60 100644
--- a/app/multi_animation_unittest.cc
+++ b/app/multi_animation_unittest.cc
@@ -34,3 +34,25 @@ TEST_F(MultiAnimationTest, Basic) {
EXPECT_EQ(Tween::CalculateValue(Tween::EASE_OUT, .2),
animation.GetCurrentValue());
}
+
+TEST_F(MultiAnimationTest, DifferingStartAndEnd) {
+ // Create a MultiAnimation with two parts.
+ MultiAnimation::Parts parts;
+ parts.push_back(MultiAnimation::Part(200, Tween::LINEAR));
+ parts[0].start_time_ms = 100;
+ parts[0].end_time_ms = 400;
+
+ MultiAnimation animation(parts);
+ AnimationContainer::Element* as_element =
+ static_cast<AnimationContainer::Element*>(&animation);
+ as_element->SetStartTime(base::TimeTicks());
+
+ // Step to 0. Because the start_time is 100, this should be 100ms into the
+ // animation
+ as_element->Step(base::TimeTicks());
+ EXPECT_EQ(.25, animation.GetCurrentValue());
+
+ // Step to 100, which is effectively 200ms into the animation.
+ as_element->Step(base::TimeTicks() + base::TimeDelta::FromMilliseconds(100));
+ EXPECT_EQ(.5, animation.GetCurrentValue());
+}
« no previous file with comments | « app/multi_animation.cc ('k') | chrome/browser/views/tabs/tab.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698