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

Side by Side Diff: Source/core/dom/PositionTest.cpp

Issue 1204233003: Oilpan: fix build after r197804. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 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 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 "config.h" 5 #include "config.h"
6 #include "core/dom/Position.h" 6 #include "core/dom/Position.h"
7 7
8 #include "core/editing/EditingTestBase.h" 8 #include "core/editing/EditingTestBase.h"
9 9
10 namespace blink { 10 namespace blink {
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 EXPECT_EQ(t1, PositionInComposedTree::afterNode(host).nodeAsRangeLastNode()) ; 75 EXPECT_EQ(t1, PositionInComposedTree::afterNode(host).nodeAsRangeLastNode()) ;
76 } 76 }
77 77
78 TEST_F(PositionTest, ToPositionInComposedTreeWithActiveInsertionPoint) 78 TEST_F(PositionTest, ToPositionInComposedTreeWithActiveInsertionPoint)
79 { 79 {
80 const char* bodyContent = "<p id='host'>00<b id='one'>11</b>22</p>"; 80 const char* bodyContent = "<p id='host'>00<b id='one'>11</b>22</p>";
81 const char* shadowContent = "<a id='a'><content select=#one id='content'></c ontent><content></content></a>"; 81 const char* shadowContent = "<a id='a'><content select=#one id='content'></c ontent><content></content></a>";
82 setBodyContent(bodyContent); 82 setBodyContent(bodyContent);
83 RefPtrWillBeRawPtr<ShadowRoot> shadowRoot = setShadowContent(shadowContent); 83 RefPtrWillBeRawPtr<ShadowRoot> shadowRoot = setShadowContent(shadowContent);
84 RefPtrWillBeRawPtr<Element> anchor = shadowRoot->getElementById("a"); 84 RefPtrWillBeRawPtr<Element> anchor = shadowRoot->getElementById("a");
85 RefPtrWillBeRawPtr<Element> insertionPoint = shadowRoot->getElementById("con tent");
86 85
87 EXPECT_EQ(positionInComposedTree(*anchor, 0), toPositionInComposedTree(posit ionInDOMTree(*anchor, 0))); 86 EXPECT_EQ(positionInComposedTree(*anchor, 0), toPositionInComposedTree(posit ionInDOMTree(*anchor, 0)));
88 EXPECT_EQ(positionInComposedTree(*anchor, 1), toPositionInComposedTree(posit ionInDOMTree(*anchor, 1))); 87 EXPECT_EQ(positionInComposedTree(*anchor, 1), toPositionInComposedTree(posit ionInDOMTree(*anchor, 1)));
89 EXPECT_EQ(PositionInComposedTree(anchor, PositionInComposedTree::PositionIsA fterChildren), toPositionInComposedTree(positionInDOMTree(*anchor, 2))); 88 EXPECT_EQ(PositionInComposedTree(anchor, PositionInComposedTree::PositionIsA fterChildren), toPositionInComposedTree(positionInDOMTree(*anchor, 2)));
90 } 89 }
91 90
92 TEST_F(PositionTest, ToPositionInComposedTreeWithInactiveInsertionPoint) 91 TEST_F(PositionTest, ToPositionInComposedTreeWithInactiveInsertionPoint)
93 { 92 {
94 const char* bodyContent = "<p id='p'><content></content></p>"; 93 const char* bodyContent = "<p id='p'><content></content></p>";
95 setBodyContent(bodyContent); 94 setBodyContent(bodyContent);
96 RefPtrWillBeRawPtr<Element> anchor = document().getElementById("p"); 95 RefPtrWillBeRawPtr<Element> anchor = document().getElementById("p");
97 96
98 EXPECT_EQ(positionInComposedTree(*anchor, 0), toPositionInComposedTree(posit ionInDOMTree(*anchor, 0))); 97 EXPECT_EQ(positionInComposedTree(*anchor, 0), toPositionInComposedTree(posit ionInDOMTree(*anchor, 0)));
99 EXPECT_EQ(PositionInComposedTree(anchor, PositionInComposedTree::PositionIsA fterChildren), toPositionInComposedTree(positionInDOMTree(*anchor, 1))); 98 EXPECT_EQ(PositionInComposedTree(anchor, PositionInComposedTree::PositionIsA fterChildren), toPositionInComposedTree(positionInDOMTree(*anchor, 1)));
100 } 99 }
101 100
102 } // namespace blink 101 } // 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