| Index: ui/accessibility/ax_tree_unittest.cc
|
| diff --git a/ui/accessibility/ax_tree_unittest.cc b/ui/accessibility/ax_tree_unittest.cc
|
| index 7c13c19caca1a0fbdac1735b19a1c9580eb62d21..25e602a634b6b303b277d6bdd3fe8e815758e516 100644
|
| --- a/ui/accessibility/ax_tree_unittest.cc
|
| +++ b/ui/accessibility/ax_tree_unittest.cc
|
| @@ -210,23 +210,24 @@ class FakeAXTreeDelegate : public AXTreeDelegate {
|
|
|
| TEST(AXTreeTest, SerializeSimpleAXTree) {
|
| AXNodeData root;
|
| + root.ClearBitfields();
|
| root.id = 1;
|
| root.role = AX_ROLE_DIALOG;
|
| - root.state = 1 << AX_STATE_FOCUSABLE;
|
| + root.AddState(AX_STATE_FOCUSABLE);
|
| root.location = gfx::RectF(0, 0, 800, 600);
|
| root.child_ids.push_back(2);
|
| root.child_ids.push_back(3);
|
|
|
| AXNodeData button;
|
| + button.ClearBitfields();
|
| button.id = 2;
|
| button.role = AX_ROLE_BUTTON;
|
| - button.state = 0;
|
| button.location = gfx::RectF(20, 20, 200, 30);
|
|
|
| AXNodeData checkbox;
|
| + checkbox.ClearBitfields();
|
| checkbox.id = 3;
|
| checkbox.role = AX_ROLE_CHECK_BOX;
|
| - checkbox.state = 0;
|
| checkbox.location = gfx::RectF(20, 50, 200, 30);
|
|
|
| AXTreeUpdate initial_state;
|
| @@ -273,27 +274,27 @@ TEST(AXTreeTest, SerializeSimpleAXTree) {
|
|
|
| TEST(AXTreeTest, SerializeAXTreeUpdate) {
|
| AXNodeData list;
|
| + list.ClearBitfields();
|
| 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.ClearBitfields();
|
| 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.ClearBitfields();
|
| list_item_3.id = 6;
|
| list_item_3.role = AX_ROLE_LIST_ITEM;
|
| - list_item_3.state = 0;
|
|
|
| AXNodeData button;
|
| + button.ClearBitfields();
|
| button.id = 7;
|
| button.role = AX_ROLE_BUTTON;
|
| - button.state = 0;
|
|
|
| AXTreeUpdate update;
|
| update.root_id = 3;
|
| @@ -575,8 +576,8 @@ TEST(AXTreeTest, TreeDelegateIsNotCalledForReparenting) {
|
| TEST(AXTreeTest, BogusAXTree) {
|
| AXTreeUpdate initial_state;
|
| AXNodeData node;
|
| + node.ClearBitfields();
|
| node.id = 0;
|
| - node.state = 0;
|
| initial_state.nodes.push_back(node);
|
| initial_state.nodes.push_back(node);
|
| ui::AXTree tree;
|
| @@ -587,12 +588,12 @@ TEST(AXTreeTest, BogusAXTree) {
|
| TEST(AXTreeTest, BogusAXTree2) {
|
| AXTreeUpdate initial_state;
|
| AXNodeData node;
|
| + node.ClearBitfields();
|
| node.id = 0;
|
| - node.state = 0;
|
| initial_state.nodes.push_back(node);
|
| AXNodeData node2;
|
| + node2.ClearBitfields();
|
| node2.id = 0;
|
| - node2.state = 0;
|
| node2.child_ids.push_back(0);
|
| node2.child_ids.push_back(0);
|
| initial_state.nodes.push_back(node2);
|
| @@ -604,14 +605,14 @@ TEST(AXTreeTest, BogusAXTree2) {
|
| TEST(AXTreeTest, BogusAXTree3) {
|
| AXTreeUpdate initial_state;
|
| AXNodeData node;
|
| + node.ClearBitfields();
|
| node.id = 0;
|
| - node.state = 0;
|
| node.child_ids.push_back(1);
|
| initial_state.nodes.push_back(node);
|
|
|
| AXNodeData node2;
|
| + node2.ClearBitfields();
|
| node2.id = 1;
|
| - node2.state = 0;
|
| node2.child_ids.push_back(1);
|
| node2.child_ids.push_back(1);
|
| initial_state.nodes.push_back(node2);
|
| @@ -626,10 +627,10 @@ TEST(AXTreeTest, RoleAndStateChangeCallbacks) {
|
| initial_state.nodes.resize(1);
|
| initial_state.nodes[0].id = 1;
|
| initial_state.nodes[0].role = AX_ROLE_BUTTON;
|
| - initial_state.nodes[0].state = 0;
|
| initial_state.nodes[0].AddIntAttribute(ui::AX_ATTR_CHECKED_STATE,
|
| ui::AX_CHECKED_STATE_TRUE);
|
| - initial_state.nodes[0].AddStateFlag(AX_STATE_FOCUSABLE);
|
| + initial_state.nodes[0].ClearBitfields();
|
| + initial_state.nodes[0].AddState(AX_STATE_FOCUSABLE);
|
| AXTree tree(initial_state);
|
|
|
| FakeAXTreeDelegate fake_delegate;
|
| @@ -641,11 +642,11 @@ TEST(AXTreeTest, RoleAndStateChangeCallbacks) {
|
| update.nodes.resize(1);
|
| update.nodes[0].id = 1;
|
| update.nodes[0].role = AX_ROLE_CHECK_BOX;
|
| - update.nodes[0].state = 0;
|
| update.nodes[0].AddIntAttribute(ui::AX_ATTR_CHECKED_STATE,
|
| ui::AX_CHECKED_STATE_FALSE);
|
| - update.nodes[0].AddStateFlag(AX_STATE_FOCUSABLE);
|
| - update.nodes[0].AddStateFlag(AX_STATE_VISITED);
|
| + update.nodes[0].ClearBitfields();
|
| + update.nodes[0].AddState(AX_STATE_FOCUSABLE);
|
| + update.nodes[0].AddState(AX_STATE_VISITED);
|
| EXPECT_TRUE(tree.Unserialize(update));
|
|
|
| const std::vector<std::string>& change_log =
|
|
|