OLD | NEW |
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/DocumentMarkerList.h" | 5 #include "core/editing/markers/DocumentMarkerList.h" |
6 | 6 |
7 #include "platform/heap/Handle.h" | 7 #include "platform/heap/Handle.h" |
8 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
9 | 9 |
10 namespace blink { | 10 namespace blink { |
(...skipping 22 matching lines...) Expand all Loading... |
33 bool markerListIsSorted() const final { return true; } | 33 bool markerListIsSorted() const final { return true; } |
34 }; | 34 }; |
35 | 35 |
36 class DocumentMarkerListTest : public ::testing::Test { | 36 class DocumentMarkerListTest : public ::testing::Test { |
37 protected: | 37 protected: |
38 DocumentMarkerListTest() | 38 DocumentMarkerListTest() |
39 : m_markerList(new DocumentMarkerListForTesting()), | 39 : m_markerList(new DocumentMarkerListForTesting()), |
40 m_sortedMarkerList(new SortedDocumentMarkerListForTesting()) {} | 40 m_sortedMarkerList(new SortedDocumentMarkerListForTesting()) {} |
41 | 41 |
42 DocumentMarker* createMarker(unsigned startOffset, unsigned endOffset) { | 42 DocumentMarker* createMarker(unsigned startOffset, unsigned endOffset) { |
43 return new DocumentMarker(startOffset, endOffset, Color::black, false, | 43 return DocumentMarker::createCompositionMarker( |
44 Color::black); | 44 startOffset, endOffset, Color::black, false, Color::black); |
45 } | 45 } |
46 | 46 |
47 Persistent<DocumentMarkerListForTesting> m_markerList; | 47 Persistent<DocumentMarkerListForTesting> m_markerList; |
48 Persistent<SortedDocumentMarkerListForTesting> m_sortedMarkerList; | 48 Persistent<SortedDocumentMarkerListForTesting> m_sortedMarkerList; |
49 }; | 49 }; |
50 | 50 |
51 TEST_F(DocumentMarkerListTest, | 51 TEST_F(DocumentMarkerListTest, |
52 RemoveMarkersSortedDoRemovePartiallyOverlappingNoOpRemoval) { | 52 RemoveMarkersSortedDoRemovePartiallyOverlappingNoOpRemoval) { |
53 m_sortedMarkerList->add(createMarker(0, 5)); | 53 m_sortedMarkerList->add(createMarker(0, 5)); |
54 | 54 |
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
399 EXPECT_EQ(1u, dstList->at(0)->endOffset()); | 399 EXPECT_EQ(1u, dstList->at(0)->endOffset()); |
400 | 400 |
401 EXPECT_EQ(2u, dstList->at(1)->startOffset()); | 401 EXPECT_EQ(2u, dstList->at(1)->startOffset()); |
402 EXPECT_EQ(3u, dstList->at(1)->endOffset()); | 402 EXPECT_EQ(3u, dstList->at(1)->endOffset()); |
403 | 403 |
404 EXPECT_EQ(4u, dstList->at(2)->startOffset()); | 404 EXPECT_EQ(4u, dstList->at(2)->startOffset()); |
405 EXPECT_EQ(4u, dstList->at(2)->endOffset()); | 405 EXPECT_EQ(4u, dstList->at(2)->endOffset()); |
406 } | 406 } |
407 | 407 |
408 } // namespace blink | 408 } // namespace blink |
OLD | NEW |