<UnitTester testDir="gumbo/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="ComboBox_mirroring_basic.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="ComboBox_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()" /> | |
<Pause timeout="20"/> | |
<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()" /> | |
<Pause timeout="20"/> | |
<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.openDropDown()" waitEvent="open" waitTarget="cb_m1"/> | |
<CompareBitmap target="cb_m1.dropDown" url="../Styles/Baselines/$testID_3.png"/> | |
<RunCode code="FlexGlobals.topLevelApplication.cb_m1.closeDropDown(false)" waitEvent="close" waitTarget="cb_m1"/> | |
</body> | |
</TestCase> | |
<TestCase testID="ComboBox_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"/> | |
<Pause timeout="20"/> | |
<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.openDropDown()" waitEvent="open" waitTarget="cb_m1"/> | |
<CompareBitmap target="cb_m1.dropDown" url="../Styles/Baselines/$testID_3.png" numColorVariances="10" ignoreMaxColorVariance="true"/> | |
<RunCode code="FlexGlobals.topLevelApplication.cb_m1.closeDropDown(false)" waitEvent="close" waitTarget="cb_m1"/> | |
</body> | |
</TestCase> | |
<TestCase testID="ComboBox_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="ComboBox_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="ComboBox_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.openDropDown()" waitEvent="open" waitTarget="cb_m1"/> | |
<Pause timeout="100"/> | |
<DispatchKeyEvent keys="[DOWN]" /> | |
<Pause timeout="100"/> | |
<DispatchKeyEvent keys="[DOWN]" /> | |
<Pause timeout="100"/> | |
<AssertPropertyValue target="cb_m1" propertyName="caretIndex" value="2"/> | |
<DispatchKeyEvent keys="[ENTER]" waitEvent="close" waitTarget="cb_m1"/> | |
<AssertPropertyValue target="cb_m1" propertyName="selectedIndex" value="2"/> | |
<AssertPropertyValue target="cb_m1" propertyName="caretIndex" value="2"/> | |
<AssertPropertyValue target="cb_m1" propertyName="selectedItem" value="Product C"/> | |
</body> | |
</TestCase> | |
<TestCase testID="ComboBox_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.openDropDown()" waitEvent="open" waitTarget="cb_m1"/> | |
<Pause timeout="100"/> | |
<DispatchKeyEvent keys="[UP]" /> | |
<Pause timeout="100"/> | |
<DispatchKeyEvent keys="[UP]" /> | |
<Pause timeout="100"/> | |
<AssertPropertyValue target="cb_m1" propertyName="caretIndex" value="2"/> | |
<DispatchKeyEvent keys="[ENTER]" waitEvent="close" waitTarget="cb_m1"/> | |
<AssertPropertyValue target="cb_m1" propertyName="selectedIndex" value="2"/> | |
<AssertPropertyValue target="cb_m1" propertyName="caretIndex" value="2"/> | |
<AssertPropertyValue target="cb_m1" propertyName="selectedItem" value="Product C"/> | |
</body> | |
</TestCase> | |
<TestCase testID="ComboBox_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.openDropDown()" waitEvent="open" waitTarget="myPanel3.theCB"/> | |
<CompareBitmap target="myPanel3.theCB.dropDown" url="../Styles/Baselines/$testID_2.png" numColorVariances="10" ignoreMaxColorVariance="true"/> | |
<RunCode code="FlexGlobals.topLevelApplication.myPanel3.theCB.closeDropDown(false)" waitEvent="close" waitTarget="myPanel3.theCB"/> | |
</body> | |
</TestCase> | |
<TestCase testID="ComboBox_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.openDropDown()" waitEvent="open" waitTarget="myPanel3.theCB"/> | |
<CompareBitmap target="myPanel3.theCB.dropDown" url="../Styles/Baselines/$testID_2.png" numColorVariances="10" ignoreMaxColorVariance="true"/> | |
<RunCode code="FlexGlobals.topLevelApplication.myPanel3.theCB.closeDropDown(false)" waitEvent="close" waitTarget="myPanel3.theCB"/> | |
</body> | |
</TestCase> | |
<TestCase testID="ComboBox_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.openDropDown()" waitEvent="open" waitTarget="myPanel3.theCB"/> | |
<CompareBitmap target="myPanel3.theCB.dropDown" url="../Styles/Baselines/$testID_2.png" numColorVariances="10" ignoreMaxColorVariance="true"/> | |
<RunCode code="FlexGlobals.topLevelApplication.myPanel3.theCB.closeDropDown(false)" waitEvent="close" waitTarget="myPanel3.theCB"/> | |
</body> | |
</TestCase> | |
<TestCase testID="ComboBox_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.openDropDown()" waitEvent="open" waitTarget="myPanel3.theCB"/> | |
<CompareBitmap target="myPanel3.theCB.dropDown" url="../Styles/Baselines/$testID_2.png" numColorVariances="10" ignoreMaxColorVariance="true"/> | |
<RunCode code="FlexGlobals.topLevelApplication.myPanel3.theCB.closeDropDown(false)" waitEvent="close" waitTarget="myPanel3.theCB"/> | |
</body> | |
</TestCase> | |
<TestCase testID="ComboBox_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" numColorVariances="8" ignoreMaxColorVariance="true"/> | |
</body> | |
</TestCase> | |
<TestCase testID="ComboBox_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 D" waitEvent="updateComplete"/> | |
<AssertPropertyValue target="cb_m1" propertyName="selectedItem" value="Product D"/> | |
<AssertPropertyValue target="cb_m1" propertyName="selectedIndex" value="3"/> | |
<CompareBitmap target="cb_m1" url="../Styles/Baselines/$testID.png" numColorVariances="8" ignoreMaxColorVariance="true"/> | |
</body> | |
</TestCase> | |
<TestCase testID="ComboBox_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 D" waitEvent="updateComplete"/> | |
<AssertPropertyValue target="cb_m1" propertyName="selectedItem" value="Product D"/> | |
<AssertPropertyValue target="cb_m1" propertyName="selectedIndex" value="3"/> | |
<CompareBitmap target="cb_m1" url="../Styles/Baselines/$testID_1.png" numColorVariances="8" ignoreMaxColorVariance="true"/> | |
<RunCode code="FlexGlobals.topLevelApplication.cb_m1.openDropDown()" waitEvent="open" waitTarget="cb_m1"/> | |
<CompareBitmap target="cb_m1.dropDown" url="../Styles/Baselines/$testID_2.png" numColorVariances="8" ignoreMaxColorVariance="true"/> | |
<RunCode code="FlexGlobals.topLevelApplication.cb_m1.closeDropDown(false)" 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 D"/> | |
<AssertPropertyValue target="cb_m1" propertyName="selectedIndex" value="3"/> | |
<CompareBitmap target="cb_m1" url="../Styles/Baselines/$testID_3.png" numColorVariances="8" ignoreMaxColorVariance="true"/> | |
</body> | |
</TestCase> | |
</testCases> | |
</UnitTester> |