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

Unified Diff: ui/aura/test/ui_controls_factory_ozone.cc

Issue 490443002: Add test for ChromeVox keyboard commands. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: No changes to ui_controls_factory_aurax11 needed. Created 6 years, 3 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
Index: ui/aura/test/ui_controls_factory_ozone.cc
diff --git a/ui/aura/test/ui_controls_factory_ozone.cc b/ui/aura/test/ui_controls_factory_ozone.cc
index 5179360e6fbe4754ac1ab3f1e6b51f4c3188ce8f..4c5330c6159600651b5f19d356a00523b60cfa10 100644
--- a/ui/aura/test/ui_controls_factory_ozone.cc
+++ b/ui/aura/test/ui_controls_factory_ozone.cc
@@ -36,8 +36,6 @@ class UIControlsOzone : public ui_controls::UIControlsAura {
bool alt,
bool command,
const base::Closure& closure) OVERRIDE {
- DCHECK(!command); // No command key on Aura
-
int flags = button_down_mask_;
if (control) {
@@ -55,6 +53,11 @@ class UIControlsOzone : public ui_controls::UIControlsAura {
PostKeyEvent(ui::ET_KEY_PRESSED, ui::VKEY_MENU, flags);
}
+ if (command) {
+ flags |= ui::EF_COMMAND_DOWN;
+ PostKeyEvent(ui::ET_KEY_PRESSED, ui::VKEY_LWIN, flags);
David Tseng 2014/09/22 21:52:21 Does it make sense to use meta or win consistently
+ }
+
PostKeyEvent(ui::ET_KEY_PRESSED, key, flags);
PostKeyEvent(ui::ET_KEY_RELEASED, key, flags);
@@ -73,6 +76,11 @@ class UIControlsOzone : public ui_controls::UIControlsAura {
PostKeyEvent(ui::ET_KEY_RELEASED, ui::VKEY_CONTROL, flags);
}
+ if (command) {
+ flags &= ~ui::EF_COMMAND_DOWN;
+ PostKeyEvent(ui::ET_KEY_RELEASED, ui::VKEY_LWIN, flags);
+ }
+
RunClosureAfterAllPendingUIEvents(closure);
return true;
}

Powered by Google App Engine
This is Rietveld 408576698