| <?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="apollo/spark/components/WindowedApplication/styles/" |
| xmlns:mx="http://www.adobe.com/2006/mxml" |
| xmlns="*" |
| testSWF="wa_app2.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 --> |
| |
| <mx:Script> |
| <![CDATA[ |
| import mx.core.FlexGlobals; |
| import spark.components.Window; |
| import spark.components.TextArea; |
| |
| ]]> |
| </mx:Script> |
| |
| <testCases> |
| <!-- |
| ======================================================== |
| Test styles set via setStyle(). |
| ======================================================== |
| --> |
| |
| <TestCase testID="style_symbolColor_test1" keywords="[WindowedApplication,style,symbolColor]" description="Set symbolColor with setStyle()."> |
| <setup> |
| <RunCode code="FlexGlobals.topLevelApplication.doReset()" waitTarget="" waitEvent="resetComplete" /> |
| <ResetComponent target="group1" className="custom.GroupWithComponents" /> |
| <SetProperty target="group1" propertyName="visible" value="true" waitEvent="show" /> |
| </setup> |
| <body> |
| <SetStyle target="" styleName="symbolColor" value="0xffff00" waitTarget="group1.ck1" waitEvent="updateComplete" /> |
| <CompareBitmap target="group1.ck1" url="../styles/baselines/$testID.png" /> |
| </body> |
| </TestCase> |
| |
| <TestCase testID="style_baseColor_test1" keywords="[WindowedApplication,style,baseColor]" description="Set baseColor with setStyle()."> |
| <setup> |
| <RunCode code="FlexGlobals.topLevelApplication.doReset()" waitTarget="" waitEvent="resetComplete" /> |
| <ResetComponent target="group1" className="custom.GroupWithComponents" /> |
| <SetProperty target="group1" propertyName="visible" value="true" waitEvent="show" /> |
| </setup> |
| <body> |
| <SetStyle target="" styleName="chromeColor" value="0x008800" waitTarget="group1.btn1" waitEvent="updateComplete" /> |
| <CompareBitmap target="group1.btn1" url="../styles/baselines/$testID.png" /> |
| </body> |
| </TestCase> |
| |
| <TestCase testID="style_contentBackgroundColor_test1" keywords="[WindowedApplication,style,contentBackgroundColor]" description="Set contentBackgroundColor with setStyle()."> |
| <setup> |
| <RunCode code="FlexGlobals.topLevelApplication.doReset()" waitTarget="" waitEvent="resetComplete" /> |
| <ResetComponent target="group1" className="custom.GroupWithComponents" /> |
| <SetProperty target="group1" propertyName="visible" value="true" waitEvent="show" /> |
| </setup> |
| <body> |
| <SetStyle target="" styleName="contentBackgroundColor" value="0x000088" waitTarget="group1.ta1" waitEvent="updateComplete" /> |
| <CompareBitmap target="group1.ta1" url="../styles/baselines/$testID.png" /> |
| </body> |
| </TestCase> |
| |
| <TestCase testID="style_focusColor_test1" keywords="[WindowedApplication,style,focusColor]" description="Set focusColor with setStyle()."> |
| <setup> |
| <RunCode code="FlexGlobals.topLevelApplication.doReset()" waitTarget="" waitEvent="resetComplete" /> |
| <ResetComponent target="group1" className="custom.GroupWithComponents" /> |
| <SetProperty target="group1" propertyName="visible" value="true" waitEvent="show" /> |
| </setup> |
| <body> |
| <SetStyle target="" styleName="focusColor" value="0xff0000" /> |
| <RunCode code="FlexGlobals.topLevelApplication.group1.btn1.focusManager.setFocus(FlexGlobals.topLevelApplication.group1.btn1); FlexGlobals.topLevelApplication.group1.btn1.focusManager.showFocus()" waitTarget="" waitEvent="updateComplete" /> |
| <CompareBitmap target="group1" url="../styles/baselines/$testID.png" /> |
| </body> |
| </TestCase> |
| |
| <TestCase testID="style_rollOverColor_test1" keywords="[WindowedApplication,style,rollOverColor]" description="Set rollOverColor with setStyle()."> |
| <setup> |
| <RunCode code="FlexGlobals.topLevelApplication.doReset()" waitTarget="" waitEvent="resetComplete" /> |
| <ResetComponent target="group1" className="custom.GroupWithComponents" /> |
| <SetProperty target="group1" propertyName="visible" value="true" waitEvent="show" /> |
| </setup> |
| <body> |
| <SetStyle target="" styleName="rollOverColor" value="0x00ff00" /> |
| <DispatchMouseEvent type="rollOver" target="group1.dg1.mx_internal:rendererArray.2.0" localX="2" localY="2" waitEvent="updateComplete"/> |
| <DispatchMouseEvent type="mouseMove" target="group1.dg1.mx_internal:rendererArray.2.0" localX="2" localY="2" /> |
| <WaitForEffectsToEnd /> |
| <CompareBitmap target="group1.dg1" url="../styles/baselines/$testID.png" /> |
| </body> |
| </TestCase> |
| |
| <TestCase testID="style_selectionColor_test1" keywords="[WindowedApplication,style,selectionColor]" description="Set selectionColor with setStyle()."> |
| <setup> |
| <RunCode code="FlexGlobals.topLevelApplication.doReset()" waitTarget="" waitEvent="resetComplete" /> |
| <ResetComponent target="group1" className="custom.GroupWithComponents" /> |
| <SetProperty target="group1" propertyName="visible" value="true" waitEvent="show" /> |
| </setup> |
| <body> |
| <SetStyle target="" styleName="selectionColor" value="0x00ffff" /> |
| <DispatchMouseClickEvent target="group1.dg1.mx_internal:rendererArray.2.0" localX="2" localY="2" waitTarget="group1.dg1" waitEvent="itemClick"/> |
| <CompareBitmap target="group1.dg1" url="../styles/baselines/$testID.png" /> |
| </body> |
| </TestCase> |
| |
| </testCases> |
| |
| </UnitTester> |