blob: 2ff2caaf8ceb69ec16b9b57aa611bc4970b4f431 [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="components/TileList/Styles/" xmlns:mx="http://ns.adobe.com/mxml/2009" xmlns="*"
testSWF="TileList_ForStyles_spark.mxml">
<!-- this set of lines form a template that must be in each unit test -->
<mx:Script>
<![CDATA[
import mx.controls.TileList;
import mx.managers.SystemManager;
import mx.events.ListEvent;
import mx.collections.*;
public static function init(o:DisplayObject):void
{
}
[Bindable]
public var myDP:Array=[{label: "top"},{label: "file"},{label:"I am a Menu"},{label:"here goes Nothing"},{label:"aw, don't sell yourself short"},{label:"can you check me?"}];
[Bindable]
public var myCol:ArrayCollection;
public var myDPArray:Array = [{label: "menu 2"},{label: "mail"},{label:"inbox"},{label:"outbox"},{label:"you are a draft"},{label:"check me"},{label: "menu 1"},{label: "file"},{label:"I am a Menu"},{label:"here goes Nothing"},{label:"aw, don't sell yourself short"},{label:"can you check me?"}];
public function setArrayCollectionDP() : void
{
myCol = new ArrayCollection(myDPArray);
application.tl.dataProvider = myCol;
}
]]>
</mx:Script>
<mx:Metadata>
<![CDATA[
[Mixin]
]]>
</mx:Metadata>
<!-- end of set of lines that must be in each unit test -->
<testCases>
<TestCase testID="Spark_Color" description="Set an AS object as a dataProvider for TileList in AS" keywords="[TileList, borderColor]">
<setup>
<ResetComponent target="tl" className="mx.controls.TileList" waitEvent="updateComplete" waitTarget="tl" />
<RunCode code="application.tl.dataProvider = myDP;" waitEvent="updateComplete" waitTarget="tl" />
<DispatchKeyEvent keys="[TAB,TAB]" />
<DispatchKeyEvent key="TAB" waitTarget="tl" waitEvent="focusIn" />
<SetStyle target="tl" styleName="color" value="0xFF0000" waitEvent="updateComplete" waitTarget="tl" />
</setup>
<body>
<CompareBitmap url="../Styles/baselines/$testID.png" target="hb" />
</body>
</TestCase>
<TestCase testID="Spark_rolloverColor_default" description="Set an AS object as a dataProvider for TileList in AS" keywords="[TileList, borderColor]">
<setup>
<ResetComponent target="tl" className="mx.controls.TileList" waitEvent="updateComplete" waitTarget="tl" />
<RunCode code="application.tl.dataProvider = myDP;" waitEvent="updateComplete" waitTarget="tl" />
<DispatchKeyEvent keys="[TAB,TAB]" />
<DispatchKeyEvent key="TAB" waitTarget="tl" waitEvent="focusIn" />
<DispatchMouseEvent type="mouseMove" target="tl" localY="10" localX="10" />
<DispatchMouseEvent type="mouseMove" target="tl" localY="12" localX="12" />
<Pause timeout="100"/>
</setup>
<body>
<CompareBitmap url="../Styles/baselines/$testID.png" target="hb" />
</body>
</TestCase>
<TestCase testID="Spark_selectionColor" description="Set an AS object as a dataProvider for TileList in AS" keywords="[TileList, borderThickness]">
<setup>
<ResetComponent target="tl" className="mx.controls.TileList" waitEvent="updateComplete" waitTarget="tl" />
<RunCode code="application.tl.dataProvider = myDP;" waitEvent="updateComplete" waitTarget="tl" />
<DispatchKeyEvent keys="[TAB,TAB]" />
<DispatchKeyEvent key="TAB" waitTarget="tl" waitEvent="focusIn" />
<SetStyle target="tl" styleName="selectionColor" value="0x00FF00" waitEvent="updateComplete" waitTarget="tl" />
<SetProperty target="tl" propertyName="selectedIndex" value="1" />
<SetProperty target="tl" propertyName="width" value="110" waitEvent="updateComplete"/>
</setup>
<body>
<CompareBitmap url="../Styles/baselines/$testID.png" target="tl" numColorVariances="7" maxColorVariance="20"/>
</body>
</TestCase>
<TestCase testID="Spark_selectionColor_default" description="Set an AS object as a dataProvider for TileList in AS" keywords="[TileList, borderThickness]">
<setup>
<ResetComponent target="tl" className="mx.controls.TileList" waitEvent="updateComplete" waitTarget="tl" />
<RunCode code="application.tl.dataProvider = myDP;" waitEvent="updateComplete" waitTarget="tl" />
<DispatchKeyEvent keys="[TAB,TAB]" />
<DispatchKeyEvent key="TAB" waitTarget="tl" waitEvent="focusIn" />
<SetProperty target="tl" propertyName="selectedIndex" value="1" />
<SetProperty target="tl" propertyName="width" value="120" waitEvent="updateComplete"/>
</setup>
<body>
<CompareBitmap url="../Styles/baselines/$testID.png" target="tl" numColorVariances="7" maxColorVariance="20"/>
</body>
</TestCase>
<TestCase testID="Spark_alternatingItemColors_set" description="Set an AS object as a dataProvider for TileList in AS" keywords="[TileList, alternatingItemColors]">
<setup>
<ResetComponent target="tl" className="mx.controls.TileList" waitEvent="updateComplete" waitTarget="tl" />
<RunCode code="application.tl.dataProvider = myDP;" waitEvent="updateComplete" waitTarget="tl" />
<DispatchKeyEvent keys="[TAB,TAB]" />
<DispatchKeyEvent key="TAB" waitTarget="tl" waitEvent="focusIn" />
<SetStyle target="tl" styleName="alternatingItemColors" value="[#00FFFF, #FFFF00]" waitEvent="updateComplete" waitTarget="tl" />
</setup>
<body>
<CompareBitmap url="../Styles/baselines/$testID.png" target="hb" />
</body>
</TestCase>
<TestCase testID="Spark_contentBackgroundColor" description="Set an AS object as a dataProvider for TileList in AS" keywords="[TileList, borderThickness]">
<setup>
<ResetComponent target="tl" className="mx.controls.TileList" waitEvent="updateComplete" waitTarget="tl" />
<RunCode code="application.tl.dataProvider = myDP;" waitEvent="updateComplete" waitTarget="tl" />
<DispatchKeyEvent keys="[TAB,TAB]" />
<DispatchKeyEvent key="TAB" waitTarget="tl" waitEvent="focusIn" />
<SetStyle target="tl" styleName="contentBackgroundColor" value="0xFFFF00" waitEvent="updateComplete" waitTarget="tl" />
</setup>
<body>
<CompareBitmap url="../Styles/baselines/$testID.png" target="hb" />
</body>
</TestCase>
</testCases>
</UnitTester>