| Index: ash/wm/workspace/workspace_manager2_unittest.cc
|
| diff --git a/ash/wm/workspace/workspace_manager2_unittest.cc b/ash/wm/workspace/workspace_manager2_unittest.cc
|
| index 4956a7d2c6f038e4a7524e95a8e40466adbeece8..6f3b217422d62b3e1cf13c37ad6473ec5a4efbe0 100644
|
| --- a/ash/wm/workspace/workspace_manager2_unittest.cc
|
| +++ b/ash/wm/workspace/workspace_manager2_unittest.cc
|
| @@ -5,6 +5,7 @@
|
| #include "ash/wm/workspace/workspace_manager2.h"
|
|
|
| #include "ash/ash_switches.h"
|
| +#include "ash/root_window_controller.h"
|
| #include "ash/screen_ash.h"
|
| #include "ash/shell.h"
|
| #include "ash/shell_window_ids.h"
|
| @@ -34,14 +35,6 @@ using aura::Window;
|
| namespace ash {
|
| namespace internal {
|
|
|
| -namespace {
|
| -
|
| -bool GetWindowOverlapsShelf() {
|
| - return Shell::GetInstance()->shelf()->window_overlaps_shelf();
|
| -}
|
| -
|
| -} // namespace
|
| -
|
| class WorkspaceManager2Test : public test::AshTestBase {
|
| public:
|
| WorkspaceManager2Test() : manager_(NULL) {}
|
| @@ -81,6 +74,14 @@ class WorkspaceManager2Test : public test::AshTestBase {
|
| return manager_->active_workspace_;
|
| }
|
|
|
| + ShelfLayoutManager* shelf_layout_manager() {
|
| + return Shell::GetPrimaryRootWindowController()->shelf();
|
| + }
|
| +
|
| + bool GetWindowOverlapsShelf() {
|
| + return shelf_layout_manager()->window_overlaps_shelf();
|
| + }
|
| +
|
| Workspace2* FindBy(aura::Window* window) const {
|
| return manager_->FindBy(window);
|
| }
|
| @@ -460,7 +461,7 @@ TEST_F(WorkspaceManager2Test, ShelfStateUpdated) {
|
|
|
| scoped_ptr<Window> w1(CreateTestWindow());
|
| const gfx::Rect w1_bounds(0, 1, 101, 102);
|
| - ShelfLayoutManager* shelf = Shell::GetInstance()->shelf();
|
| + ShelfLayoutManager* shelf = shelf_layout_manager();
|
| shelf->SetAutoHideBehavior(ash::SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS);
|
| const gfx::Rect touches_shelf_bounds(
|
| 0, shelf->GetIdealBounds().y() - 10, 101, 102);
|
| @@ -675,7 +676,7 @@ TEST_F(WorkspaceManager2Test, ShowMinimizedPersistWindow) {
|
| // Test that we report we're in the fullscreen state even if the fullscreen
|
| // window isn't being managed by us (http://crbug.com/123931).
|
| TEST_F(WorkspaceManager2Test, GetWindowStateWithUnmanagedFullscreenWindow) {
|
| - ShelfLayoutManager* shelf = Shell::GetInstance()->shelf();
|
| + ShelfLayoutManager* shelf = shelf_layout_manager();
|
|
|
| // We need to create a regular window first so there's an active workspace.
|
| scoped_ptr<Window> w1(CreateTestWindow());
|
| @@ -718,7 +719,7 @@ TEST_F(WorkspaceManager2Test, GetWindowStateWithUnmanagedFullscreenWindow) {
|
| // window rather than a normal window.
|
| TEST_F(WorkspaceManager2Test,
|
| GetWindowStateWithUnmanagedFullscreenWindowWithMaximized) {
|
| - ShelfLayoutManager* shelf = Shell::GetInstance()->shelf();
|
| + ShelfLayoutManager* shelf = shelf_layout_manager();
|
| shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_NEVER);
|
|
|
| // Make the first window maximized.
|
| @@ -783,8 +784,8 @@ TEST_F(WorkspaceManager2Test, MinimizeResetsVisibility) {
|
| w1->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MAXIMIZED);
|
| w1->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MINIMIZED);
|
| EXPECT_EQ(ShelfLayoutManager::VISIBLE,
|
| - Shell::GetInstance()->shelf()->visibility_state());
|
| - EXPECT_FALSE(Shell::GetInstance()->launcher()->paints_background());
|
| + shelf_layout_manager()->visibility_state());
|
| + EXPECT_FALSE(Launcher::ForPrimaryDisplay()->paints_background());
|
| }
|
|
|
| // Verifies transients are moved when maximizing.
|
| @@ -884,7 +885,7 @@ TEST_F(WorkspaceManager2Test, DontMoveOnSwitch) {
|
| generator.MoveMouseTo(0, 0);
|
|
|
| scoped_ptr<Window> w1(CreateTestWindow());
|
| - ShelfLayoutManager* shelf = Shell::GetInstance()->shelf();
|
| + ShelfLayoutManager* shelf = shelf_layout_manager();
|
| const gfx::Rect touches_shelf_bounds(
|
| 0, shelf->GetIdealBounds().y() - 10, 101, 102);
|
| // Move |w1| to overlap the shelf.
|
| @@ -912,7 +913,7 @@ TEST_F(WorkspaceManager2Test, MoveOnSwitch) {
|
| generator.MoveMouseTo(0, 0);
|
|
|
| scoped_ptr<Window> w1(CreateTestWindow());
|
| - ShelfLayoutManager* shelf = Shell::GetInstance()->shelf();
|
| + ShelfLayoutManager* shelf = shelf_layout_manager();
|
| const gfx::Rect w1_bounds(0, shelf->GetIdealBounds().y(), 100, 200);
|
| // Move |w1| so that the top edge is the same as the top edge of the shelf.
|
| w1->SetBounds(w1_bounds);
|
| @@ -992,7 +993,7 @@ class DontCrashOnChangeAndActivateDelegate
|
| // . show the window and during the bounds change activate it.
|
| TEST_F(WorkspaceManager2Test, DontCrashOnChangeAndActivate) {
|
| // Force the shelf
|
| - ShelfLayoutManager* shelf = Shell::GetInstance()->shelf();
|
| + ShelfLayoutManager* shelf = shelf_layout_manager();
|
| shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_NEVER);
|
|
|
| DontCrashOnChangeAndActivateDelegate delegate;
|
|
|