OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/memory/scoped_ptr.h" | 5 #include "base/memory/scoped_ptr.h" |
6 #include "base/time.h" | 6 #include "base/time.h" |
7 #include "testing/gtest/include/gtest/gtest.h" | 7 #include "testing/gtest/include/gtest/gtest.h" |
8 #include "ui/base/animation/slide_animation.h" | 8 #include "ui/base/animation/slide_animation.h" |
9 #include "ui/base/animation/test_animation_delegate.h" | 9 #include "ui/base/animation/test_animation_delegate.h" |
10 | 10 |
(...skipping 15 matching lines...) Expand all Loading... |
26 private: | 26 private: |
27 SlideAnimation* animation_; | 27 SlideAnimation* animation_; |
28 | 28 |
29 DISALLOW_COPY_AND_ASSIGN(TestApi); | 29 DISALLOW_COPY_AND_ASSIGN(TestApi); |
30 }; | 30 }; |
31 | 31 |
32 //////////////////////////////////////////////////////////////////////////////// | 32 //////////////////////////////////////////////////////////////////////////////// |
33 // SlideAnimationTest | 33 // SlideAnimationTest |
34 class SlideAnimationTest: public testing::Test { | 34 class SlideAnimationTest: public testing::Test { |
35 private: | 35 private: |
36 MessageLoopForUI message_loop_; | 36 base::MessageLoopForUI message_loop_; |
37 }; | 37 }; |
38 | 38 |
39 // Tests animation construction. | 39 // Tests animation construction. |
40 TEST_F(SlideAnimationTest, InitialState) { | 40 TEST_F(SlideAnimationTest, InitialState) { |
41 SlideAnimation animation(NULL); | 41 SlideAnimation animation(NULL); |
42 // By default, slide animations are 60 Hz, so the timer interval should be | 42 // By default, slide animations are 60 Hz, so the timer interval should be |
43 // 1/60th of a second. | 43 // 1/60th of a second. |
44 EXPECT_EQ(1000 / 60, animation.timer_interval().InMilliseconds()); | 44 EXPECT_EQ(1000 / 60, animation.timer_interval().InMilliseconds()); |
45 // Duration defaults to 120 ms. | 45 // Duration defaults to 120 ms. |
46 EXPECT_EQ(120, animation.GetSlideDuration()); | 46 EXPECT_EQ(120, animation.GetSlideDuration()); |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 | 95 |
96 // Delete the animation. | 96 // Delete the animation. |
97 animation.reset(); | 97 animation.reset(); |
98 | 98 |
99 // Make sure the delegate wasn't notified. | 99 // Make sure the delegate wasn't notified. |
100 EXPECT_FALSE(delegate.finished()); | 100 EXPECT_FALSE(delegate.finished()); |
101 EXPECT_FALSE(delegate.canceled()); | 101 EXPECT_FALSE(delegate.canceled()); |
102 } | 102 } |
103 | 103 |
104 } // namespace ui | 104 } // namespace ui |
OLD | NEW |