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/CompositionMarker.h" | 5 #include "core/editing/markers/CompositionMarker.h" |
6 | 6 |
7 #include "testing/gtest/include/gtest/gtest.h" | 7 #include "testing/gtest/include/gtest/gtest.h" |
8 | 8 |
9 namespace blink { | 9 namespace blink { |
10 | 10 |
11 class CompositionMarkerTest : public ::testing::Test {}; | 11 class CompositionMarkerTest : public ::testing::Test {}; |
12 | 12 |
13 TEST_F(CompositionMarkerTest, MarkerType) { | 13 TEST_F(CompositionMarkerTest, MarkerType) { |
14 DocumentMarker* marker = new CompositionMarker( | 14 DocumentMarker* marker = new CompositionMarker( |
15 0, 1, Color::kTransparent, CompositionMarker::Thickness::kThin, | 15 0, 1, Color::kTransparent, StyleableMarker::Thickness::kThin, |
16 Color::kTransparent); | 16 Color::kTransparent); |
17 EXPECT_EQ(DocumentMarker::kComposition, marker->GetType()); | 17 EXPECT_EQ(DocumentMarker::kComposition, marker->GetType()); |
18 } | 18 } |
19 | 19 |
| 20 TEST_F(CompositionMarkerTest, IsStyleableMarker) { |
| 21 DocumentMarker* marker = new CompositionMarker( |
| 22 0, 1, Color::kTransparent, StyleableMarker::Thickness::kThin, |
| 23 Color::kTransparent); |
| 24 EXPECT_TRUE(IsStyleableMarker(*marker)); |
| 25 } |
| 26 |
20 TEST_F(CompositionMarkerTest, ConstructorAndGetters) { | 27 TEST_F(CompositionMarkerTest, ConstructorAndGetters) { |
21 CompositionMarker* marker = | 28 CompositionMarker* marker = new CompositionMarker( |
22 new CompositionMarker(0, 1, Color::kDarkGray, | 29 0, 1, Color::kDarkGray, StyleableMarker::Thickness::kThin, Color::kGray); |
23 CompositionMarker::Thickness::kThin, Color::kGray); | |
24 EXPECT_EQ(Color::kDarkGray, marker->UnderlineColor()); | 30 EXPECT_EQ(Color::kDarkGray, marker->UnderlineColor()); |
25 EXPECT_FALSE(marker->IsThick()); | 31 EXPECT_FALSE(marker->IsThick()); |
26 EXPECT_EQ(Color::kGray, marker->BackgroundColor()); | 32 EXPECT_EQ(Color::kGray, marker->BackgroundColor()); |
27 | 33 |
28 CompositionMarker* thick_marker = | 34 CompositionMarker* thick_marker = new CompositionMarker( |
29 new CompositionMarker(0, 1, Color::kDarkGray, | 35 0, 1, Color::kDarkGray, StyleableMarker::Thickness::kThick, Color::kGray); |
30 CompositionMarker::Thickness::kThick, Color::kGray); | |
31 EXPECT_EQ(true, thick_marker->IsThick()); | 36 EXPECT_EQ(true, thick_marker->IsThick()); |
32 } | 37 } |
33 | 38 |
34 } // namespace blink | 39 } // namespace blink |
OLD | NEW |