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

Unified Diff: ui/accessibility/ax_tree_unittest.cc

Issue 116293005: Refactor content/ to use ui::AXNodeData instead of blink. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update content/DEPS instead of subdirs Created 6 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 | « ui/accessibility/ax_tree.cc ('k') | no next file » | 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 9e21280a0669a1fe2002bfd17ec71f005779b0c5..68a2911664ace3c5464c2e8e0a625d668c24f5bd 100644
--- a/ui/accessibility/ax_tree_unittest.cc
+++ b/ui/accessibility/ax_tree_unittest.cc
@@ -16,6 +16,8 @@ TEST(AXTreeTest, SerializeSimpleAXTree) {
AXNodeData root;
root.id = 1;
root.role = AX_ROLE_ROOT_WEB_AREA;
+ root.state = (1 << AX_STATE_FOCUSABLE) | (1 << AX_STATE_FOCUSED);
+ root.location = gfx::Rect(0, 0, 800, 600);
root.child_ids.push_back(2);
root.child_ids.push_back(3);
@@ -23,10 +25,13 @@ TEST(AXTreeTest, SerializeSimpleAXTree) {
button.id = 2;
button.role = AX_ROLE_BUTTON;
button.state = 0;
+ button.location = gfx::Rect(20, 20, 200, 30);
AXNodeData checkbox;
checkbox.id = 3;
checkbox.role = AX_ROLE_CHECK_BOX;
+ checkbox.state = 0;
+ checkbox.location = gfx::Rect(20, 50, 200, 30);
AXTreeUpdate initial_state;
initial_state.nodes.push_back(root);
@@ -57,6 +62,12 @@ TEST(AXTreeTest, SerializeSimpleAXTree) {
AXNode* checkbox_node = root_node->ChildAtIndex(1);
EXPECT_EQ(checkbox.id, checkbox_node->id());
EXPECT_EQ(checkbox.role, checkbox_node->data().role);
+
+ EXPECT_EQ(
+ "id=1 ROOT_WEB_AREA FOCUSABLE FOCUSED (0, 0)-(800, 600) child_ids=2,3\n"
+ " id=2 BUTTON (20, 20)-(200, 30)\n"
+ " id=3 CHECKBOX (20, 50)-(200, 30)\n",
+ dst_tree.ToString());
}
TEST(AXTreeTest, DeleteUnknownSubtreeFails) {
« no previous file with comments | « ui/accessibility/ax_tree.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698