Chromium Code Reviews| OLD | NEW |
|---|---|
| 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/RenderedDocumentMarker.h" | 7 #include "core/editing/markers/RenderedDocumentMarker.h" |
| 8 #include "platform/heap/Handle.h" | 8 #include "platform/heap/Handle.h" |
| 9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
| 10 | 10 |
| 11 namespace blink { | 11 namespace blink { |
| 12 | 12 |
| 13 class SpellCheckMarkerListImplForTesting : public SpellCheckMarkerListImpl { | |
|
yosin_UTC9
2017/05/12 05:00:04
We can use SpellingMarkerList and GrammarMakrerLis
rlanday
2017/05/12 21:07:02
Can you please clarify what you mean by "and"? Do
yosin_UTC9
2017/05/15 04:03:04
I propose having only "SpellingMarkerListImplTest.
| |
| 14 DocumentMarker::MarkerType MarkerType() const final { | |
| 15 return DocumentMarker::kSpelling; | |
| 16 } | |
| 17 }; | |
| 18 | |
| 13 class SpellCheckMarkerListImplTest : public ::testing::Test { | 19 class SpellCheckMarkerListImplTest : public ::testing::Test { |
| 14 protected: | 20 protected: |
| 15 SpellCheckMarkerListImplTest() | 21 SpellCheckMarkerListImplTest() |
| 16 : marker_list_(new SpellCheckMarkerListImpl()) {} | 22 : marker_list_(new SpellCheckMarkerListImplForTesting()) {} |
| 17 | 23 |
| 18 DocumentMarker* CreateMarker(unsigned start_offset, unsigned end_offset) { | 24 DocumentMarker* CreateMarker(unsigned start_offset, unsigned end_offset) { |
| 19 return new DocumentMarker(DocumentMarker::kSpelling, start_offset, | 25 return new DocumentMarker(DocumentMarker::kSpelling, start_offset, |
| 20 end_offset, g_empty_string); | 26 end_offset, g_empty_string); |
| 21 } | 27 } |
| 22 | 28 |
| 23 Persistent<SpellCheckMarkerListImpl> marker_list_; | 29 Persistent<SpellCheckMarkerListImpl> marker_list_; |
| 24 }; | 30 }; |
| 25 | 31 |
| 26 TEST_F(SpellCheckMarkerListImplTest, AddSorting) { | 32 TEST_F(SpellCheckMarkerListImplTest, AddSorting) { |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 141 EXPECT_EQ(2u, marker_list_->GetMarkers().size()); | 147 EXPECT_EQ(2u, marker_list_->GetMarkers().size()); |
| 142 | 148 |
| 143 EXPECT_EQ(0u, marker_list_->GetMarkers()[0]->StartOffset()); | 149 EXPECT_EQ(0u, marker_list_->GetMarkers()[0]->StartOffset()); |
| 144 EXPECT_EQ(3u, marker_list_->GetMarkers()[0]->EndOffset()); | 150 EXPECT_EQ(3u, marker_list_->GetMarkers()[0]->EndOffset()); |
| 145 | 151 |
| 146 EXPECT_EQ(9u, marker_list_->GetMarkers()[1]->StartOffset()); | 152 EXPECT_EQ(9u, marker_list_->GetMarkers()[1]->StartOffset()); |
| 147 EXPECT_EQ(14u, marker_list_->GetMarkers()[1]->EndOffset()); | 153 EXPECT_EQ(14u, marker_list_->GetMarkers()[1]->EndOffset()); |
| 148 } | 154 } |
| 149 | 155 |
| 150 } // namespace | 156 } // namespace |
| OLD | NEW |