OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/EphemeralRange.h" | 5 #include "core/editing/EphemeralRange.h" |
6 | 6 |
| 7 #include <sstream> |
7 #include "core/dom/Range.h" | 8 #include "core/dom/Range.h" |
8 #include "core/editing/EditingTestBase.h" | 9 #include "core/editing/EditingTestBase.h" |
9 #include <sstream> | |
10 | 10 |
11 namespace blink { | 11 namespace blink { |
12 | 12 |
13 class EphemeralRangeTest : public EditingTestBase { | 13 class EphemeralRangeTest : public EditingTestBase { |
14 protected: | 14 protected: |
15 template <typename Traversal = NodeTraversal> | 15 template <typename Traversal = NodeTraversal> |
16 std::string traverseRange(Range*) const; | 16 std::string traverseRange(Range*) const; |
17 | 17 |
18 template <typename Strategy> | 18 template <typename Strategy> |
19 std::string traverseRange(const EphemeralRangeTemplate<Strategy>&) const; | 19 std::string traverseRange(const EphemeralRangeTemplate<Strategy>&) const; |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 EXPECT_FALSE(iterable.begin() != iterable.end()); | 142 EXPECT_FALSE(iterable.begin() != iterable.end()); |
143 | 143 |
144 const EphemeralRange singlePositionRange(getBodyRange()->startPosition()); | 144 const EphemeralRange singlePositionRange(getBodyRange()->startPosition()); |
145 EXPECT_FALSE(singlePositionRange.isNull()); | 145 EXPECT_FALSE(singlePositionRange.isNull()); |
146 EXPECT_EQ(std::string(), traverseRange(singlePositionRange)); | 146 EXPECT_EQ(std::string(), traverseRange(singlePositionRange)); |
147 EXPECT_EQ(singlePositionRange.startPosition().nodeAsRangeFirstNode(), | 147 EXPECT_EQ(singlePositionRange.startPosition().nodeAsRangeFirstNode(), |
148 singlePositionRange.endPosition().nodeAsRangePastLastNode()); | 148 singlePositionRange.endPosition().nodeAsRangePastLastNode()); |
149 } | 149 } |
150 | 150 |
151 } // namespace blink | 151 } // namespace blink |
OLD | NEW |