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

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

Issue 2455083003: Reduce usage of VisibleSelection::setBase() and setExtent() (Closed)
Patch Set: 2016-10-31T10:31:10 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/SurroundingTextTest.cpp
diff --git a/third_party/WebKit/Source/core/editing/SurroundingTextTest.cpp b/third_party/WebKit/Source/core/editing/SurroundingTextTest.cpp
index fd5b0f178698f91f0e8b598923098fdf89821095..eb1baddc37abc08b686d0d2144a94eb88ea32f7d 100644
--- a/third_party/WebKit/Source/core/editing/SurroundingTextTest.cpp
+++ b/third_party/WebKit/Source/core/editing/SurroundingTextTest.cpp
@@ -40,10 +40,11 @@ void SurroundingTextTest::setHTML(const String& content) {
VisibleSelection SurroundingTextTest::select(int start, int end) {
Element* element = document().getElementById("selection");
- VisibleSelection selection;
- selection.setBase(Position(toText(element->firstChild()), start));
- selection.setExtent(Position(toText(element->firstChild()), end));
- return selection;
+ return createVisibleSelection(
+ SelectionInDOMTree::Builder()
+ .collapse(Position(toText(element->firstChild()), start))
+ .extend(Position(toText(element->firstChild()), end))
+ .build());
}
TEST_F(SurroundingTextTest, BasicCaretSelection) {

Powered by Google App Engine
This is Rietveld 408576698