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

Unified 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: Fixed test. Created 6 years 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
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 095ea02d2635c325b3ffd86645065e5d7a2f2b03..84bd151d38b8e9d804397ae3a1b9be7b7718b03d 100644
--- a/ui/wm/core/window_animations_unittest.cc
+++ b/ui/wm/core/window_animations_unittest.cc
@@ -300,4 +300,21 @@ TEST_F(WindowAnimationsTest, RotateHideNoLeak) {
animating_layer->GetAnimator()->StopAnimating();
}
+// The rotation animation for hiding a window should not crash when terminated
+// by LayerAnimator::StopAnimating().
+TEST_F(WindowAnimationsTest, RotateHideNoCrash) {
+ 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);
+ window->layer()->GetAnimator()->Step(base::TimeTicks::Now() +
+ base::TimeDelta::FromSeconds(5));
+ AnimateOnChildWindowVisibilityChanged(window.get(), false);
+ animating_layer->GetAnimator()->StopAnimating();
+}
+
} // namespace wm
« ui/compositor/layer_animator_unittest.cc ('K') | « ui/compositor/layer_animator_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698