| Index: ash/app_list/app_list_presenter_delegate_unittest.cc
|
| diff --git a/ash/app_list/app_list_presenter_delegate_unittest.cc b/ash/app_list/app_list_presenter_delegate_unittest.cc
|
| index 3844f22bbc0a86842e9f78e86f546046466fabcc..1f8b7161b7b5d5506e348df1364ea506273e5333 100644
|
| --- a/ash/app_list/app_list_presenter_delegate_unittest.cc
|
| +++ b/ash/app_list/app_list_presenter_delegate_unittest.cc
|
| @@ -15,10 +15,18 @@
|
| #include "ui/app_list/views/app_list_view.h"
|
| #include "ui/aura/test/test_windows.h"
|
| #include "ui/aura/window.h"
|
| -#include "ui/display/manager/display_manager.h"
|
| +#include "ui/display/display.h"
|
| +#include "ui/display/screen.h"
|
| #include "ui/events/test/event_generator.h"
|
|
|
| namespace ash {
|
| +namespace {
|
| +
|
| +int64_t GetPrimaryDisplayId() {
|
| + return display::Screen::GetScreen()->GetPrimaryDisplay().id();
|
| +}
|
| +
|
| +} // namespace
|
|
|
| class AppListPresenterDelegateTest : public test::AshTestBase {
|
| public:
|
| @@ -45,7 +53,7 @@ class AppListPresenterDelegateTest : public test::AshTestBase {
|
|
|
| // Tests that app launcher hides when focus moves to a normal window.
|
| TEST_F(AppListPresenterDelegateTest, HideOnFocusOut) {
|
| - app_list_presenter_impl()->Show(display_manager()->first_display_id());
|
| + app_list_presenter_impl()->Show(GetPrimaryDisplayId());
|
| EXPECT_TRUE(app_list_presenter_impl()->GetTargetVisibility());
|
|
|
| std::unique_ptr<aura::Window> window(CreateTestWindowInShellWithId(0));
|
| @@ -58,7 +66,7 @@ TEST_F(AppListPresenterDelegateTest, HideOnFocusOut) {
|
| // window in kShellWindowId_AppListContainer.
|
| TEST_F(AppListPresenterDelegateTest,
|
| RemainVisibleWhenFocusingToApplistContainer) {
|
| - app_list_presenter_impl()->Show(display_manager()->first_display_id());
|
| + app_list_presenter_impl()->Show(GetPrimaryDisplayId());
|
| EXPECT_TRUE(app_list_presenter_impl()->GetTargetVisibility());
|
|
|
| aura::Window* applist_container = Shell::GetContainer(
|
| @@ -72,7 +80,7 @@ TEST_F(AppListPresenterDelegateTest,
|
|
|
| // Tests that clicking outside the app-list bubble closes it.
|
| TEST_F(AppListPresenterDelegateTest, ClickOutsideBubbleClosesBubble) {
|
| - app_list_presenter_impl()->Show(display_manager()->first_display_id());
|
| + app_list_presenter_impl()->Show(GetPrimaryDisplayId());
|
| aura::Window* app_window = app_list_presenter_impl()->GetWindow();
|
| ASSERT_TRUE(app_window);
|
| ui::test::EventGenerator& generator = GetEventGenerator();
|
| @@ -93,7 +101,7 @@ TEST_F(AppListPresenterDelegateTest, ClickOutsideBubbleClosesBubble) {
|
|
|
| // Tests that clicking outside the app-list bubble closes it.
|
| TEST_F(AppListPresenterDelegateTest, TapOutsideBubbleClosesBubble) {
|
| - app_list_presenter_impl()->Show(display_manager()->first_display_id());
|
| + app_list_presenter_impl()->Show(GetPrimaryDisplayId());
|
|
|
| aura::Window* app_window = app_list_presenter_impl()->GetWindow();
|
| ASSERT_TRUE(app_window);
|
| @@ -140,7 +148,7 @@ TEST_F(AppListPresenterDelegateTest, TinyDisplay) {
|
| // Set up a screen with a tiny display (height smaller than the app list).
|
| UpdateDisplay("400x300");
|
|
|
| - app_list_presenter_impl()->Show(display_manager()->first_display_id());
|
| + app_list_presenter_impl()->Show(GetPrimaryDisplayId());
|
| EXPECT_TRUE(app_list_presenter_impl()->GetTargetVisibility());
|
|
|
| // The top of the app list should be on-screen (even if the bottom is not).
|
|
|