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

Unified Diff: ui/accessibility/ax_tree_unittest.cc

Issue 236203015: Add ToString to AXTreeUpdate. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Nicer indent Created 6 years, 8 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 | « ui/accessibility/ax_tree.cc ('k') | ui/accessibility/ax_tree_update.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/accessibility/ax_tree_unittest.cc
diff --git a/ui/accessibility/ax_tree_unittest.cc b/ui/accessibility/ax_tree_unittest.cc
index f4c609ed36b4cea2909302ada79aead060bc3aac..0001474577d1a873a8048670eaa6b1b73e103517 100644
--- a/ui/accessibility/ax_tree_unittest.cc
+++ b/ui/accessibility/ax_tree_unittest.cc
@@ -103,6 +103,44 @@ TEST(AXTreeTest, SerializeSimpleAXTree) {
dst_tree.ToString());
}
+TEST(AXTreeTest, SerializeAXTreeUpdate) {
+ AXNodeData list;
+ list.id = 3;
+ list.role = AX_ROLE_LIST;
+ list.state = 0;
+ list.child_ids.push_back(4);
+ list.child_ids.push_back(5);
+ list.child_ids.push_back(6);
+
+ AXNodeData list_item_2;
+ list_item_2.id = 5;
+ list_item_2.role = AX_ROLE_LIST_ITEM;
+ list_item_2.state = 0;
+
+ AXNodeData list_item_3;
+ list_item_3.id = 6;
+ list_item_3.role = AX_ROLE_LIST_ITEM;
+ list_item_3.state = 0;
+
+ AXNodeData button;
+ button.id = 7;
+ button.role = AX_ROLE_BUTTON;
+ button.state = 0;
+
+ AXTreeUpdate update;
+ update.nodes.push_back(list);
+ update.nodes.push_back(list_item_2);
+ update.nodes.push_back(list_item_3);
+ update.nodes.push_back(button);
+
+ EXPECT_EQ(
+ "id=3 list (0, 0)-(0, 0) child_ids=4,5,6\n"
+ " id=5 list_item (0, 0)-(0, 0)\n"
+ " id=6 list_item (0, 0)-(0, 0)\n"
+ "id=7 button (0, 0)-(0, 0)\n",
+ update.ToString());
+}
+
TEST(AXTreeTest, DeleteUnknownSubtreeFails) {
AXNodeData root;
root.id = 1;
« no previous file with comments | « ui/accessibility/ax_tree.cc ('k') | ui/accessibility/ax_tree_update.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698