summaryrefslogtreecommitdiffstats
path: root/ash/wm/overview
diff options
context:
space:
mode:
authorflackr <flackr@chromium.org>2014-09-30 11:19:00 -0700
committerCommit bot <commit-bot@chromium.org>2014-09-30 18:19:42 +0000
commitd954b810db46c2590d7fc0715fcb8e66f961382d (patch)
tree8f88bc2dff22ee8dc727b660665d5fd616d1e0b1 /ash/wm/overview
parent38b0a899fccc8e74b2b0425e17938ff62d35fe34 (diff)
downloadchromium_src-d954b810db46c2590d7fc0715fcb8e66f961382d.zip
chromium_src-d954b810db46c2590d7fc0715fcb8e66f961382d.tar.gz
chromium_src-d954b810db46c2590d7fc0715fcb8e66f961382d.tar.bz2
Defer maximize mode bounds updates until after exiting overview.
When we enter overview the shelf is revealed which causes a workspace bounds change. Normally the maximize mode window manager would update all active windows to have the new bounds but this effectively undoes the transformation applied to the window to show it in overview. As such, we defer updating the bounds until we exit overview mode. BUG=401664 TEST=WindowSelectorTest.FullscreenWindowMaximizeMode, WindowAnimationsTest.CrossFadeToBoundsFromTransform TEST=Repro steps in http://crbug.com/401664 Review URL: https://codereview.chromium.org/588193003 Cr-Commit-Position: refs/heads/master@{#297455}
Diffstat (limited to 'ash/wm/overview')
-rw-r--r--ash/wm/overview/window_selector_unittest.cc41
1 files changed, 41 insertions, 0 deletions
diff --git a/ash/wm/overview/window_selector_unittest.cc b/ash/wm/overview/window_selector_unittest.cc
index bcbe8b0..8159469 100644
--- a/ash/wm/overview/window_selector_unittest.cc
+++ b/ash/wm/overview/window_selector_unittest.cc
@@ -17,6 +17,7 @@
#include "ash/test/shelf_view_test_api.h"
#include "ash/test/shell_test_api.h"
#include "ash/test/test_shelf_delegate.h"
+#include "ash/wm/maximize_mode/maximize_mode_controller.h"
#include "ash/wm/mru_window_tracker.h"
#include "ash/wm/overview/window_grid.h"
#include "ash/wm/overview/window_selector.h"
@@ -434,6 +435,46 @@ TEST_F(WindowSelectorTest, OverviewUndimsShelf) {
EXPECT_TRUE(shelf->GetDimsShelf());
}
+// Tests that entering overview when a fullscreen window is active in maximized
+// mode correctly applies the transformations to the window and correctly
+// updates the window bounds on exiting overview mode: http://crbug.com/401664.
+TEST_F(WindowSelectorTest, FullscreenWindowMaximizeMode) {
+ gfx::Rect bounds(0, 0, 400, 400);
+ scoped_ptr<aura::Window> window1(CreateWindow(bounds));
+ scoped_ptr<aura::Window> window2(CreateWindow(bounds));
+ Shell::GetInstance()->maximize_mode_controller()->
+ EnableMaximizeModeWindowManager(true);
+ wm::ActivateWindow(window2.get());
+ wm::ActivateWindow(window1.get());
+ gfx::Rect normal_window_bounds(window1->bounds());
+ const wm::WMEvent toggle_fullscreen_event(wm::WM_EVENT_TOGGLE_FULLSCREEN);
+ wm::GetWindowState(window1.get())->OnWMEvent(&toggle_fullscreen_event);
+ gfx::Rect fullscreen_window_bounds(window1->bounds());
+ EXPECT_NE(normal_window_bounds.ToString(),
+ fullscreen_window_bounds.ToString());
+ EXPECT_EQ(fullscreen_window_bounds.ToString(),
+ window2->GetTargetBounds().ToString());
+ ToggleOverview();
+ // Window 2 would normally resize to normal window bounds on showing the shelf
+ // for overview but this is deferred until overview is exited.
+ EXPECT_EQ(fullscreen_window_bounds.ToString(),
+ window2->GetTargetBounds().ToString());
+ EXPECT_FALSE(WindowsOverlapping(window1.get(), window2.get()));
+ ToggleOverview();
+
+ // Since the fullscreen window is still active, window2 will still have the
+ // larger bounds.
+ EXPECT_EQ(fullscreen_window_bounds.ToString(),
+ window2->GetTargetBounds().ToString());
+
+ // Enter overview again and select window 2. Selecting window 2 should show
+ // the shelf bringing window2 back to the normal bounds.
+ ToggleOverview();
+ ClickWindow(window2.get());
+ EXPECT_EQ(normal_window_bounds.ToString(),
+ window2->GetTargetBounds().ToString());
+}
+
// Tests that beginning window selection hides the app list.
TEST_F(WindowSelectorTest, SelectingHidesAppList) {
gfx::Rect bounds(0, 0, 400, 400);