diff options
author | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-05 20:02:18 +0000 |
---|---|---|
committer | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-05 20:02:18 +0000 |
commit | d40c8492826ae9ac77b12c2cff7fbceb2075a772 (patch) | |
tree | a4ec160749f7f644654e9cb9165e8a1283b4574a /app/multi_animation_unittest.cc | |
parent | 379f172c0f5573f49b03a72a22f917f3c2d3caae (diff) | |
download | chromium_src-d40c8492826ae9ac77b12c2cff7fbceb2075a772.zip chromium_src-d40c8492826ae9ac77b12c2cff7fbceb2075a772.tar.gz chromium_src-d40c8492826ae9ac77b12c2cff7fbceb2075a772.tar.bz2 |
Changes the mini tab title animation.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/1902005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@46485 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'app/multi_animation_unittest.cc')
-rw-r--r-- | app/multi_animation_unittest.cc | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/app/multi_animation_unittest.cc b/app/multi_animation_unittest.cc new file mode 100644 index 0000000..c3990591 --- /dev/null +++ b/app/multi_animation_unittest.cc @@ -0,0 +1,36 @@ +// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "app/multi_animation.h" +#include "testing/gtest/include/gtest/gtest.h" + +typedef testing::Test MultiAnimationTest; + +TEST_F(MultiAnimationTest, Basic) { + // Create a MultiAnimation with two parts. + MultiAnimation::Parts parts; + parts.push_back(MultiAnimation::Part(100, Tween::LINEAR)); + parts.push_back(MultiAnimation::Part(100, Tween::EASE_OUT)); + + MultiAnimation animation(parts); + AnimationContainer::Element* as_element = + static_cast<AnimationContainer::Element*>(&animation); + as_element->SetStartTime(base::TimeTicks()); + + // Step to 50, which is half way through the first part. + as_element->Step(base::TimeTicks() + base::TimeDelta::FromMilliseconds(50)); + EXPECT_EQ(.5, animation.GetCurrentValue()); + + // Step to 120, which is 20% through the second part. + as_element->Step(base::TimeTicks() + + base::TimeDelta::FromMilliseconds(120)); + EXPECT_EQ(Tween::CalculateValue(Tween::EASE_OUT, .2), + animation.GetCurrentValue()); + + // Step to 320, which is 20% through the second part. + as_element->Step(base::TimeTicks() + + base::TimeDelta::FromMilliseconds(320)); + EXPECT_EQ(Tween::CalculateValue(Tween::EASE_OUT, .2), + animation.GetCurrentValue()); +} |