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

Unified Diff: ash/accelerators/accelerator_filter_unittest.cc

Issue 312483002: More accelerator code leanup (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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/accelerators/accelerator_delegate.cc ('k') | ash/accelerators/nested_accelerator_delegate.h » ('j') | no next file with comments »
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 0359680889b002a1321726f5ad17eabc5bc58731..69db83100aff1f3179943de4e166bec2537ff723 100644
--- a/ash/accelerators/accelerator_filter_unittest.cc
+++ b/ash/accelerators/accelerator_filter_unittest.cc
@@ -89,15 +89,24 @@ TEST_F(AcceleratorFilterTest, TestCapsLockMask) {
TEST_F(AcceleratorFilterTest, CanConsumeSystemKeys) {
::wm::AcceleratorFilter filter(
scoped_ptr< ::wm::AcceleratorDelegate>(new AcceleratorDelegate).Pass());
+ aura::Window* root_window = Shell::GetPrimaryRootWindow();
// Normal keys are not consumed.
ui::KeyEvent press_a(ui::ET_KEY_PRESSED, ui::VKEY_A, ui::EF_NONE, false);
+ {
+ ui::Event::DispatcherApi dispatch_helper(&press_a);
+ dispatch_helper.set_target(root_window);
+ }
filter.OnKeyEvent(&press_a);
EXPECT_FALSE(press_a.stopped_propagation());
// System keys are directly consumed.
ui::KeyEvent press_mute(
ui::ET_KEY_PRESSED, ui::VKEY_VOLUME_MUTE, ui::EF_NONE, false);
+ {
+ ui::Event::DispatcherApi dispatch_helper(&press_mute);
+ dispatch_helper.set_target(root_window);
+ }
filter.OnKeyEvent(&press_mute);
EXPECT_TRUE(press_mute.stopped_propagation());
« no previous file with comments | « ash/accelerators/accelerator_delegate.cc ('k') | ash/accelerators/nested_accelerator_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698