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

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

Issue 2926823002: Introduce LocalCaretRect for refactoring Local{Caret,Selection}RectPosition() (Closed)
Patch Set: 2017-06-09T13:08:12 Created 3 years, 6 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/VisibleUnitsTest.cpp
diff --git a/third_party/WebKit/Source/core/editing/VisibleUnitsTest.cpp b/third_party/WebKit/Source/core/editing/VisibleUnitsTest.cpp
index 8795eb6b3f8b2a76961c3df53c7a35e9cb522301..b6a788231e4a6e80bb2f48bd42bdf33c4093f9da 100644
--- a/third_party/WebKit/Source/core/editing/VisibleUnitsTest.cpp
+++ b/third_party/WebKit/Source/core/editing/VisibleUnitsTest.cpp
@@ -1088,18 +1088,16 @@ TEST_F(VisibleUnitsTest, localCaretRectOfPosition) {
Element* one = GetDocument().getElementById("one");
- LayoutObject* layout_object_from_dom_tree;
- LayoutRect layout_rect_from_dom_tree = LocalCaretRectOfPosition(
- Position(one->firstChild(), 0), layout_object_from_dom_tree);
-
- LayoutObject* layout_object_from_flat_tree;
- LayoutRect layout_rect_from_flat_tree = LocalCaretRectOfPosition(
- PositionInFlatTree(one->firstChild(), 0), layout_object_from_flat_tree);
-
- EXPECT_TRUE(layout_object_from_dom_tree);
- EXPECT_FALSE(layout_rect_from_dom_tree.IsEmpty());
- EXPECT_EQ(layout_object_from_dom_tree, layout_object_from_flat_tree);
- EXPECT_EQ(layout_rect_from_dom_tree, layout_rect_from_flat_tree);
+ const LocalCaretRect& caret_rect_from_dom_tree =
+ LocalCaretRectOfPosition(Position(one->firstChild(), 0));
+
+ const LocalCaretRect& caret_rect_from_flat_tree =
+ LocalCaretRectOfPosition(PositionInFlatTree(one->firstChild(), 0));
+
+ EXPECT_FALSE(caret_rect_from_dom_tree.IsEmpty());
+ EXPECT_EQ(caret_rect_from_dom_tree.layout_object,
+ caret_rect_from_flat_tree.layout_object);
+ EXPECT_EQ(caret_rect_from_dom_tree.rect, caret_rect_from_flat_tree.rect);
}
TEST_F(VisibleUnitsTest, logicalEndOfLine) {

Powered by Google App Engine
This is Rietveld 408576698