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

Unified Diff: third_party/WebKit/Source/core/editing/markers/DocumentMarkerControllerTest.cpp

Issue 2763893002: [WIP] Clean up DocumentMarkerController API (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/markers/DocumentMarkerControllerTest.cpp
diff --git a/third_party/WebKit/Source/core/editing/markers/DocumentMarkerControllerTest.cpp b/third_party/WebKit/Source/core/editing/markers/DocumentMarkerControllerTest.cpp
index f8d66e6e2f3ce391e8d976ca3c5e704b2dbc739c..98468c0c76c2c4d6f25725de487215dd71dd9e54 100644
--- a/third_party/WebKit/Source/core/editing/markers/DocumentMarkerControllerTest.cpp
+++ b/third_party/WebKit/Source/core/editing/markers/DocumentMarkerControllerTest.cpp
@@ -72,8 +72,8 @@ void DocumentMarkerControllerTest::markNodeContents(Node* node) {
// DocumentMarkerControllerTest::addMarker(), needs them.
document().updateStyleAndLayout();
auto range = EphemeralRange::rangeOfContents(*node);
- markerController().addMarker(range.startPosition(), range.endPosition(),
- DocumentMarker::TextMatch);
+ markerController().addTextMatchMarker(range.startPosition(),
+ range.endPosition(), false);
}
void DocumentMarkerControllerTest::setBodyInnerHTML(const char* bodyContent) {
@@ -189,13 +189,13 @@ TEST_F(DocumentMarkerControllerTest, UpdateRenderedRects) {
Element* div = toElement(document().body()->firstChild());
markNodeContents(div);
Vector<IntRect> renderedRects =
- markerController().renderedRectsForMarkers(DocumentMarker::TextMatch);
+ markerController().renderedRectsForTextMatchMarkers();
EXPECT_EQ(1u, renderedRects.size());
div->setAttribute(HTMLNames::styleAttr, "margin: 200px");
document().updateStyleAndLayout();
Vector<IntRect> newRenderedRects =
- markerController().renderedRectsForMarkers(DocumentMarker::TextMatch);
+ markerController().renderedRectsForTextMatchMarkers();
EXPECT_EQ(1u, newRenderedRects.size());
EXPECT_NE(renderedRects[0], newRenderedRects[0]);
}
@@ -221,12 +221,13 @@ TEST_F(DocumentMarkerControllerTest, SetMarkerActiveTest) {
Position endBElement = toPositionInDOMTree(ephemeralRange.endPosition());
const EphemeralRange range(startBElement, endBElement);
// Try to make active a marker that doesn't exist.
- EXPECT_FALSE(markerController().setMarkersActive(range, true));
+ EXPECT_FALSE(markerController().setTextMatchMarkersActive(range, true));
// Add a marker and try it once more.
- markerController().addTextMatchMarker(range, false);
+ markerController().addTextMatchMarker(range.startPosition(),
+ range.endPosition(), false);
EXPECT_EQ(1u, markerController().markers().size());
- EXPECT_TRUE(markerController().setMarkersActive(range, true));
+ EXPECT_TRUE(markerController().setTextMatchMarkersActive(range, true));
}
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698