blob: 89acbb124673122c6d9bc1f4aa3c1bec5c5ebf40 [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 testDir="components/Alert/Styles/" xmlns:mx="http://www.adobe.com/2006/mxml" xmlns="*" testSWF="Alert_Basic.mxml">
<!-- this set of lines Alert 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 -->
<mx:Script>
<![CDATA[
import mx.controls.Alert;
import mx.core.IFlexDisplayObject;
]]>
</mx:Script>
<testCases>
<TestCase testID="Alert_letterSpacing" description="Test letterSpacing of Alert" keywords="[Alert,letterSpacing]" >
<setup>
<DispatchKeyEvent key="SPACE" />
<RunCode code="application.curAlert= new Alert()" />
<RunCode code="application.curAlert = Alert.show('Check the Cancel button.', 'Alert Test', 12)" />
<SetStyle target="curAlert" styleName="letterSpacing" value="0" waitEvent="updateComplete" waitTarget="curAlert"/>
<WaitForEffectsToEnd />
</setup>
<body>
<AssertStyleValue target="curAlert" styleName="letterSpacing" value="0" />
<CompareBitmap target="curAlert" url="../Styles/baselines/letterSpacing.png" timeout="5000" numColorVariances="4" ignoreMaxColorVariance="true"/>
<DispatchKeyEvent key="TAB" waitTarget="curAlert.mx_internal:alertForm.mx_internal:buttons.1" waitEvent="focusIn" />
<DispatchKeyEvent key="ESCAPE" waitTarget="curAlert" waitEvent="removed" />
<AssertEvent target="curAlert" eventName="close" eventClass="mx.events::CloseEvent" />
<WaitForEffectsToEnd />
</body>
</TestCase>
<TestCase testID="Alert_buttonStyleName" description="Test buttonStyleName of Alert" keywords="[Alert,buttonStyleName]" >
<setup>
<DispatchKeyEvent key="SPACE" />
<RunCode code="application.curAlert= new Alert()" />
<RunCode code="application.curAlert = Alert.show('Check the buttonStyleName.', 'Alert Test', 3)" />
<SetStyle target="curAlert" styleName="buttonStyleName" value="myStyle" waitEvent="updateComplete" waitTarget="curAlert"/>
<WaitForEffectsToEnd />
</setup>
<body>
<AssertStyleValue target="curAlert" styleName="buttonStyleName" value="myStyle" />
<CompareBitmap target="curAlert" url="../Styles/baselines/buttonStyleName.png" timeout="5000" />
<DispatchKeyEvent key="TAB" waitTarget="curAlert.mx_internal:alertForm.mx_internal:buttons.1" waitEvent="focusIn" />
<DispatchKeyEvent key="ESCAPE" waitTarget="curAlert" waitEvent="removed" />
<AssertEvent target="curAlert" eventName="close" eventClass="mx.events::CloseEvent" />
<WaitForEffectsToEnd />
</body>
</TestCase>
<TestCase testID="Alert_messageStyleName" description="Test messageStyleName of Alert" keywords="[Alert,buttonStyleName]" >
<setup>
<DispatchKeyEvent key="SPACE" />
<RunCode code="application.curAlert= new Alert()" />
<RunCode code="application.curAlert = Alert.show('Check the messageStyleName style.', 'Alert Test', 3)" />
<SetStyle target="curAlert" styleName="messageStyleName" value="myStyle" waitEvent="updateComplete" waitTarget="curAlert"/>
<WaitForEffectsToEnd />
</setup>
<body>
<AssertStyleValue target="curAlert" styleName="messageStyleName" value="myStyle" />
<CompareBitmap target="curAlert" url="../Styles/baselines/messageStyleName.png" timeout="5000" numColorVariances="4" ignoreMaxColorVariance="true"/>
<DispatchKeyEvent key="TAB" waitTarget="curAlert.mx_internal:alertForm.mx_internal:buttons.1" waitEvent="focusIn" />
<DispatchKeyEvent key="ESCAPE" waitTarget="curAlert" waitEvent="removed" />
<AssertEvent target="curAlert" eventName="close" eventClass="mx.events::CloseEvent" />
<WaitForEffectsToEnd />
</body>
</TestCase>
<TestCase testID="Alert_titleStyleName" description="Test titleStyleName of Alert" keywords="[Alert,titleStyleName ]" >
<setup>
<DispatchKeyEvent key="SPACE" />
<RunCode code="application.curAlert= new Alert()" />
<RunCode code="application.curAlert = Alert.show('Check the titleStyleName style.', 'Alert Test', 3)" />
<SetStyle target="curAlert" styleName="titleStyleName" value="myStyle" waitEvent="updateComplete" waitTarget="curAlert"/>
<WaitForEffectsToEnd />
</setup>
<body>
<AssertStyleValue target="curAlert" styleName="titleStyleName" value="myStyle" />
<!--Pause timeout="100"/-->
<CompareBitmap target="curAlert" url="../Styles/baselines/titleStyleName.png" timeout="5000" />
<DispatchKeyEvent key="TAB" waitTarget="curAlert.mx_internal:alertForm.mx_internal:buttons.1" waitEvent="focusIn" />
<DispatchKeyEvent key="ESCAPE" waitTarget="curAlert" waitEvent="removed" />
<AssertEvent target="curAlert" eventName="close" eventClass="mx.events::CloseEvent" />
<WaitForEffectsToEnd />
</body>
</TestCase>
<TestCase testID="Alert_embedded_font_verdana" description="Test font embedding font in Alert title" keywords="[Alert, Title, Embedded, Font, Verdana]" >
<setup>
<DispatchKeyEvent key="SPACE" />
<RunCode code="application.curAlert= new Alert()" />
<RunCode code="application.curAlert = Alert.show('Check the title embedded font.', 'Alert Test', 3)" />
<WaitForEffectsToEnd />
</setup>
<body>
<SetStyle target="curAlert" styleName="titleStyleName" value="VerdanaStyle" waitEvent="updateComplete" waitTarget="curAlert"/>
<AssertStyleValue target="curAlert" styleName="titleStyleName" value="VerdanaStyle" />
<!--Pause timeout="100"/-->
<CompareBitmap target="curAlert" url="../Styles/baselines/titleEmbeddedFont.png" timeout="5000" numColorVariances="20" ignoreMaxColorVariance="true"/>
<DispatchKeyEvent key="TAB" waitTarget="curAlert.mx_internal:alertForm.mx_internal:buttons.1" waitEvent="focusIn" />
<DispatchKeyEvent key="ESCAPE" waitTarget="curAlert" waitEvent="removed" />
<AssertEvent target="curAlert" eventName="close" eventClass="mx.events::CloseEvent" />
<WaitForEffectsToEnd />
</body>
</TestCase>
<TestCase testID="Alert_embedded_font_verdana_italic" description="Test font embedding font in Alert button" keywords="[Alert, Button, Embedded, Font, Verdana]" >
<setup>
<DispatchKeyEvent key="SPACE" />
<RunCode code="application.curAlert= new Alert()" />
<RunCode code="application.curAlert = Alert.show('Check the button embedded font.', 'Alert Test', 3)" />
<WaitForEffectsToEnd />
</setup>
<body>
<SetStyle target="curAlert" styleName="buttonStyleName" value="VerdanaItalicStyle" waitEvent="updateComplete" waitTarget="curAlert"/>
<AssertStyleValue target="curAlert" styleName="buttonStyleName" value="VerdanaItalicStyle" />
<!--Pause timeout="100"/-->
<CompareBitmap target="curAlert" numColorVariances="20" ignoreMaxColorVariance="true" url="../Styles/baselines/buttonEmbeddedFont.png" timeout="5000" />
<DispatchKeyEvent key="TAB" waitTarget="curAlert.mx_internal:alertForm.mx_internal:buttons.1" waitEvent="focusIn" />
<DispatchKeyEvent key="ESCAPE" waitTarget="curAlert" waitEvent="removed" />
<AssertEvent target="curAlert" eventName="close" eventClass="mx.events::CloseEvent" />
<WaitForEffectsToEnd />
</body>
</TestCase>
<TestCase testID="Alert_embedded_font_verdana_bold" description="Test font embedding font in Alert message" keywords="[Alert, Message, Embedded, Font, Verdana]" >
<setup>
<DispatchKeyEvent key="SPACE" />
<RunCode code="application.curAlert= new Alert()" />
<RunCode code="application.curAlert = Alert.show('Check the message embedded font.', 'Alert Test', 3)" />
<WaitForEffectsToEnd />
</setup>
<body>
<SetStyle target="curAlert" styleName="messageStyleName" value="VerdanaBoldStyle" waitEvent="updateComplete" waitTarget="curAlert"/>
<AssertStyleValue target="curAlert" styleName="messageStyleName" value="VerdanaBoldStyle" />
<!--Pause timeout="100"/-->
<CompareBitmap target="curAlert" numColorVariances="20" ignoreMaxColorVariance="true" url="../Styles/baselines/messageEmbeddedFont.png" timeout="5000" />
<DispatchKeyEvent key="TAB" waitTarget="curAlert.mx_internal:alertForm.mx_internal:buttons.1" waitEvent="focusIn" />
<DispatchKeyEvent key="ESCAPE" waitTarget="curAlert" waitEvent="removed" />
<AssertEvent target="curAlert" eventName="close" eventClass="mx.events::CloseEvent" />
<WaitForEffectsToEnd />
</body>
</TestCase>
</testCases>
</UnitTester>