blob: 7e31806008bcc0abae74b3606cd8c94425695569 [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="gumbo/layout/TileLayout/properties/" xmlns:mx="http://www.adobe.com/2006/mxml" xmlns="*" testSWF="TileLayoutApp1.mxml">
<!-- this set of lines form a template that must be in each unit test -->
<mx:Script>
<![CDATA[
public static function init(o:DisplayObject):void
{
}
]]>
</mx:Script>
<mx:Metadata>
<![CDATA[
[Mixin]
]]>
</mx:Metadata>
<!-- end of set of lines that must be in each unit test -->
<mx:Script>
<![CDATA[
import spark.layouts.*;
]]>
</mx:Script>
<testCases>
<!--
========================================================
verticalAlign
========================================================
-->
<TestCase testID="verticalAlign_test1" keywords="[TileLayout,verticalAlign]" description="Defaults to justify." >
<setup>
<ResetComponent target="box1" className="Assets::Box1" waitEvent="updateComplete" />
</setup>
<body>
<AssertPropertyValue target="box1.group1.layout" propertyName="verticalAlign" valueExpression="value = VerticalAlign.JUSTIFY" />
</body>
</TestCase>
<TestCase testID="verticalAlign_test2" keywords="[TileLayout,verticalAlign]" description="Height of elements less than rowHeight. Set to top." >
<setup>
<ResetComponent target="box1" className="Assets::Box1" waitEvent="updateComplete" />
</setup>
<body>
<SetProperty target="box1.group1" propertyName="width" value="110" />
<SetProperty target="box1.group1" propertyName="height" value="110" />
<SetProperty target="box1.group1.layout" propertyName="rowHeight" value="50" />
<SetProperty target="box1.group1.layout" propertyName="verticalAlign" valueExpression="value = VerticalAlign.TOP" />
<RunCode code="application.addItemsToGroup(application.box1.group1, 4)" />
<RunCode code="application.setPropsOnGroupElements(application.box1.group1, 'width', 25)" />
<RunCode code="application.setPropsOnGroupElements(application.box1.group1, 'height', 25)" waitTarget="box1.group1" waitEvent="updateComplete" />
<CompareBitmap url="../properties/baselines/$testID.png" target="box1" />
</body>
</TestCase>
<TestCase testID="verticalAlign_test3" keywords="[TileLayout,verticalAlign]" description="Height of elements less than rowHeight. Set to middle." >
<setup>
<ResetComponent target="box1" className="Assets::Box1" waitEvent="updateComplete" />
</setup>
<body>
<SetProperty target="box1.group1" propertyName="width" value="110" />
<SetProperty target="box1.group1" propertyName="height" value="110" />
<SetProperty target="box1.group1.layout" propertyName="rowHeight" value="50" />
<SetProperty target="box1.group1.layout" propertyName="verticalAlign" valueExpression="value = VerticalAlign.MIDDLE" />
<RunCode code="application.addItemsToGroup(application.box1.group1, 4)" />
<RunCode code="application.setPropsOnGroupElements(application.box1.group1, 'width', 25)" />
<RunCode code="application.setPropsOnGroupElements(application.box1.group1, 'height', 25)" waitTarget="box1.group1" waitEvent="updateComplete" />
<CompareBitmap url="../properties/baselines/$testID.png" target="box1" />
</body>
</TestCase>
<TestCase testID="verticalAlign_test4" keywords="[TileLayout,verticalAlign]" description="Height of elements less than rowHeight. Set to bottom." >
<setup>
<ResetComponent target="box1" className="Assets::Box1" waitEvent="updateComplete" />
</setup>
<body>
<SetProperty target="box1.group1" propertyName="width" value="110" />
<SetProperty target="box1.group1" propertyName="height" value="110" />
<SetProperty target="box1.group1.layout" propertyName="rowHeight" value="50" />
<SetProperty target="box1.group1.layout" propertyName="verticalAlign" valueExpression="value = VerticalAlign.BOTTOM" />
<RunCode code="application.addItemsToGroup(application.box1.group1, 4)" />
<RunCode code="application.setPropsOnGroupElements(application.box1.group1, 'width', 25)" />
<RunCode code="application.setPropsOnGroupElements(application.box1.group1, 'height', 25)" waitTarget="box1.group1" waitEvent="updateComplete" />
<CompareBitmap url="../properties/baselines/$testID.png" target="box1" />
</body>
</TestCase>
<TestCase testID="verticalAlign_test5" keywords="[TileLayout,verticalAlign]" description="Height of elements less than rowHeight. Set to justify." >
<setup>
<ResetComponent target="box1" className="Assets::Box1" waitEvent="updateComplete" />
</setup>
<body>
<SetProperty target="box1.group1" propertyName="width" value="110" />
<SetProperty target="box1.group1" propertyName="height" value="110" />
<SetProperty target="box1.group1.layout" propertyName="rowHeight" value="50" />
<SetProperty target="box1.group1.layout" propertyName="verticalAlign" valueExpression="value = VerticalAlign.JUSTIFY" />
<RunCode code="application.addItemsToGroup(application.box1.group1, 4)" />
<RunCode code="application.setPropsOnGroupElements(application.box1.group1, 'width', 25)" />
<RunCode code="application.setPropsOnGroupElements(application.box1.group1, 'height', 25)" waitTarget="box1.group1" waitEvent="updateComplete" />
<CompareBitmap url="../properties/baselines/$testID.png" target="box1" />
</body>
</TestCase>
<TestCase testID="verticalAlign_test6" keywords="[TileLayout,verticalAlign]" description="Height of elements equals rowHeight. Set to top." >
<setup>
<ResetComponent target="box1" className="Assets::Box1" waitEvent="updateComplete" />
</setup>
<body>
<SetProperty target="box1.group1" propertyName="width" value="110" />
<SetProperty target="box1.group1" propertyName="height" value="110" />
<SetProperty target="box1.group1.layout" propertyName="rowHeight" value="25" />
<SetProperty target="box1.group1.layout" propertyName="verticalAlign" valueExpression="value = VerticalAlign.TOP" />
<RunCode code="application.addItemsToGroup(application.box1.group1, 4)" />
<RunCode code="application.setPropsOnGroupElements(application.box1.group1, 'width', 25)" />
<RunCode code="application.setPropsOnGroupElements(application.box1.group1, 'height', 25)" waitTarget="box1.group1" waitEvent="updateComplete" />
<CompareBitmap url="../properties/baselines/$testID.png" target="box1" />
</body>
</TestCase>
<TestCase testID="verticalAlign_test7" keywords="[TileLayout,verticalAlign]" description="Height of elements equals rowHeight. Set to middle." >
<setup>
<ResetComponent target="box1" className="Assets::Box1" waitEvent="updateComplete" />
</setup>
<body>
<SetProperty target="box1.group1" propertyName="width" value="110" />
<SetProperty target="box1.group1" propertyName="height" value="110" />
<SetProperty target="box1.group1.layout" propertyName="rowHeight" value="25" />
<SetProperty target="box1.group1.layout" propertyName="verticalAlign" valueExpression="value = VerticalAlign.MIDDLE" />
<RunCode code="application.addItemsToGroup(application.box1.group1, 4)" />
<RunCode code="application.setPropsOnGroupElements(application.box1.group1, 'width', 25)" />
<RunCode code="application.setPropsOnGroupElements(application.box1.group1, 'height', 25)" waitTarget="box1.group1" waitEvent="updateComplete" />
<CompareBitmap url="../properties/baselines/$testID.png" target="box1" />
</body>
</TestCase>
<TestCase testID="verticalAlign_test8" keywords="[TileLayout,verticalAlign]" description="Height of elements equals rowHeight. Set to bottom." >
<setup>
<ResetComponent target="box1" className="Assets::Box1" waitEvent="updateComplete" />
</setup>
<body>
<SetProperty target="box1.group1" propertyName="width" value="110" />
<SetProperty target="box1.group1" propertyName="height" value="110" />
<SetProperty target="box1.group1.layout" propertyName="rowHeight" value="25" />
<SetProperty target="box1.group1.layout" propertyName="verticalAlign" valueExpression="value = VerticalAlign.BOTTOM" />
<RunCode code="application.addItemsToGroup(application.box1.group1, 4)" />
<RunCode code="application.setPropsOnGroupElements(application.box1.group1, 'width', 25)" />
<RunCode code="application.setPropsOnGroupElements(application.box1.group1, 'height', 25)" waitTarget="box1.group1" waitEvent="updateComplete" />
<CompareBitmap url="../properties/baselines/$testID.png" target="box1" />
</body>
</TestCase>
<TestCase testID="verticalAlign_test9" keywords="[TileLayout,verticalAlign]" description="Height of elements equals rowHeight. Set to justify." >
<setup>
<ResetComponent target="box1" className="Assets::Box1" waitEvent="updateComplete" />
</setup>
<body>
<SetProperty target="box1.group1" propertyName="width" value="110" />
<SetProperty target="box1.group1" propertyName="height" value="110" />
<SetProperty target="box1.group1.layout" propertyName="rowHeight" value="25" />
<SetProperty target="box1.group1.layout" propertyName="verticalAlign" valueExpression="value = VerticalAlign.JUSTIFY" />
<RunCode code="application.addItemsToGroup(application.box1.group1, 4)" />
<RunCode code="application.setPropsOnGroupElements(application.box1.group1, 'width', 25)" />
<RunCode code="application.setPropsOnGroupElements(application.box1.group1, 'height', 25)" waitTarget="box1.group1" waitEvent="updateComplete" />
<CompareBitmap url="../properties/baselines/$testID.png" target="box1" />
</body>
</TestCase>
<TestCase testID="verticalAlign_test10" keywords="[TileLayout,verticalAlign]" description="Height of elements greater than rowHeight. Set to top." >
<setup>
<ResetComponent target="box1" className="Assets::Box1" waitEvent="updateComplete" />
</setup>
<body>
<SetProperty target="box1.group1" propertyName="width" value="110" />
<SetProperty target="box1.group1" propertyName="height" value="110" />
<SetProperty target="box1.group1.layout" propertyName="rowHeight" value="15" />
<SetProperty target="box1.group1.layout" propertyName="verticalAlign" valueExpression="value = VerticalAlign.TOP" />
<RunCode code="application.addItemsToGroup(application.box1.group1, 4, 1)" />
<RunCode code="application.setPropsOnGroupElements(application.box1.group1, 'width', 25)" />
<RunCode code="application.setPropsOnGroupElements(application.box1.group1, 'height', 25)" waitTarget="box1.group1" waitEvent="updateComplete" />
<CompareBitmap url="../properties/baselines/$testID.png" target="box1" />
</body>
</TestCase>
<TestCase testID="verticalAlign_test11" keywords="[TileLayout,verticalAlign]" description="Height of elements greater than rowHeight. Set to middle." >
<setup>
<ResetComponent target="box1" className="Assets::Box1" waitEvent="updateComplete" />
</setup>
<body>
<SetProperty target="box1.group1" propertyName="width" value="110" />
<SetProperty target="box1.group1" propertyName="height" value="110" />
<SetProperty target="box1.group1.layout" propertyName="rowHeight" value="15" />
<SetProperty target="box1.group1.layout" propertyName="verticalAlign" valueExpression="value = VerticalAlign.MIDDLE" />
<RunCode code="application.addItemsToGroup(application.box1.group1, 4, 1)" />
<RunCode code="application.setPropsOnGroupElements(application.box1.group1, 'width', 25)" />
<RunCode code="application.setPropsOnGroupElements(application.box1.group1, 'height', 25)" waitTarget="box1.group1" waitEvent="updateComplete" />
<CompareBitmap url="../properties/baselines/$testID.png" target="box1" />
</body>
</TestCase>
<TestCase testID="verticalAlign_test12" keywords="[TileLayout,verticalAlign]" description="Height of elements greater than rowHeight. Set to bottom." >
<setup>
<ResetComponent target="box1" className="Assets::Box1" waitEvent="updateComplete" />
</setup>
<body>
<SetProperty target="box1.group1" propertyName="width" value="110" />
<SetProperty target="box1.group1" propertyName="height" value="110" />
<SetProperty target="box1.group1.layout" propertyName="rowHeight" value="15" />
<SetProperty target="box1.group1.layout" propertyName="verticalAlign" valueExpression="value = VerticalAlign.BOTTOM" />
<RunCode code="application.addItemsToGroup(application.box1.group1, 4, 1)" />
<RunCode code="application.setPropsOnGroupElements(application.box1.group1, 'width', 25)" />
<RunCode code="application.setPropsOnGroupElements(application.box1.group1, 'height', 25)" waitTarget="box1.group1" waitEvent="updateComplete" />
<CompareBitmap url="../properties/baselines/$testID.png" target="box1" />
</body>
</TestCase>
<TestCase testID="verticalAlign_test13" keywords="[TileLayout,verticalAlign]" description="Height of elements greater than rowHeight. Set to justify." >
<setup>
<ResetComponent target="box1" className="Assets::Box1" waitEvent="updateComplete" />
</setup>
<body>
<SetProperty target="box1.group1" propertyName="width" value="110" />
<SetProperty target="box1.group1" propertyName="height" value="110" />
<SetProperty target="box1.group1.layout" propertyName="rowHeight" value="15" />
<SetProperty target="box1.group1.layout" propertyName="verticalAlign" valueExpression="value = VerticalAlign.JUSTIFY" />
<RunCode code="application.addItemsToGroup(application.box1.group1, 4, 1)" />
<RunCode code="application.setPropsOnGroupElements(application.box1.group1, 'width', 25)" />
<RunCode code="application.setPropsOnGroupElements(application.box1.group1, 'height', 25)" waitTarget="box1.group1" waitEvent="updateComplete" />
<CompareBitmap url="../properties/baselines/$testID.png" target="box1" />
</body>
</TestCase>
<TestCase testID="verticalAlign_test14" keywords="[TileLayout,verticalAlign]" description="Set to top and increase the rowHeight." >
<setup>
<ResetComponent target="box1" className="Assets::Box1" waitEvent="updateComplete" />
</setup>
<body>
<SetProperty target="box1.group1" propertyName="width" value="110" />
<SetProperty target="box1.group1" propertyName="height" value="110" />
<SetProperty target="box1.group1.layout" propertyName="rowHeight" value="30" />
<SetProperty target="box1.group1.layout" propertyName="verticalAlign" valueExpression="value = VerticalAlign.TOP" />
<RunCode code="application.addItemsToGroup(application.box1.group1, 4)" />
<RunCode code="application.setPropsOnGroupElements(application.box1.group1, 'width', 25)" />
<RunCode code="application.setPropsOnGroupElements(application.box1.group1, 'height', 25)" />
<SetProperty target="box1.group1.layout" propertyName="rowHeight" value="50" waitTarget="box1.group1" waitEvent="updateComplete" />
<CompareBitmap url="../properties/baselines/$testID.png" target="box1" />
</body>
</TestCase>
<TestCase testID="verticalAlign_test15" keywords="[TileLayout,verticalAlign]" description="Set to middle and increase the rowHeight." >
<setup>
<ResetComponent target="box1" className="Assets::Box1" waitEvent="updateComplete" />
</setup>
<body>
<SetProperty target="box1.group1" propertyName="width" value="110" />
<SetProperty target="box1.group1" propertyName="height" value="110" />
<SetProperty target="box1.group1.layout" propertyName="rowHeight" value="30" />
<SetProperty target="box1.group1.layout" propertyName="verticalAlign" valueExpression="value = VerticalAlign.MIDDLE" />
<RunCode code="application.addItemsToGroup(application.box1.group1, 4)" />
<RunCode code="application.setPropsOnGroupElements(application.box1.group1, 'width', 25)" />
<RunCode code="application.setPropsOnGroupElements(application.box1.group1, 'height', 25)" />
<SetProperty target="box1.group1.layout" propertyName="rowHeight" value="50" waitTarget="box1.group1" waitEvent="updateComplete" />
<CompareBitmap url="../properties/baselines/$testID.png" target="box1" />
</body>
</TestCase>
<TestCase testID="verticalAlign_test16" keywords="[TileLayout,verticalAlign]" description="Set to bottom and increase the rowHeight." >
<setup>
<ResetComponent target="box1" className="Assets::Box1" waitEvent="updateComplete" />
</setup>
<body>
<SetProperty target="box1.group1" propertyName="width" value="110" />
<SetProperty target="box1.group1" propertyName="height" value="110" />
<SetProperty target="box1.group1.layout" propertyName="rowHeight" value="30" />
<SetProperty target="box1.group1.layout" propertyName="verticalAlign" valueExpression="value = VerticalAlign.BOTTOM" />
<RunCode code="application.addItemsToGroup(application.box1.group1, 4)" />
<RunCode code="application.setPropsOnGroupElements(application.box1.group1, 'width', 25)" />
<RunCode code="application.setPropsOnGroupElements(application.box1.group1, 'height', 25)" />
<SetProperty target="box1.group1.layout" propertyName="rowHeight" value="50" waitTarget="box1.group1" waitEvent="updateComplete" />
<CompareBitmap url="../properties/baselines/$testID.png" target="box1" />
</body>
</TestCase>
<TestCase testID="verticalAlign_test17" keywords="[TileLayout,verticalAlign]" description="Set to justify and increase the rowHeight." >
<setup>
<ResetComponent target="box1" className="Assets::Box1" waitEvent="updateComplete" />
</setup>
<body>
<SetProperty target="box1.group1" propertyName="width" value="110" />
<SetProperty target="box1.group1" propertyName="height" value="110" />
<SetProperty target="box1.group1.layout" propertyName="rowHeight" value="30" />
<SetProperty target="box1.group1.layout" propertyName="verticalAlign" valueExpression="value = VerticalAlign.JUSTIFY" />
<RunCode code="application.addItemsToGroup(application.box1.group1, 4)" />
<RunCode code="application.setPropsOnGroupElements(application.box1.group1, 'width', 25)" />
<RunCode code="application.setPropsOnGroupElements(application.box1.group1, 'height', 25)" />
<SetProperty target="box1.group1.layout" propertyName="rowHeight" value="50" waitTarget="box1.group1" waitEvent="updateComplete" />
<CompareBitmap url="../properties/baselines/$testID.png" target="box1" />
</body>
</TestCase>
<TestCase testID="verticalAlign_test18" keywords="[TileLayout,verticalAlign]" description="Set to top and decrease the rowHeight." >
<setup>
<ResetComponent target="box1" className="Assets::Box1" waitEvent="updateComplete" />
</setup>
<body>
<SetProperty target="box1.group1" propertyName="width" value="110" />
<SetProperty target="box1.group1" propertyName="height" value="110" />
<SetProperty target="box1.group1.layout" propertyName="rowHeight" value="50" />
<SetProperty target="box1.group1.layout" propertyName="verticalAlign" valueExpression="value = VerticalAlign.TOP" />
<RunCode code="application.addItemsToGroup(application.box1.group1, 4)" />
<RunCode code="application.setPropsOnGroupElements(application.box1.group1, 'width', 25)" />
<RunCode code="application.setPropsOnGroupElements(application.box1.group1, 'height', 25)" />
<SetProperty target="box1.group1.layout" propertyName="rowHeight" value="30" waitTarget="box1.group1" waitEvent="updateComplete" />
<CompareBitmap url="../properties/baselines/$testID.png" target="box1" />
</body>
</TestCase>
<TestCase testID="verticalAlign_test19" keywords="[TileLayout,verticalAlign]" description="Set to middle and decrease the rowHeight." >
<setup>
<ResetComponent target="box1" className="Assets::Box1" waitEvent="updateComplete" />
</setup>
<body>
<SetProperty target="box1.group1" propertyName="width" value="110" />
<SetProperty target="box1.group1" propertyName="height" value="110" />
<SetProperty target="box1.group1.layout" propertyName="rowHeight" value="50" />
<SetProperty target="box1.group1.layout" propertyName="verticalAlign" valueExpression="value = VerticalAlign.MIDDLE" />
<RunCode code="application.addItemsToGroup(application.box1.group1, 4)" />
<RunCode code="application.setPropsOnGroupElements(application.box1.group1, 'width', 25)" />
<RunCode code="application.setPropsOnGroupElements(application.box1.group1, 'height', 25)" />
<SetProperty target="box1.group1.layout" propertyName="rowHeight" value="30" waitTarget="box1.group1" waitEvent="updateComplete" />
<CompareBitmap url="../properties/baselines/$testID.png" target="box1" />
</body>
</TestCase>
<TestCase testID="verticalAlign_test20" keywords="[TileLayout,verticalAlign]" description="Set to bottom and decrease the rowHeight." >
<setup>
<ResetComponent target="box1" className="Assets::Box1" waitEvent="updateComplete" />
</setup>
<body>
<SetProperty target="box1.group1" propertyName="width" value="110" />
<SetProperty target="box1.group1" propertyName="height" value="110" />
<SetProperty target="box1.group1.layout" propertyName="rowHeight" value="50" />
<SetProperty target="box1.group1.layout" propertyName="verticalAlign" valueExpression="value = VerticalAlign.BOTTOM" />
<RunCode code="application.addItemsToGroup(application.box1.group1, 4)" />
<RunCode code="application.setPropsOnGroupElements(application.box1.group1, 'width', 25)" />
<RunCode code="application.setPropsOnGroupElements(application.box1.group1, 'height', 25)" />
<SetProperty target="box1.group1.layout" propertyName="rowHeight" value="30" waitTarget="box1.group1" waitEvent="updateComplete" />
<CompareBitmap url="../properties/baselines/$testID.png" target="box1" />
</body>
</TestCase>
<TestCase testID="verticalAlign_test21" keywords="[TileLayout,verticalAlign]" description="Set to justify and decrease the rowHeight." >
<setup>
<ResetComponent target="box1" className="Assets::Box1" waitEvent="updateComplete" />
</setup>
<body>
<SetProperty target="box1.group1" propertyName="width" value="110" />
<SetProperty target="box1.group1" propertyName="height" value="110" />
<SetProperty target="box1.group1.layout" propertyName="rowHeight" value="50" />
<SetProperty target="box1.group1.layout" propertyName="verticalAlign" valueExpression="value = VerticalAlign.JUSTIFY" />
<RunCode code="application.addItemsToGroup(application.box1.group1, 4)" />
<RunCode code="application.setPropsOnGroupElements(application.box1.group1, 'width', 25)" />
<RunCode code="application.setPropsOnGroupElements(application.box1.group1, 'height', 25)" />
<SetProperty target="box1.group1.layout" propertyName="rowHeight" value="30" waitTarget="box1.group1" waitEvent="updateComplete" />
<CompareBitmap url="../properties/baselines/$testID.png" target="box1" />
</body>
</TestCase>
</testCases>
</UnitTester>