|
4 | 4 | * This source code is licensed under the MIT license found in the |
5 | 5 | * LICENSE file in the root directory of this source tree. |
6 | 6 | * |
7 | | - * @generated SignedSource<<27e18496d4ee880d9ba95ad0b2648071>> |
| 7 | + * @generated SignedSource<<bcf4b24144910012045652321b43e373>> |
8 | 8 | * generated by gentest/gentest-driver.ts from gentest/fixtures/YGPercentageTest.html |
9 | 9 | */ |
10 | 10 |
|
@@ -552,6 +552,7 @@ public void test_percentage_flex_basis_cross_max_width() { |
552 | 552 | } |
553 | 553 |
|
554 | 554 | @Test |
| 555 | + @Ignore |
555 | 556 | public void test_percentage_flex_basis_main_min_width() { |
556 | 557 | YogaConfig config = YogaConfigFactory.create(); |
557 | 558 |
|
@@ -1617,6 +1618,119 @@ public void test_percent_of_max_cross_unstretched() { |
1617 | 1618 | assertEquals(20f, root_child0.getLayoutHeight(), 0.0f); |
1618 | 1619 | } |
1619 | 1620 |
|
| 1621 | + @Test |
| 1622 | + public void test_percentage_nested_min_width() { |
| 1623 | + YogaConfig config = YogaConfigFactory.create(); |
| 1624 | + |
| 1625 | + final YogaNode root = createNode(config); |
| 1626 | + root.setFlexDirection(YogaFlexDirection.ROW); |
| 1627 | + root.setPositionType(YogaPositionType.ABSOLUTE); |
| 1628 | + root.setWidth(40f); |
| 1629 | + root.setHeight(20f); |
| 1630 | + |
| 1631 | + final YogaNode root_child0 = createNode(config); |
| 1632 | + root_child0.setFlexDirection(YogaFlexDirection.ROW); |
| 1633 | + root_child0.setWidth(10f); |
| 1634 | + root.addChildAt(root_child0, 0); |
| 1635 | + |
| 1636 | + final YogaNode root_child0_child0 = createNode(config); |
| 1637 | + root_child0_child0.setFlexDirection(YogaFlexDirection.ROW); |
| 1638 | + root_child0_child0.setMinWidthPercent(50f); |
| 1639 | + root_child0.addChildAt(root_child0_child0, 0); |
| 1640 | + root.setDirection(YogaDirection.LTR); |
| 1641 | + root.calculateLayout(YogaConstants.UNDEFINED, YogaConstants.UNDEFINED); |
| 1642 | + |
| 1643 | + assertEquals(0f, root.getLayoutX(), 0.0f); |
| 1644 | + assertEquals(0f, root.getLayoutY(), 0.0f); |
| 1645 | + assertEquals(40f, root.getLayoutWidth(), 0.0f); |
| 1646 | + assertEquals(20f, root.getLayoutHeight(), 0.0f); |
| 1647 | + |
| 1648 | + assertEquals(0f, root_child0.getLayoutX(), 0.0f); |
| 1649 | + assertEquals(0f, root_child0.getLayoutY(), 0.0f); |
| 1650 | + assertEquals(10f, root_child0.getLayoutWidth(), 0.0f); |
| 1651 | + assertEquals(20f, root_child0.getLayoutHeight(), 0.0f); |
| 1652 | + |
| 1653 | + assertEquals(0f, root_child0_child0.getLayoutX(), 0.0f); |
| 1654 | + assertEquals(0f, root_child0_child0.getLayoutY(), 0.0f); |
| 1655 | + assertEquals(5f, root_child0_child0.getLayoutWidth(), 0.0f); |
| 1656 | + assertEquals(20f, root_child0_child0.getLayoutHeight(), 0.0f); |
| 1657 | + |
| 1658 | + root.setDirection(YogaDirection.RTL); |
| 1659 | + root.calculateLayout(YogaConstants.UNDEFINED, YogaConstants.UNDEFINED); |
| 1660 | + |
| 1661 | + assertEquals(0f, root.getLayoutX(), 0.0f); |
| 1662 | + assertEquals(0f, root.getLayoutY(), 0.0f); |
| 1663 | + assertEquals(40f, root.getLayoutWidth(), 0.0f); |
| 1664 | + assertEquals(20f, root.getLayoutHeight(), 0.0f); |
| 1665 | + |
| 1666 | + assertEquals(30f, root_child0.getLayoutX(), 0.0f); |
| 1667 | + assertEquals(0f, root_child0.getLayoutY(), 0.0f); |
| 1668 | + assertEquals(10f, root_child0.getLayoutWidth(), 0.0f); |
| 1669 | + assertEquals(20f, root_child0.getLayoutHeight(), 0.0f); |
| 1670 | + |
| 1671 | + assertEquals(5f, root_child0_child0.getLayoutX(), 0.0f); |
| 1672 | + assertEquals(0f, root_child0_child0.getLayoutY(), 0.0f); |
| 1673 | + assertEquals(5f, root_child0_child0.getLayoutWidth(), 0.0f); |
| 1674 | + assertEquals(20f, root_child0_child0.getLayoutHeight(), 0.0f); |
| 1675 | + } |
| 1676 | + |
| 1677 | + @Test |
| 1678 | + public void test_percentage_nested_max_width() { |
| 1679 | + YogaConfig config = YogaConfigFactory.create(); |
| 1680 | + |
| 1681 | + final YogaNode root = createNode(config); |
| 1682 | + root.setFlexDirection(YogaFlexDirection.ROW); |
| 1683 | + root.setPositionType(YogaPositionType.ABSOLUTE); |
| 1684 | + root.setWidth(40f); |
| 1685 | + root.setHeight(20f); |
| 1686 | + |
| 1687 | + final YogaNode root_child0 = createNode(config); |
| 1688 | + root_child0.setFlexDirection(YogaFlexDirection.ROW); |
| 1689 | + root_child0.setWidth(10f); |
| 1690 | + root.addChildAt(root_child0, 0); |
| 1691 | + |
| 1692 | + final YogaNode root_child0_child0 = createNode(config); |
| 1693 | + root_child0_child0.setFlexDirection(YogaFlexDirection.ROW); |
| 1694 | + root_child0_child0.setWidth(20f); |
| 1695 | + root_child0_child0.setMaxWidthPercent(50f); |
| 1696 | + root_child0.addChildAt(root_child0_child0, 0); |
| 1697 | + root.setDirection(YogaDirection.LTR); |
| 1698 | + root.calculateLayout(YogaConstants.UNDEFINED, YogaConstants.UNDEFINED); |
| 1699 | + |
| 1700 | + assertEquals(0f, root.getLayoutX(), 0.0f); |
| 1701 | + assertEquals(0f, root.getLayoutY(), 0.0f); |
| 1702 | + assertEquals(40f, root.getLayoutWidth(), 0.0f); |
| 1703 | + assertEquals(20f, root.getLayoutHeight(), 0.0f); |
| 1704 | + |
| 1705 | + assertEquals(0f, root_child0.getLayoutX(), 0.0f); |
| 1706 | + assertEquals(0f, root_child0.getLayoutY(), 0.0f); |
| 1707 | + assertEquals(10f, root_child0.getLayoutWidth(), 0.0f); |
| 1708 | + assertEquals(20f, root_child0.getLayoutHeight(), 0.0f); |
| 1709 | + |
| 1710 | + assertEquals(0f, root_child0_child0.getLayoutX(), 0.0f); |
| 1711 | + assertEquals(0f, root_child0_child0.getLayoutY(), 0.0f); |
| 1712 | + assertEquals(5f, root_child0_child0.getLayoutWidth(), 0.0f); |
| 1713 | + assertEquals(20f, root_child0_child0.getLayoutHeight(), 0.0f); |
| 1714 | + |
| 1715 | + root.setDirection(YogaDirection.RTL); |
| 1716 | + root.calculateLayout(YogaConstants.UNDEFINED, YogaConstants.UNDEFINED); |
| 1717 | + |
| 1718 | + assertEquals(0f, root.getLayoutX(), 0.0f); |
| 1719 | + assertEquals(0f, root.getLayoutY(), 0.0f); |
| 1720 | + assertEquals(40f, root.getLayoutWidth(), 0.0f); |
| 1721 | + assertEquals(20f, root.getLayoutHeight(), 0.0f); |
| 1722 | + |
| 1723 | + assertEquals(30f, root_child0.getLayoutX(), 0.0f); |
| 1724 | + assertEquals(0f, root_child0.getLayoutY(), 0.0f); |
| 1725 | + assertEquals(10f, root_child0.getLayoutWidth(), 0.0f); |
| 1726 | + assertEquals(20f, root_child0.getLayoutHeight(), 0.0f); |
| 1727 | + |
| 1728 | + assertEquals(5f, root_child0_child0.getLayoutX(), 0.0f); |
| 1729 | + assertEquals(0f, root_child0_child0.getLayoutY(), 0.0f); |
| 1730 | + assertEquals(5f, root_child0_child0.getLayoutWidth(), 0.0f); |
| 1731 | + assertEquals(20f, root_child0_child0.getLayoutHeight(), 0.0f); |
| 1732 | + } |
| 1733 | + |
1620 | 1734 | private YogaNode createNode(YogaConfig config) { |
1621 | 1735 | return mNodeFactory.create(config); |
1622 | 1736 | } |
|
0 commit comments