| <?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="States/CurrentSyntax/Integration/" xmlns:mx="http://www.adobe.com/2006/mxml" xmlns="*" testSWF="CustomPropertyApp.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[ |
| |
| ]]> |
| </mx:Script> |
| |
| <testCases> |
| |
| <!-- |
| ================================================================================ |
| ContentHolder |
| ================================================================================ |
| --> |
| <!-- Selecting states on the main tab causes state changes which add/remove tabs. --> |
| <TestCase testID="customProperty_1" keywords="[States,Integration]" description="Able to define an 'includeIn' property for a custom control." > |
| <setup> |
| <RunCode code="application.doManualReset()" waitEvent="manualResetComplete" /> |
| </setup> |
| <body> |
| <SetProperty target="{application}" propertyName="currentState" value="State1" waitTarget="{application}" waitEvent="currentStateChange" /> |
| <AssertPropertyValue target="btn1" propertyName="includeIn" value="a,b,c" /> |
| </body> |
| </TestCase> |
| |
| <TestCase testID="customProperty_2" keywords="[States,Integration]" description="If there is an 'includeIn' property for a custom control, it does not interfere with the the 'includeIn' property for States." > |
| <setup> |
| <RunCode code="application.doManualReset()" waitEvent="manualResetComplete" /> |
| </setup> |
| <body> |
| <SetProperty target="{application}" propertyName="currentState" value="State1" waitTarget="{application}" waitEvent="currentStateChange" /> |
| <AssertPropertyValue target="btn2" propertyName="parent" value="CustomPropertyApp0" /> |
| <SetProperty target="{application}" propertyName="currentState" value="State2" waitTarget="{application}" waitEvent="currentStateChange" /> |
| <AssertPropertyValue target="btn2" propertyName="parent" value="null" /> |
| </body> |
| </TestCase> |
| |
| <TestCase testID="customProperty_3" keywords="[States,Integration]" description="Able to define an 'excludeFrom' property for a custom control." > |
| <setup> |
| <RunCode code="application.doManualReset()" waitEvent="manualResetComplete" /> |
| </setup> |
| <body> |
| <SetProperty target="{application}" propertyName="currentState" value="State2" waitTarget="{application}" waitEvent="currentStateChange" /> |
| <AssertPropertyValue target="btn3" propertyName="excludeFrom" value="g,h,i" /> |
| </body> |
| </TestCase> |
| |
| <TestCase testID="customProperty_4" keywords="[States,Integration]" description="If there is an 'excludeFrom' property for a custom control, it does not interfere with the the 'excludeFrom' property for States." > |
| <setup> |
| <RunCode code="application.doManualReset()" waitEvent="manualResetComplete" /> |
| </setup> |
| <body> |
| <SetProperty target="{application}" propertyName="currentState" value="State2" waitTarget="{application}" waitEvent="currentStateChange" /> |
| <AssertPropertyValue target="btn4" propertyName="parent" value="CustomPropertyApp0" /> |
| <SetProperty target="{application}" propertyName="currentState" value="State1" waitTarget="{application}" waitEvent="currentStateChange" /> |
| <AssertPropertyValue target="btn4" propertyName="parent" value="null" /> |
| </body> |
| </TestCase> |
| |
| </testCases> |
| </UnitTester> |