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

Side by Side Diff: third_party/WebKit/Source/core/editing/VisibleUnitsTest.cpp

Issue 1624593003: [Line Layout API] Change VisibleUnitsTest to use lineLayoutItem() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/editing/VisibleUnits.h" 5 #include "core/editing/VisibleUnits.h"
6 6
7 #include "core/dom/Text.h" 7 #include "core/dom/Text.h"
8 #include "core/editing/EditingTestBase.h" 8 #include "core/editing/EditingTestBase.h"
9 #include "core/editing/VisiblePosition.h" 9 #include "core/editing/VisiblePosition.h"
10 #include "core/html/HTMLTextFormControlElement.h" 10 #include "core/html/HTMLTextFormControlElement.h"
(...skipping 23 matching lines...) Expand all
34 { 34 {
35 return createVisiblePosition(PositionInComposedTree(&anchor, offset), affini ty); 35 return createVisiblePosition(PositionInComposedTree(&anchor, offset), affini ty);
36 } 36 }
37 37
38 } // namespace 38 } // namespace
39 39
40 std::ostream& operator<<(std::ostream& ostream, const InlineBoxPosition& inlineB oxPosition) 40 std::ostream& operator<<(std::ostream& ostream, const InlineBoxPosition& inlineB oxPosition)
41 { 41 {
42 if (!inlineBoxPosition.inlineBox) 42 if (!inlineBoxPosition.inlineBox)
43 return ostream << "null"; 43 return ostream << "null";
44 return ostream << inlineBoxPosition.inlineBox->layoutObject().node() << "@" << inlineBoxPosition.offsetInBox; 44 return ostream << inlineBoxPosition.inlineBox->lineLayoutItem().node() << "@ " << inlineBoxPosition.offsetInBox;
45 } 45 }
46 46
47 class VisibleUnitsTest : public EditingTestBase { 47 class VisibleUnitsTest : public EditingTestBase {
48 }; 48 };
49 49
50 TEST_F(VisibleUnitsTest, absoluteCaretBoundsOf) 50 TEST_F(VisibleUnitsTest, absoluteCaretBoundsOf)
51 { 51 {
52 const char* bodyContent = "<p id='host'><b id='one'>11</b><b id='two'>22</b> </p>"; 52 const char* bodyContent = "<p id='host'><b id='one'>11</b><b id='two'>22</b> </p>";
53 const char* shadowContent = "<div><content select=#two></content><content se lect=#one></content></div>"; 53 const char* shadowContent = "<div><content select=#two></content><content se lect=#one></content></div>";
54 setBodyContent(bodyContent); 54 setBodyContent(bodyContent);
(...skipping 1088 matching lines...) Expand 10 before | Expand all | Expand 10 after
1143 EXPECT_EQ(PositionInComposedTree(space, 1), startOfWord(createVisiblePositio nInComposedTree(*three, 1)).deepEquivalent()); 1143 EXPECT_EQ(PositionInComposedTree(space, 1), startOfWord(createVisiblePositio nInComposedTree(*three, 1)).deepEquivalent());
1144 1144
1145 EXPECT_EQ(Position(four, 0), startOfWord(createVisiblePositionInDOMTree(*fou r, 1)).deepEquivalent()); 1145 EXPECT_EQ(Position(four, 0), startOfWord(createVisiblePositionInDOMTree(*fou r, 1)).deepEquivalent());
1146 EXPECT_EQ(PositionInComposedTree(four, 0), startOfWord(createVisiblePosition InComposedTree(*four, 1)).deepEquivalent()); 1146 EXPECT_EQ(PositionInComposedTree(four, 0), startOfWord(createVisiblePosition InComposedTree(*four, 1)).deepEquivalent());
1147 1147
1148 EXPECT_EQ(Position(space, 1), startOfWord(createVisiblePositionInDOMTree(*fi ve, 1)).deepEquivalent()); 1148 EXPECT_EQ(Position(space, 1), startOfWord(createVisiblePositionInDOMTree(*fi ve, 1)).deepEquivalent());
1149 EXPECT_EQ(PositionInComposedTree(space, 1), startOfWord(createVisiblePositio nInComposedTree(*five, 1)).deepEquivalent()); 1149 EXPECT_EQ(PositionInComposedTree(space, 1), startOfWord(createVisiblePositio nInComposedTree(*five, 1)).deepEquivalent());
1150 } 1150 }
1151 1151
1152 } // namespace blink 1152 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698