|
|
Created:
6 years, 3 months ago by dmazzoni Modified:
6 years, 2 months ago Reviewers:
David Tseng CC:
chromium-reviews, oshima+watch_chromium.org, plundblad+watch_chromium.org, aboxhall+watch_chromium.org, arv+watch_chromium.org, yuzo+watch_chromium.org, dmazzoni+watch_chromium.org, dtseng+watch_chromium.org, stevenjb+watch_chromium.org, davemoore+watch_chromium.org, nkostylev+watch_chromium.org Base URL:
https://chromium.googlesource.com/chromium/src.git@sticky_key Project:
chromium Visibility:
Public. |
DescriptionAdd test for ChromeVox sticky mode.
BUG=408809
Committed: https://crrev.com/0ad49783e630e00bc9cde240774cc74b8a1b126b
Cr-Commit-Position: refs/heads/master@{#296960}
Patch Set 1 #Patch Set 2 : Cleaned up #
Total comments: 4
Patch Set 3 : Refactor press repeatedly function #Patch Set 4 : Rebase #Patch Set 5 : Rebase #Messages
Total messages: 14 (4 generated)
dmazzoni@chromium.org changed reviewers: + dtseng@chromium.org
PTAL; added test.
I think you responded to the wrong one? I'm waiting for your review on this one... On Thu, Sep 25, 2014 at 12:53 PM, <dtseng@chromium.org> wrote: > PTAL; added test. > > https://codereview.chromium.org/541903002/ > > To unsubscribe from this group and stop receiving emails from it, send an > email to chromium-reviews+unsubscribe@chromium.org. > To unsubscribe from this group and stop receiving emails from it, send an email to chromium-reviews+unsubscribe@chromium.org.
lgtm (previous response sent to the wrong issue). Just a suggestion. https://codereview.chromium.org/541903002/diff/20001/chrome/browser/chromeos/... File chrome/browser/chromeos/accessibility/spoken_feedback_browsertest.cc (right): https://codereview.chromium.org/541903002/diff/20001/chrome/browser/chromeos/... chrome/browser/chromeos/accessibility/spoken_feedback_browsertest.cc:342: EXPECT_FALSE(AccessibilityManager::Get()->IsSpokenFeedbackEnabled()); ASSERT? https://codereview.chromium.org/541903002/diff/20001/chrome/browser/chromeos/... chrome/browser/chromeos/accessibility/spoken_feedback_browsertest.cc:370: while (true) { I've had to do something similar for ChromeVox Next js based tests; perhaps refactor this pattern into a helper.
https://codereview.chromium.org/541903002/diff/20001/chrome/browser/chromeos/... File chrome/browser/chromeos/accessibility/spoken_feedback_browsertest.cc (right): https://codereview.chromium.org/541903002/diff/20001/chrome/browser/chromeos/... chrome/browser/chromeos/accessibility/spoken_feedback_browsertest.cc:342: EXPECT_FALSE(AccessibilityManager::Get()->IsSpokenFeedbackEnabled()); On 2014/09/25 20:36:57, David Tseng wrote: > ASSERT? Done. https://codereview.chromium.org/541903002/diff/20001/chrome/browser/chromeos/... chrome/browser/chromeos/accessibility/spoken_feedback_browsertest.cc:370: while (true) { On 2014/09/25 20:36:57, David Tseng wrote: > I've had to do something similar for ChromeVox Next js based tests; perhaps > refactor this pattern into a helper. Done.
The CQ bit was checked by dmazzoni@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/541903002/60001
The CQ bit was unchecked by commit-bot@chromium.org
Failed to apply patch for chrome/browser/chromeos/accessibility/spoken_feedback_browsertest.cc: While running git apply --index -3 -p1; error: patch failed: chrome/browser/chromeos/accessibility/spoken_feedback_browsertest.cc:313 Falling back to three-way merge... Applied patch to 'chrome/browser/chromeos/accessibility/spoken_feedback_browsertest.cc' with conflicts. U chrome/browser/chromeos/accessibility/spoken_feedback_browsertest.cc Patch: chrome/browser/chromeos/accessibility/spoken_feedback_browsertest.cc Index: chrome/browser/chromeos/accessibility/spoken_feedback_browsertest.cc diff --git a/chrome/browser/chromeos/accessibility/spoken_feedback_browsertest.cc b/chrome/browser/chromeos/accessibility/spoken_feedback_browsertest.cc index c4b85ce30a83df2d4fbe581bf08d103f3e65db67..9f519de23dab20d35e8d1f695fba15baec74a59f 100644 --- a/chrome/browser/chromeos/accessibility/spoken_feedback_browsertest.cc +++ b/chrome/browser/chromeos/accessibility/spoken_feedback_browsertest.cc @@ -135,6 +135,21 @@ class LoggedInSpokenFeedbackTest : public InProcessBrowserTest { ui_test_utils::NavigateToURL(browser(), url); } + void PressRepeatedlyUntilUtterance(ui::KeyboardCode key, + const std::string& expected_utterance) { + // This helper function is needed when you want to poll for something + // that happens asynchronously. Keep pressing |key|, until + // the speech feedback that follows is |expected_utterance|. + // Note that this doesn't work if pressing that key doesn't speak anything + // at all before the asynchronous event occurred. + while (true) { + SendKeyPress(key); + const std::string& utterance = speech_monitor_.GetNextUtterance(); + if (utterance == expected_utterance) + break; + } + } + SpeechMonitor speech_monitor_; private: @@ -143,7 +158,7 @@ class LoggedInSpokenFeedbackTest : public InProcessBrowserTest { }; IN_PROC_BROWSER_TEST_F(LoggedInSpokenFeedbackTest, AddBookmark) { - EXPECT_FALSE(AccessibilityManager::Get()->IsSpokenFeedbackEnabled()); + ASSERT_FALSE(AccessibilityManager::Get()->IsSpokenFeedbackEnabled()); AccessibilityManager::Get()->EnableSpokenFeedback( true, ash::A11Y_NOTIFICATION_NONE); @@ -227,7 +242,7 @@ INSTANTIATE_TEST_CASE_P( kTestAsGuestUser)); IN_PROC_BROWSER_TEST_P(SpokenFeedbackTest, EnableSpokenFeedback) { - EXPECT_FALSE(AccessibilityManager::Get()->IsSpokenFeedbackEnabled()); + ASSERT_FALSE(AccessibilityManager::Get()->IsSpokenFeedbackEnabled()); AccessibilityManager::Get()->EnableSpokenFeedback( true, ash::A11Y_NOTIFICATION_NONE); @@ -235,7 +250,7 @@ IN_PROC_BROWSER_TEST_P(SpokenFeedbackTest, EnableSpokenFeedback) { } IN_PROC_BROWSER_TEST_P(SpokenFeedbackTest, FocusToolbar) { - EXPECT_FALSE(AccessibilityManager::Get()->IsSpokenFeedbackEnabled()); + ASSERT_FALSE(AccessibilityManager::Get()->IsSpokenFeedbackEnabled()); AccessibilityManager::Get()->EnableSpokenFeedback( true, ash::A11Y_NOTIFICATION_NONE); @@ -250,7 +265,7 @@ IN_PROC_BROWSER_TEST_P(SpokenFeedbackTest, FocusToolbar) { } IN_PROC_BROWSER_TEST_P(SpokenFeedbackTest, TypeInOmnibox) { - EXPECT_FALSE(AccessibilityManager::Get()->IsSpokenFeedbackEnabled()); + ASSERT_FALSE(AccessibilityManager::Get()->IsSpokenFeedbackEnabled()); AccessibilityManager::Get()->EnableSpokenFeedback( true, ash::A11Y_NOTIFICATION_NONE); @@ -313,8 +328,50 @@ IN_PROC_BROWSER_TEST_P(SpokenFeedbackTest, ChromeVoxPrefixKey) { EXPECT_EQ("Enter a search query.", speech_monitor_.GetNextUtterance()); } +IN_PROC_BROWSER_TEST_P(SpokenFeedbackTest, ChromeVoxStickyMode) { + LoadChromeVoxAndThenNavigateToURL( + GURL("data:text/html;charset=utf-8," + "<label>Enter your name <input autofocus></label>" + "<p>One</p>" + "<h2>Two</h2>")); + while (speech_monitor_.GetNextUtterance() != "Enter your name") { + } + EXPECT_EQ("Edit text", speech_monitor_.GetNextUtterance()); + + // Press the sticky-key sequence: Search Search. + SendKeyPress(ui::VKEY_LWIN); + SendKeyPress(ui::VKEY_LWIN); + EXPECT_EQ("Sticky mode enabled", speech_monitor_.GetNextUtterance()); + + // Even once we hear "sticky mode enabled" from the ChromeVox background + // page, there's a short window of time when the content script still + // hasn't switched to sticky mode. That's why we're focused on a text box. + // Keep pressing the '/' key. If sticky mode is off, it will echo the word + // "slash". If sticky mode is on, it will open "Find in page". Keep pressing + // '/' until we get "Find in page.". + PressRepeatedlyUntilUtterance(ui::VKEY_OEM_2, "Find in page."); + EXPECT_EQ("Enter a search query.", speech_monitor_.GetNextUtterance()); + + // Press Esc to exit Find in Page mode. + SendKeyPress(ui::VKEY_ESCAPE); + EXPECT_EQ("Exited", speech_monitor_.GetNextUtterance()); + EXPECT_EQ("Find in page.", speech_monitor_.GetNextUtterance()); + + // Press N H to jump to the next heading. Skip over speech in-between + // but make sure we end up at the heading. + SendKeyPress(ui::VKEY_N); + SendKeyPress(ui::VKEY_H); + while (speech_monitor_.GetNextUtterance() != "Two") { + } + EXPECT_EQ("Heading 2", speech_monitor_.GetNextUtterance()); + + // Press the up arrow to go to the previous element. + SendKeyPress(ui::VKEY_UP); + EXPECT_EQ("One", speech_monitor_.GetNextUtterance()); +} + IN_PROC_BROWSER_TEST_P(SpokenFeedbackTest, TouchExploreStatusTray) { - EXPECT_FALSE(AccessibilityManager::Get()->IsSpokenFeedbackEnabled()); + ASSERT_FALSE(AccessibilityManager::Get()->IsSpokenFeedbackEnabled()); AccessibilityManager::Get()->EnableSpokenFeedback( true, ash::A11Y_NOTIFICATION_NONE); @@ -356,7 +413,7 @@ class GuestSpokenFeedbackTest : public LoggedInSpokenFeedbackTest { }; IN_PROC_BROWSER_TEST_F(GuestSpokenFeedbackTest, FocusToolbar) { - EXPECT_FALSE(AccessibilityManager::Get()->IsSpokenFeedbackEnabled()); + ASSERT_FALSE(AccessibilityManager::Get()->IsSpokenFeedbackEnabled()); AccessibilityManager::Get()->EnableSpokenFeedback( true, ash::A11Y_NOTIFICATION_NONE); @@ -399,7 +456,7 @@ class OobeSpokenFeedbackTest : public InProcessBrowserTest { // Test is flaky: http://crbug.com/346797 IN_PROC_BROWSER_TEST_F(OobeSpokenFeedbackTest, DISABLED_SpokenFeedbackInOobe) { ui_controls::EnableUIControls(); - EXPECT_FALSE(AccessibilityManager::Get()->IsSpokenFeedbackEnabled()); + ASSERT_FALSE(AccessibilityManager::Get()->IsSpokenFeedbackEnabled()); LoginDisplayHost* login_display_host = LoginDisplayHostImpl::default_host(); WebUILoginView* web_ui_login_view = login_display_host->GetWebUILoginView();
The CQ bit was checked by dmazzoni@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/541903002/80001
Message was sent while issue was closed.
Committed patchset #5 (id:80001) as 10b1c5408947ec807598f2ee604feead2ee669f5
Message was sent while issue was closed.
Patchset 5 (id:??) landed as https://crrev.com/0ad49783e630e00bc9cde240774cc74b8a1b126b Cr-Commit-Position: refs/heads/master@{#296960} |