Chromium Code Reviews| Index: third_party/WebKit/Source/core/editing/FrameSelectionTest.cpp |
| diff --git a/third_party/WebKit/Source/core/editing/FrameSelectionTest.cpp b/third_party/WebKit/Source/core/editing/FrameSelectionTest.cpp |
| index 9fc95a618e6d1a2b8541e53edad80acd5c90ba7b..809cd53bef6c8628e80540193e3457cd48087ba9 100644 |
| --- a/third_party/WebKit/Source/core/editing/FrameSelectionTest.cpp |
| +++ b/third_party/WebKit/Source/core/editing/FrameSelectionTest.cpp |
| @@ -238,6 +238,24 @@ TEST_F(FrameSelectionTest, MoveRangeSelectionTest) { |
| EXPECT_EQ_SELECTED_TEXT("Foo Bar"); |
| } |
| +TEST_F(FrameSelectionTest, MoveRangeSelectionNoLiveness) { |
| + SetBodyContent("<span id=sample>xyz</span>"); |
| + Element* const sample = GetDocument().getElementById("sample"); |
| + // Select as: <span id=sample>^xyz|</span> |
| + Selection().MoveRangeSelection( |
| + CreateVisiblePosition(Position(sample->firstChild(), 1)), |
| + CreateVisiblePosition(Position(sample->firstChild(), 1)), |
| + kWordGranularity); |
|
yoichio
2017/07/05 08:57:24
Could you expect_eq(SelectText(), 'xyz')?
yosin_UTC9
2017/07/05 09:15:49
Done.
|
| + sample->insertBefore(Text::Create(GetDocument(), "abc"), |
| + sample->firstChild()); |
| + GetDocument().UpdateStyleAndLayout(); |
| + const VisibleSelection& selection = |
| + Selection().ComputeVisibleSelectionInDOMTree(); |
| + // Inserting "abc" before "xyz" should not affect to selection. |
| + EXPECT_EQ(Position(sample->lastChild(), 0), selection.Start()); |
| + EXPECT_EQ(Position(sample->lastChild(), 3), selection.End()); |
|
yoichio
2017/07/05 08:57:24
Could you expect_eq(SelectText(), 'xyz') and expe
yosin_UTC9
2017/07/05 09:15:49
Done.
|
| +} |
| + |
| // For http://crbug.com/695317 |
| TEST_F(FrameSelectionTest, SelectAllWithInputElement) { |
| SetBodyContent("<input>123"); |