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

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

Issue 2905753002: [DMC #17] Make TextMatchMarkers constructible in single step (Closed)
Patch Set: Fix build error 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/DocumentMarkerListEditor.h" 5 #include "core/editing/markers/DocumentMarkerListEditor.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 class DocumentMarkerListEditorTest : public ::testing::Test { 12 class DocumentMarkerListEditorTest : public ::testing::Test {
12 protected: 13 protected:
13 DocumentMarker* CreateMarker(unsigned startOffset, unsigned endOffset) { 14 DocumentMarker* CreateMarker(unsigned startOffset, unsigned endOffset) {
14 return new DocumentMarker(startOffset, endOffset, 15 return new TextMatchMarker(startOffset, endOffset,
15 DocumentMarker::MatchStatus::kInactive); 16 DocumentMarker::MatchStatus::kInactive);
16 } 17 }
17 }; 18 };
18 19
19 TEST_F(DocumentMarkerListEditorTest, 20 TEST_F(DocumentMarkerListEditorTest,
20 ContentDependentMarker_ReplaceStartOfMarker) { 21 ContentDependentMarker_ReplaceStartOfMarker) {
21 DocumentMarkerListEditor::MarkerList markers; 22 DocumentMarkerListEditor::MarkerList markers;
22 markers.push_back(CreateMarker(0, 10)); 23 markers.push_back(CreateMarker(0, 10));
23 24
24 DocumentMarkerListEditor::ShiftMarkersContentDependent(&markers, 0, 5, 5); 25 DocumentMarkerListEditor::ShiftMarkersContentDependent(&markers, 0, 5, 5);
25 26
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after
358 EXPECT_EQ(5u, markers[0]->EndOffset()); 359 EXPECT_EQ(5u, markers[0]->EndOffset());
359 360
360 EXPECT_EQ(10u, markers[1]->StartOffset()); 361 EXPECT_EQ(10u, markers[1]->StartOffset());
361 EXPECT_EQ(15u, markers[1]->EndOffset()); 362 EXPECT_EQ(15u, markers[1]->EndOffset());
362 363
363 EXPECT_EQ(15u, markers[2]->StartOffset()); 364 EXPECT_EQ(15u, markers[2]->StartOffset());
364 EXPECT_EQ(20u, markers[2]->EndOffset()); 365 EXPECT_EQ(20u, markers[2]->EndOffset());
365 } 366 }
366 367
367 } // namespace blink 368 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698