Index: ash/wm/window_cycle_controller_unittest.cc |
diff --git a/ash/wm/window_cycle_controller_unittest.cc b/ash/wm/window_cycle_controller_unittest.cc |
index 28ca6b1cd19f84303406f857d3876616d760f86b..997002d69a175dc21c122770aa0ef956b468903d 100644 |
--- a/ash/wm/window_cycle_controller_unittest.cc |
+++ b/ash/wm/window_cycle_controller_unittest.cc |
@@ -7,6 +7,7 @@ |
#include <algorithm> |
#include <memory> |
+#include "ash/app_list/app_list_presenter_delegate_factory.h" |
#include "ash/aura/wm_window_aura.h" |
#include "ash/common/focus_cycler.h" |
#include "ash/common/scoped_root_window_for_new_windows.h" |
@@ -25,12 +26,15 @@ |
#include "ash/test/test_shell_delegate.h" |
#include "ash/wm/window_state_aura.h" |
#include "ash/wm/window_util.h" |
+#include "ui/app_list/presenter/app_list_presenter_impl.h" |
+#include "ui/app_list/presenter/test/test_app_list_view_delegate_factory.h" |
#include "ui/aura/client/aura_constants.h" |
#include "ui/aura/client/screen_position_client.h" |
#include "ui/aura/env.h" |
#include "ui/aura/test/test_windows.h" |
#include "ui/aura/window.h" |
#include "ui/aura/window_event_dispatcher.h" |
+#include "ui/display/manager/display_manager.h" |
#include "ui/events/event_handler.h" |
#include "ui/events/test/event_generator.h" |
#include "ui/gfx/geometry/rect.h" |
@@ -468,14 +472,20 @@ TEST_F(WindowCycleControllerTest, MostRecentlyUsed) { |
// Tests that beginning window selection hides the app list. |
TEST_F(WindowCycleControllerTest, SelectingHidesAppList) { |
+ // The tested behavior relies on the app list presenter implementation. |
+ AppListPresenterDelegateFactory app_list_presenter_delegate_factory( |
+ base::MakeUnique<app_list::TestAppListViewDelegateFactory>()); |
+ app_list::AppListPresenterImpl app_list_presenter_impl( |
+ &app_list_presenter_delegate_factory); |
+ |
WindowCycleController* controller = WmShell::Get()->window_cycle_controller(); |
std::unique_ptr<aura::Window> window0(CreateTestWindowInShellWithId(0)); |
std::unique_ptr<aura::Window> window1(CreateTestWindowInShellWithId(1)); |
- WmShell::Get()->ShowAppList(); |
- EXPECT_TRUE(WmShell::Get()->GetAppListTargetVisibility()); |
+ app_list_presenter_impl.Show(display_manager()->first_display_id()); |
+ EXPECT_TRUE(app_list_presenter_impl.IsVisible()); |
controller->HandleCycleWindow(WindowCycleController::FORWARD); |
- EXPECT_FALSE(WmShell::Get()->GetAppListTargetVisibility()); |
+ EXPECT_FALSE(app_list_presenter_impl.IsVisible()); |
// Make sure that dismissing the app list this way doesn't pass activation |
// to a different window. |