Commit e0ee113f authored by shreeram.k's avatar shreeram.k Committed by Commit bot

Add option to not dump childrens of a node in AX Tree.

This would be useful in cases when on the same platform due to different version, AX tree may vary.
Please check below mentioned bug id for such kind of example.

BUG=423675

Review URL: https://codereview.chromium.org/844273002

Cr-Commit-Position: refs/heads/master@{#327238}
parent d4d2fc18
......@@ -20,6 +20,7 @@ namespace {
const char kIndentSymbol = '+';
const int kIndentSymbolCount = 2;
const char* kSkipString = "@NO_DUMP";
const char* kSkipChildren = "@NO_CHILDREN_DUMP";
const char* kChildrenDictAttr = "children";
}
......@@ -84,6 +85,9 @@ void AccessibilityTreeFormatter::RecursiveFormatAccessibilityTree(
return;
*contents += line + base::ASCIIToUTF16("\n");
if (line.find(base::ASCIIToUTF16(kSkipChildren)) != base::string16::npos)
return;
const base::ListValue* children;
dict.GetList(kChildrenDictAttr, &children);
const base::DictionaryValue* child_dict;
......
android.webkit.WebView focusable focused scrollable
++android.view.View
++++android.widget.Spinner clickable focusable name='2008-09-01' input_type=20
++++android.widget.Spinner clickable focusable name='@NO_CHILDREN_DUMP' input_type=20
ROLE_SYSTEM_DOCUMENT READONLY FOCUSABLE
++IA2_ROLE_SECTION
++++IA2_ROLE_DATE_EDITOR FOCUSABLE
++++++IA2_ROLE_SECTION
++++++++IA2_ROLE_SECTION
++++++++++ROLE_SYSTEM_SPINBUTTON name='Month' FOCUSABLE
++++++++++ROLE_SYSTEM_STATICTEXT name='/'
++++++++++ROLE_SYSTEM_SPINBUTTON name='Day' FOCUSABLE
++++++++++ROLE_SYSTEM_STATICTEXT name='/'
++++++++++ROLE_SYSTEM_SPINBUTTON name='Year' FOCUSABLE
++++++ROLE_SYSTEM_BUTTONMENU FOCUSABLE
++++++ROLE_SYSTEM_SPINBUTTON
++++++++ROLE_SYSTEM_PUSHBUTTON
++++++++ROLE_SYSTEM_PUSHBUTTON
++++IA2_ROLE_DATE_EDITOR name='@NO_CHILDREN_DUMP' FOCUSABLE
......@@ -5,7 +5,7 @@
<html>
<body>
<input type="date" value="2008-09-01">
<input aria-label="@NO_CHILDREN_DUMP" type="date" value="2008-09-01">
</body>
</html>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment