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

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: Fix the issue for managed window mode, add tests. 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
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 e136100f41b965697404ded7b707781b0be35adc..acd0cdfb8d6ffc992f51ab7e2358968d7a156b02 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());

Powered by Google App Engine
This is Rietveld 408576698