AX: 5 accessibility tests just need minor tweaks to pass on chromium
authordmazzoni@google.com <dmazzoni@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 9 Oct 2012 23:15:21 +0000 (23:15 +0000)
committerdmazzoni@google.com <dmazzoni@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 9 Oct 2012 23:15:21 +0000 (23:15 +0000)
https://bugs.webkit.org/show_bug.cgi?id=98311

Reviewed by Chris Fleizach.

Tools:

Update roleToString on Chromium to include all missing roles,
which enables some layout tests to pass.

* DumpRenderTree/chromium/TestRunner/AccessibilityUIElementChromium.cpp:
(roleToString):

LayoutTests:

Modifies tests so that they log data that tends to vary between
platforms using debug(), rather than asserting a platform-specific
value. Gets rid of "forks" of tests in the gtk directory. Adds
expectations and unskips 5 tests on Chromium.

* accessibility/aria-list-and-listitem.html:
* accessibility/aria-option-role.html:
* accessibility/aria-tab-roles.html:
* platform/chromium/TestExpectations:
* platform/chromium/accessibility/aria-fallback-roles-expected.txt: Renamed from LayoutTests/platform/chromium-win/accessibility/aria-fallback-roles-expected.txt.
* platform/chromium/accessibility/aria-list-and-listitem-expected.txt: Copied from LayoutTests/platform/mac/accessibility/aria-list-and-listitem-expected.txt.
* platform/chromium/accessibility/aria-option-role-expected.txt: Copied from LayoutTests/platform/mac/accessibility/aria-option-role-expected.txt.
* platform/chromium/accessibility/aria-tab-roles-expected.txt: Copied from LayoutTests/platform/mac/accessibility/aria-tab-roles-expected.txt.
* platform/gtk/accessibility/aria-list-and-listitem-expected.txt:
* platform/gtk/accessibility/aria-list-and-listitem.html: Removed.
* platform/gtk/accessibility/aria-option-role-expected.txt:
* platform/gtk/accessibility/aria-option-role.html: Removed.
* platform/mac/accessibility/aria-list-and-listitem-expected.txt:
* platform/mac/accessibility/aria-option-role-expected.txt:
* platform/mac/accessibility/aria-tab-roles-expected.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@130823 268f45cc-cd09-0410-ab3c-d52691b4dbfc

18 files changed:
LayoutTests/ChangeLog
LayoutTests/accessibility/aria-list-and-listitem.html
LayoutTests/accessibility/aria-option-role.html
LayoutTests/accessibility/aria-tab-roles.html
LayoutTests/platform/chromium/TestExpectations
LayoutTests/platform/chromium/accessibility/aria-fallback-roles-expected.txt [moved from LayoutTests/platform/chromium-win/accessibility/aria-fallback-roles-expected.txt with 80% similarity]
LayoutTests/platform/chromium/accessibility/aria-list-and-listitem-expected.txt [new file with mode: 0644]
LayoutTests/platform/chromium/accessibility/aria-option-role-expected.txt [new file with mode: 0644]
LayoutTests/platform/chromium/accessibility/aria-tab-roles-expected.txt [new file with mode: 0644]
LayoutTests/platform/gtk/accessibility/aria-list-and-listitem-expected.txt
LayoutTests/platform/gtk/accessibility/aria-list-and-listitem.html [deleted file]
LayoutTests/platform/gtk/accessibility/aria-option-role-expected.txt
LayoutTests/platform/gtk/accessibility/aria-option-role.html [deleted file]
LayoutTests/platform/mac/accessibility/aria-list-and-listitem-expected.txt
LayoutTests/platform/mac/accessibility/aria-option-role-expected.txt
LayoutTests/platform/mac/accessibility/aria-tab-roles-expected.txt
Tools/ChangeLog
Tools/DumpRenderTree/chromium/TestRunner/AccessibilityUIElementChromium.cpp

