blob: abdafd06044732d1cc66a8de195aa12db83bc8cc [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/components/TabBar/Skins/" xmlns:mx="http://www.adobe.com/2006/mxml" xmlns="*" testSWF="TabBarApp1.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 Assets.*;
import mx.core.FlexGlobals;
]]>
</mx:Script>
<testCases>
<!--
===========================================
Custom Skin tests
===========================================
-->
<TestCase testID="customSkin_test1" keywords="[TabBar,skin]" description="verify customized TabBarSkin, the itemRender is checkBox" >
<setup>
<ResetComponent target="vgroup1" className="Assets.GroupWithTabBars" waitEvent="updateComplete" />
<RunCode code="FlexGlobals.topLevelApplication.setDataProvider(FlexGlobals.topLevelApplication.vgroup1.TabBarSkin1, 5)" waitTarget="vgroup1.TabBarSkin1" waitEvent="updateComplete" />
</setup>
<body>
<AssertPropertyValue target="vgroup1.TabBarSkin1.dataGroup.getElementAt(0)" propertyName="selected" value="true" />
<CompareBitmap url="../Skins/baselines/$testID.png" target="vgroup1.TabBarSkin1" numColorVariances="10" maxColorVariance="20" />
</body>
</TestCase>
<TestCase testID="customSkin_test2" keywords="[TabBar,skin]" description="verify customized TabBarSkin, the ButtonBar render has an image" >
<setup>
<ResetComponent target="vgroup1" className="Assets.GroupWithTabBars" waitEvent="updateComplete" />
<RunCode code="FlexGlobals.topLevelApplication.setDataProvider(FlexGlobals.topLevelApplication.vgroup1.TabBarSkin2, 3)" waitTarget="vgroup1.TabBarSkin2" waitEvent="updateComplete" />
</setup>
<body>
<AssertPropertyValue target="vgroup1.TabBarSkin2.dataGroup.getElementAt(0)" propertyName="selected" value="true" />
<CompareBitmap url="../Skins/baselines/$testID.png" target="vgroup1.TabBarSkin2" numColorVariances="10" maxColorVariance="20" />
</body>
</TestCase>
<TestCase testID="customSkin_test3" keywords="[TabBar,skin]" description="verify customized TabBarSkin, the itemRender has Button overlapped" >
<setup>
<ResetComponent target="vgroup1" className="Assets.GroupWithTabBars" waitEvent="updateComplete" />
<RunCode code="FlexGlobals.topLevelApplication.setDataProvider(FlexGlobals.topLevelApplication.vgroup1.TabBarSkin3, 1)" waitTarget="vgroup1.TabBarSkin3" waitEvent="updateComplete" />
</setup>
<body>
<AssertPropertyValue target="vgroup1.TabBarSkin3.dataGroup.getElementAt(0)" propertyName="selected" value="true" />
<CompareBitmap url="../Skins/baselines/$testID.png" target="vgroup1.TabBarSkin3" numColorVariances="10" maxColorVariance="20" />
</body>
</TestCase>
<TestCase testID="customSkin_test4" keywords="[TabBar,skin]" description="verify customized TabBarSkin, ButtonBarButton has different colors for different states" >
<setup>
<ResetComponent target="vgroup1" className="Assets.GroupWithTabBars" waitEvent="updateComplete" />
<RunCode code="FlexGlobals.topLevelApplication.setDataProvider(FlexGlobals.topLevelApplication.vgroup1.TabBarSkin4, 1)" waitTarget="vgroup1.TabBarSkin4" waitEvent="updateComplete" />
</setup>
<body>
<AssertPropertyValue target="vgroup1.TabBarSkin4.dataGroup.getElementAt(0)" propertyName="selected" value="true" />
<CompareBitmap url="../Skins/baselines/$testID.png" target="vgroup1.TabBarSkin4" numColorVariances="10" maxColorVariance="20" />
</body>
</TestCase>
<TestCase testID="customSkin_test5" keywords="[TabBar,skin]" description="verify customized TabBarSkin, ButtonBarButton has different colors for different states" >
<setup>
<ResetComponent target="vgroup1" className="Assets.GroupWithTabBars" waitEvent="updateComplete" />
<RunCode code="FlexGlobals.topLevelApplication.setDataProvider(FlexGlobals.topLevelApplication.vgroup1.TabBarSkin1, 1)" waitTarget="vgroup1.TabBarSkin1" waitEvent="updateComplete" />
</setup>
<body>
<SetStyle target="vgroup1.TabBarSkin1" styleName="skinClass" valueExpression="value=Assets.MyTabBarStatesSkin" waitTarget="vgroup1.TabBarSkin1" waitEvent="updateComplete"/>
<DispatchMouseEvent target="vgroup1.TabBarSkin1" type="rollOver" localY="2" localX="2" waitEvent="rollOver"/>
<CompareBitmap url="../Skins/baselines/$testID_rollOver.png" target="vgroup1.TabBarSkin1" numColorVariances="10" maxColorVariance="20" />
<DispatchMouseEvent target="vgroup1.TabBarSkin1" type="mouseOver" localY="2" localX="2" waitEvent="mouseOver" />
<CompareBitmap url="../Skins/baselines/$testID.png" target="vgroup1.TabBarSkin1" numColorVariances="10" maxColorVariance="20" />
<DispatchMouseEvent target="vgroup1.TabBarSkin1" type="mouseDown" localY="2" localX="2" waitEvent="mouseDown"/>
<CompareBitmap url="../Skins/baselines/$testID_mouseDown.png" target="vgroup1.TabBarSkin1" numColorVariances="10" maxColorVariance="20" />
</body>
</TestCase>
<TestCase testID="customSkin_test6" keywords="[TabBar,skin]" description="verify customized TabBarSkin, ButtonBarButton has different colors for different states" >
<setup>
<ResetComponent target="vgroup1" className="Assets.GroupWithTabBars" waitEvent="updateComplete" />
<RunCode code="FlexGlobals.topLevelApplication.setDataProvider(FlexGlobals.topLevelApplication.vgroup1.TabBarSkin1, 1)" waitTarget="vgroup1.TabBarSkin1" waitEvent="updateComplete" />
</setup>
<body>
<SetStyle target="vgroup1.TabBarSkin1" styleName="skinClass" valueExpression="value=Assets.MyTabBarStatesSkin" waitEvent="updateComplete" />
<SetProperty target="vgroup1.TabBarSkin1" propertyName="enabled" value="false" waitEvent="updateComplete" />
<CompareBitmap url="../Skins/baselines/$testID_disabled.png" target="vgroup1.TabBarSkin1" numColorVariances="10" maxColorVariance="20" />
<SetProperty target="vgroup1.TabBarSkin1" propertyName="enabled" value="true" waitEvent="updateComplete" />
<CompareBitmap url="../Skins/baselines/$testID_enabled.png" target="vgroup1.TabBarSkin1" numColorVariances="10" maxColorVariance="20" />
</body>
</TestCase>
</testCases>
</UnitTester>