OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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> |
| 6 |
5 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
6 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
7 #include "ui/accessibility/ax_text_utils.h" | 9 #include "ui/accessibility/ax_text_utils.h" |
8 | 10 |
9 namespace ui { | 11 namespace ui { |
10 | 12 |
11 TEST(AXTextUtils, FindAccessibleTextBoundaryLine) { | 13 TEST(AXTextUtils, FindAccessibleTextBoundaryLine) { |
12 const base::string16 text = base::UTF8ToUTF16("Line 1.\nLine 2\n\t"); | 14 const base::string16 text = base::UTF8ToUTF16("Line 1.\nLine 2\n\t"); |
13 const size_t text_length = text.length(); | 15 const size_t text_length = text.length(); |
14 std::vector<int> line_start_offsets; | 16 std::vector<int> line_start_offsets; |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 EXPECT_EQ(0UL, result); | 62 EXPECT_EQ(0UL, result); |
61 | 63 |
62 // When we are at the start of the last line and we are searching forwards. | 64 // When we are at the start of the last line and we are searching forwards. |
63 // it should return the text length. | 65 // it should return the text length. |
64 result = FindAccessibleTextBoundary(text, line_start_offsets, LINE_BOUNDARY, | 66 result = FindAccessibleTextBoundary(text, line_start_offsets, LINE_BOUNDARY, |
65 15, FORWARDS_DIRECTION); | 67 15, FORWARDS_DIRECTION); |
66 EXPECT_EQ(text_length, result); | 68 EXPECT_EQ(text_length, result); |
67 } | 69 } |
68 | 70 |
69 } // Namespace ui. | 71 } // Namespace ui. |
OLD | NEW |