| 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 <stddef.h> | 5 #include <stddef.h> |
| 6 #include <stdint.h> | 6 #include <stdint.h> |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 1604 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1615 ASSERT_HRESULT_SUCCEEDED(paragraph_text->get_nCharacters(&n_characters)); | 1615 ASSERT_HRESULT_SUCCEEDED(paragraph_text->get_nCharacters(&n_characters)); |
| 1616 ASSERT_LT(0, n_characters); | 1616 ASSERT_LT(0, n_characters); |
| 1617 ASSERT_LT(newline_offset, n_characters); | 1617 ASSERT_LT(newline_offset, n_characters); |
| 1618 | 1618 |
| 1619 for (LONG i = 0; i <= newline_offset; ++i) { | 1619 for (LONG i = 0; i <= newline_offset; ++i) { |
| 1620 CheckTextAtOffset( | 1620 CheckTextAtOffset( |
| 1621 paragraph_text, i, IA2_TEXT_BOUNDARY_LINE, 0, newline_offset + 1, | 1621 paragraph_text, i, IA2_TEXT_BOUNDARY_LINE, 0, newline_offset + 1, |
| 1622 L"Game theory is \"the study of \xFFFC of conflict and\n"); | 1622 L"Game theory is \"the study of \xFFFC of conflict and\n"); |
| 1623 } | 1623 } |
| 1624 | 1624 |
| 1625 for (LONG i = newline_offset + 1; i < n_characters; ++i) { | 1625 // For line boundaries, IA2 Spec allows for the offset to be equal to the |
| 1626 // text's length. |
| 1627 for (LONG i = newline_offset + 1; i <= n_characters; ++i) { |
| 1626 CheckTextAtOffset( | 1628 CheckTextAtOffset( |
| 1627 paragraph_text, i, IA2_TEXT_BOUNDARY_LINE, newline_offset + 1, | 1629 paragraph_text, i, IA2_TEXT_BOUNDARY_LINE, newline_offset + 1, |
| 1628 n_characters, | 1630 n_characters, |
| 1629 L"cooperation between intelligent rational decision-makers.\""); | 1631 L"cooperation between intelligent rational decision-makers.\""); |
| 1630 } | 1632 } |
| 1631 } | 1633 } |
| 1632 | 1634 |
| 1633 IN_PROC_BROWSER_TEST_F(AccessibilityWinBrowserTest, | 1635 IN_PROC_BROWSER_TEST_F(AccessibilityWinBrowserTest, |
| 1634 TestTextAtOffsetWithBoundaryAll) { | 1636 TestTextAtOffsetWithBoundaryAll) { |
| 1635 base::win::ScopedComPtr<IAccessibleText> input_text; | 1637 base::win::ScopedComPtr<IAccessibleText> input_text; |
| 1636 SetUpInputField(&input_text); | 1638 SetUpInputField(&input_text); |
| 1637 | 1639 |
| 1638 CheckTextAtOffset(input_text, 0, IA2_TEXT_BOUNDARY_ALL, | 1640 CheckTextAtOffset(input_text, 0, IA2_TEXT_BOUNDARY_ALL, |
| 1639 0, CONTENTS_LENGTH, base::SysUTF8ToWide(INPUT_CONTENTS)); | 1641 0, CONTENTS_LENGTH, base::SysUTF8ToWide(INPUT_CONTENTS)); |
| 1640 } | 1642 } |
| 1641 | 1643 |
| 1642 IN_PROC_BROWSER_TEST_F(AccessibilityWinBrowserTest, | 1644 IN_PROC_BROWSER_TEST_F(AccessibilityWinBrowserTest, |
| 1643 TestMultiLineTextAtOffsetWithBoundaryAll) { | 1645 TestMultiLineTextAtOffsetWithBoundaryAll) { |
| 1644 base::win::ScopedComPtr<IAccessibleText> textarea_text; | 1646 base::win::ScopedComPtr<IAccessibleText> textarea_text; |
| 1645 SetUpTextareaField(&textarea_text); | 1647 SetUpTextareaField(&textarea_text); |
| 1646 | 1648 |
| 1647 CheckTextAtOffset(textarea_text, CONTENTS_LENGTH - 1, IA2_TEXT_BOUNDARY_ALL, | 1649 CheckTextAtOffset(textarea_text, CONTENTS_LENGTH - 1, IA2_TEXT_BOUNDARY_ALL, |
| 1648 0, CONTENTS_LENGTH, base::SysUTF8ToWide(TEXTAREA_CONTENTS)); | 1650 0, CONTENTS_LENGTH, base::SysUTF8ToWide(TEXTAREA_CONTENTS)); |
| 1649 } | 1651 } |
| 1650 | 1652 |
| 1651 } // namespace content | 1653 } // namespace content |
| OLD | NEW |