diff options
author | je_julie.kim <je_julie.kim@samsung.com> | 2014-10-03 01:34:58 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-10-03 08:35:10 +0000 |
commit | 4c5b538078c55a046de21033e3fef61cfa4e7aa2 (patch) | |
tree | f29929970c7d07242045143a53213d511b89b0f1 | |
parent | 06d32878eeabdf9a12c76b8ee89bd5ac5b81d648 (diff) | |
download | chromium_src-4c5b538078c55a046de21033e3fef61cfa4e7aa2.zip chromium_src-4c5b538078c55a046de21033e3fef61cfa4e7aa2.tar.gz chromium_src-4c5b538078c55a046de21033e3fef61cfa4e7aa2.tar.bz2 |
Handle dl role for browsertests
This patch enables AccessibilitDl test and adds the case for dl role in
browsertests on Mac and Android.
BUG=226505
R=dmazzoni@chromium.org, aboxhall@chromium.org
Review URL: https://codereview.chromium.org/627603002
Cr-Commit-Position: refs/heads/master@{#298013}
3 files changed, 10 insertions, 11 deletions
diff --git a/content/browser/accessibility/browser_accessibility_android.cc b/content/browser/accessibility/browser_accessibility_android.cc index dc62c79..6f7c71f 100644 --- a/content/browser/accessibility/browser_accessibility_android.cc +++ b/content/browser/accessibility/browser_accessibility_android.cc @@ -117,6 +117,7 @@ bool BrowserAccessibilityAndroid::IsCollection() const { return (GetRole() == ui::AX_ROLE_GRID || GetRole() == ui::AX_ROLE_LIST || GetRole() == ui::AX_ROLE_LIST_BOX || + GetRole() == ui::AX_ROLE_DESCRIPTION_LIST || GetRole() == ui::AX_ROLE_TABLE || GetRole() == ui::AX_ROLE_TREE); } @@ -165,6 +166,7 @@ bool BrowserAccessibilityAndroid::IsHeading() const { bool BrowserAccessibilityAndroid::IsHierarchical() const { return (GetRole() == ui::AX_ROLE_LIST || + GetRole() == ui::AX_ROLE_DESCRIPTION_LIST || GetRole() == ui::AX_ROLE_TREE); } @@ -250,6 +252,7 @@ const char* BrowserAccessibilityAndroid::GetClassName() const { break; case ui::AX_ROLE_LIST: case ui::AX_ROLE_LIST_BOX: + case ui::AX_ROLE_DESCRIPTION_LIST: class_name = "android.widget.ListView"; break; case ui::AX_ROLE_DIALOG: @@ -356,6 +359,7 @@ int BrowserAccessibilityAndroid::GetItemCount() const { switch(GetRole()) { case ui::AX_ROLE_LIST: case ui::AX_ROLE_LIST_BOX: + case ui::AX_ROLE_DESCRIPTION_LIST: count = PlatformChildCount(); break; case ui::AX_ROLE_SLIDER: @@ -519,6 +523,7 @@ int BrowserAccessibilityAndroid::RowCount() const { if (GetRole() == ui::AX_ROLE_LIST || GetRole() == ui::AX_ROLE_LIST_BOX || + GetRole() == ui::AX_ROLE_DESCRIPTION_LIST || GetRole() == ui::AX_ROLE_TREE) { return PlatformChildCount(); } diff --git a/content/browser/accessibility/browser_accessibility_cocoa.mm b/content/browser/accessibility/browser_accessibility_cocoa.mm index a4b31fc..75c3ff1 100644 --- a/content/browser/accessibility/browser_accessibility_cocoa.mm +++ b/content/browser/accessibility/browser_accessibility_cocoa.mm @@ -700,16 +700,11 @@ NSDictionary* attributeToMethodNameMap = nil; return @"AXSecureTextField"; } - NSString* htmlTag = NSStringForStringAttribute( - browserAccessibility_, ui::AX_ATTR_HTML_TAG); + if (browserAccessibilityRole == ui::AX_ROLE_DESCRIPTION_LIST) + return @"AXDescriptionList"; - if (browserAccessibilityRole == ui::AX_ROLE_LIST) { - if ([htmlTag isEqualToString:@"dl"]) { - return @"AXDescriptionList"; - } else { - return @"AXContentList"; - } - } + if (browserAccessibilityRole == ui::AX_ROLE_LIST) + return @"AXContentList"; return [AXPlatformNodeCocoa nativeSubroleFromAXRole:browserAccessibilityRole]; } diff --git a/content/browser/accessibility/dump_accessibility_tree_browsertest.cc b/content/browser/accessibility/dump_accessibility_tree_browsertest.cc index 3467fcf..ab595f3 100644 --- a/content/browser/accessibility/dump_accessibility_tree_browsertest.cc +++ b/content/browser/accessibility/dump_accessibility_tree_browsertest.cc @@ -527,8 +527,7 @@ IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityDiv) { RunTest(FILE_PATH_LITERAL("div.html")); } -// crbug.com/418600 -IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, DISABLED_AccessibilityDl) { +IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityDl) { RunTest(FILE_PATH_LITERAL("dl.html")); } |