| Index: ui/wm/core/visibility_controller_unittest.cc
|
| diff --git a/ui/wm/core/visibility_controller_unittest.cc b/ui/wm/core/visibility_controller_unittest.cc
|
| index 39a1d49179b8a82d9385d8598600a18deec59028..3044998dd3b7a38938348fef240ece0af8dcdcf5 100644
|
| --- a/ui/wm/core/visibility_controller_unittest.cc
|
| +++ b/ui/wm/core/visibility_controller_unittest.cc
|
| @@ -54,6 +54,32 @@ TEST_F(VisibilityControllerTest, AnimateTransparencyToZeroAndHideHides) {
|
| EXPECT_FALSE(window->IsVisible());
|
| }
|
|
|
| +// Check that a hiding animation would not change a window's bounds in screen.
|
| +TEST_F(VisibilityControllerTest, HideAnimationWindowBoundsTest) {
|
| + // We cannot disable animations for this test.
|
| + ui::ScopedAnimationDurationScaleMode test_duration_mode(
|
| + ui::ScopedAnimationDurationScaleMode::NON_ZERO_DURATION);
|
| +
|
| + VisibilityController controller;
|
| + aura::client::SetVisibilityClient(root_window(), &controller);
|
| +
|
| + // Set bound expectation.
|
| + gfx::Rect expected_bounds(4, 5, 123, 245);
|
| + aura::test::TestWindowDelegate d;
|
| + std::unique_ptr<aura::Window> window(aura::test::CreateTestWindowWithDelegate(
|
| + &d, -2, expected_bounds, root_window()));
|
| + window->Show();
|
| + SetWindowVisibilityChangesAnimated(window.get());
|
| + SetWindowVisibilityAnimationDuration(window.get(),
|
| + base::TimeDelta::FromMilliseconds(5));
|
| + SetWindowVisibilityAnimationType(window.get(),
|
| + WINDOW_VISIBILITY_ANIMATION_TYPE_DROP);
|
| + // Check that the bound is correct after the hide animation has finished.
|
| + window->Hide();
|
| + window->layer()->GetAnimator()->StopAnimating();
|
| + EXPECT_EQ(expected_bounds, window->GetBoundsInScreen());
|
| +}
|
| +
|
| // Test if SetWindowVisibilityChagngesAnimated will animate the specified
|
| // window.
|
| TEST_F(VisibilityControllerTest, SetWindowVisibilityChagnesAnimated) {
|
|
|