| 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 "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 1406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1417 | 1417 |
| 1418 TEST_F(BrowserAccessibilityTest, TestSelectionInContentEditables) { | 1418 TEST_F(BrowserAccessibilityTest, TestSelectionInContentEditables) { |
| 1419 ui::AXNodeData root; | 1419 ui::AXNodeData root; |
| 1420 root.id = 1; | 1420 root.id = 1; |
| 1421 root.role = ui::AX_ROLE_ROOT_WEB_AREA; | 1421 root.role = ui::AX_ROLE_ROOT_WEB_AREA; |
| 1422 root.state = (1 << ui::AX_STATE_READ_ONLY) | (1 << ui::AX_STATE_FOCUSABLE); | 1422 root.state = (1 << ui::AX_STATE_READ_ONLY) | (1 << ui::AX_STATE_FOCUSABLE); |
| 1423 | 1423 |
| 1424 ui::AXNodeData div_editable; | 1424 ui::AXNodeData div_editable; |
| 1425 div_editable.id = 2; | 1425 div_editable.id = 2; |
| 1426 div_editable.role = ui::AX_ROLE_DIV; | 1426 div_editable.role = ui::AX_ROLE_DIV; |
| 1427 div_editable.state = (1 << ui::AX_STATE_FOCUSABLE); | 1427 div_editable.state = |
| 1428 (1 << ui::AX_STATE_FOCUSABLE) | (1 << ui::AX_STATE_EDITABLE); |
| 1428 | 1429 |
| 1429 ui::AXNodeData text; | 1430 ui::AXNodeData text; |
| 1430 text.id = 3; | 1431 text.id = 3; |
| 1431 text.role = ui::AX_ROLE_STATIC_TEXT; | 1432 text.role = ui::AX_ROLE_STATIC_TEXT; |
| 1433 text.state = (1 << ui::AX_STATE_FOCUSABLE) | (1 << ui::AX_STATE_EDITABLE); |
| 1432 text.SetName("Click "); | 1434 text.SetName("Click "); |
| 1433 | 1435 |
| 1434 ui::AXNodeData link; | 1436 ui::AXNodeData link; |
| 1435 link.id = 4; | 1437 link.id = 4; |
| 1436 link.role = ui::AX_ROLE_LINK; | 1438 link.role = ui::AX_ROLE_LINK; |
| 1437 link.state = (1 << ui::AX_STATE_FOCUSABLE) | (1 << ui::AX_STATE_LINKED); | 1439 link.state = (1 << ui::AX_STATE_FOCUSABLE) | (1 << ui::AX_STATE_EDITABLE) | |
| 1440 (1 << ui::AX_STATE_LINKED); |
| 1438 link.SetName("here"); | 1441 link.SetName("here"); |
| 1439 | 1442 |
| 1440 ui::AXNodeData link_text; | 1443 ui::AXNodeData link_text; |
| 1441 link_text.id = 5; | 1444 link_text.id = 5; |
| 1442 link_text.role = ui::AX_ROLE_STATIC_TEXT; | 1445 link_text.role = ui::AX_ROLE_STATIC_TEXT; |
| 1443 link_text.state = (1 << ui::AX_STATE_FOCUSABLE) | (1 << ui::AX_STATE_LINKED); | 1446 link_text.state = (1 << ui::AX_STATE_FOCUSABLE) | |
| 1447 (1 << ui::AX_STATE_EDITABLE) | (1 << ui::AX_STATE_LINKED); |
| 1444 link_text.SetName("here"); | 1448 link_text.SetName("here"); |
| 1445 | 1449 |
| 1446 root.child_ids.push_back(2); | 1450 root.child_ids.push_back(2); |
| 1447 div_editable.child_ids.push_back(3); | 1451 div_editable.child_ids.push_back(3); |
| 1448 div_editable.child_ids.push_back(4); | 1452 div_editable.child_ids.push_back(4); |
| 1449 link.child_ids.push_back(5); | 1453 link.child_ids.push_back(5); |
| 1450 | 1454 |
| 1451 ui::AXTreeUpdate update = | 1455 ui::AXTreeUpdate update = |
| 1452 MakeAXTreeUpdate(root, div_editable, link, link_text, text); | 1456 MakeAXTreeUpdate(root, div_editable, link, link_text, text); |
| 1453 | 1457 |
| (...skipping 876 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2330 base::win::ScopedComPtr<IDispatch> result; | 2334 base::win::ScopedComPtr<IDispatch> result; |
| 2331 EXPECT_EQ(E_INVALIDARG, ToBrowserAccessibilityWin(child)->get_accChild( | 2335 EXPECT_EQ(E_INVALIDARG, ToBrowserAccessibilityWin(child)->get_accChild( |
| 2332 root_unique_id_variant, result.Receive())); | 2336 root_unique_id_variant, result.Receive())); |
| 2333 | 2337 |
| 2334 base::win::ScopedVariant child_unique_id_variant(-child->unique_id()); | 2338 base::win::ScopedVariant child_unique_id_variant(-child->unique_id()); |
| 2335 EXPECT_EQ(S_OK, ToBrowserAccessibilityWin(root)->get_accChild( | 2339 EXPECT_EQ(S_OK, ToBrowserAccessibilityWin(root)->get_accChild( |
| 2336 child_unique_id_variant, result.Receive())); | 2340 child_unique_id_variant, result.Receive())); |
| 2337 } | 2341 } |
| 2338 | 2342 |
| 2339 } // namespace content | 2343 } // namespace content |
| OLD | NEW |