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

Unified Diff: chrome/browser/apps/guest_view/web_view_browsertest.cc

Issue 1815933002: Fix WebView accessibility (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rename set_browser_plugin_embedder_ax_tree_id Created 4 years, 9 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
« no previous file with comments | « no previous file | chrome/test/data/extensions/platform_apps/web_view/focus_accessibility/main.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/apps/guest_view/web_view_browsertest.cc
diff --git a/chrome/browser/apps/guest_view/web_view_browsertest.cc b/chrome/browser/apps/guest_view/web_view_browsertest.cc
index 754b9073ba878427a13adab2034da00fbd9fa5f3..2a232579a9fbf7fa76ec529a5a137089d2f64a54 100644
--- a/chrome/browser/apps/guest_view/web_view_browsertest.cc
+++ b/chrome/browser/apps/guest_view/web_view_browsertest.cc
@@ -738,6 +738,11 @@ INSTANTIATE_TEST_CASE_P(WebViewTests, WebViewTest, testing::Bool());
// These features current would not work with
// --use-cross-process-frames-for-guest and is disabled on
// UseCrossProcessFramesForGuests.
+class WebViewAccessibilityTest : public WebViewTest {};
+INSTANTIATE_TEST_CASE_P(WebViewTests,
+ WebViewAccessibilityTest,
+ testing::Values(false));
+
class WebViewNewWindowTest : public WebViewTest {};
INSTANTIATE_TEST_CASE_P(WebViewTests,
WebViewNewWindowTest,
@@ -2664,6 +2669,35 @@ IN_PROC_BROWSER_TEST_P(WebViewTest, LoadWebviewAccessibleResource) {
"web_view/load_webview_accessible_resource", NEEDS_TEST_SERVER);
}
+IN_PROC_BROWSER_TEST_P(WebViewAccessibilityTest, FocusAccessibility) {
+ LoadAppWithGuest("web_view/focus_accessibility");
+ content::WebContents* web_contents = GetFirstAppWindowWebContents();
+ content::EnableAccessibilityForWebContents(web_contents);
+ content::WebContents* guest_web_contents = GetGuestWebContents();
+ content::EnableAccessibilityForWebContents(guest_web_contents);
+
+ // Wait for focus to land on the "root web area" role, representing
+ // focus on the main document itself.
+ while (content::GetFocusedAccessibilityNodeInfo(web_contents).role !=
+ ui::AX_ROLE_ROOT_WEB_AREA) {
+ content::WaitForAccessibilityFocusChange();
+ }
+
+ // Now keep pressing the Tab key until focus lands on a button.
+ while (content::GetFocusedAccessibilityNodeInfo(web_contents).role !=
+ ui::AX_ROLE_BUTTON) {
+ content::SimulateKeyPress(
+ web_contents, ui::VKEY_TAB, false, false, false, false);
+ content::WaitForAccessibilityFocusChange();
+ }
+
+ // Ensure that we hit the button inside the guest frame labeled
+ // "Guest button".
+ ui::AXNodeData node_data =
+ content::GetFocusedAccessibilityNodeInfo(web_contents);
+ EXPECT_EQ("Guest button", node_data.GetStringAttribute(ui::AX_ATTR_NAME));
+}
+
class WebViewGuestScrollTest
: public WebViewTestBase,
public testing::WithParamInterface<testing::tuple<bool, bool>> {
« no previous file with comments | « no previous file | chrome/test/data/extensions/platform_apps/web_view/focus_accessibility/main.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698