| <?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/RadioButton/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:m="http://ns.adobe.com/mxml/2009" xmlns="*" testSWF="Flex4_RadioButton_main.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 spark.components.RadioButton; |
| |
| ]]> |
| </fx:Script> |
| |
| <testCases> |
| <TestCase testID="FxRadioButton_Style_baseColor_mxml" keywords="[FxRadioButton, baseColor]" description="Ensure that baseColor works in mxml."> |
| <body> |
| <AssertStyleValue target="baseColor_radio" styleName="chromeColor" value="0xFFFF00"/> |
| <CompareBitmap url="../styles/baselines/$testID.png" target="baseColor_radio"/> |
| </body> |
| </TestCase> |
| <TestCase testID="FxRadioButton_Style_color_mxml" keywords="[FxRadioButton, color]" description="Ensure that color works in mxml."> |
| <body> |
| <AssertStyleValue target="color_radio" styleName="color" value="0xFF0000"/> |
| <CompareBitmap url="../styles/baselines/$testID.png" target="color_radio"/> |
| </body> |
| </TestCase> |
| <TestCase testID="FxRadioButton_Style_focusColor_mxml" keywords="[FxRadioButton, focusColor]" description="Ensure that focusColor works in mxml."> |
| <setup> |
| <RunCode code="application.myRB.setFocus()" /> |
| <DispatchKeyEvent key="TAB" waitEvent="focusIn" waitTarget="focusColor_radio" /> |
| </setup> |
| <body> |
| <AssertStyleValue target="focusColor_radio" styleName="focusColor" value="0xCC0033"/> |
| <CompareBitmap url="../styles/baselines/$testID.png" target="focusColor_radio_box"/> |
| </body> |
| </TestCase> |
| <TestCase testID="FxRadioButton_Style_symbolColor_mxml" keywords="[FxRadioButton, symbolColor]" description="Ensure that contentColor works in mxml."> |
| <body> |
| <SetProperty target="symbolColor_radio" propertyName="selected" value="true" waitEvent="updateComplete" /> |
| <AssertStyleValue target="symbolColor_radio" styleName="symbolColor" value="0x9900CC"/> |
| <CompareBitmap url="../styles/baselines/$testID.png" target="symbolColor_radio"/> |
| </body> |
| </TestCase> |
| <TestCase testID="FxRadioButton_Style_baseColor_as" keywords="[FxRadioButton, baseColor]" description="Ensure that baseColor works at runtime."> |
| <setup> |
| <ResetComponent target="baseColor_radio" className="spark.components.RadioButton" waitEvent="updateComplete" waitTarget="baseColor_radio"/> |
| <SetProperty target="baseColor_radio" propertyName="groupName" value="randomGroup3" /> |
| <SetProperty target="baseColor_radio" propertyName="x" value="103" waitEvent="updateComplete" waitTarget="baseColor_radio"/> |
| <SetProperty target="baseColor_radio" propertyName="label" value="baseColor" waitEvent="updateComplete" waitTarget="baseColor_radio"/> |
| </setup> |
| <body> |
| <SetStyle target="baseColor_radio" styleName="chromeColor" value="0xFFFF00" waitEvent="updateComplete" waitTarget="baseColor_radio"/> |
| <CompareBitmap url="../styles/baselines/FxRadioButton_Style_baseColor_mxml.png" target="baseColor_radio"/> |
| </body> |
| </TestCase> |
| <TestCase testID="FxRadioButton_Style_baseColor_disabled" keywords="[FxRadioButton, baseColor]" description="Ensure that baseColor works at runtime."> |
| <setup> |
| <ResetComponent target="baseColor_radio" className="spark.components.RadioButton" waitEvent="updateComplete" waitTarget="baseColor_radio"/> |
| <SetProperty target="baseColor_radio" propertyName="groupName" value="randomGroup3" /> |
| <SetProperty target="baseColor_radio" propertyName="x" value="103" waitEvent="updateComplete" waitTarget="baseColor_radio"/> |
| <SetProperty target="baseColor_radio" propertyName="label" value="baseColor" waitEvent="updateComplete" waitTarget="baseColor_radio"/> |
| </setup> |
| <body> |
| <SetStyle target="baseColor_radio" styleName="chromeColor" value="0xFFFF00" waitEvent="updateComplete" waitTarget="baseColor_radio"/> |
| <SetProperty target="baseColor_radio" propertyName="enabled" value="false" waitEvent="updateComplete" waitTarget="baseColor_radio"/> |
| <CompareBitmap url="../styles/baselines/$testID.png" target="baseColor_radio"/> |
| </body> |
| </TestCase> |
| <TestCase testID="FxRadioButton_Style_color_as" keywords="[FxRadioButton, color]" description="Ensure that baseColor still works when a RadioButton is disabled."> |
| <setup> |
| <ResetComponent target="color_radio" className="spark.components.RadioButton" waitEvent="updateComplete" waitTarget="color_radio"/> |
| <SetProperty target="color_radio" propertyName="groupName" value="randomGroup3" /> |
| <SetProperty target="color_radio" propertyName="x" value="203" /> |
| <SetProperty target="color_radio" propertyName="label" value="color" waitEvent="updateComplete" waitTarget="color_radio"/> |
| </setup> |
| <body> |
| <SetStyle target="color_radio" styleName="color" value="0xFF0000" waitEvent="updateComplete" waitTarget="color_radio"/> |
| <CompareBitmap url="../styles/baselines/FxRadioButton_Style_color_mxml.png" target="color_radio"/> |
| </body> |
| </TestCase> |
| <TestCase testID="FxRadioButton_Style_color_disabled" keywords="[FxRadioButton, color]" description="Ensure that color still works when a RadioButton is disabled."> |
| <setup> |
| <ResetComponent target="color_radio" className="spark.components.RadioButton" waitEvent="updateComplete" waitTarget="color_radio"/> |
| <SetProperty target="color_radio" propertyName="groupName" value="randomGroup3" /> |
| <SetProperty target="color_radio" propertyName="x" value="203" /> |
| <SetProperty target="color_radio" propertyName="label" value="color" waitEvent="updateComplete" waitTarget="color_radio"/> |
| </setup> |
| <body> |
| <SetStyle target="color_radio" styleName="color" value="0xFF0000" waitEvent="updateComplete" waitTarget="color_radio"/> |
| <SetProperty target="color_radio" propertyName="enabled" value="false" waitEvent="updateComplete" waitTarget="color_radio"/> |
| <CompareBitmap url="../styles/baselines/$testID.png" target="color_radio"/> |
| </body> |
| </TestCase> |
| <TestCase testID="FxRadioButton_Style_focusColor_as" keywords="[FxRadioButton, focusColor]" description="Ensure that focusColor works at runtime."> |
| <setup> |
| <ResetComponent target="focusColor_radio" className="spark.components.RadioButton" waitEvent="updateComplete" waitTarget="focusColor_radio"/> |
| <ResetComponent target="myRB" className="spark.components.RadioButton" waitEvent="updateComplete" waitTarget="myRB"/> |
| <SetProperty target="color_radio" propertyName="groupName" value="randomGroup2" /> |
| <SetProperty target="focusColor_radio" propertyName="groupName" value="randomGroup1" /> |
| <RunCode code="application.myRB.setFocus()" /> |
| <Pause timeout="200" /> |
| <DispatchKeyEvent key="TAB" waitEvent="focusIn" waitTarget="focusColor_radio" /> |
| <SetProperty target="focusColor_radio" propertyName="x" value="3" waitEvent="updateComplete" waitTarget="focusColor_radio"/> |
| <SetProperty target="focusColor_radio" propertyName="label" value="focusColor" waitEvent="updateComplete" waitTarget="focusColor_radio"/> |
| </setup> |
| <body> |
| <SetStyle target="focusColor_radio" styleName="focusColor" value="0xCC0033" waitTarget="focusColor_radio" waitEvent="updateComplete" /> |
| <CompareBitmap url="../styles/baselines/FxRadioButton_Style_focusColor_mxml.png" target="focusColor_radio_box"/> |
| </body> |
| </TestCase> |
| |
| </testCases> |
| </UnitTester> |