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

Side by Side 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, 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/wm/core/accelerator_filter.h" 5 #include "ui/wm/core/accelerator_filter.h"
6 6
7 #include "ash/accelerators/accelerator_controller.h" 7 #include "ash/accelerators/accelerator_controller.h"
8 #include "ash/accelerators/accelerator_delegate.h" 8 #include "ash/accelerators/accelerator_delegate.h"
9 #include "ash/shell.h" 9 #include "ash/shell.h"
10 #include "ash/shell_window_ids.h" 10 #include "ash/shell_window_ids.h"
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 // System keys pass through to a child window if the parent (top level) 127 // System keys pass through to a child window if the parent (top level)
128 // window has the property set. 128 // window has the property set.
129 scoped_ptr<aura::Window> child(CreateTestWindowInShellWithId(2)); 129 scoped_ptr<aura::Window> child(CreateTestWindowInShellWithId(2));
130 window->AddChild(child.get()); 130 window->AddChild(child.get());
131 dispatch_helper.set_target(child.get()); 131 dispatch_helper.set_target(child.get());
132 filter.OnKeyEvent(&press_volume_up); 132 filter.OnKeyEvent(&press_volume_up);
133 EXPECT_FALSE(press_volume_up.stopped_propagation()); 133 EXPECT_FALSE(press_volume_up.stopped_propagation());
134 } 134 }
135 #endif // defined(OS_CHROMEOS) 135 #endif // defined(OS_CHROMEOS)
136 136
137 // Tests that pressing 'SEARCH' + LeftMouseClick, which will be rewritten as a
138 // RightMouseClick, will not toggle the AppList.
139 // This test will fail without the code to clear the current accelerator in
140 // the accelerator history present in |AcceleratorFilter::OnMouseEvent()|.
141 TEST_F(AcceleratorFilterTest, SearchClickDoesntToggleAppList) {
142 ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow());
143
144 EXPECT_FALSE(ash::Shell::GetInstance()->GetAppListTargetVisibility());
145 generator.PressKey(ui::VKEY_LWIN, 0);
146 generator.PressLeftButton();
147 generator.ReleaseLeftButton();
sadrul 2015/05/04 17:16:17 ClickLeftButton() instead of Press/Release?
afakhry 2015/05/04 20:17:08 Done.
148 generator.ReleaseKey(ui::VKEY_LWIN, 0);
149 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.
150 }
151
137 } // namespace test 152 } // namespace test
138 } // namespace ash 153 } // namespace ash
OLDNEW
« 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