blob: 390a7d3912609f0c9c2caec072e47de35159738a [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="spark/globalization/StringTools/Styles/"
xmlns:mx="http://www.adobe.com/2006/mxml"
xmlns:s="library://ns.adobe.com/flex/spark" xmlns="*"
testSWF="ST_style_ExternalCSS.mxml">
<mx:Script>
<![CDATA[
import flash.globalization.StringTools;
import assets.StringToolsTestConstants;
public var stGSLib:flash.globalization.StringTools;
public static function init(o:DisplayObject):void
{
}
]]>
</mx:Script>
<mx:Metadata>
<![CDATA[
[Mixin]
]]>
</mx:Metadata>
<!--This test file is to test whether StringTools can load style from an external css style file. Here include three ways of css defination:
class selector, type selector and id selector -->
<testCases>
<!--test Class selector defined in external CSS file-->
<TestCase testID="StringTools_ExtStyle_ClassSelector_test1" description="test Class selector defined in external CSS file" keywords="[StringTools, style, external, class selector]">
<setup>
<RunCode code="stGSLib=new flash.globalization.StringTools('fr-CH')" />
<Pause timeout="{StringToolsTestConstants.pauseTime}" />
</setup>
<body>
<AssertPropertyValue propertyName="actualLocaleIDName" valueExpression="value=stGSLib.actualLocaleIDName" target="stClassSelector"/>
</body>
</TestCase>
<!--test ID selector defined in external CSS file-->
<TestCase testID="StringTools_ExtStyle_IDSelector_test2" description="test ID selector defined in external CSS file" keywords="[StringTools, style, external, id selector]">
<setup>
<RunCode code="stGSLib=new flash.globalization.StringTools('ru-RU')" />
<Pause timeout="{StringToolsTestConstants.pauseTime}" />
</setup>
<body>
<AssertPropertyValue propertyName="actualLocaleIDName" valueExpression="value=stGSLib.actualLocaleIDName" target="stIdSelector"/>
</body>
</TestCase>
<!--test Global selector defined in external CSS file-->
<TestCase testID="StringTools_ExtStyle_GlobalSelector_test3" description="test Global selector defined in external CSS file" keywords="[StringTools, style, external, id selector]">
<setup>
<RunCode code="stGSLib=new flash.globalization.StringTools('lv-LV')" />
<Pause timeout="{StringToolsTestConstants.pauseTime}" />
</setup>
<body>
<AssertPropertyValue propertyName="actualLocaleIDName" valueExpression="value=stGSLib.actualLocaleIDName" target="stGlobalSelector"/>
</body>
</TestCase>
<!--test Document Property -->
<TestCase testID="StringTools_ExtStyle_Document_test4" description="test Document Property" keywords="[StringTools, style, external, document property]">
<setup>
<RunCode code="stGSLib=new flash.globalization.StringTools('fr-CA')" />
<Pause timeout="{StringToolsTestConstants.pauseTime}" />
</setup>
<body>
<AssertPropertyValue propertyName="actualLocaleIDName" valueExpression="value=stGSLib.actualLocaleIDName" target="extDocument"/>
</body>
</TestCase>
<!--test inheritance from external class selector and local id selector -->
<TestCase testID="StringTools_ExtStyle_inheritance_test5" description="test inheritance from external class selector and local id selector" keywords="[StringTools, style, external, conflict]">
<setup>
<RunCode code="stGSLib=new flash.globalization.StringTools('zh-CN')" />
<Pause timeout="{StringToolsTestConstants.pauseTime}" />
</setup>
<body>
<AssertPropertyValue propertyName="actualLocaleIDName" valueExpression="value=stGSLib.actualLocaleIDName" target="stExtLocal"/>
</body>
</TestCase>
<!--test inheritance from external id selector style and local inline style -->
<TestCase testID="StringTools_ExtStyle_inheritance_test6" description="test inheritance from external id selector style and local inline style" keywords="[StringTools, style, external, conflict]">
<setup>
<RunCode code="stGSLib=new flash.globalization.StringTools('zh-CN')" />
<Pause timeout="{StringToolsTestConstants.pauseTime}" />
</setup>
<body>
<AssertPropertyValue propertyName="actualLocaleIDName" valueExpression="value=stGSLib.actualLocaleIDName" target="stExtInline"/>
</body>
</TestCase>
</testCases>
</UnitTester>