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

Side by Side Diff: ui/base/animation/multi_animation_unittest.cc

Issue 6154001: Move animation code to new ui/base/animation directory.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 11 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/base/animation/multi_animation.cc ('k') | ui/base/animation/slide_animation.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "app/animation_container_element.h"
6 #include "app/multi_animation.h"
7 #include "testing/gtest/include/gtest/gtest.h" 5 #include "testing/gtest/include/gtest/gtest.h"
6 #include "ui/base/animation/animation_container_element.h"
7 #include "ui/base/animation/multi_animation.h"
8
9 namespace ui {
8 10
9 typedef testing::Test MultiAnimationTest; 11 typedef testing::Test MultiAnimationTest;
10 12
11 TEST_F(MultiAnimationTest, Basic) { 13 TEST_F(MultiAnimationTest, Basic) {
12 // Create a MultiAnimation with two parts. 14 // Create a MultiAnimation with two parts.
13 MultiAnimation::Parts parts; 15 MultiAnimation::Parts parts;
14 parts.push_back(MultiAnimation::Part(100, Tween::LINEAR)); 16 parts.push_back(MultiAnimation::Part(100, Tween::LINEAR));
15 parts.push_back(MultiAnimation::Part(100, Tween::EASE_OUT)); 17 parts.push_back(MultiAnimation::Part(100, Tween::EASE_OUT));
16 18
17 MultiAnimation animation(parts); 19 MultiAnimation animation(parts);
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 parts.push_back(MultiAnimation::Part(200, Tween::LINEAR)); 82 parts.push_back(MultiAnimation::Part(200, Tween::LINEAR));
81 MultiAnimation animation(parts); 83 MultiAnimation animation(parts);
82 AnimationContainerElement* as_element = 84 AnimationContainerElement* as_element =
83 static_cast<AnimationContainerElement*>(&animation); 85 static_cast<AnimationContainerElement*>(&animation);
84 as_element->SetStartTime(base::TimeTicks()); 86 as_element->SetStartTime(base::TimeTicks());
85 87
86 // Step to 300, which is greater than the cycle time. 88 // Step to 300, which is greater than the cycle time.
87 as_element->Step(base::TimeTicks() + base::TimeDelta::FromMilliseconds(300)); 89 as_element->Step(base::TimeTicks() + base::TimeDelta::FromMilliseconds(300));
88 EXPECT_EQ(.5, animation.GetCurrentValue()); 90 EXPECT_EQ(.5, animation.GetCurrentValue());
89 } 91 }
92
93 } // namespace ui
OLDNEW
« no previous file with comments | « ui/base/animation/multi_animation.cc ('k') | ui/base/animation/slide_animation.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698