OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 <atlcom.h> | 6 #include <atlcom.h> |
7 #include <oleacc.h> | 7 #include <oleacc.h> |
8 | 8 |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/win/scoped_bstr.h" | 10 #include "base/win/scoped_bstr.h" |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
222 Init(root, child); | 222 Init(root, child); |
223 AXNode* child_node = GetRootNode()->children()[0]; | 223 AXNode* child_node = GetRootNode()->children()[0]; |
224 ScopedComPtr<IAccessible> child_iaccessible( | 224 ScopedComPtr<IAccessible> child_iaccessible( |
225 IAccessibleFromNode(child_node)); | 225 IAccessibleFromNode(child_node)); |
226 | 226 |
227 ScopedVariant role; | 227 ScopedVariant role; |
228 | 228 |
229 child.role = AX_ROLE_ALERT; | 229 child.role = AX_ROLE_ALERT; |
230 child_node->SetData(child); | 230 child_node->SetData(child); |
231 ASSERT_EQ(S_OK, child_iaccessible->get_accRole(SELF, role.Receive())); | 231 ASSERT_EQ(S_OK, child_iaccessible->get_accRole(SELF, role.Receive())); |
232 EXPECT_EQ(ROLE_SYSTEM_ALERT, V_I4(&role)); | 232 EXPECT_EQ(ROLE_SYSTEM_ALERT, V_I4(role.ptr())); |
233 | 233 |
234 child.role = AX_ROLE_BUTTON; | 234 child.role = AX_ROLE_BUTTON; |
235 child_node->SetData(child); | 235 child_node->SetData(child); |
236 ASSERT_EQ(S_OK, child_iaccessible->get_accRole(SELF, role.Receive())); | 236 ASSERT_EQ(S_OK, child_iaccessible->get_accRole(SELF, role.Receive())); |
237 EXPECT_EQ(ROLE_SYSTEM_PUSHBUTTON, V_I4(&role)); | 237 EXPECT_EQ(ROLE_SYSTEM_PUSHBUTTON, V_I4(role.ptr())); |
238 | 238 |
239 child.role = AX_ROLE_POP_UP_BUTTON; | 239 child.role = AX_ROLE_POP_UP_BUTTON; |
240 child_node->SetData(child); | 240 child_node->SetData(child); |
241 ASSERT_EQ(S_OK, child_iaccessible->get_accRole(SELF, role.Receive())); | 241 ASSERT_EQ(S_OK, child_iaccessible->get_accRole(SELF, role.Receive())); |
242 EXPECT_EQ(ROLE_SYSTEM_BUTTONMENU, V_I4(&role)); | 242 EXPECT_EQ(ROLE_SYSTEM_BUTTONMENU, V_I4(role.ptr())); |
243 | 243 |
244 ASSERT_EQ(E_INVALIDARG, child_iaccessible->get_accRole(SELF, nullptr)); | 244 ASSERT_EQ(E_INVALIDARG, child_iaccessible->get_accRole(SELF, nullptr)); |
245 ScopedVariant bad_id(999); | 245 ScopedVariant bad_id(999); |
246 ASSERT_EQ(E_INVALIDARG, child_iaccessible->get_accRole( | 246 ASSERT_EQ(E_INVALIDARG, child_iaccessible->get_accRole( |
247 bad_id, role.Receive())); | 247 bad_id, role.Receive())); |
248 } | 248 } |
249 | 249 |
250 TEST_F(AXPlatformNodeWinTest, TestIAccessibleLocation) { | 250 TEST_F(AXPlatformNodeWinTest, TestIAccessibleLocation) { |
251 AXNodeData root; | 251 AXNodeData root; |
252 root.id = 1; | 252 root.id = 1; |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
363 ASSERT_EQ(result.get(), root_iaccessible); | 363 ASSERT_EQ(result.get(), root_iaccessible); |
364 } | 364 } |
365 | 365 |
366 { | 366 { |
367 ScopedComPtr<IDispatch> result; | 367 ScopedComPtr<IDispatch> result; |
368 ASSERT_EQ(S_FALSE, root_iaccessible->get_accParent(result.Receive())); | 368 ASSERT_EQ(S_FALSE, root_iaccessible->get_accParent(result.Receive())); |
369 } | 369 } |
370 } | 370 } |
371 | 371 |
372 } // namespace ui | 372 } // namespace ui |
OLD | NEW |