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/SpellCheckMarker.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 ShiftMarkerResult = DocumentMarker::ShiftMarkerResult; | 12 using ShiftMarkerResult = DocumentMarker::ShiftMarkerResult; |
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(DocumentMarker::Spelling, startOffset, endOffset, | 17 return new SpellCheckMarker(DocumentMarker::Spelling, startOffset, |
17 emptyString); | 18 endOffset, emptyString); |
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::Spelling); | 28 DocumentMarker::MarkerTypes types(DocumentMarker::Spelling); |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 EXPECT_TRUE(result.shouldRemoveMarker); | 227 EXPECT_TRUE(result.shouldRemoveMarker); |
227 } | 228 } |
228 | 229 |
229 TEST_F(DocumentMarkerTest, GetShiftedMarkerPosition_ReplaceBeforeAndEnd) { | 230 TEST_F(DocumentMarkerTest, GetShiftedMarkerPosition_ReplaceBeforeAndEnd) { |
230 DocumentMarker* marker = createMarker(5, 10); | 231 DocumentMarker* marker = createMarker(5, 10); |
231 ShiftMarkerResult result = marker->getShiftedMarkerPosition(4, 6, 1); | 232 ShiftMarkerResult result = marker->getShiftedMarkerPosition(4, 6, 1); |
232 EXPECT_TRUE(result.shouldRemoveMarker); | 233 EXPECT_TRUE(result.shouldRemoveMarker); |
233 } | 234 } |
234 | 235 |
235 } // namespace blink | 236 } // namespace blink |
OLD | NEW |