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

Unified Diff: ash/wm/shelf_layout_manager_unittest.cc

Issue 9689027: MonitorManager to manage multiple monitors. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync Created 8 years, 9 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
« no previous file with comments | « ash/wm/shelf_layout_manager.cc ('k') | ash/wm/toplevel_layout_manager_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/shelf_layout_manager_unittest.cc
diff --git a/ash/wm/shelf_layout_manager_unittest.cc b/ash/wm/shelf_layout_manager_unittest.cc
index fbf924db2e8b55ddb9660462c72cfb16c45c16da..03fc06715982b263d18ce6fa837f17bd6bd2d866 100644
--- a/ash/wm/shelf_layout_manager_unittest.cc
+++ b/ash/wm/shelf_layout_manager_unittest.cc
@@ -9,11 +9,15 @@
#include "ash/shell.h"
#include "ash/shell_window_ids.h"
#include "ash/test/ash_test_base.h"
+#include "ui/aura/env.h"
+#include "ui/aura/monitor.h"
+#include "ui/aura/monitor_manager.h"
#include "ui/aura/root_window.h"
#include "ui/aura/window.h"
#include "ui/base/animation/animation_container_element.h"
#include "ui/gfx/compositor/layer_animator.h"
#include "ui/gfx/compositor/layer.h"
+#include "ui/gfx/screen.h"
#include "ui/views/widget/widget.h"
namespace ash {
@@ -50,11 +54,13 @@ TEST_F(ShelfLayoutManagerTest, MAYBE_SetVisible) {
// Force an initial layout.
shelf->LayoutShelf();
ASSERT_TRUE(shelf->visible());
-
- const ash::ScreenAsh* screen = Shell::GetInstance()->screen();
- ASSERT_TRUE(screen);
+ const aura::MonitorManager* manager =
+ aura::Env::GetInstance()->monitor_manager();
+ const aura::Monitor* monitor =
+ manager->GetMonitorNearestWindow(Shell::GetRootWindow());
+ ASSERT_TRUE(monitor);
// Bottom inset should be the max of widget heights.
- EXPECT_EQ(shelf->max_height(), screen->work_area_insets().bottom());
+ EXPECT_EQ(shelf->max_height(), monitor->work_area_insets().bottom());
// Hide the shelf.
shelf->SetVisible(false);
@@ -62,7 +68,7 @@ TEST_F(ShelfLayoutManagerTest, MAYBE_SetVisible) {
StepWidgetLayerAnimatorToEnd(shelf->launcher());
StepWidgetLayerAnimatorToEnd(shelf->status());
EXPECT_FALSE(shelf->visible());
- EXPECT_EQ(0, screen->work_area_insets().bottom());
+ EXPECT_EQ(0, monitor->work_area_insets().bottom());
// Make sure the bounds of the two widgets changed.
EXPECT_GE(shelf->launcher()->GetNativeView()->bounds().y(),
@@ -76,7 +82,7 @@ TEST_F(ShelfLayoutManagerTest, MAYBE_SetVisible) {
StepWidgetLayerAnimatorToEnd(shelf->launcher());
StepWidgetLayerAnimatorToEnd(shelf->status());
EXPECT_TRUE(shelf->visible());
- EXPECT_EQ(shelf->max_height(), screen->work_area_insets().bottom());
+ EXPECT_EQ(shelf->max_height(), monitor->work_area_insets().bottom());
// Make sure the bounds of the two widgets changed.
gfx::Rect launcher_bounds(shelf->launcher()->GetNativeView()->bounds());
@@ -96,14 +102,17 @@ TEST_F(ShelfLayoutManagerTest, LayoutShelfWhileAnimating) {
shelf->LayoutShelf();
ASSERT_TRUE(shelf->visible());
- const ash::ScreenAsh* screen = Shell::GetInstance()->screen();
+ const aura::MonitorManager* manager =
+ aura::Env::GetInstance()->monitor_manager();
+ const aura::Monitor* monitor =
+ manager->GetMonitorNearestWindow(Shell::GetRootWindow());
// Hide the shelf.
shelf->SetVisible(false);
shelf->LayoutShelf();
EXPECT_FALSE(shelf->visible());
EXPECT_FALSE(shelf->visible());
- EXPECT_EQ(0, screen->work_area_insets().bottom());
+ EXPECT_EQ(0, monitor->work_area_insets().bottom());
// Make sure the bounds of the two widgets changed.
EXPECT_GE(shelf->launcher()->GetNativeView()->bounds().y(),
gfx::Screen::GetPrimaryMonitorBounds().bottom());
« no previous file with comments | « ash/wm/shelf_layout_manager.cc ('k') | ash/wm/toplevel_layout_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698