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

Unified Diff: ash/wm/window_util_unittest.cc

Issue 1489843003: [WIP: Not for review] Simplify and unify widget/window show logic Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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: ash/wm/window_util_unittest.cc
diff --git a/ash/wm/window_util_unittest.cc b/ash/wm/window_util_unittest.cc
index 3ce125932bf97734d6ca87db8e60edad608a523b..3059a9c33029fe9da68d9aefea1fd8e36d3b1da2 100644
--- a/ash/wm/window_util_unittest.cc
+++ b/ash/wm/window_util_unittest.cc
@@ -76,6 +76,10 @@ TEST_F(WindowUtilTest, AdjustBoundsToEnsureMinimumVisibility) {
"125,125 100x100",
GetAdjustedBounds(visible_bounds_right, gfx::Rect(-100, 150, 150, 150)));
+ // Make sure that the window smaller than minimum visibility is fully visible.
+ EXPECT_EQ("200,140 20x10", GetAdjustedBounds(visible_bounds_right,
+ gfx::Rect(-100, 150, 20, 10)));
+
const gfx::Rect visible_bounds_left(-200, -50, 100, 100);
EXPECT_EQ(
"-190,-40 90x90",
@@ -91,6 +95,10 @@ TEST_F(WindowUtilTest, AdjustBoundsToEnsureMinimumVisibility) {
GetAdjustedBounds(visible_bounds_left, gfx::Rect(-400, -60, 150, 150)));
EXPECT_EQ("-125,0 100x100",
GetAdjustedBounds(visible_bounds_left, gfx::Rect(0, 0, 150, 150)));
+
+ // Make sure that the window smaller than minimum visibility is fully visible.
+ EXPECT_EQ("-120,40 20x10", GetAdjustedBounds(visible_bounds_left,
+ gfx::Rect(-100, 150, 20, 10)));
}
} // namespace ash

Powered by Google App Engine
This is Rietveld 408576698