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

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

Issue 2374183004: Make non-null VisibleSelections creatable only by createVisibleSelection[Deprecated] (Closed)
Patch Set: Fix mac compile error Created 4 years, 3 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/GranularityStrategyTest.cpp
diff --git a/third_party/WebKit/Source/core/editing/GranularityStrategyTest.cpp b/third_party/WebKit/Source/core/editing/GranularityStrategyTest.cpp
index a4b5527b9b1fbbc95e4c2a4ffa7f38059674d26f..c59465f6b87fc0163f0f4fdc183572f5e7b82466 100644
--- a/third_party/WebKit/Source/core/editing/GranularityStrategyTest.cpp
+++ b/third_party/WebKit/Source/core/editing/GranularityStrategyTest.cpp
@@ -260,7 +260,7 @@ void GranularityStrategyTest::setupTextSpan(String str1, String str2, String str
else
p2 = Position(text3, selEnd - str1.length() - str2.length());
- selection().setSelection(VisibleSelection(p1, p2));
+ selection().setSelection(createVisibleSelectionDeprecated(p1, p2));
}
void GranularityStrategyTest::setupVerticalAlign(String str1, String str2, String str3, size_t selBegin, size_t selEnd)
@@ -483,7 +483,7 @@ TEST_F(GranularityStrategyTest, Character)
document().updateStyleAndLayout();
// "Foo B^a|>r Baz," (^ means base, | means extent, , < means start, and > means end).
- selection().setSelection(VisibleSelection(Position(text, 5), Position(text, 6)));
+ selection().setSelection(createVisibleSelectionDeprecated(Position(text, 5), Position(text, 6)));
EXPECT_EQ_SELECTED_TEXT("a");
// "Foo B^ar B|>az,"
selection().moveRangeSelectionExtent(visiblePositionToContentsPoint(createVisiblePosition(Position(text, 9))));
@@ -499,7 +499,7 @@ TEST_F(GranularityStrategyTest, DirectionRotate)
{
Text* text = setupRotate("Foo Bar Baz,");
// "Foo B^a|>r Baz," (^ means base, | means extent, , < means start, and > means end).
- selection().setSelection(VisibleSelection(Position(text, 5), Position(text, 6)));
+ selection().setSelection(createVisibleSelectionDeprecated(Position(text, 5), Position(text, 6)));
EXPECT_EQ_SELECTED_TEXT("a");
IntPoint p = m_letterPos[9];
// Need to move by one pixel, otherwise this point is not evaluated
@@ -519,7 +519,7 @@ TEST_F(GranularityStrategyTest, DirectionExpandTranslateZ)
{
Text* text = setupTranslateZ("abcdef ghij kl mnopqr stuvwi inm mnii,");
// "abcdef ghij kl mno^p|>qr stuvwi inm mnii," (^ means base, | means extent, < means start, and > means end).
- selection().setSelection(VisibleSelection(Position(text, 18), Position(text, 19)));
+ selection().setSelection(createVisibleSelectionDeprecated(Position(text, 18), Position(text, 19)));
EXPECT_EQ_SELECTED_TEXT("p");
testDirectionExpand();
}
@@ -528,7 +528,7 @@ TEST_F(GranularityStrategyTest, DirectionExpandTransform)
{
Text* text = setupTransform("abcdef ghij kl mnopqr stuvwi inm mnii,");
// "abcdef ghij kl mno^p|>qr stuvwi inm mnii," (^ means base, | means extent, < means start, and > means end).
- selection().setSelection(VisibleSelection(Position(text, 18), Position(text, 19)));
+ selection().setSelection(createVisibleSelectionDeprecated(Position(text, 18), Position(text, 19)));
EXPECT_EQ_SELECTED_TEXT("p");
testDirectionExpand();
}
@@ -551,7 +551,7 @@ TEST_F(GranularityStrategyTest, DirectionExpandFontSizes)
TEST_F(GranularityStrategyTest, DirectionShrinkTranslateZ)
{
Text* text = setupTranslateZ("abcdef ghij kl mnopqr iiinmni, abc");
- selection().setSelection(VisibleSelection(Position(text, 18), Position(text, 21)));
+ selection().setSelection(createVisibleSelectionDeprecated(Position(text, 18), Position(text, 21)));
EXPECT_EQ_SELECTED_TEXT("pqr");
testDirectionShrink();
}
@@ -559,7 +559,7 @@ TEST_F(GranularityStrategyTest, DirectionShrinkTranslateZ)
TEST_F(GranularityStrategyTest, DirectionShrinkTransform)
{
Text* text = setupTransform("abcdef ghij kl mnopqr iiinmni, abc");
- selection().setSelection(VisibleSelection(Position(text, 18), Position(text, 21)));
+ selection().setSelection(createVisibleSelectionDeprecated(Position(text, 18), Position(text, 21)));
EXPECT_EQ_SELECTED_TEXT("pqr");
testDirectionShrink();
}
@@ -581,7 +581,7 @@ TEST_F(GranularityStrategyTest, DirectionShrinkFontSizes)
TEST_F(GranularityStrategyTest, DirectionSwitchSideTranslateZ)
{
Text* text = setupTranslateZ("abcd efgh ijkl mnopqr iiinmni, abc");
- selection().setSelection(VisibleSelection(Position(text, 18), Position(text, 21)));
+ selection().setSelection(createVisibleSelectionDeprecated(Position(text, 18), Position(text, 21)));
EXPECT_EQ_SELECTED_TEXT("pqr");
testDirectionSwitchSide();
}
@@ -589,7 +589,7 @@ TEST_F(GranularityStrategyTest, DirectionSwitchSideTranslateZ)
TEST_F(GranularityStrategyTest, DirectionSwitchSideTransform)
{
Text* text = setupTransform("abcd efgh ijkl mnopqr iiinmni, abc");
- selection().setSelection(VisibleSelection(Position(text, 18), Position(text, 21)));
+ selection().setSelection(createVisibleSelectionDeprecated(Position(text, 18), Position(text, 21)));
EXPECT_EQ_SELECTED_TEXT("pqr");
testDirectionSwitchSide();
}
@@ -622,7 +622,7 @@ TEST_F(GranularityStrategyTest, DirectionSwitchSideWordGranularityThenShrink)
parseText(text);
// "abcd efgh ijkl mno^pqr|> iiin, abc" (^ means base, | means extent, < means start, and > means end).
- selection().setSelection(VisibleSelection(Position(text, 18), Position(text, 21)));
+ selection().setSelection(createVisibleSelectionDeprecated(Position(text, 18), Position(text, 21)));
EXPECT_EQ_SELECTED_TEXT("pqr");
// Move to the middle of word #4 selecting it - this will set the offset to
// be half the width of "iiin".
@@ -656,7 +656,7 @@ TEST_F(GranularityStrategyTest, DirectionSwitchStartOnBoundary)
// "ab cd efghijkl ^mnopqr |>stuvwi inm," (^ means base and | means extent,
// > means end).
- selection().setSelection(VisibleSelection(Position(text, 15), Position(text, 22)));
+ selection().setSelection(createVisibleSelectionDeprecated(Position(text, 15), Position(text, 22)));
EXPECT_EQ_SELECTED_TEXT("mnopqr ");
selection().moveRangeSelectionExtent(m_wordMiddles[4]);
EXPECT_EQ_SELECTED_TEXT("mnopqr iiin");

Powered by Google App Engine
This is Rietveld 408576698