index ed2e7eb..006ef6d 100644 (file)
@@ -1,3 +1,31 @@
+2012-10-09  Dominic Mazzoni  <dmazzoni@google.com>
+
+        AX: 5 accessibility tests just need minor tweaks to pass on chromium
+        https://bugs.webkit.org/show_bug.cgi?id=98311
+
+        Reviewed by Chris Fleizach.
+
+        Modifies tests so that they log data that tends to vary between
+        platforms using debug(), rather than asserting a platform-specific
+        value. Gets rid of "forks" of tests in the gtk directory. Adds
+        expectations and unskips 5 tests on Chromium.
+
+        * accessibility/aria-list-and-listitem.html:
+        * accessibility/aria-option-role.html:
+        * accessibility/aria-tab-roles.html:
+        * platform/chromium/TestExpectations:
+        * platform/chromium/accessibility/aria-fallback-roles-expected.txt: Renamed from LayoutTests/platform/chromium-win/accessibility/aria-fallback-roles-expected.txt.
+        * platform/chromium/accessibility/aria-list-and-listitem-expected.txt: Copied from LayoutTests/platform/mac/accessibility/aria-list-and-listitem-expected.txt.
+        * platform/chromium/accessibility/aria-option-role-expected.txt: Copied from LayoutTests/platform/mac/accessibility/aria-option-role-expected.txt.
+        * platform/chromium/accessibility/aria-tab-roles-expected.txt: Copied from LayoutTests/platform/mac/accessibility/aria-tab-roles-expected.txt.
+        * platform/gtk/accessibility/aria-list-and-listitem-expected.txt:
+        * platform/gtk/accessibility/aria-list-and-listitem.html: Removed.
+        * platform/gtk/accessibility/aria-option-role-expected.txt:
+        * platform/gtk/accessibility/aria-option-role.html: Removed.
+        * platform/mac/accessibility/aria-list-and-listitem-expected.txt:
+        * platform/mac/accessibility/aria-option-role-expected.txt:
+        * platform/mac/accessibility/aria-tab-roles-expected.txt:
+
 2012-10-09  Levi Weintraub  <leviw@chromium.org>
 
         Rolling back unintended change to iframe-copy-on-scroll.html from previous commit.
index f3bdbab..616e189 100644 (file)
@@ -23,9 +23,9 @@
           document.getElementById("body").focus();
           var obj = accessibilityController.focusedElement;
 
-          shouldBe("obj.childAtIndex(0).role", "'AXRole: AXList'");
-          shouldBe("obj.childAtIndex(0).childAtIndex(0).role", "'AXRole: AXGroup'");
-          shouldBe("obj.childAtIndex(0).childAtIndex(1).role", "'AXRole: AXGroup'");
+          debug("obj.childAtIndex(0).role = " + obj.childAtIndex(0).role);
+          debug("obj.childAtIndex(0).childAtIndex(0).role = " + obj.childAtIndex(0).childAtIndex(0).role);
+          debug("obj.childAtIndex(0).childAtIndex(1).role = " + obj.childAtIndex(0).childAtIndex(1).role);
     }
 
 </script>
index d77dd24..a636b5d 100644 (file)
           var listBox = accessibilityController.focusedElement.childAtIndex(0);
           var firstChild = listBox.childAtIndex(0);
           var secondChild = listBox.childAtIndex(1);
-          shouldBe("firstChild.role", "'AXRole: AXStaticText'");
+          debug("firstChild.role is " + firstChild.role);
           shouldBe("firstChild.title", "'AXTitle: option 1'");
 
-          shouldBe("secondChild.role", "'AXRole: AXStaticText'");
+          debug("secondChild.role is " + secondChild.role);
           shouldBe("secondChild.description", "'AXDescription: label 2'");
 
           shouldBe("firstChild.childrenCount", "0");
index 4ea1597..97f04b5 100644 (file)
           var tab2 = tabList.childAtIndex(1);
           var tabPanel = accessibilityController.focusedElement.childAtIndex(1);
 
-          shouldBe("tabList.role", "'AXRole: AXTabGroup'");
-          shouldBe("tab1.role", "'AXRole: AXRadioButton'");
+          debug("tabList.role = " + tabList.role);
+          debug("tab1.role = " + tab1.role);
           shouldBe("tab1.title", "'AXTitle: Crust'");
           shouldBe("tab1.childrenCount", "0");
-          shouldBe("tab2.role", "'AXRole: AXRadioButton'");
+          debug("tab2.role = " + tab2.role);
           shouldBe("tab2.title", "'AXTitle: Veges'");
-          shouldBe("tabPanel.role", "'AXRole: AXGroup'");
-          shouldBe("tabPanel.subrole", "'AXSubrole: AXTabPanel'");
+          debug("tabPanel.role = " + tabPanel.role);
+          debug("tabPanel.subrole = " + tabPanel.subrole);
     }
 
 </script>
