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

Unified Diff: Source/core/editing/TextIteratorTest.cpp

Issue 297003003: Emit object replacement char to IME (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: yuta's comments addressed Created 6 years, 7 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 | « Source/core/editing/TextIterator.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/editing/TextIteratorTest.cpp
diff --git a/Source/core/editing/TextIteratorTest.cpp b/Source/core/editing/TextIteratorTest.cpp
index 59fe0f53f72750be3749b6f3df8a77193768a911..082444eb5aabf0d78ed3607d0b7f153cd7ce5fb4 100644
--- a/Source/core/editing/TextIteratorTest.cpp
+++ b/Source/core/editing/TextIteratorTest.cpp
@@ -517,4 +517,26 @@ TEST_F(TextIteratorTest, FindPlainTextInvalidTarget)
}
}
+TEST_F(TextIteratorTest, EmitsReplacementCharForInput)
+{
+ static const char* bodyContent =
+ "<div contenteditable=\"true\">"
+ "Before"
+ "<img src=\"foo.png\">"
+ "After"
+ "</div>";
+ // "Before".
+ static const UChar expectedRawString1[] = { 0x42, 0x65, 0x66, 0x6F, 0x72, 0x65, 0 };
+ // Object replacement char.
+ static const UChar expectedRawString2[] = { 0xFFFC, 0 };
+ // "After".
+ static const UChar expectedRawString3[] = { 0x41, 0x66, 0x74, 0x65, 0x72, 0 };
+ static const UChar* expectedRawStrings[] = { expectedRawString1, expectedRawString2, expectedRawString3 };
+ Vector<String> expectedTextChunks;
+ expectedTextChunks.append(expectedRawStrings, WTF_ARRAY_LENGTH(expectedRawStrings));
+
+ setBodyInnerHTML(bodyContent);
+ EXPECT_EQ(expectedTextChunks, iterate(TextIteratorEmitsObjectReplacementCharacter));
+}
+
}
« no previous file with comments | « Source/core/editing/TextIterator.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698