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

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

Issue 2911723002: [DMC #24] Add SpellingMarker and GrammarMarker (subclasses of DocumentMarker) (Closed)
Patch Set: Add IsSpellCheckMarker() tests 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. Use of 1 // Copyright 2017 The Chromium Authors. All rights reserved. Use of
2 // this source code is governed by a BSD-style license that can be 2 // 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/SpellCheckMarkerListImpl.h" 5 #include "core/editing/markers/SpellCheckMarkerListImpl.h"
6 6
7 #include "core/editing/markers/SpellingMarker.h"
7 #include "core/editing/markers/SpellingMarkerListImpl.h" 8 #include "core/editing/markers/SpellingMarkerListImpl.h"
8 #include "platform/heap/Handle.h" 9 #include "platform/heap/Handle.h"
9 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
10 11
11 namespace blink { 12 namespace blink {
12 13
13 // This test class tests functionality implemented by SpellingMarkerListImpl and 14 // This test class tests functionality implemented by SpellingMarkerListImpl and
14 // also functionality implemented by its parent class SpellCheckMarkerListImpl. 15 // also functionality implemented by its parent class SpellCheckMarkerListImpl.
15 16
16 class SpellingMarkerListImplTest : public ::testing::Test { 17 class SpellingMarkerListImplTest : public ::testing::Test {
17 protected: 18 protected:
18 SpellingMarkerListImplTest() : marker_list_(new SpellingMarkerListImpl()) {} 19 SpellingMarkerListImplTest() : marker_list_(new SpellingMarkerListImpl()) {}
19 20
20 DocumentMarker* CreateMarker(unsigned start_offset, unsigned end_offset) { 21 DocumentMarker* CreateMarker(unsigned start_offset, unsigned end_offset) {
21 return new DocumentMarker(DocumentMarker::kSpelling, start_offset, 22 return new SpellingMarker(start_offset, end_offset, g_empty_string);
22 end_offset, g_empty_string);
23 } 23 }
24 24
25 Persistent<SpellingMarkerListImpl> marker_list_; 25 Persistent<SpellingMarkerListImpl> marker_list_;
26 }; 26 };
27 27
28 // Test cases for functionality implemented by SpellingMarkerListImpl. 28 // Test cases for functionality implemented by SpellingMarkerListImpl.
29 29
30 TEST_F(SpellingMarkerListImplTest, MarkerType) { 30 TEST_F(SpellingMarkerListImplTest, MarkerType) {
31 EXPECT_EQ(DocumentMarker::kSpelling, marker_list_->MarkerType()); 31 EXPECT_EQ(DocumentMarker::kSpelling, marker_list_->MarkerType());
32 } 32 }
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 EXPECT_EQ(2u, marker_list_->GetMarkers().size()); 151 EXPECT_EQ(2u, marker_list_->GetMarkers().size());
152 152
153 EXPECT_EQ(0u, marker_list_->GetMarkers()[0]->StartOffset()); 153 EXPECT_EQ(0u, marker_list_->GetMarkers()[0]->StartOffset());
154 EXPECT_EQ(3u, marker_list_->GetMarkers()[0]->EndOffset()); 154 EXPECT_EQ(3u, marker_list_->GetMarkers()[0]->EndOffset());
155 155
156 EXPECT_EQ(9u, marker_list_->GetMarkers()[1]->StartOffset()); 156 EXPECT_EQ(9u, marker_list_->GetMarkers()[1]->StartOffset());
157 EXPECT_EQ(14u, marker_list_->GetMarkers()[1]->EndOffset()); 157 EXPECT_EQ(14u, marker_list_->GetMarkers()[1]->EndOffset());
158 } 158 }
159 159
160 } // namespace 160 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698