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

Unified Diff: LayoutTests/accessibility/aria-tables.html

Issue 876003003: Extract buildAccessibilityTree() from the individual layout test. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Updated some tests and added rolesToIgnore param to helper function. Created 5 years, 11 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: LayoutTests/accessibility/aria-tables.html
diff --git a/LayoutTests/accessibility/aria-tables.html b/LayoutTests/accessibility/aria-tables.html
index 06029a1b197bd57590bfbf75547c26fb97375ab5..893934f0c831a0fd1e40fdedf8ee2dc6784aa5b7 100644
--- a/LayoutTests/accessibility/aria-tables.html
+++ b/LayoutTests/accessibility/aria-tables.html
@@ -1,4 +1,5 @@
<script src="../resources/js-test.js"></script>
+<script src="../resources/accessibility-helper.js"></script>
<body id="body">
<div role="grid">
<div role="row">
@@ -22,27 +23,8 @@
<p id="description"></p>
<div id="console"></div>
<script>
- function buildAccessibilityTree(accessibilityObject, i) {
- if(accessibilityObject.stringValue.indexOf('End of test') >= 0)
- return false;
-
- if (accessibilityObject.role == 'AXRole: AXColumn' || accessibilityObject.role == 'AXRole: AXTableHeaderContainer')
- return true;
-
- var indent = "";
- for (var k = 0; k < i; k++)
- indent += " ";
- debug(indent + accessibilityObject.role + " " + accessibilityObject.stringValue);
- var childrenCount = accessibilityObject.childrenCount;
- for (var j = 0; j < childrenCount; j++) {
- if (!buildAccessibilityTree(accessibilityObject.childAtIndex(j), i + 1))
- return false;
- }
- return true;
- }
-
if (window.accessibilityController) {
document.getElementById("body").focus();
- buildAccessibilityTree(accessibilityController.focusedElement, 0);
+ buildAccessibilityTree(accessibilityController.focusedElement, 0, 1, ['AXColumn', 'AXTableHeaderContainer']);
}
</script>

Powered by Google App Engine
This is Rietveld 408576698