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

Unified Diff: LayoutTests/accessibility/table-header-column-row.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/table-header-column-row.html
diff --git a/LayoutTests/accessibility/table-header-column-row.html b/LayoutTests/accessibility/table-header-column-row.html
index 2e57686aa79878f1bf7a748f9cdd558592171c83..0f4df90a367924c847c9fb34440955c118fde762 100644
--- a/LayoutTests/accessibility/table-header-column-row.html
+++ b/LayoutTests/accessibility/table-header-column-row.html
@@ -1,4 +1,5 @@
<script src="../resources/js-test.js"></script>
+<script src="../resources/accessibility-helper.js"></script>
<table width="50%" border="1">
<caption>
scope test
@@ -99,36 +100,7 @@ description("This tests that AXRoles for header cells are assigned.");
if (window.testRunner)
testRunner.dumpAsText();
-
-function buildAccessibilityTree(accessibilityObject, indent) {
- if (accessibilityObject.role == 'AXRole: AXColumn' || accessibilityObject.role == 'AXRole: AXTableHeaderContainer')
- return true;
- var str = "";
- for (var i = 0; i < indent; i++)
- str += " ";
- str += accessibilityObject.role;
- str += " " + accessibilityObject.stringValue;
-
- if (accessibilityObject.role == '')
- str += accessibilityObject.allAttributes();
-
- str += "\n";
- document.getElementById("console").innerText += str;
-
- if (accessibilityObject.stringValue.indexOf('End of test') >= 0)
- return false;
-
- var count = accessibilityObject.childrenCount;
- for (var i = 0; i < count; ++i) {
- if (!buildAccessibilityTree(accessibilityObject.childAtIndex(i), indent + 1))
- return false;
- }
-
- return true;
-}
-
if (window.accessibilityController) {
- var body = accessibilityController.focusedElement;
- buildAccessibilityTree(body, 0);
+ buildAccessibilityTree(accessibilityController.focusedElement, 0, 1, ['AXColumn', 'AXTableHeaderContainer']);
}
</script>

Powered by Google App Engine
This is Rietveld 408576698