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

Side by Side Diff: third_party/WebKit/Source/core/editing/markers/DocumentMarkerTest.cpp

Issue 2912133003: Revert of [DMC #17] Make TextMatchMarkers constructible in single step (Closed)
Patch Set: Created 3 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
OLDNEW
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"
8 #include "testing/gtest/include/gtest/gtest.h" 7 #include "testing/gtest/include/gtest/gtest.h"
9 8
10 namespace blink { 9 namespace blink {
11 10
12 using MarkerOffsets = DocumentMarker::MarkerOffsets; 11 using MarkerOffsets = DocumentMarker::MarkerOffsets;
13 12
14 class DocumentMarkerTest : public ::testing::Test { 13 class DocumentMarkerTest : public ::testing::Test {
15 protected: 14 protected:
16 DocumentMarker* CreateMarker(unsigned startOffset, unsigned endOffset) { 15 DocumentMarker* CreateMarker(unsigned startOffset, unsigned endOffset) {
17 return new TextMatchMarker(startOffset, endOffset, 16 return new DocumentMarker(startOffset, endOffset,
18 DocumentMarker::MatchStatus::kInactive); 17 DocumentMarker::MatchStatus::kInactive);
19 } 18 }
20 }; 19 };
21 20
22 TEST_F(DocumentMarkerTest, MarkerTypeIteratorEmpty) { 21 TEST_F(DocumentMarkerTest, MarkerTypeIteratorEmpty) {
23 DocumentMarker::MarkerTypes types(0); 22 DocumentMarker::MarkerTypes types(0);
24 EXPECT_TRUE(types.begin() == types.end()); 23 EXPECT_TRUE(types.begin() == types.end());
25 } 24 }
26 25
27 TEST_F(DocumentMarkerTest, MarkerTypeIteratorOne) { 26 TEST_F(DocumentMarkerTest, MarkerTypeIteratorOne) {
28 DocumentMarker::MarkerTypes types(DocumentMarker::kSpelling); 27 DocumentMarker::MarkerTypes types(DocumentMarker::kSpelling);
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 EXPECT_EQ(WTF::nullopt, result); 209 EXPECT_EQ(WTF::nullopt, result);
211 } 210 }
212 211
213 TEST_F(DocumentMarkerTest, GetShiftedMarkerPosition_ReplaceBeforeAndEnd) { 212 TEST_F(DocumentMarkerTest, GetShiftedMarkerPosition_ReplaceBeforeAndEnd) {
214 DocumentMarker* marker = CreateMarker(5, 10); 213 DocumentMarker* marker = CreateMarker(5, 10);
215 Optional<MarkerOffsets> result = marker->ComputeOffsetsAfterShift(4, 6, 1); 214 Optional<MarkerOffsets> result = marker->ComputeOffsetsAfterShift(4, 6, 1);
216 EXPECT_EQ(WTF::nullopt, result); 215 EXPECT_EQ(WTF::nullopt, result);
217 } 216 }
218 217
219 } // namespace blink 218 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698