Commit 18e2d4a0 authored by Trent Apted's avatar Trent Apted Committed by Commit Bot

Revert "Re-enable some SpokenFeedbackTests"

This reverts commit a3c46feb.

Reason for revert: Landed on top of https://chromium-review.googlesource.com/c/chromium/src/+/2120741 which needs to be reverted

Original change's description:
> Re-enable some SpokenFeedbackTests
> 
> General strategy:
> - perform all actions (sm_.Call)
> - gather pending utterances
> - mix in Expect* calls between all Call actions (incrementally from the top)
> - keep the tests mostly simple (limit UI interactions) to prevent flakes
> - do use the async SpeechMonitor api which should be less flakey
> - deleted one test who's behavior is still in flux (empty panel menu behavior)
> 
> Some tests were still failing but due to external factors. Comments left.
> 
> Change-Id: I7689880dbeeac3b31fe22a8029fae5078d975f0a
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2119382
> Commit-Queue: David Tseng <dtseng@chromium.org>
> Reviewed-by: Akihiro Ota <akihiroota@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#753470}

TBR=dmazzoni@chromium.org,dtseng@chromium.org,akihiroota@chromium.org

Change-Id: I01288031b7aab5694da31522da5393bf25ff2018
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2121636Reviewed-by: default avatarTrent Apted <tapted@chromium.org>
Commit-Queue: Trent Apted <tapted@chromium.org>
Cr-Commit-Position: refs/heads/master@{#753517}
parent 6bd49e08
...@@ -230,10 +230,6 @@ void SpeechMonitor::Replay() { ...@@ -230,10 +230,6 @@ void SpeechMonitor::Replay() {
} }
void SpeechMonitor::MaybeContinueReplay() { void SpeechMonitor::MaybeContinueReplay() {
// This method can be called prior to Replay() being called.
if (!replay_called_)
return;
auto it = replay_queue_.begin(); auto it = replay_queue_.begin();
while (it != replay_queue_.end()) { while (it != replay_queue_.end()) {
if (it->first()) { if (it->first()) {
......
...@@ -140,32 +140,34 @@ IN_PROC_BROWSER_TEST_P(SpokenFeedbackAppListTest, ...@@ -140,32 +140,34 @@ IN_PROC_BROWSER_TEST_P(SpokenFeedbackAppListTest,
EXPECT_TRUE(PerformAcceleratorAction(ash::FOCUS_SHELF)); EXPECT_TRUE(PerformAcceleratorAction(ash::FOCUS_SHELF));
sm_.ExpectSpeech("Shelf"); while (sm_.GetNextUtterance() != "Press Search plus Space to activate") {
}
// Press space on the launcher button in shelf, this opens peeking launcher. // Press space on the launcher button in shelf, this opens peeking launcher.
sm_.Call([this]() { SendKeyPressWithSearch(ui::VKEY_SPACE); }); SendKeyPressWithSearch(ui::VKEY_SPACE);
sm_.ExpectSpeech("Launcher, partial view"); while (sm_.GetNextUtterance() != "Launcher, partial view") {
}
// Send a key press to enable keyboard traversal // Send a key press to enable keyboard traversal
sm_.Call([this]() { SendKeyPressWithSearchAndShift(ui::VKEY_TAB); }); SendKeyPressWithSearchAndShift(ui::VKEY_TAB);
// Move focus to expand all apps button. // Move focus to expand all apps button.
sm_.Call([this]() { SendKeyPressWithSearchAndShift(ui::VKEY_TAB); }); SendKeyPressWithSearchAndShift(ui::VKEY_TAB);
sm_.ExpectSpeech("Expand to all apps"); while (sm_.GetNextUtterance() != "Press Search plus Space to activate") {
}
// Press space on expand arrow to go to fullscreen launcher. // Press space on expand arrow to go to fullscreen launcher.
sm_.Call([this]() { SendKeyPressWithSearch(ui::VKEY_SPACE); }); SendKeyPressWithSearch(ui::VKEY_SPACE);
sm_.ExpectSpeech("Launcher, all apps"); while (sm_.GetNextUtterance() != "Launcher, all apps") {
}
// Make sure the first traversal left is not the expand arrow button. // Make sure the first traversal left is not the expand arrow button.
sm_.Call([this]() { SendKeyPressWithSearch(ui::VKEY_LEFT); }); SendKeyPressWithSearch(ui::VKEY_LEFT);
sm_.ExpectNextSpeechIsNot("Expand to all apps"); EXPECT_NE("Expand to all apps", sm_.GetNextUtterance());
// Make sure the second traversal left is not the expand arrow button. // Make sure the second traversal left is not the expand arrow button.
sm_.Call([this]() { SendKeyPressWithSearch(ui::VKEY_LEFT); }); SendKeyPressWithSearch(ui::VKEY_LEFT);
sm_.ExpectNextSpeechIsNot("Expand to all apps"); EXPECT_NE("Expand to all apps", sm_.GetNextUtterance());
sm_.Replay();
} }
IN_PROC_BROWSER_TEST_P(SpokenFeedbackAppListTest, IN_PROC_BROWSER_TEST_P(SpokenFeedbackAppListTest,
...@@ -254,49 +256,61 @@ IN_PROC_BROWSER_TEST_P(SpokenFeedbackAppListTest, ...@@ -254,49 +256,61 @@ IN_PROC_BROWSER_TEST_P(SpokenFeedbackAppListTest,
sm_.Replay(); sm_.Replay();
} }
IN_PROC_BROWSER_TEST_P(SpokenFeedbackAppListTest, NavigateAppLauncher) { // TODO(newcomer): reimplement this test once the AppListFocus changes are
// complete (http://crbug.com/784942).
IN_PROC_BROWSER_TEST_P(SpokenFeedbackAppListTest,
DISABLED_NavigateAppLauncher) {
EnableChromeVox(); EnableChromeVox();
// Add one app to the applist.
PopulateApps(1);
EXPECT_TRUE(PerformAcceleratorAction(ash::FOCUS_SHELF)); EXPECT_TRUE(PerformAcceleratorAction(ash::FOCUS_SHELF));
// Wait for it to say "Launcher", "Button", "Shelf", "Tool bar". // Wait for it to say "Launcher", "Button", "Shelf", "Tool bar".
sm_.ExpectSpeechPattern("Launcher"); while (true) {
sm_.ExpectSpeech("Button"); std::string utterance = sm_.GetNextUtterance();
sm_.ExpectSpeech("Shelf"); if (base::MatchPattern(utterance, "Launcher"))
sm_.ExpectSpeech("Tool bar"); break;
}
EXPECT_EQ("Button", sm_.GetNextUtterance());
EXPECT_EQ("Shelf", sm_.GetNextUtterance());
EXPECT_EQ("Tool bar", sm_.GetNextUtterance());
// Click on the launcher, it brings up the app list UI. // Click on the launcher, it brings up the app list UI.
sm_.Call([this]() { SendKeyPress(ui::VKEY_SPACE); }); SendKeyPress(ui::VKEY_SPACE);
sm_.ExpectSpeech( while ("Search or type URL" != sm_.GetNextUtterance()) {
"Search your device, apps, and web. Use the arrow keys to navigate your " }
"apps."); while ("Edit text" != sm_.GetNextUtterance()) {
sm_.ExpectSpeech("Edit text"); }
// Close it and open it again. // Close it and open it again.
sm_.Call([this]() { SendKeyPress(ui::VKEY_ESCAPE); }); SendKeyPress(ui::VKEY_ESCAPE);
sm_.ExpectSpeechPattern("*window*"); while (true) {
std::string utterance = sm_.GetNextUtterance();
sm_.Call( if (base::MatchPattern(utterance, "*window*"))
[this]() { EXPECT_TRUE(PerformAcceleratorAction(ash::FOCUS_SHELF)); }); break;
sm_.ExpectSpeechPattern("Launcher"); }
sm_.ExpectSpeech("Button");
sm_.Call([this]() { SendKeyPress(ui::VKEY_SPACE); }); EXPECT_TRUE(PerformAcceleratorAction(ash::FOCUS_SHELF));
sm_.ExpectSpeech( while (true) {
"Search your device, apps, and web. Use the arrow keys to navigate your " std::string utterance = sm_.GetNextUtterance();
"apps."); if (base::MatchPattern(utterance, "Button"))
break;
}
SendKeyPress(ui::VKEY_SPACE);
// Now type a space into the text field and wait until we hear "space".
// This makes the test more robust as it allows us to skip over other
// speech along the way.
SendKeyPress(ui::VKEY_SPACE);
while (true) {
if ("space" == sm_.GetNextUtterance())
break;
}
// Now press the right arrow and we should be focused on an app button // Now press the down arrow and we should be focused on an app button
// in a dialog. // in a dialog.
// THis doesn't work though (to be done below). SendKeyPress(ui::VKEY_DOWN);
while ("Button" != sm_.GetNextUtterance()) {
// TODO(newcomer): reimplement this test once the AppListFocus changes are }
// complete (http://crbug.com/784942).
sm_.Replay();
} }
} // namespace chromeos } // namespace chromeos
...@@ -29,7 +29,6 @@ class LoggedInSpokenFeedbackTest : public InProcessBrowserTest { ...@@ -29,7 +29,6 @@ class LoggedInSpokenFeedbackTest : public InProcessBrowserTest {
// Simulate key press event. // Simulate key press event.
void SendKeyPress(ui::KeyboardCode key); void SendKeyPress(ui::KeyboardCode key);
void SendKeyPressWithControl(ui::KeyboardCode key); void SendKeyPressWithControl(ui::KeyboardCode key);
void SendKeyPressWithShift(ui::KeyboardCode key);
void SendKeyPressWithSearchAndShift(ui::KeyboardCode key); void SendKeyPressWithSearchAndShift(ui::KeyboardCode key);
void SendKeyPressWithSearch(ui::KeyboardCode key); void SendKeyPressWithSearch(ui::KeyboardCode key);
void SendKeyPressWithSearchAndControl(ui::KeyboardCode key); void SendKeyPressWithSearchAndControl(ui::KeyboardCode key);
......
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