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