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

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

Issue 2119643002: Attempted to fix crash in BrowserAccessibilityWin::RemoveBidirectionalRelation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changed attributes to target_ids. Created 4 years, 5 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 | « content/browser/accessibility/browser_accessibility_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 (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 "content/browser/accessibility/browser_accessibility_win.h" 5 #include "content/browser/accessibility/browser_accessibility_win.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <memory> 9 #include <memory>
10 10
(...skipping 2323 matching lines...) Expand 10 before | Expand all | Expand 10 after
2334 base::win::ScopedComPtr<IDispatch> result; 2334 base::win::ScopedComPtr<IDispatch> result;
2335 EXPECT_EQ(E_INVALIDARG, ToBrowserAccessibilityWin(child)->get_accChild( 2335 EXPECT_EQ(E_INVALIDARG, ToBrowserAccessibilityWin(child)->get_accChild(
2336 root_unique_id_variant, result.Receive())); 2336 root_unique_id_variant, result.Receive()));
2337 2337
2338 base::win::ScopedVariant child_unique_id_variant(-child->unique_id()); 2338 base::win::ScopedVariant child_unique_id_variant(-child->unique_id());
2339 EXPECT_EQ(S_OK, ToBrowserAccessibilityWin(root)->get_accChild( 2339 EXPECT_EQ(S_OK, ToBrowserAccessibilityWin(root)->get_accChild(
2340 child_unique_id_variant, result.Receive())); 2340 child_unique_id_variant, result.Receive()));
2341 } 2341 }
2342 2342
2343 TEST_F(BrowserAccessibilityTest, TestIAccessible2Relations) { 2343 TEST_F(BrowserAccessibilityTest, TestIAccessible2Relations) {
2344 std::vector<int32_t> describedby_ids = {2, 3};
2345 ui::AXNodeData root; 2344 ui::AXNodeData root;
2346 root.id = 1; 2345 root.id = 1;
2347 root.role = ui::AX_ROLE_ROOT_WEB_AREA; 2346 root.role = ui::AX_ROLE_ROOT_WEB_AREA;
2347 // Reflexive relations should be ignored.
2348 std::vector<int32_t> describedby_ids = {1, 2, 3};
2348 root.AddIntListAttribute(ui::AX_ATTR_DESCRIBEDBY_IDS, describedby_ids); 2349 root.AddIntListAttribute(ui::AX_ATTR_DESCRIBEDBY_IDS, describedby_ids);
2349 2350
2350 ui::AXNodeData child1; 2351 ui::AXNodeData child1;
2351 child1.id = 2; 2352 child1.id = 2;
2352 child1.role = ui::AX_ROLE_STATIC_TEXT; 2353 child1.role = ui::AX_ROLE_STATIC_TEXT;
2353 root.child_ids.push_back(2); 2354 root.child_ids.push_back(2);
2354 2355
2355 ui::AXNodeData child2; 2356 ui::AXNodeData child2;
2356 child2.id = 3; 2357 child2.id = 3;
2357 child2.role = ui::AX_ROLE_STATIC_TEXT; 2358 child2.role = ui::AX_ROLE_STATIC_TEXT;
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
2465 std::vector<AXEventNotificationDetails> events = {event}; 2466 std::vector<AXEventNotificationDetails> events = {event};
2466 manager->OnAccessibilityEvents(events); 2467 manager->OnAccessibilityEvents(events);
2467 2468
2468 EXPECT_HRESULT_SUCCEEDED(ax_child1->get_nRelations(&n_relations)); 2469 EXPECT_HRESULT_SUCCEEDED(ax_child1->get_nRelations(&n_relations));
2469 EXPECT_EQ(2, n_relations); 2470 EXPECT_EQ(2, n_relations);
2470 EXPECT_HRESULT_SUCCEEDED(ax_child2->get_nRelations(&n_relations)); 2471 EXPECT_HRESULT_SUCCEEDED(ax_child2->get_nRelations(&n_relations));
2471 EXPECT_EQ(2, n_relations); 2472 EXPECT_EQ(2, n_relations);
2472 } 2473 }
2473 2474
2474 } // namespace content 2475 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/accessibility/browser_accessibility_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698