Chromium Code Reviews| 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 14357cc7ecc0d97c0f5ceb48b1de01fc713ef94c..3563dc13a343cfe2fb337d03eeb426e58823e7cd 100644 |
| --- a/chrome/browser/chromeos/accessibility/spoken_feedback_browsertest.cc |
| +++ b/chrome/browser/chromeos/accessibility/spoken_feedback_browsertest.cc |
| @@ -176,16 +176,18 @@ class LoggedInSpokenFeedbackTest : public InProcessBrowserTest { |
| DISALLOW_COPY_AND_ASSIGN(LoggedInSpokenFeedbackTest); |
| }; |
| -IN_PROC_BROWSER_TEST_F(LoggedInSpokenFeedbackTest, AddBookmark) { |
| +// This test is very flakey with ChromeVox Next since we generate a lot more |
| +// utterances for text fields. |
| +// TODO(dtseng): Fix properly. |
| +IN_PROC_BROWSER_TEST_F(LoggedInSpokenFeedbackTest, DISABLED_AddBookmark) { |
| EnableChromeVox(); |
| chrome::ExecuteCommand(browser(), IDC_SHOW_BOOKMARK_BAR); |
| // Create a bookmark with title "foo". |
| chrome::ExecuteCommand(browser(), IDC_BOOKMARK_PAGE); |
| - EXPECT_EQ("Bookmark added!,", speech_monitor_.GetNextUtterance()); |
| - EXPECT_EQ("about blank,", speech_monitor_.GetNextUtterance()); |
| - EXPECT_EQ("Bookmark name,", speech_monitor_.GetNextUtterance()); |
| - EXPECT_EQ("text box", speech_monitor_.GetNextUtterance()); |
| + EXPECT_EQ("Bookmark added! dialog Bookmark name about:blank Edit text", |
| + speech_monitor_.GetNextUtterance()); |
| + EXPECT_EQ("about:blank", speech_monitor_.GetNextUtterance()); |
| SendKeyPress(ui::VKEY_F); |
| EXPECT_EQ("f", speech_monitor_.GetNextUtterance()); |
| @@ -195,9 +197,8 @@ IN_PROC_BROWSER_TEST_F(LoggedInSpokenFeedbackTest, AddBookmark) { |
| EXPECT_EQ("o", speech_monitor_.GetNextUtterance()); |
| SendKeyPress(ui::VKEY_TAB); |
| - EXPECT_EQ("Bookmarks bar,", speech_monitor_.GetNextUtterance()); |
| - EXPECT_EQ("Bookmark folder,", speech_monitor_.GetNextUtterance()); |
| - EXPECT_TRUE(MatchPattern(speech_monitor_.GetNextUtterance(), "combo box*")); |
| + EXPECT_EQ("Bookmark folder combo Box Bookmarks bar", |
| + speech_monitor_.GetNextUtterance()); |
| SendKeyPress(ui::VKEY_RETURN); |
| @@ -260,25 +261,17 @@ IN_PROC_BROWSER_TEST_P(SpokenFeedbackTest, EnableSpokenFeedback) { |
| IN_PROC_BROWSER_TEST_P(SpokenFeedbackTest, FocusToolbar) { |
| EnableChromeVox(); |
| - |
| chrome::ExecuteCommand(browser(), IDC_FOCUS_TOOLBAR); |
| - // Might be "Google Chrome Toolbar" or "Chromium Toolbar". |
| - EXPECT_TRUE(MatchPattern(speech_monitor_.GetNextUtterance(), "*oolbar*")); |
| - EXPECT_EQ("Reload,", speech_monitor_.GetNextUtterance()); |
| - EXPECT_EQ("button", speech_monitor_.GetNextUtterance()); |
| + EXPECT_TRUE( |
| + MatchPattern(speech_monitor_.GetNextUtterance(), |
| + "about:blank about:blank*Toolbar toolbar Reload Button")); |
|
dmazzoni
2014/11/29 08:03:59
Why is about:blank there twice? How about the shor
David Tseng
2014/12/04 17:15:31
about:blank is there twice because the ancestry 'e
|
| } |
| IN_PROC_BROWSER_TEST_P(SpokenFeedbackTest, TypeInOmnibox) { |
| EnableChromeVox(); |
| - // Wait for ChromeVox to finish speaking. |
| chrome::ExecuteCommand(browser(), IDC_FOCUS_LOCATION); |
| - while (true) { |
| - std::string utterance = speech_monitor_.GetNextUtterance(); |
| - VLOG(0) << "Got utterance: " << utterance; |
| - if (utterance == "text box") |
| - break; |
| - } |
| + EXPECT_TRUE(MatchPattern(speech_monitor_.GetNextUtterance(), "*Edit text")); |
| SendKeyPress(ui::VKEY_X); |
| EXPECT_EQ("x", speech_monitor_.GetNextUtterance()); |
| @@ -297,12 +290,10 @@ IN_PROC_BROWSER_TEST_P(SpokenFeedbackTest, FocusShelf) { |
| EnableChromeVox(); |
| EXPECT_TRUE(PerformAcceleratorAction(ash::FOCUS_SHELF)); |
| - EXPECT_EQ("Shelf,", speech_monitor_.GetNextUtterance()); |
| - EXPECT_EQ("Apps,", speech_monitor_.GetNextUtterance()); |
| - EXPECT_EQ("button", speech_monitor_.GetNextUtterance()); |
| + EXPECT_EQ("Shelf toolbar Apps Button", speech_monitor_.GetNextUtterance()); |
| SendKeyPress(ui::VKEY_TAB); |
| - EXPECT_TRUE(MatchPattern(speech_monitor_.GetNextUtterance(), "*, button")); |
| + EXPECT_TRUE(MatchPattern(speech_monitor_.GetNextUtterance(), "* Button")); |
| } |
| IN_PROC_BROWSER_TEST_P(SpokenFeedbackTest, NavigateAppLauncher) { |
| @@ -311,27 +302,26 @@ IN_PROC_BROWSER_TEST_P(SpokenFeedbackTest, NavigateAppLauncher) { |
| EXPECT_TRUE(PerformAcceleratorAction(ash::FOCUS_SHELF)); |
| while (true) { |
| std::string utterance = speech_monitor_.GetNextUtterance(); |
| - if (utterance == "button") |
| + if (MatchPattern(utterance, "*Button")) |
| break; |
| } |
| SendKeyPress(ui::VKEY_RETURN); |
| - EXPECT_TRUE(MatchPattern(speech_monitor_.GetNextUtterance(), "Chrom*,")); |
| - EXPECT_EQ("text box", speech_monitor_.GetNextUtterance()); |
| + EXPECT_TRUE(MatchPattern(speech_monitor_.GetNextUtterance(), "*Edit text")); |
| SendKeyPress(ui::VKEY_DOWN); |
| - EXPECT_TRUE(MatchPattern(speech_monitor_.GetNextUtterance(), "*, button")); |
| + EXPECT_TRUE(MatchPattern(speech_monitor_.GetNextUtterance(), "* Button")); |
| } |
| IN_PROC_BROWSER_TEST_P(SpokenFeedbackTest, OpenStatusTray) { |
| EnableChromeVox(); |
| EXPECT_TRUE(PerformAcceleratorAction(ash::SHOW_SYSTEM_TRAY_BUBBLE)); |
| - EXPECT_EQ("Status tray,", speech_monitor_.GetNextUtterance()); |
| + EXPECT_TRUE(MatchPattern(speech_monitor_.GetNextUtterance(), "Status tray*")); |
| EXPECT_TRUE(MatchPattern(speech_monitor_.GetNextUtterance(), "time *")); |
| EXPECT_TRUE(MatchPattern(speech_monitor_.GetNextUtterance(), |
| "Battery is*full.")); |
| - EXPECT_TRUE(MatchPattern(speech_monitor_.GetNextUtterance(), "*, button")); |
| + EXPECT_TRUE(MatchPattern(speech_monitor_.GetNextUtterance(), "*Button")); |
| } |
| IN_PROC_BROWSER_TEST_P(SpokenFeedbackTest, NavigateSystemTray) { |
| @@ -340,7 +330,7 @@ IN_PROC_BROWSER_TEST_P(SpokenFeedbackTest, NavigateSystemTray) { |
| EXPECT_TRUE(PerformAcceleratorAction(ash::SHOW_SYSTEM_TRAY_BUBBLE)); |
| while (true) { |
| std::string utterance = speech_monitor_.GetNextUtterance(); |
| - if (MatchPattern(utterance, "*, button")) |
| + if (MatchPattern(utterance, "* Button")) |
| break; |
| } |
| @@ -348,7 +338,7 @@ IN_PROC_BROWSER_TEST_P(SpokenFeedbackTest, NavigateSystemTray) { |
| while (true) { |
| SendKeyPress(ui::VKEY_TAB); |
| std::string utterance = speech_monitor_.GetNextUtterance(); |
| - if (MatchPattern(utterance, "*Bluetooth*, button")) |
| + if (MatchPattern(utterance, "*Bluetooth* Button")) |
|
dmazzoni
2014/11/29 08:03:59
BTW, are you sure you want to remove this comma be
David Tseng
2014/12/04 17:15:31
It depends. Commas between name role and state see
|
| break; |
| } |
| SendKeyPress(ui::VKEY_RETURN); |
| @@ -357,12 +347,12 @@ IN_PROC_BROWSER_TEST_P(SpokenFeedbackTest, NavigateSystemTray) { |
| while (true) { |
| SendKeyPress(ui::VKEY_TAB); |
| std::string utterance = speech_monitor_.GetNextUtterance(); |
| - if (MatchPattern(utterance, "Previous menu, button")) |
| + if (MatchPattern(utterance, "Previous menu Button")) |
| break; |
| } |
| SendKeyPress(ui::VKEY_RETURN); |
| - EXPECT_TRUE(MatchPattern(speech_monitor_.GetNextUtterance(), |
| - "*Bluetooth*, button")); |
| + EXPECT_TRUE( |
| + MatchPattern(speech_monitor_.GetNextUtterance(), "*Bluetooth* Button")); |
| } |
| IN_PROC_BROWSER_TEST_P(SpokenFeedbackTest, ScreenBrightness) { |
| @@ -381,7 +371,7 @@ IN_PROC_BROWSER_TEST_P(SpokenFeedbackTest, VolumeSlider) { |
| EnableChromeVox(); |
| EXPECT_TRUE(PerformAcceleratorAction(ash::VOLUME_UP)); |
| - EXPECT_TRUE(MatchPattern(speech_monitor_.GetNextUtterance(), "*%,")); |
| + EXPECT_TRUE(MatchPattern(speech_monitor_.GetNextUtterance(), "* percent*")); |
| EXPECT_EQ("Volume,", speech_monitor_.GetNextUtterance()); |
| EXPECT_EQ("slider", speech_monitor_.GetNextUtterance()); |
| } |
| @@ -390,12 +380,12 @@ IN_PROC_BROWSER_TEST_P(SpokenFeedbackTest, OverviewMode) { |
| EnableChromeVox(); |
| EXPECT_TRUE(PerformAcceleratorAction(ash::TOGGLE_OVERVIEW)); |
| - EXPECT_EQ("Alert Entered window overview mode", |
| + EXPECT_EQ("Edit text", speech_monitor_.GetNextUtterance()); |
| + EXPECT_EQ("Entered window overview mode, window", |
| speech_monitor_.GetNextUtterance()); |
| - EXPECT_EQ(", text box", speech_monitor_.GetNextUtterance()); |
| SendKeyPress(ui::VKEY_TAB); |
| - EXPECT_EQ("about blank, button", speech_monitor_.GetNextUtterance()); |
| + EXPECT_EQ("about:blank Button", speech_monitor_.GetNextUtterance()); |
| } |
| IN_PROC_BROWSER_TEST_P(SpokenFeedbackTest, ChromeVoxShiftSearch) { |
| @@ -515,8 +505,8 @@ IN_PROC_BROWSER_TEST_P(SpokenFeedbackTest, TouchExploreStatusTray) { |
| EXPECT_EQ("Status tray,", speech_monitor_.GetNextUtterance()); |
| EXPECT_TRUE(MatchPattern(speech_monitor_.GetNextUtterance(), "time*,")); |
| - EXPECT_TRUE(MatchPattern(speech_monitor_.GetNextUtterance(), "Battery*,")); |
| - EXPECT_EQ("button", speech_monitor_.GetNextUtterance()); |
| + EXPECT_TRUE(MatchPattern(speech_monitor_.GetNextUtterance(), "Battery*")); |
| + EXPECT_EQ("Button", speech_monitor_.GetNextUtterance()); |
| } |
| // |
| @@ -544,10 +534,10 @@ IN_PROC_BROWSER_TEST_F(GuestSpokenFeedbackTest, FocusToolbar) { |
| EnableChromeVox(); |
| chrome::ExecuteCommand(browser(), IDC_FOCUS_TOOLBAR); |
| - // Might be "Google Chrome Toolbar" or "Chromium Toolbar". |
| - EXPECT_TRUE(MatchPattern(speech_monitor_.GetNextUtterance(), "*oolbar*")); |
| - EXPECT_EQ("Reload,", speech_monitor_.GetNextUtterance()); |
| - EXPECT_EQ("button", speech_monitor_.GetNextUtterance()); |
| + |
| + EXPECT_TRUE( |
| + MatchPattern(speech_monitor_.GetNextUtterance(), |
| + "about:blank about:blank*Toolbar toolbar Reload Button")); |
|
dmazzoni
2014/11/29 08:03:59
same as above
David Tseng
2014/12/04 17:15:31
Ditto.
|
| } |
| // |