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

Unified Diff: ash/wm/window_cycle_controller_unittest.cc

Issue 2576913002: Use mojo app list interfaces for mash and classic ash. (Closed)
Patch Set: Fix test name. Created 4 years 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
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.

Powered by Google App Engine
This is Rietveld 408576698