Commit 14e5bdf5 authored by jam's avatar jam Committed by Commit bot

Revert of Add test for ChromeVox keyboard commands. (patchset #21 id:390004 of...

Revert of Add test for ChromeVox keyboard commands. (patchset #21 id:390004 of https://codereview.chromium.org/490443002/)

Reason for revert:
flakes, see http://build.chromium.org/p/chromium.chromiumos/builders/Linux%20ChromiumOS%20Tests%20%28dbg%29%281%29/builds/31850

failures:
TestAsNormalAndGuestUser/SpokenFeedbackTest.ChromeVoxPrefixKey/0
TestAsNormalAndGuestUser/SpokenFeedbackTest.ChromeVoxPrefixKey/1
TestAsNormalAndGuestUser/SpokenFeedbackTest.ChromeVoxShiftSearch/1
TestAsNormalAndGuestUser/SpokenFeedbackTest.ChromeVoxShiftSearch/0
LoggedInSpokenFeedbackTest.AddBookmark

Original issue's description:
> Add test for ChromeVox keyboard commands.
>
> This is just a couple of quick sanity checks to prevent future regressions
> like the one in the linked bug. It tests both a Search+Shift shortcut and
> the corresponding Prefix Key shortcut.
>
> Adds support for sending the meta modifier key in
> aura/x11 tests.
>
> BUG=404470
>
> Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=291547
>
> Committed: https://chromium.googlesource.com/chromium/src/+/8cab2737f1cb6e6011b0946f6bef5027868602c0
>
> Committed: https://crrev.com/91703961c10dfa0f452999ed7cb87945ea817362
> Cr-Commit-Position: refs/heads/master@{#293687}
>
> Committed: https://crrev.com/15ea141544fedaf306c94890b5be19b7c5df885a
> Cr-Commit-Position: refs/heads/master@{#296074}

TBR=dtseng@chromium.org,sky@chromium.org,dmazzoni@chromium.org
NOTREECHECKS=true
NOTRY=true
BUG=404470

Review URL: https://codereview.chromium.org/603823002

Cr-Commit-Position: refs/heads/master@{#296627}
parent 2637bf54
...@@ -21,7 +21,6 @@ ...@@ -21,7 +21,6 @@
#include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_commands.h" #include "chrome/browser/ui/browser_commands.h"
#include "chrome/browser/ui/browser_window.h" #include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/common/chrome_switches.h" #include "chrome/common/chrome_switches.h"
#include "chrome/common/extensions/extension_constants.h" #include "chrome/common/extensions/extension_constants.h"
#include "chrome/test/base/in_process_browser_test.h" #include "chrome/test/base/in_process_browser_test.h"
...@@ -61,24 +60,11 @@ class LoggedInSpokenFeedbackTest : public InProcessBrowserTest { ...@@ -61,24 +60,11 @@ class LoggedInSpokenFeedbackTest : public InProcessBrowserTest {
} }
void SendKeyPress(ui::KeyboardCode key) { void SendKeyPress(ui::KeyboardCode key) {
ASSERT_NO_FATAL_FAILURE( gfx::NativeWindow root_window =
ASSERT_TRUE( ash::Shell::GetInstance()->GetPrimaryRootWindow();
ui_test_utils::SendKeyPressToWindowSync( ASSERT_TRUE(
NULL, key, false, false, false, false))); ui_test_utils::SendKeyPressToWindowSync(
} root_window, key, false, false, false, false));
void SendKeyPressWithControl(ui::KeyboardCode key) {
ASSERT_NO_FATAL_FAILURE(
ASSERT_TRUE(
ui_test_utils::SendKeyPressToWindowSync(
NULL, key, true, false, false, false)));
}
void SendKeyPressWithSearchAndShift(ui::KeyboardCode key) {
ASSERT_NO_FATAL_FAILURE(
ASSERT_TRUE(
ui_test_utils::SendKeyPressToWindowSync(
NULL, key, false, true, false, true)));
} }
void RunJavaScriptInChromeVoxBackgroundPage(const std::string& script) { void RunJavaScriptInChromeVoxBackgroundPage(const std::string& script) {
...@@ -106,37 +92,6 @@ class LoggedInSpokenFeedbackTest : public InProcessBrowserTest { ...@@ -106,37 +92,6 @@ class LoggedInSpokenFeedbackTest : public InProcessBrowserTest {
"cvox.ChromeVox.earcons.playEarcon = function() {};"); "cvox.ChromeVox.earcons.playEarcon = function() {};");
} }
void LoadChromeVoxAndThenNavigateToURL(const GURL& url) {
// The goal of this helper function is to avoid race conditions between
// the page loading and the ChromeVox extension loading and fully
// initializing. To do this, we first load a test url that repeatedly
// asks ChromeVox to speak 'ready', then we load ChromeVox and block
// until we get that 'ready' speech.
ui_test_utils::NavigateToURL(
browser(),
GURL("data:text/html;charset=utf-8,"
"<script>"
"window.setInterval(function() {"
" try {"
" cvox.Api.speak('ready');"
" } catch (e) {}"
"}, 100);"
"</script>"));
EXPECT_FALSE(AccessibilityManager::Get()->IsSpokenFeedbackEnabled());
AccessibilityManager::Get()->EnableSpokenFeedback(
true, ash::A11Y_NOTIFICATION_NONE);
// Block until we get "ready".
while (speech_monitor_.GetNextUtterance() != "ready") {
}
// Now load the requested url.
ui_test_utils::NavigateToURL(browser(), url);
}
SpeechMonitor speech_monitor_;
private: private:
StubBrailleController braille_controller_; StubBrailleController braille_controller_;
DISALLOW_COPY_AND_ASSIGN(LoggedInSpokenFeedbackTest); DISALLOW_COPY_AND_ASSIGN(LoggedInSpokenFeedbackTest);
...@@ -145,51 +100,52 @@ class LoggedInSpokenFeedbackTest : public InProcessBrowserTest { ...@@ -145,51 +100,52 @@ class LoggedInSpokenFeedbackTest : public InProcessBrowserTest {
IN_PROC_BROWSER_TEST_F(LoggedInSpokenFeedbackTest, AddBookmark) { IN_PROC_BROWSER_TEST_F(LoggedInSpokenFeedbackTest, AddBookmark) {
EXPECT_FALSE(AccessibilityManager::Get()->IsSpokenFeedbackEnabled()); EXPECT_FALSE(AccessibilityManager::Get()->IsSpokenFeedbackEnabled());
SpeechMonitor monitor;
AccessibilityManager::Get()->EnableSpokenFeedback( AccessibilityManager::Get()->EnableSpokenFeedback(
true, ash::A11Y_NOTIFICATION_NONE); true, ash::A11Y_NOTIFICATION_NONE);
EXPECT_TRUE(speech_monitor_.SkipChromeVoxEnabledMessage()); EXPECT_TRUE(monitor.SkipChromeVoxEnabledMessage());
DisableEarcons(); DisableEarcons();
chrome::ExecuteCommand(browser(), IDC_SHOW_BOOKMARK_BAR); chrome::ExecuteCommand(browser(), IDC_SHOW_BOOKMARK_BAR);
// Create a bookmark with title "foo". // Create a bookmark with title "foo".
chrome::ExecuteCommand(browser(), IDC_BOOKMARK_PAGE); chrome::ExecuteCommand(browser(), IDC_BOOKMARK_PAGE);
EXPECT_EQ("Bookmark added!,", speech_monitor_.GetNextUtterance()); EXPECT_EQ("Bookmark added!,", monitor.GetNextUtterance());
EXPECT_EQ("about blank,", speech_monitor_.GetNextUtterance()); EXPECT_EQ("about blank,", monitor.GetNextUtterance());
EXPECT_EQ("Bookmark name,", speech_monitor_.GetNextUtterance()); EXPECT_EQ("Bookmark name,", monitor.GetNextUtterance());
EXPECT_EQ("text box", speech_monitor_.GetNextUtterance()); EXPECT_EQ("text box", monitor.GetNextUtterance());
SendKeyPress(ui::VKEY_F); SendKeyPress(ui::VKEY_F);
EXPECT_EQ("f", speech_monitor_.GetNextUtterance()); EXPECT_EQ("f", monitor.GetNextUtterance());
SendKeyPress(ui::VKEY_O); SendKeyPress(ui::VKEY_O);
EXPECT_EQ("o", speech_monitor_.GetNextUtterance()); EXPECT_EQ("o", monitor.GetNextUtterance());
SendKeyPress(ui::VKEY_O); SendKeyPress(ui::VKEY_O);
EXPECT_EQ("o", speech_monitor_.GetNextUtterance()); EXPECT_EQ("o", monitor.GetNextUtterance());
SendKeyPress(ui::VKEY_TAB); SendKeyPress(ui::VKEY_TAB);
EXPECT_EQ("Bookmarks bar,", speech_monitor_.GetNextUtterance()); EXPECT_EQ("Bookmarks bar,", monitor.GetNextUtterance());
EXPECT_EQ("Bookmark folder,", speech_monitor_.GetNextUtterance()); EXPECT_EQ("Bookmark folder,", monitor.GetNextUtterance());
EXPECT_TRUE(MatchPattern(speech_monitor_.GetNextUtterance(), "combo box*")); EXPECT_TRUE(MatchPattern(monitor.GetNextUtterance(), "combo box*"));
SendKeyPress(ui::VKEY_RETURN); SendKeyPress(ui::VKEY_RETURN);
EXPECT_TRUE(MatchPattern(speech_monitor_.GetNextUtterance(), "*oolbar*")); EXPECT_TRUE(MatchPattern(monitor.GetNextUtterance(), "*oolbar*"));
// Wait for active window change to be announced to avoid interference from // Wait for active window change to be announced to avoid interference from
// that below. // that below.
while (speech_monitor_.GetNextUtterance() != "window about blank tab") { while (monitor.GetNextUtterance() != "window about blank tab") {
// Do nothing. // Do nothing.
} }
// Focus bookmarks bar and listen for "foo". // Focus bookmarks bar and listen for "foo".
chrome::ExecuteCommand(browser(), IDC_FOCUS_BOOKMARKS); chrome::ExecuteCommand(browser(), IDC_FOCUS_BOOKMARKS);
while (true) { while (true) {
std::string utterance = speech_monitor_.GetNextUtterance(); std::string utterance = monitor.GetNextUtterance();
VLOG(0) << "Got utterance: " << utterance; VLOG(0) << "Got utterance: " << utterance;
if (utterance == "Bookmarks,") if (utterance == "Bookmarks,")
break; break;
} }
EXPECT_EQ("foo,", speech_monitor_.GetNextUtterance()); EXPECT_EQ("foo,", monitor.GetNextUtterance());
EXPECT_EQ("button", speech_monitor_.GetNextUtterance()); EXPECT_EQ("button", monitor.GetNextUtterance());
} }
// //
...@@ -229,96 +185,66 @@ INSTANTIATE_TEST_CASE_P( ...@@ -229,96 +185,66 @@ INSTANTIATE_TEST_CASE_P(
IN_PROC_BROWSER_TEST_P(SpokenFeedbackTest, EnableSpokenFeedback) { IN_PROC_BROWSER_TEST_P(SpokenFeedbackTest, EnableSpokenFeedback) {
EXPECT_FALSE(AccessibilityManager::Get()->IsSpokenFeedbackEnabled()); EXPECT_FALSE(AccessibilityManager::Get()->IsSpokenFeedbackEnabled());
SpeechMonitor monitor;
AccessibilityManager::Get()->EnableSpokenFeedback( AccessibilityManager::Get()->EnableSpokenFeedback(
true, ash::A11Y_NOTIFICATION_NONE); true, ash::A11Y_NOTIFICATION_NONE);
EXPECT_TRUE(speech_monitor_.SkipChromeVoxEnabledMessage()); EXPECT_TRUE(monitor.SkipChromeVoxEnabledMessage());
} }
IN_PROC_BROWSER_TEST_P(SpokenFeedbackTest, FocusToolbar) { IN_PROC_BROWSER_TEST_P(SpokenFeedbackTest, FocusToolbar) {
EXPECT_FALSE(AccessibilityManager::Get()->IsSpokenFeedbackEnabled()); EXPECT_FALSE(AccessibilityManager::Get()->IsSpokenFeedbackEnabled());
SpeechMonitor monitor;
AccessibilityManager::Get()->EnableSpokenFeedback( AccessibilityManager::Get()->EnableSpokenFeedback(
true, ash::A11Y_NOTIFICATION_NONE); true, ash::A11Y_NOTIFICATION_NONE);
EXPECT_TRUE(speech_monitor_.SkipChromeVoxEnabledMessage()); EXPECT_TRUE(monitor.SkipChromeVoxEnabledMessage());
DisableEarcons(); DisableEarcons();
chrome::ExecuteCommand(browser(), IDC_FOCUS_TOOLBAR); chrome::ExecuteCommand(browser(), IDC_FOCUS_TOOLBAR);
// Might be "Google Chrome Toolbar" or "Chromium Toolbar". // Might be "Google Chrome Toolbar" or "Chromium Toolbar".
EXPECT_TRUE(MatchPattern(speech_monitor_.GetNextUtterance(), "*oolbar*")); EXPECT_TRUE(MatchPattern(monitor.GetNextUtterance(), "*oolbar*"));
EXPECT_EQ("Reload,", speech_monitor_.GetNextUtterance()); EXPECT_EQ("Reload,", monitor.GetNextUtterance());
EXPECT_EQ("button", speech_monitor_.GetNextUtterance()); EXPECT_EQ("button", monitor.GetNextUtterance());
} }
IN_PROC_BROWSER_TEST_P(SpokenFeedbackTest, TypeInOmnibox) { IN_PROC_BROWSER_TEST_P(SpokenFeedbackTest, TypeInOmnibox) {
EXPECT_FALSE(AccessibilityManager::Get()->IsSpokenFeedbackEnabled()); EXPECT_FALSE(AccessibilityManager::Get()->IsSpokenFeedbackEnabled());
SpeechMonitor monitor;
AccessibilityManager::Get()->EnableSpokenFeedback( AccessibilityManager::Get()->EnableSpokenFeedback(
true, ash::A11Y_NOTIFICATION_NONE); true, ash::A11Y_NOTIFICATION_NONE);
EXPECT_TRUE(speech_monitor_.SkipChromeVoxEnabledMessage()); EXPECT_TRUE(monitor.SkipChromeVoxEnabledMessage());
DisableEarcons(); DisableEarcons();
// Wait for ChromeVox to finish speaking. // Wait for ChromeVox to finish speaking.
chrome::ExecuteCommand(browser(), IDC_FOCUS_LOCATION); chrome::ExecuteCommand(browser(), IDC_FOCUS_LOCATION);
while (true) { while (true) {
std::string utterance = speech_monitor_.GetNextUtterance(); std::string utterance = monitor.GetNextUtterance();
VLOG(0) << "Got utterance: " << utterance; VLOG(0) << "Got utterance: " << utterance;
if (utterance == "text box") if (utterance == "text box")
break; break;
} }
SendKeyPress(ui::VKEY_X); SendKeyPress(ui::VKEY_X);
EXPECT_EQ("x", speech_monitor_.GetNextUtterance()); EXPECT_EQ("x", monitor.GetNextUtterance());
SendKeyPress(ui::VKEY_Y); SendKeyPress(ui::VKEY_Y);
EXPECT_EQ("y", speech_monitor_.GetNextUtterance()); EXPECT_EQ("y", monitor.GetNextUtterance());
SendKeyPress(ui::VKEY_Z); SendKeyPress(ui::VKEY_Z);
EXPECT_EQ("z", speech_monitor_.GetNextUtterance()); EXPECT_EQ("z", monitor.GetNextUtterance());
SendKeyPress(ui::VKEY_BACK); SendKeyPress(ui::VKEY_BACK);
EXPECT_EQ("z", speech_monitor_.GetNextUtterance()); EXPECT_EQ("z", monitor.GetNextUtterance());
}
IN_PROC_BROWSER_TEST_P(SpokenFeedbackTest, ChromeVoxShiftSearch) {
LoadChromeVoxAndThenNavigateToURL(
GURL("data:text/html;charset=utf-8,<button autofocus>Click me</button>"));
while (true) {
std::string utterance = speech_monitor_.GetNextUtterance();
if (utterance == "Click me")
break;
}
EXPECT_EQ("Button", speech_monitor_.GetNextUtterance());
// Press Search+Shift+/ to enter ChromeVox's "find in page".
SendKeyPressWithSearchAndShift(ui::VKEY_OEM_2);
EXPECT_EQ("Find in page.", speech_monitor_.GetNextUtterance());
EXPECT_EQ("Enter a search query.", speech_monitor_.GetNextUtterance());
}
IN_PROC_BROWSER_TEST_P(SpokenFeedbackTest, ChromeVoxPrefixKey) {
LoadChromeVoxAndThenNavigateToURL(
GURL("data:text/html;charset=utf-8,<button autofocus>Click me</button>"));
while (true) {
std::string utterance = speech_monitor_.GetNextUtterance();
if (utterance == "Click me")
break;
}
EXPECT_EQ("Button", speech_monitor_.GetNextUtterance());
// Press the prefix key Ctrl+';' followed by '/'
// to enter ChromeVox's "find in page".
SendKeyPressWithControl(ui::VKEY_OEM_1);
SendKeyPress(ui::VKEY_OEM_2);
EXPECT_EQ("Find in page.", speech_monitor_.GetNextUtterance());
EXPECT_EQ("Enter a search query.", speech_monitor_.GetNextUtterance());
} }
IN_PROC_BROWSER_TEST_P(SpokenFeedbackTest, TouchExploreStatusTray) { IN_PROC_BROWSER_TEST_P(SpokenFeedbackTest, TouchExploreStatusTray) {
EXPECT_FALSE(AccessibilityManager::Get()->IsSpokenFeedbackEnabled()); EXPECT_FALSE(AccessibilityManager::Get()->IsSpokenFeedbackEnabled());
SpeechMonitor monitor;
AccessibilityManager::Get()->EnableSpokenFeedback( AccessibilityManager::Get()->EnableSpokenFeedback(
true, ash::A11Y_NOTIFICATION_NONE); true, ash::A11Y_NOTIFICATION_NONE);
EXPECT_TRUE(speech_monitor_.SkipChromeVoxEnabledMessage()); EXPECT_TRUE(monitor.SkipChromeVoxEnabledMessage());
DisableEarcons(); DisableEarcons();
SimulateTouchScreenInChromeVox(); SimulateTouchScreenInChromeVox();
...@@ -328,10 +254,10 @@ IN_PROC_BROWSER_TEST_P(SpokenFeedbackTest, TouchExploreStatusTray) { ...@@ -328,10 +254,10 @@ IN_PROC_BROWSER_TEST_P(SpokenFeedbackTest, TouchExploreStatusTray) {
ash::SystemTray* tray = ash::Shell::GetInstance()->GetPrimarySystemTray(); ash::SystemTray* tray = ash::Shell::GetInstance()->GetPrimarySystemTray();
tray->NotifyAccessibilityEvent(ui::AX_EVENT_HOVER, true); tray->NotifyAccessibilityEvent(ui::AX_EVENT_HOVER, true);
EXPECT_EQ("Status tray,", speech_monitor_.GetNextUtterance()); EXPECT_EQ("Status tray,", monitor.GetNextUtterance());
EXPECT_TRUE(MatchPattern(speech_monitor_.GetNextUtterance(), "time*,")); EXPECT_TRUE(MatchPattern(monitor.GetNextUtterance(), "time*,"));
EXPECT_TRUE(MatchPattern(speech_monitor_.GetNextUtterance(), "Battery*,")); EXPECT_TRUE(MatchPattern(monitor.GetNextUtterance(), "Battery*,"));
EXPECT_EQ("button", speech_monitor_.GetNextUtterance()); EXPECT_EQ("button", monitor.GetNextUtterance());
} }
// //
...@@ -358,16 +284,17 @@ class GuestSpokenFeedbackTest : public LoggedInSpokenFeedbackTest { ...@@ -358,16 +284,17 @@ class GuestSpokenFeedbackTest : public LoggedInSpokenFeedbackTest {
IN_PROC_BROWSER_TEST_F(GuestSpokenFeedbackTest, FocusToolbar) { IN_PROC_BROWSER_TEST_F(GuestSpokenFeedbackTest, FocusToolbar) {
EXPECT_FALSE(AccessibilityManager::Get()->IsSpokenFeedbackEnabled()); EXPECT_FALSE(AccessibilityManager::Get()->IsSpokenFeedbackEnabled());
SpeechMonitor monitor;
AccessibilityManager::Get()->EnableSpokenFeedback( AccessibilityManager::Get()->EnableSpokenFeedback(
true, ash::A11Y_NOTIFICATION_NONE); true, ash::A11Y_NOTIFICATION_NONE);
EXPECT_TRUE(speech_monitor_.SkipChromeVoxEnabledMessage()); EXPECT_TRUE(monitor.SkipChromeVoxEnabledMessage());
DisableEarcons(); DisableEarcons();
chrome::ExecuteCommand(browser(), IDC_FOCUS_TOOLBAR); chrome::ExecuteCommand(browser(), IDC_FOCUS_TOOLBAR);
// Might be "Google Chrome Toolbar" or "Chromium Toolbar". // Might be "Google Chrome Toolbar" or "Chromium Toolbar".
EXPECT_TRUE(MatchPattern(speech_monitor_.GetNextUtterance(), "*oolbar*")); EXPECT_TRUE(MatchPattern(monitor.GetNextUtterance(), "*oolbar*"));
EXPECT_EQ("Reload,", speech_monitor_.GetNextUtterance()); EXPECT_EQ("Reload,", monitor.GetNextUtterance());
EXPECT_EQ("button", speech_monitor_.GetNextUtterance()); EXPECT_EQ("button", monitor.GetNextUtterance());
} }
// //
...@@ -390,8 +317,6 @@ class OobeSpokenFeedbackTest : public InProcessBrowserTest { ...@@ -390,8 +317,6 @@ class OobeSpokenFeedbackTest : public InProcessBrowserTest {
SetProfileForTest(ProfileHelper::GetSigninProfile()); SetProfileForTest(ProfileHelper::GetSigninProfile());
} }
SpeechMonitor speech_monitor_;
private: private:
DISALLOW_COPY_AND_ASSIGN(OobeSpokenFeedbackTest); DISALLOW_COPY_AND_ASSIGN(OobeSpokenFeedbackTest);
}; };
...@@ -406,18 +331,18 @@ IN_PROC_BROWSER_TEST_F(OobeSpokenFeedbackTest, DISABLED_SpokenFeedbackInOobe) { ...@@ -406,18 +331,18 @@ IN_PROC_BROWSER_TEST_F(OobeSpokenFeedbackTest, DISABLED_SpokenFeedbackInOobe) {
views::Widget* widget = web_ui_login_view->GetWidget(); views::Widget* widget = web_ui_login_view->GetWidget();
gfx::NativeWindow window = widget->GetNativeWindow(); gfx::NativeWindow window = widget->GetNativeWindow();
SpeechMonitor monitor;
AccessibilityManager::Get()->EnableSpokenFeedback( AccessibilityManager::Get()->EnableSpokenFeedback(
true, ash::A11Y_NOTIFICATION_NONE); true, ash::A11Y_NOTIFICATION_NONE);
EXPECT_TRUE(speech_monitor_.SkipChromeVoxEnabledMessage()); EXPECT_TRUE(monitor.SkipChromeVoxEnabledMessage());
EXPECT_EQ("Select your language:", speech_monitor_.GetNextUtterance()); EXPECT_EQ("Select your language:", monitor.GetNextUtterance());
EXPECT_EQ("English ( United States)", speech_monitor_.GetNextUtterance()); EXPECT_EQ("English ( United States)", monitor.GetNextUtterance());
EXPECT_TRUE(MatchPattern(speech_monitor_.GetNextUtterance(), EXPECT_TRUE(MatchPattern(monitor.GetNextUtterance(), "Combo box * of *"));
"Combo box * of *"));
ASSERT_TRUE( ASSERT_TRUE(
ui_test_utils::SendKeyPressToWindowSync( ui_test_utils::SendKeyPressToWindowSync(
window, ui::VKEY_TAB, false, false, false, false)); window, ui::VKEY_TAB, false, false, false, false));
EXPECT_EQ("Select your keyboard:", speech_monitor_.GetNextUtterance()); EXPECT_EQ("Select your keyboard:", monitor.GetNextUtterance());
} }
} // namespace chromeos } // namespace chromeos
...@@ -36,6 +36,8 @@ class UIControlsOzone : public ui_controls::UIControlsAura { ...@@ -36,6 +36,8 @@ class UIControlsOzone : public ui_controls::UIControlsAura {
bool alt, bool alt,
bool command, bool command,
const base::Closure& closure) OVERRIDE { const base::Closure& closure) OVERRIDE {
DCHECK(!command); // No command key on Aura
int flags = button_down_mask_; int flags = button_down_mask_;
if (control) { if (control) {
...@@ -53,11 +55,6 @@ class UIControlsOzone : public ui_controls::UIControlsAura { ...@@ -53,11 +55,6 @@ class UIControlsOzone : public ui_controls::UIControlsAura {
PostKeyEvent(ui::ET_KEY_PRESSED, ui::VKEY_MENU, flags); 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);
}
PostKeyEvent(ui::ET_KEY_PRESSED, key, flags); PostKeyEvent(ui::ET_KEY_PRESSED, key, flags);
PostKeyEvent(ui::ET_KEY_RELEASED, key, flags); PostKeyEvent(ui::ET_KEY_RELEASED, key, flags);
...@@ -76,11 +73,6 @@ class UIControlsOzone : public ui_controls::UIControlsAura { ...@@ -76,11 +73,6 @@ class UIControlsOzone : public ui_controls::UIControlsAura {
PostKeyEvent(ui::ET_KEY_RELEASED, ui::VKEY_CONTROL, flags); 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); RunClosureAfterAllPendingUIEvents(closure);
return true; return true;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment