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. |