index c5b20f5..49c5128 100644 (file)
@@ -1379,15 +1379,10 @@ crbug.com/10322 platform/win/accessibility
 crbug.com/10322 accessibility/aria-activedescendant-crash.html [ Skip ]
 crbug.com/10322 accessibility/aria-combobox.html [ Skip ]
 crbug.com/10322 accessibility/aria-controls-with-tabs.html [ Skip ]
-crbug.com/10322 accessibility/aria-fallback-roles.html [ Skip ]
-crbug.com/10322 accessibility/aria-hidden-update.html [ Skip ]
 crbug.com/10322 accessibility/aria-invalid.html [ Skip ]
 crbug.com/10322 accessibility/aria-labelledby-overrides-label.html [ Skip ]
 crbug.com/10322 accessibility/aria-link-supports-press.html [ Skip ]
-crbug.com/10322 accessibility/aria-list-and-listitem.html [ Skip ]
 crbug.com/10322 accessibility/aria-menubar-menuitems.html [ Skip ]
-crbug.com/10322 accessibility/aria-option-role.html [ Skip ]
-crbug.com/10322 accessibility/aria-tab-roles.html [ Skip ]
 crbug.com/10322 accessibility/aria-tables.html [ Skip ]
 crbug.com/10322 accessibility/aria-text-role.html [ Skip ]
 crbug.com/10322 accessibility/aria-used-on-image-maps.html [ Skip ]
@@ -4,5 +4,5 @@ This tests that aria fallback roles work correctly.
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
 
-Role should be: check box
+Role should be: AXRole: AXCheckBox
 
diff --git a/LayoutTests/platform/chromium/accessibility/aria-list-and-listitem-expected.txt b/LayoutTests/platform/chromium/accessibility/aria-list-and-listitem-expected.txt
new file mode 100644 (file)
index 0000000..a758ae3
--- /dev/null
@@ -0,0 +1,14 @@
+
+
+This tests that the ARIA roles of list and listitem map correctly to Mac accessibility roles.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+obj.childAtIndex(0).role = AXRole: AXList
+obj.childAtIndex(0).childAtIndex(0).role = AXRole: AXListItem
+obj.childAtIndex(0).childAtIndex(1).role = AXRole: AXListItem
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/platform/chromium/accessibility/aria-option-role-expected.txt b/LayoutTests/platform/chromium/accessibility/aria-option-role-expected.txt
new file mode 100644 (file)
index 0000000..66ce78e
--- /dev/null
@@ -0,0 +1,17 @@
+option 1
+option 2
+This tests that the aria 'option' role works as expected. That is, it becomes a static text element with no children.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+firstChild.role is AXRole: AXListBoxOption
+PASS firstChild.title is 'AXTitle: option 1'
+secondChild.role is AXRole: AXListBoxOption
+PASS secondChild.description is 'AXDescription: label 2'
+PASS firstChild.childrenCount is 0
+PASS secondChild.childrenCount is 0
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/platform/chromium/accessibility/aria-tab-roles-expected.txt b/LayoutTests/platform/chromium/accessibility/aria-tab-roles-expected.txt
new file mode 100644 (file)
index 0000000..f4ddc68
--- /dev/null
@@ -0,0 +1,21 @@
+Crust
+Veges
+Select Crust
+
+This tests that the aria roles for tab, tabpanel and tablist work as expected correctly.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+tabList.role = AXRole: AXTabList
+tab1.role = AXRole: AXTab
+PASS tab1.title is 'AXTitle: Crust'
+PASS tab1.childrenCount is 0
+tab2.role = AXRole: AXTab
+PASS tab2.title is 'AXTitle: Veges'
+tabPanel.role = AXRole: AXTabPanel
+tabPanel.subrole = undefined
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
index b0cd6e4..b1e6636 100644 (file)
@@ -5,9 +5,9 @@ This tests that the ARIA roles of list and listitem map correctly to Mac accessi
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
 
-PASS obj.childAtIndex(0).role is 'AXRole: list'
-PASS obj.childAtIndex(0).childAtIndex(0).role is 'AXRole: list item'
-PASS obj.childAtIndex(0).childAtIndex(1).role is 'AXRole: list item'
+obj.childAtIndex(0).role = AXRole: list
+obj.childAtIndex(0).childAtIndex(0).role = AXRole: list item
+obj.childAtIndex(0).childAtIndex(1).role = AXRole: list item
 PASS successfullyParsed is true
 
 TEST COMPLETE
