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

Unified Diff: third_party/WebKit/Source/core/layout/ng/ng_constraint_space_test.cc

Issue 2438313003: [LayoutNG] Remove derived constraint spaces from opportunity iterator. (Closed)
Patch Set: address comments? Created 4 years, 2 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: third_party/WebKit/Source/core/layout/ng/ng_constraint_space_test.cc
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_constraint_space_test.cc b/third_party/WebKit/Source/core/layout/ng/ng_constraint_space_test.cc
index 04022dd323400ab783606dab40a89b20c93f60fc..9da13aa8c5490b52f06f74a5bdedebf5af72998a 100644
--- a/third_party/WebKit/Source/core/layout/ng/ng_constraint_space_test.cc
+++ b/third_party/WebKit/Source/core/layout/ng/ng_constraint_space_test.cc
@@ -44,8 +44,8 @@ TEST(NGConstraintSpaceTest, WritingMode) {
EXPECT_EQ(FragmentNone, vert_space->BlockFragmentationType());
}
-static String OpportunityToString(const NGConstraintSpace* opportunity) {
- return opportunity ? opportunity->ToString() : String("(null)");
+static String OpportunityToString(const NGLayoutOpportunity& opportunity) {
+ return !opportunity.IsEmpty() ? opportunity.ToString() : String("(empty)");
Gleb Lanbin 2016/10/21 22:13:01 .nit please try to use positive booleans statement
ikilpatrick 2016/10/24 17:09:19 Done.
}
TEST(NGConstraintSpaceTest, LayoutOpportunitiesNoExclusions) {
@@ -60,7 +60,7 @@ TEST(NGConstraintSpaceTest, LayoutOpportunitiesNoExclusions) {
auto* iterator = space->LayoutOpportunities(NGClearNone, for_inline_or_bfc);
EXPECT_EQ("0,0 600x400", OpportunityToString(iterator->Next()));
- EXPECT_EQ("(null)", OpportunityToString(iterator->Next()));
+ EXPECT_EQ("(empty)", OpportunityToString(iterator->Next()));
}
TEST(NGConstraintSpaceTest, LayoutOpportunitiesTopRightExclusion) {
@@ -85,7 +85,7 @@ TEST(NGConstraintSpaceTest, LayoutOpportunitiesTopRightExclusion) {
EXPECT_EQ("0,100 600x300", OpportunityToString(iterator->Next()));
// There should be no third opportunity.
- EXPECT_EQ("(null)", OpportunityToString(iterator->Next()));
+ EXPECT_EQ("(empty)", OpportunityToString(iterator->Next()));
}
TEST(NGConstraintSpaceTest, LayoutOpportunitiesTopLeftExclusion) {
@@ -110,7 +110,7 @@ TEST(NGConstraintSpaceTest, LayoutOpportunitiesTopLeftExclusion) {
EXPECT_EQ("0,100 600x300", OpportunityToString(iterator->Next()));
// There should be no third opportunity.
- EXPECT_EQ("(null)", OpportunityToString(iterator->Next()));
+ EXPECT_EQ("(empty)", OpportunityToString(iterator->Next()));
}
// Verifies that Layout Opportunity iterator produces 7 layout opportunities
@@ -169,7 +169,7 @@ TEST(NGConstraintSpaceTest, LayoutOpportunitiesTwoInMiddle) {
EXPECT_EQ("0,300 500x100", OpportunityToString(iterator->Next()));
// Iterator is exhausted.
- EXPECT_EQ("(null)", OpportunityToString(iterator->Next()));
+ EXPECT_EQ("(empty)", OpportunityToString(iterator->Next()));
}
// Verifies that Layout Opportunity iterator ignores the exclusion that is not
@@ -202,7 +202,7 @@ TEST(NGConstraintSpaceTest, LayoutOpportunitiesWithOutOfBoundsExclusions) {
auto* iterator = space->LayoutOpportunities(NGClearNone, for_inline_or_bfc);
EXPECT_EQ("0,0 600x100", OpportunityToString(iterator->Next()));
- EXPECT_EQ("(null)", OpportunityToString(iterator->Next()));
+ EXPECT_EQ("(empty)", OpportunityToString(iterator->Next()));
}
} // namespace

Powered by Google App Engine
This is Rietveld 408576698