blob: b35cb8881ae32ed3cac01c2ff93d60c1658d8453 [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="mobile/components/Label/Styles/" xmlns:mx="http://www.adobe.com/2006/mxml" xmlns="*" testSWF="Label1.mxml">
<mx:Script>
<![CDATA[
public static function init(o:DisplayObject):void
{
}
]]>
</mx:Script>
<mx:Metadata>
<![CDATA[
[Mixin]
]]>
</mx:Metadata>
<!-- ################################################################## -->
<mx:Script>
<![CDATA[
import components.*;
import mx.core.FlexGlobals;
public var multiLineText:String = "The quick brown\nfox jumps over\nthe lazy dog.";
]]>
</mx:Script>
<testCases>
<TestCase testID="Label_IDSelector" description="Be sure that Label can match an id selector like #tb" keywords="[TextBox, ID Selector, Graphic]">
<setup>
<RunCode code="FlexGlobals.topLevelApplication.doPopAll()" waitTarget="navigator" waitEvent="viewChangeComplete" />
<RunCode code="FlexGlobals.topLevelApplication.navigator.pushView(components.LabelStylesView1)" waitTarget="navigator" waitEvent="viewChangeComplete" />
<SetProperty target="navigator.activeView.textBoxComp2" propertyName="text" valueExpression="value=multiLineText;" waitTarget="navigator.activeView.textBoxComp2" waitEvent="updateComplete" />
</setup>
<body>
<AssertStyleValue target="navigator.activeView.textBoxComp2" styleName="textDecoration" value="underline" />
<AssertStyleValue target="navigator.activeView.textBoxComp2" styleName="fontSize" value="15" />
<CompareBitmap numColorVariances="20" maxColorVariance="10" url="../Styles/baselines" target="navigator.activeView.textBoxComp2">
<ConditionalValue deviceDensity="160" />
<ConditionalValue deviceDensity="240" />
<ConditionalValue deviceDensity="320" os="win"/>
<ConditionalValue deviceDensity="320" os="ios"/>
<ConditionalValue deviceDensity="160" os="qnx" />
</CompareBitmap>
</body>
</TestCase>
<TestCase testID="Label_TypeIDSelector" description="Be sure that Label can match a type and id selector like TextBox#tb" keywords="[TextBox, Type Selector, ID Selector, Graphic]">
<setup>
<RunCode code="FlexGlobals.topLevelApplication.doPopAll()" waitTarget="navigator" waitEvent="viewChangeComplete" />
<RunCode code="FlexGlobals.topLevelApplication.navigator.pushView(components.LabelStylesView1)" waitTarget="navigator" waitEvent="viewChangeComplete" />
<SetProperty target="navigator.activeView.textBoxComp3" propertyName="text" valueExpression="value=multiLineText;" waitTarget="navigator.activeView.textBoxComp3" waitEvent="updateComplete" />
</setup>
<body>
<AssertStyleValue target="navigator.activeView.textBoxComp3" styleName="color" value="0xff0000" />
<AssertStyleValue target="navigator.activeView.textBoxComp3" styleName="fontSize" value="20" />
<CompareBitmap numColorVariances="20" maxColorVariance="20" url="../Styles/baselines" target="navigator.activeView.textBoxComp3" >
<ConditionalValue deviceDensity="160" />
<ConditionalValue deviceDensity="240" />
<ConditionalValue deviceDensity="320" os="win"/>
<ConditionalValue deviceDensity="320" os="ios"/>
<ConditionalValue deviceDensity="160" os="qnx" />
</CompareBitmap>
</body>
</TestCase>
<TestCase testID="Label_DescendantSelector" description="Be sure that Label can match a descendant selector like HBox TextBox" keywords="[TextBox, Descendant Selector, Graphic]">
<setup>
<RunCode code="FlexGlobals.topLevelApplication.doPopAll()" waitTarget="navigator" waitEvent="viewChangeComplete" />
<RunCode code="FlexGlobals.topLevelApplication.navigator.pushView(components.LabelStylesView1)" waitTarget="navigator" waitEvent="viewChangeComplete" />
<SetProperty target="navigator.activeView.textBoxComp4" propertyName="text" valueExpression="value=multiLineText;" waitTarget="navigator.activeView.textBoxComp4" waitEvent="updateComplete" />
</setup>
<body>
<AssertStyleValue target="navigator.activeView.textBoxComp4" styleName="color" value="0x0000ff" />
<AssertStyleValue target="navigator.activeView.textBoxComp4" styleName="fontWeight" value="bold" />
<CompareBitmap numColorVariances="20" maxColorVariance="10" url="../Styles/baselines" target="navigator.activeView.textBoxComp4" >
<ConditionalValue deviceDensity="160" />
<ConditionalValue deviceDensity="240" />
<ConditionalValue deviceDensity="320" os="win"/>
<ConditionalValue deviceDensity="320" os="ios"/>
<ConditionalValue deviceDensity="160" os="qnx" />
</CompareBitmap>
</body>
</TestCase>
<TestCase testID="Label_DescendantClassSelector_spark" description="Be sure that Label can match a descendant selector like SkinnableContainer .greenText" keywords="[TextBox, Descendant Selector, Class Selector Graphic]">
<setup>
<RunCode code="FlexGlobals.topLevelApplication.doPopAll()" waitTarget="navigator" waitEvent="viewChangeComplete" />
<RunCode code="FlexGlobals.topLevelApplication.navigator.pushView(components.LabelStylesView1)" waitTarget="navigator" waitEvent="viewChangeComplete" />
<SetProperty target="navigator.activeView.textBoxComp6" propertyName="text" valueExpression="value=multiLineText;" waitTarget="navigator.activeView.textBoxComp6" waitEvent="updateComplete" />
</setup>
<body>
<AssertStyleValue target="navigator.activeView.textBoxComp6" styleName="textAlpha" value="0.5" />
<AssertStyleValue target="navigator.activeView.textBoxComp6" styleName="fontSize" value="22" />
<CompareBitmap numColorVariances="20" maxColorVariance="10" url="../Styles/baselines/" target="navigator.activeView.textBoxComp6" >
<ConditionalValue deviceDensity="160" />
<ConditionalValue deviceDensity="240" />
<ConditionalValue deviceDensity="320" />
<ConditionalValue deviceDensity="320" os="ios"/>
<ConditionalValue deviceDensity="160" os="qnx" />
</CompareBitmap>
</body>
</TestCase>
</testCases>
</UnitTester>