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

Unified Diff: Source/core/rendering/shapes/BoxShapeTest.cpp

Issue 454123002: Refactor getExcludedIntervals since only one LineSegment is ever returned (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: Source/core/rendering/shapes/BoxShapeTest.cpp
diff --git a/Source/core/rendering/shapes/BoxShapeTest.cpp b/Source/core/rendering/shapes/BoxShapeTest.cpp
index 0cc1c419f1cb478fac67353867c8c59fce5bd8df..2c68887c295cbdf6f8bad4dbfe0f4624bf7620e1 100644
--- a/Source/core/rendering/shapes/BoxShapeTest.cpp
+++ b/Source/core/rendering/shapes/BoxShapeTest.cpp
@@ -55,20 +55,18 @@ using namespace blink;
#define TEST_EXCLUDED_INTERVAL(shapePtr, lineTop, lineHeight, expectedLeft, expectedRight) \
{ \
- SegmentList result; \
- shapePtr->getExcludedIntervals(lineTop, lineHeight, result); \
- EXPECT_EQ(1u, result.size()); \
- if (result.size() == 1u) { \
- EXPECT_FLOAT_EQ(expectedLeft, result[0].logicalLeft); \
- EXPECT_FLOAT_EQ(expectedRight, result[0].logicalRight); \
+ LineSegment segment = shapePtr->getExcludedInterval(lineTop, lineHeight); \
+ EXPECT_TRUE(segment.isValid); \
+ if (segment.isValid) { \
+ EXPECT_FLOAT_EQ(expectedLeft, segment.logicalLeft); \
+ EXPECT_FLOAT_EQ(expectedRight, segment.logicalRight); \
} \
}
#define TEST_NO_EXCLUDED_INTERVAL(shapePtr, lineTop, lineHeight) \
{ \
- SegmentList result; \
- shapePtr->getExcludedIntervals(lineTop, lineHeight, result); \
- EXPECT_EQ(0u, result.size()); \
+ LineSegment segment = shapePtr->getExcludedInterval(lineTop, lineHeight); \
+ EXPECT_FALSE(segment.isValid); \
}
/* The BoxShape is based on a 100x50 rectangle at 0,0. The shape-margin value is 10,

Powered by Google App Engine
This is Rietveld 408576698