OLD | NEW |
(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 |
OLD | NEW |