blob: 98f9104114a2065978136d6d87124e6334e7914a [file] [log] [blame]
<?xml version="1.0" encoding="utf-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<UnitTester testDir="Application/Application_SparkSkin/Properties/" xmlns:mx="http://www.adobe.com/2006/mxml" xmlns="*" testSWF="FixedApplication.mxml">
<mx:Script>
<![CDATA[
import mx.containers.utilityClasses.ConstraintColumn;
import mx.containers.utilityClasses.ConstraintRow;
import mx.controls.Button;
public static function init(o:DisplayObject):void
{
}
public var arr:Array;
public var col1:ConstraintColumn;
public var col2:ConstraintColumn;
public var row1:ConstraintRow;
public var row2:ConstraintRow;
]]>
</mx:Script>
<mx:Metadata>
<![CDATA[
[Mixin]
]]>
</mx:Metadata>
<testCases>
<!-- Fixed Size Tests (with fixed size columns and rows) -->
<TestCase testID="constraintColumns_set_validValues_fixed_mxml" keywords="[constraintColumns, Property, valid, fixed size ]" description="Verify the constraintColumns
property is correct when set in mxml">
<body>
<AssertPropertyValue target="constraintColumns" propertyName="length" value="2" />
</body>
</TestCase>
<TestCase testID="constraintRows_set_validValues_fixed_mxml" keywords="[constraintRows, Property, valid value, fixed size ]" description="Verify that constraintRows have been
set correctly in mxml">
<body>
<AssertPropertyValue target="constraintRows" propertyName="length" value="2" />
</body>
</TestCase>
<TestCase testID="constraintColumnsRows_initially_null_fixed" keywords="[constraintColumns, constraintRows, initial,
property, fixed size ]" description="Verify the constraintColumns and constraintRows properties are null when unset">
<setup>
<RunCode code="arr = []" />
<RunCode code="row1 = new ConstraintRow()" />
<RunCode code="row1.id = 'row1'" />
<RunCode code="row1.height = 100" />
<RunCode code="arr.push(row1);" />
<RunCode code="row2 = new ConstraintRow();" />
<RunCode code="row2.id = 'row2';" />
<RunCode code="row2.height = 100;" />
<RunCode code="arr.push(row2);" />
<RunCode code="application.constraintRows = arr;" />
<RunCode code="arr = []" />
<RunCode code="col1 = new ConstraintColumn()" />
<RunCode code="col1.id = 'col1'" />
<RunCode code="col1.width = 100" />
<RunCode code="arr.push(col1);" />
<RunCode code="col2 = new ConstraintColumn();" />
<RunCode code="col2.id = 'col2';" />
<RunCode code="col2.width = 100;" />
<RunCode code="arr.push(col2);" />
<RunCode code="application.constraintColumns = arr;" />
</setup>
<body>
<SetProperty propertyName="constraintColumns" valueExpression="value=[]" target="" waitTarget="" waitEvent="updateComplete" />
<SetProperty propertyName="constraintRows" valueExpression="value=[]" target="" waitTarget="" waitEvent="updateComplete" />
<AssertPropertyValue target="constraintColumns" propertyName="length" value="0" />
<AssertPropertyValue target="constraintRows" propertyName="length" value="0" />
</body>
</TestCase>
<TestCase testID="constraintColumns_set_validValues_fixed" keywords="[constraintColumns, Property, valid, fixed size ]" description="Verify the constraintColumns
property is correct">
<setup>
<RunCode code="arr = []" />
<RunCode code="row1 = new ConstraintRow()" />
<RunCode code="row1.id = 'row1'" />
<RunCode code="row1.height = 100" />
<RunCode code="arr.push(row1);" />
<RunCode code="row2 = new ConstraintRow();" />
<RunCode code="row2.id = 'row2';" />
<RunCode code="row2.height = 100;" />
<RunCode code="arr.push(row2);" />
<RunCode code="application.constraintRows = arr;" />
<RunCode code="arr = []" />
<RunCode code="col1 = new ConstraintColumn()" />
<RunCode code="col1.id = 'col1'" />
<RunCode code="col1.width = 100" />
<RunCode code="arr.push(col1);" />
<RunCode code="col2 = new ConstraintColumn();" />
<RunCode code="col2.id = 'col2';" />
<RunCode code="col2.width = 100;" />
<RunCode code="arr.push(col2);" />
<RunCode code="application.constraintColumns = arr;" />
</setup>
<body>
<AssertPropertyValue target="constraintColumns" propertyName="length" value="2" />
</body>
</TestCase>
<TestCase testID="constrainButtonToCol1HorizontalCenter_fixed" keywords="[Button, constraint, horizontalCenter, constraintColumn, fixed size ]" description="Verify the button
obeys its horizontalCenter style affixing it to the center of col1">
<setup>
<RunCode code="arr = []" />
<RunCode code="row1 = new ConstraintRow()" />
<RunCode code="row1.id = 'row1'" />
<RunCode code="row1.height = 100" />
<RunCode code="arr.push(row1);" />
<RunCode code="row2 = new ConstraintRow();" />
<RunCode code="row2.id = 'row2';" />
<RunCode code="row2.height = 100;" />
<RunCode code="arr.push(row2);" />
<RunCode code="application.constraintRows = arr;" />
<RunCode code="arr = []" />
<RunCode code="col1 = new ConstraintColumn()" />
<RunCode code="col1.id = 'col1'" />
<RunCode code="col1.width = 100" />
<RunCode code="arr.push(col1);" />
<RunCode code="col2 = new ConstraintColumn();" />
<RunCode code="col2.id = 'col2';" />
<RunCode code="col2.width = 100;" />
<RunCode code="arr.push(col2);" />
<RunCode code="application.constraintColumns = arr;" />
</setup>
<body>
<SetStyle target="getChildAt(0)" styleName="horizontalCenter" value="col1:0" waitEvent="updateComplete" waitTarget=""/>
<AssertStyleValue target="getChildAt(0)" styleName="horizontalCenter" value="col1:0" />
<AssertPropertyValue target="getChildAt(0)" propertyName="width" value="70" />
<AssertPropertyValue target="getChildAt(0)" propertyName="x" value="15" />
</body>
</TestCase>
<TestCase testID="constrainButtonToParentHorizontalCenter_fixed" keywords="[Button, constraint, horizontalCenter, parent, fixed size ]" description="Verify the button
is constrained to the center of the parent ">
<setup>
<RunCode code="arr = []" />
<RunCode code="row1 = new ConstraintRow()" />
<RunCode code="row1.id = 'row1'" />
<RunCode code="row1.height = 100" />
<RunCode code="arr.push(row1);" />
<RunCode code="row2 = new ConstraintRow();" />
<RunCode code="row2.id = 'row2';" />
<RunCode code="row2.height = 100;" />
<RunCode code="arr.push(row2);" />
<RunCode code="application.constraintRows = arr;" />
<RunCode code="arr = []" />
<RunCode code="col1 = new ConstraintColumn()" />
<RunCode code="col1.id = 'col1'" />
<RunCode code="col1.width = 100" />
<RunCode code="arr.push(col1);" />
<RunCode code="col2 = new ConstraintColumn();" />
<RunCode code="col2.id = 'col2';" />
<RunCode code="col2.width = 100;" />
<RunCode code="arr.push(col2);" />
<RunCode code="application.constraintColumns = arr;" />
</setup>
<body>
<SetStyle target="getChildAt(0)" styleName="horizontalCenter" value="0" waitEvent="updateComplete" waitTarget=""/>
<AssertStyleValue target="getChildAt(0)" styleName="horizontalCenter" value="0" />
<AssertPropertyValue target="getChildAt(0)" propertyName="width" value="70" />
<AssertPropertyValue target="getChildAt(0)" propertyName="x" value="115" />
</body>
</TestCase>
<TestCase testID="constrainButtonToParentLeftRight_fixed" keywords="[Button, constraint, left, right, parent, fixed size ]" description="Verify the button
is constrained on the right and left to the parent edges">
<setup>
<RunCode code="arr = []" />
<RunCode code="row1 = new ConstraintRow()" />
<RunCode code="row1.id = 'row1'" />
<RunCode code="row1.height = 100" />
<RunCode code="arr.push(row1);" />
<RunCode code="row2 = new ConstraintRow();" />
<RunCode code="row2.id = 'row2';" />
<RunCode code="row2.height = 100;" />
<RunCode code="arr.push(row2);" />
<RunCode code="application.constraintRows = arr;" />
<RunCode code="arr = []" />
<RunCode code="col1 = new ConstraintColumn()" />
<RunCode code="col1.id = 'col1'" />
<RunCode code="col1.width = 100" />
<RunCode code="arr.push(col1);" />
<RunCode code="col2 = new ConstraintColumn();" />
<RunCode code="col2.id = 'col2';" />
<RunCode code="col2.width = 100;" />
<RunCode code="arr.push(col2);" />
<RunCode code="application.constraintColumns = arr;" />
</setup>
<body>
<SetStyle target="getChildAt(0)" styleName="left" value="10" waitEvent="updateComplete" waitTarget=""/>
<SetStyle target="getChildAt(0)" styleName="right" value="10" waitEvent="updateComplete" waitTarget=""/>
<AssertStyleValue target="getChildAt(0)" styleName="left" value="10" />
<AssertStyleValue target="getChildAt(0)" styleName="right" value="10" />
<AssertPropertyValue target="getChildAt(0)" propertyName="x" value="10" />
<AssertPropertyValue target="getChildAt(0)" propertyName="width" value="280" />
</body>
</TestCase>
<TestCase testID="constrainButtonToParentRegionsTopBottom_fixed" keywords="[Button, constraint, top, bottom, parent, fixed size ]" description="Verify the button added
is constrained on the top and bottom to the parent edges">
<setup>
<RunCode code="arr = []" />
<RunCode code="row1 = new ConstraintRow()" />
<RunCode code="row1.id = 'row1'" />
<RunCode code="row1.height = 100" />
<RunCode code="arr.push(row1);" />
<RunCode code="row2 = new ConstraintRow();" />
<RunCode code="row2.id = 'row2';" />
<RunCode code="row2.height = 100;" />
<RunCode code="arr.push(row2);" />
<RunCode code="application.constraintRows = arr;" />
<RunCode code="arr = []" />
<RunCode code="col1 = new ConstraintColumn()" />
<RunCode code="col1.id = 'col1'" />
<RunCode code="col1.width = 100" />
<RunCode code="arr.push(col1);" />
<RunCode code="col2 = new ConstraintColumn();" />
<RunCode code="col2.id = 'col2';" />
<RunCode code="col2.width = 100;" />
<RunCode code="arr.push(col2);" />
<RunCode code="application.constraintColumns = arr;" />
</setup>
<body>
<SetStyle target="getChildAt(0)" styleName="top" value="5" waitEvent="updateComplete" waitTarget=""/>
<SetStyle target="getChildAt(0)" styleName="bottom" value="5" waitEvent="updateComplete" waitTarget=""/>
<AssertStyleValue target="getChildAt(0)" styleName="top" value="5" />
<AssertStyleValue target="getChildAt(0)" styleName="bottom" value="5" />
<AssertPropertyValue target="getChildAt(0)" propertyName="y" value="5" />
<AssertPropertyValue target="getChildAt(0)" propertyName="height" value="290" />
</body>
</TestCase>
<TestCase testID="addButtonConstrainedToSingleColumnWithOffset_fixed" keywords="[Button, constraint, left, right, single column, fixed size ]" description="Verify the button added
is constrained on the left and right to a single column">
<setup>
<RunCode code="arr = []" />
<RunCode code="row1 = new ConstraintRow()" />
<RunCode code="row1.id = 'row1'" />
<RunCode code="row1.height = 100" />
<RunCode code="arr.push(row1);" />
<RunCode code="row2 = new ConstraintRow();" />
<RunCode code="row2.id = 'row2';" />
<RunCode code="row2.height = 100;" />
<RunCode code="arr.push(row2);" />
<RunCode code="application.constraintRows = arr;" />
<RunCode code="arr = []" />
<RunCode code="col1 = new ConstraintColumn()" />
<RunCode code="col1.id = 'col1'" />
<RunCode code="col1.width = 100" />
<RunCode code="arr.push(col1);" />
<RunCode code="col2 = new ConstraintColumn();" />
<RunCode code="col2.id = 'col2';" />
<RunCode code="col2.width = 100;" />
<RunCode code="arr.push(col2);" />
<RunCode code="application.constraintColumns = arr;" />
</setup>
<body>
<SetStyle target="getChildAt(0)" styleName="left" value="col1:10" waitEvent="updateComplete" waitTarget=""/>
<SetStyle target="getChildAt(0)" styleName="right" value="col1:10" waitEvent="updateComplete" waitTarget=""/>
<AssertStyleValue target="getChildAt(0)" styleName="left" value="col1:10" />
<AssertStyleValue target="getChildAt(0)" styleName="right" value="col1:10" />
<AssertPropertyValue target="getChildAt(0)" propertyName="x" value="10" />
<AssertPropertyValue target="getChildAt(0)" propertyName="width" value="80" />
</body>
</TestCase>
<TestCase testID="addButtonConstrainedToMultipleColumnsWithOffset_fixed" keywords="[Button, constraint, left, right, multiple columns, fixed size ]" description="Verify the button added
is constrained on the left and right to multiple columns">
<setup>
<RunCode code="arr = []" />
<RunCode code="row1 = new ConstraintRow()" />
<RunCode code="row1.id = 'row1'" />
<RunCode code="row1.height = 100" />
<RunCode code="arr.push(row1);" />
<RunCode code="row2 = new ConstraintRow();" />
<RunCode code="row2.id = 'row2';" />
<RunCode code="row2.height = 100;" />
<RunCode code="arr.push(row2);" />
<RunCode code="application.constraintRows = arr;" />
<RunCode code="arr = []" />
<RunCode code="col1 = new ConstraintColumn()" />
<RunCode code="col1.id = 'col1'" />
<RunCode code="col1.width = 100" />
<RunCode code="arr.push(col1);" />
<RunCode code="col2 = new ConstraintColumn();" />
<RunCode code="col2.id = 'col2';" />
<RunCode code="col2.width = 100;" />
<RunCode code="arr.push(col2);" />
<RunCode code="application.constraintColumns = arr;" />
</setup>
<body>
<SetStyle target="getChildAt(0)" styleName="left" value="col1:5" waitEvent="updateComplete" waitTarget=""/>
<SetStyle target="getChildAt(0)" styleName="right" value="col2:5" waitEvent="updateComplete" waitTarget=""/>
<AssertStyleValue target="getChildAt(0)" styleName="left" value="col1:5" />
<AssertStyleValue target="getChildAt(0)" styleName="right" value="col2:5" />
<AssertPropertyValue target="getChildAt(0)" propertyName="x" value="5" />
<AssertPropertyValue target="getChildAt(0)" propertyName="width" value="190" />
</body>
</TestCase>
<TestCase testID="constraintRows_set_validValues_fixed" keywords="[constraintRows, Property, valid value, fixed size ]" description="Verify that constraintRows have been
added">
<setup>
<RunCode code="arr = []" />
<RunCode code="row1 = new ConstraintRow()" />
<RunCode code="row1.id = 'row1'" />
<RunCode code="row1.height = 100" />
<RunCode code="arr.push(row1);" />
<RunCode code="row2 = new ConstraintRow();" />
<RunCode code="row2.id = 'row2';" />
<RunCode code="row2.height = 100;" />
<RunCode code="arr.push(row2);" />
<RunCode code="application.constraintRows = arr;" />
<RunCode code="arr = []" />
<RunCode code="col1 = new ConstraintColumn()" />
<RunCode code="col1.id = 'col1'" />
<RunCode code="col1.width = 100" />
<RunCode code="arr.push(col1);" />
<RunCode code="col2 = new ConstraintColumn();" />
<RunCode code="col2.id = 'col2';" />
<RunCode code="col2.width = 100;" />
<RunCode code="arr.push(col2);" />
<RunCode code="application.constraintColumns = arr;" />
</setup>
<body>
<AssertPropertyValue target="constraintRows" propertyName="length" value="2" />
</body>
</TestCase>
<TestCase testID="constrainButtonToRow1VerticalCenter_fixed" keywords="[Button, constraint, verticalCenter, constraintRow, fixed size ]" description="Verify the button
obeys its verticalCenter style affixing it to the center of row1">
<setup>
<RunCode code="arr = []" />
<RunCode code="row1 = new ConstraintRow()" />
<RunCode code="row1.id = 'row1'" />
<RunCode code="row1.height = 100" />
<RunCode code="arr.push(row1);" />
<RunCode code="row2 = new ConstraintRow();" />
<RunCode code="row2.id = 'row2';" />
<RunCode code="row2.height = 100;" />
<RunCode code="arr.push(row2);" />
<RunCode code="application.constraintRows = arr;" />
<RunCode code="arr = []" />
<RunCode code="col1 = new ConstraintColumn()" />
<RunCode code="col1.id = 'col1'" />
<RunCode code="col1.width = 100" />
<RunCode code="arr.push(col1);" />
<RunCode code="col2 = new ConstraintColumn();" />
<RunCode code="col2.id = 'col2';" />
<RunCode code="col2.width = 100;" />
<RunCode code="arr.push(col2);" />
<RunCode code="application.constraintColumns = arr;" />
<ResetComponent target="btn" className="mx.controls.Button" waitTarget="btn" waitEvent="updateComplete" />
</setup>
<body>
<SetStyle target="getChildAt(0)" styleName="verticalCenter" value="row1:0" waitEvent="updateComplete" waitTarget=""/>
<AssertStyleValue target="getChildAt(0)" styleName="verticalCenter" value="row1:0" />
<AssertPropertyValue target="getChildAt(0)" propertyName="height" value="21" />
<AssertPropertyValue target="getChildAt(0)" propertyName="y" value="40" />
</body>
</TestCase>
<TestCase testID="constrainButtonToParentVerticalCenter_fixed" keywords="[Button, constraint, verticalCenter, parent, fixed size ]" description="Verify the button
is constrained to the center of the parent ">
<setup>
<RunCode code="arr = []" />
<RunCode code="row1 = new ConstraintRow()" />
<RunCode code="row1.id = 'row1'" />
<RunCode code="row1.height = 100" />
<RunCode code="arr.push(row1);" />
<RunCode code="row2 = new ConstraintRow();" />
<RunCode code="row2.id = 'row2';" />
<RunCode code="row2.height = 100;" />
<RunCode code="arr.push(row2);" />
<RunCode code="application.constraintRows = arr;" />
<RunCode code="arr = []" />
<RunCode code="col1 = new ConstraintColumn()" />
<RunCode code="col1.id = 'col1'" />
<RunCode code="col1.width = 100" />
<RunCode code="arr.push(col1);" />
<RunCode code="col2 = new ConstraintColumn();" />
<RunCode code="col2.id = 'col2';" />
<RunCode code="col2.width = 100;" />
<RunCode code="arr.push(col2);" />
<RunCode code="application.constraintColumns = arr;" />
<ResetComponent target="btn" className="mx.controls.Button" waitTarget="btn" waitEvent="updateComplete" />
</setup>
<body>
<SetStyle target="getChildAt(0)" styleName="verticalCenter" value="0" waitEvent="updateComplete" waitTarget=""/>
<AssertStyleValue target="getChildAt(0)" styleName="verticalCenter" value="0" />
<AssertPropertyValue target="getChildAt(0)" propertyName="height" value="21" />
<AssertPropertyValue target="getChildAt(0)" propertyName="y" value="140" />
</body>
</TestCase>
<TestCase testID="buttonConstrainedToSingleRowWithOffset_fixed" keywords="[Button, constraint, top, bottom, single row, fixed size ]" description="Verify the button added
is constrained on the top and bottom to a single row">
<setup>
<RunCode code="arr = []" />
<RunCode code="row1 = new ConstraintRow()" />
<RunCode code="row1.id = 'row1'" />
<RunCode code="row1.height = 100" />
<RunCode code="arr.push(row1);" />
<RunCode code="row2 = new ConstraintRow();" />
<RunCode code="row2.id = 'row2';" />
<RunCode code="row2.height = 100;" />
<RunCode code="arr.push(row2);" />
<RunCode code="application.constraintRows = arr;" />
<RunCode code="arr = []" />
<RunCode code="col1 = new ConstraintColumn()" />
<RunCode code="col1.id = 'col1'" />
<RunCode code="col1.width = 100" />
<RunCode code="arr.push(col1);" />
<RunCode code="col2 = new ConstraintColumn();" />
<RunCode code="col2.id = 'col2';" />
<RunCode code="col2.width = 100;" />
<RunCode code="arr.push(col2);" />
<RunCode code="application.constraintColumns = arr;" />
<ResetComponent target="btn" className="mx.controls.Button" waitTarget="btn" waitEvent="updateComplete" />
</setup>
<body>
<SetStyle target="getChildAt(0)" styleName="top" value="row1:10" waitEvent="updateComplete" waitTarget=""/>
<SetStyle target="getChildAt(0)" styleName="bottom" value="row1:10" waitEvent="updateComplete" waitTarget=""/>
<AssertStyleValue target="getChildAt(0)" styleName="top" value="row1:10" />
<AssertStyleValue target="getChildAt(0)" styleName="bottom" value="row1:10" />
<AssertPropertyValue target="getChildAt(0)" propertyName="y" value="10" />
<AssertPropertyValue target="getChildAt(0)" propertyName="height" value="80" />
</body>
</TestCase>
<TestCase testID="buttonConstrainedToMultipleRowsWithOffset_fixed" keywords="[Button, constraint, top, bottom, multiple rows, fixed size ]" description="Verify the button added
is constrained on the top and bottom to multiple rows" >
<setup>
<RunCode code="arr = []" />
<RunCode code="row1 = new ConstraintRow()" />
<RunCode code="row1.id = 'row1'" />
<RunCode code="row1.height = 100" />
<RunCode code="arr.push(row1);" />
<RunCode code="row2 = new ConstraintRow();" />
<RunCode code="row2.id = 'row2';" />
<RunCode code="row2.height = 100;" />
<RunCode code="arr.push(row2);" />
<RunCode code="application.constraintRows = arr;" />
<RunCode code="arr = []" />
<RunCode code="col1 = new ConstraintColumn()" />
<RunCode code="col1.id = 'col1'" />
<RunCode code="col1.width = 100" />
<RunCode code="arr.push(col1);" />
<RunCode code="col2 = new ConstraintColumn();" />
<RunCode code="col2.id = 'col2';" />
<RunCode code="col2.width = 100;" />
<RunCode code="arr.push(col2);" />
<RunCode code="application.constraintColumns = arr;" />
<ResetComponent target="btn" className="mx.controls.Button" waitTarget="btn" waitEvent="updateComplete" />
</setup>
<body>
<SetStyle target="getChildAt(0)" styleName="top" value="row1:5" waitEvent="updateComplete" waitTarget=""/>
<SetStyle target="getChildAt(0)" styleName="bottom" value="row2:10" waitEvent="updateComplete" waitTarget=""/>
<AssertStyleValue target="getChildAt(0)" styleName="top" value="row1:5" />
<AssertStyleValue target="getChildAt(0)" styleName="bottom" value="row2:10" />
<AssertPropertyValue target="getChildAt(0)" propertyName="y" value="5" />
<AssertPropertyValue target="getChildAt(0)" propertyName="height" value="185" />
</body>
</TestCase>
<TestCase testID="makeButtonFixedSized" keywords="[Button, fixed sized]">
<setup>
<RunCode code="arr = []" />
<RunCode code="row1 = new ConstraintRow()" />
<RunCode code="row1.id = 'row1'" />
<RunCode code="row1.height = 100" />
<RunCode code="arr.push(row1);" />
<RunCode code="row2 = new ConstraintRow();" />
<RunCode code="row2.id = 'row2';" />
<RunCode code="row2.height = 100;" />
<RunCode code="arr.push(row2);" />
<RunCode code="application.constraintRows = arr;" />
<RunCode code="arr = []" />
<RunCode code="col1 = new ConstraintColumn()" />
<RunCode code="col1.id = 'col1'" />
<RunCode code="col1.width = 100" />
<RunCode code="arr.push(col1);" />
<RunCode code="col2 = new ConstraintColumn();" />
<RunCode code="col2.id = 'col2';" />
<RunCode code="col2.width = 100;" />
<RunCode code="arr.push(col2);" />
<RunCode code="application.constraintColumns = arr;" />
<ResetComponent target="btn" className="mx.controls.Button" waitTarget="btn" waitEvent="updateComplete" />
</setup>
<body>
<SetProperty target="getChildAt(0)" propertyName="width" value="150" waitEvent="updateComplete" waitTarget=""/>
<AssertPropertyValue target="getChildAt(0)" propertyName="width" value="150" />
<SetProperty target="getChildAt(0)" propertyName="height" value="100" waitEvent="updateComplete" waitTarget=""/>
<AssertPropertyValue target="getChildAt(0)" propertyName="height" value="100" />
</body>
</TestCase>
<TestCase testID="setLeftRightConstraintsOnFixedButton" keywords="[Button, fixed sized, left, right, constraints]">
<setup>
<RunCode code="arr = []" />
<RunCode code="row1 = new ConstraintRow()" />
<RunCode code="row1.id = 'row1'" />
<RunCode code="row1.height = 100" />
<RunCode code="arr.push(row1);" />
<RunCode code="row2 = new ConstraintRow();" />
<RunCode code="row2.id = 'row2';" />
<RunCode code="row2.height = 100;" />
<RunCode code="arr.push(row2);" />
<RunCode code="application.constraintRows = arr;" />
<RunCode code="arr = []" />
<RunCode code="col1 = new ConstraintColumn()" />
<RunCode code="col1.id = 'col1'" />
<RunCode code="col1.width = 100" />
<RunCode code="arr.push(col1);" />
<RunCode code="col2 = new ConstraintColumn();" />
<RunCode code="col2.id = 'col2';" />
<RunCode code="col2.width = 100;" />
<RunCode code="arr.push(col2);" />
<RunCode code="application.constraintColumns = arr;" />
<ResetComponent target="btn" className="mx.controls.Button" waitTarget="btn" waitEvent="updateComplete" />
<SetProperty target="getChildAt(0)" propertyName="width" value="150" waitEvent="updateComplete" waitTarget=""/>
<SetProperty target="getChildAt(0)" propertyName="height" value="100" waitEvent="updateComplete" waitTarget=""/>
</setup>
<body>
<SetStyle target="getChildAt(0)" styleName="left" value="col1:5" waitEvent="updateComplete" waitTarget=""/>
<SetStyle target="getChildAt(0)" styleName="right" value="col2:5" waitEvent="updateComplete" waitTarget=""/>
<AssertPropertyValue target="getChildAt(0)" propertyName="width" value="190" />
</body>
</TestCase>
<TestCase testID="setTopBottomConstraintsOnFixedButton" keywords="[Button, fixed sized, top, bottom, constraints]">
<setup>
<RunCode code="arr = []" />
<RunCode code="row1 = new ConstraintRow()" />
<RunCode code="row1.id = 'row1'" />
<RunCode code="row1.height = 100" />
<RunCode code="arr.push(row1);" />
<RunCode code="row2 = new ConstraintRow();" />
<RunCode code="row2.id = 'row2';" />
<RunCode code="row2.height = 100;" />
<RunCode code="arr.push(row2);" />
<RunCode code="application.constraintRows = arr;" />
<RunCode code="arr = []" />
<RunCode code="col1 = new ConstraintColumn()" />
<RunCode code="col1.id = 'col1'" />
<RunCode code="col1.width = 100" />
<RunCode code="arr.push(col1);" />
<RunCode code="col2 = new ConstraintColumn();" />
<RunCode code="col2.id = 'col2';" />
<RunCode code="col2.width = 100;" />
<RunCode code="arr.push(col2);" />
<RunCode code="application.constraintColumns = arr;" />
<ResetComponent target="btn" className="mx.controls.Button" waitTarget="btn" waitEvent="updateComplete" />
<SetProperty target="getChildAt(0)" propertyName="width" value="150" waitEvent="updateComplete" waitTarget=""/>
<SetProperty target="getChildAt(0)" propertyName="height" value="100" waitEvent="updateComplete" waitTarget=""/>
</setup>
<body>
<SetStyle target="getChildAt(0)" styleName="top" value="row1:5" waitEvent="updateComplete" waitTarget=""/>
<SetStyle target="getChildAt(0)" styleName="bottom" value="row2:5" waitEvent="updateComplete" waitTarget=""/>
<AssertPropertyValue target="getChildAt(0)" propertyName="height" value="190" />
</body>
</TestCase>
<TestCase testID="makeButtonPercentageSized" keywords="[Button, percentage sized]">
<setup>
<RunCode code="arr = []" />
<RunCode code="row1 = new ConstraintRow()" />
<RunCode code="row1.id = 'row1'" />
<RunCode code="row1.height = 100" />
<RunCode code="arr.push(row1);" />
<RunCode code="row2 = new ConstraintRow();" />
<RunCode code="row2.id = 'row2';" />
<RunCode code="row2.height = 100;" />
<RunCode code="arr.push(row2);" />
<RunCode code="application.constraintRows = arr;" />
<RunCode code="arr = []" />
<RunCode code="col1 = new ConstraintColumn()" />
<RunCode code="col1.id = 'col1'" />
<RunCode code="col1.width = 100" />
<RunCode code="arr.push(col1);" />
<RunCode code="col2 = new ConstraintColumn();" />
<RunCode code="col2.id = 'col2';" />
<RunCode code="col2.width = 100;" />
<RunCode code="arr.push(col2);" />
<RunCode code="application.constraintColumns = arr;" />
<ResetComponent target="btn" className="mx.controls.Button" waitTarget="btn" waitEvent="updateComplete" />
</setup>
<body>
<SetProperty target="getChildAt(0)" propertyName="percentWidth" value="80" waitEvent="updateComplete" waitTarget=""/>
<AssertPropertyValue target="getChildAt(0)" propertyName="percentWidth" value="80" />
<AssertPropertyValue target="getChildAt(0)" propertyName="width" value="240" />
<SetProperty target="getChildAt(0)" propertyName="percentHeight" value="80" waitEvent="updateComplete" waitTarget=""/>
<AssertPropertyValue target="getChildAt(0)" propertyName="percentHeight" value="80" />
<AssertPropertyValue target="getChildAt(0)" propertyName="height" value="240" />
</body>
</TestCase>
<TestCase testID="setLeftRightConstraintsOnPercentageButton" keywords="[Button, percentage sized, left, right, constraints]">
<setup>
<RunCode code="arr = []" />
<RunCode code="row1 = new ConstraintRow()" />
<RunCode code="row1.id = 'row1'" />
<RunCode code="row1.height = 100" />
<RunCode code="arr.push(row1);" />
<RunCode code="row2 = new ConstraintRow();" />
<RunCode code="row2.id = 'row2';" />
<RunCode code="row2.height = 100;" />
<RunCode code="arr.push(row2);" />
<RunCode code="application.constraintRows = arr;" />
<RunCode code="arr = []" />
<RunCode code="col1 = new ConstraintColumn()" />
<RunCode code="col1.id = 'col1'" />
<RunCode code="col1.width = 100" />
<RunCode code="arr.push(col1);" />
<RunCode code="col2 = new ConstraintColumn();" />
<RunCode code="col2.id = 'col2';" />
<RunCode code="col2.width = 100;" />
<RunCode code="arr.push(col2);" />
<RunCode code="application.constraintColumns = arr;" />
<ResetComponent target="btn" className="mx.controls.Button" waitTarget="btn" waitEvent="updateComplete" />
<SetProperty target="getChildAt(0)" propertyName="percentWidth" value="80" waitEvent="updateComplete" waitTarget=""/>
<SetProperty target="getChildAt(0)" propertyName="percentHeight" value="80" waitEvent="updateComplete" waitTarget=""/>
</setup>
<body>
<SetStyle target="getChildAt(0)" styleName="left" value="col1:5" waitEvent="updateComplete" waitTarget=""/>
<SetStyle target="getChildAt(0)" styleName="right" value="col2:5" waitEvent="updateComplete" waitTarget=""/>
<AssertPropertyValue target="getChildAt(0)" propertyName="width" value="190" />
</body>
</TestCase>
<TestCase testID="setTopBottomConstraintsOnPercentageButton" keywords="[Button, percentage sized, top, bottom, constraints]">
<setup>
<RunCode code="arr = []" />
<RunCode code="row1 = new ConstraintRow()" />
<RunCode code="row1.id = 'row1'" />
<RunCode code="row1.height = 100" />
<RunCode code="arr.push(row1);" />
<RunCode code="row2 = new ConstraintRow();" />
<RunCode code="row2.id = 'row2';" />
<RunCode code="row2.height = 100;" />
<RunCode code="arr.push(row2);" />
<RunCode code="application.constraintRows = arr;" />
<RunCode code="arr = []" />
<RunCode code="col1 = new ConstraintColumn()" />
<RunCode code="col1.id = 'col1'" />
<RunCode code="col1.width = 100" />
<RunCode code="arr.push(col1);" />
<RunCode code="col2 = new ConstraintColumn();" />
<RunCode code="col2.id = 'col2';" />
<RunCode code="col2.width = 100;" />
<RunCode code="arr.push(col2);" />
<RunCode code="application.constraintColumns = arr;" />
<ResetComponent target="btn" className="mx.controls.Button" waitTarget="btn" waitEvent="updateComplete" />
<SetProperty target="btn" propertyName="percentWidth" value="80" waitEvent="updateComplete" waitTarget="btn"/>
<SetProperty target="btn" propertyName="percentHeight" value="80" waitEvent="updateComplete" waitTarget="btn"/>
</setup>
<body>
<SetStyle target="getChildAt(0)" styleName="top" value="row1:5" waitEvent="updateComplete" waitTarget="btn"/>
<SetStyle target="getChildAt(0)" styleName="bottom" value="row2:5" waitEvent="updateComplete" waitTarget="btn"/>
<AssertPropertyValue target="getChildAt(0)" propertyName="height" value="190" />
</body>
</TestCase>
<!-- horizontalCenter and verticalCenter tests -->
<TestCase testID="fixedColumns_Fixed_horizontalCenter_positive" keywords="[horizontalCenter, percentage sized]">
<setup>
<RunCode code="arr = []" />
<RunCode code="row1 = new ConstraintRow()" />
<RunCode code="row1.id = 'row1'" />
<RunCode code="row1.height = 100" />
<RunCode code="arr.push(row1);" />
<RunCode code="row2 = new ConstraintRow();" />
<RunCode code="row2.id = 'row2';" />
<RunCode code="row2.height = 100;" />
<RunCode code="arr.push(row2);" />
<RunCode code="application.constraintRows = arr;" />
<RunCode code="arr = []" />
<RunCode code="col1 = new ConstraintColumn()" />
<RunCode code="col1.id = 'col1'" />
<RunCode code="col1.width = 100" />
<RunCode code="arr.push(col1);" />
<RunCode code="col2 = new ConstraintColumn();" />
<RunCode code="col2.id = 'col2';" />
<RunCode code="col2.width = 100;" />
<RunCode code="arr.push(col2);" />
<RunCode code="application.constraintColumns = arr;" />
<ResetComponent target="btn" className="mx.controls.Button" waitTarget="btn" waitEvent="updateComplete" />
</setup>
<body>
<SetProperty target="getChildAt(0)" propertyName="width" value="60" waitEvent="updateComplete" waitTarget=""/>
<SetStyle target="getChildAt(0)" styleName="horizontalCenter" valueExpression="value='col1:10'" waitEvent="updateComplete" waitTarget=""/>
<AssertPropertyValue target="getChildAt(0)" propertyName="x" value="30" />
</body>
</TestCase>
<TestCase testID="fixedColumns_Fixed_horizontalCenter_zero" keywords="[horizontalCenter, percentage sized]">
<setup>
<RunCode code="arr = []" />
<RunCode code="row1 = new ConstraintRow()" />
<RunCode code="row1.id = 'row1'" />
<RunCode code="row1.height = 100" />
<RunCode code="arr.push(row1);" />
<RunCode code="row2 = new ConstraintRow();" />
<RunCode code="row2.id = 'row2';" />
<RunCode code="row2.height = 100;" />
<RunCode code="arr.push(row2);" />
<RunCode code="application.constraintRows = arr;" />
<RunCode code="arr = []" />
<RunCode code="col1 = new ConstraintColumn()" />
<RunCode code="col1.id = 'col1'" />
<RunCode code="col1.width = 100" />
<RunCode code="arr.push(col1);" />
<RunCode code="col2 = new ConstraintColumn();" />
<RunCode code="col2.id = 'col2';" />
<RunCode code="col2.width = 100;" />
<RunCode code="arr.push(col2);" />
<RunCode code="application.constraintColumns = arr;" />
<ResetComponent target="btn" className="mx.controls.Button" waitTarget="btn" waitEvent="updateComplete" />
</setup>
<body>
<SetProperty target="getChildAt(0)" propertyName="width" value="60" waitEvent="updateComplete" waitTarget=""/>
<SetStyle target="getChildAt(0)" styleName="horizontalCenter" valueExpression="value='col1:0'" waitEvent="updateComplete" waitTarget=""/>
<AssertPropertyValue target="getChildAt(0)" propertyName="x" value="20" />
</body>
</TestCase>
<TestCase testID="fixedColumns_Fixed_verticalCenter_positive" keywords="[verticalCenter, percentage sized]">
<setup>
<RunCode code="arr = []" />
<RunCode code="row1 = new ConstraintRow()" />
<RunCode code="row1.id = 'row1'" />
<RunCode code="row1.height = 100" />
<RunCode code="arr.push(row1);" />
<RunCode code="row2 = new ConstraintRow();" />
<RunCode code="row2.id = 'row2';" />
<RunCode code="row2.height = 100;" />
<RunCode code="arr.push(row2);" />
<RunCode code="application.constraintRows = arr;" />
<RunCode code="arr = []" />
<RunCode code="col1 = new ConstraintColumn()" />
<RunCode code="col1.id = 'col1'" />
<RunCode code="col1.width = 100" />
<RunCode code="arr.push(col1);" />
<RunCode code="col2 = new ConstraintColumn();" />
<RunCode code="col2.id = 'col2';" />
<RunCode code="col2.width = 100;" />
<RunCode code="arr.push(col2);" />
<RunCode code="application.constraintColumns = arr;" />
<ResetComponent target="btn" className="mx.controls.Button" waitTarget="btn" waitEvent="updateComplete" />
</setup>
<body>
<SetProperty target="getChildAt(0)" propertyName="height" value="60" waitEvent="updateComplete" waitTarget=""/>
<SetStyle target="getChildAt(0)" styleName="verticalCenter" valueExpression="value='row1:10'" waitEvent="updateComplete" waitTarget=""/>
<AssertPropertyValue target="getChildAt(0)" propertyName="y" value="30" />
</body>
</TestCase>
<TestCase testID="fixedColumns_Fixed_verticalCenter_zero" keywords="[verticalCenter, percentage sized]">
<setup>
<RunCode code="arr = []" />
<RunCode code="row1 = new ConstraintRow()" />
<RunCode code="row1.id = 'row1'" />
<RunCode code="row1.height = 100" />
<RunCode code="arr.push(row1);" />
<RunCode code="row2 = new ConstraintRow();" />
<RunCode code="row2.id = 'row2';" />
<RunCode code="row2.height = 100;" />
<RunCode code="arr.push(row2);" />
<RunCode code="application.constraintRows = arr;" />
<RunCode code="arr = []" />
<RunCode code="col1 = new ConstraintColumn()" />
<RunCode code="col1.id = 'col1'" />
<RunCode code="col1.width = 100" />
<RunCode code="arr.push(col1);" />
<RunCode code="col2 = new ConstraintColumn();" />
<RunCode code="col2.id = 'col2';" />
<RunCode code="col2.width = 100;" />
<RunCode code="arr.push(col2);" />
<RunCode code="application.constraintColumns = arr;" />
<ResetComponent target="btn" className="mx.controls.Button" waitTarget="btn" waitEvent="updateComplete" />
</setup>
<body>
<SetProperty target="getChildAt(0)" propertyName="height" value="60" waitEvent="updateComplete" waitTarget=""/>
<SetStyle target="getChildAt(0)" styleName="verticalCenter" valueExpression="value='row1:0'" waitEvent="updateComplete" waitTarget=""/>
<AssertPropertyValue target="getChildAt(0)" propertyName="y" value="20" />
</body>
</TestCase>
<TestCase testID="fixedColumns_Fixed_horizontalCenter_negative" keywords="[horizontalCenter, percentage sized]">
<setup>
<RunCode code="arr = []" />
<RunCode code="row1 = new ConstraintRow()" />
<RunCode code="row1.id = 'row1'" />
<RunCode code="row1.height = 100" />
<RunCode code="arr.push(row1);" />
<RunCode code="row2 = new ConstraintRow();" />
<RunCode code="row2.id = 'row2';" />
<RunCode code="row2.height = 100;" />
<RunCode code="arr.push(row2);" />
<RunCode code="application.constraintRows = arr;" />
<RunCode code="arr = []" />
<RunCode code="col1 = new ConstraintColumn()" />
<RunCode code="col1.id = 'col1'" />
<RunCode code="col1.width = 100" />
<RunCode code="arr.push(col1);" />
<RunCode code="col2 = new ConstraintColumn();" />
<RunCode code="col2.id = 'col2';" />
<RunCode code="col2.width = 100;" />
<RunCode code="arr.push(col2);" />
<RunCode code="application.constraintColumns = arr;" />
<ResetComponent target="btn" className="mx.controls.Button" waitTarget="btn" waitEvent="updateComplete" />
</setup>
<body>
<SetProperty target="getChildAt(0)" propertyName="width" value="60" waitEvent="updateComplete" waitTarget=""/>
<SetStyle target="getChildAt(0)" styleName="horizontalCenter" valueExpression="value='col1:-10'" waitEvent="updateComplete" waitTarget=""/>
<AssertPropertyValue target="getChildAt(0)" propertyName="x" value="10" />
</body>
</TestCase>
<TestCase testID="fixedColumns_Fixed_verticalCenter_negative" keywords="[verticalCenter, percentage sized]">
<setup>
<RunCode code="arr = []" />
<RunCode code="row1 = new ConstraintRow()" />
<RunCode code="row1.id = 'row1'" />
<RunCode code="row1.height = 100" />
<RunCode code="arr.push(row1);" />
<RunCode code="row2 = new ConstraintRow();" />
<RunCode code="row2.id = 'row2';" />
<RunCode code="row2.height = 100;" />
<RunCode code="arr.push(row2);" />
<RunCode code="application.constraintRows = arr;" />
<RunCode code="arr = []" />
<RunCode code="col1 = new ConstraintColumn()" />
<RunCode code="col1.id = 'col1'" />
<RunCode code="col1.width = 100" />
<RunCode code="arr.push(col1);" />
<RunCode code="col2 = new ConstraintColumn();" />
<RunCode code="col2.id = 'col2';" />
<RunCode code="col2.width = 100;" />
<RunCode code="arr.push(col2);" />
<RunCode code="application.constraintColumns = arr;" />
<ResetComponent target="btn" className="mx.controls.Button" waitTarget="btn" waitEvent="updateComplete" />
</setup>
<body>
<SetProperty target="getChildAt(0)" propertyName="height" value="60" waitEvent="updateComplete" waitTarget=""/>
<SetStyle target="getChildAt(0)" styleName="verticalCenter" valueExpression="value='row1:-10'" waitEvent="updateComplete" waitTarget=""/>
<AssertPropertyValue target="getChildAt(0)" propertyName="y" value="10" />
</body>
</TestCase>
</testCases>
</UnitTester>