| <?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="containers/DividedBox/Events/" xmlns:mx="http://www.adobe.com/2006/mxml" xmlns="*" testSWF="DivBoxMain_spark.mxml"> |
| <mx:Script> |
| <![CDATA[ |
| public static function init(o:DisplayObject):void |
| { |
| } |
| ]]> |
| </mx:Script> |
| <mx:Metadata> |
| <![CDATA[ |
| [Mixin] |
| ]]> |
| </mx:Metadata> |
| <mx:Script> |
| <![CDATA[ |
| import mx.styles.StyleManager; |
| import mx.managers.SystemManager; |
| import mx.managers.CursorManager; |
| |
| private function getCursor():int{ |
| return (CursorManager.currentCursorID); |
| } |
| ]]> |
| </mx:Script> |
| |
| <testCases> |
| |
| <TestCase testID="div_events_dividerPress_spark" keywords="[DividedBox,events,dividerPress]"> |
| <setup> |
| <ResetComponent target="div" className="DivBoxComp_spark" waitTarget="div" waitEvent="updateComplete"/> |
| </setup> |
| <body> |
| <DispatchMouseEvent target="div" localX="250" localY="256" type="mouseMove"/> |
| <DispatchMouseEvent target="div" localX="250" localY="256" type="mouseDown"/> |
| <AssertEvent target="div" eventName="dividerPress" eventClass="mx.events::DividerEvent"/> |
| <WaitForEffectsToEnd /> |
| </body> |
| </TestCase> |
| <TestCase testID="div_events_dividerDrag_spark" keywords="[DividedBox,events,dividerDrag]"> |
| <setup> |
| <ResetComponent target="div" className="DivBoxComp_spark" waitTarget="div" waitEvent="updateComplete"/> |
| </setup> |
| <body> |
| <DispatchMouseEvent target="div" localX="250" localY="256" type="mouseMove"/> |
| <DispatchMouseEvent target="div" localX="250" localY="256" type="mouseDown"/> |
| <AssertEvent target="div" eventName="dividerPress" eventClass="mx.events::DividerEvent"/> |
| <DispatchMouseEvent target="div" localX="250" localY="276" type="mouseMove"/> |
| <AssertEvent target="div" eventName="dividerDrag" eventClass="mx.events::DividerEvent"/> |
| <WaitForEffectsToEnd /> |
| </body> |
| </TestCase> |
| <TestCase testID="div_events_dividerRelease_spark" keywords="[DividedBox,events,dividerRelease]"> |
| <setup> |
| <ResetComponent target="div" className="DivBoxComp_spark" waitTarget="div" waitEvent="updateComplete"/> |
| </setup> |
| <body> |
| <DispatchMouseEvent target="div" localX="250" localY="256" type="rollOver" waitEvent="rollOver"/> |
| <DispatchMouseEvent target="div" localX="250" localY="256" type="mouseDown" waitEvent="mouseDown"/> |
| <DispatchMouseEvent target="div" localX="250" localY="276" type="mouseMove"/> |
| <WaitForEffectsToEnd /> |
| <DispatchMouseEvent target="div" localX="250" localY="276" type="mouseUp" waitEvent="mouseUp"/> |
| <AssertEvent target="div" eventName="dividerRelease" eventClass="mx.events::DividerEvent"/> |
| </body> |
| </TestCase> |
| |
| <TestCase testID="DividedBox_Event_mouseMove_spark" keywords="[DividedBox, Event, mouseMove]"> |
| <setup> |
| <ResetComponent target="div" className="DivBoxComp_spark" waitTarget="div" waitEvent="updateComplete" /> |
| </setup> |
| <body> |
| <DispatchMouseEvent target="div" localX="250" localY="256" type="mouseMove"/> |
| <DispatchMouseEvent target="div" localX="250" localY="256" type="mouseDown"/> |
| <DispatchMouseEvent target="div" localX="250" localY="286" type="mouseMove"/> |
| |
| <AssertEvent target="div" eventName="mouseMove" eventClass="flash.events::MouseEvent" timeout="5000" /> |
| <WaitForEffectsToEnd /> |
| </body> |
| </TestCase> |
| <TestCase testID="DividedBox_Event_mouseDown_spark" keywords="[DividedBox, Event, mouseMove]"> |
| <setup> |
| <ResetComponent target="div" className="DivBoxComp_spark" waitTarget="div" waitEvent="updateComplete" /> |
| </setup> |
| <body> |
| <DispatchMouseEvent target="div" localX="250" localY="256" type="mouseMove"/> |
| <DispatchMouseEvent target="div" localX="250" localY="256" type="mouseDown"/> |
| <AssertEvent target="div" eventName="mouseDown" eventClass="flash.events::MouseEvent" timeout="5000" /> |
| <WaitForEffectsToEnd /> |
| </body> |
| </TestCase> |
| <TestCase testID="DividedBox_Event_mouseUp_spark" keywords="[DividedBox, Event, mouseUp]"> |
| <setup> |
| <ResetComponent target="div" className="DivBoxComp_spark" waitTarget="div" waitEvent="updateComplete" /> |
| </setup> |
| <body> |
| <DispatchMouseEvent target="div" localX="250" localY="256" type="mouseUp"/> |
| <AssertEvent target="div" eventName="mouseUp" eventClass="flash.events::MouseEvent" timeout="5000" /> |
| <WaitForEffectsToEnd /> |
| </body> |
| </TestCase> |
| <TestCase testID="DividedBox_Event_mouseOver_spark" keywords="[DividedBox, Event, mouseOver]"> |
| <setup> |
| <ResetComponent target="div" className="DivBoxComp_spark" waitTarget="div" waitEvent="updateComplete" /> |
| </setup> |
| <body> |
| <DispatchMouseEvent target="div" localX="250" localY="256" type="mouseOver"/> |
| <AssertEvent target="div" eventName="mouseOver" eventClass="flash.events::MouseEvent" timeout="5000" /> |
| <WaitForEffectsToEnd /> |
| </body> |
| </TestCase> |
| <TestCase testID="DividedBox_events_creationComplete_spark" keywords="[creationComplete, event, DividedBox]"> |
| <setup> |
| <ResetComponent target="myDB" className="mx.containers.DividedBox" waitEvent="updateComplete" waitTarget="myDB"/> |
| <WaitForEffectsToEnd /> |
| </setup> |
| <body> |
| <AssertPropertyValue target="ti1" propertyName="text" value="DividedBox creationComplete fired" /> |
| <WaitForEffectsToEnd /> |
| </body> |
| </TestCase> |
| <TestCase testID="DividedBox_events_initialize_spark" keywords="[initialize, event, DividedBox]"> |
| <setup> |
| <ResetComponent target="myDB" className="mx.containers.DividedBox" waitEvent="updateComplete" waitTarget="myDB"/> |
| <SetProperty target="myDB" propertyName="width" value="200" waitEvent="updateComplete" waitTarget="myDB"/> |
| <SetProperty target="myDB" propertyName="height" value="300" waitEvent="updateComplete" waitTarget="myDB"/> |
| <WaitForEffectsToEnd /> |
| </setup> |
| <body> |
| <AssertPropertyValue target="ti2" propertyName="text" value="DividedBox initialize fired" /> |
| <WaitForEffectsToEnd /> |
| </body> |
| </TestCase> |
| |
| <TestCase testID="DividedBox_events_show_spark" keywords="[show, event, DividedBox]"> |
| <setup> |
| <ResetComponent target="myDB" className="mx.containers.DividedBox" waitEvent="updateComplete" waitTarget="myDB"/> |
| <SetProperty target="myDB" propertyName="width" value="200" waitEvent="updateComplete" waitTarget="myDB"/> |
| <SetProperty target="myDB" propertyName="height" value="300" waitEvent="updateComplete" waitTarget="myDB"/> |
| <WaitForEffectsToEnd /> |
| <SetProperty target="myDB" propertyName="visible" value="false"/> |
| </setup> |
| <body> |
| <SetProperty target="myDB" propertyName="visible" value="true"/> |
| <AssertEvent target="myDB" eventName="show" eventClass="mx.events::FlexEvent" timeout="5000" /> |
| <WaitForEffectsToEnd /> |
| <ResetComponent target="myDB" className="mx.containers.DividedBox" waitEvent="updateComplete" waitTarget="myDB"/> |
| <ResetComponent target="div" className="DivBoxComp_spark" waitTarget="div" waitEvent="updateComplete" /> |
| <WaitForEffectsToEnd /> |
| </body> |
| </TestCase> |
| </testCases> |
| </UnitTester> |