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

Unified Diff: third_party/WebKit/Source/core/editing/markers/ActiveSuggestionMarkerTest.cpp

Issue 2919173002: Add DocumentMarker::kActiveSuggestion MarkerType (Closed)
Patch Set: Fix build errors Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/editing/markers/ActiveSuggestionMarkerTest.cpp
diff --git a/third_party/WebKit/Source/core/editing/markers/ActiveSuggestionMarkerTest.cpp b/third_party/WebKit/Source/core/editing/markers/ActiveSuggestionMarkerTest.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..48053fef0ad9fb85f96e0c5873d99f5847116904
--- /dev/null
+++ b/third_party/WebKit/Source/core/editing/markers/ActiveSuggestionMarkerTest.cpp
@@ -0,0 +1,41 @@
+// 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/ActiveSuggestionMarker.h"
+
+#include "testing/gtest/include/gtest/gtest.h"
+
+namespace blink {
+
+class ActiveSuggestionMarkerTest : public ::testing::Test {};
+
+TEST_F(ActiveSuggestionMarkerTest, MarkerType) {
+ DocumentMarker* marker = new ActiveSuggestionMarker(
+ 0, 1, Color::kTransparent, ActiveSuggestionMarker::Thickness::kThin,
+ Color::kTransparent);
+ EXPECT_EQ(DocumentMarker::kActiveSuggestion, marker->GetType());
+}
+
+TEST_F(ActiveSuggestionMarkerTest, IsMarkerWithFormatting) {
+ DocumentMarker* marker = new ActiveSuggestionMarker(
+ 0, 1, Color::kDarkGray, ActiveSuggestionMarker::Thickness::kThin,
+ Color::kGray);
+ EXPECT_TRUE(IsMarkerWithFormatting(*marker));
+}
+
+TEST_F(ActiveSuggestionMarkerTest, ConstructorAndGetters) {
+ ActiveSuggestionMarker* marker = new ActiveSuggestionMarker(
+ 0, 1, Color::kDarkGray, ActiveSuggestionMarker::Thickness::kThin,
+ Color::kGray);
+ EXPECT_EQ(Color::kDarkGray, marker->UnderlineColor());
+ EXPECT_EQ(false, marker->IsThick());
+ EXPECT_EQ(Color::kGray, marker->BackgroundColor());
+
+ ActiveSuggestionMarker* thick_marker = new ActiveSuggestionMarker(
+ 0, 1, Color::kDarkGray, ActiveSuggestionMarker::Thickness::kThick,
+ Color::kGray);
+ EXPECT_EQ(true, thick_marker->IsThick());
+}
+
+} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698