OLD | NEW |
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/utf_string_conversions.h" | 8 #include "base/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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 IDispatch* dispatch = V_DISPATCH(var); | 47 IDispatch* dispatch = V_DISPATCH(var); |
48 if (dispatch) | 48 if (dispatch) |
49 ptr.QueryFrom(dispatch); | 49 ptr.QueryFrom(dispatch); |
50 break; | 50 break; |
51 } | 51 } |
52 | 52 |
53 case VT_I4: { | 53 case VT_I4: { |
54 base::win::ScopedComPtr<IDispatch> dispatch; | 54 base::win::ScopedComPtr<IDispatch> dispatch; |
55 HRESULT hr = parent->get_accChild(*var, dispatch.Receive()); | 55 HRESULT hr = parent->get_accChild(*var, dispatch.Receive()); |
56 EXPECT_TRUE(SUCCEEDED(hr)); | 56 EXPECT_TRUE(SUCCEEDED(hr)); |
57 if (dispatch.get()) | 57 if (dispatch) |
58 dispatch.QueryInterface(ptr.Receive()); | 58 dispatch.QueryInterface(ptr.Receive()); |
59 break; | 59 break; |
60 } | 60 } |
61 } | 61 } |
62 return ptr; | 62 return ptr; |
63 } | 63 } |
64 | 64 |
65 HRESULT QueryIAccessible2(IAccessible* accessible, IAccessible2** accessible2) { | 65 HRESULT QueryIAccessible2(IAccessible* accessible, IAccessible2** accessible2) { |
66 // TODO(ctguil): For some reason querying the IAccessible2 interface from | 66 // TODO(ctguil): For some reason querying the IAccessible2 interface from |
67 // IAccessible fails. | 67 // IAccessible fails. |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 scoped_ptr<VARIANT[]> child_array(new VARIANT[child_count]); | 105 scoped_ptr<VARIANT[]> child_array(new VARIANT[child_count]); |
106 LONG obtained_count = 0; | 106 LONG obtained_count = 0; |
107 hr = AccessibleChildren( | 107 hr = AccessibleChildren( |
108 node, 0, child_count, child_array.get(), &obtained_count); | 108 node, 0, child_count, child_array.get(), &obtained_count); |
109 ASSERT_EQ(S_OK, hr); | 109 ASSERT_EQ(S_OK, hr); |
110 ASSERT_EQ(child_count, obtained_count); | 110 ASSERT_EQ(child_count, obtained_count); |
111 | 111 |
112 for (int index = 0; index < obtained_count; index++) { | 112 for (int index = 0; index < obtained_count; index++) { |
113 base::win::ScopedComPtr<IAccessible> child_accessible( | 113 base::win::ScopedComPtr<IAccessible> child_accessible( |
114 GetAccessibleFromResultVariant(node, &child_array.get()[index])); | 114 GetAccessibleFromResultVariant(node, &child_array.get()[index])); |
115 if (child_accessible.get()) { | 115 if (child_accessible) { |
116 RecursiveFindNodeInAccessibilityTree( | 116 RecursiveFindNodeInAccessibilityTree( |
117 child_accessible.get(), expected_role, expected_name, depth + 1, | 117 child_accessible.get(), expected_role, expected_name, depth + 1, |
118 found); | 118 found); |
119 if (*found) | 119 if (*found) |
120 return; | 120 return; |
121 } | 121 } |
122 } | 122 } |
123 } | 123 } |
124 | 124 |
125 | 125 |
(...skipping 771 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
897 AccessibleChecker grouping2_checker(std::wstring(), ROLE_SYSTEM_GROUPING, | 897 AccessibleChecker grouping2_checker(std::wstring(), ROLE_SYSTEM_GROUPING, |
898 std::wstring()); | 898 std::wstring()); |
899 AccessibleChecker document_checker(std::wstring(), ROLE_SYSTEM_DOCUMENT, | 899 AccessibleChecker document_checker(std::wstring(), ROLE_SYSTEM_DOCUMENT, |
900 std::wstring()); | 900 std::wstring()); |
901 document_checker.AppendExpectedChild(&grouping1_checker); | 901 document_checker.AppendExpectedChild(&grouping1_checker); |
902 document_checker.AppendExpectedChild(&grouping2_checker); | 902 document_checker.AppendExpectedChild(&grouping2_checker); |
903 document_checker.CheckAccessible(GetRendererAccessible()); | 903 document_checker.CheckAccessible(GetRendererAccessible()); |
904 } | 904 } |
905 | 905 |
906 } // namespace content | 906 } // namespace content |
OLD | NEW |