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

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

Issue 1313883002: Introduce firstRangeOf() as replacement of VisibleSelection::firstRange() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 2015-08-25T17:47:14 Created 5 years, 4 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 | « Source/core/editing/InputMethodController.cpp ('k') | Source/core/editing/VisibleSelection.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/editing/SurroundingTextTest.cpp
diff --git a/Source/core/editing/SurroundingTextTest.cpp b/Source/core/editing/SurroundingTextTest.cpp
index 69b71d05ae25596467ffc90057c4d458604bc2aa..052cdfc4a7a09456880bab79e4ecc5e0f7ae0233 100644
--- a/Source/core/editing/SurroundingTextTest.cpp
+++ b/Source/core/editing/SurroundingTextTest.cpp
@@ -116,7 +116,7 @@ TEST_F(SurroundingTextTest, BasicRangeSelection)
{
VisibleSelection selection = select(0, 5);
- SurroundingText surroundingText(*selection.firstRange(), 1);
+ SurroundingText surroundingText(*firstRangeOf(selection), 1);
EXPECT_EQ("Lorem ", surroundingText.content());
EXPECT_EQ(0u, surroundingText.startOffsetInContent());
@@ -125,7 +125,7 @@ TEST_F(SurroundingTextTest, BasicRangeSelection)
{
VisibleSelection selection = select(0, 5);
- SurroundingText surroundingText(*selection.firstRange(), 5);
+ SurroundingText surroundingText(*firstRangeOf(selection), 5);
EXPECT_EQ("Lorem ip", surroundingText.content().simplifyWhiteSpace());
EXPECT_EQ(1u, surroundingText.startOffsetInContent());
@@ -134,7 +134,7 @@ TEST_F(SurroundingTextTest, BasicRangeSelection)
{
VisibleSelection selection = select(0, 5);
- SurroundingText surroundingText(*selection.firstRange(), 42);
+ SurroundingText surroundingText(*firstRangeOf(selection), 42);
EXPECT_EQ("Lorem ipsum dolor sit amet", surroundingText.content().simplifyWhiteSpace());
EXPECT_EQ(1u, surroundingText.startOffsetInContent());
@@ -143,7 +143,7 @@ TEST_F(SurroundingTextTest, BasicRangeSelection)
{
VisibleSelection selection = select(6, 11);
- SurroundingText surroundingText(*selection.firstRange(), 2);
+ SurroundingText surroundingText(*firstRangeOf(selection), 2);
EXPECT_EQ(" ipsum ", surroundingText.content());
EXPECT_EQ(1u, surroundingText.startOffsetInContent());
@@ -152,7 +152,7 @@ TEST_F(SurroundingTextTest, BasicRangeSelection)
{
VisibleSelection selection = select(6, 11);
- SurroundingText surroundingText(*selection.firstRange(), 42);
+ SurroundingText surroundingText(*firstRangeOf(selection), 42);
EXPECT_EQ("Lorem ipsum dolor sit amet", surroundingText.content().simplifyWhiteSpace());
EXPECT_EQ(7u, surroundingText.startOffsetInContent());
@@ -216,7 +216,7 @@ TEST_F(SurroundingTextTest, TreeRangeSelection)
{
VisibleSelection selection = select(0, 1);
- SurroundingText surroundingText(*selection.firstRange(), 1);
+ SurroundingText surroundingText(*firstRangeOf(selection), 1);
EXPECT_EQ("fo", surroundingText.content().simplifyWhiteSpace());
EXPECT_EQ(0u, surroundingText.startOffsetInContent());
@@ -225,7 +225,7 @@ TEST_F(SurroundingTextTest, TreeRangeSelection)
{
VisibleSelection selection = select(0, 3);
- SurroundingText surroundingText(*selection.firstRange(), 12);
+ SurroundingText surroundingText(*firstRangeOf(selection), 12);
EXPECT_EQ("e of foo bar", surroundingText.content().simplifyWhiteSpace());
EXPECT_EQ(5u, surroundingText.startOffsetInContent());
@@ -234,7 +234,7 @@ TEST_F(SurroundingTextTest, TreeRangeSelection)
{
VisibleSelection selection = select(0, 3);
- SurroundingText surroundingText(*selection.firstRange(), 1337);
+ SurroundingText surroundingText(*firstRangeOf(selection), 1337);
EXPECT_EQ("This is outside of foo bar the selected node", surroundingText.content().simplifyWhiteSpace());
EXPECT_EQ(20u, surroundingText.startOffsetInContent());
@@ -243,7 +243,7 @@ TEST_F(SurroundingTextTest, TreeRangeSelection)
{
VisibleSelection selection = select(4, 7);
- SurroundingText surroundingText(*selection.firstRange(), 12);
+ SurroundingText surroundingText(*firstRangeOf(selection), 12);
EXPECT_EQ("foo bar the se", surroundingText.content().simplifyWhiteSpace());
EXPECT_EQ(5u, surroundingText.startOffsetInContent());
@@ -252,7 +252,7 @@ TEST_F(SurroundingTextTest, TreeRangeSelection)
{
VisibleSelection selection = select(0, 7);
- SurroundingText surroundingText(*selection.firstRange(), 1337);
+ SurroundingText surroundingText(*firstRangeOf(selection), 1337);
EXPECT_EQ("This is outside of foo bar the selected node", surroundingText.content().simplifyWhiteSpace());
EXPECT_EQ(20u, surroundingText.startOffsetInContent());
« no previous file with comments | « Source/core/editing/InputMethodController.cpp ('k') | Source/core/editing/VisibleSelection.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698