| <?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/properties/" xmlns:mx="http://www.adobe.com/2006/mxml" xmlns="*" testSWF="wa_properties_heightwidth.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 flash.system.Capabilities; |
| import mx.core.FlexGlobals; |
| import spark.components.*; |
| import spark.skins.spark.*; |
| |
| ]]> |
| </mx:Script> |
| |
| <testCases> |
| |
| <!-- |
| ======================================================== |
| Test width |
| ======================================================== |
| --> |
| <TestCase testID="width_test1_SparkChromeWindowedApplicationSkin_mac" keywords="[WindowedApplication,width]" description="Negative" > |
| <setup> |
| <RunCode code="FlexGlobals.topLevelApplication.doReset()" waitTarget="" waitEvent="resetComplete" /> |
| </setup> |
| <body> |
| <SetStyle target="" styleName="skinClass" valueExpression="value = SparkChromeWindowedApplicationSkin" waitEvent="updateComplete" /> |
| <SetProperty target="" propertyName="minWidth" value="-10"/> |
| <SetProperty target="" propertyName="width" value="-1" waitEvent="resize" /> |
| <AssertPropertyValue target="" propertyName="width" value="2" /> |
| <CompareBitmap target="" url="../properties/baselines/$testID.png" /> |
| <RunCode code="FlexGlobals.topLevelApplication.restore()" /> |
| </body> |
| </TestCase> |
| |
| <TestCase testID="width_test2_SparkChromeWindowedApplicationSkin_mac" keywords="[WindowedApplication,width]" description="Zero" > |
| <setup> |
| <RunCode code="FlexGlobals.topLevelApplication.doReset()" waitTarget="" waitEvent="resetComplete" /> |
| </setup> |
| <body> |
| <SetStyle target="" styleName="skinClass" valueExpression="value = SparkChromeWindowedApplicationSkin" waitEvent="updateComplete" /> |
| <SetProperty target="" propertyName="minWidth" value="-10"/> |
| <SetProperty target="" propertyName="width" value="0" waitEvent="resize" /> |
| <AssertPropertyValue target="" propertyName="width" value="2" /> |
| <CompareBitmap target="" url="../properties/baselines/$testID.png" /> |
| <RunCode code="FlexGlobals.topLevelApplication.restore()" /> |
| </body> |
| </TestCase> |
| |
| |
| <!-- Removed due to OS dependency --> |
| <!-- |
| <TestCase testID="width_test2_SparkChromeWindowedApplicationSkin_win" keywords="[WindowedApplication,width]" description="Zero" > |
| <setup> |
| <RunCode code="FlexGlobals.topLevelApplication.doReset()" waitTarget="" waitEvent="resetComplete" /> |
| </setup> |
| <body> |
| <SetStyle target="" styleName="skinClass" valueExpression="value = SparkChromeWindowedApplicationSkin" waitEvent="updateComplete" /> |
| <SetProperty target="" propertyName="minWidth" value="-10"/> |
| <SetProperty target="" propertyName="width" value="0" waitEvent="resize" /> |
| <AssertPropertyValue target="" propertyName="width" value="140" /> |
| <CompareBitmap target="" url="../properties/baselines/$testID.png" /> |
| <RunCode code="FlexGlobals.topLevelApplication.restore()" /> |
| </body> |
| </TestCase> |
| --> |
| |
| |
| <!-- Removed due to OS dependency --> |
| <!-- |
| <TestCase testID="width_test2_windowedApplicationSkin" keywords="[WindowedApplication,width]" description="Zero" > |
| <setup> |
| <RunCode code="FlexGlobals.topLevelApplication.doReset()" waitTarget="" waitEvent="resetComplete" /> |
| </setup> |
| <body> |
| <SetProperty target="" propertyName="minWidth" value="-10"/> |
| <SetProperty target="" propertyName="width" value="0" waitEvent="resize" /> |
| <AssertMethodValue method="value = FlexGlobals.topLevelApplication.assertValueBasedOnOS(FlexGlobals.topLevelApplication.width, 140, 2, 2)" value="pass" /> |
| </body> |
| </TestCase> |
| --> |
| |
| <TestCase testID="width_test3_SparkChromeWindowedApplicationSkin_mac" keywords="[WindowedApplication,width]" description="One" > |
| <setup> |
| <RunCode code="FlexGlobals.topLevelApplication.doReset()" waitTarget="" waitEvent="resetComplete" /> |
| </setup> |
| <body> |
| <SetStyle target="" styleName="skinClass" valueExpression="value = SparkChromeWindowedApplicationSkin" waitEvent="updateComplete" /> |
| <SetProperty target="" propertyName="minWidth" value="-10"/> |
| <SetProperty target="" propertyName="width" value="1" waitEvent="resize" /> |
| <AssertMethodValue method="value = FlexGlobals.topLevelApplication.assertValueBasedOnOS(FlexGlobals.topLevelApplication.width, 140, 2, 2)" value="pass" /> |
| </body> |
| </TestCase> |
| |
| |
| <TestCase testID="width_test4_SparkChromeWindowedApplicationSkin_mac" keywords="[WindowedApplication,width]" description="Set width to a positive, reasonable value." > |
| <setup> |
| <RunCode code="FlexGlobals.topLevelApplication.doReset()" waitTarget="" waitEvent="resetComplete" /> |
| </setup> |
| <body> |
| <SetStyle target="" styleName="skinClass" valueExpression="value = SparkChromeWindowedApplicationSkin" waitEvent="updateComplete" /> |
| <SetProperty target="" propertyName="width" value="30" waitEvent="resize" /> |
| <AssertPropertyValue target="" propertyName="width" value="140" /> |
| <CompareBitmap target="" url="../properties/baselines/$testID.png" /> |
| </body> |
| </TestCase> |
| |
| |
| <TestCase testID="width_test4_SparkChromeWindowedApplicationSkin_win" keywords="[WindowedApplication,width]" description="Set width to a positive, reasonable value." > |
| <setup> |
| <RunCode code="FlexGlobals.topLevelApplication.doReset()" waitTarget="" waitEvent="resetComplete" /> |
| </setup> |
| <body> |
| <SetStyle target="" styleName="skinClass" valueExpression="value = SparkChromeWindowedApplicationSkin" waitEvent="updateComplete" /> |
| <SetProperty target="" propertyName="width" value="30" waitEvent="resize" /> |
| <AssertPropertyValue target="" propertyName="width" value="140" /> |
| <CompareBitmap target="" url="../properties/baselines/$testID.png" /> |
| </body> |
| </TestCase> |
| |
| <TestCase testID="width_test4_windowedApplicationSkin" keywords="[WindowedApplication,width]" description="Set width to a positive, reasonable value." > |
| <setup> |
| <RunCode code="FlexGlobals.topLevelApplication.doReset()" waitTarget="" waitEvent="resetComplete" /> |
| </setup> |
| <body> |
| <SetProperty target="" propertyName="width" value="33" waitEvent="resize" /> |
| <AssertMethodValue method="value = FlexGlobals.topLevelApplication.assertValueBasedOnOS(FlexGlobals.topLevelApplication.width, 140, 140, 2)" value="pass" /> |
| </body> |
| </TestCase> |
| |
| <TestCase testID="width_test5_SparkChromeWindowedApplicationSkin_mac" keywords="[WindowedApplication,width]" description="Set width to a positive, reasonable value." > |
| <setup> |
| <RunCode code="FlexGlobals.topLevelApplication.doReset()" waitTarget="" waitEvent="resetComplete" /> |
| </setup> |
| <body> |
| <SetStyle target="" styleName="skinClass" valueExpression="value = SparkChromeWindowedApplicationSkin" waitEvent="updateComplete" /> |
| <SetProperty target="" propertyName="width" value="253" waitEvent="resize" /> |
| <AssertPropertyValue target="" propertyName="width" value="253" /> |
| <CompareBitmap target="" url="../properties/baselines/$testID.png" /> |
| </body> |
| </TestCase> |
| |
| <TestCase testID="width_test5_SparkChromeWindowedApplicationSkin_win" keywords="[WindowedApplication,width]" description="Set width to a positive, reasonable value." > |
| <setup> |
| <RunCode code="FlexGlobals.topLevelApplication.doReset()" waitTarget="" waitEvent="resetComplete" /> |
| </setup> |
| <body> |
| <SetStyle target="" styleName="skinClass" valueExpression="value = SparkChromeWindowedApplicationSkin" waitEvent="updateComplete" /> |
| <SetProperty target="" propertyName="width" value="253" waitEvent="resize" /> |
| <AssertPropertyValue target="" propertyName="width" value="253" /> |
| <CompareBitmap target="" url="../properties/baselines/$testID.png" /> |
| </body> |
| </TestCase> |
| |
| <TestCase testID="width_test5_windowedApplicationSkin" keywords="[WindowedApplication,width]" description="Set width to a positive, reasonable value." > |
| <setup> |
| <RunCode code="FlexGlobals.topLevelApplication.doReset()" waitTarget="" waitEvent="resetComplete" /> |
| </setup> |
| <body> |
| <SetProperty target="" propertyName="width" value="183" waitEvent="resize" /> |
| <AssertPropertyValue target="" propertyName="width" value="183" /> |
| <CompareBitmap target="" url="../properties/baselines/$testID.png" /> |
| </body> |
| </TestCase> |
| |
| <TestCase testID="width_test6_SparkChromeWindowedApplicationSkin_mac" keywords="[WindowedApplication,width]" description="Less than minWidth" > |
| <setup> |
| <RunCode code="FlexGlobals.topLevelApplication.doReset()" waitTarget="" waitEvent="resetComplete" /> |
| </setup> |
| <body> |
| <SetStyle target="" styleName="skinClass" valueExpression="value = SparkChromeWindowedApplicationSkin" waitEvent="updateComplete" /> |
| <SetProperty target="" propertyName="minWidth" value="150" /> |
| <SetProperty target="" propertyName="width" value="130" waitEvent="resize" /> |
| <AssertPropertyValue target="" propertyName="width" value="150" /> |
| <CompareBitmap target="" url="../properties/baselines/$testID.png" /> |
| </body> |
| </TestCase> |
| |
| <TestCase testID="width_test6_SparkChromeWindowedApplicationSkin_win" keywords="[WindowedApplication,width]" description="Less than minWidth" > |
| <setup> |
| <RunCode code="FlexGlobals.topLevelApplication.doReset()" waitTarget="" waitEvent="resetComplete" /> |
| </setup> |
| <body> |
| <SetStyle target="" styleName="skinClass" valueExpression="value = SparkChromeWindowedApplicationSkin" waitEvent="updateComplete" /> |
| <SetProperty target="" propertyName="minWidth" value="150" /> |
| <SetProperty target="" propertyName="width" value="130" waitEvent="resize" /> |
| <AssertPropertyValue target="" propertyName="width" value="150" /> |
| <CompareBitmap target="" url="../properties/baselines/$testID.png" /> |
| </body> |
| </TestCase> |
| |
| <TestCase testID="width_test6_windowedApplicationSkin" keywords="[WindowedApplication,width]" description="Less than minWidth" > |
| <setup> |
| <RunCode code="FlexGlobals.topLevelApplication.doReset()" waitTarget="" waitEvent="resetComplete" /> |
| </setup> |
| <body> |
| <SetProperty target="" propertyName="minWidth" value="150" /> |
| <SetProperty target="" propertyName="width" value="130" waitEvent="resize" /> |
| <AssertPropertyValue target="" propertyName="width" value="150" /> |
| <CompareBitmap target="" url="../properties/baselines/$testID.png" /> |
| </body> |
| </TestCase> |
| |
| <TestCase testID="width_test7_SparkChromeWindowedApplicationSkin_mac" keywords="[WindowedApplication,width]" description="Increase to more than maxWidth" > |
| <setup> |
| <RunCode code="FlexGlobals.topLevelApplication.doReset()" waitTarget="" waitEvent="resetComplete" /> |
| </setup> |
| <body> |
| <SetStyle target="" styleName="skinClass" valueExpression="value = SparkChromeWindowedApplicationSkin" waitEvent="updateComplete" /> |
| <SetProperty target="" propertyName="width" value="150" waitEvent="updateComplete" /> |
| <SetProperty target="" propertyName="maxWidth" value="160" /> |
| <SetProperty target="" propertyName="width" value="170" waitEvent="updateComplete" /> |
| <AssertPropertyValue target="" propertyName="width" value="160" /> |
| <CompareBitmap target="" url="../properties/baselines/$testID.png" /> |
| </body> |
| </TestCase> |
| |
| <TestCase testID="width_test7_SparkChromeWindowedApplicationSkin_win" keywords="[WindowedApplication,width]" description="Increase to more than maxWidth" > |
| <setup> |
| <RunCode code="FlexGlobals.topLevelApplication.doReset()" waitTarget="" waitEvent="resetComplete" /> |
| </setup> |
| <body> |
| <SetStyle target="" styleName="skinClass" valueExpression="value = SparkChromeWindowedApplicationSkin" waitEvent="updateComplete" /> |
| <SetProperty target="" propertyName="width" value="150" waitEvent="updateComplete" /> |
| <SetProperty target="" propertyName="maxWidth" value="160" /> |
| <SetProperty target="" propertyName="width" value="170" waitEvent="updateComplete" /> |
| <AssertPropertyValue target="" propertyName="width" value="160" /> |
| <CompareBitmap target="" url="../properties/baselines/$testID.png" /> |
| </body> |
| </TestCase> |
| |
| <TestCase testID="width_test7_windowedApplicationSkin" keywords="[WindowedApplication,width]" description="More than maxWidth" > |
| <setup> |
| <RunCode code="FlexGlobals.topLevelApplication.doReset()" waitTarget="" waitEvent="resetComplete" /> |
| </setup> |
| <body> |
| <SetProperty target="" propertyName="width" value="150" waitEvent="updateComplete" /> |
| <SetProperty target="" propertyName="maxWidth" value="160" /> |
| <SetProperty target="" propertyName="width" value="170" waitEvent="updateComplete" /> |
| <AssertPropertyValue target="" propertyName="width" value="160" /> |
| <CompareBitmap target="" url="../properties/baselines/$testID.png" /> |
| </body> |
| </TestCase> |
| |
| <TestCase testID="width_test8_binding" keywords="[WindowedApplication,width]" description="Bind to the width" > |
| <setup> |
| <RunCode code="FlexGlobals.topLevelApplication.doReset()" waitTarget="" waitEvent="resetComplete" /> |
| </setup> |
| <body> |
| <SetProperty target="" propertyName="width" value="130" waitEvent="resize" /> |
| <AssertPropertyValue target="bindingTarget" propertyName="theWidth" value="140" /> |
| </body> |
| </TestCase> |
| |
| </testCases> |
| </UnitTester> |