blob: 8037b6c84a333dbc7ec1160bbe2902e08583a9ce [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
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="*"
testDir="mobile/components/RadioButton/methods/"
testSWF="MobileRadioButtonMain.mxml">
<fx:Script><![CDATA[ public static function init(o:DisplayObject):void { } ]]></fx:Script>
<fx:Metadata><![CDATA[ [Mixin] ]]></fx:Metadata>
<testCases>
<TestCase testID="Mobile_RadioButton_method_getStyle" keywords="[Mobile, RadioButton, getStyle]" description="Test getStyle method on RadioButton">
<setup>
<ResetComponent target="styleComp" className="comps.StyleComp" waitEvent="updateComplete" />
<SetProperty target="styleComp.rb1" propertyName="label" value="Test getStyle" waitEvent="updateComplete" />
<SetStyle target="styleComp.rb1" styleName="color" value="0xff0000" waitEvent="updateComplete" />
<SetStyle target="styleComp.rb1" styleName="fontStyle" value="italic" waitEvent="updateComplete" />
<SetStyle target="styleComp.rb1" styleName="fontWeight" value="bold" waitEvent="updateComplete" />
<SetStyle target="styleComp.rb1" styleName="iconPlacement" value="right" waitEvent="updateComplete" />
</setup>
<body>
<AssertMethodValue method="value=application.styleComp.rb1.getStyle('color');" value="0xff0000" />
<AssertMethodValue method="value=application.styleComp.rb1.getStyle('fontStyle');" value="italic" />
<AssertMethodValue method="value=application.styleComp.rb1.getStyle('fontWeight');" value="bold" />
<AssertMethodValue method="value=application.styleComp.rb1.getStyle('iconPlacement');" value="right" />
</body>
</TestCase>
<TestCase testID="Mobile_RadioButton_method_clearStyle_iconPlacement" keywords="[Mobile, RadioButton, clearStyle]" description="Test clearStyle method on RadioButton">
<setup>
<ResetComponent target="styleComp" className="comps.StyleComp" waitEvent="updateComplete" />
</setup>
<body>
<SetProperty target="styleComp.rb1" propertyName="label" value="Test clearStyle" waitEvent="updateComplete" />
<SetStyle target="styleComp.rb1" styleName="iconPlacement" value="top" waitEvent="updateComplete" />
<AssertStyleValue target="styleComp.rb1" styleName="iconPlacement" value="top" />
<RunCode code="application.styleComp.rb1.clearStyle('iconPlacement');" waitEvent="updateComplete" waitTarget="styleComp.rb1"/>
<CompareBitmap url="../methods/baselines" target="styleComp.rb1" >
<ConditionalValue deviceDensity="160" os="win" />
<ConditionalValue deviceDensity="240" os="android" />
<ConditionalValue deviceDensity="320" os="win" />
<ConditionalValue deviceDensity="320" os="ios" />
<ConditionalValue deviceDensity="160" os="qnx" />
</CompareBitmap>
</body>
</TestCase>
<TestCase testID="Mobile_RadioButton_clearStyle_textStyle" keywords="[Mobile, RadioButton, clearStyle]" description="Test clearStyle on text styles in RadioButton">
<setup>
<ResetComponent target="styleComp" className="comps.StyleComp" waitEvent="updateComplete" />
</setup>
<body>
<SetProperty target="styleComp.rb1" propertyName="label" value="Test clearStyle" waitEvent="updateComplete" />
<SetStyle target="styleComp.rb1" styleName="color" value="0xff0000" waitEvent="updateComplete" />
<SetStyle target="styleComp.rb1" styleName="fontSize" value="28" waitEvent="updateComplete" />
<SetStyle target="styleComp.rb1" styleName="textDecoration" value="underline" waitEvent="updateComplete" />
<RunCode code="application.styleComp.rb1.clearStyle('color');" waitEvent="updateComplete" waitTarget="styleComp.rb1" />
<RunCode code="application.styleComp.rb1.clearStyle('fontSize');" waitEvent="updateComplete" waitTarget="styleComp.rb1"/>
<RunCode code="value=application.styleComp.rb1.clearStyle('textDecoration');" waitEvent="updateComplete" waitTarget="styleComp.rb1"/>
<CompareBitmap url="../methods/baselines" target="styleComp.rb1" >
<ConditionalValue deviceDensity="160" os="win" />
<ConditionalValue deviceDensity="240" os="android" />
<ConditionalValue deviceDensity="320" os="win" />
<ConditionalValue deviceDensity="320" os="ios" />
<ConditionalValue deviceDensity="160" os="qnx" />
</CompareBitmap>
</body>
</TestCase>
</testCases>
</UnitTester>