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 9e6a5bdf22a990d3b502b0878e3894f16a2807e8..7a5311cb2801b7763741f37dd9c21b12af487d68 100644 |
--- a/third_party/WebKit/Source/core/editing/iterators/TextIteratorTest.cpp |
+++ b/third_party/WebKit/Source/core/editing/iterators/TextIteratorTest.cpp |
@@ -158,6 +158,15 @@ TEST_F(TextIteratorTest, EnteringTextControlsWithOptionComplex) |
EXPECT_EQ("[][\n][Beginning of range][\n][][\n][Under DOM nodes][\n][][\n][End of range]", iterate<FlatTree>(TextIteratorEntersTextControls)); |
} |
+TEST_F(TextIteratorTest, PreserveLeadingSpace) |
+{ |
+ static const char* input = "<div style='width: 2em;'><b><i>foo</i></b> bar</div>"; |
+ setBodyContent(input); |
+ EXPECT_EQ("[foo][ ][bar]", iterate<DOMTree>(TextIteratorEmitsImageAltText)); |
+ EXPECT_EQ("[foo][ ][bar]", iterate<DOMTree>(TextIteratorDoesNotBreakAtReplacedElement)); |
+ EXPECT_EQ("[foo][ ][bar]", iterate<DOMTree>(TextIteratorForInnerText)); |
+} |
+ |
TEST_F(TextIteratorTest, NotEnteringShadowTree) |
{ |
static const char* bodyContent = "<div>Hello, <span id='host'>text</span> iterator.</div>"; |