blob: 7823856c1edb5cea54a2ce27ff579399ec2ed375 [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="apollo/spark/components/WindowedApplication/styles/"
xmlns:mx="http://www.adobe.com/2006/mxml" xmlns="*"
testSWF="wa_styles_css.mxml"
xmlns:custom="assets.*">
<!-- 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 css.
========================================================
-->
<TestCase testID="style_baseColor_css_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>
<SetProperty target="" propertyName="styleName" value="baseColorStyle1" waitTarget="group1.btn1" waitEvent="updateComplete" />
<CompareBitmap target="group1.btn1" url="../styles/baselines/$testID.png" />
</body>
</TestCase>
<TestCase testID="style_contentBackgroundColor_css_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>
<SetProperty target="" propertyName="styleName" value="contentBackgroundColorStyle1" waitTarget="group1.ta1" waitEvent="updateComplete" />
<CompareBitmap target="group1.ta1" url="../styles/baselines/$testID.png" />
</body>
</TestCase>
<TestCase testID="style_focusColor_css_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>
<SetProperty target="" propertyName="styleName" value="focusColorStyle1" />
<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_symbolColor_css_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>
<SetProperty target="" propertyName="styleName" value="symbolColorStyle1" waitTarget="group1.ck1" waitEvent="updateComplete" />
<CompareBitmap target="group1.ck1" url="../styles/baselines/$testID.png" />
</body>
</TestCase>
<TestCase testID="style_rollOverColor_css_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>
<SetProperty target="" propertyName="styleName" value="rollOverColorStyle1" />
<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_css_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>
<SetProperty target="" propertyName="styleName" value="selectionColorStyle1" />
<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>