Commit 744746cc authored by agable's avatar agable Committed by Commit bot

Revert of Add test for ChromeVox keyboard commands. (patchset #6 of...

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

Reason for revert:
Broke interactive_ui_tests on chromium.chromiumos waterfall: http://build.chromium.org/p/chromium.chromiumos/builders/Linux%20ChromiumOS%20Ozone%20Tests%20%282%29/builds/1291

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

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

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

Cr-Commit-Position: refs/heads/master@{#291576}
parent 950d9641
...@@ -60,24 +60,11 @@ class LoggedInSpokenFeedbackTest : public InProcessBrowserTest { ...@@ -60,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) {
...@@ -251,93 +238,6 @@ IN_PROC_BROWSER_TEST_P(SpokenFeedbackTest, TypeInOmnibox) { ...@@ -251,93 +238,6 @@ IN_PROC_BROWSER_TEST_P(SpokenFeedbackTest, TypeInOmnibox) {
EXPECT_EQ("z", monitor.GetNextUtterance()); EXPECT_EQ("z", monitor.GetNextUtterance());
} }
IN_PROC_BROWSER_TEST_P(SpokenFeedbackTest, ChromeVoxShiftSearch) {
EXPECT_FALSE(AccessibilityManager::Get()->IsSpokenFeedbackEnabled());
SpeechMonitor monitor;
AccessibilityManager::Get()->EnableSpokenFeedback(
true, ash::A11Y_NOTIFICATION_NONE);
EXPECT_TRUE(monitor.SkipChromeVoxEnabledMessage());
ui_test_utils::NavigateToURL(
browser(),
GURL("data:text/html;charset=utf-8,<button autofocus>Click me</button>"));
while (true) {
std::string utterance = monitor.GetNextUtterance();
if (utterance == "Click me")
break;
}
EXPECT_EQ("Button", monitor.GetNextUtterance());
// Press Search+Shift+/ to enter ChromeVox's "find in page".
SendKeyPressWithSearchAndShift(ui::VKEY_OEM_2);
EXPECT_EQ("Find in page.", monitor.GetNextUtterance());
EXPECT_EQ("Enter a search query.", monitor.GetNextUtterance());
}
IN_PROC_BROWSER_TEST_P(SpokenFeedbackTest, ChromeVoxPrefixKey) {
EXPECT_FALSE(AccessibilityManager::Get()->IsSpokenFeedbackEnabled());
SpeechMonitor monitor;
AccessibilityManager::Get()->EnableSpokenFeedback(
true, ash::A11Y_NOTIFICATION_NONE);
EXPECT_TRUE(monitor.SkipChromeVoxEnabledMessage());
ui_test_utils::NavigateToURL(
browser(),
GURL("data:text/html;charset=utf-8,<button autofocus>Click me</button>"));
while (true) {
std::string utterance = monitor.GetNextUtterance();
if (utterance == "Click me")
break;
}
EXPECT_EQ("Button", 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.", monitor.GetNextUtterance());
EXPECT_EQ("Enter a search query.", monitor.GetNextUtterance());
}
IN_PROC_BROWSER_TEST_P(SpokenFeedbackTest, ChromeVoxNavigateAndSelect) {
EXPECT_FALSE(AccessibilityManager::Get()->IsSpokenFeedbackEnabled());
SpeechMonitor monitor;
AccessibilityManager::Get()->EnableSpokenFeedback(
true, ash::A11Y_NOTIFICATION_NONE);
EXPECT_TRUE(monitor.SkipChromeVoxEnabledMessage());
ui_test_utils::NavigateToURL(
browser(),
GURL("data:text/html;charset=utf-8,"
"<h1>Title</h1>"
"<button autofocus>Click me</button>"));
while (true) {
std::string utterance = monitor.GetNextUtterance();
if (utterance == "Click me")
break;
}
EXPECT_EQ("Button", monitor.GetNextUtterance());
// Press Search+Shift+Up to navigate to the previous item.
SendKeyPressWithSearchAndShift(ui::VKEY_UP);
EXPECT_EQ("Title", monitor.GetNextUtterance());
EXPECT_EQ("Heading 1", monitor.GetNextUtterance());
// Press Search+Shift+S to select the text.
SendKeyPressWithSearchAndShift(ui::VKEY_S);
EXPECT_EQ("Start selection", monitor.GetNextUtterance());
EXPECT_EQ("Title", monitor.GetNextUtterance());
EXPECT_EQ(", selected", monitor.GetNextUtterance());
// Press again to end the selection.
SendKeyPressWithSearchAndShift(ui::VKEY_S);
EXPECT_EQ("End selection", monitor.GetNextUtterance());
EXPECT_EQ("Title", 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());
......
...@@ -56,6 +56,7 @@ class UIControlsX11 : public UIControlsAura { ...@@ -56,6 +56,7 @@ class UIControlsX11 : public UIControlsAura {
bool shift, bool shift,
bool alt, bool alt,
bool command) OVERRIDE { bool command) OVERRIDE {
DCHECK(!command); // No command key on Aura
return SendKeyPressNotifyWhenDone( return SendKeyPressNotifyWhenDone(
window, key, control, shift, alt, command, base::Closure()); window, key, control, shift, alt, command, base::Closure());
} }
...@@ -67,6 +68,7 @@ class UIControlsX11 : public UIControlsAura { ...@@ -67,6 +68,7 @@ class UIControlsX11 : public 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
XEvent xevent = {0}; XEvent xevent = {0};
xevent.xkey.type = KeyPress; xevent.xkey.type = KeyPress;
if (control) if (control)
...@@ -75,8 +77,6 @@ class UIControlsX11 : public UIControlsAura { ...@@ -75,8 +77,6 @@ class UIControlsX11 : public UIControlsAura {
SetKeycodeAndSendThenMask(&xevent, XK_Shift_L, ShiftMask); SetKeycodeAndSendThenMask(&xevent, XK_Shift_L, ShiftMask);
if (alt) if (alt)
SetKeycodeAndSendThenMask(&xevent, XK_Alt_L, Mod1Mask); SetKeycodeAndSendThenMask(&xevent, XK_Alt_L, Mod1Mask);
if (command)
SetKeycodeAndSendThenMask(&xevent, XK_Super_L, Mod4Mask);
xevent.xkey.keycode = xevent.xkey.keycode =
XKeysymToKeycode(gfx::GetXDisplay(), XKeysymToKeycode(gfx::GetXDisplay(),
ui::XKeysymForWindowsKeyCode(key, shift)); ui::XKeysymForWindowsKeyCode(key, shift));
...@@ -91,8 +91,6 @@ class UIControlsX11 : public UIControlsAura { ...@@ -91,8 +91,6 @@ class UIControlsX11 : public UIControlsAura {
UnmaskAndSetKeycodeThenSend(&xevent, ShiftMask, XK_Shift_L); UnmaskAndSetKeycodeThenSend(&xevent, ShiftMask, XK_Shift_L);
if (control) if (control)
UnmaskAndSetKeycodeThenSend(&xevent, ControlMask, XK_Control_L); UnmaskAndSetKeycodeThenSend(&xevent, ControlMask, XK_Control_L);
if (command)
UnmaskAndSetKeycodeThenSend(&xevent, Mod4Mask, XK_Super_L);
DCHECK(!xevent.xkey.state); DCHECK(!xevent.xkey.state);
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