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

Unified Diff: ash/wm/base_layout_manager_unittest.cc

Issue 10821008: ash: Window restore-bounds should not be reset when showing window from minimized state. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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
« no previous file with comments | « ash/wm/base_layout_manager.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/base_layout_manager_unittest.cc
diff --git a/ash/wm/base_layout_manager_unittest.cc b/ash/wm/base_layout_manager_unittest.cc
index e02b32ac654b039598fad690e9238fb3f7dbffad..e2525cc20c6a36ac86385ec09065d805c8447d22 100644
--- a/ash/wm/base_layout_manager_unittest.cc
+++ b/ash/wm/base_layout_manager_unittest.cc
@@ -9,6 +9,7 @@
#include "ash/shell_window_ids.h"
#include "ash/test/ash_test_base.h"
#include "ash/wm/property_util.h"
+#include "ash/wm/window_util.h"
#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "ui/aura/client/aura_constants.h"
@@ -192,6 +193,34 @@ TEST_F(BaseLayoutManagerTest, MaximizeResetsRestoreBounds) {
EXPECT_TRUE(GetRestoreBoundsInScreen(window.get()) == NULL);
}
+// Verifies that the restore bounds do not get reset when restoring to a
+// maximzied state from a minimized state.
+TEST_F(BaseLayoutManagerTest, BoundsAfterRestoringToMaximizeFromMinimize) {
+ scoped_ptr<aura::Window> window(CreateTestWindow(gfx::Rect(1, 2, 3, 4)));
+ gfx::Rect bounds(10, 15, 25, 35);
+ window->SetBounds(bounds);
+
+ // Maximize it, which should reset restore bounds.
+ wm::MaximizeWindow(window.get());
+ EXPECT_EQ(bounds.ToString(),
+ GetRestoreBoundsInParent(window.get()).ToString());
+
+ // Minimize the window. The restore bounds should not change.
+ wm::MinimizeWindow(window.get());
+ EXPECT_EQ(bounds.ToString(),
+ GetRestoreBoundsInParent(window.get()).ToString());
+
+ // Show the window again. The window should be maximized, and the restore
+ // bounds should not change.
+ window->Show();
+ EXPECT_EQ(bounds.ToString(),
+ GetRestoreBoundsInParent(window.get()).ToString());
+ EXPECT_TRUE(wm::IsWindowMaximized(window.get()));
+
+ wm::RestoreWindow(window.get());
+ EXPECT_EQ(bounds.ToString(), window->bounds().ToString());
+}
+
} // namespace
} // namespace ash
« no previous file with comments | « ash/wm/base_layout_manager.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698