Yoga android news feed benchmark tests
Summary: Added a benchmark tests along with the usual gentest in yoga for a complex yoga android news feed view. Reviewed By: emilsjolander Differential Revision: D6753544 fbshipit-source-id: 23b8da9785990a86248ff4708ac61e12411eb489
This commit is contained in:
committed by
Facebook Github Bot
parent
80f8aa3c7e
commit
4f92ae46ef
301
csharp/tests/Facebook.Yoga/YGAndroidNewsFeed.cs
Normal file
301
csharp/tests/Facebook.Yoga/YGAndroidNewsFeed.cs
Normal file
@@ -0,0 +1,301 @@
|
||||
/**
|
||||
* Copyright (c) 2014-present, Facebook, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This source code is licensed under the BSD-style license found in the
|
||||
* LICENSE file in the root directory of this source tree. An additional grant
|
||||
* of patent rights can be found in the PATENTS file in the same directory.
|
||||
*/
|
||||
|
||||
// @Generated by gentest/gentest.rb from gentest/fixtures/YGAndroidNewsFeed.html
|
||||
|
||||
using System;
|
||||
using NUnit.Framework;
|
||||
|
||||
namespace Facebook.Yoga
|
||||
{
|
||||
[TestFixture]
|
||||
public class YGAndroidNewsFeed
|
||||
{
|
||||
[Test]
|
||||
public void Test_android_news_feed()
|
||||
{
|
||||
YogaConfig config = new YogaConfig();
|
||||
|
||||
YogaNode root = new YogaNode(config);
|
||||
root.AlignContent = YogaAlign.Stretch;
|
||||
root.Width = 1080;
|
||||
|
||||
YogaNode root_child0 = new YogaNode(config);
|
||||
root.Insert(0, root_child0);
|
||||
|
||||
YogaNode root_child0_child0 = new YogaNode(config);
|
||||
root_child0_child0.AlignContent = YogaAlign.Stretch;
|
||||
root_child0.Insert(0, root_child0_child0);
|
||||
|
||||
YogaNode root_child0_child0_child0 = new YogaNode(config);
|
||||
root_child0_child0_child0.AlignContent = YogaAlign.Stretch;
|
||||
root_child0_child0.Insert(0, root_child0_child0_child0);
|
||||
|
||||
YogaNode root_child0_child0_child0_child0 = new YogaNode(config);
|
||||
root_child0_child0_child0_child0.FlexDirection = YogaFlexDirection.Row;
|
||||
root_child0_child0_child0_child0.AlignContent = YogaAlign.Stretch;
|
||||
root_child0_child0_child0_child0.AlignItems = YogaAlign.FlexStart;
|
||||
root_child0_child0_child0_child0.MarginStart = 36;
|
||||
root_child0_child0_child0_child0.MarginTop = 24;
|
||||
root_child0_child0_child0.Insert(0, root_child0_child0_child0_child0);
|
||||
|
||||
YogaNode root_child0_child0_child0_child0_child0 = new YogaNode(config);
|
||||
root_child0_child0_child0_child0_child0.FlexDirection = YogaFlexDirection.Row;
|
||||
root_child0_child0_child0_child0_child0.AlignContent = YogaAlign.Stretch;
|
||||
root_child0_child0_child0_child0.Insert(0, root_child0_child0_child0_child0_child0);
|
||||
|
||||
YogaNode root_child0_child0_child0_child0_child0_child0 = new YogaNode(config);
|
||||
root_child0_child0_child0_child0_child0_child0.AlignContent = YogaAlign.Stretch;
|
||||
root_child0_child0_child0_child0_child0_child0.Width = 120;
|
||||
root_child0_child0_child0_child0_child0_child0.Height = 120;
|
||||
root_child0_child0_child0_child0_child0.Insert(0, root_child0_child0_child0_child0_child0_child0);
|
||||
|
||||
YogaNode root_child0_child0_child0_child0_child1 = new YogaNode(config);
|
||||
root_child0_child0_child0_child0_child1.AlignContent = YogaAlign.Stretch;
|
||||
root_child0_child0_child0_child0_child1.FlexShrink = 1;
|
||||
root_child0_child0_child0_child0_child1.MarginRight = 36;
|
||||
root_child0_child0_child0_child0_child1.PaddingLeft = 36;
|
||||
root_child0_child0_child0_child0_child1.PaddingTop = 21;
|
||||
root_child0_child0_child0_child0_child1.PaddingRight = 36;
|
||||
root_child0_child0_child0_child0_child1.PaddingBottom = 18;
|
||||
root_child0_child0_child0_child0.Insert(1, root_child0_child0_child0_child0_child1);
|
||||
|
||||
YogaNode root_child0_child0_child0_child0_child1_child0 = new YogaNode(config);
|
||||
root_child0_child0_child0_child0_child1_child0.FlexDirection = YogaFlexDirection.Row;
|
||||
root_child0_child0_child0_child0_child1_child0.AlignContent = YogaAlign.Stretch;
|
||||
root_child0_child0_child0_child0_child1_child0.FlexShrink = 1;
|
||||
root_child0_child0_child0_child0_child1.Insert(0, root_child0_child0_child0_child0_child1_child0);
|
||||
|
||||
YogaNode root_child0_child0_child0_child0_child1_child1 = new YogaNode(config);
|
||||
root_child0_child0_child0_child0_child1_child1.AlignContent = YogaAlign.Stretch;
|
||||
root_child0_child0_child0_child0_child1_child1.FlexShrink = 1;
|
||||
root_child0_child0_child0_child0_child1.Insert(1, root_child0_child0_child0_child0_child1_child1);
|
||||
|
||||
YogaNode root_child0_child0_child1 = new YogaNode(config);
|
||||
root_child0_child0_child1.AlignContent = YogaAlign.Stretch;
|
||||
root_child0_child0.Insert(1, root_child0_child0_child1);
|
||||
|
||||
YogaNode root_child0_child0_child1_child0 = new YogaNode(config);
|
||||
root_child0_child0_child1_child0.FlexDirection = YogaFlexDirection.Row;
|
||||
root_child0_child0_child1_child0.AlignContent = YogaAlign.Stretch;
|
||||
root_child0_child0_child1_child0.AlignItems = YogaAlign.FlexStart;
|
||||
root_child0_child0_child1_child0.MarginStart = 174;
|
||||
root_child0_child0_child1_child0.MarginTop = 24;
|
||||
root_child0_child0_child1.Insert(0, root_child0_child0_child1_child0);
|
||||
|
||||
YogaNode root_child0_child0_child1_child0_child0 = new YogaNode(config);
|
||||
root_child0_child0_child1_child0_child0.FlexDirection = YogaFlexDirection.Row;
|
||||
root_child0_child0_child1_child0_child0.AlignContent = YogaAlign.Stretch;
|
||||
root_child0_child0_child1_child0.Insert(0, root_child0_child0_child1_child0_child0);
|
||||
|
||||
YogaNode root_child0_child0_child1_child0_child0_child0 = new YogaNode(config);
|
||||
root_child0_child0_child1_child0_child0_child0.AlignContent = YogaAlign.Stretch;
|
||||
root_child0_child0_child1_child0_child0_child0.Width = 72;
|
||||
root_child0_child0_child1_child0_child0_child0.Height = 72;
|
||||
root_child0_child0_child1_child0_child0.Insert(0, root_child0_child0_child1_child0_child0_child0);
|
||||
|
||||
YogaNode root_child0_child0_child1_child0_child1 = new YogaNode(config);
|
||||
root_child0_child0_child1_child0_child1.AlignContent = YogaAlign.Stretch;
|
||||
root_child0_child0_child1_child0_child1.FlexShrink = 1;
|
||||
root_child0_child0_child1_child0_child1.MarginRight = 36;
|
||||
root_child0_child0_child1_child0_child1.PaddingLeft = 36;
|
||||
root_child0_child0_child1_child0_child1.PaddingTop = 21;
|
||||
root_child0_child0_child1_child0_child1.PaddingRight = 36;
|
||||
root_child0_child0_child1_child0_child1.PaddingBottom = 18;
|
||||
root_child0_child0_child1_child0.Insert(1, root_child0_child0_child1_child0_child1);
|
||||
|
||||
YogaNode root_child0_child0_child1_child0_child1_child0 = new YogaNode(config);
|
||||
root_child0_child0_child1_child0_child1_child0.FlexDirection = YogaFlexDirection.Row;
|
||||
root_child0_child0_child1_child0_child1_child0.AlignContent = YogaAlign.Stretch;
|
||||
root_child0_child0_child1_child0_child1_child0.FlexShrink = 1;
|
||||
root_child0_child0_child1_child0_child1.Insert(0, root_child0_child0_child1_child0_child1_child0);
|
||||
|
||||
YogaNode root_child0_child0_child1_child0_child1_child1 = new YogaNode(config);
|
||||
root_child0_child0_child1_child0_child1_child1.AlignContent = YogaAlign.Stretch;
|
||||
root_child0_child0_child1_child0_child1_child1.FlexShrink = 1;
|
||||
root_child0_child0_child1_child0_child1.Insert(1, root_child0_child0_child1_child0_child1_child1);
|
||||
root.StyleDirection = YogaDirection.LTR;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
Assert.AreEqual(0f, root.LayoutY);
|
||||
Assert.AreEqual(1080f, root.LayoutWidth);
|
||||
Assert.AreEqual(240f, root.LayoutHeight);
|
||||
|
||||
Assert.AreEqual(0f, root_child0.LayoutX);
|
||||
Assert.AreEqual(0f, root_child0.LayoutY);
|
||||
Assert.AreEqual(1080f, root_child0.LayoutWidth);
|
||||
Assert.AreEqual(240f, root_child0.LayoutHeight);
|
||||
|
||||
Assert.AreEqual(0f, root_child0_child0.LayoutX);
|
||||
Assert.AreEqual(0f, root_child0_child0.LayoutY);
|
||||
Assert.AreEqual(1080f, root_child0_child0.LayoutWidth);
|
||||
Assert.AreEqual(240f, root_child0_child0.LayoutHeight);
|
||||
|
||||
Assert.AreEqual(0f, root_child0_child0_child0.LayoutX);
|
||||
Assert.AreEqual(0f, root_child0_child0_child0.LayoutY);
|
||||
Assert.AreEqual(1080f, root_child0_child0_child0.LayoutWidth);
|
||||
Assert.AreEqual(144f, root_child0_child0_child0.LayoutHeight);
|
||||
|
||||
Assert.AreEqual(36f, root_child0_child0_child0_child0.LayoutX);
|
||||
Assert.AreEqual(24f, root_child0_child0_child0_child0.LayoutY);
|
||||
Assert.AreEqual(1044f, root_child0_child0_child0_child0.LayoutWidth);
|
||||
Assert.AreEqual(120f, root_child0_child0_child0_child0.LayoutHeight);
|
||||
|
||||
Assert.AreEqual(0f, root_child0_child0_child0_child0_child0.LayoutX);
|
||||
Assert.AreEqual(0f, root_child0_child0_child0_child0_child0.LayoutY);
|
||||
Assert.AreEqual(120f, root_child0_child0_child0_child0_child0.LayoutWidth);
|
||||
Assert.AreEqual(120f, root_child0_child0_child0_child0_child0.LayoutHeight);
|
||||
|
||||
Assert.AreEqual(0f, root_child0_child0_child0_child0_child0_child0.LayoutX);
|
||||
Assert.AreEqual(0f, root_child0_child0_child0_child0_child0_child0.LayoutY);
|
||||
Assert.AreEqual(120f, root_child0_child0_child0_child0_child0_child0.LayoutWidth);
|
||||
Assert.AreEqual(120f, root_child0_child0_child0_child0_child0_child0.LayoutHeight);
|
||||
|
||||
Assert.AreEqual(120f, root_child0_child0_child0_child0_child1.LayoutX);
|
||||
Assert.AreEqual(0f, root_child0_child0_child0_child0_child1.LayoutY);
|
||||
Assert.AreEqual(72f, root_child0_child0_child0_child0_child1.LayoutWidth);
|
||||
Assert.AreEqual(39f, root_child0_child0_child0_child0_child1.LayoutHeight);
|
||||
|
||||
Assert.AreEqual(36f, root_child0_child0_child0_child0_child1_child0.LayoutX);
|
||||
Assert.AreEqual(21f, root_child0_child0_child0_child0_child1_child0.LayoutY);
|
||||
Assert.AreEqual(0f, root_child0_child0_child0_child0_child1_child0.LayoutWidth);
|
||||
Assert.AreEqual(0f, root_child0_child0_child0_child0_child1_child0.LayoutHeight);
|
||||
|
||||
Assert.AreEqual(36f, root_child0_child0_child0_child0_child1_child1.LayoutX);
|
||||
Assert.AreEqual(21f, root_child0_child0_child0_child0_child1_child1.LayoutY);
|
||||
Assert.AreEqual(0f, root_child0_child0_child0_child0_child1_child1.LayoutWidth);
|
||||
Assert.AreEqual(0f, root_child0_child0_child0_child0_child1_child1.LayoutHeight);
|
||||
|
||||
Assert.AreEqual(0f, root_child0_child0_child1.LayoutX);
|
||||
Assert.AreEqual(144f, root_child0_child0_child1.LayoutY);
|
||||
Assert.AreEqual(1080f, root_child0_child0_child1.LayoutWidth);
|
||||
Assert.AreEqual(96f, root_child0_child0_child1.LayoutHeight);
|
||||
|
||||
Assert.AreEqual(174f, root_child0_child0_child1_child0.LayoutX);
|
||||
Assert.AreEqual(24f, root_child0_child0_child1_child0.LayoutY);
|
||||
Assert.AreEqual(906f, root_child0_child0_child1_child0.LayoutWidth);
|
||||
Assert.AreEqual(72f, root_child0_child0_child1_child0.LayoutHeight);
|
||||
|
||||
Assert.AreEqual(0f, root_child0_child0_child1_child0_child0.LayoutX);
|
||||
Assert.AreEqual(0f, root_child0_child0_child1_child0_child0.LayoutY);
|
||||
Assert.AreEqual(72f, root_child0_child0_child1_child0_child0.LayoutWidth);
|
||||
Assert.AreEqual(72f, root_child0_child0_child1_child0_child0.LayoutHeight);
|
||||
|
||||
Assert.AreEqual(0f, root_child0_child0_child1_child0_child0_child0.LayoutX);
|
||||
Assert.AreEqual(0f, root_child0_child0_child1_child0_child0_child0.LayoutY);
|
||||
Assert.AreEqual(72f, root_child0_child0_child1_child0_child0_child0.LayoutWidth);
|
||||
Assert.AreEqual(72f, root_child0_child0_child1_child0_child0_child0.LayoutHeight);
|
||||
|
||||
Assert.AreEqual(72f, root_child0_child0_child1_child0_child1.LayoutX);
|
||||
Assert.AreEqual(0f, root_child0_child0_child1_child0_child1.LayoutY);
|
||||
Assert.AreEqual(72f, root_child0_child0_child1_child0_child1.LayoutWidth);
|
||||
Assert.AreEqual(39f, root_child0_child0_child1_child0_child1.LayoutHeight);
|
||||
|
||||
Assert.AreEqual(36f, root_child0_child0_child1_child0_child1_child0.LayoutX);
|
||||
Assert.AreEqual(21f, root_child0_child0_child1_child0_child1_child0.LayoutY);
|
||||
Assert.AreEqual(0f, root_child0_child0_child1_child0_child1_child0.LayoutWidth);
|
||||
Assert.AreEqual(0f, root_child0_child0_child1_child0_child1_child0.LayoutHeight);
|
||||
|
||||
Assert.AreEqual(36f, root_child0_child0_child1_child0_child1_child1.LayoutX);
|
||||
Assert.AreEqual(21f, root_child0_child0_child1_child0_child1_child1.LayoutY);
|
||||
Assert.AreEqual(0f, root_child0_child0_child1_child0_child1_child1.LayoutWidth);
|
||||
Assert.AreEqual(0f, root_child0_child0_child1_child0_child1_child1.LayoutHeight);
|
||||
|
||||
root.StyleDirection = YogaDirection.RTL;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
Assert.AreEqual(0f, root.LayoutY);
|
||||
Assert.AreEqual(1080f, root.LayoutWidth);
|
||||
Assert.AreEqual(240f, root.LayoutHeight);
|
||||
|
||||
Assert.AreEqual(0f, root_child0.LayoutX);
|
||||
Assert.AreEqual(0f, root_child0.LayoutY);
|
||||
Assert.AreEqual(1080f, root_child0.LayoutWidth);
|
||||
Assert.AreEqual(240f, root_child0.LayoutHeight);
|
||||
|
||||
Assert.AreEqual(0f, root_child0_child0.LayoutX);
|
||||
Assert.AreEqual(0f, root_child0_child0.LayoutY);
|
||||
Assert.AreEqual(1080f, root_child0_child0.LayoutWidth);
|
||||
Assert.AreEqual(240f, root_child0_child0.LayoutHeight);
|
||||
|
||||
Assert.AreEqual(0f, root_child0_child0_child0.LayoutX);
|
||||
Assert.AreEqual(0f, root_child0_child0_child0.LayoutY);
|
||||
Assert.AreEqual(1080f, root_child0_child0_child0.LayoutWidth);
|
||||
Assert.AreEqual(144f, root_child0_child0_child0.LayoutHeight);
|
||||
|
||||
Assert.AreEqual(0f, root_child0_child0_child0_child0.LayoutX);
|
||||
Assert.AreEqual(24f, root_child0_child0_child0_child0.LayoutY);
|
||||
Assert.AreEqual(1044f, root_child0_child0_child0_child0.LayoutWidth);
|
||||
Assert.AreEqual(120f, root_child0_child0_child0_child0.LayoutHeight);
|
||||
|
||||
Assert.AreEqual(924f, root_child0_child0_child0_child0_child0.LayoutX);
|
||||
Assert.AreEqual(0f, root_child0_child0_child0_child0_child0.LayoutY);
|
||||
Assert.AreEqual(120f, root_child0_child0_child0_child0_child0.LayoutWidth);
|
||||
Assert.AreEqual(120f, root_child0_child0_child0_child0_child0.LayoutHeight);
|
||||
|
||||
Assert.AreEqual(0f, root_child0_child0_child0_child0_child0_child0.LayoutX);
|
||||
Assert.AreEqual(0f, root_child0_child0_child0_child0_child0_child0.LayoutY);
|
||||
Assert.AreEqual(120f, root_child0_child0_child0_child0_child0_child0.LayoutWidth);
|
||||
Assert.AreEqual(120f, root_child0_child0_child0_child0_child0_child0.LayoutHeight);
|
||||
|
||||
Assert.AreEqual(816f, root_child0_child0_child0_child0_child1.LayoutX);
|
||||
Assert.AreEqual(0f, root_child0_child0_child0_child0_child1.LayoutY);
|
||||
Assert.AreEqual(72f, root_child0_child0_child0_child0_child1.LayoutWidth);
|
||||
Assert.AreEqual(39f, root_child0_child0_child0_child0_child1.LayoutHeight);
|
||||
|
||||
Assert.AreEqual(36f, root_child0_child0_child0_child0_child1_child0.LayoutX);
|
||||
Assert.AreEqual(21f, root_child0_child0_child0_child0_child1_child0.LayoutY);
|
||||
Assert.AreEqual(0f, root_child0_child0_child0_child0_child1_child0.LayoutWidth);
|
||||
Assert.AreEqual(0f, root_child0_child0_child0_child0_child1_child0.LayoutHeight);
|
||||
|
||||
Assert.AreEqual(36f, root_child0_child0_child0_child0_child1_child1.LayoutX);
|
||||
Assert.AreEqual(21f, root_child0_child0_child0_child0_child1_child1.LayoutY);
|
||||
Assert.AreEqual(0f, root_child0_child0_child0_child0_child1_child1.LayoutWidth);
|
||||
Assert.AreEqual(0f, root_child0_child0_child0_child0_child1_child1.LayoutHeight);
|
||||
|
||||
Assert.AreEqual(0f, root_child0_child0_child1.LayoutX);
|
||||
Assert.AreEqual(144f, root_child0_child0_child1.LayoutY);
|
||||
Assert.AreEqual(1080f, root_child0_child0_child1.LayoutWidth);
|
||||
Assert.AreEqual(96f, root_child0_child0_child1.LayoutHeight);
|
||||
|
||||
Assert.AreEqual(0f, root_child0_child0_child1_child0.LayoutX);
|
||||
Assert.AreEqual(24f, root_child0_child0_child1_child0.LayoutY);
|
||||
Assert.AreEqual(906f, root_child0_child0_child1_child0.LayoutWidth);
|
||||
Assert.AreEqual(72f, root_child0_child0_child1_child0.LayoutHeight);
|
||||
|
||||
Assert.AreEqual(834f, root_child0_child0_child1_child0_child0.LayoutX);
|
||||
Assert.AreEqual(0f, root_child0_child0_child1_child0_child0.LayoutY);
|
||||
Assert.AreEqual(72f, root_child0_child0_child1_child0_child0.LayoutWidth);
|
||||
Assert.AreEqual(72f, root_child0_child0_child1_child0_child0.LayoutHeight);
|
||||
|
||||
Assert.AreEqual(0f, root_child0_child0_child1_child0_child0_child0.LayoutX);
|
||||
Assert.AreEqual(0f, root_child0_child0_child1_child0_child0_child0.LayoutY);
|
||||
Assert.AreEqual(72f, root_child0_child0_child1_child0_child0_child0.LayoutWidth);
|
||||
Assert.AreEqual(72f, root_child0_child0_child1_child0_child0_child0.LayoutHeight);
|
||||
|
||||
Assert.AreEqual(726f, root_child0_child0_child1_child0_child1.LayoutX);
|
||||
Assert.AreEqual(0f, root_child0_child0_child1_child0_child1.LayoutY);
|
||||
Assert.AreEqual(72f, root_child0_child0_child1_child0_child1.LayoutWidth);
|
||||
Assert.AreEqual(39f, root_child0_child0_child1_child0_child1.LayoutHeight);
|
||||
|
||||
Assert.AreEqual(36f, root_child0_child0_child1_child0_child1_child0.LayoutX);
|
||||
Assert.AreEqual(21f, root_child0_child0_child1_child0_child1_child0.LayoutY);
|
||||
Assert.AreEqual(0f, root_child0_child0_child1_child0_child1_child0.LayoutWidth);
|
||||
Assert.AreEqual(0f, root_child0_child0_child1_child0_child1_child0.LayoutHeight);
|
||||
|
||||
Assert.AreEqual(36f, root_child0_child0_child1_child0_child1_child1.LayoutX);
|
||||
Assert.AreEqual(21f, root_child0_child0_child1_child0_child1_child1.LayoutY);
|
||||
Assert.AreEqual(0f, root_child0_child0_child1_child0_child1_child1.LayoutWidth);
|
||||
Assert.AreEqual(0f, root_child0_child0_child1_child0_child1_child1.LayoutHeight);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
28
gentest/fixtures/YGAndroidNewsFeed.html
Normal file
28
gentest/fixtures/YGAndroidNewsFeed.html
Normal file
@@ -0,0 +1,28 @@
|
||||
<div id="android_news_feed" layout="width: 1080; height: 444; top: 0; left: 0;" style="align-content: stretch; flex-shrink: 0; width: 1080px; " >
|
||||
<div layout="width: 1080; height: 444; top: 0; left: 0;" style="flex-shrink: 0; " >
|
||||
<div layout="width: 1080; height: 444; top: 0; left: 0;" style="align-content: stretch; " >
|
||||
<div layout="width: 1080; height: 226; top: 0; left: 0;" style="align-content: stretch; " >
|
||||
<div layout="width: 1044; height: 202; top: 24; left: 36;" style="flex-direction: row; align-items: flex-start; align-content: stretch; margin-top: 24px; margin-start: 36px; " >
|
||||
<div layout="width: 120; height: 120; top: 0; left: 0;" style="flex-direction: row; align-content: stretch; flex-shrink: 0; " >
|
||||
<div layout="width: 120; height: 120; top: 0; left: 0;" style="align-content: stretch; flex-shrink: 0; width: 120px; height: 120px; " has-custom-measure="true"></div>
|
||||
</div>
|
||||
<div layout="width: 870; height: 202; top: 0; left: 138;" style="align-content: stretch; flex-shrink: 1; margin-right: 36px; padding-left: 36px; padding-top: 21px; padding-right: 36px; padding-bottom: 18px; " >
|
||||
<div layout="width: 798; height: 49; top: 21; left: 36;" style="flex-direction: row; align-content: stretch; flex-shrink: 1; " has-custom-measure="true"></div>
|
||||
<div layout="width: 798; height: 114; top: 70; left: 36;" style="align-content: stretch; flex-shrink: 1; " has-custom-measure="true"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div layout="width: 1080; height: 218; top: 226; left: 0;" style="align-content: stretch; " >
|
||||
<div layout="width: 906; height: 194; top: 24; left: 174;" style="flex-direction: row; align-items: flex-start; align-content: stretch; margin-top: 24px; margin-start: 174px; " >
|
||||
<div layout="width: 72; height: 72; top: 12; left: 0;" style="flex-direction: row; align-content: stretch; flex-shrink: 0; " >
|
||||
<div layout="width: 72; height: 72; top: 0; left: 0;" style="align-content: stretch; flex-shrink: 0; width: 72px; height: 72px; " has-custom-measure="true"></div>
|
||||
</div>
|
||||
<div layout="width: 780; height: 194; top: 0; left: 90;" style="align-content: stretch; flex-shrink: 1; margin-right: 36px; padding-left: 36px; padding-top: 21px; padding-right: 36px; padding-bottom: 18px; " >
|
||||
<div layout="width: 708; height: 49; top: 21; left: 36;" style="flex-direction: row; align-content: stretch; flex-shrink: 1; " has-custom-measure="true"></div>
|
||||
<div layout="width: 708; height: 106; top: 70; left: 36;" style="align-content: stretch; flex-shrink: 1; " has-custom-measure="true"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
302
java/tests/com/facebook/yoga/YGAndroidNewsFeed.java
Normal file
302
java/tests/com/facebook/yoga/YGAndroidNewsFeed.java
Normal file
@@ -0,0 +1,302 @@
|
||||
/**
|
||||
* Copyright (c) 2014-present, Facebook, Inc. All rights reserved.
|
||||
*
|
||||
* <p>This source code is licensed under the BSD-style license found in the LICENSE file in the root
|
||||
* directory of this source tree. An additional grant of patent rights can be found in the PATENTS
|
||||
* file in the same directory.
|
||||
*/
|
||||
|
||||
// @Generated by gentest/gentest.rb from gentest/fixtures/YGAndroidNewsFeed.html
|
||||
|
||||
package com.facebook.yoga;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
public class YGAndroidNewsFeed {
|
||||
@Test
|
||||
public void test_android_news_feed() {
|
||||
YogaConfig config = new YogaConfig();
|
||||
|
||||
final YogaNode root = new YogaNode(config);
|
||||
root.setAlignContent(YogaAlign.STRETCH);
|
||||
root.setWidth(1080f);
|
||||
|
||||
final YogaNode root_child0 = new YogaNode(config);
|
||||
root.addChildAt(root_child0, 0);
|
||||
|
||||
final YogaNode root_child0_child0 = new YogaNode(config);
|
||||
root_child0_child0.setAlignContent(YogaAlign.STRETCH);
|
||||
root_child0.addChildAt(root_child0_child0, 0);
|
||||
|
||||
final YogaNode root_child0_child0_child0 = new YogaNode(config);
|
||||
root_child0_child0_child0.setAlignContent(YogaAlign.STRETCH);
|
||||
root_child0_child0.addChildAt(root_child0_child0_child0, 0);
|
||||
|
||||
final YogaNode root_child0_child0_child0_child0 = new YogaNode(config);
|
||||
root_child0_child0_child0_child0.setFlexDirection(YogaFlexDirection.ROW);
|
||||
root_child0_child0_child0_child0.setAlignContent(YogaAlign.STRETCH);
|
||||
root_child0_child0_child0_child0.setAlignItems(YogaAlign.FLEX_START);
|
||||
root_child0_child0_child0_child0.setMargin(YogaEdge.START, 36f);
|
||||
root_child0_child0_child0_child0.setMargin(YogaEdge.TOP, 24f);
|
||||
root_child0_child0_child0.addChildAt(root_child0_child0_child0_child0, 0);
|
||||
|
||||
final YogaNode root_child0_child0_child0_child0_child0 = new YogaNode(config);
|
||||
root_child0_child0_child0_child0_child0.setFlexDirection(YogaFlexDirection.ROW);
|
||||
root_child0_child0_child0_child0_child0.setAlignContent(YogaAlign.STRETCH);
|
||||
root_child0_child0_child0_child0.addChildAt(root_child0_child0_child0_child0_child0, 0);
|
||||
|
||||
final YogaNode root_child0_child0_child0_child0_child0_child0 = new YogaNode(config);
|
||||
root_child0_child0_child0_child0_child0_child0.setAlignContent(YogaAlign.STRETCH);
|
||||
root_child0_child0_child0_child0_child0_child0.setWidth(120f);
|
||||
root_child0_child0_child0_child0_child0_child0.setHeight(120f);
|
||||
root_child0_child0_child0_child0_child0.addChildAt(
|
||||
root_child0_child0_child0_child0_child0_child0, 0);
|
||||
|
||||
final YogaNode root_child0_child0_child0_child0_child1 = new YogaNode(config);
|
||||
root_child0_child0_child0_child0_child1.setAlignContent(YogaAlign.STRETCH);
|
||||
root_child0_child0_child0_child0_child1.setFlexShrink(1f);
|
||||
root_child0_child0_child0_child0_child1.setMargin(YogaEdge.RIGHT, 36f);
|
||||
root_child0_child0_child0_child0_child1.setPadding(YogaEdge.LEFT, 36);
|
||||
root_child0_child0_child0_child0_child1.setPadding(YogaEdge.TOP, 21);
|
||||
root_child0_child0_child0_child0_child1.setPadding(YogaEdge.RIGHT, 36);
|
||||
root_child0_child0_child0_child0_child1.setPadding(YogaEdge.BOTTOM, 18);
|
||||
root_child0_child0_child0_child0.addChildAt(root_child0_child0_child0_child0_child1, 1);
|
||||
|
||||
final YogaNode root_child0_child0_child0_child0_child1_child0 = new YogaNode(config);
|
||||
root_child0_child0_child0_child0_child1_child0.setFlexDirection(YogaFlexDirection.ROW);
|
||||
root_child0_child0_child0_child0_child1_child0.setAlignContent(YogaAlign.STRETCH);
|
||||
root_child0_child0_child0_child0_child1_child0.setFlexShrink(1f);
|
||||
root_child0_child0_child0_child0_child1.addChildAt(
|
||||
root_child0_child0_child0_child0_child1_child0, 0);
|
||||
|
||||
final YogaNode root_child0_child0_child0_child0_child1_child1 = new YogaNode(config);
|
||||
root_child0_child0_child0_child0_child1_child1.setAlignContent(YogaAlign.STRETCH);
|
||||
root_child0_child0_child0_child0_child1_child1.setFlexShrink(1f);
|
||||
root_child0_child0_child0_child0_child1.addChildAt(
|
||||
root_child0_child0_child0_child0_child1_child1, 1);
|
||||
|
||||
final YogaNode root_child0_child0_child1 = new YogaNode(config);
|
||||
root_child0_child0_child1.setAlignContent(YogaAlign.STRETCH);
|
||||
root_child0_child0.addChildAt(root_child0_child0_child1, 1);
|
||||
|
||||
final YogaNode root_child0_child0_child1_child0 = new YogaNode(config);
|
||||
root_child0_child0_child1_child0.setFlexDirection(YogaFlexDirection.ROW);
|
||||
root_child0_child0_child1_child0.setAlignContent(YogaAlign.STRETCH);
|
||||
root_child0_child0_child1_child0.setAlignItems(YogaAlign.FLEX_START);
|
||||
root_child0_child0_child1_child0.setMargin(YogaEdge.START, 174f);
|
||||
root_child0_child0_child1_child0.setMargin(YogaEdge.TOP, 24f);
|
||||
root_child0_child0_child1.addChildAt(root_child0_child0_child1_child0, 0);
|
||||
|
||||
final YogaNode root_child0_child0_child1_child0_child0 = new YogaNode(config);
|
||||
root_child0_child0_child1_child0_child0.setFlexDirection(YogaFlexDirection.ROW);
|
||||
root_child0_child0_child1_child0_child0.setAlignContent(YogaAlign.STRETCH);
|
||||
root_child0_child0_child1_child0.addChildAt(root_child0_child0_child1_child0_child0, 0);
|
||||
|
||||
final YogaNode root_child0_child0_child1_child0_child0_child0 = new YogaNode(config);
|
||||
root_child0_child0_child1_child0_child0_child0.setAlignContent(YogaAlign.STRETCH);
|
||||
root_child0_child0_child1_child0_child0_child0.setWidth(72f);
|
||||
root_child0_child0_child1_child0_child0_child0.setHeight(72f);
|
||||
root_child0_child0_child1_child0_child0.addChildAt(
|
||||
root_child0_child0_child1_child0_child0_child0, 0);
|
||||
|
||||
final YogaNode root_child0_child0_child1_child0_child1 = new YogaNode(config);
|
||||
root_child0_child0_child1_child0_child1.setAlignContent(YogaAlign.STRETCH);
|
||||
root_child0_child0_child1_child0_child1.setFlexShrink(1f);
|
||||
root_child0_child0_child1_child0_child1.setMargin(YogaEdge.RIGHT, 36f);
|
||||
root_child0_child0_child1_child0_child1.setPadding(YogaEdge.LEFT, 36);
|
||||
root_child0_child0_child1_child0_child1.setPadding(YogaEdge.TOP, 21);
|
||||
root_child0_child0_child1_child0_child1.setPadding(YogaEdge.RIGHT, 36);
|
||||
root_child0_child0_child1_child0_child1.setPadding(YogaEdge.BOTTOM, 18);
|
||||
root_child0_child0_child1_child0.addChildAt(root_child0_child0_child1_child0_child1, 1);
|
||||
|
||||
final YogaNode root_child0_child0_child1_child0_child1_child0 = new YogaNode(config);
|
||||
root_child0_child0_child1_child0_child1_child0.setFlexDirection(YogaFlexDirection.ROW);
|
||||
root_child0_child0_child1_child0_child1_child0.setAlignContent(YogaAlign.STRETCH);
|
||||
root_child0_child0_child1_child0_child1_child0.setFlexShrink(1f);
|
||||
root_child0_child0_child1_child0_child1.addChildAt(
|
||||
root_child0_child0_child1_child0_child1_child0, 0);
|
||||
|
||||
final YogaNode root_child0_child0_child1_child0_child1_child1 = new YogaNode(config);
|
||||
root_child0_child0_child1_child0_child1_child1.setAlignContent(YogaAlign.STRETCH);
|
||||
root_child0_child0_child1_child0_child1_child1.setFlexShrink(1f);
|
||||
root_child0_child0_child1_child0_child1.addChildAt(
|
||||
root_child0_child0_child1_child0_child1_child1, 1);
|
||||
root.setDirection(YogaDirection.LTR);
|
||||
root.calculateLayout(YogaConstants.UNDEFINED, YogaConstants.UNDEFINED);
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
assertEquals(0f, root.getLayoutY(), 0.0f);
|
||||
assertEquals(1080f, root.getLayoutWidth(), 0.0f);
|
||||
assertEquals(240f, root.getLayoutHeight(), 0.0f);
|
||||
|
||||
assertEquals(0f, root_child0.getLayoutX(), 0.0f);
|
||||
assertEquals(0f, root_child0.getLayoutY(), 0.0f);
|
||||
assertEquals(1080f, root_child0.getLayoutWidth(), 0.0f);
|
||||
assertEquals(240f, root_child0.getLayoutHeight(), 0.0f);
|
||||
|
||||
assertEquals(0f, root_child0_child0.getLayoutX(), 0.0f);
|
||||
assertEquals(0f, root_child0_child0.getLayoutY(), 0.0f);
|
||||
assertEquals(1080f, root_child0_child0.getLayoutWidth(), 0.0f);
|
||||
assertEquals(240f, root_child0_child0.getLayoutHeight(), 0.0f);
|
||||
|
||||
assertEquals(0f, root_child0_child0_child0.getLayoutX(), 0.0f);
|
||||
assertEquals(0f, root_child0_child0_child0.getLayoutY(), 0.0f);
|
||||
assertEquals(1080f, root_child0_child0_child0.getLayoutWidth(), 0.0f);
|
||||
assertEquals(144f, root_child0_child0_child0.getLayoutHeight(), 0.0f);
|
||||
|
||||
assertEquals(36f, root_child0_child0_child0_child0.getLayoutX(), 0.0f);
|
||||
assertEquals(24f, root_child0_child0_child0_child0.getLayoutY(), 0.0f);
|
||||
assertEquals(1044f, root_child0_child0_child0_child0.getLayoutWidth(), 0.0f);
|
||||
assertEquals(120f, root_child0_child0_child0_child0.getLayoutHeight(), 0.0f);
|
||||
|
||||
assertEquals(0f, root_child0_child0_child0_child0_child0.getLayoutX(), 0.0f);
|
||||
assertEquals(0f, root_child0_child0_child0_child0_child0.getLayoutY(), 0.0f);
|
||||
assertEquals(120f, root_child0_child0_child0_child0_child0.getLayoutWidth(), 0.0f);
|
||||
assertEquals(120f, root_child0_child0_child0_child0_child0.getLayoutHeight(), 0.0f);
|
||||
|
||||
assertEquals(0f, root_child0_child0_child0_child0_child0_child0.getLayoutX(), 0.0f);
|
||||
assertEquals(0f, root_child0_child0_child0_child0_child0_child0.getLayoutY(), 0.0f);
|
||||
assertEquals(120f, root_child0_child0_child0_child0_child0_child0.getLayoutWidth(), 0.0f);
|
||||
assertEquals(120f, root_child0_child0_child0_child0_child0_child0.getLayoutHeight(), 0.0f);
|
||||
|
||||
assertEquals(120f, root_child0_child0_child0_child0_child1.getLayoutX(), 0.0f);
|
||||
assertEquals(0f, root_child0_child0_child0_child0_child1.getLayoutY(), 0.0f);
|
||||
assertEquals(72f, root_child0_child0_child0_child0_child1.getLayoutWidth(), 0.0f);
|
||||
assertEquals(39f, root_child0_child0_child0_child0_child1.getLayoutHeight(), 0.0f);
|
||||
|
||||
assertEquals(36f, root_child0_child0_child0_child0_child1_child0.getLayoutX(), 0.0f);
|
||||
assertEquals(21f, root_child0_child0_child0_child0_child1_child0.getLayoutY(), 0.0f);
|
||||
assertEquals(0f, root_child0_child0_child0_child0_child1_child0.getLayoutWidth(), 0.0f);
|
||||
assertEquals(0f, root_child0_child0_child0_child0_child1_child0.getLayoutHeight(), 0.0f);
|
||||
|
||||
assertEquals(36f, root_child0_child0_child0_child0_child1_child1.getLayoutX(), 0.0f);
|
||||
assertEquals(21f, root_child0_child0_child0_child0_child1_child1.getLayoutY(), 0.0f);
|
||||
assertEquals(0f, root_child0_child0_child0_child0_child1_child1.getLayoutWidth(), 0.0f);
|
||||
assertEquals(0f, root_child0_child0_child0_child0_child1_child1.getLayoutHeight(), 0.0f);
|
||||
|
||||
assertEquals(0f, root_child0_child0_child1.getLayoutX(), 0.0f);
|
||||
assertEquals(144f, root_child0_child0_child1.getLayoutY(), 0.0f);
|
||||
assertEquals(1080f, root_child0_child0_child1.getLayoutWidth(), 0.0f);
|
||||
assertEquals(96f, root_child0_child0_child1.getLayoutHeight(), 0.0f);
|
||||
|
||||
assertEquals(174f, root_child0_child0_child1_child0.getLayoutX(), 0.0f);
|
||||
assertEquals(24f, root_child0_child0_child1_child0.getLayoutY(), 0.0f);
|
||||
assertEquals(906f, root_child0_child0_child1_child0.getLayoutWidth(), 0.0f);
|
||||
assertEquals(72f, root_child0_child0_child1_child0.getLayoutHeight(), 0.0f);
|
||||
|
||||
assertEquals(0f, root_child0_child0_child1_child0_child0.getLayoutX(), 0.0f);
|
||||
assertEquals(0f, root_child0_child0_child1_child0_child0.getLayoutY(), 0.0f);
|
||||
assertEquals(72f, root_child0_child0_child1_child0_child0.getLayoutWidth(), 0.0f);
|
||||
assertEquals(72f, root_child0_child0_child1_child0_child0.getLayoutHeight(), 0.0f);
|
||||
|
||||
assertEquals(0f, root_child0_child0_child1_child0_child0_child0.getLayoutX(), 0.0f);
|
||||
assertEquals(0f, root_child0_child0_child1_child0_child0_child0.getLayoutY(), 0.0f);
|
||||
assertEquals(72f, root_child0_child0_child1_child0_child0_child0.getLayoutWidth(), 0.0f);
|
||||
assertEquals(72f, root_child0_child0_child1_child0_child0_child0.getLayoutHeight(), 0.0f);
|
||||
|
||||
assertEquals(72f, root_child0_child0_child1_child0_child1.getLayoutX(), 0.0f);
|
||||
assertEquals(0f, root_child0_child0_child1_child0_child1.getLayoutY(), 0.0f);
|
||||
assertEquals(72f, root_child0_child0_child1_child0_child1.getLayoutWidth(), 0.0f);
|
||||
assertEquals(39f, root_child0_child0_child1_child0_child1.getLayoutHeight(), 0.0f);
|
||||
|
||||
assertEquals(36f, root_child0_child0_child1_child0_child1_child0.getLayoutX(), 0.0f);
|
||||
assertEquals(21f, root_child0_child0_child1_child0_child1_child0.getLayoutY(), 0.0f);
|
||||
assertEquals(0f, root_child0_child0_child1_child0_child1_child0.getLayoutWidth(), 0.0f);
|
||||
assertEquals(0f, root_child0_child0_child1_child0_child1_child0.getLayoutHeight(), 0.0f);
|
||||
|
||||
assertEquals(36f, root_child0_child0_child1_child0_child1_child1.getLayoutX(), 0.0f);
|
||||
assertEquals(21f, root_child0_child0_child1_child0_child1_child1.getLayoutY(), 0.0f);
|
||||
assertEquals(0f, root_child0_child0_child1_child0_child1_child1.getLayoutWidth(), 0.0f);
|
||||
assertEquals(0f, root_child0_child0_child1_child0_child1_child1.getLayoutHeight(), 0.0f);
|
||||
|
||||
root.setDirection(YogaDirection.RTL);
|
||||
root.calculateLayout(YogaConstants.UNDEFINED, YogaConstants.UNDEFINED);
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
assertEquals(0f, root.getLayoutY(), 0.0f);
|
||||
assertEquals(1080f, root.getLayoutWidth(), 0.0f);
|
||||
assertEquals(240f, root.getLayoutHeight(), 0.0f);
|
||||
|
||||
assertEquals(0f, root_child0.getLayoutX(), 0.0f);
|
||||
assertEquals(0f, root_child0.getLayoutY(), 0.0f);
|
||||
assertEquals(1080f, root_child0.getLayoutWidth(), 0.0f);
|
||||
assertEquals(240f, root_child0.getLayoutHeight(), 0.0f);
|
||||
|
||||
assertEquals(0f, root_child0_child0.getLayoutX(), 0.0f);
|
||||
assertEquals(0f, root_child0_child0.getLayoutY(), 0.0f);
|
||||
assertEquals(1080f, root_child0_child0.getLayoutWidth(), 0.0f);
|
||||
assertEquals(240f, root_child0_child0.getLayoutHeight(), 0.0f);
|
||||
|
||||
assertEquals(0f, root_child0_child0_child0.getLayoutX(), 0.0f);
|
||||
assertEquals(0f, root_child0_child0_child0.getLayoutY(), 0.0f);
|
||||
assertEquals(1080f, root_child0_child0_child0.getLayoutWidth(), 0.0f);
|
||||
assertEquals(144f, root_child0_child0_child0.getLayoutHeight(), 0.0f);
|
||||
|
||||
assertEquals(0f, root_child0_child0_child0_child0.getLayoutX(), 0.0f);
|
||||
assertEquals(24f, root_child0_child0_child0_child0.getLayoutY(), 0.0f);
|
||||
assertEquals(1044f, root_child0_child0_child0_child0.getLayoutWidth(), 0.0f);
|
||||
assertEquals(120f, root_child0_child0_child0_child0.getLayoutHeight(), 0.0f);
|
||||
|
||||
assertEquals(924f, root_child0_child0_child0_child0_child0.getLayoutX(), 0.0f);
|
||||
assertEquals(0f, root_child0_child0_child0_child0_child0.getLayoutY(), 0.0f);
|
||||
assertEquals(120f, root_child0_child0_child0_child0_child0.getLayoutWidth(), 0.0f);
|
||||
assertEquals(120f, root_child0_child0_child0_child0_child0.getLayoutHeight(), 0.0f);
|
||||
|
||||
assertEquals(0f, root_child0_child0_child0_child0_child0_child0.getLayoutX(), 0.0f);
|
||||
assertEquals(0f, root_child0_child0_child0_child0_child0_child0.getLayoutY(), 0.0f);
|
||||
assertEquals(120f, root_child0_child0_child0_child0_child0_child0.getLayoutWidth(), 0.0f);
|
||||
assertEquals(120f, root_child0_child0_child0_child0_child0_child0.getLayoutHeight(), 0.0f);
|
||||
|
||||
assertEquals(816f, root_child0_child0_child0_child0_child1.getLayoutX(), 0.0f);
|
||||
assertEquals(0f, root_child0_child0_child0_child0_child1.getLayoutY(), 0.0f);
|
||||
assertEquals(72f, root_child0_child0_child0_child0_child1.getLayoutWidth(), 0.0f);
|
||||
assertEquals(39f, root_child0_child0_child0_child0_child1.getLayoutHeight(), 0.0f);
|
||||
|
||||
assertEquals(36f, root_child0_child0_child0_child0_child1_child0.getLayoutX(), 0.0f);
|
||||
assertEquals(21f, root_child0_child0_child0_child0_child1_child0.getLayoutY(), 0.0f);
|
||||
assertEquals(0f, root_child0_child0_child0_child0_child1_child0.getLayoutWidth(), 0.0f);
|
||||
assertEquals(0f, root_child0_child0_child0_child0_child1_child0.getLayoutHeight(), 0.0f);
|
||||
|
||||
assertEquals(36f, root_child0_child0_child0_child0_child1_child1.getLayoutX(), 0.0f);
|
||||
assertEquals(21f, root_child0_child0_child0_child0_child1_child1.getLayoutY(), 0.0f);
|
||||
assertEquals(0f, root_child0_child0_child0_child0_child1_child1.getLayoutWidth(), 0.0f);
|
||||
assertEquals(0f, root_child0_child0_child0_child0_child1_child1.getLayoutHeight(), 0.0f);
|
||||
|
||||
assertEquals(0f, root_child0_child0_child1.getLayoutX(), 0.0f);
|
||||
assertEquals(144f, root_child0_child0_child1.getLayoutY(), 0.0f);
|
||||
assertEquals(1080f, root_child0_child0_child1.getLayoutWidth(), 0.0f);
|
||||
assertEquals(96f, root_child0_child0_child1.getLayoutHeight(), 0.0f);
|
||||
|
||||
assertEquals(0f, root_child0_child0_child1_child0.getLayoutX(), 0.0f);
|
||||
assertEquals(24f, root_child0_child0_child1_child0.getLayoutY(), 0.0f);
|
||||
assertEquals(906f, root_child0_child0_child1_child0.getLayoutWidth(), 0.0f);
|
||||
assertEquals(72f, root_child0_child0_child1_child0.getLayoutHeight(), 0.0f);
|
||||
|
||||
assertEquals(834f, root_child0_child0_child1_child0_child0.getLayoutX(), 0.0f);
|
||||
assertEquals(0f, root_child0_child0_child1_child0_child0.getLayoutY(), 0.0f);
|
||||
assertEquals(72f, root_child0_child0_child1_child0_child0.getLayoutWidth(), 0.0f);
|
||||
assertEquals(72f, root_child0_child0_child1_child0_child0.getLayoutHeight(), 0.0f);
|
||||
|
||||
assertEquals(0f, root_child0_child0_child1_child0_child0_child0.getLayoutX(), 0.0f);
|
||||
assertEquals(0f, root_child0_child0_child1_child0_child0_child0.getLayoutY(), 0.0f);
|
||||
assertEquals(72f, root_child0_child0_child1_child0_child0_child0.getLayoutWidth(), 0.0f);
|
||||
assertEquals(72f, root_child0_child0_child1_child0_child0_child0.getLayoutHeight(), 0.0f);
|
||||
|
||||
assertEquals(726f, root_child0_child0_child1_child0_child1.getLayoutX(), 0.0f);
|
||||
assertEquals(0f, root_child0_child0_child1_child0_child1.getLayoutY(), 0.0f);
|
||||
assertEquals(72f, root_child0_child0_child1_child0_child1.getLayoutWidth(), 0.0f);
|
||||
assertEquals(39f, root_child0_child0_child1_child0_child1.getLayoutHeight(), 0.0f);
|
||||
|
||||
assertEquals(36f, root_child0_child0_child1_child0_child1_child0.getLayoutX(), 0.0f);
|
||||
assertEquals(21f, root_child0_child0_child1_child0_child1_child0.getLayoutY(), 0.0f);
|
||||
assertEquals(0f, root_child0_child0_child1_child0_child1_child0.getLayoutWidth(), 0.0f);
|
||||
assertEquals(0f, root_child0_child0_child1_child0_child1_child0.getLayoutHeight(), 0.0f);
|
||||
|
||||
assertEquals(36f, root_child0_child0_child1_child0_child1_child1.getLayoutX(), 0.0f);
|
||||
assertEquals(21f, root_child0_child0_child1_child0_child1_child1.getLayoutY(), 0.0f);
|
||||
assertEquals(0f, root_child0_child0_child1_child0_child1_child1.getLayoutWidth(), 0.0f);
|
||||
assertEquals(0f, root_child0_child0_child1_child0_child1_child1.getLayoutHeight(), 0.0f);
|
||||
}
|
||||
}
|
296
javascript/tests/Facebook.Yoga/YGAndroidNewsFeed.js
Normal file
296
javascript/tests/Facebook.Yoga/YGAndroidNewsFeed.js
Normal file
@@ -0,0 +1,296 @@
|
||||
/**
|
||||
* Copyright (c) 2014-present, Facebook, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This source code is licensed under the BSD-style license found in the
|
||||
* LICENSE file in the root directory of this source tree. An additional grant
|
||||
* of patent rights can be found in the PATENTS file in the same directory.
|
||||
*/
|
||||
|
||||
// @Generated by gentest/gentest.rb from gentest/fixtures/YGAndroidNewsFeed.html
|
||||
|
||||
var Yoga = Yoga || require("../../sources/entry-" + process.env.TEST_ENTRY);
|
||||
|
||||
it("android_news_feed", function () {
|
||||
var config = Yoga.Config.create();
|
||||
|
||||
try {
|
||||
var root = Yoga.Node.create(config);
|
||||
root.setAlignContent(Yoga.ALIGN_STRETCH);
|
||||
root.setWidth(1080);
|
||||
|
||||
var root_child0 = Yoga.Node.create(config);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
var root_child0_child0 = Yoga.Node.create(config);
|
||||
root_child0_child0.setAlignContent(Yoga.ALIGN_STRETCH);
|
||||
root_child0.insertChild(root_child0_child0, 0);
|
||||
|
||||
var root_child0_child0_child0 = Yoga.Node.create(config);
|
||||
root_child0_child0_child0.setAlignContent(Yoga.ALIGN_STRETCH);
|
||||
root_child0_child0.insertChild(root_child0_child0_child0, 0);
|
||||
|
||||
var root_child0_child0_child0_child0 = Yoga.Node.create(config);
|
||||
root_child0_child0_child0_child0.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
|
||||
root_child0_child0_child0_child0.setAlignContent(Yoga.ALIGN_STRETCH);
|
||||
root_child0_child0_child0_child0.setAlignItems(Yoga.ALIGN_FLEX_START);
|
||||
root_child0_child0_child0_child0.setMargin(Yoga.EDGE_START, 36);
|
||||
root_child0_child0_child0_child0.setMargin(Yoga.EDGE_TOP, 24);
|
||||
root_child0_child0_child0.insertChild(root_child0_child0_child0_child0, 0);
|
||||
|
||||
var root_child0_child0_child0_child0_child0 = Yoga.Node.create(config);
|
||||
root_child0_child0_child0_child0_child0.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
|
||||
root_child0_child0_child0_child0_child0.setAlignContent(Yoga.ALIGN_STRETCH);
|
||||
root_child0_child0_child0_child0.insertChild(root_child0_child0_child0_child0_child0, 0);
|
||||
|
||||
var root_child0_child0_child0_child0_child0_child0 = Yoga.Node.create(config);
|
||||
root_child0_child0_child0_child0_child0_child0.setAlignContent(Yoga.ALIGN_STRETCH);
|
||||
root_child0_child0_child0_child0_child0_child0.setWidth(120);
|
||||
root_child0_child0_child0_child0_child0_child0.setHeight(120);
|
||||
root_child0_child0_child0_child0_child0.insertChild(root_child0_child0_child0_child0_child0_child0, 0);
|
||||
|
||||
var root_child0_child0_child0_child0_child1 = Yoga.Node.create(config);
|
||||
root_child0_child0_child0_child0_child1.setAlignContent(Yoga.ALIGN_STRETCH);
|
||||
root_child0_child0_child0_child0_child1.setFlexShrink(1);
|
||||
root_child0_child0_child0_child0_child1.setMargin(Yoga.EDGE_RIGHT, 36);
|
||||
root_child0_child0_child0_child0_child1.setPadding(Yoga.EDGE_LEFT, 36);
|
||||
root_child0_child0_child0_child0_child1.setPadding(Yoga.EDGE_TOP, 21);
|
||||
root_child0_child0_child0_child0_child1.setPadding(Yoga.EDGE_RIGHT, 36);
|
||||
root_child0_child0_child0_child0_child1.setPadding(Yoga.EDGE_BOTTOM, 18);
|
||||
root_child0_child0_child0_child0.insertChild(root_child0_child0_child0_child0_child1, 1);
|
||||
|
||||
var root_child0_child0_child0_child0_child1_child0 = Yoga.Node.create(config);
|
||||
root_child0_child0_child0_child0_child1_child0.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
|
||||
root_child0_child0_child0_child0_child1_child0.setAlignContent(Yoga.ALIGN_STRETCH);
|
||||
root_child0_child0_child0_child0_child1_child0.setFlexShrink(1);
|
||||
root_child0_child0_child0_child0_child1.insertChild(root_child0_child0_child0_child0_child1_child0, 0);
|
||||
|
||||
var root_child0_child0_child0_child0_child1_child1 = Yoga.Node.create(config);
|
||||
root_child0_child0_child0_child0_child1_child1.setAlignContent(Yoga.ALIGN_STRETCH);
|
||||
root_child0_child0_child0_child0_child1_child1.setFlexShrink(1);
|
||||
root_child0_child0_child0_child0_child1.insertChild(root_child0_child0_child0_child0_child1_child1, 1);
|
||||
|
||||
var root_child0_child0_child1 = Yoga.Node.create(config);
|
||||
root_child0_child0_child1.setAlignContent(Yoga.ALIGN_STRETCH);
|
||||
root_child0_child0.insertChild(root_child0_child0_child1, 1);
|
||||
|
||||
var root_child0_child0_child1_child0 = Yoga.Node.create(config);
|
||||
root_child0_child0_child1_child0.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
|
||||
root_child0_child0_child1_child0.setAlignContent(Yoga.ALIGN_STRETCH);
|
||||
root_child0_child0_child1_child0.setAlignItems(Yoga.ALIGN_FLEX_START);
|
||||
root_child0_child0_child1_child0.setMargin(Yoga.EDGE_START, 174);
|
||||
root_child0_child0_child1_child0.setMargin(Yoga.EDGE_TOP, 24);
|
||||
root_child0_child0_child1.insertChild(root_child0_child0_child1_child0, 0);
|
||||
|
||||
var root_child0_child0_child1_child0_child0 = Yoga.Node.create(config);
|
||||
root_child0_child0_child1_child0_child0.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
|
||||
root_child0_child0_child1_child0_child0.setAlignContent(Yoga.ALIGN_STRETCH);
|
||||
root_child0_child0_child1_child0.insertChild(root_child0_child0_child1_child0_child0, 0);
|
||||
|
||||
var root_child0_child0_child1_child0_child0_child0 = Yoga.Node.create(config);
|
||||
root_child0_child0_child1_child0_child0_child0.setAlignContent(Yoga.ALIGN_STRETCH);
|
||||
root_child0_child0_child1_child0_child0_child0.setWidth(72);
|
||||
root_child0_child0_child1_child0_child0_child0.setHeight(72);
|
||||
root_child0_child0_child1_child0_child0.insertChild(root_child0_child0_child1_child0_child0_child0, 0);
|
||||
|
||||
var root_child0_child0_child1_child0_child1 = Yoga.Node.create(config);
|
||||
root_child0_child0_child1_child0_child1.setAlignContent(Yoga.ALIGN_STRETCH);
|
||||
root_child0_child0_child1_child0_child1.setFlexShrink(1);
|
||||
root_child0_child0_child1_child0_child1.setMargin(Yoga.EDGE_RIGHT, 36);
|
||||
root_child0_child0_child1_child0_child1.setPadding(Yoga.EDGE_LEFT, 36);
|
||||
root_child0_child0_child1_child0_child1.setPadding(Yoga.EDGE_TOP, 21);
|
||||
root_child0_child0_child1_child0_child1.setPadding(Yoga.EDGE_RIGHT, 36);
|
||||
root_child0_child0_child1_child0_child1.setPadding(Yoga.EDGE_BOTTOM, 18);
|
||||
root_child0_child0_child1_child0.insertChild(root_child0_child0_child1_child0_child1, 1);
|
||||
|
||||
var root_child0_child0_child1_child0_child1_child0 = Yoga.Node.create(config);
|
||||
root_child0_child0_child1_child0_child1_child0.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
|
||||
root_child0_child0_child1_child0_child1_child0.setAlignContent(Yoga.ALIGN_STRETCH);
|
||||
root_child0_child0_child1_child0_child1_child0.setFlexShrink(1);
|
||||
root_child0_child0_child1_child0_child1.insertChild(root_child0_child0_child1_child0_child1_child0, 0);
|
||||
|
||||
var root_child0_child0_child1_child0_child1_child1 = Yoga.Node.create(config);
|
||||
root_child0_child0_child1_child0_child1_child1.setAlignContent(Yoga.ALIGN_STRETCH);
|
||||
root_child0_child0_child1_child0_child1_child1.setFlexShrink(1);
|
||||
root_child0_child0_child1_child0_child1.insertChild(root_child0_child0_child1_child0_child1_child1, 1);
|
||||
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
|
||||
|
||||
console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")");
|
||||
console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
|
||||
console.assert(1080 === root.getComputedWidth(), "1080 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
|
||||
console.assert(240 === root.getComputedHeight(), "240 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
|
||||
|
||||
console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
|
||||
console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
|
||||
console.assert(1080 === root_child0.getComputedWidth(), "1080 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
|
||||
console.assert(240 === root_child0.getComputedHeight(), "240 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
|
||||
|
||||
console.assert(0 === root_child0_child0.getComputedLeft(), "0 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")");
|
||||
console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")");
|
||||
console.assert(1080 === root_child0_child0.getComputedWidth(), "1080 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")");
|
||||
console.assert(240 === root_child0_child0.getComputedHeight(), "240 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")");
|
||||
|
||||
console.assert(0 === root_child0_child0_child0.getComputedLeft(), "0 === root_child0_child0_child0.getComputedLeft() (" + root_child0_child0_child0.getComputedLeft() + ")");
|
||||
console.assert(0 === root_child0_child0_child0.getComputedTop(), "0 === root_child0_child0_child0.getComputedTop() (" + root_child0_child0_child0.getComputedTop() + ")");
|
||||
console.assert(1080 === root_child0_child0_child0.getComputedWidth(), "1080 === root_child0_child0_child0.getComputedWidth() (" + root_child0_child0_child0.getComputedWidth() + ")");
|
||||
console.assert(144 === root_child0_child0_child0.getComputedHeight(), "144 === root_child0_child0_child0.getComputedHeight() (" + root_child0_child0_child0.getComputedHeight() + ")");
|
||||
|
||||
console.assert(36 === root_child0_child0_child0_child0.getComputedLeft(), "36 === root_child0_child0_child0_child0.getComputedLeft() (" + root_child0_child0_child0_child0.getComputedLeft() + ")");
|
||||
console.assert(24 === root_child0_child0_child0_child0.getComputedTop(), "24 === root_child0_child0_child0_child0.getComputedTop() (" + root_child0_child0_child0_child0.getComputedTop() + ")");
|
||||
console.assert(1044 === root_child0_child0_child0_child0.getComputedWidth(), "1044 === root_child0_child0_child0_child0.getComputedWidth() (" + root_child0_child0_child0_child0.getComputedWidth() + ")");
|
||||
console.assert(120 === root_child0_child0_child0_child0.getComputedHeight(), "120 === root_child0_child0_child0_child0.getComputedHeight() (" + root_child0_child0_child0_child0.getComputedHeight() + ")");
|
||||
|
||||
console.assert(0 === root_child0_child0_child0_child0_child0.getComputedLeft(), "0 === root_child0_child0_child0_child0_child0.getComputedLeft() (" + root_child0_child0_child0_child0_child0.getComputedLeft() + ")");
|
||||
console.assert(0 === root_child0_child0_child0_child0_child0.getComputedTop(), "0 === root_child0_child0_child0_child0_child0.getComputedTop() (" + root_child0_child0_child0_child0_child0.getComputedTop() + ")");
|
||||
console.assert(120 === root_child0_child0_child0_child0_child0.getComputedWidth(), "120 === root_child0_child0_child0_child0_child0.getComputedWidth() (" + root_child0_child0_child0_child0_child0.getComputedWidth() + ")");
|
||||
console.assert(120 === root_child0_child0_child0_child0_child0.getComputedHeight(), "120 === root_child0_child0_child0_child0_child0.getComputedHeight() (" + root_child0_child0_child0_child0_child0.getComputedHeight() + ")");
|
||||
|
||||
console.assert(0 === root_child0_child0_child0_child0_child0_child0.getComputedLeft(), "0 === root_child0_child0_child0_child0_child0_child0.getComputedLeft() (" + root_child0_child0_child0_child0_child0_child0.getComputedLeft() + ")");
|
||||
console.assert(0 === root_child0_child0_child0_child0_child0_child0.getComputedTop(), "0 === root_child0_child0_child0_child0_child0_child0.getComputedTop() (" + root_child0_child0_child0_child0_child0_child0.getComputedTop() + ")");
|
||||
console.assert(120 === root_child0_child0_child0_child0_child0_child0.getComputedWidth(), "120 === root_child0_child0_child0_child0_child0_child0.getComputedWidth() (" + root_child0_child0_child0_child0_child0_child0.getComputedWidth() + ")");
|
||||
console.assert(120 === root_child0_child0_child0_child0_child0_child0.getComputedHeight(), "120 === root_child0_child0_child0_child0_child0_child0.getComputedHeight() (" + root_child0_child0_child0_child0_child0_child0.getComputedHeight() + ")");
|
||||
|
||||
console.assert(120 === root_child0_child0_child0_child0_child1.getComputedLeft(), "120 === root_child0_child0_child0_child0_child1.getComputedLeft() (" + root_child0_child0_child0_child0_child1.getComputedLeft() + ")");
|
||||
console.assert(0 === root_child0_child0_child0_child0_child1.getComputedTop(), "0 === root_child0_child0_child0_child0_child1.getComputedTop() (" + root_child0_child0_child0_child0_child1.getComputedTop() + ")");
|
||||
console.assert(72 === root_child0_child0_child0_child0_child1.getComputedWidth(), "72 === root_child0_child0_child0_child0_child1.getComputedWidth() (" + root_child0_child0_child0_child0_child1.getComputedWidth() + ")");
|
||||
console.assert(39 === root_child0_child0_child0_child0_child1.getComputedHeight(), "39 === root_child0_child0_child0_child0_child1.getComputedHeight() (" + root_child0_child0_child0_child0_child1.getComputedHeight() + ")");
|
||||
|
||||
console.assert(36 === root_child0_child0_child0_child0_child1_child0.getComputedLeft(), "36 === root_child0_child0_child0_child0_child1_child0.getComputedLeft() (" + root_child0_child0_child0_child0_child1_child0.getComputedLeft() + ")");
|
||||
console.assert(21 === root_child0_child0_child0_child0_child1_child0.getComputedTop(), "21 === root_child0_child0_child0_child0_child1_child0.getComputedTop() (" + root_child0_child0_child0_child0_child1_child0.getComputedTop() + ")");
|
||||
console.assert(0 === root_child0_child0_child0_child0_child1_child0.getComputedWidth(), "0 === root_child0_child0_child0_child0_child1_child0.getComputedWidth() (" + root_child0_child0_child0_child0_child1_child0.getComputedWidth() + ")");
|
||||
console.assert(0 === root_child0_child0_child0_child0_child1_child0.getComputedHeight(), "0 === root_child0_child0_child0_child0_child1_child0.getComputedHeight() (" + root_child0_child0_child0_child0_child1_child0.getComputedHeight() + ")");
|
||||
|
||||
console.assert(36 === root_child0_child0_child0_child0_child1_child1.getComputedLeft(), "36 === root_child0_child0_child0_child0_child1_child1.getComputedLeft() (" + root_child0_child0_child0_child0_child1_child1.getComputedLeft() + ")");
|
||||
console.assert(21 === root_child0_child0_child0_child0_child1_child1.getComputedTop(), "21 === root_child0_child0_child0_child0_child1_child1.getComputedTop() (" + root_child0_child0_child0_child0_child1_child1.getComputedTop() + ")");
|
||||
console.assert(0 === root_child0_child0_child0_child0_child1_child1.getComputedWidth(), "0 === root_child0_child0_child0_child0_child1_child1.getComputedWidth() (" + root_child0_child0_child0_child0_child1_child1.getComputedWidth() + ")");
|
||||
console.assert(0 === root_child0_child0_child0_child0_child1_child1.getComputedHeight(), "0 === root_child0_child0_child0_child0_child1_child1.getComputedHeight() (" + root_child0_child0_child0_child0_child1_child1.getComputedHeight() + ")");
|
||||
|
||||
console.assert(0 === root_child0_child0_child1.getComputedLeft(), "0 === root_child0_child0_child1.getComputedLeft() (" + root_child0_child0_child1.getComputedLeft() + ")");
|
||||
console.assert(144 === root_child0_child0_child1.getComputedTop(), "144 === root_child0_child0_child1.getComputedTop() (" + root_child0_child0_child1.getComputedTop() + ")");
|
||||
console.assert(1080 === root_child0_child0_child1.getComputedWidth(), "1080 === root_child0_child0_child1.getComputedWidth() (" + root_child0_child0_child1.getComputedWidth() + ")");
|
||||
console.assert(96 === root_child0_child0_child1.getComputedHeight(), "96 === root_child0_child0_child1.getComputedHeight() (" + root_child0_child0_child1.getComputedHeight() + ")");
|
||||
|
||||
console.assert(174 === root_child0_child0_child1_child0.getComputedLeft(), "174 === root_child0_child0_child1_child0.getComputedLeft() (" + root_child0_child0_child1_child0.getComputedLeft() + ")");
|
||||
console.assert(24 === root_child0_child0_child1_child0.getComputedTop(), "24 === root_child0_child0_child1_child0.getComputedTop() (" + root_child0_child0_child1_child0.getComputedTop() + ")");
|
||||
console.assert(906 === root_child0_child0_child1_child0.getComputedWidth(), "906 === root_child0_child0_child1_child0.getComputedWidth() (" + root_child0_child0_child1_child0.getComputedWidth() + ")");
|
||||
console.assert(72 === root_child0_child0_child1_child0.getComputedHeight(), "72 === root_child0_child0_child1_child0.getComputedHeight() (" + root_child0_child0_child1_child0.getComputedHeight() + ")");
|
||||
|
||||
console.assert(0 === root_child0_child0_child1_child0_child0.getComputedLeft(), "0 === root_child0_child0_child1_child0_child0.getComputedLeft() (" + root_child0_child0_child1_child0_child0.getComputedLeft() + ")");
|
||||
console.assert(0 === root_child0_child0_child1_child0_child0.getComputedTop(), "0 === root_child0_child0_child1_child0_child0.getComputedTop() (" + root_child0_child0_child1_child0_child0.getComputedTop() + ")");
|
||||
console.assert(72 === root_child0_child0_child1_child0_child0.getComputedWidth(), "72 === root_child0_child0_child1_child0_child0.getComputedWidth() (" + root_child0_child0_child1_child0_child0.getComputedWidth() + ")");
|
||||
console.assert(72 === root_child0_child0_child1_child0_child0.getComputedHeight(), "72 === root_child0_child0_child1_child0_child0.getComputedHeight() (" + root_child0_child0_child1_child0_child0.getComputedHeight() + ")");
|
||||
|
||||
console.assert(0 === root_child0_child0_child1_child0_child0_child0.getComputedLeft(), "0 === root_child0_child0_child1_child0_child0_child0.getComputedLeft() (" + root_child0_child0_child1_child0_child0_child0.getComputedLeft() + ")");
|
||||
console.assert(0 === root_child0_child0_child1_child0_child0_child0.getComputedTop(), "0 === root_child0_child0_child1_child0_child0_child0.getComputedTop() (" + root_child0_child0_child1_child0_child0_child0.getComputedTop() + ")");
|
||||
console.assert(72 === root_child0_child0_child1_child0_child0_child0.getComputedWidth(), "72 === root_child0_child0_child1_child0_child0_child0.getComputedWidth() (" + root_child0_child0_child1_child0_child0_child0.getComputedWidth() + ")");
|
||||
console.assert(72 === root_child0_child0_child1_child0_child0_child0.getComputedHeight(), "72 === root_child0_child0_child1_child0_child0_child0.getComputedHeight() (" + root_child0_child0_child1_child0_child0_child0.getComputedHeight() + ")");
|
||||
|
||||
console.assert(72 === root_child0_child0_child1_child0_child1.getComputedLeft(), "72 === root_child0_child0_child1_child0_child1.getComputedLeft() (" + root_child0_child0_child1_child0_child1.getComputedLeft() + ")");
|
||||
console.assert(0 === root_child0_child0_child1_child0_child1.getComputedTop(), "0 === root_child0_child0_child1_child0_child1.getComputedTop() (" + root_child0_child0_child1_child0_child1.getComputedTop() + ")");
|
||||
console.assert(72 === root_child0_child0_child1_child0_child1.getComputedWidth(), "72 === root_child0_child0_child1_child0_child1.getComputedWidth() (" + root_child0_child0_child1_child0_child1.getComputedWidth() + ")");
|
||||
console.assert(39 === root_child0_child0_child1_child0_child1.getComputedHeight(), "39 === root_child0_child0_child1_child0_child1.getComputedHeight() (" + root_child0_child0_child1_child0_child1.getComputedHeight() + ")");
|
||||
|
||||
console.assert(36 === root_child0_child0_child1_child0_child1_child0.getComputedLeft(), "36 === root_child0_child0_child1_child0_child1_child0.getComputedLeft() (" + root_child0_child0_child1_child0_child1_child0.getComputedLeft() + ")");
|
||||
console.assert(21 === root_child0_child0_child1_child0_child1_child0.getComputedTop(), "21 === root_child0_child0_child1_child0_child1_child0.getComputedTop() (" + root_child0_child0_child1_child0_child1_child0.getComputedTop() + ")");
|
||||
console.assert(0 === root_child0_child0_child1_child0_child1_child0.getComputedWidth(), "0 === root_child0_child0_child1_child0_child1_child0.getComputedWidth() (" + root_child0_child0_child1_child0_child1_child0.getComputedWidth() + ")");
|
||||
console.assert(0 === root_child0_child0_child1_child0_child1_child0.getComputedHeight(), "0 === root_child0_child0_child1_child0_child1_child0.getComputedHeight() (" + root_child0_child0_child1_child0_child1_child0.getComputedHeight() + ")");
|
||||
|
||||
console.assert(36 === root_child0_child0_child1_child0_child1_child1.getComputedLeft(), "36 === root_child0_child0_child1_child0_child1_child1.getComputedLeft() (" + root_child0_child0_child1_child0_child1_child1.getComputedLeft() + ")");
|
||||
console.assert(21 === root_child0_child0_child1_child0_child1_child1.getComputedTop(), "21 === root_child0_child0_child1_child0_child1_child1.getComputedTop() (" + root_child0_child0_child1_child0_child1_child1.getComputedTop() + ")");
|
||||
console.assert(0 === root_child0_child0_child1_child0_child1_child1.getComputedWidth(), "0 === root_child0_child0_child1_child0_child1_child1.getComputedWidth() (" + root_child0_child0_child1_child0_child1_child1.getComputedWidth() + ")");
|
||||
console.assert(0 === root_child0_child0_child1_child0_child1_child1.getComputedHeight(), "0 === root_child0_child0_child1_child0_child1_child1.getComputedHeight() (" + root_child0_child0_child1_child0_child1_child1.getComputedHeight() + ")");
|
||||
|
||||
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);
|
||||
|
||||
console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")");
|
||||
console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");
|
||||
console.assert(1080 === root.getComputedWidth(), "1080 === root.getComputedWidth() (" + root.getComputedWidth() + ")");
|
||||
console.assert(240 === root.getComputedHeight(), "240 === root.getComputedHeight() (" + root.getComputedHeight() + ")");
|
||||
|
||||
console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");
|
||||
console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");
|
||||
console.assert(1080 === root_child0.getComputedWidth(), "1080 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");
|
||||
console.assert(240 === root_child0.getComputedHeight(), "240 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");
|
||||
|
||||
console.assert(0 === root_child0_child0.getComputedLeft(), "0 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")");
|
||||
console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")");
|
||||
console.assert(1080 === root_child0_child0.getComputedWidth(), "1080 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")");
|
||||
console.assert(240 === root_child0_child0.getComputedHeight(), "240 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")");
|
||||
|
||||
console.assert(0 === root_child0_child0_child0.getComputedLeft(), "0 === root_child0_child0_child0.getComputedLeft() (" + root_child0_child0_child0.getComputedLeft() + ")");
|
||||
console.assert(0 === root_child0_child0_child0.getComputedTop(), "0 === root_child0_child0_child0.getComputedTop() (" + root_child0_child0_child0.getComputedTop() + ")");
|
||||
console.assert(1080 === root_child0_child0_child0.getComputedWidth(), "1080 === root_child0_child0_child0.getComputedWidth() (" + root_child0_child0_child0.getComputedWidth() + ")");
|
||||
console.assert(144 === root_child0_child0_child0.getComputedHeight(), "144 === root_child0_child0_child0.getComputedHeight() (" + root_child0_child0_child0.getComputedHeight() + ")");
|
||||
|
||||
console.assert(0 === root_child0_child0_child0_child0.getComputedLeft(), "0 === root_child0_child0_child0_child0.getComputedLeft() (" + root_child0_child0_child0_child0.getComputedLeft() + ")");
|
||||
console.assert(24 === root_child0_child0_child0_child0.getComputedTop(), "24 === root_child0_child0_child0_child0.getComputedTop() (" + root_child0_child0_child0_child0.getComputedTop() + ")");
|
||||
console.assert(1044 === root_child0_child0_child0_child0.getComputedWidth(), "1044 === root_child0_child0_child0_child0.getComputedWidth() (" + root_child0_child0_child0_child0.getComputedWidth() + ")");
|
||||
console.assert(120 === root_child0_child0_child0_child0.getComputedHeight(), "120 === root_child0_child0_child0_child0.getComputedHeight() (" + root_child0_child0_child0_child0.getComputedHeight() + ")");
|
||||
|
||||
console.assert(924 === root_child0_child0_child0_child0_child0.getComputedLeft(), "924 === root_child0_child0_child0_child0_child0.getComputedLeft() (" + root_child0_child0_child0_child0_child0.getComputedLeft() + ")");
|
||||
console.assert(0 === root_child0_child0_child0_child0_child0.getComputedTop(), "0 === root_child0_child0_child0_child0_child0.getComputedTop() (" + root_child0_child0_child0_child0_child0.getComputedTop() + ")");
|
||||
console.assert(120 === root_child0_child0_child0_child0_child0.getComputedWidth(), "120 === root_child0_child0_child0_child0_child0.getComputedWidth() (" + root_child0_child0_child0_child0_child0.getComputedWidth() + ")");
|
||||
console.assert(120 === root_child0_child0_child0_child0_child0.getComputedHeight(), "120 === root_child0_child0_child0_child0_child0.getComputedHeight() (" + root_child0_child0_child0_child0_child0.getComputedHeight() + ")");
|
||||
|
||||
console.assert(0 === root_child0_child0_child0_child0_child0_child0.getComputedLeft(), "0 === root_child0_child0_child0_child0_child0_child0.getComputedLeft() (" + root_child0_child0_child0_child0_child0_child0.getComputedLeft() + ")");
|
||||
console.assert(0 === root_child0_child0_child0_child0_child0_child0.getComputedTop(), "0 === root_child0_child0_child0_child0_child0_child0.getComputedTop() (" + root_child0_child0_child0_child0_child0_child0.getComputedTop() + ")");
|
||||
console.assert(120 === root_child0_child0_child0_child0_child0_child0.getComputedWidth(), "120 === root_child0_child0_child0_child0_child0_child0.getComputedWidth() (" + root_child0_child0_child0_child0_child0_child0.getComputedWidth() + ")");
|
||||
console.assert(120 === root_child0_child0_child0_child0_child0_child0.getComputedHeight(), "120 === root_child0_child0_child0_child0_child0_child0.getComputedHeight() (" + root_child0_child0_child0_child0_child0_child0.getComputedHeight() + ")");
|
||||
|
||||
console.assert(816 === root_child0_child0_child0_child0_child1.getComputedLeft(), "816 === root_child0_child0_child0_child0_child1.getComputedLeft() (" + root_child0_child0_child0_child0_child1.getComputedLeft() + ")");
|
||||
console.assert(0 === root_child0_child0_child0_child0_child1.getComputedTop(), "0 === root_child0_child0_child0_child0_child1.getComputedTop() (" + root_child0_child0_child0_child0_child1.getComputedTop() + ")");
|
||||
console.assert(72 === root_child0_child0_child0_child0_child1.getComputedWidth(), "72 === root_child0_child0_child0_child0_child1.getComputedWidth() (" + root_child0_child0_child0_child0_child1.getComputedWidth() + ")");
|
||||
console.assert(39 === root_child0_child0_child0_child0_child1.getComputedHeight(), "39 === root_child0_child0_child0_child0_child1.getComputedHeight() (" + root_child0_child0_child0_child0_child1.getComputedHeight() + ")");
|
||||
|
||||
console.assert(36 === root_child0_child0_child0_child0_child1_child0.getComputedLeft(), "36 === root_child0_child0_child0_child0_child1_child0.getComputedLeft() (" + root_child0_child0_child0_child0_child1_child0.getComputedLeft() + ")");
|
||||
console.assert(21 === root_child0_child0_child0_child0_child1_child0.getComputedTop(), "21 === root_child0_child0_child0_child0_child1_child0.getComputedTop() (" + root_child0_child0_child0_child0_child1_child0.getComputedTop() + ")");
|
||||
console.assert(0 === root_child0_child0_child0_child0_child1_child0.getComputedWidth(), "0 === root_child0_child0_child0_child0_child1_child0.getComputedWidth() (" + root_child0_child0_child0_child0_child1_child0.getComputedWidth() + ")");
|
||||
console.assert(0 === root_child0_child0_child0_child0_child1_child0.getComputedHeight(), "0 === root_child0_child0_child0_child0_child1_child0.getComputedHeight() (" + root_child0_child0_child0_child0_child1_child0.getComputedHeight() + ")");
|
||||
|
||||
console.assert(36 === root_child0_child0_child0_child0_child1_child1.getComputedLeft(), "36 === root_child0_child0_child0_child0_child1_child1.getComputedLeft() (" + root_child0_child0_child0_child0_child1_child1.getComputedLeft() + ")");
|
||||
console.assert(21 === root_child0_child0_child0_child0_child1_child1.getComputedTop(), "21 === root_child0_child0_child0_child0_child1_child1.getComputedTop() (" + root_child0_child0_child0_child0_child1_child1.getComputedTop() + ")");
|
||||
console.assert(0 === root_child0_child0_child0_child0_child1_child1.getComputedWidth(), "0 === root_child0_child0_child0_child0_child1_child1.getComputedWidth() (" + root_child0_child0_child0_child0_child1_child1.getComputedWidth() + ")");
|
||||
console.assert(0 === root_child0_child0_child0_child0_child1_child1.getComputedHeight(), "0 === root_child0_child0_child0_child0_child1_child1.getComputedHeight() (" + root_child0_child0_child0_child0_child1_child1.getComputedHeight() + ")");
|
||||
|
||||
console.assert(0 === root_child0_child0_child1.getComputedLeft(), "0 === root_child0_child0_child1.getComputedLeft() (" + root_child0_child0_child1.getComputedLeft() + ")");
|
||||
console.assert(144 === root_child0_child0_child1.getComputedTop(), "144 === root_child0_child0_child1.getComputedTop() (" + root_child0_child0_child1.getComputedTop() + ")");
|
||||
console.assert(1080 === root_child0_child0_child1.getComputedWidth(), "1080 === root_child0_child0_child1.getComputedWidth() (" + root_child0_child0_child1.getComputedWidth() + ")");
|
||||
console.assert(96 === root_child0_child0_child1.getComputedHeight(), "96 === root_child0_child0_child1.getComputedHeight() (" + root_child0_child0_child1.getComputedHeight() + ")");
|
||||
|
||||
console.assert(0 === root_child0_child0_child1_child0.getComputedLeft(), "0 === root_child0_child0_child1_child0.getComputedLeft() (" + root_child0_child0_child1_child0.getComputedLeft() + ")");
|
||||
console.assert(24 === root_child0_child0_child1_child0.getComputedTop(), "24 === root_child0_child0_child1_child0.getComputedTop() (" + root_child0_child0_child1_child0.getComputedTop() + ")");
|
||||
console.assert(906 === root_child0_child0_child1_child0.getComputedWidth(), "906 === root_child0_child0_child1_child0.getComputedWidth() (" + root_child0_child0_child1_child0.getComputedWidth() + ")");
|
||||
console.assert(72 === root_child0_child0_child1_child0.getComputedHeight(), "72 === root_child0_child0_child1_child0.getComputedHeight() (" + root_child0_child0_child1_child0.getComputedHeight() + ")");
|
||||
|
||||
console.assert(834 === root_child0_child0_child1_child0_child0.getComputedLeft(), "834 === root_child0_child0_child1_child0_child0.getComputedLeft() (" + root_child0_child0_child1_child0_child0.getComputedLeft() + ")");
|
||||
console.assert(0 === root_child0_child0_child1_child0_child0.getComputedTop(), "0 === root_child0_child0_child1_child0_child0.getComputedTop() (" + root_child0_child0_child1_child0_child0.getComputedTop() + ")");
|
||||
console.assert(72 === root_child0_child0_child1_child0_child0.getComputedWidth(), "72 === root_child0_child0_child1_child0_child0.getComputedWidth() (" + root_child0_child0_child1_child0_child0.getComputedWidth() + ")");
|
||||
console.assert(72 === root_child0_child0_child1_child0_child0.getComputedHeight(), "72 === root_child0_child0_child1_child0_child0.getComputedHeight() (" + root_child0_child0_child1_child0_child0.getComputedHeight() + ")");
|
||||
|
||||
console.assert(0 === root_child0_child0_child1_child0_child0_child0.getComputedLeft(), "0 === root_child0_child0_child1_child0_child0_child0.getComputedLeft() (" + root_child0_child0_child1_child0_child0_child0.getComputedLeft() + ")");
|
||||
console.assert(0 === root_child0_child0_child1_child0_child0_child0.getComputedTop(), "0 === root_child0_child0_child1_child0_child0_child0.getComputedTop() (" + root_child0_child0_child1_child0_child0_child0.getComputedTop() + ")");
|
||||
console.assert(72 === root_child0_child0_child1_child0_child0_child0.getComputedWidth(), "72 === root_child0_child0_child1_child0_child0_child0.getComputedWidth() (" + root_child0_child0_child1_child0_child0_child0.getComputedWidth() + ")");
|
||||
console.assert(72 === root_child0_child0_child1_child0_child0_child0.getComputedHeight(), "72 === root_child0_child0_child1_child0_child0_child0.getComputedHeight() (" + root_child0_child0_child1_child0_child0_child0.getComputedHeight() + ")");
|
||||
|
||||
console.assert(726 === root_child0_child0_child1_child0_child1.getComputedLeft(), "726 === root_child0_child0_child1_child0_child1.getComputedLeft() (" + root_child0_child0_child1_child0_child1.getComputedLeft() + ")");
|
||||
console.assert(0 === root_child0_child0_child1_child0_child1.getComputedTop(), "0 === root_child0_child0_child1_child0_child1.getComputedTop() (" + root_child0_child0_child1_child0_child1.getComputedTop() + ")");
|
||||
console.assert(72 === root_child0_child0_child1_child0_child1.getComputedWidth(), "72 === root_child0_child0_child1_child0_child1.getComputedWidth() (" + root_child0_child0_child1_child0_child1.getComputedWidth() + ")");
|
||||
console.assert(39 === root_child0_child0_child1_child0_child1.getComputedHeight(), "39 === root_child0_child0_child1_child0_child1.getComputedHeight() (" + root_child0_child0_child1_child0_child1.getComputedHeight() + ")");
|
||||
|
||||
console.assert(36 === root_child0_child0_child1_child0_child1_child0.getComputedLeft(), "36 === root_child0_child0_child1_child0_child1_child0.getComputedLeft() (" + root_child0_child0_child1_child0_child1_child0.getComputedLeft() + ")");
|
||||
console.assert(21 === root_child0_child0_child1_child0_child1_child0.getComputedTop(), "21 === root_child0_child0_child1_child0_child1_child0.getComputedTop() (" + root_child0_child0_child1_child0_child1_child0.getComputedTop() + ")");
|
||||
console.assert(0 === root_child0_child0_child1_child0_child1_child0.getComputedWidth(), "0 === root_child0_child0_child1_child0_child1_child0.getComputedWidth() (" + root_child0_child0_child1_child0_child1_child0.getComputedWidth() + ")");
|
||||
console.assert(0 === root_child0_child0_child1_child0_child1_child0.getComputedHeight(), "0 === root_child0_child0_child1_child0_child1_child0.getComputedHeight() (" + root_child0_child0_child1_child0_child1_child0.getComputedHeight() + ")");
|
||||
|
||||
console.assert(36 === root_child0_child0_child1_child0_child1_child1.getComputedLeft(), "36 === root_child0_child0_child1_child0_child1_child1.getComputedLeft() (" + root_child0_child0_child1_child0_child1_child1.getComputedLeft() + ")");
|
||||
console.assert(21 === root_child0_child0_child1_child0_child1_child1.getComputedTop(), "21 === root_child0_child0_child1_child0_child1_child1.getComputedTop() (" + root_child0_child0_child1_child0_child1_child1.getComputedTop() + ")");
|
||||
console.assert(0 === root_child0_child0_child1_child0_child1_child1.getComputedWidth(), "0 === root_child0_child0_child1_child0_child1_child1.getComputedWidth() (" + root_child0_child0_child1_child0_child1_child1.getComputedWidth() + ")");
|
||||
console.assert(0 === root_child0_child0_child1_child0_child1_child1.getComputedHeight(), "0 === root_child0_child0_child1_child0_child1_child1.getComputedHeight() (" + root_child0_child0_child1_child0_child1_child1.getComputedHeight() + ")");
|
||||
} finally {
|
||||
if (typeof root !== "undefined") {
|
||||
root.freeRecursive();
|
||||
}
|
||||
|
||||
config.free();
|
||||
}
|
||||
});
|
447
tests/YGAndroidNewsFeed.cpp
Normal file
447
tests/YGAndroidNewsFeed.cpp
Normal file
@@ -0,0 +1,447 @@
|
||||
/**
|
||||
* Copyright (c) 2014-present, Facebook, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This source code is licensed under the BSD-style license found in the
|
||||
* LICENSE file in the root directory of this source tree. An additional grant
|
||||
* of patent rights can be found in the PATENTS file in the same directory.
|
||||
*/
|
||||
|
||||
// @Generated by gentest/gentest.rb from gentest/fixtures/YGAndroidNewsFeed.html
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
#include <yoga/Yoga.h>
|
||||
|
||||
TEST(YogaTest, android_news_feed) {
|
||||
const YGConfigRef config = YGConfigNew();
|
||||
|
||||
const YGNodeRef root = YGNodeNewWithConfig(config);
|
||||
YGNodeStyleSetAlignContent(root, YGAlignStretch);
|
||||
YGNodeStyleSetWidth(root, 1080);
|
||||
|
||||
const YGNodeRef root_child0 = YGNodeNewWithConfig(config);
|
||||
YGNodeInsertChild(root, root_child0, 0);
|
||||
|
||||
const YGNodeRef root_child0_child0 = YGNodeNewWithConfig(config);
|
||||
YGNodeStyleSetAlignContent(root_child0_child0, YGAlignStretch);
|
||||
YGNodeInsertChild(root_child0, root_child0_child0, 0);
|
||||
|
||||
const YGNodeRef root_child0_child0_child0 = YGNodeNewWithConfig(config);
|
||||
YGNodeStyleSetAlignContent(root_child0_child0_child0, YGAlignStretch);
|
||||
YGNodeInsertChild(root_child0_child0, root_child0_child0_child0, 0);
|
||||
|
||||
const YGNodeRef root_child0_child0_child0_child0 =
|
||||
YGNodeNewWithConfig(config);
|
||||
YGNodeStyleSetFlexDirection(
|
||||
root_child0_child0_child0_child0, YGFlexDirectionRow);
|
||||
YGNodeStyleSetAlignContent(root_child0_child0_child0_child0, YGAlignStretch);
|
||||
YGNodeStyleSetAlignItems(root_child0_child0_child0_child0, YGAlignFlexStart);
|
||||
YGNodeStyleSetMargin(root_child0_child0_child0_child0, YGEdgeStart, 36);
|
||||
YGNodeStyleSetMargin(root_child0_child0_child0_child0, YGEdgeTop, 24);
|
||||
YGNodeInsertChild(
|
||||
root_child0_child0_child0, root_child0_child0_child0_child0, 0);
|
||||
|
||||
const YGNodeRef root_child0_child0_child0_child0_child0 =
|
||||
YGNodeNewWithConfig(config);
|
||||
YGNodeStyleSetFlexDirection(
|
||||
root_child0_child0_child0_child0_child0, YGFlexDirectionRow);
|
||||
YGNodeStyleSetAlignContent(
|
||||
root_child0_child0_child0_child0_child0, YGAlignStretch);
|
||||
YGNodeInsertChild(
|
||||
root_child0_child0_child0_child0,
|
||||
root_child0_child0_child0_child0_child0,
|
||||
0);
|
||||
|
||||
const YGNodeRef root_child0_child0_child0_child0_child0_child0 =
|
||||
YGNodeNewWithConfig(config);
|
||||
YGNodeStyleSetAlignContent(
|
||||
root_child0_child0_child0_child0_child0_child0, YGAlignStretch);
|
||||
YGNodeStyleSetWidth(root_child0_child0_child0_child0_child0_child0, 120);
|
||||
YGNodeStyleSetHeight(root_child0_child0_child0_child0_child0_child0, 120);
|
||||
YGNodeInsertChild(
|
||||
root_child0_child0_child0_child0_child0,
|
||||
root_child0_child0_child0_child0_child0_child0,
|
||||
0);
|
||||
|
||||
const YGNodeRef root_child0_child0_child0_child0_child1 =
|
||||
YGNodeNewWithConfig(config);
|
||||
YGNodeStyleSetAlignContent(
|
||||
root_child0_child0_child0_child0_child1, YGAlignStretch);
|
||||
YGNodeStyleSetFlexShrink(root_child0_child0_child0_child0_child1, 1);
|
||||
YGNodeStyleSetMargin(
|
||||
root_child0_child0_child0_child0_child1, YGEdgeRight, 36);
|
||||
YGNodeStyleSetPadding(
|
||||
root_child0_child0_child0_child0_child1, YGEdgeLeft, 36);
|
||||
YGNodeStyleSetPadding(root_child0_child0_child0_child0_child1, YGEdgeTop, 21);
|
||||
YGNodeStyleSetPadding(
|
||||
root_child0_child0_child0_child0_child1, YGEdgeRight, 36);
|
||||
YGNodeStyleSetPadding(
|
||||
root_child0_child0_child0_child0_child1, YGEdgeBottom, 18);
|
||||
YGNodeInsertChild(
|
||||
root_child0_child0_child0_child0,
|
||||
root_child0_child0_child0_child0_child1,
|
||||
1);
|
||||
|
||||
const YGNodeRef root_child0_child0_child0_child0_child1_child0 =
|
||||
YGNodeNewWithConfig(config);
|
||||
YGNodeStyleSetFlexDirection(
|
||||
root_child0_child0_child0_child0_child1_child0, YGFlexDirectionRow);
|
||||
YGNodeStyleSetAlignContent(
|
||||
root_child0_child0_child0_child0_child1_child0, YGAlignStretch);
|
||||
YGNodeStyleSetFlexShrink(root_child0_child0_child0_child0_child1_child0, 1);
|
||||
YGNodeInsertChild(
|
||||
root_child0_child0_child0_child0_child1,
|
||||
root_child0_child0_child0_child0_child1_child0,
|
||||
0);
|
||||
|
||||
const YGNodeRef root_child0_child0_child0_child0_child1_child1 =
|
||||
YGNodeNewWithConfig(config);
|
||||
YGNodeStyleSetAlignContent(
|
||||
root_child0_child0_child0_child0_child1_child1, YGAlignStretch);
|
||||
YGNodeStyleSetFlexShrink(root_child0_child0_child0_child0_child1_child1, 1);
|
||||
YGNodeInsertChild(
|
||||
root_child0_child0_child0_child0_child1,
|
||||
root_child0_child0_child0_child0_child1_child1,
|
||||
1);
|
||||
|
||||
const YGNodeRef root_child0_child0_child1 = YGNodeNewWithConfig(config);
|
||||
YGNodeStyleSetAlignContent(root_child0_child0_child1, YGAlignStretch);
|
||||
YGNodeInsertChild(root_child0_child0, root_child0_child0_child1, 1);
|
||||
|
||||
const YGNodeRef root_child0_child0_child1_child0 =
|
||||
YGNodeNewWithConfig(config);
|
||||
YGNodeStyleSetFlexDirection(
|
||||
root_child0_child0_child1_child0, YGFlexDirectionRow);
|
||||
YGNodeStyleSetAlignContent(root_child0_child0_child1_child0, YGAlignStretch);
|
||||
YGNodeStyleSetAlignItems(root_child0_child0_child1_child0, YGAlignFlexStart);
|
||||
YGNodeStyleSetMargin(root_child0_child0_child1_child0, YGEdgeStart, 174);
|
||||
YGNodeStyleSetMargin(root_child0_child0_child1_child0, YGEdgeTop, 24);
|
||||
YGNodeInsertChild(
|
||||
root_child0_child0_child1, root_child0_child0_child1_child0, 0);
|
||||
|
||||
const YGNodeRef root_child0_child0_child1_child0_child0 =
|
||||
YGNodeNewWithConfig(config);
|
||||
YGNodeStyleSetFlexDirection(
|
||||
root_child0_child0_child1_child0_child0, YGFlexDirectionRow);
|
||||
YGNodeStyleSetAlignContent(
|
||||
root_child0_child0_child1_child0_child0, YGAlignStretch);
|
||||
YGNodeInsertChild(
|
||||
root_child0_child0_child1_child0,
|
||||
root_child0_child0_child1_child0_child0,
|
||||
0);
|
||||
|
||||
const YGNodeRef root_child0_child0_child1_child0_child0_child0 =
|
||||
YGNodeNewWithConfig(config);
|
||||
YGNodeStyleSetAlignContent(
|
||||
root_child0_child0_child1_child0_child0_child0, YGAlignStretch);
|
||||
YGNodeStyleSetWidth(root_child0_child0_child1_child0_child0_child0, 72);
|
||||
YGNodeStyleSetHeight(root_child0_child0_child1_child0_child0_child0, 72);
|
||||
YGNodeInsertChild(
|
||||
root_child0_child0_child1_child0_child0,
|
||||
root_child0_child0_child1_child0_child0_child0,
|
||||
0);
|
||||
|
||||
const YGNodeRef root_child0_child0_child1_child0_child1 =
|
||||
YGNodeNewWithConfig(config);
|
||||
YGNodeStyleSetAlignContent(
|
||||
root_child0_child0_child1_child0_child1, YGAlignStretch);
|
||||
YGNodeStyleSetFlexShrink(root_child0_child0_child1_child0_child1, 1);
|
||||
YGNodeStyleSetMargin(
|
||||
root_child0_child0_child1_child0_child1, YGEdgeRight, 36);
|
||||
YGNodeStyleSetPadding(
|
||||
root_child0_child0_child1_child0_child1, YGEdgeLeft, 36);
|
||||
YGNodeStyleSetPadding(root_child0_child0_child1_child0_child1, YGEdgeTop, 21);
|
||||
YGNodeStyleSetPadding(
|
||||
root_child0_child0_child1_child0_child1, YGEdgeRight, 36);
|
||||
YGNodeStyleSetPadding(
|
||||
root_child0_child0_child1_child0_child1, YGEdgeBottom, 18);
|
||||
YGNodeInsertChild(
|
||||
root_child0_child0_child1_child0,
|
||||
root_child0_child0_child1_child0_child1,
|
||||
1);
|
||||
|
||||
const YGNodeRef root_child0_child0_child1_child0_child1_child0 =
|
||||
YGNodeNewWithConfig(config);
|
||||
YGNodeStyleSetFlexDirection(
|
||||
root_child0_child0_child1_child0_child1_child0, YGFlexDirectionRow);
|
||||
YGNodeStyleSetAlignContent(
|
||||
root_child0_child0_child1_child0_child1_child0, YGAlignStretch);
|
||||
YGNodeStyleSetFlexShrink(root_child0_child0_child1_child0_child1_child0, 1);
|
||||
YGNodeInsertChild(
|
||||
root_child0_child0_child1_child0_child1,
|
||||
root_child0_child0_child1_child0_child1_child0,
|
||||
0);
|
||||
|
||||
const YGNodeRef root_child0_child0_child1_child0_child1_child1 =
|
||||
YGNodeNewWithConfig(config);
|
||||
YGNodeStyleSetAlignContent(
|
||||
root_child0_child0_child1_child0_child1_child1, YGAlignStretch);
|
||||
YGNodeStyleSetFlexShrink(root_child0_child0_child1_child0_child1_child1, 1);
|
||||
YGNodeInsertChild(
|
||||
root_child0_child0_child1_child0_child1,
|
||||
root_child0_child0_child1_child0_child1_child1,
|
||||
1);
|
||||
YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR);
|
||||
|
||||
ASSERT_FLOAT_EQ(0, YGNodeLayoutGetLeft(root));
|
||||
ASSERT_FLOAT_EQ(0, YGNodeLayoutGetTop(root));
|
||||
ASSERT_FLOAT_EQ(1080, YGNodeLayoutGetWidth(root));
|
||||
ASSERT_FLOAT_EQ(240, YGNodeLayoutGetHeight(root));
|
||||
|
||||
ASSERT_FLOAT_EQ(0, YGNodeLayoutGetLeft(root_child0));
|
||||
ASSERT_FLOAT_EQ(0, YGNodeLayoutGetTop(root_child0));
|
||||
ASSERT_FLOAT_EQ(1080, YGNodeLayoutGetWidth(root_child0));
|
||||
ASSERT_FLOAT_EQ(240, YGNodeLayoutGetHeight(root_child0));
|
||||
|
||||
ASSERT_FLOAT_EQ(0, YGNodeLayoutGetLeft(root_child0_child0));
|
||||
ASSERT_FLOAT_EQ(0, YGNodeLayoutGetTop(root_child0_child0));
|
||||
ASSERT_FLOAT_EQ(1080, YGNodeLayoutGetWidth(root_child0_child0));
|
||||
ASSERT_FLOAT_EQ(240, YGNodeLayoutGetHeight(root_child0_child0));
|
||||
|
||||
ASSERT_FLOAT_EQ(0, YGNodeLayoutGetLeft(root_child0_child0_child0));
|
||||
ASSERT_FLOAT_EQ(0, YGNodeLayoutGetTop(root_child0_child0_child0));
|
||||
ASSERT_FLOAT_EQ(1080, YGNodeLayoutGetWidth(root_child0_child0_child0));
|
||||
ASSERT_FLOAT_EQ(144, YGNodeLayoutGetHeight(root_child0_child0_child0));
|
||||
|
||||
ASSERT_FLOAT_EQ(36, YGNodeLayoutGetLeft(root_child0_child0_child0_child0));
|
||||
ASSERT_FLOAT_EQ(24, YGNodeLayoutGetTop(root_child0_child0_child0_child0));
|
||||
ASSERT_FLOAT_EQ(1044, YGNodeLayoutGetWidth(root_child0_child0_child0_child0));
|
||||
ASSERT_FLOAT_EQ(120, YGNodeLayoutGetHeight(root_child0_child0_child0_child0));
|
||||
|
||||
ASSERT_FLOAT_EQ(
|
||||
0, YGNodeLayoutGetLeft(root_child0_child0_child0_child0_child0));
|
||||
ASSERT_FLOAT_EQ(
|
||||
0, YGNodeLayoutGetTop(root_child0_child0_child0_child0_child0));
|
||||
ASSERT_FLOAT_EQ(
|
||||
120, YGNodeLayoutGetWidth(root_child0_child0_child0_child0_child0));
|
||||
ASSERT_FLOAT_EQ(
|
||||
120, YGNodeLayoutGetHeight(root_child0_child0_child0_child0_child0));
|
||||
|
||||
ASSERT_FLOAT_EQ(
|
||||
0, YGNodeLayoutGetLeft(root_child0_child0_child0_child0_child0_child0));
|
||||
ASSERT_FLOAT_EQ(
|
||||
0, YGNodeLayoutGetTop(root_child0_child0_child0_child0_child0_child0));
|
||||
ASSERT_FLOAT_EQ(
|
||||
120,
|
||||
YGNodeLayoutGetWidth(root_child0_child0_child0_child0_child0_child0));
|
||||
ASSERT_FLOAT_EQ(
|
||||
120,
|
||||
YGNodeLayoutGetHeight(root_child0_child0_child0_child0_child0_child0));
|
||||
|
||||
ASSERT_FLOAT_EQ(
|
||||
120, YGNodeLayoutGetLeft(root_child0_child0_child0_child0_child1));
|
||||
ASSERT_FLOAT_EQ(
|
||||
0, YGNodeLayoutGetTop(root_child0_child0_child0_child0_child1));
|
||||
ASSERT_FLOAT_EQ(
|
||||
72, YGNodeLayoutGetWidth(root_child0_child0_child0_child0_child1));
|
||||
ASSERT_FLOAT_EQ(
|
||||
39, YGNodeLayoutGetHeight(root_child0_child0_child0_child0_child1));
|
||||
|
||||
ASSERT_FLOAT_EQ(
|
||||
36, YGNodeLayoutGetLeft(root_child0_child0_child0_child0_child1_child0));
|
||||
ASSERT_FLOAT_EQ(
|
||||
21, YGNodeLayoutGetTop(root_child0_child0_child0_child0_child1_child0));
|
||||
ASSERT_FLOAT_EQ(
|
||||
0, YGNodeLayoutGetWidth(root_child0_child0_child0_child0_child1_child0));
|
||||
ASSERT_FLOAT_EQ(
|
||||
0, YGNodeLayoutGetHeight(root_child0_child0_child0_child0_child1_child0));
|
||||
|
||||
ASSERT_FLOAT_EQ(
|
||||
36, YGNodeLayoutGetLeft(root_child0_child0_child0_child0_child1_child1));
|
||||
ASSERT_FLOAT_EQ(
|
||||
21, YGNodeLayoutGetTop(root_child0_child0_child0_child0_child1_child1));
|
||||
ASSERT_FLOAT_EQ(
|
||||
0, YGNodeLayoutGetWidth(root_child0_child0_child0_child0_child1_child1));
|
||||
ASSERT_FLOAT_EQ(
|
||||
0, YGNodeLayoutGetHeight(root_child0_child0_child0_child0_child1_child1));
|
||||
|
||||
ASSERT_FLOAT_EQ(0, YGNodeLayoutGetLeft(root_child0_child0_child1));
|
||||
ASSERT_FLOAT_EQ(144, YGNodeLayoutGetTop(root_child0_child0_child1));
|
||||
ASSERT_FLOAT_EQ(1080, YGNodeLayoutGetWidth(root_child0_child0_child1));
|
||||
ASSERT_FLOAT_EQ(96, YGNodeLayoutGetHeight(root_child0_child0_child1));
|
||||
|
||||
ASSERT_FLOAT_EQ(174, YGNodeLayoutGetLeft(root_child0_child0_child1_child0));
|
||||
ASSERT_FLOAT_EQ(24, YGNodeLayoutGetTop(root_child0_child0_child1_child0));
|
||||
ASSERT_FLOAT_EQ(906, YGNodeLayoutGetWidth(root_child0_child0_child1_child0));
|
||||
ASSERT_FLOAT_EQ(72, YGNodeLayoutGetHeight(root_child0_child0_child1_child0));
|
||||
|
||||
ASSERT_FLOAT_EQ(
|
||||
0, YGNodeLayoutGetLeft(root_child0_child0_child1_child0_child0));
|
||||
ASSERT_FLOAT_EQ(
|
||||
0, YGNodeLayoutGetTop(root_child0_child0_child1_child0_child0));
|
||||
ASSERT_FLOAT_EQ(
|
||||
72, YGNodeLayoutGetWidth(root_child0_child0_child1_child0_child0));
|
||||
ASSERT_FLOAT_EQ(
|
||||
72, YGNodeLayoutGetHeight(root_child0_child0_child1_child0_child0));
|
||||
|
||||
ASSERT_FLOAT_EQ(
|
||||
0, YGNodeLayoutGetLeft(root_child0_child0_child1_child0_child0_child0));
|
||||
ASSERT_FLOAT_EQ(
|
||||
0, YGNodeLayoutGetTop(root_child0_child0_child1_child0_child0_child0));
|
||||
ASSERT_FLOAT_EQ(
|
||||
72, YGNodeLayoutGetWidth(root_child0_child0_child1_child0_child0_child0));
|
||||
ASSERT_FLOAT_EQ(
|
||||
72,
|
||||
YGNodeLayoutGetHeight(root_child0_child0_child1_child0_child0_child0));
|
||||
|
||||
ASSERT_FLOAT_EQ(
|
||||
72, YGNodeLayoutGetLeft(root_child0_child0_child1_child0_child1));
|
||||
ASSERT_FLOAT_EQ(
|
||||
0, YGNodeLayoutGetTop(root_child0_child0_child1_child0_child1));
|
||||
ASSERT_FLOAT_EQ(
|
||||
72, YGNodeLayoutGetWidth(root_child0_child0_child1_child0_child1));
|
||||
ASSERT_FLOAT_EQ(
|
||||
39, YGNodeLayoutGetHeight(root_child0_child0_child1_child0_child1));
|
||||
|
||||
ASSERT_FLOAT_EQ(
|
||||
36, YGNodeLayoutGetLeft(root_child0_child0_child1_child0_child1_child0));
|
||||
ASSERT_FLOAT_EQ(
|
||||
21, YGNodeLayoutGetTop(root_child0_child0_child1_child0_child1_child0));
|
||||
ASSERT_FLOAT_EQ(
|
||||
0, YGNodeLayoutGetWidth(root_child0_child0_child1_child0_child1_child0));
|
||||
ASSERT_FLOAT_EQ(
|
||||
0, YGNodeLayoutGetHeight(root_child0_child0_child1_child0_child1_child0));
|
||||
|
||||
ASSERT_FLOAT_EQ(
|
||||
36, YGNodeLayoutGetLeft(root_child0_child0_child1_child0_child1_child1));
|
||||
ASSERT_FLOAT_EQ(
|
||||
21, YGNodeLayoutGetTop(root_child0_child0_child1_child0_child1_child1));
|
||||
ASSERT_FLOAT_EQ(
|
||||
0, YGNodeLayoutGetWidth(root_child0_child0_child1_child0_child1_child1));
|
||||
ASSERT_FLOAT_EQ(
|
||||
0, YGNodeLayoutGetHeight(root_child0_child0_child1_child0_child1_child1));
|
||||
|
||||
YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionRTL);
|
||||
|
||||
ASSERT_FLOAT_EQ(0, YGNodeLayoutGetLeft(root));
|
||||
ASSERT_FLOAT_EQ(0, YGNodeLayoutGetTop(root));
|
||||
ASSERT_FLOAT_EQ(1080, YGNodeLayoutGetWidth(root));
|
||||
ASSERT_FLOAT_EQ(240, YGNodeLayoutGetHeight(root));
|
||||
|
||||
ASSERT_FLOAT_EQ(0, YGNodeLayoutGetLeft(root_child0));
|
||||
ASSERT_FLOAT_EQ(0, YGNodeLayoutGetTop(root_child0));
|
||||
ASSERT_FLOAT_EQ(1080, YGNodeLayoutGetWidth(root_child0));
|
||||
ASSERT_FLOAT_EQ(240, YGNodeLayoutGetHeight(root_child0));
|
||||
|
||||
ASSERT_FLOAT_EQ(0, YGNodeLayoutGetLeft(root_child0_child0));
|
||||
ASSERT_FLOAT_EQ(0, YGNodeLayoutGetTop(root_child0_child0));
|
||||
ASSERT_FLOAT_EQ(1080, YGNodeLayoutGetWidth(root_child0_child0));
|
||||
ASSERT_FLOAT_EQ(240, YGNodeLayoutGetHeight(root_child0_child0));
|
||||
|
||||
ASSERT_FLOAT_EQ(0, YGNodeLayoutGetLeft(root_child0_child0_child0));
|
||||
ASSERT_FLOAT_EQ(0, YGNodeLayoutGetTop(root_child0_child0_child0));
|
||||
ASSERT_FLOAT_EQ(1080, YGNodeLayoutGetWidth(root_child0_child0_child0));
|
||||
ASSERT_FLOAT_EQ(144, YGNodeLayoutGetHeight(root_child0_child0_child0));
|
||||
|
||||
ASSERT_FLOAT_EQ(0, YGNodeLayoutGetLeft(root_child0_child0_child0_child0));
|
||||
ASSERT_FLOAT_EQ(24, YGNodeLayoutGetTop(root_child0_child0_child0_child0));
|
||||
ASSERT_FLOAT_EQ(1044, YGNodeLayoutGetWidth(root_child0_child0_child0_child0));
|
||||
ASSERT_FLOAT_EQ(120, YGNodeLayoutGetHeight(root_child0_child0_child0_child0));
|
||||
|
||||
ASSERT_FLOAT_EQ(
|
||||
924, YGNodeLayoutGetLeft(root_child0_child0_child0_child0_child0));
|
||||
ASSERT_FLOAT_EQ(
|
||||
0, YGNodeLayoutGetTop(root_child0_child0_child0_child0_child0));
|
||||
ASSERT_FLOAT_EQ(
|
||||
120, YGNodeLayoutGetWidth(root_child0_child0_child0_child0_child0));
|
||||
ASSERT_FLOAT_EQ(
|
||||
120, YGNodeLayoutGetHeight(root_child0_child0_child0_child0_child0));
|
||||
|
||||
ASSERT_FLOAT_EQ(
|
||||
0, YGNodeLayoutGetLeft(root_child0_child0_child0_child0_child0_child0));
|
||||
ASSERT_FLOAT_EQ(
|
||||
0, YGNodeLayoutGetTop(root_child0_child0_child0_child0_child0_child0));
|
||||
ASSERT_FLOAT_EQ(
|
||||
120,
|
||||
YGNodeLayoutGetWidth(root_child0_child0_child0_child0_child0_child0));
|
||||
ASSERT_FLOAT_EQ(
|
||||
120,
|
||||
YGNodeLayoutGetHeight(root_child0_child0_child0_child0_child0_child0));
|
||||
|
||||
ASSERT_FLOAT_EQ(
|
||||
816, YGNodeLayoutGetLeft(root_child0_child0_child0_child0_child1));
|
||||
ASSERT_FLOAT_EQ(
|
||||
0, YGNodeLayoutGetTop(root_child0_child0_child0_child0_child1));
|
||||
ASSERT_FLOAT_EQ(
|
||||
72, YGNodeLayoutGetWidth(root_child0_child0_child0_child0_child1));
|
||||
ASSERT_FLOAT_EQ(
|
||||
39, YGNodeLayoutGetHeight(root_child0_child0_child0_child0_child1));
|
||||
|
||||
ASSERT_FLOAT_EQ(
|
||||
36, YGNodeLayoutGetLeft(root_child0_child0_child0_child0_child1_child0));
|
||||
ASSERT_FLOAT_EQ(
|
||||
21, YGNodeLayoutGetTop(root_child0_child0_child0_child0_child1_child0));
|
||||
ASSERT_FLOAT_EQ(
|
||||
0, YGNodeLayoutGetWidth(root_child0_child0_child0_child0_child1_child0));
|
||||
ASSERT_FLOAT_EQ(
|
||||
0, YGNodeLayoutGetHeight(root_child0_child0_child0_child0_child1_child0));
|
||||
|
||||
ASSERT_FLOAT_EQ(
|
||||
36, YGNodeLayoutGetLeft(root_child0_child0_child0_child0_child1_child1));
|
||||
ASSERT_FLOAT_EQ(
|
||||
21, YGNodeLayoutGetTop(root_child0_child0_child0_child0_child1_child1));
|
||||
ASSERT_FLOAT_EQ(
|
||||
0, YGNodeLayoutGetWidth(root_child0_child0_child0_child0_child1_child1));
|
||||
ASSERT_FLOAT_EQ(
|
||||
0, YGNodeLayoutGetHeight(root_child0_child0_child0_child0_child1_child1));
|
||||
|
||||
ASSERT_FLOAT_EQ(0, YGNodeLayoutGetLeft(root_child0_child0_child1));
|
||||
ASSERT_FLOAT_EQ(144, YGNodeLayoutGetTop(root_child0_child0_child1));
|
||||
ASSERT_FLOAT_EQ(1080, YGNodeLayoutGetWidth(root_child0_child0_child1));
|
||||
ASSERT_FLOAT_EQ(96, YGNodeLayoutGetHeight(root_child0_child0_child1));
|
||||
|
||||
ASSERT_FLOAT_EQ(0, YGNodeLayoutGetLeft(root_child0_child0_child1_child0));
|
||||
ASSERT_FLOAT_EQ(24, YGNodeLayoutGetTop(root_child0_child0_child1_child0));
|
||||
ASSERT_FLOAT_EQ(906, YGNodeLayoutGetWidth(root_child0_child0_child1_child0));
|
||||
ASSERT_FLOAT_EQ(72, YGNodeLayoutGetHeight(root_child0_child0_child1_child0));
|
||||
|
||||
ASSERT_FLOAT_EQ(
|
||||
834, YGNodeLayoutGetLeft(root_child0_child0_child1_child0_child0));
|
||||
ASSERT_FLOAT_EQ(
|
||||
0, YGNodeLayoutGetTop(root_child0_child0_child1_child0_child0));
|
||||
ASSERT_FLOAT_EQ(
|
||||
72, YGNodeLayoutGetWidth(root_child0_child0_child1_child0_child0));
|
||||
ASSERT_FLOAT_EQ(
|
||||
72, YGNodeLayoutGetHeight(root_child0_child0_child1_child0_child0));
|
||||
|
||||
ASSERT_FLOAT_EQ(
|
||||
0, YGNodeLayoutGetLeft(root_child0_child0_child1_child0_child0_child0));
|
||||
ASSERT_FLOAT_EQ(
|
||||
0, YGNodeLayoutGetTop(root_child0_child0_child1_child0_child0_child0));
|
||||
ASSERT_FLOAT_EQ(
|
||||
72, YGNodeLayoutGetWidth(root_child0_child0_child1_child0_child0_child0));
|
||||
ASSERT_FLOAT_EQ(
|
||||
72,
|
||||
YGNodeLayoutGetHeight(root_child0_child0_child1_child0_child0_child0));
|
||||
|
||||
ASSERT_FLOAT_EQ(
|
||||
726, YGNodeLayoutGetLeft(root_child0_child0_child1_child0_child1));
|
||||
ASSERT_FLOAT_EQ(
|
||||
0, YGNodeLayoutGetTop(root_child0_child0_child1_child0_child1));
|
||||
ASSERT_FLOAT_EQ(
|
||||
72, YGNodeLayoutGetWidth(root_child0_child0_child1_child0_child1));
|
||||
ASSERT_FLOAT_EQ(
|
||||
39, YGNodeLayoutGetHeight(root_child0_child0_child1_child0_child1));
|
||||
|
||||
ASSERT_FLOAT_EQ(
|
||||
36, YGNodeLayoutGetLeft(root_child0_child0_child1_child0_child1_child0));
|
||||
ASSERT_FLOAT_EQ(
|
||||
21, YGNodeLayoutGetTop(root_child0_child0_child1_child0_child1_child0));
|
||||
ASSERT_FLOAT_EQ(
|
||||
0, YGNodeLayoutGetWidth(root_child0_child0_child1_child0_child1_child0));
|
||||
ASSERT_FLOAT_EQ(
|
||||
0, YGNodeLayoutGetHeight(root_child0_child0_child1_child0_child1_child0));
|
||||
|
||||
ASSERT_FLOAT_EQ(
|
||||
36, YGNodeLayoutGetLeft(root_child0_child0_child1_child0_child1_child1));
|
||||
ASSERT_FLOAT_EQ(
|
||||
21, YGNodeLayoutGetTop(root_child0_child0_child1_child0_child1_child1));
|
||||
ASSERT_FLOAT_EQ(
|
||||
0, YGNodeLayoutGetWidth(root_child0_child0_child1_child0_child1_child1));
|
||||
ASSERT_FLOAT_EQ(
|
||||
0, YGNodeLayoutGetHeight(root_child0_child0_child1_child0_child1_child1));
|
||||
|
||||
YGNodeFreeRecursive(root);
|
||||
|
||||
YGConfigFree(config);
|
||||
}
|
Reference in New Issue
Block a user