blob: 0f052d1382b55856c477f4eb0dd7a02c42ef6930 [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/Button/styles/"
testSWF="MobileButtonMainCSSStyle.mxml">
<fx:Script><![CDATA[ public static function init(o:DisplayObject):void { } ]]></fx:Script>
<fx:Metadata><![CDATA[ [Mixin] ]]></fx:Metadata>
<testCases>
<TestCase testID="Mobile_Button_style_css_style_upState_first_button" keywords="[Button,mobile, ButtonSkin, css]" description="Test style defined on css is applied">
<body>
<AssertStyleValue target="firstB" styleName="fontSize" value="16" />
<AssertStyleValue target="firstB" styleName="color" value="0" />
<AssertStyleValue target="firstB" styleName="fontWeight" value="bold" />
<AssertStyleValue target="firstB" styleName="chromeColor" value="0xCCCCCC" />
<CompareBitmap url="../styles/baselines" target="firstB" >
<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_Button_style_css_style_down_state_first_button" keywords="[Button,mobile, ButtonSkin, css]" description="Test style is applied on down state of button">
<body>
<DispatchMouseEvent target="firstB" type="rollOver" localX="57" localY="19" />
<DispatchMouseEvent target="firstB" type="mouseMove" localX="57" localY="19" waitEvent="mouseMove" />
<DispatchMouseEvent target="firstB" type="mouseOver" localX="57" localY="19" waitEvent="mouseOver" />
<DispatchMouseEvent target="firstB" type="mouseDown" localX="57" localY="19" waitEvent="buttonDown" waitTarget="firstB" />
<AssertStyleValue target="firstB" styleName="color" value="0x33CC33" />
<CompareBitmap url="../styles/baselines" target="firstB" >
<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>
<DispatchMouseEvent target="firstB" type="mouseUp" localX="57" localY="19" waitEvent="mouseUp" />
</body>
</TestCase>
<TestCase testID="Mobile_Button_style_css_style_up_state_second_button" keywords="[Button,mobile, ButtonSkin, css]" description="Test style defined on css is applied">
<body>
<AssertStyleValue target="secondB" styleName="color" value="0" />
<AssertStyleValue target="secondB" styleName="chromeColor" value="0xff0000" />
<AssertStyleValue target="secondB" styleName="fontWeight" value="bold" />
<CompareBitmap url="../styles/baselines" target="secondB" >
<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_Button_style_css_style_disabled_state" keywords="[Button,mobile, ButtonSkin, css]" description="Test disabled state style is applied on a button">
<body>
<AssertStyleValue target="thirdB" styleName="color" value="0x0000ff" />
<AssertStyleValue target="thirdB" styleName="fontSize" value="24" >
<ConditionalValue deviceDensity="160" os="win" value="16" />
<ConditionalValue deviceDensity="240" os="android" value="24" />
<ConditionalValue deviceDensity="320" os="win" value="32" />
<ConditionalValue deviceDensity="320" os="ios" value="32" />
<ConditionalValue deviceDensity="160" os="qnx" value="16" />
</AssertStyleValue>
<AssertStyleValue target="thirdB" styleName="fontWeight" value="bold" />
<CompareBitmap url="../styles/baselines" target="thirdB" >
<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_Button_style_css_iconPlacement" keywords="[Button, mobile, css, iconPlacement]" description="Test setting iconPlacement in css">
<setup>
<ResetComponent target="secondB" className="spark.components.Button" waitEvent="updateComplete"/>
<SetProperty target="secondB" propertyName="label" value="Save" waitEvent="contentChange"/>
<SetStyle target="secondB" styleName="icon" value="@Embed('../../../../../Assets/Images/ButtonImages/save48x48.gif')" waitEvent="updateComplete"/>
</setup>
<body>
<AssertStyleValue target="secondB" styleName="iconPlacement" value="right"/>
<CompareBitmap url="../styles/baselines" target="secondB" >
<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>