Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(205)

Unified Diff: chrome/browser/chromeos/accessibility/spoken_feedback_browsertest.cc

Issue 2447773002: Use setSequentialFocusNavigationStartingPoint in ChromeVox (Closed)
Patch Set: Links or controls Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 e3a1b70da126ddb93afbb3db5c18c9ccb68291cc..6a8d40f7f2dfb8b8b50565aa337239139966c062 100644
--- a/chrome/browser/chromeos/accessibility/spoken_feedback_browsertest.cc
+++ b/chrome/browser/chromeos/accessibility/spoken_feedback_browsertest.cc
@@ -622,6 +622,48 @@ IN_PROC_BROWSER_TEST_P(SpokenFeedbackTest, TouchExploreStatusTray) {
EXPECT_EQ("Button", speech_monitor_.GetNextUtterance());
}
+IN_PROC_BROWSER_TEST_P(SpokenFeedbackTest, ChromeVoxNextTabRecovery) {
+ EnableChromeVox();
+
+ ui_test_utils::NavigateToURL(
+ browser(), GURL("data:text/html;charset=utf-8,"
+ "<button id='b1' autofocus>11</button>"
+ "<button>22</button>"
+ "<button>33</button>"
+ "<h1>Middle</h1>"
+ "<button>44</button>"
+ "<button>55</button>"
+ "<div id=console aria-live=polite></div>"
+ "<script>"
+ "var b1 = document.getElementById('b1');"
+ "b1.addEventListener('blur', function() {"
+ " document.getElementById('console').innerText = "
+ "'button lost focus';"
+ "});"
+ "</script>"));
+ while ("Button" != speech_monitor_.GetNextUtterance()) {
+ }
+
+ // Press Search+H to go to the next heading
+ SendKeyPressWithSearch(ui::VKEY_H);
+ while ("Middle" != speech_monitor_.GetNextUtterance()) {
+ }
+
+ // To ensure that the setSequentialFocusNavigationStartingPoint has
+ // executed before pressing Tab, the page has an event handler waiting
+ // for the 'blur' event on the button, and when it loses focus it
+ // triggers a live region announcement that we wait for, here.
+ while ("button lost focus" != speech_monitor_.GetNextUtterance()) {
+ }
+
+ // Now we know that focus has left the button, so the sequential focus
+ // navigation starting point must be on the heading. Press Tab and
+ // ensure that we land on the first link past the heading.
+ SendKeyPress(ui::VKEY_TAB);
+ while ("44" != speech_monitor_.GetNextUtterance()) {
+ }
+}
+
//
// Spoken feedback tests that run only in guest mode.
//

Powered by Google App Engine
This is Rietveld 408576698