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

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

Issue 2922233002: [ActiveSuggestionMarker #1] Introduce abstract StyleableMarker subclass of DocumentMarker (Closed)
Patch Set: Add test for IsStyleableMarker() 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. 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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698