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

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

Issue 2776983003: Expand FrameSelection/SelectionEditor::firstRange() (Closed)
Patch Set: 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
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 d566ff080c633599465f68c011d17a0b816a22cf..e32a97a4237c6da5cf308df69fcab7e3b01b5485 100644
--- a/third_party/WebKit/Source/core/editing/FrameSelectionTest.cpp
+++ b/third_party/WebKit/Source/core/editing/FrameSelectionTest.cpp
@@ -56,7 +56,7 @@ Text* FrameSelectionTest::appendTextNode(const String& data) {
return text;
}
-TEST_F(FrameSelectionTest, FirstRange) {
+TEST_F(FrameSelectionTest, FirstEphemeralRangeOf) {
setBodyContent("<div id=sample>0123456789</div>abc");
Element* const sample = document().getElementById("sample");
Node* const text = sample->firstChild();
@@ -66,10 +66,11 @@ TEST_F(FrameSelectionTest, FirstRange) {
sample->setAttribute(HTMLNames::styleAttr, "display:none");
// Move |VisibleSelection| before "abc".
updateAllLifecyclePhases();
- Range* const range = selection().firstRange();
- EXPECT_EQ(Position(sample->nextSibling(), 0), range->startPosition())
+ const EphemeralRange& range =
+ firstEphemeralRangeOf(selection().computeVisibleSelectionInDOMTree());
+ EXPECT_EQ(Position(sample->nextSibling(), 0), range.startPosition())
<< "firstRagne() should return current selection value";
- EXPECT_EQ(Position(sample->nextSibling(), 0), range->endPosition());
+ EXPECT_EQ(Position(sample->nextSibling(), 0), range.endPosition());
}
TEST_F(FrameSelectionTest, SetValidSelection) {
« no previous file with comments | « third_party/WebKit/Source/core/editing/FrameSelection.cpp ('k') | third_party/WebKit/Source/core/editing/SelectionEditor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698