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

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

Issue 2329633003: Implement progress bar spec (determinate and indeterminate). (Closed)
Patch Set: attempt to unbreak mac and unit test Created 4 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
« no previous file with comments | « ui/app_list/views/search_result_view.cc ('k') | ui/gfx/animation/linear_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 "base/run_loop.h" 5 #include "base/run_loop.h"
6 #include "build/build_config.h" 6 #include "build/build_config.h"
7 #include "testing/gtest/include/gtest/gtest.h" 7 #include "testing/gtest/include/gtest/gtest.h"
8 #include "ui/gfx/animation/animation_delegate.h" 8 #include "ui/gfx/animation/animation_delegate.h"
9 #include "ui/gfx/animation/linear_animation.h" 9 #include "ui/gfx/animation/linear_animation.h"
10 #include "ui/gfx/animation/test_animation_delegate.h" 10 #include "ui/gfx/animation/test_animation_delegate.h"
(...skipping 10 matching lines...) Expand all
21 }; 21 };
22 22
23 namespace { 23 namespace {
24 24
25 /////////////////////////////////////////////////////////////////////////////// 25 ///////////////////////////////////////////////////////////////////////////////
26 // RunAnimation 26 // RunAnimation
27 27
28 class RunAnimation : public LinearAnimation { 28 class RunAnimation : public LinearAnimation {
29 public: 29 public:
30 RunAnimation(int frame_rate, AnimationDelegate* delegate) 30 RunAnimation(int frame_rate, AnimationDelegate* delegate)
31 : LinearAnimation(frame_rate, delegate) { 31 : LinearAnimation(delegate, frame_rate) {}
32 }
33 32
34 void AnimateToState(double state) override { 33 void AnimateToState(double state) override {
35 EXPECT_LE(0.0, state); 34 EXPECT_LE(0.0, state);
36 EXPECT_GE(1.0, state); 35 EXPECT_GE(1.0, state);
37 } 36 }
38 }; 37 };
39 38
40 /////////////////////////////////////////////////////////////////////////////// 39 ///////////////////////////////////////////////////////////////////////////////
41 // CancelAnimation 40 // CancelAnimation
42 41
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 EXPECT_EQ(0.0, animation.GetCurrentValue()); 150 EXPECT_EQ(0.0, animation.GetCurrentValue());
152 animation.Start(); 151 animation.Start();
153 EXPECT_EQ(0.0, animation.GetCurrentValue()); 152 EXPECT_EQ(0.0, animation.GetCurrentValue());
154 animation.End(); 153 animation.End();
155 EXPECT_EQ(1.0, animation.GetCurrentValue()); 154 EXPECT_EQ(1.0, animation.GetCurrentValue());
156 animation.Start(); 155 animation.Start();
157 EXPECT_EQ(0.0, animation.GetCurrentValue()); 156 EXPECT_EQ(0.0, animation.GetCurrentValue());
158 } 157 }
159 158
160 } // namespace gfx 159 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/app_list/views/search_result_view.cc ('k') | ui/gfx/animation/linear_animation.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698