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

Side by Side Diff: Source/platform/geometry/FloatRoundedRectTest.cpp

Issue 1136083002: Drop assert for degenerate cases in FloatRoundedRect::radiusCenterRect() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « Source/platform/geometry/FloatRoundedRect.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « Source/platform/geometry/FloatRoundedRect.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698