Chromium Code Reviews| Index: ash/shelf/shelf_widget_unittest.cc |
| diff --git a/ash/shelf/shelf_widget_unittest.cc b/ash/shelf/shelf_widget_unittest.cc |
| index 7cdac60ef9c5b6fb1b7dac06c4e311d92a9cf832..bb0bc47fc5cf2a640714df170a9305832fd7ed4a 100644 |
| --- a/ash/shelf/shelf_widget_unittest.cc |
| +++ b/ash/shelf/shelf_widget_unittest.cc |
| @@ -39,43 +39,44 @@ ShelfLayoutManager* GetShelfLayoutManager() { |
| using ShelfWidgetTest = test::AshTestBase; |
| -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) |
|
James Cook
2017/05/17 23:41:49
Aside: I really miss window->GetDisplayNearestWind
msw
2017/05/18 20:28:00
Ditto, I think this is worth separate consideratio
|
| + .work_area() |
| + .ToString()); |
| } |
| 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, |
| @@ -152,7 +153,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); |