OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |