| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. | 2 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above | 8 * 1. Redistributions of source code must retain the above |
| 9 * copyright notice, this list of conditions and the following | 9 * copyright notice, this list of conditions and the following |
| 10 * disclaimer. | 10 * disclaimer. |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | 26 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED |
| 27 * OF THE POSSIBILITY OF SUCH DAMAGE. | 27 * OF THE POSSIBILITY OF SUCH DAMAGE. |
| 28 */ | 28 */ |
| 29 | 29 |
| 30 #include "config.h" | 30 #include "config.h" |
| 31 | 31 |
| 32 #include "platform/geometry/FloatRoundedRect.h" | 32 #include "platform/geometry/FloatRoundedRect.h" |
| 33 | 33 |
| 34 #include <gtest/gtest.h> | 34 #include <gtest/gtest.h> |
| 35 | 35 |
| 36 using namespace WebCore; | 36 using namespace blink; |
| 37 | 37 |
| 38 namespace WebCore { | 38 namespace blink { |
| 39 | 39 |
| 40 void PrintTo(const FloatSize& size, std::ostream* os) | 40 void PrintTo(const FloatSize& size, std::ostream* os) |
| 41 { | 41 { |
| 42 *os << "FloatSize(" | 42 *os << "FloatSize(" |
| 43 << size.width() << ", " | 43 << size.width() << ", " |
| 44 << size.height() << ")"; | 44 << size.height() << ")"; |
| 45 } | 45 } |
| 46 | 46 |
| 47 void PrintTo(const FloatRect& rect, std::ostream* os) | 47 void PrintTo(const FloatRect& rect, std::ostream* os) |
| 48 { | 48 { |
| (...skipping 13 matching lines...) Expand all Loading... |
| 62 << ::testing::PrintToString(radii.bottomLeft()) << ")"; | 62 << ::testing::PrintToString(radii.bottomLeft()) << ")"; |
| 63 } | 63 } |
| 64 | 64 |
| 65 void PrintTo(const FloatRoundedRect& roundedRect, std::ostream* os) | 65 void PrintTo(const FloatRoundedRect& roundedRect, std::ostream* os) |
| 66 { | 66 { |
| 67 *os << "FloatRoundedRect(" | 67 *os << "FloatRoundedRect(" |
| 68 << ::testing::PrintToString(roundedRect.rect()) << ", " | 68 << ::testing::PrintToString(roundedRect.rect()) << ", " |
| 69 << ::testing::PrintToString(roundedRect.radii()) << ")"; | 69 << ::testing::PrintToString(roundedRect.radii()) << ")"; |
| 70 } | 70 } |
| 71 | 71 |
| 72 } // namespace WebCore | 72 } // namespace blink |
| 73 | 73 |
| 74 namespace { | 74 namespace { |
| 75 | 75 |
| 76 #define TEST_INTERCEPTS(roundedRect, yCoordinate, expectedMinXIntercept, expecte
dMaxXIntercept) \ | 76 #define TEST_INTERCEPTS(roundedRect, yCoordinate, expectedMinXIntercept, expecte
dMaxXIntercept) \ |
| 77 {
\ | 77 {
\ |
| 78 float minXIntercept;
\ | 78 float minXIntercept;
\ |
| 79 float maxXIntercept;
\ | 79 float maxXIntercept;
\ |
| 80 EXPECT_TRUE(roundedRect.xInterceptsAtY(yCoordinate, minXIntercept, maxXInter
cept)); \ | 80 EXPECT_TRUE(roundedRect.xInterceptsAtY(yCoordinate, minXIntercept, maxXInter
cept)); \ |
| 81 EXPECT_FLOAT_EQ(expectedMinXIntercept, minXIntercept);
\ | 81 EXPECT_FLOAT_EQ(expectedMinXIntercept, minXIntercept);
\ |
| 82 EXPECT_FLOAT_EQ(expectedMaxXIntercept, maxXIntercept);
\ | 82 EXPECT_FLOAT_EQ(expectedMaxXIntercept, maxXIntercept);
\ |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 | 191 |
| 192 float minXIntercept; | 192 float minXIntercept; |
| 193 float maxXIntercept; | 193 float maxXIntercept; |
| 194 | 194 |
| 195 EXPECT_FALSE(r.xInterceptsAtY(-1, minXIntercept, maxXIntercept)); | 195 EXPECT_FALSE(r.xInterceptsAtY(-1, minXIntercept, maxXIntercept)); |
| 196 EXPECT_FALSE(r.xInterceptsAtY(101, minXIntercept, maxXIntercept)); | 196 EXPECT_FALSE(r.xInterceptsAtY(101, minXIntercept, maxXIntercept)); |
| 197 } | 197 } |
| 198 | 198 |
| 199 } // namespace | 199 } // namespace |
| 200 | 200 |
| OLD | NEW |