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

Unified Diff: ash/shelf/shelf_widget_unittest.cc

Issue 2886253002: mash: remove more shell/shelf WmWindow usage. (Closed)
Patch Set: Fix WmShelf::ForWindow. Created 3 years, 7 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_view_unittest.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_widget_unittest.cc
diff --git a/ash/shelf/shelf_widget_unittest.cc b/ash/shelf/shelf_widget_unittest.cc
index 13bb5de091cef70a32249947f0a7f72b7b362bca..4e3dbc95f28bd44314dad826c19baac6b363f83e 100644
--- a/ash/shelf/shelf_widget_unittest.cc
+++ b/ash/shelf/shelf_widget_unittest.cc
@@ -35,12 +35,14 @@ ShelfLayoutManager* GetShelfLayoutManager() {
return GetShelfWidget()->shelf_layout_manager();
}
-void TestLauncherAlignment(WmWindow* root,
+void TestLauncherAlignment(aura::Window* root,
ShelfAlignment alignment,
const gfx::Rect& expected) {
- root->GetRootWindowController()->GetShelf()->SetAlignment(alignment);
- EXPECT_EQ(expected.ToString(),
- root->GetDisplayNearestWindow().work_area().ToString());
+ GetRootWindowController(root)->GetShelf()->SetAlignment(alignment);
+ EXPECT_EQ(expected.ToString(), display::Screen::GetScreen()
+ ->GetDisplayNearestWindow(root)
+ .work_area()
+ .ToString());
}
using ShelfWidgetTest = test::AshTestBase;
@@ -49,31 +51,30 @@ TEST_F(ShelfWidgetTest, TestAlignment) {
UpdateDisplay("400x400");
{
SCOPED_TRACE("Single Bottom");
- TestLauncherAlignment(ShellPort::Get()->GetPrimaryRootWindow(),
- SHELF_ALIGNMENT_BOTTOM, gfx::Rect(0, 0, 400, 352));
+ TestLauncherAlignment(Shell::GetPrimaryRootWindow(), SHELF_ALIGNMENT_BOTTOM,
+ gfx::Rect(0, 0, 400, 352));
}
{
SCOPED_TRACE("Single Locked");
- TestLauncherAlignment(ShellPort::Get()->GetPrimaryRootWindow(),
+ TestLauncherAlignment(Shell::GetPrimaryRootWindow(),
SHELF_ALIGNMENT_BOTTOM_LOCKED,
gfx::Rect(0, 0, 400, 352));
}
{
SCOPED_TRACE("Single Right");
- TestLauncherAlignment(ShellPort::Get()->GetPrimaryRootWindow(),
- SHELF_ALIGNMENT_RIGHT, gfx::Rect(0, 0, 352, 400));
+ TestLauncherAlignment(Shell::GetPrimaryRootWindow(), SHELF_ALIGNMENT_RIGHT,
+ gfx::Rect(0, 0, 352, 400));
}
{
SCOPED_TRACE("Single Left");
- TestLauncherAlignment(ShellPort::Get()->GetPrimaryRootWindow(),
- SHELF_ALIGNMENT_LEFT,
+ TestLauncherAlignment(Shell::GetPrimaryRootWindow(), SHELF_ALIGNMENT_LEFT,
gfx::Rect(kShelfSize, 0, 352, 400));
}
}
TEST_F(ShelfWidgetTest, TestAlignmentForMultipleDisplays) {
UpdateDisplay("300x300,500x500");
- std::vector<WmWindow*> root_windows = ShellPort::Get()->GetAllRootWindows();
+ aura::Window::Windows root_windows = Shell::GetAllRootWindows();
{
SCOPED_TRACE("Primary Bottom");
TestLauncherAlignment(root_windows[0], SHELF_ALIGNMENT_BOTTOM,
@@ -150,7 +151,7 @@ TEST_F(ShelfWidgetTest, ShelfInitiallySizedAfterLogin) {
UpdateDisplay("300x200,400x300");
// Both displays have a shelf controller.
- std::vector<WmWindow*> roots = ShellPort::Get()->GetAllRootWindows();
+ aura::Window::Windows roots = Shell::GetAllRootWindows();
WmShelf* shelf1 = WmShelf::ForWindow(roots[0]);
WmShelf* shelf2 = WmShelf::ForWindow(roots[1]);
ASSERT_TRUE(shelf1);
« no previous file with comments | « ash/shelf/shelf_view_unittest.cc ('k') | ash/shelf/shelf_window_watcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698