OLD | NEW |
---|---|
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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/markers/DocumentMarker.h" | 5 #include "core/editing/markers/DocumentMarker.h" |
6 | 6 |
7 #include "core/editing/markers/TextMatchMarker.h" | |
7 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
8 | 9 |
9 namespace blink { | 10 namespace blink { |
10 | 11 |
11 using MarkerOffsets = DocumentMarker::MarkerOffsets; | 12 using MarkerOffsets = DocumentMarker::MarkerOffsets; |
12 | 13 |
13 class DocumentMarkerTest : public ::testing::Test { | 14 class DocumentMarkerTest : public ::testing::Test { |
14 protected: | 15 protected: |
15 DocumentMarker* CreateMarker(unsigned startOffset, unsigned endOffset) { | 16 DocumentMarker* CreateMarker(unsigned startOffset, unsigned endOffset) { |
16 return new DocumentMarker(startOffset, endOffset, | 17 return new TextMatchMarker(startOffset, endOffset, |
rlanday
2017/05/31 02:03:30
This is the fix: use the new TextMatchMarker const
| |
17 DocumentMarker::MatchStatus::kInactive); | 18 DocumentMarker::MatchStatus::kInactive); |
18 } | 19 } |
19 }; | 20 }; |
20 | 21 |
21 TEST_F(DocumentMarkerTest, MarkerTypeIteratorEmpty) { | 22 TEST_F(DocumentMarkerTest, MarkerTypeIteratorEmpty) { |
22 DocumentMarker::MarkerTypes types(0); | 23 DocumentMarker::MarkerTypes types(0); |
23 EXPECT_TRUE(types.begin() == types.end()); | 24 EXPECT_TRUE(types.begin() == types.end()); |
24 } | 25 } |
25 | 26 |
26 TEST_F(DocumentMarkerTest, MarkerTypeIteratorOne) { | 27 TEST_F(DocumentMarkerTest, MarkerTypeIteratorOne) { |
27 DocumentMarker::MarkerTypes types(DocumentMarker::kSpelling); | 28 DocumentMarker::MarkerTypes types(DocumentMarker::kSpelling); |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
209 EXPECT_EQ(WTF::nullopt, result); | 210 EXPECT_EQ(WTF::nullopt, result); |
210 } | 211 } |
211 | 212 |
212 TEST_F(DocumentMarkerTest, GetShiftedMarkerPosition_ReplaceBeforeAndEnd) { | 213 TEST_F(DocumentMarkerTest, GetShiftedMarkerPosition_ReplaceBeforeAndEnd) { |
213 DocumentMarker* marker = CreateMarker(5, 10); | 214 DocumentMarker* marker = CreateMarker(5, 10); |
214 Optional<MarkerOffsets> result = marker->ComputeOffsetsAfterShift(4, 6, 1); | 215 Optional<MarkerOffsets> result = marker->ComputeOffsetsAfterShift(4, 6, 1); |
215 EXPECT_EQ(WTF::nullopt, result); | 216 EXPECT_EQ(WTF::nullopt, result); |
216 } | 217 } |
217 | 218 |
218 } // namespace blink | 219 } // namespace blink |
OLD | NEW |