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

Side by Side Diff: content/test/accessibility_test_utils_win.cc

Issue 10837065: Revert 149510 - Allow filters in accessibility tests to specify which attributes to check. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 4 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "content/public/test/accessibility_test_utils_win.h" 5 #include "content/public/test/accessibility_test_utils_win.h"
6 6
7 #include <oleacc.h> 7 #include <oleacc.h>
8 8
9 #include <map> 9 #include <map>
10 #include <string> 10 #include <string>
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 } // namespace. 223 } // namespace.
224 224
225 string16 IAccessibleRoleToString(int32 ia_role) { 225 string16 IAccessibleRoleToString(int32 ia_role) {
226 return AccessibilityRoleStateMap::GetInstance()->ia_role_string_map[ia_role]; 226 return AccessibilityRoleStateMap::GetInstance()->ia_role_string_map[ia_role];
227 } 227 }
228 228
229 string16 IAccessible2RoleToString(int32 ia_role) { 229 string16 IAccessible2RoleToString(int32 ia_role) {
230 return AccessibilityRoleStateMap::GetInstance()->ia2_role_string_map[ia_role]; 230 return AccessibilityRoleStateMap::GetInstance()->ia2_role_string_map[ia_role];
231 } 231 }
232 232
233 void IAccessibleStateToStringVector(int32 ia_state, 233 string16 IAccessibleStateToString(int32 ia_state) {
234 std::vector<string16>* result) { 234 string16 state_str;
235 const std::map<int32, string16>& state_string_map = 235 const std::map<int32, string16>& state_string_map =
236 AccessibilityRoleStateMap::GetInstance()->ia_state_string_map; 236 AccessibilityRoleStateMap::GetInstance()->ia_state_string_map;
237 std::map<int32, string16>::const_iterator it; 237 std::map<int32, string16>::const_iterator it;
238 for (it = state_string_map.begin(); it != state_string_map.end(); ++it) { 238
239 if (it->first & ia_state) 239 for (it = state_string_map.begin();
240 result->push_back(it->second); 240 it != state_string_map.end();
241 ++it) {
242 if (it->first & ia_state) {
243 if (!state_str.empty())
244 state_str += L",";
245 state_str += it->second;
246 }
241 } 247 }
248 return state_str;
242 } 249 }
243 250
244 string16 IAccessibleStateToString(int32 ia_state) { 251 string16 IAccessible2StateToString(int32 ia2_state) {
245 std::vector<string16> strings; 252 string16 state_str;
246 IAccessibleStateToStringVector(ia_state, &strings);
247 return JoinString(strings, ',');
248 }
249
250 void IAccessible2StateToStringVector(int32 ia2_state,
251 std::vector<string16>* result) {
252 const std::map<int32, string16>& state_string_map = 253 const std::map<int32, string16>& state_string_map =
253 AccessibilityRoleStateMap::GetInstance()->ia2_state_string_map; 254 AccessibilityRoleStateMap::GetInstance()->ia2_state_string_map;
254 std::map<int32, string16>::const_iterator it; 255 std::map<int32, string16>::const_iterator it;
255 for (it = state_string_map.begin(); it != state_string_map.end(); ++it) { 256
256 if (it->first & ia2_state) 257 for (it = state_string_map.begin();
257 result->push_back(it->second); 258 it != state_string_map.end();
259 ++it) {
260 if (it->first & ia2_state) {
261 if (!state_str.empty())
262 state_str += L",";
263 state_str += it->second;
264 }
258 } 265 }
266 return state_str;
259 } 267 }
260
261 string16 IAccessible2StateToString(int32 ia2_state) {
262 std::vector<string16> strings;
263 IAccessible2StateToStringVector(ia2_state, &strings);
264 return JoinString(strings, ',');
265 }
OLDNEW
« no previous file with comments | « content/public/test/accessibility_test_utils_win.h ('k') | content/test/data/accessibility/a.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698