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

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

Issue 2923033002: [ActiveSuggestionMarker #2] Add ActiveSuggestionMarker (Closed)
Patch Set: Update comment on ActiveSuggestionMarker.h 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 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..3b6f1893e30aac35d13a6fabe06afe4c92497464
--- /dev/null
+++ b/third_party/WebKit/Source/core/editing/markers/ActiveSuggestionMarkerTest.cpp
@@ -0,0 +1,39 @@
+// 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, StyleableMarker::Thickness::kThin,
+ Color::kTransparent);
+ EXPECT_EQ(DocumentMarker::kActiveSuggestion, marker->GetType());
+}
+
+TEST_F(ActiveSuggestionMarkerTest, IsStyleableMarker) {
+ DocumentMarker* marker = new ActiveSuggestionMarker(
+ 0, 1, Color::kTransparent, StyleableMarker::Thickness::kThin,
+ Color::kTransparent);
+ EXPECT_TRUE(IsStyleableMarker(*marker));
+}
+
+TEST_F(ActiveSuggestionMarkerTest, ConstructorAndGetters) {
+ ActiveSuggestionMarker* marker = new ActiveSuggestionMarker(
+ 0, 1, Color::kDarkGray, StyleableMarker::Thickness::kThin, Color::kGray);
+ EXPECT_EQ(Color::kDarkGray, marker->UnderlineColor());
+ EXPECT_FALSE(marker->IsThick());
+ EXPECT_EQ(Color::kGray, marker->BackgroundColor());
+
+ ActiveSuggestionMarker* thick_marker = new ActiveSuggestionMarker(
+ 0, 1, Color::kDarkGray, StyleableMarker::Thickness::kThick, Color::kGray);
+ EXPECT_EQ(true, thick_marker->IsThick());
+}
+
+} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698