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

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

Issue 12481022: On Win, the accessible value of a document should be its url. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 | 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 <atlbase.h> 5 #include <atlbase.h>
6 #include <vector> 6 #include <vector>
7 7
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/stringprintf.h" 9 #include "base/stringprintf.h"
10 #include "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after
351 EXPECT_EQ(ia2_role_, ia2_role); 351 EXPECT_EQ(ia2_role_, ia2_role);
352 if (ia2_role_ != ia2_role) { 352 if (ia2_role_ != ia2_role) {
353 LOG(ERROR) << "Expected ia2 role: " << 353 LOG(ERROR) << "Expected ia2 role: " <<
354 IAccessible2RoleToString(ia2_role_); 354 IAccessible2RoleToString(ia2_role_);
355 LOG(ERROR) << "Got ia2 role: " << 355 LOG(ERROR) << "Got ia2 role: " <<
356 IAccessible2RoleToString(ia2_role); 356 IAccessible2RoleToString(ia2_role);
357 } 357 }
358 } 358 }
359 359
360 void AccessibleChecker::CheckAccessibleValue(IAccessible* accessible) { 360 void AccessibleChecker::CheckAccessibleValue(IAccessible* accessible) {
361 // Don't check the value if if's a DOCUMENT role, because the value
362 // is supposed to be the url (and we don't keep track of that in the
363 // test expectations).
364 VARIANT var_role = {0};
365 HRESULT hr =
366 accessible->get_accRole(CreateI4Variant(CHILDID_SELF), &var_role);
367 ASSERT_EQ(S_OK, hr);
368 if (V_VT(&var_role) == VT_I4 &&
369 V_I4(&var_role) == ROLE_SYSTEM_DOCUMENT) {
370 return;
371 }
372
373 // Get the value.
361 CComBSTR value; 374 CComBSTR value;
362 HRESULT hr = 375 hr = accessible->get_accValue(CreateI4Variant(CHILDID_SELF), &value);
363 accessible->get_accValue(CreateI4Variant(CHILDID_SELF), &value);
364 EXPECT_EQ(S_OK, hr); 376 EXPECT_EQ(S_OK, hr);
365 377
366 // Test that the correct string was returned. 378 // Test that the correct string was returned.
367 EXPECT_STREQ(value_.c_str(), 379 EXPECT_STREQ(value_.c_str(),
368 wstring(value.m_str, SysStringLen(value)).c_str()); 380 wstring(value.m_str, SysStringLen(value)).c_str());
369 } 381 }
370 382
371 void AccessibleChecker::CheckAccessibleState(IAccessible* accessible) { 383 void AccessibleChecker::CheckAccessibleState(IAccessible* accessible) {
372 if (state_ < 0) 384 if (state_ < 0)
373 return; 385 return;
(...skipping 483 matching lines...) Expand 10 before | Expand all | Expand 10 after
857 AccessibleChecker grouping1_checker(L"", ROLE_SYSTEM_GROUPING, L""); 869 AccessibleChecker grouping1_checker(L"", ROLE_SYSTEM_GROUPING, L"");
858 AccessibleChecker grouping2_checker(L"", ROLE_SYSTEM_GROUPING, L""); 870 AccessibleChecker grouping2_checker(L"", ROLE_SYSTEM_GROUPING, L"");
859 AccessibleChecker document_checker(L"", ROLE_SYSTEM_DOCUMENT, L""); 871 AccessibleChecker document_checker(L"", ROLE_SYSTEM_DOCUMENT, L"");
860 document_checker.AppendExpectedChild(&grouping1_checker); 872 document_checker.AppendExpectedChild(&grouping1_checker);
861 document_checker.AppendExpectedChild(&grouping2_checker); 873 document_checker.AppendExpectedChild(&grouping2_checker);
862 document_checker.CheckAccessible(GetRendererAccessible()); 874 document_checker.CheckAccessible(GetRendererAccessible());
863 } 875 }
864 } // namespace. 876 } // namespace.
865 877
866 } // namespace content 878 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698