| 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 SpellCheckMarkerListImplTest : public ::testing::Test { | 13 class SpellCheckMarkerListImplTest : public ::testing::Test { |
| 14 protected: | 14 protected: |
| 15 SpellCheckMarkerListImplTest() | 15 SpellCheckMarkerListImplTest() |
| 16 : marker_list_(new SpellCheckMarkerListImpl()) {} | 16 : marker_list_(new SpellCheckMarkerListImpl(DocumentMarker::kSpelling)) {} |
| 17 | 17 |
| 18 DocumentMarker* CreateMarker(unsigned start_offset, unsigned end_offset) { | 18 DocumentMarker* CreateMarker(unsigned start_offset, unsigned end_offset) { |
| 19 return new DocumentMarker(DocumentMarker::kSpelling, start_offset, | 19 return new DocumentMarker(DocumentMarker::kSpelling, start_offset, |
| 20 end_offset, g_empty_string); | 20 end_offset, g_empty_string); |
| 21 } | 21 } |
| 22 | 22 |
| 23 Persistent<SpellCheckMarkerListImpl> marker_list_; | 23 Persistent<SpellCheckMarkerListImpl> marker_list_; |
| 24 }; | 24 }; |
| 25 | 25 |
| 26 TEST_F(SpellCheckMarkerListImplTest, AddSorting) { | 26 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()); | 141 EXPECT_EQ(2u, marker_list_->GetMarkers().size()); |
| 142 | 142 |
| 143 EXPECT_EQ(0u, marker_list_->GetMarkers()[0]->StartOffset()); | 143 EXPECT_EQ(0u, marker_list_->GetMarkers()[0]->StartOffset()); |
| 144 EXPECT_EQ(3u, marker_list_->GetMarkers()[0]->EndOffset()); | 144 EXPECT_EQ(3u, marker_list_->GetMarkers()[0]->EndOffset()); |
| 145 | 145 |
| 146 EXPECT_EQ(9u, marker_list_->GetMarkers()[1]->StartOffset()); | 146 EXPECT_EQ(9u, marker_list_->GetMarkers()[1]->StartOffset()); |
| 147 EXPECT_EQ(14u, marker_list_->GetMarkers()[1]->EndOffset()); | 147 EXPECT_EQ(14u, marker_list_->GetMarkers()[1]->EndOffset()); |
| 148 } | 148 } |
| 149 | 149 |
| 150 } // namespace | 150 } // namespace |
| OLD | NEW |