blob: 231b037071fac36a2c38c267050df4565200c43d [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>
<!--
========================================================
horizontalAlign
========================================================
-->
<TestCase testID="horizontalAlign_test1" keywords="[TileLayout,horizontalAlign]" description="Defaults to justify." >
<setup>
<ResetComponent target="box1" className="Assets::Box1" waitEvent="updateComplete" />
</setup>
<body>
<AssertPropertyValue target="box1.group1.layout" propertyName="horizontalAlign" valueExpression="value = HorizontalAlign.JUSTIFY" />
</body>
</TestCase>
<TestCase testID="horizontalAlign_test2" keywords="[TileLayout,horizontalAlign]" description="Width of elements less than columnWidth. Set to left." >
<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="columnWidth" value="50" />
<SetProperty target="box1.group1.layout" propertyName="horizontalAlign" valueExpression="value = HorizontalAlign.LEFT" />
<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="horizontalAlign_test3" keywords="[TileLayout,horizontalAlign]" description="Width of elements less than columnWidth. Set to center." >
<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="columnWidth" value="50" />
<SetProperty target="box1.group1.layout" propertyName="horizontalAlign" valueExpression="value = HorizontalAlign.CENTER" />
<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="horizontalAlign_test4" keywords="[TileLayout,horizontalAlign]" description="Width of elements less than columnWidth. Set to right." >
<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="columnWidth" value="50" />
<SetProperty target="box1.group1.layout" propertyName="horizontalAlign" valueExpression="value = HorizontalAlign.RIGHT" />
<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="horizontalAlign_test5" keywords="[TileLayout,horizontalAlign]" description="Width of elements less than columnWidth. 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="columnWidth" value="50" />
<SetProperty target="box1.group1.layout" propertyName="horizontalAlign" valueExpression="value = HorizontalAlign.JUSTIFY" />
<RunCode code="application.addItemsToGroup(application.box1.group1, 4)" waitTarget="box1.group1" waitEvent="updateComplete" />
<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="horizontalAlign_test6" keywords="[TileLayout,horizontalAlign]" description="Width of elements equals columnWidth. Set to left." >
<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="columnWidth" value="25" />
<SetProperty target="box1.group1.layout" propertyName="horizontalAlign" valueExpression="value = HorizontalAlign.LEFT" />
<RunCode code="application.addItemsToGroup(application.box1.group1, 4)" waitTarget="box1.group1" waitEvent="updateComplete" />
<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="horizontalAlign_test7" keywords="[TileLayout,horizontalAlign]" description="Width of elements equals columnWidth. Set to center." >
<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="columnWidth" value="25" />
<SetProperty target="box1.group1.layout" propertyName="horizontalAlign" valueExpression="value = HorizontalAlign.CENTER" />
<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="horizontalAlign_test8" keywords="[TileLayout,horizontalAlign]" description="Width of elements equals columnWidth. Set to right." >
<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="columnWidth" value="25" />
<SetProperty target="box1.group1.layout" propertyName="horizontalAlign" valueExpression="value = HorizontalAlign.RIGHT" />
<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="horizontalAlign_test9" keywords="[TileLayout,horizontalAlign]" description="Width of elements equals columnWidth. 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="columnWidth" value="25" />
<SetProperty target="box1.group1.layout" propertyName="horizontalAlign" valueExpression="value = HorizontalAlign.JUSTIFY" />
<RunCode code="application.addItemsToGroup(application.box1.group1, 4)" waitTarget="box1.group1" waitEvent="updateComplete" />
<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="horizontalAlign_test10" keywords="[TileLayout,horizontalAlign]" description="Width of elements greater than columnWidth. Set to left." >
<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="columnWidth" value="15" />
<SetProperty target="box1.group1.layout" propertyName="horizontalAlign" valueExpression="value = HorizontalAlign.LEFT" />
<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="horizontalAlign_test11" keywords="[TileLayout,horizontalAlign]" description="Width of elements greater than columnWidth. Set to center." >
<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="columnWidth" value="15" />
<SetProperty target="box1.group1.layout" propertyName="horizontalAlign" valueExpression="value = HorizontalAlign.CENTER" />
<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="horizontalAlign_test12" keywords="[TileLayout,horizontalAlign]" description="Width of elements greater than columnWidth. Set to right." >
<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="columnWidth" value="15" />
<SetProperty target="box1.group1.layout" propertyName="horizontalAlign" valueExpression="value = HorizontalAlign.RIGHT" />
<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="horizontalAlign_test13" keywords="[TileLayout,horizontalAlign]" description="Width of elements greater than columnWidth. 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="columnWidth" value="15" />
<SetProperty target="box1.group1.layout" propertyName="horizontalAlign" valueExpression="value = HorizontalAlign.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="horizontalAlign_test14" keywords="[TileLayout,horizontalAlign]" description="Set to left and increase the columnWidth." >
<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="columnWidth" value="30" />
<SetProperty target="box1.group1.layout" propertyName="horizontalAlign" valueExpression="value = HorizontalAlign.LEFT" />
<RunCode code="application.addItemsToGroup(application.box1.group1, 4)" />
<SetProperty target="box1.group1.layout" propertyName="columnWidth" value="50" />
<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="horizontalAlign_test15" keywords="[TileLayout,horizontalAlign]" description="Set to center and increase the columnWidth." >
<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="columnWidth" value="30" />
<SetProperty target="box1.group1.layout" propertyName="horizontalAlign" valueExpression="value = HorizontalAlign.CENTER" />
<RunCode code="application.addItemsToGroup(application.box1.group1, 4)" />
<SetProperty target="box1.group1.layout" propertyName="columnWidth" value="50" />
<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="horizontalAlign_test16" keywords="[TileLayout,horizontalAlign]" description="Set to right and increase the columnWidth." >
<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="columnWidth" value="30" />
<SetProperty target="box1.group1.layout" propertyName="horizontalAlign" valueExpression="value = HorizontalAlign.RIGHT" />
<RunCode code="application.addItemsToGroup(application.box1.group1, 4)" />
<SetProperty target="box1.group1.layout" propertyName="columnWidth" value="50" />
<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="horizontalAlign_test17" keywords="[TileLayout,horizontalAlign]" description="Set to justify and increase the columnWidth." >
<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="columnWidth" value="30" />
<SetProperty target="box1.group1.layout" propertyName="horizontalAlign" valueExpression="value = HorizontalAlign.JUSTIFY" />
<RunCode code="application.addItemsToGroup(application.box1.group1, 4)" />
<SetProperty target="box1.group1.layout" propertyName="columnWidth" value="50" waitTarget="box1.group1" waitEvent="updateComplete" />
<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="horizontalAlign_test18" keywords="[TileLayout,horizontalAlign]" description="Set to left and decrease the columnWidth." >
<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="columnWidth" value="50" />
<SetProperty target="box1.group1.layout" propertyName="horizontalAlign" valueExpression="value = HorizontalAlign.LEFT" />
<RunCode code="application.addItemsToGroup(application.box1.group1, 4)" />
<SetProperty target="box1.group1.layout" propertyName="columnWidth" value="30" />
<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="horizontalAlign_test19" keywords="[TileLayout,horizontalAlign]" description="Set to center and decrease the columnWidth." >
<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="columnWidth" value="50" />
<SetProperty target="box1.group1.layout" propertyName="horizontalAlign" valueExpression="value = HorizontalAlign.CENTER" />
<RunCode code="application.addItemsToGroup(application.box1.group1, 4)" />
<SetProperty target="box1.group1.layout" propertyName="columnWidth" value="30" />
<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="horizontalAlign_test20" keywords="[TileLayout,horizontalAlign]" description="Set to right and decrease the columnWidth." >
<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="columnWidth" value="50" />
<SetProperty target="box1.group1.layout" propertyName="horizontalAlign" valueExpression="value = HorizontalAlign.RIGHT" />
<RunCode code="application.addItemsToGroup(application.box1.group1, 4)" />
<SetProperty target="box1.group1.layout" propertyName="columnWidth" value="30" />
<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="horizontalAlign_test21" keywords="[TileLayout,horizontalAlign]" description="Set to justify and decrease the columnWidth." >
<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="columnWidth" value="50" />
<SetProperty target="box1.group1.layout" propertyName="horizontalAlign" valueExpression="value = HorizontalAlign.JUSTIFY" />
<RunCode code="application.addItemsToGroup(application.box1.group1, 4)" />
<SetProperty target="box1.group1.layout" propertyName="columnWidth" value="30" waitTarget="box1.group1" waitEvent="updateComplete" />
<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>
</testCases>
</UnitTester>