|
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<<f4f43f15e5bcf5ed02e631d44d9260e7>> |
| 7 | + * @generated SignedSource<<1bd4fc7d44bfd98f9ac2a49123deb733>> |
8 | 8 | * generated by gentest/src/GentestDriver.ts from gentest/fixtures/YGPercentageTest.html |
9 | 9 | */ |
10 | 10 |
|
@@ -496,6 +496,7 @@ public void test_percentage_flex_basis_cross_max_width() { |
496 | 496 | } |
497 | 497 |
|
498 | 498 | @Test |
| 499 | + @Ignore |
499 | 500 | public void test_percentage_flex_basis_main_min_width() { |
500 | 501 | YogaConfig config = YogaConfigFactory.create(); |
501 | 502 |
|
@@ -1339,6 +1340,119 @@ public void test_percent_of_max_cross_unstretched() { |
1339 | 1340 | assertEquals(20f, root_child0.getLayoutHeight(), 0.0f); |
1340 | 1341 | } |
1341 | 1342 |
|
| 1343 | + @Test |
| 1344 | + public void test_percentage_nested_min_width() { |
| 1345 | + YogaConfig config = YogaConfigFactory.create(); |
| 1346 | + |
| 1347 | + final YogaNode root = createNode(config); |
| 1348 | + root.setPositionType(YogaPositionType.ABSOLUTE); |
| 1349 | + root.setFlexDirection(YogaFlexDirection.ROW); |
| 1350 | + root.setWidth(40f); |
| 1351 | + root.setHeight(20f); |
| 1352 | + |
| 1353 | + final YogaNode root_child0 = createNode(config); |
| 1354 | + root_child0.setFlexDirection(YogaFlexDirection.ROW); |
| 1355 | + root_child0.setWidth(10f); |
| 1356 | + root.addChildAt(root_child0, 0); |
| 1357 | + |
| 1358 | + final YogaNode root_child0_child0 = createNode(config); |
| 1359 | + root_child0_child0.setFlexDirection(YogaFlexDirection.ROW); |
| 1360 | + root_child0_child0.setMinWidthPercent(50f); |
| 1361 | + root_child0.addChildAt(root_child0_child0, 0); |
| 1362 | + root.setDirection(YogaDirection.LTR); |
| 1363 | + root.calculateLayout(YogaConstants.UNDEFINED, YogaConstants.UNDEFINED); |
| 1364 | + |
| 1365 | + assertEquals(0f, root.getLayoutX(), 0.0f); |
| 1366 | + assertEquals(0f, root.getLayoutY(), 0.0f); |
| 1367 | + assertEquals(40f, root.getLayoutWidth(), 0.0f); |
| 1368 | + assertEquals(20f, root.getLayoutHeight(), 0.0f); |
| 1369 | + |
| 1370 | + assertEquals(0f, root_child0.getLayoutX(), 0.0f); |
| 1371 | + assertEquals(0f, root_child0.getLayoutY(), 0.0f); |
| 1372 | + assertEquals(10f, root_child0.getLayoutWidth(), 0.0f); |
| 1373 | + assertEquals(20f, root_child0.getLayoutHeight(), 0.0f); |
| 1374 | + |
| 1375 | + assertEquals(0f, root_child0_child0.getLayoutX(), 0.0f); |
| 1376 | + assertEquals(0f, root_child0_child0.getLayoutY(), 0.0f); |
| 1377 | + assertEquals(5f, root_child0_child0.getLayoutWidth(), 0.0f); |
| 1378 | + assertEquals(20f, root_child0_child0.getLayoutHeight(), 0.0f); |
| 1379 | + |
| 1380 | + root.setDirection(YogaDirection.RTL); |
| 1381 | + root.calculateLayout(YogaConstants.UNDEFINED, YogaConstants.UNDEFINED); |
| 1382 | + |
| 1383 | + assertEquals(0f, root.getLayoutX(), 0.0f); |
| 1384 | + assertEquals(0f, root.getLayoutY(), 0.0f); |
| 1385 | + assertEquals(40f, root.getLayoutWidth(), 0.0f); |
| 1386 | + assertEquals(20f, root.getLayoutHeight(), 0.0f); |
| 1387 | + |
| 1388 | + assertEquals(30f, root_child0.getLayoutX(), 0.0f); |
| 1389 | + assertEquals(0f, root_child0.getLayoutY(), 0.0f); |
| 1390 | + assertEquals(10f, root_child0.getLayoutWidth(), 0.0f); |
| 1391 | + assertEquals(20f, root_child0.getLayoutHeight(), 0.0f); |
| 1392 | + |
| 1393 | + assertEquals(5f, root_child0_child0.getLayoutX(), 0.0f); |
| 1394 | + assertEquals(0f, root_child0_child0.getLayoutY(), 0.0f); |
| 1395 | + assertEquals(5f, root_child0_child0.getLayoutWidth(), 0.0f); |
| 1396 | + assertEquals(20f, root_child0_child0.getLayoutHeight(), 0.0f); |
| 1397 | + } |
| 1398 | + |
| 1399 | + @Test |
| 1400 | + public void test_percentage_nested_max_width() { |
| 1401 | + YogaConfig config = YogaConfigFactory.create(); |
| 1402 | + |
| 1403 | + final YogaNode root = createNode(config); |
| 1404 | + root.setPositionType(YogaPositionType.ABSOLUTE); |
| 1405 | + root.setFlexDirection(YogaFlexDirection.ROW); |
| 1406 | + root.setWidth(40f); |
| 1407 | + root.setHeight(20f); |
| 1408 | + |
| 1409 | + final YogaNode root_child0 = createNode(config); |
| 1410 | + root_child0.setFlexDirection(YogaFlexDirection.ROW); |
| 1411 | + root_child0.setWidth(10f); |
| 1412 | + root.addChildAt(root_child0, 0); |
| 1413 | + |
| 1414 | + final YogaNode root_child0_child0 = createNode(config); |
| 1415 | + root_child0_child0.setFlexDirection(YogaFlexDirection.ROW); |
| 1416 | + root_child0_child0.setWidth(20f); |
| 1417 | + root_child0_child0.setMaxWidthPercent(50f); |
| 1418 | + root_child0.addChildAt(root_child0_child0, 0); |
| 1419 | + root.setDirection(YogaDirection.LTR); |
| 1420 | + root.calculateLayout(YogaConstants.UNDEFINED, YogaConstants.UNDEFINED); |
| 1421 | + |
| 1422 | + assertEquals(0f, root.getLayoutX(), 0.0f); |
| 1423 | + assertEquals(0f, root.getLayoutY(), 0.0f); |
| 1424 | + assertEquals(40f, root.getLayoutWidth(), 0.0f); |
| 1425 | + assertEquals(20f, root.getLayoutHeight(), 0.0f); |
| 1426 | + |
| 1427 | + assertEquals(0f, root_child0.getLayoutX(), 0.0f); |
| 1428 | + assertEquals(0f, root_child0.getLayoutY(), 0.0f); |
| 1429 | + assertEquals(10f, root_child0.getLayoutWidth(), 0.0f); |
| 1430 | + assertEquals(20f, root_child0.getLayoutHeight(), 0.0f); |
| 1431 | + |
| 1432 | + assertEquals(0f, root_child0_child0.getLayoutX(), 0.0f); |
| 1433 | + assertEquals(0f, root_child0_child0.getLayoutY(), 0.0f); |
| 1434 | + assertEquals(5f, root_child0_child0.getLayoutWidth(), 0.0f); |
| 1435 | + assertEquals(20f, root_child0_child0.getLayoutHeight(), 0.0f); |
| 1436 | + |
| 1437 | + root.setDirection(YogaDirection.RTL); |
| 1438 | + root.calculateLayout(YogaConstants.UNDEFINED, YogaConstants.UNDEFINED); |
| 1439 | + |
| 1440 | + assertEquals(0f, root.getLayoutX(), 0.0f); |
| 1441 | + assertEquals(0f, root.getLayoutY(), 0.0f); |
| 1442 | + assertEquals(40f, root.getLayoutWidth(), 0.0f); |
| 1443 | + assertEquals(20f, root.getLayoutHeight(), 0.0f); |
| 1444 | + |
| 1445 | + assertEquals(30f, root_child0.getLayoutX(), 0.0f); |
| 1446 | + assertEquals(0f, root_child0.getLayoutY(), 0.0f); |
| 1447 | + assertEquals(10f, root_child0.getLayoutWidth(), 0.0f); |
| 1448 | + assertEquals(20f, root_child0.getLayoutHeight(), 0.0f); |
| 1449 | + |
| 1450 | + assertEquals(5f, root_child0_child0.getLayoutX(), 0.0f); |
| 1451 | + assertEquals(0f, root_child0_child0.getLayoutY(), 0.0f); |
| 1452 | + assertEquals(5f, root_child0_child0.getLayoutWidth(), 0.0f); |
| 1453 | + assertEquals(20f, root_child0_child0.getLayoutHeight(), 0.0f); |
| 1454 | + } |
| 1455 | + |
1342 | 1456 | private YogaNode createNode(YogaConfig config) { |
1343 | 1457 | return mNodeFactory.create(config); |
1344 | 1458 | } |
|
0 commit comments