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

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

Issue 2972863003: Introduce CreateVisibleSelectionWithGranularity() (Closed)
Patch Set: 2017-07-06T16:26:15 Created 3 years, 5 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/VisibleSelectionTest.cpp
diff --git a/third_party/WebKit/Source/core/editing/VisibleSelectionTest.cpp b/third_party/WebKit/Source/core/editing/VisibleSelectionTest.cpp
index 4077327dc41f99cc19d2e69e094e41712aa9ad51..c9e5b882db3ee029d54fe56c979759ad3a6350e8 100644
--- a/third_party/WebKit/Source/core/editing/VisibleSelectionTest.cpp
+++ b/third_party/WebKit/Source/core/editing/VisibleSelectionTest.cpp
@@ -64,11 +64,11 @@ template <typename Strategy>
VisibleSelectionTemplate<Strategy> ExpandUsingGranularity(
const VisibleSelectionTemplate<Strategy>& selection,
TextGranularity granularity) {
- return CreateVisibleSelection(
+ return CreateVisibleSelectionWithGranularity(
typename SelectionTemplate<Strategy>::Builder()
.SetBaseAndExtent(selection.Base(), selection.Extent())
- .SetGranularity(granularity)
- .Build());
+ .Build(),
+ granularity);
}
// For http://crbug.com/700368
@@ -82,12 +82,12 @@ TEST_F(VisibleSelectionTest, appendTrailingWhitespaceWithAfterAnchor) {
// TODO(editing-dev): We should remove above comment once we fix [1].
// [1] http://crbug.com/701657 double-click on user-select:none should not
// compute selection.
- const VisibleSelection selection =
- CreateVisibleSelection(SelectionInDOMTree::Builder()
- .Collapse(Position::BeforeNode(*input))
- .Extend(Position::AfterNode(*input))
- .SetGranularity(kWordGranularity)
- .Build());
+ const VisibleSelection selection = CreateVisibleSelectionWithGranularity(
+ SelectionInDOMTree::Builder()
+ .Collapse(Position::BeforeNode(*input))
+ .Extend(Position::AfterNode(*input))
+ .Build(),
+ kWordGranularity);
const VisibleSelection result = selection.AppendTrailingWhitespace();
EXPECT_EQ(Position::BeforeNode(*input), result.Start());

Powered by Google App Engine
This is Rietveld 408576698