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 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 TEST_INTERCEPTS(r, 85, 0, 97.320511); | 189 TEST_INTERCEPTS(r, 85, 0, 97.320511); |
190 TEST_INTERCEPTS(r, 95, 6.3661003, 91.05542); | 190 TEST_INTERCEPTS(r, 95, 6.3661003, 91.05542); |
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 TEST(FloatRoundedRectTest, radiusCenterRect) |
| 200 { |
| 201 FloatSize cornerRect(10, 10); |
| 202 FloatRoundedRect r0(FloatRect(0, 0, 100, 50), FloatRoundedRect::Radii(corner
Rect, cornerRect, cornerRect, cornerRect)); |
| 203 EXPECT_EQ(FloatRect(10, 10, 80, 30), r0.radiusCenterRect()); |
| 204 |
| 205 // "Degenerate" cases all return an empty rectangle. |
| 206 FloatRect collapsedRect(0, 0, 100, 50); |
| 207 collapsedRect.expand(FloatRectOutsets(-200, -200, -200, -200)); |
| 208 FloatRoundedRect r1(collapsedRect); |
| 209 EXPECT_TRUE(r1.radiusCenterRect().isEmpty()); |
| 210 |
| 211 FloatRoundedRect::Radii radiiWithTooLargeCorner(FloatSize(55, 55), FloatSize
(), FloatSize(), FloatSize()); |
| 212 FloatRoundedRect r2(FloatRect(0, 0, 100, 50), radiiWithTooLargeCorner); |
| 213 EXPECT_TRUE(r2.radiusCenterRect().isEmpty()); |
| 214 } |
| 215 |
199 } // namespace | 216 } // namespace |
200 | 217 |
OLD | NEW |