summaryrefslogtreecommitdiffstats
path: root/ui/base/animation/slide_animation_unittest.cc
diff options
context:
space:
mode:
authorben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-07 17:33:39 +0000
committerben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-07 17:33:39 +0000
commitf676780687464428e340d008a0d1ca13d9944628 (patch)
tree489e8bd8188e31a7f6c53f15e8d1d9c6ba36d023 /ui/base/animation/slide_animation_unittest.cc
parent3b65bfd55c56cf8a6db025087d937494f49dc15f (diff)
downloadchromium_src-f676780687464428e340d008a0d1ca13d9944628.zip
chromium_src-f676780687464428e340d008a0d1ca13d9944628.tar.gz
chromium_src-f676780687464428e340d008a0d1ca13d9944628.tar.bz2
Move animation code to new ui/base/animation directory.
BUG=none TEST=none TBR=brettw Review URL: http://codereview.chromium.org/6154001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@70743 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/base/animation/slide_animation_unittest.cc')
-rw-r--r--ui/base/animation/slide_animation_unittest.cc34
1 files changed, 34 insertions, 0 deletions
diff --git a/ui/base/animation/slide_animation_unittest.cc b/ui/base/animation/slide_animation_unittest.cc
new file mode 100644
index 0000000..dcce5c0
--- /dev/null
+++ b/ui/base/animation/slide_animation_unittest.cc
@@ -0,0 +1,34 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "base/scoped_ptr.h"
+#include "testing/gtest/include/gtest/gtest.h"
+#include "ui/base/animation/slide_animation.h"
+#include "ui/base/animation/test_animation_delegate.h"
+
+namespace ui {
+
+class SlideAnimationTest: public testing::Test {
+ private:
+ MessageLoopForUI message_loop_;
+};
+
+// Tests that delegate is not notified when animation is running and is deleted.
+// (Such a scenario would cause problems for BoundsAnimator).
+TEST_F(SlideAnimationTest, DontNotifyOnDelete) {
+ TestAnimationDelegate delegate;
+ scoped_ptr<SlideAnimation> animation(new SlideAnimation(&delegate));
+
+ // Start the animation.
+ animation->Show();
+
+ // Delete the animation.
+ animation.reset();
+
+ // Make sure the delegate wasn't notified.
+ EXPECT_FALSE(delegate.finished());
+ EXPECT_FALSE(delegate.canceled());
+}
+
+} // namespace ui