Index: ash/wm/window_state_unittest.cc |
diff --git a/ash/wm/window_state_unittest.cc b/ash/wm/window_state_unittest.cc |
index b81f4ca5e74a6cb588f3704c7563291f97fc60e8..cef8fbbe25304830a70be20b3c77c78a07f013b6 100644 |
--- a/ash/wm/window_state_unittest.cc |
+++ b/ash/wm/window_state_unittest.cc |
@@ -312,6 +312,26 @@ TEST_F(WindowStateTest, StateSwapRestore) { |
EXPECT_FALSE(window_state->IsMaximized()); |
} |
+// Tests that a window that had same bounds as the work area shrinks after the |
+// window is maximized and then restored. |
+TEST_F(WindowStateTest, RestoredWindowBoundsShrink) { |
+ scoped_ptr<aura::Window> window(CreateTestWindowInShellWithId(0)); |
+ WindowState* window_state = GetWindowState(window.get()); |
+ EXPECT_FALSE(window_state->IsMaximized()); |
+ gfx::Rect work_area = |
+ ash::Shell::GetScreen()->GetPrimaryDisplay().work_area(); |
+ |
+ window->SetBounds(work_area); |
+ window_state->Maximize(); |
+ EXPECT_TRUE(window_state->IsMaximized()); |
+ EXPECT_EQ(work_area.ToString(), window->bounds().ToString()); |
+ |
+ window_state->Restore(); |
+ EXPECT_FALSE(window_state->IsMaximized()); |
+ EXPECT_NE(work_area.ToString(), window->bounds().ToString()); |
+ EXPECT_TRUE(work_area.Contains(window->bounds())); |
+} |
+ |
// TODO(skuhne): Add more unit test to verify the correctness for the restore |
// operation. |