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..130d844192c8c23e6f0b4e3306cecf7f90cbc081 100644 |
--- a/ash/app_list/app_list_presenter_delegate_unittest.cc |
+++ b/ash/app_list/app_list_presenter_delegate_unittest.cc |
@@ -15,10 +15,17 @@ |
#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() { |
msw
2017/04/06 18:43:22
optional nit: Add this to AshTestBase/AshTestHelpe
sky
2017/04/06 19:00:11
I think this (and some of the other utility functi
|
+ return display::Screen::GetScreen()->GetPrimaryDisplay().id(); |
+} |
+} // namespace |
msw
2017/04/06 18:43:22
nit: blank line above
sky
2017/04/06 19:00:11
Done.
|
class AppListPresenterDelegateTest : public test::AshTestBase { |
public: |
@@ -45,7 +52,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 +65,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 +79,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 +100,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 +147,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). |