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

Side by Side Diff: ui/accessibility/platform/ax_platform_node_win_unittest.cc

Issue 1019663002: Implement AXPlatformNodeWin::get_indexInParent (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
« no previous file with comments | « ui/accessibility/platform/ax_platform_node_win.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « ui/accessibility/platform/ax_platform_node_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698