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

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

Issue 11017079: Remove Shell::shelf()|status_area_widget()|launcher() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 2 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 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

Powered by Google App Engine
This is Rietveld 408576698