summaryrefslogtreecommitdiffstats
path: root/ash/wm/base_layout_manager_unittest.cc
diff options
context:
space:
mode:
authorsky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-07-20 01:52:16 +0000
committersky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-07-20 01:52:16 +0000
commit14d8e6ad02c6268fcbcb2965a27196d32dd7921c (patch)
tree365a12c3e1af18b2db1911dc04d1814145b905ca /ash/wm/base_layout_manager_unittest.cc
parent26effd10fe11d820b3040e72d85e00dd3bd524d5 (diff)
downloadchromium_src-14d8e6ad02c6268fcbcb2965a27196d32dd7921c.zip
chromium_src-14d8e6ad02c6268fcbcb2965a27196d32dd7921c.tar.gz
chromium_src-14d8e6ad02c6268fcbcb2965a27196d32dd7921c.tar.bz2
Changes maximize/fullscreen to always reset the restore bounds. Doing
otherwise leads to unexpected behavior. I'm also changing double clicking the caption to go back to restore bounds if set. This too makes things more consistant. BUG=122324 TEST=covered by tests R=jamescook@chromium.org Review URL: https://chromiumcodereview.appspot.com/10803048 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@147598 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/wm/base_layout_manager_unittest.cc')
-rw-r--r--ash/wm/base_layout_manager_unittest.cc17
1 files changed, 17 insertions, 0 deletions
diff --git a/ash/wm/base_layout_manager_unittest.cc b/ash/wm/base_layout_manager_unittest.cc
index 47f1306..e02b32a 100644
--- a/ash/wm/base_layout_manager_unittest.cc
+++ b/ash/wm/base_layout_manager_unittest.cc
@@ -8,6 +8,7 @@
#include "ash/shell.h"
#include "ash/shell_window_ids.h"
#include "ash/test/ash_test_base.h"
+#include "ash/wm/property_util.h"
#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "ui/aura/client/aura_constants.h"
@@ -175,6 +176,22 @@ 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) {
+ 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.
+ window->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MAXIMIZED);
+ EXPECT_EQ("1,2 3x4", GetRestoreBoundsInParent(window.get()).ToString());
+
+ // Restore it, which should restore bounds and reset restore bounds.
+ window->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_NORMAL);
+ EXPECT_EQ("1,2 3x4", window->bounds().ToString());
+ EXPECT_TRUE(GetRestoreBoundsInScreen(window.get()) == NULL);
+}
+
} // namespace
} // namespace ash