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

Unified Diff: chrome/browser/ui/window_sizer/window_sizer_ash_unittest.cc

Issue 424463002: Makes a window that has been resized to maximized bounds, then maximized and then restored shrink (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Maximizes a window that has been resized to maximized bounds (only update size when unmaximizing) Created 6 years, 5 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
« ash/wm/default_state.cc ('K') | « chrome/browser/ui/window_sizer/window_sizer.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/window_sizer/window_sizer_ash_unittest.cc
diff --git a/chrome/browser/ui/window_sizer/window_sizer_ash_unittest.cc b/chrome/browser/ui/window_sizer/window_sizer_ash_unittest.cc
index 4bd32d5ec0207c69c2bb9cc3ac9aaa0028ca9279..9cff2c68d0d8d26a71e8c2b14f6258826520d97a 100644
--- a/chrome/browser/ui/window_sizer/window_sizer_ash_unittest.cc
+++ b/chrome/browser/ui/window_sizer/window_sizer_ash_unittest.cc
@@ -891,7 +891,33 @@ TEST_F(WindowSizerAshTest, TestShowStateDefaults) {
p1600x1200), ui::SHOW_STATE_NORMAL);
}
-// Test that the target root window is used as the destionation of
+TEST_F(WindowSizerAshTest, DefaultStateBecomesMaximized) {
+ gfx::Rect display_bounds = ash::Shell::GetInstance()->GetScreen()->
+ GetPrimaryDisplay().bounds();
+ gfx::Rect specified_bounds = display_bounds;
+
+ // Make a window bigger than the display work area.
msw 2014/07/31 04:03:24 Users can still make windows excessively large and
varkha 2014/08/01 14:18:34 No, with ash they cannot. The biggest a window is
msw 2014/08/01 16:24:47 But windows could span multiple displays on Window
varkha 2014/08/01 21:00:24 I've moved the behavior in window_sizer_ash.cc so
+ specified_bounds.Inset(-20, -20);
+ ui::WindowShowState show_state = ui::SHOW_STATE_DEFAULT;
+ gfx::Rect bounds;
+ WindowSizer::GetBrowserWindowBoundsAndShowState(
+ std::string(), specified_bounds, NULL, &bounds, &show_state);
+ // The window should start maximized with its restore bounds shrunken.
+ EXPECT_EQ(ui::SHOW_STATE_MAXIMIZED, show_state);
+ EXPECT_NE(display_bounds.ToString(), bounds.ToString());
+ EXPECT_TRUE(display_bounds.Contains(bounds));
+
+ // Make a window smaller than the display work area.
+ specified_bounds.Inset(100, 100);
+ show_state = ui::SHOW_STATE_DEFAULT;
+ WindowSizer::GetBrowserWindowBoundsAndShowState(
+ std::string(), specified_bounds, NULL, &bounds, &show_state);
+ // The window should start in default state.
+ EXPECT_EQ(ui::SHOW_STATE_DEFAULT, show_state);
+ EXPECT_EQ(specified_bounds.ToString(), bounds.ToString());
+}
+
+// Test that the target root window is used as the destination of
// the non browser window. This differ from PersistedBoundsCase
// in that this uses real ash shell implementations + StateProvider
// TargetDisplayProvider, rather than mocks.
« ash/wm/default_state.cc ('K') | « chrome/browser/ui/window_sizer/window_sizer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698