Chromium Code Reviews| 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 01ad2cbc8ddffe45426495c673301a13bd45f6a5..6cb159ad3223b416e6670a8a5024276413226630 100644 |
| --- a/ash/wm/workspace/workspace_manager_unittest.cc |
| +++ b/ash/wm/workspace/workspace_manager_unittest.cc |
| @@ -149,7 +149,7 @@ class WorkspaceManagerTest : public test::AshTestBase { |
| } |
| std::string WorkspaceStateString(Workspace* workspace) { |
| - return (workspace->is_maximized() ? "M" : "") + |
| + return (workspace->is_fullscreen() ? "F" : "") + |
| base::IntToString(static_cast<int>( |
| workspace->window()->children().size())); |
| } |
| @@ -163,14 +163,14 @@ class WorkspaceManagerTest : public test::AshTestBase { |
| // Returns a string description of the current state. The string has the |
| // following format: |
| // W* P=W* active=N |
| - // Each W corresponds to a workspace. Each workspace is prefixed with an 'M' |
| - // if the workspace is maximized and is followed by the number of windows in |
| + // Each W corresponds to a workspace. Each workspace is prefixed with an 'F' |
| + // if the workspace is fullscreen and is followed by the number of windows in |
| // the workspace. |
| // 'P=' is used for the pending workspaces (see |
| // WorkspaceManager::pending_workspaces_ for details on pending workspaces). |
| // N is the index of the active workspace (index into |
| // WorkspaceManager::workspaces_). |
| - // For example, '2 M1 P=M1 active=1' means the first workspace (the desktop) |
| + // For example, '2 F1 P=F1 active=1' means the first workspace (the desktop) |
| // has 2 windows, the second workspace is a maximized workspace with 1 window, |
| // there is a pending maximized workspace with 1 window and the second |
| // workspace is active. |
| @@ -260,9 +260,9 @@ TEST_F(WorkspaceManagerTest, SingleMaximizeWindow) { |
| EXPECT_TRUE(wm::IsActiveWindow(w1.get())); |
| - // Should be 2 workspaces, the second maximized with w1. |
| - ASSERT_EQ("0 M1 active=1", StateString()); |
| - EXPECT_EQ(w1.get(), workspaces()[1]->window()->children()[0]); |
| + // Should be 1 workspace. |
| + ASSERT_EQ("1 active=0", StateString()); |
| + EXPECT_EQ(w1.get(), workspaces()[0]->window()->children()[0]); |
| EXPECT_EQ(ScreenAsh::GetMaximizedWindowBoundsInParent(w1.get()).width(), |
| w1->bounds().width()); |
| EXPECT_EQ(ScreenAsh::GetMaximizedWindowBoundsInParent(w1.get()).height(), |
| @@ -271,7 +271,6 @@ TEST_F(WorkspaceManagerTest, SingleMaximizeWindow) { |
| // Restore the window. |
| w1->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_NORMAL); |
| - // Should be 1 workspace for the desktop. |
| ASSERT_EQ("1 active=0", StateString()); |
| EXPECT_EQ(w1.get(), workspaces()[0]->window()->children()[0]); |
| EXPECT_EQ("0,0 250x251", w1->bounds().ToString()); |
| @@ -287,10 +286,10 @@ TEST_F(WorkspaceManagerTest, CloseLastWindowInWorkspace) { |
| w2->Show(); |
| wm::ActivateWindow(w1.get()); |
| - // Should be 1 workspace and 1 pending, !maximized and maximized. The second |
| - // workspace is pending since the window wasn't active. |
| - ASSERT_EQ("1 P=M1 active=0", StateString()); |
| - EXPECT_EQ(w1.get(), workspaces()[0]->window()->children()[0]); |
| + // Maximized window will be in the same workspace. |
| + ASSERT_EQ("2 active=0", StateString()); |
| + EXPECT_EQ(w1.get(), workspaces()[0]->window()->children()[1]); |
| + EXPECT_EQ(w2.get(), workspaces()[0]->window()->children()[0]); |
| // Close w2. |
| w2.reset(); |
| @@ -316,9 +315,8 @@ TEST_F(WorkspaceManagerTest, AddMaximizedWindowWhenEmpty) { |
| EXPECT_EQ(work_area.width(), w1->bounds().width()); |
| EXPECT_EQ(work_area.height(), w1->bounds().height()); |
| - // Should be 2 workspaces (since we always keep the desktop). |
| - ASSERT_EQ("0 M1 active=1", StateString()); |
| - EXPECT_EQ(w1.get(), workspaces()[1]->window()->children()[0]); |
| + ASSERT_EQ("1 active=0", StateString()); |
| + EXPECT_EQ(w1.get(), workspaces()[0]->window()->children()[0]); |
| } |
| // Assertions around two windows and toggling one to be maximized. |
| @@ -336,16 +334,16 @@ TEST_F(WorkspaceManagerTest, MaximizeWithNormalWindow) { |
| w2->Show(); |
| wm::ActivateWindow(w2.get()); |
| - // Should now be two workspaces. |
| - ASSERT_EQ("1 M1 active=1", StateString()); |
| + // Both w1 and w2 should be in the same workspace. |
| + ASSERT_EQ("2 active=0", StateString()); |
| EXPECT_EQ(w1.get(), workspaces()[0]->window()->children()[0]); |
| - EXPECT_EQ(w2.get(), workspaces()[1]->window()->children()[0]); |
| + EXPECT_EQ(w2.get(), workspaces()[0]->window()->children()[1]); |
| gfx::Rect work_area(ScreenAsh::GetMaximizedWindowBoundsInParent(w1.get())); |
| EXPECT_EQ(work_area.width(), w2->bounds().width()); |
| EXPECT_EQ(work_area.height(), w2->bounds().height()); |
| - // Restore w2, which should then go back to one workspace. |
| + // Restore w2 |
| w2->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_NORMAL); |
| ASSERT_EQ("2 active=0", StateString()); |
| EXPECT_EQ(w1.get(), workspaces()[0]->window()->children()[0]); |
| @@ -363,20 +361,20 @@ TEST_F(WorkspaceManagerTest, TwoMaximized) { |
| w1->Show(); |
| wm::ActivateWindow(w1.get()); |
| w1->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MAXIMIZED); |
|
sky
2013/06/07 19:44:35
I tend to think that for all these tests you need
Jun Mukai
2013/06/08 00:00:39
Done.
|
| - ASSERT_EQ("1 M1 active=1", StateString()); |
| + ASSERT_EQ("2 active=0", StateString()); |
| w2->SetBounds(gfx::Rect(0, 0, 50, 51)); |
| w2->Show(); |
| wm::ActivateWindow(w2.get()); |
| - ASSERT_EQ("1 M1 active=0", StateString()); |
| + ASSERT_EQ("2 active=0", StateString()); |
| w2->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MAXIMIZED); |
| EXPECT_TRUE(wm::IsActiveWindow(w2.get())); |
| - ASSERT_EQ("0 M1 M1 active=2", StateString()); |
| + ASSERT_EQ("2 active=0", StateString()); |
| // The last stacked window (|w2|) should be last since it was maximized last. |
| - EXPECT_EQ(w1.get(), workspaces()[1]->window()->children()[0]); |
| - EXPECT_EQ(w2.get(), workspaces()[2]->window()->children()[0]); |
| + EXPECT_EQ(w1.get(), workspaces()[0]->window()->children()[0]); |
| + EXPECT_EQ(w2.get(), workspaces()[0]->window()->children()[1]); |
| } |
| // Get the index of the layer inside its parent. This index can be used to |
| @@ -405,7 +403,7 @@ TEST_F(WorkspaceManagerTest, MaximizeSecondInWorkspace) { |
| w1->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MAXIMIZED); |
| wm::ActivateWindow(w1.get()); |
| // There are two workspaces: A normal and a maximized one. |
| - ASSERT_EQ("0 M1 active=1", StateString()); |
| + ASSERT_EQ("1 active=0", StateString()); |
| // Create a second window and make it part of the maximized workspace. |
| scoped_ptr<Window> w2(CreateAppTestWindow(w1->parent())); |
| @@ -414,7 +412,7 @@ TEST_F(WorkspaceManagerTest, MaximizeSecondInWorkspace) { |
| wm::ActivateWindow(w2.get()); |
| // There are still two workspaces and two windows in the (maximized) |
| // workspace. |
| - ASSERT_EQ("0 M2 active=1", StateString()); |
| + ASSERT_EQ("2 active=0", StateString()); |
| ASSERT_EQ(w1->layer()->parent()->children()[0], w1->layer()); |
| ASSERT_EQ(w1->layer()->parent()->children()[1], w2->layer()); |
| @@ -424,41 +422,15 @@ TEST_F(WorkspaceManagerTest, MaximizeSecondInWorkspace) { |
| new ui::ScopedAnimationDurationScaleMode( |
| ui::ScopedAnimationDurationScaleMode::FAST_DURATION)); |
| - ui::Layer* old_w2_layer = w2->layer(); |
| - |
| // Maximize the second window and make sure that the workspace changes. |
| w2->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MAXIMIZED); |
| // Check the correct window hierarchy - (|w2|) should be last since it was |
| // maximized last. |
| - ASSERT_EQ("0 M1 M1 active=2", StateString()); |
| - EXPECT_EQ(3U, workspaces().size()); |
| - EXPECT_EQ(w1.get(), workspaces()[1]->window()->children()[0]); |
| - EXPECT_EQ(w2.get(), workspaces()[2]->window()->children()[0]); |
| - |
| - // Check the workspace layer visibility. |
| - EXPECT_EQ(1, workspaces()[1]->window()->layer()->opacity()); |
| - EXPECT_EQ(1, workspaces()[2]->window()->layer()->opacity()); |
| - |
| - // Check that |w2| got a new layer and that the old layer is still visible, |
| - // while the new one is not. Further and foremost the old layer should be a |
| - // member of the workspace's window and it should be the second last of the |
| - // list to be properly stacked while the animation is going on. |
| - EXPECT_NE(w2->layer(), old_w2_layer); |
| - EXPECT_EQ(0, w2->layer()->opacity()); |
| - EXPECT_EQ(1, old_w2_layer->opacity()); |
| - |
| - // For the animation to look right we need the following ordering: |
| - // workspace_1_layer_index < old_layer_index < workspace_2_layer_index. |
| - ASSERT_EQ(workspaces()[1]->window()->parent()->layer(), |
| - old_w2_layer->parent()); |
| - const size_t workspace_1_layer_index = IndexOfLayerInParent( |
| - workspaces()[1]->window()->layer()); |
| - const size_t workspace_2_layer_index = IndexOfLayerInParent( |
| - workspaces()[2]->window()->layer()); |
| - const size_t old_layer_index = IndexOfLayerInParent(old_w2_layer); |
| - EXPECT_LT(workspace_1_layer_index, old_layer_index); |
| - EXPECT_LT(old_layer_index, workspace_2_layer_index); |
| + ASSERT_EQ("2 active=0", StateString()); |
| + EXPECT_EQ(1U, workspaces().size()); |
| + EXPECT_EQ(w1.get(), workspaces()[0]->window()->children()[0]); |
| + EXPECT_EQ(w2.get(), workspaces()[0]->window()->children()[1]); |
| } |
| // Makes sure requests to change the bounds of a normal window go through. |
| @@ -495,7 +467,7 @@ TEST_F(WorkspaceManagerTest, SingleFullscreenWindow) { |
| wm::ActivateWindow(w1.get()); |
| // Should be 2 workspaces, normal and maximized. |
| - ASSERT_EQ("0 M1 active=1", StateString()); |
| + ASSERT_EQ("0 F1 active=1", StateString()); |
| EXPECT_EQ(w1.get(), workspaces()[1]->window()->children()[0]); |
| EXPECT_EQ(GetFullscreenBounds(w1.get()).width(), w1->bounds().width()); |
| EXPECT_EQ(GetFullscreenBounds(w1.get()).height(), w1->bounds().height()); |
| @@ -513,7 +485,7 @@ TEST_F(WorkspaceManagerTest, SingleFullscreenWindow) { |
| // Back to fullscreen. |
| w1->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_FULLSCREEN); |
| - ASSERT_EQ("0 M1 active=1", StateString()); |
| + ASSERT_EQ("0 F1 active=1", StateString()); |
| EXPECT_EQ(w1.get(), workspaces()[1]->window()->children()[0]); |
| EXPECT_EQ(GetFullscreenBounds(w1.get()).width(), w1->bounds().width()); |
| EXPECT_EQ(GetFullscreenBounds(w1.get()).height(), w1->bounds().height()); |
| @@ -537,14 +509,14 @@ TEST_F(WorkspaceManagerTest, DontShowTransientsOnSwitch) { |
| w3->Show(); |
| wm::ActivateWindow(w3.get()); |
| - EXPECT_FALSE(w1->layer()->IsDrawn()); |
| + EXPECT_TRUE(w1->layer()->IsDrawn()); |
| EXPECT_FALSE(w2->layer()->IsDrawn()); |
| EXPECT_TRUE(w3->layer()->IsDrawn()); |
| wm::ActivateWindow(w1.get()); |
| EXPECT_TRUE(w1->layer()->IsDrawn()); |
| EXPECT_FALSE(w2->layer()->IsDrawn()); |
| - EXPECT_FALSE(w3->layer()->IsDrawn()); |
| + EXPECT_TRUE(w3->layer()->IsDrawn()); |
| } |
| // Persists-across-all-workspace flag should not cause a transient child |
| @@ -557,7 +529,7 @@ TEST_F(WorkspaceManagerTest, PersistsTransientChildStayInSameWorkspace) { |
| w1->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MAXIMIZED); |
| w1->Show(); |
| wm::ActivateWindow(w1.get()); |
| - ASSERT_EQ("0 M1 active=1", StateString()); |
| + ASSERT_EQ("1 active=0", StateString()); |
| scoped_ptr<Window> w2(CreateTestWindowUnparented()); |
| w1->AddTransientChild(w2.get()); |
| @@ -568,7 +540,7 @@ TEST_F(WorkspaceManagerTest, PersistsTransientChildStayInSameWorkspace) { |
| w2->Show(); |
| wm::ActivateWindow(w2.get()); |
| - ASSERT_EQ("0 M2 active=1", StateString()); |
| + ASSERT_EQ("2 active=0", StateString()); |
| } |
| // Assertions around minimizing a single window. |
| @@ -598,23 +570,23 @@ TEST_F(WorkspaceManagerTest, MinimizeMaximizedWindow) { |
| w2->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MAXIMIZED); |
| w2->Show(); |
| wm::ActivateWindow(w2.get()); |
| - ASSERT_EQ("1 M1 active=1", StateString()); |
| + ASSERT_EQ("2 active=0", StateString()); |
| // Minimize w2. |
| w2->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MINIMIZED); |
| - ASSERT_EQ("1 P=M1 active=0", StateString()); |
| + ASSERT_EQ("2 active=0", StateString()); |
| EXPECT_TRUE(w1->layer()->IsDrawn()); |
| EXPECT_FALSE(w2->layer()->IsDrawn()); |
| // Show the window, which should trigger unminimizing. |
| w2->Show(); |
| - ASSERT_EQ("1 P=M1 active=0", StateString()); |
| + ASSERT_EQ("2 active=0", StateString()); |
| wm::ActivateWindow(w2.get()); |
| - ASSERT_EQ("1 M1 active=1", StateString()); |
| + ASSERT_EQ("2 active=0", StateString()); |
| EXPECT_TRUE(wm::IsWindowMaximized(w2.get())); |
| - EXPECT_FALSE(w1->layer()->IsDrawn()); |
| + EXPECT_TRUE(w1->layer()->IsDrawn()); |
| EXPECT_TRUE(w2->layer()->IsDrawn()); |
| // Minimize the window, which should hide the window and activate another. |
| @@ -726,7 +698,7 @@ TEST_F(WorkspaceManagerTest, ShelfStateUpdated) { |
| w2->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MAXIMIZED); |
| w2->Show(); |
| wm::ActivateWindow(w2.get()); |
| - EXPECT_EQ(1, active_index()); |
| + EXPECT_EQ(0, active_index()); |
| EXPECT_EQ(SHELF_AUTO_HIDE, shelf->visibility_state()); |
| EXPECT_EQ(SHELF_AUTO_HIDE_HIDDEN, shelf->auto_hide_state()); |
| EXPECT_EQ("0,1 101x102", w1->bounds().ToString()); |
| @@ -742,7 +714,7 @@ TEST_F(WorkspaceManagerTest, ShelfStateUpdated) { |
| // Switch to w2. |
| wm::ActivateWindow(w2.get()); |
| - EXPECT_EQ(1, active_index()); |
| + EXPECT_EQ(0, active_index()); |
| EXPECT_EQ(SHELF_AUTO_HIDE, shelf->visibility_state()); |
| EXPECT_EQ(SHELF_AUTO_HIDE_HIDDEN, shelf->auto_hide_state()); |
| EXPECT_EQ("0,1 101x102", w1->bounds().ToString()); |
| @@ -759,8 +731,13 @@ TEST_F(WorkspaceManagerTest, ShelfStateUpdated) { |
| w1->SetBounds(touches_shelf_bounds); |
| EXPECT_FALSE(GetWindowOverlapsShelf()); |
| - // Activate w1. Since w1 is visible the overlap state should be true. |
| + // Activate w1. Although w1 is visible, the overlap state is still false since |
| + // w2 is maximized. |
| wm::ActivateWindow(w1.get()); |
| + EXPECT_FALSE(GetWindowOverlapsShelf()); |
| + |
| + // Restore w2. |
| + w2->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_NORMAL); |
| EXPECT_TRUE(GetWindowOverlapsShelf()); |
| } |
| @@ -771,7 +748,7 @@ TEST_F(WorkspaceManagerTest, PersistAcrossAllWorkspaces) { |
| w1->Show(); |
| w1->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MAXIMIZED); |
| wm::ActivateWindow(w1.get()); |
| - ASSERT_EQ("0 M1 active=1", StateString()); |
| + ASSERT_EQ("1 active=0", StateString()); |
| // Create a window that persists across all workspaces. It should be placed in |
| // the current maximized workspace. |
| @@ -780,34 +757,34 @@ TEST_F(WorkspaceManagerTest, PersistAcrossAllWorkspaces) { |
| w2.get(), |
| WINDOW_PERSISTS_ACROSS_ALL_WORKSPACES_VALUE_YES); |
| w2->Show(); |
| - ASSERT_EQ("1 M1 active=1", StateString()); |
| + ASSERT_EQ("2 active=0", StateString()); |
| // Activate w2, which should move it to the 2nd workspace. |
| wm::ActivateWindow(w2.get()); |
| - ASSERT_EQ("0 M2 active=1", StateString()); |
| + ASSERT_EQ("2 active=0", StateString()); |
| // Restoring w2 should drop the persists window back to the desktop, and drop |
| // it to the bottom of the stack. |
| w1->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_NORMAL); |
| ASSERT_EQ("2 active=0", StateString()); |
| - EXPECT_EQ(w2.get(), workspaces()[0]->window()->children()[0]); |
| - EXPECT_EQ(w1.get(), workspaces()[0]->window()->children()[1]); |
| + EXPECT_EQ(w2.get(), workspaces()[0]->window()->children()[1]); |
| + EXPECT_EQ(w1.get(), workspaces()[0]->window()->children()[0]); |
| // Repeat, but this time minimize. The minimized window should end up in |
| // pending. |
| w1->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MAXIMIZED); |
| - ASSERT_EQ("1 P=M1 active=0", StateString()); |
| + ASSERT_EQ("2 active=0", StateString()); |
| w2.reset(CreateTestWindow()); |
| SetPersistsAcrossAllWorkspaces( |
| w2.get(), |
| WINDOW_PERSISTS_ACROSS_ALL_WORKSPACES_VALUE_YES); |
| w2->Show(); |
| - ASSERT_EQ("1 P=M1 active=0", StateString()); |
| + ASSERT_EQ("2 active=0", StateString()); |
| wm::ActivateWindow(w2.get()); |
| - ASSERT_EQ("1 P=M1 active=0", StateString()); |
| + ASSERT_EQ("2 active=0", StateString()); |
| w1->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MINIMIZED); |
| - ASSERT_EQ("1 P=M1 active=0", StateString()); |
| - EXPECT_EQ(w2.get(), workspaces()[0]->window()->children()[0]); |
| + ASSERT_EQ("2 active=0", StateString()); |
| + EXPECT_EQ(w2.get(), workspaces()[0]->window()->children()[1]); |
| } |
| // Verifies that when a window persists across all workpaces is activated that |
| @@ -826,16 +803,16 @@ TEST_F(WorkspaceManagerTest, ActivatePersistAcrossAllWorkspacesWhenNotActive) { |
| w1->Show(); |
| w1->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MAXIMIZED); |
| wm::ActivateWindow(w1.get()); |
| - ASSERT_EQ("1 M1 active=1", StateString()); |
| + ASSERT_EQ("2 active=0", StateString()); |
| // Activate the persists across all workspace window. It should move to the |
| // current workspace. |
| wm::ActivateWindow(w2.get()); |
| - ASSERT_EQ("0 M2 active=1", StateString()); |
| + ASSERT_EQ("2 active=0", StateString()); |
| // The window that persists across all workspaces should be moved to the top |
| // of the stacking order. |
| - EXPECT_EQ(w1.get(), workspaces()[1]->window()->children()[0]); |
| - EXPECT_EQ(w2.get(), workspaces()[1]->window()->children()[1]); |
| + EXPECT_EQ(w1.get(), workspaces()[0]->window()->children()[0]); |
| + EXPECT_EQ(w2.get(), workspaces()[0]->window()->children()[1]); |
| EXPECT_TRUE(wm::IsActiveWindow(w2.get())); |
| } |
| @@ -900,22 +877,22 @@ TEST_F(WorkspaceManagerTest, GetWindowStateWithUnmanagedFullscreenWindow) { |
| w2->Show(); |
| wm::ActivateWindow(w2.get()); |
| - ASSERT_EQ("1 M1 active=1", StateString()); |
| + ASSERT_EQ("1 F1 active=1", StateString()); |
| EXPECT_EQ(SHELF_HIDDEN, shelf->visibility_state()); |
| EXPECT_EQ(WORKSPACE_WINDOW_STATE_FULL_SCREEN, manager_->GetWindowState()); |
| w2->Hide(); |
| - ASSERT_EQ("1 P=M1 active=0", StateString()); |
| + ASSERT_EQ("1 P=F1 active=0", StateString()); |
| EXPECT_EQ(SHELF_VISIBLE, shelf->visibility_state()); |
| w2->Show(); |
| - ASSERT_EQ("1 P=M1 active=0", StateString()); |
| + ASSERT_EQ("1 P=F1 active=0", StateString()); |
| EXPECT_EQ(SHELF_VISIBLE, shelf->visibility_state()); |
| EXPECT_EQ(WORKSPACE_WINDOW_STATE_DEFAULT, manager_->GetWindowState()); |
| wm::ActivateWindow(w2.get()); |
| - ASSERT_EQ("1 M1 active=1", StateString()); |
| + ASSERT_EQ("1 F1 active=1", StateString()); |
| EXPECT_EQ(SHELF_HIDDEN, shelf->visibility_state()); |
| EXPECT_EQ(WORKSPACE_WINDOW_STATE_FULL_SCREEN, manager_->GetWindowState()); |
| @@ -978,7 +955,7 @@ TEST_F(WorkspaceManagerTest, MaximizeDontPersistEndsUpInOwnWorkspace) { |
| // Maximize should trigger containing the window. |
| w1->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MAXIMIZED); |
| - ASSERT_EQ("0 P=M1 active=0", StateString()); |
| + ASSERT_EQ("1 active=0", StateString()); |
| // And resetting to normal should remove it. |
| w1->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_NORMAL); |
| @@ -1009,7 +986,7 @@ TEST_F(WorkspaceManagerTest, MoveTransientOnMaximize) { |
| ASSERT_EQ("2 active=0", StateString()); |
| w1->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MAXIMIZED); |
| - ASSERT_EQ("0 M2 active=1", StateString()); |
| + ASSERT_EQ("2 active=0", StateString()); |
| EXPECT_TRUE(wm::IsActiveWindow(w1.get())); |
| // Create another transient child of |w1|. We do this unparented, set up the |
| @@ -1019,12 +996,12 @@ TEST_F(WorkspaceManagerTest, MoveTransientOnMaximize) { |
| w1->AddTransientChild(w3.get()); |
| SetDefaultParentByPrimaryRootWindow(w3.get()); |
| w3->Show(); |
| - ASSERT_EQ("0 M3 active=1", StateString()); |
| + ASSERT_EQ("3 active=0", StateString()); |
| // Minimize the window. All the transients are hidden as a result, so it ends |
| // up in pending. |
| w1->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MINIMIZED); |
| - ASSERT_EQ("0 P=M3 active=0", StateString()); |
| + ASSERT_EQ("3 active=0", StateString()); |
| // Restore and everything should go back to the first workspace. |
| w1->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_NORMAL); |
| @@ -1045,19 +1022,19 @@ TEST_F(WorkspaceManagerTest, VisibilityTests) { |
| w2->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MAXIMIZED); |
| EXPECT_TRUE(w2->IsVisible()); |
| EXPECT_EQ(1.0f, w2->layer()->GetCombinedOpacity()); |
| - EXPECT_FALSE(w1->IsVisible()); |
| + EXPECT_TRUE(w1->IsVisible()); |
| // Switch to w1. |w1| should be visible and |w2| hidden. |
| wm::ActivateWindow(w1.get()); |
| EXPECT_TRUE(w1->IsVisible()); |
| EXPECT_EQ(1.0f, w1->layer()->GetCombinedOpacity()); |
| - EXPECT_FALSE(w2->IsVisible()); |
| + EXPECT_TRUE(w2->IsVisible()); |
| // Switch back to |w2|. |
| wm::ActivateWindow(w2.get()); |
| EXPECT_TRUE(w2->IsVisible()); |
| EXPECT_EQ(1.0f, w2->layer()->GetCombinedOpacity()); |
| - EXPECT_FALSE(w1->IsVisible()); |
| + EXPECT_TRUE(w1->IsVisible()); |
| // Restore |w2|, both windows should be visible. |
| w2->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_NORMAL); |
| @@ -1285,9 +1262,9 @@ TEST_F(WorkspaceManagerTest, TrackedByWorkspace) { |
| // workspace. |
| SetTrackedByWorkspace(w2.get(), true); |
| EXPECT_TRUE(wm::IsActiveWindow(w2.get())); |
| - EXPECT_FALSE(w1->IsVisible()); |
| + EXPECT_TRUE(w1->IsVisible()); |
| EXPECT_TRUE(w2->IsVisible()); |
| - EXPECT_NE(w1->parent(), w2->parent()); |
| + EXPECT_EQ(w1->parent(), w2->parent()); |
| } |
| // Verifies a window marked as persisting across all workspaces ends up in its |
| @@ -1310,11 +1287,11 @@ TEST_F(WorkspaceManagerTest, DeactivateDropsToDesktop) { |
| w2->Show(); |
| wm::ActivateWindow(w2.get()); |
| EXPECT_EQ(w1->parent(), w2->parent()); |
| - ASSERT_EQ("0 M2 active=1", StateString()); |
| + ASSERT_EQ("2 active=0", StateString()); |
| // Activate |w1|, should result in dropping |w2| to the desktop. |
| wm::ActivateWindow(w1.get()); |
| - ASSERT_EQ("1 M1 active=1", StateString()); |
| + ASSERT_EQ("2 active=0", StateString()); |
| } |
| // Test the basic auto placement of one and or two windows in a "simulated |
| @@ -1755,14 +1732,14 @@ TEST_F(WorkspaceManagerTest, DragMaximizedNonTrackedWindow) { |
| // There should be two workspace, one for the desktop and one for the |
| // maximized window with the maximized active. |
| - EXPECT_EQ("0 M1 active=1", StateString()); |
| + EXPECT_EQ("1 active=0", StateString()); |
| generator.PressLeftButton(); |
| generator.MoveMouseTo(100, 100); |
| // The bounds shouldn't change (drag should result in nothing happening |
| // now. |
| EXPECT_EQ(max_bounds.ToString(), w1->bounds().ToString()); |
| - EXPECT_EQ("0 M1 active=1", StateString()); |
| + EXPECT_EQ("1 active=0", StateString()); |
| generator.ReleaseLeftButton(); |
| EXPECT_EQ(0, observer.change_count()); |
| @@ -1775,12 +1752,12 @@ TEST_F(WorkspaceManagerTest, DragMaximizedNonTrackedWindow) { |
| EXPECT_EQ(gfx::Rect(max_bounds.x() + 100, max_bounds.y() + 100, |
| max_bounds.width(), max_bounds.height()).ToString(), |
| w1->bounds().ToString()); |
| - EXPECT_EQ("0 M1 active=1", StateString()); |
| + EXPECT_EQ("1 active=0", StateString()); |
| generator.ReleaseLeftButton(); |
| SetTrackedByWorkspace(w1.get(), true); |
| // Marking the window tracked again should snap back to origin. |
| - EXPECT_EQ("0 M1 active=1", StateString()); |
| + EXPECT_EQ("1 active=0", StateString()); |
| EXPECT_EQ(max_bounds.ToString(), w1->bounds().ToString()); |
| EXPECT_EQ(0, observer.change_count()); |