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

Side by Side Diff: ui/wm/core/window_animations_unittest.cc

Issue 795113002: compositor/layer_animator: handle delegate removal in LayerAnimation::StopAnimating (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: More fixups for test Created 5 years, 11 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
« no previous file with comments | « ui/compositor/layer_animator_unittest.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 282 matching lines...) Expand 10 before | Expand all | Expand 10 after
293 ui::Layer* animating_layer = window->layer(); 293 ui::Layer* animating_layer = window->layer();
294 wm::SetWindowVisibilityAnimationType(window.get(), 294 wm::SetWindowVisibilityAnimationType(window.get(),
295 WINDOW_VISIBILITY_ANIMATION_TYPE_ROTATE); 295 WINDOW_VISIBILITY_ANIMATION_TYPE_ROTATE);
296 296
297 AnimateOnChildWindowVisibilityChanged(window.get(), true); 297 AnimateOnChildWindowVisibilityChanged(window.get(), true);
298 AnimateOnChildWindowVisibilityChanged(window.get(), false); 298 AnimateOnChildWindowVisibilityChanged(window.get(), false);
299 299
300 animating_layer->GetAnimator()->StopAnimating(); 300 animating_layer->GetAnimator()->StopAnimating();
301 } 301 }
302 302
303 // The rotation animation for hiding a window should not crash when terminated
304 // by LayerAnimator::StopAnimating().
305 TEST_F(WindowAnimationsTest, RotateHideNoCrash) {
306 ui::ScopedAnimationDurationScaleMode scale_mode(
307 ui::ScopedAnimationDurationScaleMode::FAST_DURATION);
308
309 scoped_ptr<aura::Window> window(aura::test::CreateTestWindowWithId(0, NULL));
310 ui::Layer* animating_layer = window->layer();
311 wm::SetWindowVisibilityAnimationType(window.get(),
312 WINDOW_VISIBILITY_ANIMATION_TYPE_ROTATE);
313 AnimateOnChildWindowVisibilityChanged(window.get(), true);
314 window->layer()->GetAnimator()->Step(base::TimeTicks::Now() +
315 base::TimeDelta::FromSeconds(5));
316 AnimateOnChildWindowVisibilityChanged(window.get(), false);
317 animating_layer->GetAnimator()->StopAnimating();
318 }
319
303 } // namespace wm 320 } // namespace wm
OLDNEW
« no previous file with comments | « ui/compositor/layer_animator_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698