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

Unified Diff: ash/system/toast/toast_manager_unittest.cc

Issue 2215223004: mash: Migrate ShelfLayoutManager ScreenUtil usage to ash common types. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Restore screen bounds conversion for app list. Created 4 years, 4 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/wm/lock_window_state.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/system/toast/toast_manager_unittest.cc
diff --git a/ash/system/toast/toast_manager_unittest.cc b/ash/system/toast/toast_manager_unittest.cc
index 7c79707db9859d97ebd80bc6c4d76b3a899e1142..dd0482d9a3739a6c518e3846ecc8aedb001389ce 100644
--- a/ash/system/toast/toast_manager_unittest.cc
+++ b/ash/system/toast/toast_manager_unittest.cc
@@ -5,6 +5,7 @@
#include "ash/common/shelf/shelf_constants.h"
#include "ash/common/shelf/wm_shelf.h"
#include "ash/common/system/toast/toast_manager.h"
+#include "ash/common/wm/wm_screen_util.h"
#include "ash/common/wm_shell.h"
#include "ash/display/display_manager.h"
#include "ash/screen_util.h"
@@ -161,8 +162,7 @@ TEST_F(ToastManagerTest, PositionWithVisibleBottomShelf) {
EXPECT_EQ(1, GetToastSerial());
gfx::Rect toast_bounds = GetCurrentWidget()->GetWindowBoundsInScreen();
- gfx::Rect root_bounds =
- ScreenUtil::GetShelfDisplayBoundsInRoot(Shell::GetPrimaryRootWindow());
+ gfx::Rect root_bounds = wm::GetDisplayBoundsWithShelf(shelf->GetWindow());
EXPECT_TRUE(toast_bounds.Intersects(shelf->GetUserWorkAreaBounds()));
EXPECT_NEAR(root_bounds.CenterPoint().x(), toast_bounds.CenterPoint().x(), 1);
@@ -191,8 +191,7 @@ TEST_F(ToastManagerTest, PositionWithAutoHiddenBottomShelf) {
EXPECT_EQ(1, GetToastSerial());
gfx::Rect toast_bounds = GetCurrentWidget()->GetWindowBoundsInScreen();
- gfx::Rect root_bounds =
- ScreenUtil::GetShelfDisplayBoundsInRoot(Shell::GetPrimaryRootWindow());
+ gfx::Rect root_bounds = wm::GetDisplayBoundsWithShelf(shelf->GetWindow());
EXPECT_TRUE(toast_bounds.Intersects(shelf->GetUserWorkAreaBounds()));
EXPECT_NEAR(root_bounds.CenterPoint().x(), toast_bounds.CenterPoint().x(), 1);
@@ -210,8 +209,7 @@ TEST_F(ToastManagerTest, PositionWithHiddenBottomShelf) {
EXPECT_EQ(1, GetToastSerial());
gfx::Rect toast_bounds = GetCurrentWidget()->GetWindowBoundsInScreen();
- gfx::Rect root_bounds =
- ScreenUtil::GetShelfDisplayBoundsInRoot(Shell::GetPrimaryRootWindow());
+ gfx::Rect root_bounds = wm::GetDisplayBoundsWithShelf(shelf->GetWindow());
EXPECT_TRUE(toast_bounds.Intersects(shelf->GetUserWorkAreaBounds()));
EXPECT_NEAR(root_bounds.CenterPoint().x(), toast_bounds.CenterPoint().x(), 1);
@@ -228,8 +226,7 @@ TEST_F(ToastManagerTest, PositionWithVisibleLeftShelf) {
gfx::Rect toast_bounds = GetCurrentWidget()->GetWindowBoundsInScreen();
gfx::RectF precise_toast_bounds(toast_bounds);
- gfx::Rect root_bounds =
- ScreenUtil::GetShelfDisplayBoundsInRoot(Shell::GetPrimaryRootWindow());
+ gfx::Rect root_bounds = wm::GetDisplayBoundsWithShelf(shelf->GetWindow());
EXPECT_TRUE(toast_bounds.Intersects(shelf->GetUserWorkAreaBounds()));
EXPECT_EQ(root_bounds.bottom() - 5, toast_bounds.bottom());
@@ -261,8 +258,7 @@ TEST_F(ToastManagerTest, PositionWithUnifiedDesktop) {
EXPECT_EQ(1, GetToastSerial());
gfx::Rect toast_bounds = GetCurrentWidget()->GetWindowBoundsInScreen();
- gfx::Rect root_bounds =
- ScreenUtil::GetShelfDisplayBoundsInRoot(Shell::GetPrimaryRootWindow());
+ gfx::Rect root_bounds = wm::GetDisplayBoundsWithShelf(shelf->GetWindow());
EXPECT_TRUE(toast_bounds.Intersects(shelf->GetUserWorkAreaBounds()));
EXPECT_TRUE(root_bounds.Contains(toast_bounds));
« no previous file with comments | « ash/shelf/shelf_layout_manager.cc ('k') | ash/wm/lock_window_state.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698