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

Unified Diff: ash/wm/window_util_unittest.cc

Issue 2175833002: AdjustBoundsToEnsureMinimumWindowVisibility may cause unwanted shift if window dimension is small (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: AdjustBoundsToEnsureMinimumWindowVisibility Created 4 years, 4 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 | « ash/common/wm/window_positioning_utils.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/window_util_unittest.cc
diff --git a/ash/wm/window_util_unittest.cc b/ash/wm/window_util_unittest.cc
index 5c18e6b58f85ae83b5281cad6be2cdd4e6c0fcb8..9867931445d8ab17697b791d0248660e468d0475 100644
--- a/ash/wm/window_util_unittest.cc
+++ b/ash/wm/window_util_unittest.cc
@@ -62,6 +62,25 @@ TEST_F(WindowUtilTest, AdjustBoundsToEnsureMinimumVisibility) {
EXPECT_EQ("75,75 100x100",
GetAdjustedBounds(visible_bounds, gfx::Rect(100, 100, 150, 150)));
+ // For windows that have smaller dimensions than wm::kMinimumOnScreenArea,
+ // we should adjust bounds accordingly, leaving no white space.
+ EXPECT_EQ("50,80 20x20",
+ GetAdjustedBounds(visible_bounds, gfx::Rect(50, 80, 20, 20)));
+ EXPECT_EQ("80,50 20x20",
+ GetAdjustedBounds(visible_bounds, gfx::Rect(80, 50, 20, 20)));
+ EXPECT_EQ("0,50 20x20",
+ GetAdjustedBounds(visible_bounds, gfx::Rect(0, 50, 20, 20)));
+ EXPECT_EQ("50,0 20x20",
+ GetAdjustedBounds(visible_bounds, gfx::Rect(50, 0, 20, 20)));
+ EXPECT_EQ("50,80 20x20",
+ GetAdjustedBounds(visible_bounds, gfx::Rect(50, 100, 20, 20)));
+ EXPECT_EQ("80,50 20x20",
+ GetAdjustedBounds(visible_bounds, gfx::Rect(100, 50, 20, 20)));
+ EXPECT_EQ("0,50 20x20",
+ GetAdjustedBounds(visible_bounds, gfx::Rect(-10, 50, 20, 20)));
+ EXPECT_EQ("50,0 20x20",
+ GetAdjustedBounds(visible_bounds, gfx::Rect(50, -10, 20, 20)));
+
const gfx::Rect visible_bounds_right(200, 50, 100, 100);
EXPECT_EQ("210,60 90x90", GetAdjustedBounds(visible_bounds_right,
« no previous file with comments | « ash/common/wm/window_positioning_utils.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698