| <?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/RadioButtonGroup/Styles/" xmlns:mx="http://www.adobe.com/2006/mxml" xmlns="*" testSWF="RBG_Basic.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 --> |
| |
| <testCases> |
| |
| <TestCase testID="RBG_Styles_Mirroring_RTL" keywords="[RadioButtonGroup, Mirroring]" description="Test layout direction rtl on RadioButtonGroup"> |
| <setup> |
| <ResetComponent target="myCustomRBG" className="CustomRBG" waitEvent="updateComplete"/> |
| </setup> |
| <body> |
| <CompareBitmap target="myCustomRBG" url="../Styles/Baselines/$testID_1.png"/> |
| <SetStyle target="myCustomRBG.rb1" styleName="layoutDirection" value="rtl" waitEvent="updateComplete"/> |
| <CompareBitmap target="myCustomRBG" url="../Styles/Baselines/$testID_2.png"/> |
| </body> |
| </TestCase> |
| |
| <TestCase testID="RBG_Styles_Mirroring_RTL_selection" keywords="[RadioButtonGroup, Mirroring]" description="Test selecting buttons with layout direction rtl on RadioButtonGroup"> |
| <setup> |
| <ResetComponent target="myCustomRBG" className="CustomRBG" waitEvent="updateComplete"/> |
| </setup> |
| <body> |
| <SetStyle target="myCustomRBG.rb1" styleName="layoutDirection" value="rtl" waitEvent="updateComplete"/> |
| <SetStyle target="myCustomRBG.rb3" styleName="layoutDirection" value="rtl" waitEvent="updateComplete"/> |
| <DispatchMouseClickEvent target="myCustomRBG.rb1" localX="6" localY="8" waitEvent="click"/> |
| <AssertPropertyValue target="myCustomRBG.rb1" propertyName="selected" value="true"/> |
| <DispatchMouseClickEvent target="myCustomRBG.rb2" localX="6" localY="8" waitEvent="click"/> |
| <AssertPropertyValue target="myCustomRBG.rb1" propertyName="selected" value="false"/> |
| <AssertPropertyValue target="myCustomRBG.rb2" propertyName="selected" value="true"/> |
| <DispatchMouseClickEvent target="myCustomRBG.rb3" localX="6" localY="8" waitEvent="click"/> |
| <AssertPropertyValue target="myCustomRBG.rb1" propertyName="selected" value="false"/> |
| <AssertPropertyValue target="myCustomRBG.rb2" propertyName="selected" value="false"/> |
| <AssertPropertyValue target="myCustomRBG.rb3" propertyName="selected" value="true"/> |
| <CompareBitmap target="myCustomRBG" url="../Styles/Baselines/$testID.png"/> |
| </body> |
| </TestCase> |
| |
| <TestCase testID="RBG_Styles_Mirroring_RTL_keySelection" keywords="[RadioButtonGroup, Mirroring]" description="Test selecting buttons with arrow keys layout direction rtl on RadioButtonGroup"> |
| <setup> |
| <ResetComponent target="myCustomRBG" className="CustomRBG" waitEvent="updateComplete"/> |
| </setup> |
| <body> |
| <SetStyle target="myCustomRBG.rb1" styleName="layoutDirection" value="rtl" waitEvent="updateComplete"/> |
| <SetStyle target="myCustomRBG.rb2" styleName="layoutDirection" value="rtl" waitEvent="updateComplete"/> |
| <SetStyle target="myCustomRBG.rb3" styleName="layoutDirection" value="rtl" waitEvent="updateComplete"/> |
| <DispatchMouseClickEvent target="myCustomRBG.rb1" localX="6" localY="8" waitEvent="click"/> |
| <AssertPropertyValue target="myCustomRBG.rb1" propertyName="selected" value="true"/> |
| <DispatchKeyEvent key="LEFT" waitEvent="focusIn" waitTarget="myCustomRBG.rb2"/> |
| <AssertPropertyValue target="myCustomRBG.rb1" propertyName="selected" value="false"/> |
| <AssertPropertyValue target="myCustomRBG.rb2" propertyName="selected" value="true"/> |
| <CompareBitmap target="myCustomRBG" url="../Styles/Baselines/$testID_1.png"/> |
| <DispatchKeyEvent key="DOWN" waitEvent="focusIn" waitTarget="myCustomRBG.rb3"/> |
| <AssertPropertyValue target="myCustomRBG.rb1" propertyName="selected" value="false"/> |
| <AssertPropertyValue target="myCustomRBG.rb2" propertyName="selected" value="false"/> |
| <AssertPropertyValue target="myCustomRBG.rb3" propertyName="selected" value="true"/> |
| <CompareBitmap target="myCustomRBG" url="../Styles/Baselines/$testID_2.png"/> |
| <DispatchKeyEvent key="RIGHT" waitEvent="focusIn" waitTarget="myCustomRBG.rb2"/> |
| <AssertPropertyValue target="myCustomRBG.rb1" propertyName="selected" value="false"/> |
| <AssertPropertyValue target="myCustomRBG.rb2" propertyName="selected" value="true"/> |
| <AssertPropertyValue target="myCustomRBG.rb3" propertyName="selected" value="false"/> |
| <DispatchKeyEvent key="UP" waitEvent="focusIn" waitTarget="myCustomRBG.rb1"/> |
| <AssertPropertyValue target="myCustomRBG.rb1" propertyName="selected" value="true"/> |
| <AssertPropertyValue target="myCustomRBG.rb2" propertyName="selected" value="false"/> |
| <AssertPropertyValue target="myCustomRBG.rb3" propertyName="selected" value="false"/> |
| <CompareBitmap target="myCustomRBG" url="../Styles/Baselines/$testID_3.png"/> |
| </body> |
| </TestCase> |
| |
| </testCases> |
| </UnitTester> |