summaryrefslogtreecommitdiffstats
path: root/app/multi_animation_unittest.cc
diff options
context:
space:
mode:
authorsky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-11 00:37:15 +0000
committersky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-11 00:37:15 +0000
commit553aabb40b432ecdc2c289c935ba77874928dfcc (patch)
tree7ecabde66cc28677bc092a715c2a1228cac80ba5 /app/multi_animation_unittest.cc
parent2ca83cd871de1a2c322a48b80d06f4d3c8bb6923 (diff)
downloadchromium_src-553aabb40b432ecdc2c289c935ba77874928dfcc.zip
chromium_src-553aabb40b432ecdc2c289c935ba77874928dfcc.tar.gz
chromium_src-553aabb40b432ecdc2c289c935ba77874928dfcc.tar.bz2
Makes the instant suggested text autocomplete after 1.3 seconds. There
are a number of parts of this patch that need work, but it should be good enough for us to decide if we want to pursue it. BUG=none TEST=none Review URL: http://codereview.chromium.org/4385001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@65741 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'app/multi_animation_unittest.cc')
-rw-r--r--app/multi_animation_unittest.cc30
1 files changed, 30 insertions, 0 deletions
diff --git a/app/multi_animation_unittest.cc b/app/multi_animation_unittest.cc
index fbbf1b0..e6e81f1 100644
--- a/app/multi_animation_unittest.cc
+++ b/app/multi_animation_unittest.cc
@@ -56,3 +56,33 @@ TEST_F(MultiAnimationTest, DifferingStartAndEnd) {
as_element->Step(base::TimeTicks() + base::TimeDelta::FromMilliseconds(100));
EXPECT_EQ(.5, animation.GetCurrentValue());
}
+
+// Makes sure multi-animation stops if cycles is false.
+TEST_F(MultiAnimationTest, DontCycle) {
+ MultiAnimation::Parts parts;
+ parts.push_back(MultiAnimation::Part(200, Tween::LINEAR));
+ MultiAnimation animation(parts);
+ AnimationContainer::Element* as_element =
+ static_cast<AnimationContainer::Element*>(&animation);
+ as_element->SetStartTime(base::TimeTicks());
+ animation.set_continuous(false);
+
+ // Step to 300, which is greater than the cycle time.
+ as_element->Step(base::TimeTicks() + base::TimeDelta::FromMilliseconds(300));
+ EXPECT_EQ(1.0, animation.GetCurrentValue());
+ EXPECT_FALSE(animation.is_animating());
+}
+
+// Makes sure multi-animation cycles correctly.
+TEST_F(MultiAnimationTest, Cycle) {
+ MultiAnimation::Parts parts;
+ parts.push_back(MultiAnimation::Part(200, Tween::LINEAR));
+ MultiAnimation animation(parts);
+ AnimationContainer::Element* as_element =
+ static_cast<AnimationContainer::Element*>(&animation);
+ as_element->SetStartTime(base::TimeTicks());
+
+ // Step to 300, which is greater than the cycle time.
+ as_element->Step(base::TimeTicks() + base::TimeDelta::FromMilliseconds(300));
+ EXPECT_EQ(.5, animation.GetCurrentValue());
+}