| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "platform/geometry/FloatQuad.h" | 5 #include "platform/geometry/FloatQuad.h" |
| 6 | 6 |
| 7 #include <limits> | 7 #include <limits> |
| 8 #include "platform/wtf/text/WTFString.h" |
| 8 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
| 9 #include "wtf/text/WTFString.h" | |
| 10 | 10 |
| 11 namespace blink { | 11 namespace blink { |
| 12 | 12 |
| 13 TEST(FloatQuadTest, ToString) { | 13 TEST(FloatQuadTest, ToString) { |
| 14 FloatQuad quad(FloatPoint(2, 3), FloatPoint(5, 7), FloatPoint(11, 13), | 14 FloatQuad quad(FloatPoint(2, 3), FloatPoint(5, 7), FloatPoint(11, 13), |
| 15 FloatPoint(17, 19)); | 15 FloatPoint(17, 19)); |
| 16 EXPECT_EQ("2,3; 5,7; 11,13; 17,19", quad.toString()); | 16 EXPECT_EQ("2,3; 5,7; 11,13; 17,19", quad.toString()); |
| 17 } | 17 } |
| 18 | 18 |
| 19 TEST(FloatQuadTest, BoundingBox) { | 19 TEST(FloatQuadTest, BoundingBox) { |
| (...skipping 10 matching lines...) Expand all Loading... |
| 30 double inf = std::numeric_limits<double>::infinity(); | 30 double inf = std::numeric_limits<double>::infinity(); |
| 31 FloatQuad quad(FloatPoint(-inf, 3), FloatPoint(5, inf), FloatPoint(11, 13), | 31 FloatQuad quad(FloatPoint(-inf, 3), FloatPoint(5, inf), FloatPoint(11, 13), |
| 32 FloatPoint(17, 19)); | 32 FloatPoint(17, 19)); |
| 33 FloatRect rect = quad.boundingBox(); | 33 FloatRect rect = quad.boundingBox(); |
| 34 EXPECT_EQ(rect.x(), std::numeric_limits<int>::min()); | 34 EXPECT_EQ(rect.x(), std::numeric_limits<int>::min()); |
| 35 EXPECT_EQ(rect.y(), 3.0f); | 35 EXPECT_EQ(rect.y(), 3.0f); |
| 36 EXPECT_EQ(rect.width(), 17.0f - std::numeric_limits<int>::min()); | 36 EXPECT_EQ(rect.width(), 17.0f - std::numeric_limits<int>::min()); |
| 37 EXPECT_EQ(rect.height(), std::numeric_limits<int>::max() - 3.0f); | 37 EXPECT_EQ(rect.height(), std::numeric_limits<int>::max() - 3.0f); |
| 38 } | 38 } |
| 39 } // namespace blink | 39 } // namespace blink |
| OLD | NEW |