Added bool config to YGConfig to configure using web defaults

Summary:
Added bool config to YGConfig to configure using web defaults. See #445.
Closes https://github.com/facebook/yoga/pull/449

Reviewed By: astreet

Differential Revision: D4642272

Pulled By: emilsjolander

fbshipit-source-id: 4f35bd17b7f764f42295052a4a8b4ae46c192d7e
This commit is contained in:
Lukas Wöhrl
2017-03-03 10:47:42 -08:00
committed by Facebook Github Bot
parent a706f4c97c
commit 62f47190fb
3 changed files with 41 additions and 5 deletions

View File

@@ -90,3 +90,16 @@ TEST(YogaTest, assert_default_values) {
YGNodeFreeRecursive(root);
}
TEST(YogaTest, assert_webdefault_values) {
YGConfig * config = YGConfigNew();
YGConfigSetUseWebDefaults(config, true);
const YGNodeRef root = YGNodeNewWithConfig(config);
ASSERT_EQ(YGFlexDirectionRow, YGNodeStyleGetFlexDirection(root));
ASSERT_EQ(YGAlignStretch, YGNodeStyleGetAlignContent(root));
ASSERT_FLOAT_EQ(1.0f, YGNodeStyleGetFlexShrink(root));
YGNodeFreeRecursive(root);
YGConfigFree(config);
}