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

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

Issue 2820343004: [DMC #4] Add CompositionMarkerListImpl (Closed)
Patch Set: DECLARE_VIRTUAL_TRACE() Created 3 years, 8 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 931f6e7b208f7af8e26bd48d29f342c413489220..0e23593766962c11d7b8bb844db704ffee0dff20 100644
--- a/third_party/WebKit/Source/core/editing/markers/DocumentMarkerControllerTest.cpp
+++ b/third_party/WebKit/Source/core/editing/markers/DocumentMarkerControllerTest.cpp
@@ -57,7 +57,6 @@ class DocumentMarkerControllerTest : public ::testing::Test {
Text* CreateTextNode(const char*);
void MarkNodeContents(Node*);
- void MarkNodeContentsWithComposition(Node*);
void SetBodyInnerHTML(const char*);
private:
@@ -77,16 +76,6 @@ void DocumentMarkerControllerTest::MarkNodeContents(Node* node) {
DocumentMarker::kSpelling);
}
-void DocumentMarkerControllerTest::MarkNodeContentsWithComposition(Node* node) {
- // Force layoutObjects to be created; TextIterator, which is used in
- // DocumentMarkerControllerTest::addMarker(), needs them.
- GetDocument().UpdateStyleAndLayout();
- auto range = EphemeralRange::RangeOfContents(*node);
- MarkerController().AddCompositionMarker(range.StartPosition(),
- range.EndPosition(), Color::kBlack,
- false, Color::kBlack);
-}
-
void DocumentMarkerControllerTest::SetBodyInnerHTML(const char* body_content) {
GetDocument().body()->setInnerHTML(String::FromUTF8(body_content));
}
@@ -217,22 +206,6 @@ TEST_F(DocumentMarkerControllerTest, UpdateRenderedRects) {
EXPECT_NE(rendered_rects[0], new_rendered_rects[0]);
}
-TEST_F(DocumentMarkerControllerTest, UpdateRenderedRectsForComposition) {
- SetBodyInnerHTML("<div style='margin: 100px'>foo</div>");
- Element* div = ToElement(GetDocument().body()->firstChild());
- MarkNodeContentsWithComposition(div);
- Vector<IntRect> rendered_rects =
- MarkerController().RenderedRectsForMarkers(DocumentMarker::kComposition);
- EXPECT_EQ(1u, rendered_rects.size());
-
- div->setAttribute(HTMLNames::styleAttr, "margin: 200px");
- GetDocument().UpdateStyleAndLayout();
- Vector<IntRect> new_rendered_rects =
- MarkerController().RenderedRectsForMarkers(DocumentMarker::kComposition);
- EXPECT_EQ(1u, new_rendered_rects.size());
- EXPECT_NE(rendered_rects[0], new_rendered_rects[0]);
-}
-
TEST_F(DocumentMarkerControllerTest, CompositionMarkersNotMerged) {
SetBodyInnerHTML("<div style='margin: 100px'>foo</div>");
Node* text = GetDocument().body()->firstChild()->firstChild();

Powered by Google App Engine
This is Rietveld 408576698