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

Unified Diff: ash/wm/workspace/workspace_manager_unittest.cc

Issue 9515003: Fix the full screen switching browser window dipping below launcher bar issue. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Make SetWorkSpaceBounds private. Created 8 years, 10 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/workspace/workspace_manager.cc ('k') | ash/wm/workspace/workspace_window_resizer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/workspace/workspace_manager_unittest.cc
diff --git a/ash/wm/workspace/workspace_manager_unittest.cc b/ash/wm/workspace/workspace_manager_unittest.cc
index b8f97179f266c585ec085e79a41ae1ea48f924f4..5c5a5a3d4b6101d4fb19128bd7c3fb740aec3aeb 100644
--- a/ash/wm/workspace/workspace_manager_unittest.cc
+++ b/ash/wm/workspace/workspace_manager_unittest.cc
@@ -159,6 +159,48 @@ TEST_F(WorkspaceManagerTest, SingleMaximizeWindow) {
EXPECT_EQ(251, w1->bounds().height());
}
+// Assertions around maximized window resizing on work area insets change.
+TEST_F(WorkspaceManagerTest, ResizeMaximizedWindowOnWorkAreaInsetsChange) {
+ scoped_ptr<Window> w1(CreateTestWindow());
+ w1->SetBounds(gfx::Rect(0, 0, 250, 251));
+
+ ASSERT_TRUE(manager_->IsManagedWindow(w1.get()));
+
+ w1->Show();
+
+ ASSERT_TRUE(w1->layer() != NULL);
+ EXPECT_TRUE(w1->layer()->visible());
+
+ EXPECT_EQ(250, w1->bounds().width());
+ EXPECT_EQ(251, w1->bounds().height());
+
+ // Maximize the window.
+ Shell::GetRootWindow()->SetScreenWorkAreaInsets(
+ gfx::Insets(0, 0, 30, 0));
+ w1->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MAXIMIZED);
+
+ // Should be 1 workspace, TYPE_MAXIMIZED with w1, fills the work area bounds.
+ ASSERT_EQ(1u, workspaces().size());
+ EXPECT_EQ(Workspace::TYPE_MAXIMIZED, workspaces()[0]->type());
+ ASSERT_EQ(1u, workspaces()[0]->windows().size());
+ EXPECT_EQ(w1.get(), workspaces()[0]->windows()[0]);
+ EXPECT_EQ(GetWorkAreaBounds().width(), w1->bounds().width());
+ EXPECT_EQ(GetWorkAreaBounds().height(), w1->bounds().height());
+
+ // Change work area insets.
+ Shell::GetRootWindow()->SetScreenWorkAreaInsets(
+ gfx::Insets(0, 0, 60, 0));
+
+ // Should be 1 workspace, TYPE_MAXIMIZED with w1, fills the changed work
+ // area bounds.
+ ASSERT_EQ(1u, workspaces().size());
+ EXPECT_EQ(Workspace::TYPE_MAXIMIZED, workspaces()[0]->type());
+ ASSERT_EQ(1u, workspaces()[0]->windows().size());
+ EXPECT_EQ(w1.get(), workspaces()[0]->windows()[0]);
+ EXPECT_EQ(GetWorkAreaBounds().width(), w1->bounds().width());
+ EXPECT_EQ(GetWorkAreaBounds().height(), w1->bounds().height());
+}
+
// Assertions around closing the last window in a workspace.
TEST_F(WorkspaceManagerTest, CloseLastWindowInWorkspace) {
scoped_ptr<Window> w1(CreateTestWindow());
« no previous file with comments | « ash/wm/workspace/workspace_manager.cc ('k') | ash/wm/workspace/workspace_window_resizer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698