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/listitem-presentation-inherited.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
« no previous file with comments | « LayoutTests/accessibility/legend.html ('k') | LayoutTests/accessibility/table-header-column-row.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/accessibility/listitem-presentation-inherited.html
diff --git a/LayoutTests/accessibility/listitem-presentation-inherited.html b/LayoutTests/accessibility/listitem-presentation-inherited.html
index d9d225e5228e7ed098ea60d6d1acfc848b5bb4ae..22420381fdaa9e03475e1d182b4f12bb1d982256 100644
--- a/LayoutTests/accessibility/listitem-presentation-inherited.html
+++ b/LayoutTests/accessibility/listitem-presentation-inherited.html
@@ -1,4 +1,5 @@
<script src="../resources/js-test.js"></script>
+<script src="../resources/accessibility-helper.js"></script>
<ul role="presentation">
<li role="listitem">Item 1</li>
<li role="listitem">Item 2</li>
@@ -18,34 +19,7 @@ description("This tests that the presentation role is inherited.");
if (window.testRunner)
testRunner.dumpAsText();
-
-function buildAccessibilityTree(accessibilityObject, indent) {
- 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);
}
-</script>
+</script>
« no previous file with comments | « LayoutTests/accessibility/legend.html ('k') | LayoutTests/accessibility/table-header-column-row.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698