diff --git a/LayoutTests/platform/gtk/accessibility/aria-list-and-listitem.html b/LayoutTests/platform/gtk/accessibility/aria-list-and-listitem.html
deleted file mode 100644 (file)
index 5e067aa..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<html>
-<head>
-<script src="../../../fast/js/resources/js-test-pre.js"></script>
-</head>
-<body id="body">
-
-<div role="list">
-<div role="listitem" aria-label="item 1"><img src='#' width=100 height=100></div>
-<div role="listitem" aria-label="item 2"><img src='#' width=100 height=100></div>
-</div>
-
-<p id="description"></p>
-<div id="console"></div>
-
-<script>
-
-    description("This tests that the ARIA roles of list and listitem map correctly to Mac accessibility roles.");
-
-    if (window.accessibilityController) {
-
-          // this text field should be required.
-          document.getElementById("body").focus();
-          var obj = accessibilityController.focusedElement;
-
-          shouldBe("obj.childAtIndex(0).role", "'AXRole: list'");
-          shouldBe("obj.childAtIndex(0).childAtIndex(0).role", "'AXRole: list item'");
-          shouldBe("obj.childAtIndex(0).childAtIndex(1).role", "'AXRole: list item'");
-    }
-
-</script>
-
-<script src="../../../fast/js/resources/js-test-post.js"></script>
-</body>
-</html>
index 52e2657..2c4366a 100644 (file)
@@ -1,13 +1,13 @@
 option 1
 option 2
-This tests that the aria 'option' role works as expected.
+This tests that the aria 'option' role works as expected. That is, it becomes a static text element with no children.
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
 
-PASS firstChild.role is 'AXRole: list item'
+firstChild.role is AXRole: list item
 PASS firstChild.title is 'AXTitle: option 1'
-PASS secondChild.role is 'AXRole: list item'
+secondChild.role is AXRole: list item
 PASS secondChild.description is 'AXDescription: label 2'
 PASS firstChild.childrenCount is 0
 PASS secondChild.childrenCount is 0
diff --git a/LayoutTests/platform/gtk/accessibility/aria-option-role.html b/LayoutTests/platform/gtk/accessibility/aria-option-role.html
deleted file mode 100644 (file)
index 39d5d60..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<html>
-<head>
-<script src="../../../fast/js/resources/js-test-pre.js"></script>
-</head>
-<body id="body">
-
-<div role="listbox">
-<div role="option">option 1</div>
-<div role="option" aria-label="label 2">option 2</div>
-</div>
-
-<p id="description"></p>
-<div id="console"></div>
-
-<script>
-
-    description("This tests that the aria 'option' role works as expected.");
-
-    if (window.accessibilityController) {
-
-          var body = document.getElementById("body");
-          body.focus();
-
-          var listBox = accessibilityController.focusedElement.childAtIndex(0);
-          var firstChild = listBox.childAtIndex(0);
-          var secondChild = listBox.childAtIndex(1);
-          shouldBe("firstChild.role", "'AXRole: list item'");
-          shouldBe("firstChild.title", "'AXTitle: option 1'");
-
-          shouldBe("secondChild.role", "'AXRole: list item'");
-          shouldBe("secondChild.description", "'AXDescription: label 2'");
-
-          shouldBe("firstChild.childrenCount", "0");
-          shouldBe("secondChild.childrenCount", "0");
-    }
-
-</script>
-
-<script src="../../../fast/js/resources/js-test-post.js"></script>
-</body>
-</html>
index 51158ee..94f9717 100644 (file)
@@ -5,9 +5,9 @@ This tests that the ARIA roles of list and listitem map correctly to Mac accessi
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
 
-PASS obj.childAtIndex(0).role is 'AXRole: AXList'
-PASS obj.childAtIndex(0).childAtIndex(0).role is 'AXRole: AXGroup'
-PASS obj.childAtIndex(0).childAtIndex(1).role is 'AXRole: AXGroup'
+obj.childAtIndex(0).role = AXRole: AXList
+obj.childAtIndex(0).childAtIndex(0).role = AXRole: AXGroup
+obj.childAtIndex(0).childAtIndex(1).role = AXRole: AXGroup
 PASS successfullyParsed is true
 
 TEST COMPLETE
index e037837..3990fec 100644 (file)
@@ -5,9 +5,9 @@ This tests that the aria 'option' role works as expected. That is, it becomes a
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
 
