Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(13)

Unified Diff: ui/wm/core/window_animations_unittest.cc

Issue 343753007: Fix a leak in wm::AnimateOnChildWindowVisibilityChanged(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove expect. Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/wm/core/window_animations.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/wm/core/window_animations_unittest.cc
diff --git a/ui/wm/core/window_animations_unittest.cc b/ui/wm/core/window_animations_unittest.cc
index 5968bf32440b03211c8aa95231de08b5eaabf7e3..0a9a944481255b18228c66175b54f74accd1186b 100644
--- a/ui/wm/core/window_animations_unittest.cc
+++ b/ui/wm/core/window_animations_unittest.cc
@@ -288,4 +288,21 @@ TEST_F(WindowAnimationsTest, NotifyHideCompleted) {
EXPECT_TRUE(animation_host.hide_completed());
}
+// The rotation animation for hiding a window should not leak the animation
+// observer.
+TEST_F(WindowAnimationsTest, RotateHideNoLeak) {
+ ui::ScopedAnimationDurationScaleMode scale_mode(
+ ui::ScopedAnimationDurationScaleMode::FAST_DURATION);
+
+ scoped_ptr<aura::Window> window(aura::test::CreateTestWindowWithId(0, NULL));
+ ui::Layer* animating_layer = window->layer();
+ wm::SetWindowVisibilityAnimationType(window.get(),
+ WINDOW_VISIBILITY_ANIMATION_TYPE_ROTATE);
+
+ AnimateOnChildWindowVisibilityChanged(window.get(), true);
+ AnimateOnChildWindowVisibilityChanged(window.get(), false);
+
+ animating_layer->GetAnimator()->StopAnimating();
+}
+
} // namespace wm
« no previous file with comments | « ui/wm/core/window_animations.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698