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

Side by Side Diff: ui/accessibility/ax_tree_unittest.cc

Issue 163233005: Fix accessibility_unittests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/memory/scoped_ptr.h" 5 #include "base/memory/scoped_ptr.h"
6 #include "base/strings/string_number_conversions.h" 6 #include "base/strings/string_number_conversions.h"
7 #include "testing/gtest/include/gtest/gtest.h" 7 #include "testing/gtest/include/gtest/gtest.h"
8 #include "ui/accessibility/ax_node.h" 8 #include "ui/accessibility/ax_node.h"
9 #include "ui/accessibility/ax_serializable_tree.h" 9 #include "ui/accessibility/ax_serializable_tree.h"
10 #include "ui/accessibility/ax_tree.h" 10 #include "ui/accessibility/ax_tree.h"
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 57
58 AXNode* button_node = root_node->ChildAtIndex(0); 58 AXNode* button_node = root_node->ChildAtIndex(0);
59 EXPECT_EQ(button.id, button_node->id()); 59 EXPECT_EQ(button.id, button_node->id());
60 EXPECT_EQ(button.role, button_node->data().role); 60 EXPECT_EQ(button.role, button_node->data().role);
61 61
62 AXNode* checkbox_node = root_node->ChildAtIndex(1); 62 AXNode* checkbox_node = root_node->ChildAtIndex(1);
63 EXPECT_EQ(checkbox.id, checkbox_node->id()); 63 EXPECT_EQ(checkbox.id, checkbox_node->id());
64 EXPECT_EQ(checkbox.role, checkbox_node->data().role); 64 EXPECT_EQ(checkbox.role, checkbox_node->data().role);
65 65
66 EXPECT_EQ( 66 EXPECT_EQ(
67 "id=1 ROOT_WEB_AREA FOCUSABLE FOCUSED (0, 0)-(800, 600) child_ids=2,3\n" 67 "id=1 root_web_area FOCUSABLE FOCUSED (0, 0)-(800, 600) child_ids=2,3\n"
68 " id=2 BUTTON (20, 20)-(200, 30)\n" 68 " id=2 button (20, 20)-(200, 30)\n"
69 " id=3 CHECKBOX (20, 50)-(200, 30)\n", 69 " id=3 check_box (20, 50)-(200, 30)\n",
70 dst_tree.ToString()); 70 dst_tree.ToString());
71 } 71 }
72 72
73 TEST(AXTreeTest, DeleteUnknownSubtreeFails) { 73 TEST(AXTreeTest, DeleteUnknownSubtreeFails) {
74 AXNodeData root; 74 AXNodeData root;
75 root.id = 1; 75 root.id = 1;
76 root.role = AX_ROLE_ROOT_WEB_AREA; 76 root.role = AX_ROLE_ROOT_WEB_AREA;
77 77
78 AXTreeUpdate initial_state; 78 AXTreeUpdate initial_state;
79 initial_state.nodes.push_back(root); 79 initial_state.nodes.push_back(root);
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 update.nodes[0].role = AX_ROLE_ROOT_WEB_AREA; 168 update.nodes[0].role = AX_ROLE_ROOT_WEB_AREA;
169 update.nodes[0].child_ids.push_back(3); 169 update.nodes[0].child_ids.push_back(3);
170 update.nodes[0].child_ids.push_back(2); 170 update.nodes[0].child_ids.push_back(2);
171 update.nodes[1].id = 2; 171 update.nodes[1].id = 2;
172 update.nodes[2].id = 3; 172 update.nodes[2].id = 3;
173 EXPECT_FALSE(tree.Unserialize(update)); 173 EXPECT_FALSE(tree.Unserialize(update));
174 ASSERT_EQ("Node 3 reparented from 2 to 1", tree.error()); 174 ASSERT_EQ("Node 3 reparented from 2 to 1", tree.error());
175 } 175 }
176 176
177 } // namespace ui 177 } // namespace ui
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698