| Index: third_party/WebKit/Source/core/editing/iterators/TextIteratorTest.cpp
|
| diff --git a/third_party/WebKit/Source/core/editing/iterators/TextIteratorTest.cpp b/third_party/WebKit/Source/core/editing/iterators/TextIteratorTest.cpp
|
| index ff89e831f0946c529475b5c918c4c9f50869175e..893bc646d8432f289d19d8c77ee65ca75f7825a0 100644
|
| --- a/third_party/WebKit/Source/core/editing/iterators/TextIteratorTest.cpp
|
| +++ b/third_party/WebKit/Source/core/editing/iterators/TextIteratorTest.cpp
|
| @@ -655,6 +655,16 @@ TEST_F(TextIteratorTest, PreserveLeadingSpace) {
|
| plainText(EphemeralRange(start, end), emitsImageAltTextBehavior()));
|
| }
|
|
|
| +// We used to have a bug where the leading space was duplicated if we didn't
|
| +// emit alt text, this tests for that bug
|
| +TEST_F(TextIteratorTest, PreserveLeadingSpaceWithoutEmittingAltText) {
|
| + setBodyContent("<div style='width: 2em;'><b><i>foo</i></b> bar</div>");
|
| + Element* div = document().querySelector("div");
|
| + Position start(div->firstChild()->firstChild()->firstChild(), 0);
|
| + Position end(div->lastChild(), 4);
|
| + EXPECT_EQ("foo bar", plainText(EphemeralRange(start, end)));
|
| +}
|
| +
|
| TEST_F(TextIteratorTest, PreserveOnlyLeadingSpace) {
|
| setBodyContent(
|
| "<div style='width: 2em;'><b><i id='foo'>foo </i></b> bar</div>");
|
|
|