OLD | NEW |
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 Loading... |
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 |
OLD | NEW |