| 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 0ae1c218a917f3b8beef7727bee1ce8e74ed37f0..382915918aba0336a8e78532eacd80ff068600c5 100644
|
| --- a/third_party/WebKit/Source/core/editing/FrameSelectionTest.cpp
|
| +++ b/third_party/WebKit/Source/core/editing/FrameSelectionTest.cpp
|
| @@ -33,7 +33,7 @@ class FrameSelectionTest : public EditingTestBase {
|
| return selection().selection();
|
| }
|
| const VisibleSelectionInFlatTree& visibleSelectionInFlatTree() const {
|
| - return selection().selectionInFlatTree();
|
| + return selection().computeVisibleSelectionInFlatTree();
|
| }
|
|
|
| Text* appendTextNode(const String& data);
|
| @@ -91,6 +91,9 @@ TEST_F(FrameSelectionTest, InvalidateCaretRect) {
|
| EXPECT_FALSE(selection().isCaretBoundsDirty());
|
| }
|
|
|
| +// TODO(yosin): We should get rid of |PaintCaretShouldNotLayout| since
|
| +// |FrameSelection::paintCaret()| requires up-to-date layout.
|
| +#if 0
|
| TEST_F(FrameSelectionTest, PaintCaretShouldNotLayout) {
|
| Text* text = appendTextNode("Hello, World!");
|
| document().view()->updateAllLifecyclePhases();
|
| @@ -122,6 +125,7 @@ TEST_F(FrameSelectionTest, PaintCaretShouldNotLayout) {
|
| paintController->commitNewDisplayItems();
|
| EXPECT_EQ(startCount, layoutCount());
|
| }
|
| +#endif
|
|
|
| TEST_F(FrameSelectionTest, InvalidatePreviousCaretAfterRemovingLastCharacter) {
|
| Text* text = appendTextNode("Hello, World!");
|
| @@ -155,7 +159,7 @@ TEST_F(FrameSelectionTest, InvalidatePreviousCaretAfterRemovingLastCharacter) {
|
| selection().setCaretRectNeedsUpdate();
|
| EXPECT_TRUE(selection().isCaretBoundsDirty());
|
| // "H" remains so early previousCaret invalidation isn't needed.
|
| - EXPECT_TRUE(isPreviousCaretDirtyForTesting());
|
| + EXPECT_FALSE(isPreviousCaretDirtyForTesting());
|
| selection().invalidateCaretRect();
|
| EXPECT_FALSE(selection().isCaretBoundsDirty());
|
| EXPECT_TRUE(isPreviousCaretDirtyForTesting());
|
| @@ -285,7 +289,7 @@ class SelectionControllerTest : public EditingTestBase {
|
| }
|
|
|
| const VisibleSelectionInFlatTree& visibleSelectionInFlatTree() const {
|
| - return selection().selectionInFlatTree();
|
| + return selection().computeVisibleSelectionInFlatTree();
|
| }
|
|
|
| void setNonDirectionalSelectionIfNeeded(const VisibleSelectionInFlatTree&,
|
| @@ -314,17 +318,14 @@ TEST_F(FrameSelectionTest, updateIfNeededAndFrameCaret) {
|
| EXPECT_EQ(Position(document().body(), 0), selection().start());
|
| EXPECT_EQ(selection().start(), caretPosition().position());
|
| document().body()->remove();
|
| - // TODO(yosin): Once lazy canonicalization implemented, selection.start
|
| - // should be Position(HTML, 0).
|
| - EXPECT_EQ(Position(document().documentElement(), 1), selection().start());
|
| + EXPECT_EQ(Position(), selection().start())
|
| + << "Selection has been removed by BODY.remove().";
|
| EXPECT_EQ(selection().start(), caretPosition().position());
|
| document().updateStyleAndLayout();
|
| selection().updateIfNeeded();
|
|
|
| - // TODO(yosin): Once lazy canonicalization implemented, selection.start
|
| - // should be Position(HTML, 0).
|
| EXPECT_EQ(Position(), selection().start())
|
| - << "updateIfNeeded() makes selection to null.";
|
| + << "updateIfNeeded() does nothing.";
|
| EXPECT_EQ(selection().start(), caretPosition().position());
|
| }
|
|
|
|
|