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

Unified Diff: LayoutTests/accessibility/legend.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/legend.html
diff --git a/LayoutTests/accessibility/legend.html b/LayoutTests/accessibility/legend.html
index 748ef516f27938cfec1928f5195614a785d93b11..2cb39b1e69af2dc24b115bc1b81697ea27208041 100644
--- a/LayoutTests/accessibility/legend.html
+++ b/LayoutTests/accessibility/legend.html
@@ -1,32 +1,8 @@
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
-<script>
-
- function buildAccessibilityTree(accessibilityObject, indent, targetObject, targetString) {
- var str = "";
- for (var i = 0; i < indent; i++)
- str += " ";
- str += accessibilityObject.role;
- str += " " + accessibilityObject.stringValue;
- if (targetObject && accessibilityObject.isEqual(targetObject))
- str += " " + targetString;
- str += "\n";
- document.getElementById("tree").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, targetObject, targetString))
- return false;
- }
-
- return true;
- }
-</script>
<script src="../resources/js-test.js"></script>
+<script src="../resources/accessibility-helper.js"></script>
</head>
<body id="body">
@@ -38,7 +14,6 @@
<div>End of test</div>
<p id="description"></p>
-<pre id="tree"></pre>
<div id="console"></div>
<script>
@@ -53,7 +28,7 @@
// Print out the tree of accessible objects, indicating the titleUIElement so
// that each platform can verify their expected object has been found
- buildAccessibilityTree(body, 0, titleUIElement, "<< fieldset's titleUIElement");
+ buildAccessibilityTree(body, 0, 0, 0, titleUIElement, "<< fieldset's titleUIElement");
// Verify that we have gotten the titleUIElement and it has the expected text,
// which should be in the last descendant regardless of platform.

Powered by Google App Engine
This is Rietveld 408576698