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

Unified Diff: ash/accelerators/accelerator_filter_unittest.cc

Issue 1117173003: Converting (Alt+LeftClick -> RightClick) to (Search+LeftClick -> RightClick) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added a test, and addressed comments Created 5 years, 8 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 | « no previous file | chrome/browser/chromeos/events/event_rewriter.h » ('j') | ui/wm/core/accelerator_filter.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/accelerators/accelerator_filter_unittest.cc
diff --git a/ash/accelerators/accelerator_filter_unittest.cc b/ash/accelerators/accelerator_filter_unittest.cc
index a4e9c297b5643cc36349e460f9ca0e246b288181..7e71514b25e452633c97dcd31dd99b8dac94fa05 100644
--- a/ash/accelerators/accelerator_filter_unittest.cc
+++ b/ash/accelerators/accelerator_filter_unittest.cc
@@ -134,5 +134,20 @@ TEST_F(AcceleratorFilterTest, CanConsumeSystemKeys) {
}
#endif // defined(OS_CHROMEOS)
+// Tests that pressing 'SEARCH' + LeftMouseClick, which will be rewritten as a
+// RightMouseClick, will not toggle the AppList.
+// This test will fail without the code to clear the current accelerator in
+// the accelerator history present in |AcceleratorFilter::OnMouseEvent()|.
+TEST_F(AcceleratorFilterTest, SearchClickDoesntToggleAppList) {
+ ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow());
+
+ EXPECT_FALSE(ash::Shell::GetInstance()->GetAppListTargetVisibility());
+ generator.PressKey(ui::VKEY_LWIN, 0);
+ generator.PressLeftButton();
+ generator.ReleaseLeftButton();
sadrul 2015/05/04 17:16:17 ClickLeftButton() instead of Press/Release?
afakhry 2015/05/04 20:17:08 Done.
+ generator.ReleaseKey(ui::VKEY_LWIN, 0);
+ EXPECT_FALSE(ash::Shell::GetInstance()->GetAppListTargetVisibility());
sadrul 2015/05/04 17:16:17 If you leave the synth. bit in AcceleratorFilter,
afakhry 2015/05/04 20:17:08 Done.
+}
+
} // namespace test
} // namespace ash
« no previous file with comments | « no previous file | chrome/browser/chromeos/events/event_rewriter.h » ('j') | ui/wm/core/accelerator_filter.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698