blob: dd6f2d8100eb2017ec41a463797d8f6fbb34430e [file] [log] [blame]
<UnitTester testDir="components/ComboBox/Styles/"
xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:mx="library://ns.adobe.com/flex/mx"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns="*"
testSWF="ComboBoxMirroring_wireframe.mxml">
<!-- this set of lines form a template that must be in each unit test -->
<fx:Script>
<![CDATA[
public static function init(o:DisplayObject):void
{
}
]]>
</fx:Script>
<fx:Metadata>
<![CDATA[
[Mixin]
]]>
</fx:Metadata>
<!-- end of set of lines that must be in each unit test -->
<fx:Script>
<![CDATA[
{
import mx.core.FlexGlobals;
}
]]>
</fx:Script>
<testCases>
<TestCase testID="WF_mxComboBox_Mirroring_as_default" keywords="[ComboBox, Mirroring, rtl]" description="Test layoutDirection/direction set to rtl in AS on ComboBox">
<setup>
<ResetComponent target="cb_m1" className="comps.Custom_CB_M" waitEvent="updateComplete"/>
</setup>
<body>
<RunCode code="FlexGlobals.topLevelApplication.setLdRTL()" waitTarget="cb_m1" waitEvent="layoutDirectionChanged"/>
<AssertStyleValue target="cb_m1" styleName="layoutDirection" value="rtl"/>
<CompareBitmap target="cb_m1" url="../Styles/Baselines/$testID_1.png" numColorVariances="10" ignoreMaxColorVariance="true"/>
<RunCode code="FlexGlobals.topLevelApplication.setDRTL()" waitTarget="cb_m1" waitEvent="directionChanged"/>
<AssertStyleValue target="cb_m1" styleName="direction" value="rtl"/>
<CompareBitmap target="cb_m1" url="../Styles/Baselines/$testID_2.png" numColorVariances="10" ignoreMaxColorVariance="true"/>
<RunCode code="FlexGlobals.topLevelApplication.cb_m1.open()" waitEvent="open" waitTarget="cb_m1"/>
<CompareBitmap target="cb_m1.dropdown" url="../Styles/Baselines/$testID_3.png"/>
</body>
</TestCase>
<TestCase testID="WF_mxComboBox_Mirroring_default" keywords="[ComboBox, Mirroring, rtl]" description="Test layoutDirection/direction rtl on ComboBox">
<setup>
<ResetComponent target="cb_m1" className="comps.Custom_CB_M" waitEvent="updateComplete"/>
</setup>
<body>
<AssertStyleValue target="cb_m1" styleName="layoutDirection" value="ltr"/>
<AssertStyleValue target="cb_m1" styleName="direction" value="ltr"/>
<SetStyle target="cb_m1" styleName="layoutDirection" value="rtl" waitEvent="updateComplete"/>
<AssertStyleValue target="cb_m1" styleName="layoutDirection" value="rtl"/>
<AssertStyleValue target="cb_m1" styleName="direction" value="ltr"/>
<CompareBitmap target="cb_m1" url="../Styles/Baselines/$testID_1.png" numColorVariances="10" ignoreMaxColorVariance="true"/>
<SetStyle target="cb_m1" styleName="direction" value="rtl" waitEvent="updateComplete"/>
<AssertStyleValue target="cb_m1" styleName="direction" value="rtl"/>
<AssertStyleValue target="cb_m1" styleName="layoutDirection" value="rtl"/>
<CompareBitmap target="cb_m1" url="../Styles/Baselines/$testID_2.png" numColorVariances="10" ignoreMaxColorVariance="true"/>
<RunCode code="FlexGlobals.topLevelApplication.cb_m1.open()" waitEvent="open" waitTarget="cb_m1"/>
<CompareBitmap target="cb_m1.dropdown" url="../Styles/Baselines/$testID_3.png" numColorVariances="10" ignoreMaxColorVariance="true"/>
</body>
</TestCase>
<TestCase testID="WF_mxComboBox_Mirroring_mxml_default" keywords="[ComboBox, Mirroring, rtl]" description="Test layoutDirection/direction set to rtl in MXML on ComboBox">
<setup>
<ResetComponent target="cb_m2" className="comps.Custom_CB_M_RTL" waitEvent="updateComplete"/>
</setup>
<body>
<AssertStyleValue target="cb_m2" styleName="layoutDirection" value="rtl"/>
<AssertStyleValue target="cb_m2" styleName="direction" value="rtl"/>
<CompareBitmap target="cb_m2" url="../Styles/Baselines/$testID.png" numColorVariances="10" ignoreMaxColorVariance="true"/>
</body>
</TestCase>
<TestCase testID="WF_mxComboBox_Mirroring_mxml_changeDir" keywords="[ComboBox, Mirroring, rtl]" description="Test layoutDirection set to ltr at runtime on ComboBox">
<setup>
<ResetComponent target="cb_m2" className="comps.Custom_CB_M_RTL" waitEvent="updateComplete"/>
</setup>
<body>
<AssertStyleValue target="cb_m2" styleName="layoutDirection" value="rtl"/>
<AssertStyleValue target="cb_m2" styleName="direction" value="rtl"/>
<CompareBitmap target="cb_m2" url="../Styles/Baselines/$testID_1.png" numColorVariances="10" ignoreMaxColorVariance="true"/>
<SetStyle target="cb_m2" styleName="layoutDirection" value="ltr" waitEvent="updateComplete"/>
<SetStyle target="cb_m2" styleName="direction" value="ltr" waitEvent="updateComplete"/>
<AssertStyleValue target="cb_m2" styleName="layoutDirection" value="ltr"/>
<AssertStyleValue target="cb_m2" styleName="direction" value="ltr"/>
<CompareBitmap target="cb_m2" url="../Styles/Baselines/$testID_2.png" numColorVariances="10" ignoreMaxColorVariance="true"/>
</body>
</TestCase>
<TestCase testID="WF_mxComboBox_Mirroring_keyboard1" keywords="[ComboBox, Mirroring, rtl]" description="Test keyboard navigation with layoutDirection rtl on ComboBox">
<setup>
<ResetComponent target="cb_m1" className="comps.Custom_CB_M" waitEvent="updateComplete"/>
<SetStyle target="cb_m1" styleName="layoutDirection" value="rtl" waitEvent="updateComplete"/>
</setup>
<body>
<DispatchKeyEvent keys="[TAB]" waitEvent="focusIn" waitTarget="cb_m1"/>
<RunCode code="FlexGlobals.topLevelApplication.cb_m1.open()" waitEvent="open" waitTarget="cb_m1"/>
<WaitForLayoutManager/>
<DispatchKeyEvent keys="[DOWN]" />
<WaitForLayoutManager/>
<DispatchKeyEvent keys="[DOWN]" />
<WaitForLayoutManager/>
<AssertPropertyValue target="cb_m1" propertyName="selectedIndex" value="2"/>
<DispatchKeyEvent keys="[ENTER]" waitEvent="close" waitTarget="cb_m1"/>
<AssertPropertyValue target="cb_m1" propertyName="selectedIndex" value="2"/>
<AssertPropertyValue target="cb_m1" propertyName="selectedItem" value="Product C"/>
</body>
</TestCase>
<TestCase testID="WF_mxComboBox_Mirroring_keyboard2" keywords="[ComboBox, Mirroring, rtl]" description="Test keyboard navigation with layoutDirection rtl on ComboBox">
<setup>
<ResetComponent target="cb_m1" className="comps.Custom_CB_M" waitEvent="updateComplete"/>
<SetStyle target="cb_m1" styleName="layoutDirection" value="rtl" waitEvent="updateComplete"/>
<SetProperty target="cb_m1" propertyName="selectedIndex" value="4" waitEvent="updateComplete"/>
</setup>
<body>
<DispatchKeyEvent keys="[TAB]" waitEvent="focusIn" waitTarget="cb_m1"/>
<RunCode code="FlexGlobals.topLevelApplication.cb_m1.open()" waitEvent="open" waitTarget="cb_m1"/>
<WaitForLayoutManager/>
<DispatchKeyEvent keys="[UP]" />
<WaitForLayoutManager/>
<DispatchKeyEvent keys="[UP]" />
<WaitForLayoutManager/>
<AssertPropertyValue target="cb_m1" propertyName="selectedIndex" value="2"/>
<DispatchKeyEvent keys="[ENTER]" waitEvent="close" waitTarget="cb_m1"/>
<AssertPropertyValue target="cb_m1" propertyName="selectedIndex" value="2"/>
<AssertPropertyValue target="cb_m1" propertyName="selectedItem" value="Product C"/>
</body>
</TestCase>
<TestCase testID="WF_mxComboBox_Mirroring_parentContainer1" keywords="[ComboBox, Mirroring, rtl]" description="Test setting layDirection on parentContainer of ComboBox">
<setup>
<ResetComponent target="myPanel3" className="comps.myCustomPanel_M" waitEvent="updateComplete"/>
<SetStyle target="myPanel3" styleName="layoutDirection" value="rtl" waitEvent="updateComplete"/>
</setup>
<body>
<AssertStyleValue target="myPanel3" styleName="layoutDirection" value="rtl"/>
<CompareBitmap target="myPanel3" url="../Styles/Baselines/$testID_1.png" numColorVariances="10" ignoreMaxColorVariance="true"/>
<RunCode code="FlexGlobals.topLevelApplication.myPanel3.theCB.open()" waitEvent="open" waitTarget="myPanel3.theCB"/>
<CompareBitmap target="myPanel3.theCB.dropdown" url="../Styles/Baselines/$testID_2.png" numColorVariances="10" ignoreMaxColorVariance="true"/>
</body>
</TestCase>
<TestCase testID="WF_mxComboBox_Mirroring_parentContainer2" keywords="[ComboBox, Mirroring, rtl]" description="Test setting direction on parentContainer of ComboBox">
<setup>
<ResetComponent target="myPanel3" className="comps.myCustomPanel_M" waitEvent="updateComplete"/>
<SetStyle target="myPanel3" styleName="direction" value="rtl" waitEvent="updateComplete"/>
</setup>
<body>
<AssertStyleValue target="myPanel3" styleName="direction" value="rtl"/>
<CompareBitmap target="myPanel3" url="../Styles/Baselines/$testID_1.png" numColorVariances="10" ignoreMaxColorVariance="true"/>
<RunCode code="FlexGlobals.topLevelApplication.myPanel3.theCB.open()" waitEvent="open" waitTarget="myPanel3.theCB"/>
<CompareBitmap target="myPanel3.theCB.dropdown" url="../Styles/Baselines/$testID_2.png" numColorVariances="10" ignoreMaxColorVariance="true"/>
</body>
</TestCase>
<TestCase testID="WF_mxComboBox_Mirroring_parentContainer3" keywords="[ComboBox, Mirroring, rtl]" description="Test setting layoutDirection/direction on parentContainer of ComboBox">
<setup>
<ResetComponent target="myPanel3" className="comps.myCustomPanel_M" waitEvent="updateComplete"/>
<SetStyle target="myPanel3" styleName="direction" value="rtl" waitEvent="updateComplete"/>
<SetStyle target="myPanel3" styleName="layoutDirection" value="rtl" waitEvent="updateComplete"/>
</setup>
<body>
<AssertStyleValue target="myPanel3" styleName="direction" value="rtl"/>
<AssertStyleValue target="myPanel3" styleName="layoutDirection" value="rtl"/>
<CompareBitmap target="myPanel3" url="../Styles/Baselines/$testID_1.png" numColorVariances="10" ignoreMaxColorVariance="true"/>
<RunCode code="FlexGlobals.topLevelApplication.myPanel3.theCB.open()" waitEvent="open" waitTarget="myPanel3.theCB"/>
<CompareBitmap target="myPanel3.theCB.dropdown" url="../Styles/Baselines/$testID_2.png" numColorVariances="10" ignoreMaxColorVariance="true"/>
</body>
</TestCase>
<TestCase testID="WF_mxComboBox_Mirroring_parentContainer4" keywords="[ComboBox, Mirroring, rtl]" description="Test setting styles and layoutDirection/direction on parentContainer of ComboBox">
<setup>
<ResetComponent target="myPanel3" className="comps.myCustomPanel_M" waitEvent="updateComplete"/>
<SetStyle target="myPanel3" styleName="color" value="0x00DD00" waitEvent="updateComplete"/>
<SetStyle target="myPanel3" styleName="fontSize" value="14" waitEvent="updateComplete"/>
<SetStyle target="myPanel3" styleName="chromeColor" value="0x0000DD" waitEvent="updateComplete"/>
<SetStyle target="myPanel3" styleName="direction" value="rtl" waitEvent="updateComplete"/>
<SetStyle target="myPanel3" styleName="layoutDirection" value="rtl" waitEvent="updateComplete"/>
</setup>
<body>
<AssertStyleValue target="myPanel3" styleName="direction" value="rtl"/>
<AssertStyleValue target="myPanel3" styleName="layoutDirection" value="rtl"/>
<AssertStyleValue target="myPanel3" styleName="color" value="0x00DD00" />
<AssertStyleValue target="myPanel3" styleName="fontSize" value="14" />
<AssertStyleValue target="myPanel3" styleName="chromeColor" value="0x0000DD" />
<CompareBitmap target="myPanel3" url="../Styles/Baselines/$testID_1.png" numColorVariances="10" ignoreMaxColorVariance="true"/>
<RunCode code="FlexGlobals.topLevelApplication.myPanel3.theCB.open()" waitEvent="open" waitTarget="myPanel3.theCB"/>
<CompareBitmap target="myPanel3.theCB.dropdown" url="../Styles/Baselines/$testID_2.png" numColorVariances="10" ignoreMaxColorVariance="true"/>
</body>
</TestCase>
<TestCase testID="WF_mxComboBox_Mirroring_selectedIndex" keywords="[ComboBox, Mirroring, rtl]" description="Test selectedIndex with layoutDirection/direction rtl on ComboBox">
<setup>
<ResetComponent target="cb_m1" className="comps.Custom_CB_M" waitEvent="updateComplete"/>
<SetStyle target="cb_m1" styleName="layoutDirection" value="rtl" waitEvent="updateComplete"/>
<SetStyle target="cb_m1" styleName="direction" value="rtl" waitEvent="updateComplete"/>
</setup>
<body>
<AssertStyleValue target="cb_m1" styleName="layoutDirection" value="rtl"/>
<AssertStyleValue target="cb_m1" styleName="direction" value="rtl"/>
<SetProperty target="cb_m1" propertyName="selectedIndex" value="2" waitEvent="updateComplete"/>
<AssertPropertyValue target="cb_m1" propertyName="selectedIndex" value="2"/>
<AssertPropertyValue target="cb_m1" propertyName="selectedItem" value="Product C"/>
<CompareBitmap target="cb_m1" url="../Styles/Baselines/$testID.png"/>
</body>
</TestCase>
<TestCase testID="WF_mxComboBox_Mirroring_selectedItem" keywords="[ComboBox, Mirroring, rtl]" description="Test selectedIndex with layoutDirection/direction rtl on ComboBox">
<setup>
<ResetComponent target="cb_m1" className="comps.Custom_CB_M" waitEvent="updateComplete"/>
<SetStyle target="cb_m1" styleName="layoutDirection" value="rtl" waitEvent="updateComplete"/>
<SetStyle target="cb_m1" styleName="direction" value="rtl" waitEvent="updateComplete"/>
</setup>
<body>
<AssertStyleValue target="cb_m1" styleName="layoutDirection" value="rtl"/>
<AssertStyleValue target="cb_m1" styleName="direction" value="rtl"/>
<SetProperty target="cb_m1" propertyName="selectedItem" value="Product F" waitEvent="updateComplete"/>
<AssertPropertyValue target="cb_m1" propertyName="selectedItem" value="Product F"/>
<AssertPropertyValue target="cb_m1" propertyName="selectedIndex" value="5"/>
<CompareBitmap target="cb_m1" url="../Styles/Baselines/$testID.png"/>
</body>
</TestCase>
<TestCase testID="WF_mxComboBox_Mirroring_styles" keywords="[ComboBox, Mirroring, rtl]" description="Test styles with layoutDirection/direction rtl on ComboBox">
<setup>
<ResetComponent target="cb_m1" className="comps.Custom_CB_M" waitEvent="updateComplete"/>
<SetStyle target="cb_m1" styleName="color" value="0x00FF00" waitEvent="updateComplete"/>
<SetStyle target="cb_m1" styleName="fontSize" value="16" waitEvent="updateComplete"/>
<SetStyle target="cb_m1" styleName="chromeColor" value="0xDD0000" waitEvent="updateComplete"/>
<SetStyle target="cb_m1" styleName="layoutDirection" value="rtl" waitEvent="updateComplete"/>
<SetStyle target="cb_m1" styleName="direction" value="rtl" waitEvent="updateComplete"/>
</setup>
<body>
<AssertStyleValue target="cb_m1" styleName="layoutDirection" value="rtl"/>
<AssertStyleValue target="cb_m1" styleName="direction" value="rtl"/>
<AssertStyleValue target="cb_m1" styleName="color" value="0x00FF00"/>
<AssertStyleValue target="cb_m1" styleName="fontSize" value="16"/>
<AssertStyleValue target="cb_m1" styleName="chromeColor" value="0xDD0000"/>
<SetProperty target="cb_m1" propertyName="selectedItem" value="Product F" waitEvent="updateComplete"/>
<AssertPropertyValue target="cb_m1" propertyName="selectedItem" value="Product F"/>
<AssertPropertyValue target="cb_m1" propertyName="selectedIndex" value="5"/>
<CompareBitmap target="cb_m1" url="../Styles/Baselines/$testID_1.png" numColorVariances="3" maxColorVariance="20"/>
<RunCode code="FlexGlobals.topLevelApplication.cb_m1.open()" waitEvent="open" waitTarget="cb_m1"/>
<CompareBitmap target="cb_m1.dropdown" url="../Styles/Baselines/$testID_2.png" numColorVariances="3" maxColorVariance="20"/>
<RunCode code="FlexGlobals.topLevelApplication.cb_m1.close()" waitEvent="close" waitTarget="cb_m1"/>
<SetStyle target="cb_m1" styleName="layoutDirection" value="ltr" waitEvent="updateComplete"/>
<SetStyle target="cb_m1" styleName="direction" value="ltr" waitEvent="updateComplete"/>
<AssertStyleValue target="cb_m1" styleName="layoutDirection" value="ltr"/>
<AssertStyleValue target="cb_m1" styleName="direction" value="ltr"/>
<AssertStyleValue target="cb_m1" styleName="color" value="0x00FF00"/>
<AssertStyleValue target="cb_m1" styleName="fontSize" value="16"/>
<AssertStyleValue target="cb_m1" styleName="chromeColor" value="0xDD0000"/>
<AssertPropertyValue target="cb_m1" propertyName="selectedItem" value="Product F"/>
<AssertPropertyValue target="cb_m1" propertyName="selectedIndex" value="5"/>
<CompareBitmap target="cb_m1" url="../Styles/Baselines/$testID_3.png" numColorVariances="3" maxColorVariance="20"/>
</body>
</TestCase>
</testCases>
</UnitTester>