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

Unified Diff: ui/wm/core/visibility_controller_unittest.cc

Issue 2020563006: [Merge to M51] Fix the issue that Apps window keeps moving down to the right when reopened. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2704
Patch Set: Created 4 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ui/wm/core/window_animations.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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) {
« no previous file with comments | « no previous file | ui/wm/core/window_animations.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698