diff options
author | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-19 20:46:07 +0000 |
---|---|---|
committer | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-19 20:46:07 +0000 |
commit | 7edf5b5462727c06c0232b541c5db549f176d84a (patch) | |
tree | 4a4ac06d13b40e52180ecd6a1fa7c9be977c14f3 /app/multi_animation_unittest.cc | |
parent | 948ab987c4bdc1a63a54434276d68bc68b3a0e07 (diff) | |
download | chromium_src-7edf5b5462727c06c0232b541c5db549f176d84a.zip chromium_src-7edf5b5462727c06c0232b541c5db549f176d84a.tar.gz chromium_src-7edf5b5462727c06c0232b541c5db549f176d84a.tar.bz2 |
Tweaks the pinned background tab title change animation per Nicholas's
request.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/3041006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@52949 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'app/multi_animation_unittest.cc')
-rw-r--r-- | app/multi_animation_unittest.cc | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/app/multi_animation_unittest.cc b/app/multi_animation_unittest.cc index c3990591..fbbf1b0 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()); +} |