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

Unified Diff: ash/wm/base_layout_manager_unittest.cc

Issue 10883069: Added restore functionality for maximize full/left/right (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed unit test failure Created 8 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/base_layout_manager.cc ('k') | ash/wm/custom_frame_view_ash_unittest.cc » ('j') | 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 e2525cc20c6a36ac86385ec09065d805c8447d22..e797c75670a40ed454844ad83427067044b7113a 100644
--- a/ash/wm/base_layout_manager_unittest.cc
+++ b/ash/wm/base_layout_manager_unittest.cc
@@ -177,13 +177,12 @@ TEST_F(BaseLayoutManagerTest, BoundsWithScreenEdgeVisible) {
EXPECT_EQ(max_bounds.ToString(), window->bounds().ToString());
}
-// Verifies maximizing always resets the restore bounds, and similarly restoring
-// resets the restore bounds.
-TEST_F(BaseLayoutManagerTest, MaximizeResetsRestoreBounds) {
+// Verifies maximizing sets the restore bounds, and restoring
+// restores the bounds.
+TEST_F(BaseLayoutManagerTest, MaximizeSetsRestoreBounds) {
scoped_ptr<aura::Window> window(CreateTestWindow(gfx::Rect(1, 2, 3, 4)));
- SetRestoreBoundsInParent(window.get(), gfx::Rect(10, 11, 12, 13));
- // Maximize it, which should reset restore bounds.
+ // Maximize it, which will keep the previous restore bounds.
window->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MAXIMIZED);
EXPECT_EQ("1,2 3x4", GetRestoreBoundsInParent(window.get()).ToString());
@@ -193,6 +192,16 @@ TEST_F(BaseLayoutManagerTest, MaximizeResetsRestoreBounds) {
EXPECT_TRUE(GetRestoreBoundsInScreen(window.get()) == NULL);
}
+// Verifies maximizing keeps the restore bounds if set.
+TEST_F(BaseLayoutManagerTest, MaximizeResetsRestoreBounds) {
+ scoped_ptr<aura::Window> window(CreateTestWindow(gfx::Rect(1, 2, 3, 4)));
+ SetRestoreBoundsInParent(window.get(), gfx::Rect(10, 11, 12, 13));
+
+ // Maximize it, which will keep the previous restore bounds.
+ window->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MAXIMIZED);
+ EXPECT_EQ("10,11 12x13", GetRestoreBoundsInParent(window.get()).ToString());
+}
+
// Verifies that the restore bounds do not get reset when restoring to a
// maximzied state from a minimized state.
TEST_F(BaseLayoutManagerTest, BoundsAfterRestoringToMaximizeFromMinimize) {
« no previous file with comments | « ash/wm/base_layout_manager.cc ('k') | ash/wm/custom_frame_view_ash_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698