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

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

Issue 1317053004: Make VisiblePosition constructor private (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 2015-09-02T12:44:47 Rebase Created 5 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
« no previous file with comments | « Source/core/editing/FrameSelectionTest.cpp ('k') | Source/core/editing/PlainTextRange.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/editing/GranularityStrategyTest.cpp
diff --git a/Source/core/editing/GranularityStrategyTest.cpp b/Source/core/editing/GranularityStrategyTest.cpp
index e988f7e8602ac77fb8b67149ddac83ec46a8e2d9..5e6cc9fb3acd7ac669bece8e1c716ce11182c80b 100644
--- a/Source/core/editing/GranularityStrategyTest.cpp
+++ b/Source/core/editing/GranularityStrategyTest.cpp
@@ -124,7 +124,7 @@ void GranularityStrategyTest::parseText(std::vector<Text*> textNodes)
int wordStartIndexOffset = m_letterPos.size();
WTF::String str = text->wholeText();
for (size_t i = 0; i < str.length(); i++) {
- m_letterPos.push_back(visiblePositionToContentsPoint(VisiblePosition(Position(text, i))));
+ m_letterPos.push_back(visiblePositionToContentsPoint(createVisiblePosition(Position(text, i))));
char c = str.characterAt(i);
if (isASCIIAlphanumeric(c) && !wordStarted) {
wordStartIndex = i + wordStartIndexOffset;
@@ -138,7 +138,7 @@ void GranularityStrategyTest::parseText(std::vector<Text*> textNodes)
}
if (wordStarted) {
Text* lastNode = textNodes[textNodes.size() - 1];
- int xEnd = visiblePositionToContentsPoint(VisiblePosition(Position(lastNode, lastNode->wholeText().length()))).x();
+ int xEnd = visiblePositionToContentsPoint(createVisiblePosition(Position(lastNode, lastNode->wholeText().length()))).x();
IntPoint wordMiddle((m_letterPos[wordStartIndex].x() + xEnd) / 2, m_letterPos[wordStartIndex].y());
m_wordMiddles.push_back(wordMiddle);
}
@@ -484,10 +484,10 @@ TEST_F(GranularityStrategyTest, Character)
selection().setSelection(VisibleSelection(Position(text, 5), Position(text, 6)));
EXPECT_EQ_SELECTED_TEXT("a");
// "Foo B^ar B|>az,"
- selection().moveRangeSelectionExtent(visiblePositionToContentsPoint(VisiblePosition(Position(text, 9))));
+ selection().moveRangeSelectionExtent(visiblePositionToContentsPoint(createVisiblePosition(Position(text, 9))));
EXPECT_EQ_SELECTED_TEXT("ar B");
// "F<|oo B^ar Baz,"
- selection().moveRangeSelectionExtent(visiblePositionToContentsPoint(VisiblePosition(Position(text, 1))));
+ selection().moveRangeSelectionExtent(visiblePositionToContentsPoint(createVisiblePosition(Position(text, 1))));
EXPECT_EQ_SELECTED_TEXT("oo B");
}
« no previous file with comments | « Source/core/editing/FrameSelectionTest.cpp ('k') | Source/core/editing/PlainTextRange.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698