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 2b4f08abf0900428f0acceb93b811033c22fee70..5f67615ac2231156d48dde84a671e3205c7382b2 100644 |
--- a/ash/wm/workspace/workspace_manager_unittest.cc |
+++ b/ash/wm/workspace/workspace_manager_unittest.cc |
@@ -5,6 +5,7 @@ |
#include "ash/wm/workspace/workspace_manager.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" |
@@ -30,14 +31,6 @@ using aura::Window; |
namespace ash { |
namespace internal { |
-namespace { |
- |
-bool GetWindowOverlapsShelf() { |
- return Shell::GetInstance()->shelf()->window_overlaps_shelf(); |
-} |
- |
-} // namespace |
- |
class WorkspaceManagerTest : public test::AshTestBase { |
public: |
WorkspaceManagerTest() : manager_(NULL) {} |
@@ -78,6 +71,14 @@ class WorkspaceManagerTest : public test::AshTestBase { |
return manager_->active_workspace_; |
} |
+ ShelfLayoutManager* shelf_layout_manager() { |
+ return Shell::GetPrimaryRootWindowController()->shelf(); |
+ } |
+ |
+ bool GetWindowOverlapsShelf() { |
+ return shelf_layout_manager()->window_overlaps_shelf(); |
+ } |
+ |
Workspace* FindBy(aura::Window* window) const { |
return manager_->FindBy(window); |
} |
@@ -470,7 +471,7 @@ TEST_F(WorkspaceManagerTest, ShelfStateUpdated) { |
// Two windows, w1 normal, w2 maximized. |
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); |
@@ -622,7 +623,7 @@ TEST_F(WorkspaceManagerTest, 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(WorkspaceManagerTest, 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()); |
@@ -654,7 +655,7 @@ TEST_F(WorkspaceManagerTest, GetWindowStateWithUnmanagedFullscreenWindow) { |
// window rather than a normal window. |
TEST_F(WorkspaceManagerTest, |
GetWindowStateWithUnmanagedFullscreenWindowWithMaximized) { |
- ShelfLayoutManager* shelf = Shell::GetInstance()->shelf(); |
+ ShelfLayoutManager* shelf = shelf_layout_manager(); |
shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_NEVER); |
// Make the first window maximized. |
@@ -733,8 +734,8 @@ TEST_F(WorkspaceManagerTest, 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()); |
} |
} // namespace internal |