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

Unified Diff: third_party/WebKit/Source/core/editing/FrameSelectionTest.cpp

Issue 2431153002: Introduce FrameSelection::moveCaretSelection() as replacement of moveTo() (Closed)
Patch Set: 2016-10-19T14:44:09 Created 4 years, 2 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
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 93968c58ce28d55f88a885e95c0ac72ad9fe77ea..ab01e8b30cc746f71f9eb97d189592f46dec43ce 100644
--- a/third_party/WebKit/Source/core/editing/FrameSelectionTest.cpp
+++ b/third_party/WebKit/Source/core/editing/FrameSelectionTest.cpp
@@ -142,9 +142,8 @@ TEST_F(FrameSelectionTest, InvalidatePreviousCaretAfterRemovingLastCharacter) {
// Simulate to type "Hello, World!".
DisableCompositingQueryAsserts disabler;
document().updateStyleAndLayout();
- selection().moveTo(
- createVisiblePosition(selection().end(), selection().affinity()),
- NotUserTriggered);
+ selection().setSelection(
+ SelectionInDOMTree::Builder().collapse(selection().end()).build());
selection().setCaretRectNeedsUpdate();
EXPECT_TRUE(selection().isCaretBoundsDirty());
EXPECT_FALSE(isPreviousCaretDirtyForTesting());
@@ -155,9 +154,8 @@ TEST_F(FrameSelectionTest, InvalidatePreviousCaretAfterRemovingLastCharacter) {
// Simulate to remove all except for "H".
text->replaceWholeText("H");
document().updateStyleAndLayout();
- selection().moveTo(
- createVisiblePosition(selection().end(), selection().affinity()),
- NotUserTriggered);
+ selection().setSelection(
+ SelectionInDOMTree::Builder().collapse(selection().end()).build());
selection().setCaretRectNeedsUpdate();
EXPECT_TRUE(selection().isCaretBoundsDirty());
// "H" remains so early previousCaret invalidation isn't needed.
« no previous file with comments | « third_party/WebKit/Source/core/editing/FrameSelection.cpp ('k') | third_party/WebKit/Source/web/WebLocalFrameImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698