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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/wm/core/window_animations.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/wm/core/window_animations.h" 5 #include "ui/wm/core/window_animations.h"
6 6
7 #include "base/time/time.h" 7 #include "base/time/time.h"
8 #include "ui/aura/test/aura_test_base.h" 8 #include "ui/aura/test/aura_test_base.h"
9 #include "ui/aura/test/test_windows.h" 9 #include "ui/aura/test/test_windows.h"
10 #include "ui/aura/window.h" 10 #include "ui/aura/window.h"
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after
281 wm::SetWindowVisibilityAnimationType( 281 wm::SetWindowVisibilityAnimationType(
282 window.get(), WINDOW_VISIBILITY_ANIMATION_TYPE_FADE); 282 window.get(), WINDOW_VISIBILITY_ANIMATION_TYPE_FADE);
283 AnimateOnChildWindowVisibilityChanged(window.get(), true); 283 AnimateOnChildWindowVisibilityChanged(window.get(), true);
284 EXPECT_TRUE(window->layer()->visible()); 284 EXPECT_TRUE(window->layer()->visible());
285 285
286 EXPECT_FALSE(animation_host.hide_completed()); 286 EXPECT_FALSE(animation_host.hide_completed());
287 AnimateOnChildWindowVisibilityChanged(window.get(), false); 287 AnimateOnChildWindowVisibilityChanged(window.get(), false);
288 EXPECT_TRUE(animation_host.hide_completed()); 288 EXPECT_TRUE(animation_host.hide_completed());
289 } 289 }
290 290
291 // The rotation animation for hiding a window should not leak the animation
292 // observer.
293 TEST_F(WindowAnimationsTest, RotateHideNoLeak) {
294 ui::ScopedAnimationDurationScaleMode scale_mode(
295 ui::ScopedAnimationDurationScaleMode::FAST_DURATION);
296
297 scoped_ptr<aura::Window> window(aura::test::CreateTestWindowWithId(0, NULL));
298 ui::Layer* animating_layer = window->layer();
299 wm::SetWindowVisibilityAnimationType(window.get(),
300 WINDOW_VISIBILITY_ANIMATION_TYPE_ROTATE);
301
302 AnimateOnChildWindowVisibilityChanged(window.get(), true);
303 AnimateOnChildWindowVisibilityChanged(window.get(), false);
304
305 animating_layer->GetAnimator()->StopAnimating();
306 }
307
291 } // namespace wm 308 } // namespace wm
OLDNEW
« 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