blob: 16e7d01f8de672c517f5b2583837d4301f003b68 [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="mx/styles/AdvancedStyleClient/Styles/"
xmlns:mx="http://www.adobe.com/2006/mxml"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns="*"
testSWF="ADV_externalStyle_main.mxml">
<mx:Script>
<![CDATA[
import assets.styleTest.*;
public static function init(o:DisplayObject):void
{
}
]]>
</mx:Script>
<mx:Metadata>
<![CDATA[
[Mixin]
]]>
</mx:Metadata>
<testCases>
<!--test with external style setting: Class Selector-->
<TestCase testID="ADV_extStyle_class_selector_test1"
description="test with external style setting: Class Selector"
keywords="[ADVStyleTestClass, external, Class Selector]">
<setup>
<ResetComponent target="label" className="spark.components.Label" waitEvent="updateComplete" />
</setup>
<body>
<AssertStyleValue target="advStyleTest_External_Class" styleName="teststyle_1_string_noinh" value="ExternalString"/>
<AssertStyleValue target="advStyleTest_External_Class" styleName="teststyle_2_number_noinh" valueExpression="value=6666789"/>
<AssertStyleValue target="advStyleTest_External_Class" styleName="teststyle_3_uint_inh" valueExpression="value=34"/>
<AssertStyleValue target="advStyleTest_External_Class" styleName="teststyle_5_format_length_noinh" valueExpression="value=50"/>
<AssertStyleValue target="advStyleTest_External_Class" styleName="teststyle_6_format_time_noinh" valueExpression="value=12000"/>
<AssertStyleValue target="advStyleTest_External_Class" styleName="teststyle_7_format_color_noinh" valueExpression="value=0x776655"/>
<AssertStyleValue target="advStyleTest_External_Class" styleName="teststyle_11_boolean_noinh" valueExpression="value=false"/>
<AssertStyleValue target="advStyleTest_External_Class" styleName="teststyle_12_enum_string_inh" value="secondType"/>
<AssertStyleValue target="advStyleTest_External_Class" styleName="teststyle_13_enum_int_noinh" valueExpression="value=99"/>
<AssertStyleValue target="advStyleTest_External_Class" styleName="teststyle_15_state_string_noinh" value="ExternalStateString"/>
<AssertStyleValue target="advStyleTest_External_Class" styleName="teststyle_17_skin_state_noinh" valueExpression="value=assets.styleTest.ADVStyleTestSkin"/>
</body>
</TestCase>
<!--test with external style setting: ID Selector-->
<TestCase testID="ADV_extStyle_id_selector_test2"
description="test with external style setting: ID Selector"
keywords="[ADVStyleTestClass, external, ID Selector]">
<setup>
<ResetComponent target="label" className="spark.components.Label" waitEvent="updateComplete" />
</setup>
<body>
<AssertStyleValue target="advStyleTest_External_ID" styleName="teststyle_1_string_noinh" value="idString"/>
<AssertStyleValue target="advStyleTest_External_ID" styleName="teststyle_2_number_noinh" valueExpression="value=6666666"/>
<AssertStyleValue target="advStyleTest_External_ID" styleName="teststyle_3_uint_inh" valueExpression="value=43"/>
<AssertStyleValue target="advStyleTest_External_ID" styleName="teststyle_5_format_length_noinh" valueExpression="value=50"/>
<AssertStyleValue target="advStyleTest_External_ID" styleName="teststyle_6_format_time_noinh" valueExpression="value=12000"/>
<AssertStyleValue target="advStyleTest_External_ID" styleName="teststyle_7_format_color_noinh" valueExpression="value=0x556677"/>
<AssertStyleValue target="advStyleTest_External_ID" styleName="teststyle_11_boolean_noinh" valueExpression="value=true"/>
<AssertStyleValue target="advStyleTest_External_ID" styleName="teststyle_12_enum_string_inh" value="secondType"/>
<AssertStyleValue target="advStyleTest_External_ID" styleName="teststyle_13_enum_int_noinh" valueExpression="value=99"/>
<AssertStyleValue target="advStyleTest_External_ID" styleName="teststyle_15_state_string_noinh" value="idStateString"/>
</body>
</TestCase>
<!--test style compound/overwrite between inline and external class selector styles-->
<TestCase testID="ADV_extStyle_compound_inline_class_test3"
description="test style compound/overwrite between inline and external class selector styles"
keywords="[ADVStyleTestClass, external, compound, inline, class selector]">
<setup>
<ResetComponent target="label" className="spark.components.Label" waitEvent="updateComplete" />
</setup>
<body>
<!--class selector setting-->
<AssertStyleValue target="advStyleTest_External1" styleName="teststyle_1_string_noinh" value="classString"/>
<AssertStyleValue target="advStyleTest_External1" styleName="teststyle_5_format_length_noinh" valueExpression="value=50"/>
<AssertStyleValue target="advStyleTest_External1" styleName="teststyle_6_format_time_noinh" valueExpression="value=12000"/>
<!--inline setting-->
<AssertStyleValue target="advStyleTest_External1" styleName="teststyle_15_state_string_noinh" value="inlineStringHeavy"/>
<AssertStyleValue target="advStyleTest_External1" styleName="teststyle_17_skin_state_noinh" valueExpression="value=ADVStyleTestConstants.imgCls"/>
<!--compound style between inline and external class selector using inline style value-->
<AssertStyleValue target="advStyleTest_External1" styleName="teststyle_11_boolean_noinh" valueExpression="value=true"/>
<AssertStyleValue target="advStyleTest_External1" styleName="teststyle_12_enum_string_inh" value="firstType"/>
<!--default setting-->
<AssertStyleValue target="advStyleTest_External1" styleName="teststyle_2_number_noinh" valueExpression="value=undefined"/>
<AssertStyleValue target="advStyleTest_External1" styleName="teststyle_3_uint_inh" valueExpression="value=undefined"/>
<AssertStyleValue target="advStyleTest_External1" styleName="teststyle_7_format_color_noinh" valueExpression="value=0x112233"/>
<AssertStyleValue target="advStyleTest_External1" styleName="teststyle_13_enum_int_noinh" valueExpression="value=15"/>
<AssertStyleValue target="advStyleTest_External1" styleName="teststyle_16_skin_noinh" valueExpression="value=ADVStyleTestConstants.defaultCls"/>
</body>
</TestCase>
<!--test style compound/overwrite of class selector between local and external styles-->
<TestCase testID="ADV_extStyle_compound_local_external_test4"
description="test style compound/overwrite of class selector between local and external styles"
keywords="[ADVStyleTestClass, external, compound, local, class selector]">
<setup>
<ResetComponent target="label" className="spark.components.Label" waitEvent="updateComplete" />
</setup>
<body>
<!--local class setting-->
<AssertStyleValue target="advStyleTest_External2" styleName="teststyle_15_state_string_noinh" value="localStringHeavy"/>
<AssertStyleValue target="advStyleTest_External2" styleName="teststyle_17_skin_state_noinh" valueExpression="value=assets.styleTest.ADVStyleTestSkin"/>
<!--external class setting-->
<AssertStyleValue target="advStyleTest_External2" styleName="teststyle_1_string_noinh" value="classString"/>
<AssertStyleValue target="advStyleTest_External2" styleName="teststyle_5_format_length_noinh" valueExpression="value=50"/>
<AssertStyleValue target="advStyleTest_External2" styleName="teststyle_6_format_time_noinh" valueExpression="value=12000"/>
<!--compound style between local and external using local style value-->
<AssertStyleValue target="advStyleTest_External2" styleName="teststyle_11_boolean_noinh" valueExpression="value=true"/>
<AssertStyleValue target="advStyleTest_External2" styleName="teststyle_12_enum_string_inh" value="firstType"/>
<!--default setting-->
<AssertStyleValue target="advStyleTest_External2" styleName="teststyle_2_number_noinh" valueExpression="value=undefined"/>
<AssertStyleValue target="advStyleTest_External2" styleName="teststyle_3_uint_inh" valueExpression="value=undefined"/>
<AssertStyleValue target="advStyleTest_External2" styleName="teststyle_7_format_color_noinh" valueExpression="value=0x112233"/>
<AssertStyleValue target="advStyleTest_External2" styleName="teststyle_13_enum_int_noinh" valueExpression="value=15"/>
<AssertStyleValue target="advStyleTest_External2" styleName="teststyle_16_skin_noinh" valueExpression="value=ADVStyleTestConstants.defaultCls"/>
</body>
</TestCase>
<!--test external varied measure setting for style5 and style7-->
<TestCase testID="ADV_extStyle_style_format_test5"
description="test external varied measure setting for style5 and style7"
keywords="[ADVStyleTestClass, external, style definition, format property]">
<setup>
<ResetComponent target="label" className="spark.components.Label" waitEvent="updateComplete" />
</setup>
<body>
<AssertStyleValue target="advStyleTest_External_Measure1" styleName="teststyle_5_format_length_noinh" valueExpression="value=72"/>
<AssertStyleValue target="advStyleTest_External_Measure1" styleName="teststyle_7_format_color_noinh" valueExpression="value=16711680"/>
<AssertStyleValue target="advStyleTest_External_Measure2" styleName="teststyle_5_format_length_noinh" valueExpression="value=28"/>
<AssertStyleValue target="advStyleTest_External_Measure2" styleName="teststyle_7_format_color_noinh" valueExpression="value=16711680"/>
<AssertStyleValue target="advStyleTest_External_Measure3" styleName="teststyle_5_format_length_noinh" valueExpression="value=1"/>
<AssertStyleValue target="advStyleTest_External_Measure3" styleName="teststyle_7_format_color_noinh" valueExpression="value='255,0,0'"/>
<AssertStyleValue target="advStyleTest_External_Measure4" styleName="teststyle_5_format_length_noinh" valueExpression="value=12"/>
<AssertStyleValue target="advStyleTest_External_Measure4" styleName="teststyle_7_format_color_noinh" valueExpression="value=16711680"/>
<AssertStyleValue target="advStyleTest_External_Measure5" styleName="teststyle_5_format_length_noinh" valueExpression="value=2"/>
<AssertStyleValue target="advStyleTest_External_Measure6" styleName="teststyle_5_format_length_noinh" valueExpression="value=1"/>
</body>
</TestCase>
<!--test style compound/overwrite between id selector and class selector-->
<TestCase testID="ADV_extStyle_compound_id_class_test6"
description="test style compound/overwrite between id selector and class selector"
keywords="[ADVStyleTestClass, external, compound, id selector, class selector]">
<setup>
<ResetComponent target="label" className="spark.components.Label" waitEvent="updateComplete" />
</setup>
<body>
<!--class selector setting-->
<AssertStyleValue target="advStyleTest_External3" styleName="teststyle_1_string_noinh" value="classString"/>
<AssertStyleValue target="advStyleTest_External3" styleName="teststyle_5_format_length_noinh" valueExpression="value=50"/>
<AssertStyleValue target="advStyleTest_External3" styleName="teststyle_6_format_time_noinh" valueExpression="value=12000"/>
<!--id selector setting-->
<AssertStyleValue target="advStyleTest_External3" styleName="teststyle_2_number_noinh" valueExpression="value=1111"/>
<!--compound style between id selector and class selector using id selector value-->
<AssertStyleValue target="advStyleTest_External3" styleName="teststyle_11_boolean_noinh" valueExpression="value=true"/>
<AssertStyleValue target="advStyleTest_External3" styleName="teststyle_12_enum_string_inh" value="firstType"/>
<!--default setting-->
<AssertStyleValue target="advStyleTest_External3" styleName="teststyle_3_uint_inh" valueExpression="value=undefined"/>
<AssertStyleValue target="advStyleTest_External3" styleName="teststyle_7_format_color_noinh" valueExpression="value=0x112233"/>
<AssertStyleValue target="advStyleTest_External3" styleName="teststyle_13_enum_int_noinh" valueExpression="value=15"/>
<AssertStyleValue target="advStyleTest_External3" styleName="teststyle_15_state_string_noinh" value="defaultStateString"/>
<AssertStyleValue target="advStyleTest_External3" styleName="teststyle_16_skin_noinh" valueExpression="value=ADVStyleTestConstants.defaultCls"/>
<AssertStyleValue target="advStyleTest_External3" styleName="teststyle_17_skin_state_noinh" valueExpression="value=ADVStyleTestConstants.defaultCls_heavy"/>
</body>
</TestCase>
</testCases>
</UnitTester>