OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "app/slide_animation.h" | 5 #include "app/slide_animation.h" |
6 #include "app/test_animation_delegate.h" | 6 #include "app/test_animation_delegate.h" |
| 7 #include "base/scoped_ptr.h" |
7 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
8 | 9 |
9 class SlideAnimationTest: public testing::Test { | 10 class SlideAnimationTest: public testing::Test { |
10 private: | 11 private: |
11 MessageLoopForUI message_loop_; | 12 MessageLoopForUI message_loop_; |
12 }; | 13 }; |
13 | 14 |
14 // Tests that delegate is not notified when animation is running and is deleted. | 15 // Tests that delegate is not notified when animation is running and is deleted. |
15 // (Such a scenario would cause problems for BoundsAnimator). | 16 // (Such a scenario would cause problems for BoundsAnimator). |
16 TEST_F(SlideAnimationTest, DontNotifyOnDelete) { | 17 TEST_F(SlideAnimationTest, DontNotifyOnDelete) { |
17 TestAnimationDelegate delegate; | 18 TestAnimationDelegate delegate; |
18 scoped_ptr<SlideAnimation> animation(new SlideAnimation(&delegate)); | 19 scoped_ptr<SlideAnimation> animation(new SlideAnimation(&delegate)); |
19 | 20 |
20 // Start the animation. | 21 // Start the animation. |
21 animation->Show(); | 22 animation->Show(); |
22 | 23 |
23 // Delete the animation. | 24 // Delete the animation. |
24 animation.reset(); | 25 animation.reset(); |
25 | 26 |
26 // Make sure the delegate wasn't notified. | 27 // Make sure the delegate wasn't notified. |
27 EXPECT_FALSE(delegate.finished()); | 28 EXPECT_FALSE(delegate.finished()); |
28 EXPECT_FALSE(delegate.canceled()); | 29 EXPECT_FALSE(delegate.canceled()); |
29 } | 30 } |
OLD | NEW |