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

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

Issue 2732963002: Make SelectionController::setNonDirectionalSelectionIfNeeded() to take SelectionInFlatTree (Closed)
Patch Set: 2017-03-07T13:12:10 Created 3 years, 9 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
« no previous file with comments | « third_party/WebKit/Source/core/editing/SelectionController.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/editing/SelectionControllerTest.cpp
diff --git a/third_party/WebKit/Source/core/editing/SelectionControllerTest.cpp b/third_party/WebKit/Source/core/editing/SelectionControllerTest.cpp
index 2d856bd0fa702adaa084440302230bf682717d9b..a8e0c22878bbdc63fb0bf6488cd050d0c024b769 100644
--- a/third_party/WebKit/Source/core/editing/SelectionControllerTest.cpp
+++ b/third_party/WebKit/Source/core/editing/SelectionControllerTest.cpp
@@ -24,7 +24,7 @@ class SelectionControllerTest : public EditingTestBase {
return selection().selectionInFlatTree();
}
- void setNonDirectionalSelectionIfNeeded(const VisibleSelectionInFlatTree&,
+ void setNonDirectionalSelectionIfNeeded(const SelectionInFlatTree&,
TextGranularity);
private:
@@ -32,7 +32,7 @@ class SelectionControllerTest : public EditingTestBase {
};
void SelectionControllerTest::setNonDirectionalSelectionIfNeeded(
- const VisibleSelectionInFlatTree& newSelection,
+ const SelectionInFlatTree& newSelection,
TextGranularity granularity) {
frame()
.eventHandler()
@@ -53,12 +53,11 @@ TEST_F(SelectionControllerTest, setNonDirectionalSelectionIfNeeded) {
Node* host = document().getElementById("host");
// top to bottom
- setNonDirectionalSelectionIfNeeded(
- createVisibleSelection(SelectionInFlatTree::Builder()
- .collapse(PositionInFlatTree(top, 1))
- .extend(PositionInFlatTree(bottom, 3))
- .build()),
- CharacterGranularity);
+ setNonDirectionalSelectionIfNeeded(SelectionInFlatTree::Builder()
+ .collapse(PositionInFlatTree(top, 1))
+ .extend(PositionInFlatTree(bottom, 3))
+ .build(),
+ CharacterGranularity);
EXPECT_EQ(Position(top, 1), visibleSelectionInDOMTree().base());
EXPECT_EQ(Position::beforeNode(host), visibleSelectionInDOMTree().extent());
EXPECT_EQ(Position(top, 1), visibleSelectionInDOMTree().start());
@@ -72,10 +71,10 @@ TEST_F(SelectionControllerTest, setNonDirectionalSelectionIfNeeded) {
// bottom to top
setNonDirectionalSelectionIfNeeded(
- createVisibleSelection(SelectionInFlatTree::Builder()
- .collapse(PositionInFlatTree(bottom, 3))
- .extend(PositionInFlatTree(top, 1))
- .build()),
+ SelectionInFlatTree::Builder()
+ .collapse(PositionInFlatTree(bottom, 3))
+ .extend(PositionInFlatTree(top, 1))
+ .build(),
CharacterGranularity);
EXPECT_EQ(Position(bottom, 3), visibleSelectionInDOMTree().base());
EXPECT_EQ(Position::beforeNode(bottom->parentNode()),
« no previous file with comments | « third_party/WebKit/Source/core/editing/SelectionController.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698