| 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 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 362 ASSERT_EQ(S_OK, checkbox_iaccessible->get_accParent(result.Receive())); | 362 ASSERT_EQ(S_OK, checkbox_iaccessible->get_accParent(result.Receive())); |
| 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 TEST_F(AXPlatformNodeWinTest, TestIAccessible2IndexInParent) { |
| 373 AXNodeData root; |
| 374 root.id = 1; |
| 375 root.role = AX_ROLE_ROOT_WEB_AREA; |
| 376 root.child_ids.push_back(2); |
| 377 root.child_ids.push_back(3); |
| 378 |
| 379 AXNodeData left; |
| 380 left.id = 2; |
| 381 |
| 382 AXNodeData right; |
| 383 right.id = 3; |
| 384 |
| 385 Init(root, left, right); |
| 386 ScopedComPtr<IAccessible> root_iaccessible(GetRootIAccessible()); |
| 387 ScopedComPtr<IAccessible2> root_iaccessible2 = |
| 388 ToIAccessible2(root_iaccessible); |
| 389 ScopedComPtr<IAccessible> left_iaccessible( |
| 390 IAccessibleFromNode(GetRootNode()->children()[0])); |
| 391 ScopedComPtr<IAccessible2> left_iaccessible2 = |
| 392 ToIAccessible2(left_iaccessible); |
| 393 ScopedComPtr<IAccessible> right_iaccessible( |
| 394 IAccessibleFromNode(GetRootNode()->children()[1])); |
| 395 ScopedComPtr<IAccessible2> right_iaccessible2 = |
| 396 ToIAccessible2(right_iaccessible); |
| 397 |
| 398 LONG index; |
| 399 ASSERT_EQ(E_FAIL, root_iaccessible2->get_indexInParent(&index)); |
| 400 |
| 401 ASSERT_EQ(S_OK, left_iaccessible2->get_indexInParent(&index)); |
| 402 EXPECT_EQ(0, index); |
| 403 |
| 404 ASSERT_EQ(S_OK, right_iaccessible2->get_indexInParent(&index)); |
| 405 EXPECT_EQ(1, index); |
| 406 } |
| 407 |
| 372 } // namespace ui | 408 } // namespace ui |
| OLD | NEW |