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

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: Fixed standard text fields in unit test. 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
« no previous file with comments | « no previous file | content/browser/accessibility/browser_accessibility.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..28171d7895d8bacaaa2bb3f46085718cefeeeccb 100644
--- a/content/browser/accessibility/accessibility_win_browsertest.cc
+++ b/content/browser/accessibility/accessibility_win_browsertest.cc
@@ -1605,6 +1605,32 @@ 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 + 1,
+ L"Game theory is \"the study of \xFFFC of conflict and\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"cooperation between intelligent rational decision-makers.\"");
+ }
+}
+
+IN_PROC_BROWSER_TEST_F(AccessibilityWinBrowserTest,
TestTextAtOffsetWithBoundaryAll) {
base::win::ScopedComPtr<IAccessibleText> input_text;
SetUpInputField(&input_text);
« no previous file with comments | « no previous file | content/browser/accessibility/browser_accessibility.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698