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

Unified Diff: content/browser/accessibility/accessibility_win_browsertest.cc

Issue 1905263002: Correctly finds line boundaries in objects with rich text on Windows. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/accessibility/accessibility_win_browsertest.cc
diff --git a/content/browser/accessibility/accessibility_win_browsertest.cc b/content/browser/accessibility/accessibility_win_browsertest.cc
index 9e62aba952cb9f754cdb709e6821b29e2fa3bb64..559daf26d6be5758e8d7f3d83126bffbc57f41e5 100644
--- a/content/browser/accessibility/accessibility_win_browsertest.cc
+++ b/content/browser/accessibility/accessibility_win_browsertest.cc
@@ -1605,6 +1605,30 @@ IN_PROC_BROWSER_TEST_F(AccessibilityWinBrowserTest,
}
IN_PROC_BROWSER_TEST_F(AccessibilityWinBrowserTest,
+ TestParagraphTextAtOffsetWithBoundaryLine) {
+ base::win::ScopedComPtr<IAccessibleText> paragraph_text;
+ SetUpSampleParagraph(&paragraph_text);
+
+ // There should be two lines in this paragraph.
+ const LONG newline_offset = 46;
+ LONG n_characters;
+ ASSERT_HRESULT_SUCCEEDED(paragraph_text->get_nCharacters(&n_characters));
+ ASSERT_LT(0, n_characters);
+ ASSERT_LT(newline_offset, n_characters);
+
+ for (LONG i = 0; i <= newline_offset; ++i) {
+ CheckTextAtOffset(paragraph_text, i, IA2_TEXT_BOUNDARY_LINE, 0,
+ newline_offset, L"Moz/5.0 (ST 6.x; WWW33)\n");
+ }
+
+ for (LONG i = newline_offset + 1; i < n_characters; ++i) {
+ CheckTextAtOffset(paragraph_text, i, IA2_TEXT_BOUNDARY_LINE,
+ newline_offset + 1, n_characters,
+ L"Moz/5.0 (ST 6.x; WWW33)\n");
+ }
+}
+
+IN_PROC_BROWSER_TEST_F(AccessibilityWinBrowserTest,
TestTextAtOffsetWithBoundaryAll) {
base::win::ScopedComPtr<IAccessibleText> input_text;
SetUpInputField(&input_text);

Powered by Google App Engine
This is Rietveld 408576698