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 "ui/gfx/animation/slide_animation.h" |
| 6 |
5 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
6 #include "base/time/time.h" | 8 #include "base/time/time.h" |
7 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
8 #include "ui/base/animation/slide_animation.h" | 10 #include "ui/gfx/animation/test_animation_delegate.h" |
9 #include "ui/base/animation/test_animation_delegate.h" | |
10 | 11 |
11 namespace ui { | 12 namespace gfx { |
12 | 13 |
13 // Class to provide access to SlideAnimation internals for testing. | 14 // Class to provide access to SlideAnimation internals for testing. |
14 class SlideAnimation::TestApi { | 15 class SlideAnimation::TestApi { |
15 public: | 16 public: |
16 explicit TestApi(SlideAnimation* animation) : animation_(animation) {} | 17 explicit TestApi(SlideAnimation* animation) : animation_(animation) {} |
17 | 18 |
18 void SetStartTime(base::TimeTicks ticks) { | 19 void SetStartTime(base::TimeTicks ticks) { |
19 animation_->SetStartTime(ticks); | 20 animation_->SetStartTime(ticks); |
20 } | 21 } |
21 | 22 |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 animation->Show(); | 95 animation->Show(); |
95 | 96 |
96 // Delete the animation. | 97 // Delete the animation. |
97 animation.reset(); | 98 animation.reset(); |
98 | 99 |
99 // Make sure the delegate wasn't notified. | 100 // Make sure the delegate wasn't notified. |
100 EXPECT_FALSE(delegate.finished()); | 101 EXPECT_FALSE(delegate.finished()); |
101 EXPECT_FALSE(delegate.canceled()); | 102 EXPECT_FALSE(delegate.canceled()); |
102 } | 103 } |
103 | 104 |
104 } // namespace ui | 105 } // namespace gfx |
OLD | NEW |