| <?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="components/TileList/Properties/" xmlns:mx="http://www.adobe.com/2006/mxml" xmlns="*" testSWF="TileList_DragDrop.mxml"> |
| <mx:Script> |
| <![CDATA[ |
| |
| public static function init(o:DisplayObject):void |
| { |
| |
| } |
| ]]> |
| </mx:Script> |
| <mx:Metadata> |
| <![CDATA[ |
| [Mixin] |
| ]]> |
| </mx:Metadata> |
| |
| |
| |
| <mx:Script> |
| <![CDATA[ |
| import mx.controls.TileList; |
| import mx.collections.*; |
| |
| private function addArrayData(tl:TileList):void |
| { |
| |
| var col:ArrayCollection = |
| new ArrayCollection(['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z']); |
| tl.dataProvider = col; |
| } |
| |
| |
| ]]> |
| </mx:Script> |
| |
| <testCases> |
| |
| <TestCase testID="TL_DragDropSameItem" keywords="[dragdrop, TileList]"> |
| <setup> |
| <ResetComponent target="tl1" className="comps.tlDragDropComp" waitEvent="updateComplete" waitTarget="tl1" /> |
| <ResetComponent target="tl2" className="comps.tlDragDropComp" waitEvent="updateComplete" waitTarget="tl2" /> |
| <RunCode code="addArrayData(application.tl1);" /> |
| <RunCode code="addArrayData(application.tl2);" /> |
| </setup> |
| <body> |
| <DispatchKeyEvent keys="[TAB]" waitEvent="focusIn" waitTarget="tl1" /> |
| |
| <DispatchMouseEvent target="tl1" type="mouseOver" buttonDown="false" localX="20" localY="30" waitTarget="tl1" waitEvent="mouseOver"/> |
| <DispatchMouseEvent target="tl1" type="mouseDown" buttonDown="true" localX="20" localY="30" waitTarget="tl1" waitEvent="mouseDown"/> |
| <DispatchMouseEvent target="tl1" type="mouseMove" buttonDown="true" localX="20" localY="30" /> |
| <WaitForEffectsToEnd/> |
| <DispatchMouseEvent target="tl1" type="mouseMove" buttonDown="true" localX="20" localY="40" /> |
| <DispatchMouseEvent target="tl1" type="mouseMove" buttonDown="true" localX="20" localY="70" /> |
| <WaitForEffectsToEnd/> |
| <DispatchMouseEvent target="tl1" type="mouseMove" buttonDown="true" localX="20" localY="90" /> |
| <WaitForEffectsToEnd/> |
| <DispatchMouseEvent target="tl1" type="mouseMove" buttonDown="true" localX="30" localY="120" /> |
| <WaitForEffectsToEnd/> |
| <DispatchMouseEvent target="tl2" type="mouseMove" buttonDown="true" localX="30" localY="65" /> |
| <DispatchMouseEvent target="tl2" type="mouseMove" buttonDown="true" localX="40" localY="65" /> |
| <WaitForEffectsToEnd/> |
| <DispatchMouseEvent target="tl2" type="mouseUp" localX="40" localY="65" waitTarget="tl2" waitEvent="dragDrop" /> |
| <WaitForEffectsToEnd/> |
| |
| <DispatchMouseEvent target="tl1" type="mouseOver" buttonDown="false" localX="20" localY="30" waitTarget="tl1" waitEvent="mouseOver"/> |
| <DispatchMouseEvent target="tl1" type="mouseDown" buttonDown="true" localX="20" localY="30" waitTarget="tl1" waitEvent="mouseDown"/> |
| <DispatchMouseEvent target="tl1" type="mouseMove" buttonDown="true" localX="20" localY="30" /> |
| <WaitForEffectsToEnd/> |
| <DispatchMouseEvent target="tl1" type="mouseMove" buttonDown="true" localX="20" localY="40" /> |
| <DispatchMouseEvent target="tl1" type="mouseMove" buttonDown="true" localX="20" localY="70" /> |
| <WaitForEffectsToEnd/> |
| <DispatchMouseEvent target="tl1" type="mouseMove" buttonDown="true" localX="20" localY="90" /> |
| <WaitForEffectsToEnd/> |
| <DispatchMouseEvent target="tl1" type="mouseMove" buttonDown="true" localX="30" localY="120" /> |
| <WaitForEffectsToEnd/> |
| <DispatchMouseEvent target="tl2" type="mouseMove" buttonDown="true" localX="30" localY="65" /> |
| <DispatchMouseEvent target="tl2" type="mouseMove" buttonDown="true" localX="40" localY="65" /> |
| <WaitForEffectsToEnd/> |
| <DispatchMouseEvent target="tl2" type="mouseUp" localX="40" localY="65" waitTarget="tl2" waitEvent="dragDrop" /> |
| <WaitForEffectsToEnd/> |
| |
| <CompareBitmap target="tl2" url="../Properties/baselines/TL_DragDropSameItem.png" /> |
| </body> |
| </TestCase> |
| |
| <TestCase testID="TL_vertical_DragDropSameItem" keywords="[dragdrop, TileList, vertical]"> |
| <setup> |
| <ResetComponent target="tl1" className="comps.tlDragDropComp" waitEvent="updateComplete" waitTarget="tl1" /> |
| <ResetComponent target="tl2" className="comps.tlDragDropComp" waitEvent="updateComplete" waitTarget="tl2" /> |
| <SetProperty propertyName="direction" value="vertical" target="tl1"/> |
| <SetProperty propertyName="direction" value="vertical" target="tl2"/> |
| <SetProperty propertyName="horizontalScrollPolicy" value="on" target="tl1"/> |
| <SetProperty propertyName="horizontalScrollPolicy" value="on" target="tl2"/> |
| <RunCode code="addArrayData(application.tl1);" /> |
| <RunCode code="addArrayData(application.tl2);" /> |
| </setup> |
| <body> |
| <DispatchKeyEvent keys="[TAB]" waitEvent="focusIn" waitTarget="tl1" /> |
| <DispatchMouseEvent target="tl1" type="mouseOver" buttonDown="false" localX="20" localY="30" waitTarget="tl1" waitEvent="mouseOver"/> |
| <DispatchMouseEvent target="tl1" type="mouseDown" buttonDown="true" localX="20" localY="30" waitTarget="tl1" waitEvent="mouseDown"/> |
| <DispatchMouseEvent target="tl1" type="mouseMove" buttonDown="true" localX="20" localY="30" /> |
| <WaitForEffectsToEnd/> |
| <DispatchMouseEvent target="tl1" type="mouseMove" buttonDown="true" localX="20" localY="40" /> |
| <DispatchMouseEvent target="tl1" type="mouseMove" buttonDown="true" localX="20" localY="70" /> |
| <WaitForEffectsToEnd/> |
| <DispatchMouseEvent target="tl1" type="mouseMove" buttonDown="true" localX="20" localY="90" /> |
| <WaitForEffectsToEnd/> |
| <DispatchMouseEvent target="tl1" type="mouseMove" buttonDown="true" localX="30" localY="120" /> |
| <WaitForEffectsToEnd/> |
| <DispatchMouseEvent target="tl2" type="mouseMove" buttonDown="true" localX="30" localY="65" /> |
| <WaitForEffectsToEnd/> |
| <DispatchMouseEvent target="tl2" type="mouseMove" buttonDown="true" localX="30" localY="65" /> |
| <DispatchMouseEvent target="tl2" type="mouseMove" buttonDown="true" localX="40" localY="65" /> |
| <WaitForEffectsToEnd/> |
| <DispatchMouseEvent target="tl2" type="mouseUp" localX="340" localY="65" waitTarget="tl2" waitEvent="dragDrop" /> |
| <WaitForEffectsToEnd/> |
| |
| <DispatchMouseEvent target="tl1" type="mouseOver" buttonDown="false" localX="20" localY="30" waitTarget="tl1" waitEvent="mouseOver"/> |
| <DispatchMouseEvent target="tl1" type="mouseDown" buttonDown="true" localX="20" localY="30" waitTarget="tl1" waitEvent="mouseDown"/> |
| <DispatchMouseEvent target="tl1" type="mouseMove" buttonDown="true" localX="20" localY="30" /> |
| <WaitForEffectsToEnd/> |
| <DispatchMouseEvent target="tl1" type="mouseMove" buttonDown="true" localX="20" localY="40" /> |
| <DispatchMouseEvent target="tl1" type="mouseMove" buttonDown="true" localX="20" localY="70" /> |
| <WaitForEffectsToEnd/> |
| <DispatchMouseEvent target="tl1" type="mouseMove" buttonDown="true" localX="20" localY="90" /> |
| <WaitForEffectsToEnd/> |
| <DispatchMouseEvent target="tl1" type="mouseMove" buttonDown="true" localX="30" localY="120" /> |
| <WaitForEffectsToEnd/> |
| <DispatchMouseEvent target="tl2" type="mouseMove" buttonDown="true" localX="30" localY="65" /> |
| <WaitForEffectsToEnd/> |
| <DispatchMouseEvent target="tl2" type="mouseMove" buttonDown="true" localX="30" localY="65" /> |
| <DispatchMouseEvent target="tl2" type="mouseMove" buttonDown="true" localX="40" localY="65" /> |
| <WaitForEffectsToEnd/> |
| <DispatchMouseEvent target="tl2" type="mouseUp" localX="340" localY="65" waitTarget="tl2" waitEvent="dragDrop" /> |
| <WaitForEffectsToEnd/> |
| <DispatchKeyEvent key="TAB" waitEvent="focusIn" waitTarget="tl2" /> |
| <DispatchKeyEvent key="END" waitEvent="change" waitTarget="tl2" /> |
| <WaitForEffectsToEnd/> |
| |
| <DispatchKeyEvent key="HOME" waitEvent="change" waitTarget="tl2" /> |
| |
| <WaitForEffectsToEnd /> |
| <CompareBitmap target="tl2" url="../Properties/baselines/TL_vertical_DragDropSameItem.png" /> |
| </body> |
| </TestCase> |
| </testCases> |
| </UnitTester> |