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

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

Issue 23531053: ui/base/animation -> ui/gfx/animation (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge 2 trunk Created 7 years, 3 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/gfx/animation/multi_animation.cc ('k') | ui/gfx/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) 2011 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 "ui/gfx/animation/multi_animation.h"
6
5 #include "testing/gtest/include/gtest/gtest.h" 7 #include "testing/gtest/include/gtest/gtest.h"
6 #include "ui/base/animation/animation_container_element.h" 8 #include "ui/gfx/animation/animation_container_element.h"
7 #include "ui/base/animation/multi_animation.h"
8 9
9 namespace ui { 10 namespace gfx {
10 11
11 TEST(MultiAnimationTest, Basic) { 12 TEST(MultiAnimationTest, Basic) {
12 // Create a MultiAnimation with two parts. 13 // Create a MultiAnimation with two parts.
13 MultiAnimation::Parts parts; 14 MultiAnimation::Parts parts;
14 parts.push_back(MultiAnimation::Part(100, Tween::LINEAR)); 15 parts.push_back(MultiAnimation::Part(100, Tween::LINEAR));
15 parts.push_back(MultiAnimation::Part(100, Tween::EASE_OUT)); 16 parts.push_back(MultiAnimation::Part(100, Tween::EASE_OUT));
16 17
17 MultiAnimation animation(parts, MultiAnimation::GetDefaultTimerInterval()); 18 MultiAnimation animation(parts, MultiAnimation::GetDefaultTimerInterval());
18 AnimationContainerElement* as_element = 19 AnimationContainerElement* as_element =
19 static_cast<AnimationContainerElement*>(&animation); 20 static_cast<AnimationContainerElement*>(&animation);
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 MultiAnimation animation(parts, MultiAnimation::GetDefaultTimerInterval()); 82 MultiAnimation animation(parts, MultiAnimation::GetDefaultTimerInterval());
82 AnimationContainerElement* as_element = 83 AnimationContainerElement* as_element =
83 static_cast<AnimationContainerElement*>(&animation); 84 static_cast<AnimationContainerElement*>(&animation);
84 as_element->SetStartTime(base::TimeTicks()); 85 as_element->SetStartTime(base::TimeTicks());
85 86
86 // Step to 300, which is greater than the cycle time. 87 // Step to 300, which is greater than the cycle time.
87 as_element->Step(base::TimeTicks() + base::TimeDelta::FromMilliseconds(300)); 88 as_element->Step(base::TimeTicks() + base::TimeDelta::FromMilliseconds(300));
88 EXPECT_EQ(.5, animation.GetCurrentValue()); 89 EXPECT_EQ(.5, animation.GetCurrentValue());
89 } 90 }
90 91
91 } // namespace ui 92 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/gfx/animation/multi_animation.cc ('k') | ui/gfx/animation/slide_animation.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698