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

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

Issue 2923033002: [ActiveSuggestionMarker #2] Add ActiveSuggestionMarker (Closed)
Patch Set: Update comment on ActiveSuggestionMarker.h 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "core/editing/markers/ActiveSuggestionMarkerListImpl.h"
6
7 #include "core/editing/EditingTestBase.h"
8 #include "core/editing/markers/ActiveSuggestionMarker.h"
9
10 namespace blink {
11
12 class ActiveSuggestionMarkerListImplTest : public EditingTestBase {
13 protected:
14 ActiveSuggestionMarkerListImplTest()
15 : marker_list_(new ActiveSuggestionMarkerListImpl()) {}
16
17 DocumentMarker* CreateMarker(unsigned start_offset, unsigned end_offset) {
18 return new ActiveSuggestionMarker(start_offset, end_offset, Color::kBlack,
19 StyleableMarker::Thickness::kThin,
20 Color::kBlack);
21 }
22
23 Persistent<ActiveSuggestionMarkerListImpl> marker_list_;
24 };
25
26 // ActiveSuggestionMarkerListImpl shouldn't merge markers with touching
27 // endpoints
28 TEST_F(ActiveSuggestionMarkerListImplTest, Add) {
29 EXPECT_EQ(0u, marker_list_->GetMarkers().size());
30
31 marker_list_->Add(CreateMarker(0, 1));
32 marker_list_->Add(CreateMarker(1, 2));
33
34 EXPECT_EQ(2u, marker_list_->GetMarkers().size());
35
36 EXPECT_EQ(0u, marker_list_->GetMarkers()[0]->StartOffset());
37 EXPECT_EQ(1u, marker_list_->GetMarkers()[0]->EndOffset());
38
39 EXPECT_EQ(1u, marker_list_->GetMarkers()[1]->StartOffset());
40 EXPECT_EQ(2u, marker_list_->GetMarkers()[1]->EndOffset());
41 }
42
43 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698