CSSNodeCopyStyle API for Java and C#

Summary: Add CopyStyle API for Java and C#

Reviewed By: emilsjolander

Differential Revision: D4189954

fbshipit-source-id: 10759fdb27bf67350d3151614f7815aa09bf7e04
This commit is contained in:
Kazuki Sakamoto
2016-11-17 09:10:47 -08:00
committed by Facebook Github Bot
parent 191ac98b89
commit 0bb2955c5c
8 changed files with 52 additions and 1 deletions

View File

@@ -215,13 +215,26 @@ namespace Facebook.CSSLayout
Assert.AreEqual(parent.Print(), "{layout: {width: 100, height: 120, top: 0, left: 0}, flexDirection: 'column', alignItems: 'stretch', flexGrow: 0, flexShrink: 0, overflow: 'visible', width: 100, height: 120, children: [\n {layout: {width: 35, height: 45, top: 0, left: 0}, flexDirection: 'column', alignItems: 'stretch', flexGrow: 0, flexShrink: 0, overflow: 'visible', width: 35, height: 45, },\n {layout: {width: 30, height: 40, top: 45, left: 0}, flexDirection: 'column', alignItems: 'stretch', flexGrow: 0, flexShrink: 0, overflow: 'visible', width: 30, height: 40, },\n]},\n");
}
[Test]
public void TestCopyStyle()
{
CSSNode node0 = new CSSNode();
Assert.IsTrue(CSSConstants.IsUndefined(node0.StyleMaxHeight));
CSSNode node1 = new CSSNode();
node1.StyleMaxHeight = 100;
node0.CopyStyle(node1);
Assert.AreEqual(100, node0.StyleMaxHeight);
}
#if !UNITY_EDITOR
private void ForceGC()
{
GC.Collect(GC.MaxGeneration);
GC.WaitForPendingFinalizers();
}
#if !UNITY_EDITOR
[Test]
public void TestDestructor()
{