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

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

Issue 1299873002: ALL-IN-ONE Introduce enum class TextAffinity (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 2015-08-19T18:08:52 Created 5 years, 4 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
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 "config.h" 5 #include "config.h"
6 #include "core/editing/VisibleUnits.h" 6 #include "core/editing/VisibleUnits.h"
7 7
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 10
11 namespace blink { 11 namespace blink {
12 12
13 namespace { 13 namespace {
14 14
15 PositionWithAffinity positionWithAffinityInDOMTree(Node& anchor, int offset, EAf finity affinity = DOWNSTREAM) 15 PositionWithAffinity positionWithAffinityInDOMTree(Node& anchor, int offset, Tex tAffinity affinity = TextAffinity::Downstream)
16 { 16 {
17 return PositionWithAffinity(canonicalPositionOf(Position(&anchor, offset)), affinity); 17 return PositionWithAffinity(canonicalPositionOf(Position(&anchor, offset)), affinity);
18 } 18 }
19 19
20 PositionInComposedTreeWithAffinity positionWithAffinityInComposedTree(Node& anch or, int offset, EAffinity affinity = DOWNSTREAM) 20 PositionInComposedTreeWithAffinity positionWithAffinityInComposedTree(Node& anch or, int offset, TextAffinity affinity = TextAffinity::Downstream)
21 { 21 {
22 return PositionInComposedTreeWithAffinity(canonicalPositionOf(PositionInComp osedTree(&anchor, offset)), affinity); 22 return PositionInComposedTreeWithAffinity(canonicalPositionOf(PositionInComp osedTree(&anchor, offset)), affinity);
23 } 23 }
24 24
25 } // namespace 25 } // namespace
26 26
27 class VisibleUnitsTest : public EditingTestBase { 27 class VisibleUnitsTest : public EditingTestBase {
28 }; 28 };
29 29
30 TEST_F(VisibleUnitsTest, inSameLine) 30 TEST_F(VisibleUnitsTest, inSameLine)
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 setBodyContent(bodyContent); 69 setBodyContent(bodyContent);
70 updateLayoutAndStyleForPainting(); 70 updateLayoutAndStyleForPainting();
71 RefPtrWillBeRawPtr<Element> sample1 = document().getElementById("sample1"); 71 RefPtrWillBeRawPtr<Element> sample1 = document().getElementById("sample1");
72 RefPtrWillBeRawPtr<Element> sample2 = document().getElementById("sample2"); 72 RefPtrWillBeRawPtr<Element> sample2 = document().getElementById("sample2");
73 73
74 EXPECT_FALSE(rendersInDifferentPosition(Position::afterNode(sample1->firstCh ild()), Position(sample2->firstChild(), 0))); 74 EXPECT_FALSE(rendersInDifferentPosition(Position::afterNode(sample1->firstCh ild()), Position(sample2->firstChild(), 0)));
75 EXPECT_FALSE(rendersInDifferentPosition(Position::lastPositionInNode(sample1 ->firstChild()), Position(sample2->firstChild(), 0))); 75 EXPECT_FALSE(rendersInDifferentPosition(Position::lastPositionInNode(sample1 ->firstChild()), Position(sample2->firstChild(), 0)));
76 } 76 }
77 77
78 } // namespace blink 78 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/editing/VisibleUnits.cpp ('k') | Source/core/editing/commands/ApplyBlockElementCommand.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698