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

Unified Diff: ash/shelf/shelf_layout_manager_unittest.cc

Issue 1608053002: Remove now-unnecessary wrappers around gfx::Screen::GetScreen() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@metro-mode-5
Patch Set: cros Created 4 years, 11 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/shelf/shelf_layout_manager.cc ('k') | ash/shelf/shelf_window_watcher.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/shelf/shelf_layout_manager_unittest.cc
diff --git a/ash/shelf/shelf_layout_manager_unittest.cc b/ash/shelf/shelf_layout_manager_unittest.cc
index d4cd5c31c4dd76aad59dd0bcf2549aac7e16f7ec..33802dcb192a41078ba1885fca9d92d260000d42 100644
--- a/ash/shelf/shelf_layout_manager_unittest.cc
+++ b/ash/shelf/shelf_layout_manager_unittest.cc
@@ -717,7 +717,7 @@ TEST_F(ShelfLayoutManagerTest, MAYBE_SetVisible) {
gfx::Rect shelf_bounds(
shelf->GetWindowBoundsInScreen());
int shelf_height = manager->GetIdealBounds().height();
- gfx::Screen* screen = Shell::GetScreen();
+ gfx::Screen* screen = gfx::Screen::GetScreen();
gfx::Display display = screen->GetDisplayNearestWindow(
Shell::GetPrimaryRootWindow());
ASSERT_NE(-1, display.id());
@@ -814,15 +814,15 @@ TEST_F(ShelfLayoutManagerTest, LayoutShelfWhileAnimating) {
SetState(shelf->shelf_layout_manager(), SHELF_HIDDEN);
shelf->shelf_layout_manager()->LayoutShelf();
EXPECT_EQ(SHELF_HIDDEN, shelf->shelf_layout_manager()->visibility_state());
- gfx::Display display = Shell::GetScreen()->GetDisplayNearestWindow(
+ gfx::Display display = gfx::Screen::GetScreen()->GetDisplayNearestWindow(
Shell::GetPrimaryRootWindow());
EXPECT_EQ(0, display.GetWorkAreaInsets().bottom());
// Make sure the bounds of the two widgets changed.
EXPECT_GE(shelf->GetNativeView()->bounds().y(),
- Shell::GetScreen()->GetPrimaryDisplay().bounds().bottom());
+ gfx::Screen::GetScreen()->GetPrimaryDisplay().bounds().bottom());
EXPECT_GE(shelf->status_area_widget()->GetNativeView()->bounds().y(),
- Shell::GetScreen()->GetPrimaryDisplay().bounds().bottom());
+ gfx::Screen::GetScreen()->GetPrimaryDisplay().bounds().bottom());
}
// Test that switching to a different visibility state does not restart the
@@ -898,8 +898,10 @@ TEST_F(ShelfLayoutManagerTest, MAYBE_AutoHide) {
EXPECT_EQ(root->bounds().bottom() - ShelfLayoutManager::kAutoHideSize,
GetShelfWidget()->GetWindowBoundsInScreen().y());
EXPECT_EQ(root->bounds().bottom() - ShelfLayoutManager::kAutoHideSize,
- Shell::GetScreen()->GetDisplayNearestWindow(
- root).work_area().bottom());
+ gfx::Screen::GetScreen()
+ ->GetDisplayNearestWindow(root)
+ .work_area()
+ .bottom());
// Move the mouse to the bottom of the screen.
generator.MoveMouseTo(0, root->bounds().bottom() - 1);
@@ -911,8 +913,10 @@ TEST_F(ShelfLayoutManagerTest, MAYBE_AutoHide) {
EXPECT_EQ(root->bounds().bottom() - shelf->GetIdealBounds().height(),
GetShelfWidget()->GetWindowBoundsInScreen().y());
EXPECT_EQ(root->bounds().bottom() - ShelfLayoutManager::kAutoHideSize,
- Shell::GetScreen()->GetDisplayNearestWindow(
- root).work_area().bottom());
+ gfx::Screen::GetScreen()
+ ->GetDisplayNearestWindow(root)
+ .work_area()
+ .bottom());
// Move mouse back up.
generator.MoveMouseTo(0, 0);
@@ -977,7 +981,8 @@ TEST_F(ShelfLayoutManagerTest, AutoHideShelfOnScreenBoundary) {
generator.MoveMouseTo(right_edge - 1, y);
UpdateAutoHideStateNow();
EXPECT_EQ(SHELF_AUTO_HIDE_SHOWN, shelf->auto_hide_state());
- EXPECT_EQ(right_edge - 1, Shell::GetScreen()->GetCursorScreenPoint().x());
+ EXPECT_EQ(right_edge - 1,
+ gfx::Screen::GetScreen()->GetCursorScreenPoint().x());
// Moving the mouse off the light bar should hide the shelf.
generator.MoveMouseTo(right_edge - 50, y);
@@ -990,7 +995,8 @@ TEST_F(ShelfLayoutManagerTest, AutoHideShelfOnScreenBoundary) {
generator.MoveMouseTo(right_edge - 1, y);
generator.MoveMouseTo(right_edge, y);
UpdateAutoHideStateNow();
- EXPECT_NE(right_edge - 1, Shell::GetScreen()->GetCursorScreenPoint().x());
+ EXPECT_NE(right_edge - 1,
+ gfx::Screen::GetScreen()->GetCursorScreenPoint().x());
EXPECT_EQ(SHELF_AUTO_HIDE_SHOWN, shelf->auto_hide_state());
// Hide the shelf.
@@ -1103,7 +1109,7 @@ TEST_F(ShelfLayoutManagerTest, SetAutoHideBehavior) {
widget->Show();
aura::Window* window = widget->GetNativeWindow();
gfx::Rect display_bounds(
- Shell::GetScreen()->GetDisplayNearestWindow(window).bounds());
+ gfx::Screen::GetScreen()->GetDisplayNearestWindow(window).bounds());
shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS);
EXPECT_EQ(SHELF_AUTO_HIDE, shelf->visibility_state());
@@ -1113,14 +1119,18 @@ TEST_F(ShelfLayoutManagerTest, SetAutoHideBehavior) {
widget->Maximize();
EXPECT_EQ(SHELF_VISIBLE, shelf->visibility_state());
- EXPECT_EQ(Shell::GetScreen()->GetDisplayNearestWindow(
- window).work_area().bottom(),
+ EXPECT_EQ(gfx::Screen::GetScreen()
+ ->GetDisplayNearestWindow(window)
+ .work_area()
+ .bottom(),
widget->GetWorkAreaBoundsInScreen().bottom());
shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS);
EXPECT_EQ(SHELF_AUTO_HIDE, shelf->visibility_state());
- EXPECT_EQ(Shell::GetScreen()->GetDisplayNearestWindow(
- window).work_area().bottom(),
+ EXPECT_EQ(gfx::Screen::GetScreen()
+ ->GetDisplayNearestWindow(window)
+ .work_area()
+ .bottom(),
widget->GetWorkAreaBoundsInScreen().bottom());
ui::ScopedAnimationDurationScaleMode animation_duration(
@@ -1132,8 +1142,10 @@ TEST_F(ShelfLayoutManagerTest, SetAutoHideBehavior) {
StepWidgetLayerAnimatorToEnd(shelf_widget);
StepWidgetLayerAnimatorToEnd(shelf_widget->status_area_widget());
EXPECT_EQ(SHELF_VISIBLE, shelf->visibility_state());
- EXPECT_EQ(Shell::GetScreen()->GetDisplayNearestWindow(
- window).work_area().bottom(),
+ EXPECT_EQ(gfx::Screen::GetScreen()
+ ->GetDisplayNearestWindow(window)
+ .work_area()
+ .bottom(),
widget->GetWorkAreaBoundsInScreen().bottom());
}
@@ -1157,7 +1169,7 @@ TEST_F(ShelfLayoutManagerTest, DimmingBehavior) {
widget->Show();
aura::Window* window = widget->GetNativeWindow();
gfx::Rect display_bounds(
- Shell::GetScreen()->GetDisplayNearestWindow(window).bounds());
+ gfx::Screen::GetScreen()->GetDisplayNearestWindow(window).bounds());
gfx::Point off_shelf = display_bounds.CenterPoint();
gfx::Point on_shelf =
@@ -1288,7 +1300,7 @@ TEST_F(ShelfLayoutManagerTest, DimmingBehaviorWithMenus) {
widget->Show();
aura::Window* window = widget->GetNativeWindow();
gfx::Rect display_bounds(
- Shell::GetScreen()->GetDisplayNearestWindow(window).bounds());
+ gfx::Screen::GetScreen()->GetDisplayNearestWindow(window).bounds());
// After maximization, the shelf should be visible and the dimmer created.
widget->Maximize();
@@ -1714,7 +1726,7 @@ TEST_F(ShelfLayoutManagerTest, MAYBE_SetAlignment) {
shelf->SetAlignment(SHELF_ALIGNMENT_LEFT);
gfx::Rect shelf_bounds(
GetShelfWidget()->GetWindowBoundsInScreen());
- const gfx::Screen* screen = Shell::GetScreen();
+ const gfx::Screen* screen = gfx::Screen::GetScreen();
gfx::Display display =
screen->GetDisplayNearestWindow(Shell::GetPrimaryRootWindow());
ASSERT_NE(-1, display.id());
« no previous file with comments | « ash/shelf/shelf_layout_manager.cc ('k') | ash/shelf/shelf_window_watcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698