blob: 3db1f7ebd699ff6512ea7a232a377460cc2ea8a3 [file] [log] [blame]
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "core/editing/markers/CompositionMarker.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace blink {
class CompositionMarkerTest : public ::testing::Test {};
TEST_F(CompositionMarkerTest, MarkerType) {
DocumentMarker* marker = new CompositionMarker(
0, 1, Color::kTransparent, CompositionMarker::Thickness::kThin,
Color::kTransparent);
EXPECT_EQ(DocumentMarker::kComposition, marker->GetType());
}
TEST_F(CompositionMarkerTest, ConstructorAndGetters) {
CompositionMarker* marker =
new CompositionMarker(0, 1, Color::kDarkGray,
CompositionMarker::Thickness::kThin, Color::kGray);
EXPECT_EQ(Color::kDarkGray, marker->UnderlineColor());
EXPECT_FALSE(marker->IsThick());
EXPECT_EQ(Color::kGray, marker->BackgroundColor());
CompositionMarker* thick_marker =
new CompositionMarker(0, 1, Color::kDarkGray,
CompositionMarker::Thickness::kThick, Color::kGray);
EXPECT_EQ(true, thick_marker->IsThick());
}
} // namespace blink