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

Unified Diff: third_party/WebKit/Source/platform/graphics/paint/FloatClipRectTest.cpp

Issue 2699593006: Refactor to remove need for infiniteIntRect when computing rects in pre-paint (Closed)
Patch Set: none Created 3 years, 10 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/platform/graphics/paint/FloatClipRectTest.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/paint/FloatClipRectTest.cpp b/third_party/WebKit/Source/platform/graphics/paint/FloatClipRectTest.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..7b14dcd1dd0327474c2912f83bfe5561afb105a9
--- /dev/null
+++ b/third_party/WebKit/Source/platform/graphics/paint/FloatClipRectTest.cpp
@@ -0,0 +1,44 @@
+// 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 "platform/graphics/paint/FloatClipRect.h"
+
+#include "platform/geometry/FloatRect.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+namespace blink {
+
+class FloatClipRectTest : public ::testing::Test {
+ public:
+};
+
+TEST_F(FloatClipRectTest, InfinitRect) {
+ FloatClipRect rect;
+ EXPECT_TRUE(rect.isInfinite());
+
+ FloatClipRect rect2((FloatRect(1, 2, 3, 4)));
+ EXPECT_FALSE(rect2.isInfinite());
+}
+
+TEST_F(FloatClipRectTest, MoveBy) {
+ FloatClipRect rect;
+ rect.moveBy(FloatPoint(1, 2));
+ EXPECT_EQ(rect.rect(), FloatClipRect().rect());
+}
+
+TEST_F(FloatClipRectTest, SetRect) {
+ FloatClipRect rect;
+ rect.setRect(FloatRect(1, 2, 3, 4));
+ EXPECT_FALSE(rect.isInfinite());
+ EXPECT_EQ(FloatRect(1, 2, 3, 4), rect.rect());
+}
+
+TEST_F(FloatClipRectTest, SetHasRadius) {
+ FloatClipRect rect;
+ rect.setHasRadius();
+ EXPECT_FALSE(rect.isInfinite());
+ EXPECT_TRUE(rect.hasRadius());
+}
+
+} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698