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

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

Issue 2906493003: Get rid of FrameSelection::SetSelectedRange() (Closed)
Patch Set: Created 3 years, 7 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/FrameSelection.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/FrameSelectionTest.cpp
diff --git a/third_party/WebKit/Source/core/editing/FrameSelectionTest.cpp b/third_party/WebKit/Source/core/editing/FrameSelectionTest.cpp
index 0cc7e19026e8252cc2cb129812c511c1d36c8652..26a48819ec7f1eeb18e46b485108a8b84ceebfb0 100644
--- a/third_party/WebKit/Source/core/editing/FrameSelectionTest.cpp
+++ b/third_party/WebKit/Source/core/editing/FrameSelectionTest.cpp
@@ -60,9 +60,11 @@ TEST_F(FrameSelectionTest, FirstEphemeralRangeOf) {
SetBodyContent("<div id=sample>0123456789</div>abc");
Element* const sample = GetDocument().getElementById("sample");
Node* const text = sample->firstChild();
- Selection().SetSelectedRange(
- EphemeralRange(Position(text, 3), Position(text, 6)), VP_DEFAULT_AFFINITY,
- SelectionDirectionalMode::kNonDirectional, 0);
+ Selection().SetSelection(SelectionInDOMTree::Builder()
+ .SetBaseAndExtent(EphemeralRange(
+ Position(text, 3), Position(text, 6)))
+ .Build(),
+ 0);
sample->setAttribute(HTMLNames::styleAttr, "display:none");
// Move |VisibleSelection| before "abc".
UpdateAllLifecyclePhases();
@@ -296,7 +298,7 @@ TEST_F(FrameSelectionTest, SelectAllPreservesHandle) {
"after it.";
}
-TEST_F(FrameSelectionTest, SetSelectedRangeHidesHandle) {
+TEST_F(FrameSelectionTest, SelectionOnRangeHidesHandles) {
Text* text = AppendTextNode("Hello, World!");
GetDocument().View()->UpdateAllLifecyclePhases();
Selection().SetSelection(
@@ -305,12 +307,14 @@ TEST_F(FrameSelectionTest, SetSelectedRangeHidesHandle) {
.SetIsHandleVisible(false)
.Build());
- Selection().SetSelectedRange(
- EphemeralRange(Position(text, 0), Position(text, 12)),
- VP_DEFAULT_AFFINITY, SelectionDirectionalMode::kNonDirectional, 0);
+ Selection().SetSelection(SelectionInDOMTree::Builder()
+ .SetBaseAndExtent(EphemeralRange(
+ Position(text, 0), Position(text, 12)))
+ .Build(),
+ 0);
EXPECT_FALSE(Selection().IsHandleVisible())
- << "After SetSelectedRange handles shouldn't be present.";
+ << "After SetSelection on Range, handles shouldn't be present.";
Selection().SetSelection(
SelectionInDOMTree::Builder()
@@ -318,12 +322,14 @@ TEST_F(FrameSelectionTest, SetSelectedRangeHidesHandle) {
.SetIsHandleVisible(true)
.Build());
- Selection().SetSelectedRange(
- EphemeralRange(Position(text, 0), Position(text, 12)),
- VP_DEFAULT_AFFINITY, SelectionDirectionalMode::kNonDirectional, 0);
+ Selection().SetSelection(SelectionInDOMTree::Builder()
+ .SetBaseAndExtent(EphemeralRange(
+ Position(text, 0), Position(text, 12)))
+ .Build(),
+ 0);
EXPECT_FALSE(Selection().IsHandleVisible())
- << "After SetSelectedRange handles shouldn't be present.";
+ << "After SetSelection on Range, handles shouldn't be present.";
}
// Regression test for crbug.com/702756
« no previous file with comments | « third_party/WebKit/Source/core/editing/FrameSelection.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698