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

Unified Diff: ash/wm/overview/window_selector_unittest.cc

Issue 2225683008: [ash-md] Cancels app-list (launcher) before entering overview (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: [ash-md] - Prevents accelerators from reaching an active window in overview (handle in app-list) Created 4 years, 4 months 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
« no previous file with comments | « ash/app_list/app_list_presenter_delegate.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/overview/window_selector_unittest.cc
diff --git a/ash/wm/overview/window_selector_unittest.cc b/ash/wm/overview/window_selector_unittest.cc
index eef26a99ba832d49b968073d1bafb0a3afbecbfc..f5f53a15ff0cc71870e4f37aa554dc42bf06a15f 100644
--- a/ash/wm/overview/window_selector_unittest.cc
+++ b/ash/wm/overview/window_selector_unittest.cc
@@ -453,6 +453,27 @@ TEST_P(WindowSelectorTest, Basic) {
EXPECT_FALSE(aura::client::GetCursorClient(root_window)->IsCursorLocked());
}
+// Tests that entering overview mode with an App-list active properly focuses
+// and activates the overview text filter window.
+TEST_P(WindowSelectorTest, TextFilterActive) {
+ gfx::Rect bounds(0, 0, 400, 400);
+ std::unique_ptr<aura::Window> window1(CreateWindow(bounds));
+ wm::ActivateWindow(window1.get());
+
+ EXPECT_TRUE(wm::IsActiveWindow(window1.get()));
+ EXPECT_EQ(window1.get(), GetFocusedWindow());
+
+ WmShell::Get()->ToggleAppList();
+
+ // Activating overview cancels the App-list which normally would activate the
+ // previously active |window1|. Overview mode should properly transfer focus
+ // and activation to the text filter widget.
+ ToggleOverview();
+ EXPECT_FALSE(wm::IsActiveWindow(window1.get()));
+ EXPECT_TRUE(wm::IsActiveWindow(GetFocusedWindow()));
+ EXPECT_EQ(text_filter_widget()->GetNativeWindow(), GetFocusedWindow());
+}
James Cook 2016/08/10 15:55:59 Nice test. Easy to read.
varkha 2016/08/10 16:04:54 Acknowledged.
+
// Tests that the ordering of windows is near the windows' original positions.
TEST_P(WindowSelectorTest, MinimizeMovement) {
// With Material Design the order of windows in overview mode is MRU.
« no previous file with comments | « ash/app_list/app_list_presenter_delegate.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698