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

Side by Side 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 unified diff | Download patch
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "platform/graphics/paint/FloatClipRect.h"
6
7 #include "platform/geometry/FloatRect.h"
8 #include "testing/gtest/include/gtest/gtest.h"
9
10 namespace blink {
11
12 class FloatClipRectTest : public ::testing::Test {
13 public:
14 };
15
16 TEST_F(FloatClipRectTest, InfinitRect) {
17 FloatClipRect rect;
18 EXPECT_TRUE(rect.isInfinite());
19
20 FloatClipRect rect2((FloatRect(1, 2, 3, 4)));
21 EXPECT_FALSE(rect2.isInfinite());
22 }
23
24 TEST_F(FloatClipRectTest, MoveBy) {
25 FloatClipRect rect;
26 rect.moveBy(FloatPoint(1, 2));
27 EXPECT_EQ(rect.rect(), FloatClipRect().rect());
28 }
29
30 TEST_F(FloatClipRectTest, SetRect) {
31 FloatClipRect rect;
32 rect.setRect(FloatRect(1, 2, 3, 4));
33 EXPECT_FALSE(rect.isInfinite());
34 EXPECT_EQ(FloatRect(1, 2, 3, 4), rect.rect());
35 }
36
37 TEST_F(FloatClipRectTest, SetHasRadius) {
38 FloatClipRect rect;
39 rect.setHasRadius();
40 EXPECT_FALSE(rect.isInfinite());
41 EXPECT_TRUE(rect.hasRadius());
42 }
43
44 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698