-PASS firstChild.role is 'AXRole: AXStaticText'
+firstChild.role is AXRole: AXStaticText
 PASS firstChild.title is 'AXTitle: option 1'
-PASS secondChild.role is 'AXRole: AXStaticText'
+secondChild.role is AXRole: AXStaticText
 PASS secondChild.description is 'AXDescription: label 2'
 PASS firstChild.childrenCount is 0
 PASS secondChild.childrenCount is 0
index fd9cae3..e670f9c 100644 (file)
@@ -7,14 +7,14 @@ This tests that the aria roles for tab, tabpanel and tablist work as expected co
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
 
-PASS tabList.role is 'AXRole: AXTabGroup'
-PASS tab1.role is 'AXRole: AXRadioButton'
+tabList.role = AXRole: AXTabGroup
+tab1.role = AXRole: AXRadioButton
 PASS tab1.title is 'AXTitle: Crust'
 PASS tab1.childrenCount is 0
-PASS tab2.role is 'AXRole: AXRadioButton'
+tab2.role = AXRole: AXRadioButton
 PASS tab2.title is 'AXTitle: Veges'
-PASS tabPanel.role is 'AXRole: AXGroup'
-PASS tabPanel.subrole is 'AXSubrole: AXTabPanel'
+tabPanel.role = AXRole: AXGroup
+tabPanel.subrole = AXSubrole: AXTabPanel
 PASS successfullyParsed is true
 
 TEST COMPLETE
index 7fe7489..94aa5d9 100644 (file)
@@ -1,3 +1,16 @@
+2012-10-09  Dominic Mazzoni  <dmazzoni@google.com>
+
+        AX: 5 accessibility tests just need minor tweaks to pass on chromium
+        https://bugs.webkit.org/show_bug.cgi?id=98311
+
+        Reviewed by Chris Fleizach.
+
+        Update roleToString on Chromium to include all missing roles,
+        which enables some layout tests to pass.
+
+        * DumpRenderTree/chromium/TestRunner/AccessibilityUIElementChromium.cpp:
+        (roleToString):
+
 2012-10-09  Dirk Pranke  <dpranke@chromium.org>
 
         webkit-patch rebaseline-expectations doesn't work w/o failures specified
index b795aeb..4189855 100644 (file)
@@ -221,8 +221,47 @@ static string roleToString(WebAccessibilityRole role)
         return result.append("HorizontalRule");
     case WebAccessibilityRoleLegend:
         return result.append("Legend");
-    default:
-        // Also matches WebAccessibilityRoleUnknown.
+    case WebAccessibilityRoleApplicationAlert:
+        return result.append("Alert");
+    case WebAccessibilityRoleApplicationAlertDialog:
+        return result.append("AlertDialog");
+    case WebAccessibilityRoleApplicationDialog:
+        return result.append("ApplicationDialog");
+    case WebAccessibilityRoleDirectory:
+        return result.append("Directory");
+    case WebAccessibilityRoleDocumentMath:
+        return result.append("Math");
+    case WebAccessibilityRoleEditableText:
+        return result.append("EditableText");
+    case WebAccessibilityRoleFooter:
+        return result.append("Footer");
+    case WebAccessibilityRoleIgnored:
+        return result.append("Ignored");
+    case WebAccessibilityRoleListItem:
+        return result.append("ListItem");
+    case WebAccessibilityRoleMenuListPopup:
+        return result.append("MenuListPopup");
+    case WebAccessibilityRoleMenuListOption:
+        return result.append("MenuListOption");
+    case WebAccessibilityRolePresentational:
+        return result.append("Presentational");
+    case WebAccessibilityRoleSpinButton:
+        return result.append("SpinButton");
+    case WebAccessibilityRoleSpinButtonPart:
+        return result.append("SpinButtonPart");
+    case WebAccessibilityRoleTabList:
+        return result.append("TabList");
+    case WebAccessibilityRoleTabPanel:
+        return result.append("TabPanel");
+    case WebAccessibilityRoleTab:
+        return result.append("Tab");
+    case WebAccessibilityRoleTreeRole:
+        return result.append("Tree");
+    case WebAccessibilityRoleTreeGrid:
+        return result.append("TreeGrid");
+    case WebAccessibilityRoleTreeItemRole:
+        return result.append("TreeItem");
+    case WebAccessibilityRoleUnknown:
         return result.append("Unknown");
     }
 }