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

Side by Side Diff: content/browser/accessibility/accessibility_win_browsertest.cc

Issue 102593002: Convert string16 to base::string16 in content. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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 <vector> 5 #include <vector>
6 6
7 #include "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "base/win/scoped_bstr.h" 9 #include "base/win/scoped_bstr.h"
10 #include "base/win/scoped_comptr.h" 10 #include "base/win/scoped_comptr.h"
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 219
220 private: 220 private:
221 typedef std::vector<AccessibleChecker*> AccessibleCheckerVector; 221 typedef std::vector<AccessibleChecker*> AccessibleCheckerVector;
222 222
223 void CheckAccessibleName(IAccessible* accessible); 223 void CheckAccessibleName(IAccessible* accessible);
224 void CheckAccessibleRole(IAccessible* accessible); 224 void CheckAccessibleRole(IAccessible* accessible);
225 void CheckIA2Role(IAccessible* accessible); 225 void CheckIA2Role(IAccessible* accessible);
226 void CheckAccessibleValue(IAccessible* accessible); 226 void CheckAccessibleValue(IAccessible* accessible);
227 void CheckAccessibleState(IAccessible* accessible); 227 void CheckAccessibleState(IAccessible* accessible);
228 void CheckAccessibleChildren(IAccessible* accessible); 228 void CheckAccessibleChildren(IAccessible* accessible);
229 string16 RoleVariantToString(const base::win::ScopedVariant& role); 229 base::string16 RoleVariantToString(const base::win::ScopedVariant& role);
230 230
231 // Expected accessible name. Checked against IAccessible::get_accName. 231 // Expected accessible name. Checked against IAccessible::get_accName.
232 std::wstring name_; 232 std::wstring name_;
233 233
234 // Expected accessible role. Checked against IAccessible::get_accRole. 234 // Expected accessible role. Checked against IAccessible::get_accRole.
235 base::win::ScopedVariant role_; 235 base::win::ScopedVariant role_;
236 236
237 // Expected IAccessible2 role. Checked against IAccessible2::role. 237 // Expected IAccessible2 role. Checked against IAccessible2::role.
238 int32 ia2_role_; 238 int32 ia2_role_;
239 239
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
396 for (AccessibleCheckerVector::iterator child_checker = children_.begin(); 396 for (AccessibleCheckerVector::iterator child_checker = children_.begin();
397 child_checker != children_.end(); 397 child_checker != children_.end();
398 ++child_checker, ++child) { 398 ++child_checker, ++child) {
399 base::win::ScopedComPtr<IAccessible> child_accessible( 399 base::win::ScopedComPtr<IAccessible> child_accessible(
400 GetAccessibleFromResultVariant(parent, child)); 400 GetAccessibleFromResultVariant(parent, child));
401 ASSERT_TRUE(child_accessible.get()); 401 ASSERT_TRUE(child_accessible.get());
402 (*child_checker)->CheckAccessible(child_accessible); 402 (*child_checker)->CheckAccessible(child_accessible);
403 } 403 }
404 } 404 }
405 405
406 string16 AccessibleChecker::RoleVariantToString( 406 base::string16 AccessibleChecker::RoleVariantToString(
407 const base::win::ScopedVariant& role) { 407 const base::win::ScopedVariant& role) {
408 if (role.type() == VT_I4) 408 if (role.type() == VT_I4)
409 return IAccessibleRoleToString(V_I4(&role)); 409 return IAccessibleRoleToString(V_I4(&role));
410 if (role.type() == VT_BSTR) 410 if (role.type() == VT_BSTR)
411 return string16(V_BSTR(&role), SysStringLen(V_BSTR(&role))); 411 return base::string16(V_BSTR(&role), SysStringLen(V_BSTR(&role)));
412 return string16(); 412 return base::string16();
413 } 413 }
414 414
415 } // namespace 415 } // namespace
416 416
417 417
418 // Tests ---------------------------------------------------------------------- 418 // Tests ----------------------------------------------------------------------
419 419
420 IN_PROC_BROWSER_TEST_F(AccessibilityWinBrowserTest, 420 IN_PROC_BROWSER_TEST_F(AccessibilityWinBrowserTest,
421 MAYBE(TestBusyAccessibilityTree)) { 421 MAYBE(TestBusyAccessibilityTree)) {
422 NavigateToURL(shell(), GURL(kAboutBlankURL)); 422 NavigateToURL(shell(), GURL(kAboutBlankURL));
(...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after
874 AccessibleChecker grouping2_checker(std::wstring(), ROLE_SYSTEM_GROUPING, 874 AccessibleChecker grouping2_checker(std::wstring(), ROLE_SYSTEM_GROUPING,
875 std::wstring()); 875 std::wstring());
876 AccessibleChecker document_checker(std::wstring(), ROLE_SYSTEM_DOCUMENT, 876 AccessibleChecker document_checker(std::wstring(), ROLE_SYSTEM_DOCUMENT,
877 std::wstring()); 877 std::wstring());
878 document_checker.AppendExpectedChild(&grouping1_checker); 878 document_checker.AppendExpectedChild(&grouping1_checker);
879 document_checker.AppendExpectedChild(&grouping2_checker); 879 document_checker.AppendExpectedChild(&grouping2_checker);
880 document_checker.CheckAccessible(GetRendererAccessible()); 880 document_checker.CheckAccessible(GetRendererAccessible());
881 } 881 }
882 882
883 } // namespace content 883 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/accessibility/accessibility_ui.cc ('k') | content/browser/accessibility/browser_accessibility.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698