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

Unified Diff: ash/wm/window_state_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 (nits, restricts to tabbed browsers) Created 6 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/wm/default_state.cc ('k') | chrome/browser/ui/window_sizer/window_sizer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.
« no previous file with comments | « ash/wm/default_state.cc ('k') | chrome/browser/ui/window_sizer/window_sizer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698