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

Side by Side Diff: ui/accessibility/ax_tree.h

Issue 967583002: Improve AXTree unit tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update automation_apitest.cc Created 5 years, 9 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
« no previous file with comments | « ui/accessibility/ax_generated_tree_unittest.cc ('k') | ui/accessibility/tree_generator.h » ('j') | 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 #ifndef UI_ACCESSIBILITY_AX_TREE_H_ 5 #ifndef UI_ACCESSIBILITY_AX_TREE_H_
6 #define UI_ACCESSIBILITY_AX_TREE_H_ 6 #define UI_ACCESSIBILITY_AX_TREE_H_
7 7
8 #include <set> 8 #include <set>
9 9
10 #include "base/containers/hash_tables.h" 10 #include "base/containers/hash_tables.h"
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 // should not be trusted any longer. 101 // should not be trusted any longer.
102 virtual bool Unserialize(const AXTreeUpdate& update); 102 virtual bool Unserialize(const AXTreeUpdate& update);
103 103
104 // Return a multi-line indented string representation, for logging. 104 // Return a multi-line indented string representation, for logging.
105 std::string ToString() const; 105 std::string ToString() const;
106 106
107 // A string describing the error from an unsuccessful Unserialize, 107 // A string describing the error from an unsuccessful Unserialize,
108 // for testing and debugging. 108 // for testing and debugging.
109 const std::string& error() const { return error_; } 109 const std::string& error() const { return error_; }
110 110
111 int size() { return static_cast<int>(id_map_.size()); }
112
111 private: 113 private:
112 AXNode* CreateNode(AXNode* parent, int32 id, int32 index_in_parent); 114 AXNode* CreateNode(AXNode* parent, int32 id, int32 index_in_parent);
113 115
114 // This is called from within Unserialize(), it returns true on success. 116 // This is called from within Unserialize(), it returns true on success.
115 bool UpdateNode(const AXNodeData& src, AXTreeUpdateState* update_state); 117 bool UpdateNode(const AXNodeData& src, AXTreeUpdateState* update_state);
116 118
117 void OnRootChanged(); 119 void OnRootChanged();
118 120
119 // Notify the delegate that the subtree rooted at |node| will be destroyed, 121 // Notify the delegate that the subtree rooted at |node| will be destroyed,
120 // then call DestroyNodeAndSubtree on it. 122 // then call DestroyNodeAndSubtree on it.
(...skipping 21 matching lines...) Expand all
142 144
143 AXTreeDelegate* delegate_; 145 AXTreeDelegate* delegate_;
144 AXNode* root_; 146 AXNode* root_;
145 base::hash_map<int32, AXNode*> id_map_; 147 base::hash_map<int32, AXNode*> id_map_;
146 std::string error_; 148 std::string error_;
147 }; 149 };
148 150
149 } // namespace ui 151 } // namespace ui
150 152
151 #endif // UI_ACCESSIBILITY_AX_TREE_H_ 153 #endif // UI_ACCESSIBILITY_AX_TREE_H_
OLDNEW
« no previous file with comments | « ui/accessibility/ax_generated_tree_unittest.cc ('k') | ui/accessibility/tree_generator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698