| <?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/Tree/Properties/" xmlns:mx="http://www.adobe.com/2006/mxml" xmlns="*" testSWF="Tree_CustomDragDrop.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.Tree; |
| import mx.events.TreeEvent; |
| import data.TreeData; |
| import mx.collections.*; |
| |
| private function addArrayData(tree:Tree):void |
| { |
| |
| var treeData:TreeData = new TreeData(); |
| tree.dataProvider = treeData.a1; |
| |
| } |
| private function addXMLData(tree:Tree, myXML:XML):void |
| { |
| |
| var xlc1:XMLListCollection = new XMLListCollection(new XMLList(new XML(myXML) )); |
| tree.dataProvider = xlc1; |
| tree.showRoot = false; |
| tree.labelField = '@label'; |
| |
| } |
| |
| ]]> |
| </mx:Script> |
| |
| <testCases> |
| <!--******************************dataProvider Array*******************************--> |
| |
| <TestCase testID="CustomTree_DP_Array_Move" description="dataProvider set to Array object" keywords="[dataProvider, Array, Tree, DragDrop" > |
| <setup> |
| <ResetComponent target="tree" className="comps.treeDragDropComp" /> |
| <ResetComponent target="tree2" className="comps.treeDragDropComp" /> |
| <RunCode code="addArrayData(application.tree);" waitEvent="updateComplete" waitTarget="tree"/> |
| |
| </setup> |
| <body> |
| <DispatchKeyEvent keys="[TAB]" waitEvent="focusIn" waitTarget="tree" /> |
| <DispatchKeyEvent keys="[DOWN,RIGHT,DOWN,RIGHT]" waitEvent="change" waitTarget="tree"/> |
| <WaitForEffectsToEnd /> |
| |
| <DispatchMouseEvent target="tree" type="mouseOver" buttonDown="false" localX="40" localY="30" waitTarget="tree" waitEvent="mouseOver"/> |
| <DispatchMouseEvent target="tree" type="mouseDown" buttonDown="true" localX="40" localY="30" waitTarget="tree" waitEvent="mouseDown"/> |
| <DispatchMouseEvent target="stage" type="mouseMove" buttonDown="true" stageX="100" stageY="35" /> |
| <DispatchMouseEvent target="stage" type="mouseMove" buttonDown="true" stageX="150" stageY="40" /> |
| <DispatchMouseEvent target="stage" type="mouseMove" buttonDown="true" stageX="200" stageY="50" /> |
| <DispatchMouseEvent target="stage" type="mouseMove" buttonDown="true" stageX="250" stageY="65" /> |
| <DispatchMouseEvent target="stage" type="mouseMove" buttonDown="true" stageX="300" stageY="70" /> |
| <DispatchMouseEvent target="stage" type="mouseUp" stageX="300" stageY="70" waitTarget="tree2" waitEvent="dragDrop" /> |
| <WaitForEffectsToEnd /> |
| <CompareBitmap numColorVariances="10" ignoreMaxColorVariance="true" target="hb" url="../Properties/baselines/Tree_Custom_Array_Move.png" /> |
| |
| </body> |
| </TestCase> |
| |
| <TestCase testID="CustomTree_DP_Array_Copy" description="dataProvider set to Array object" keywords="[dataProvider, Array, Tree, DragDrop" > |
| <setup> |
| <ResetComponent target="tree" className="comps.treeDragDropComp" /> |
| <ResetComponent target="tree2" className="comps.treeDragDropComp" /> |
| <RunCode code="addArrayData(application.tree);" waitEvent="updateComplete" waitTarget="tree"/> |
| <RunCode code="addArrayData(application.tree2);" waitEvent="updateComplete" waitTarget="tree2"/> |
| <WaitForEffectsToEnd/> |
| |
| </setup> |
| <body> |
| <DispatchKeyEvent keys="[TAB]" waitEvent="focusIn" waitTarget="tree" /> |
| |
| <DispatchKeyEvent keys="[DOWN,RIGHT,DOWN]" waitEvent="change" waitTarget="tree"/> |
| <WaitForEffectsToEnd /> |
| <DispatchMouseEvent target="tree" type="mouseOver" buttonDown="false" localX="40" localY="35" /> |
| <DispatchMouseEvent target="tree" type="mouseDown" buttonDown="true" localX="40" localY="35" /> |
| <DispatchMouseEvent target="stage" type="mouseMove" buttonDown="true" stageX="100" stageY="56" /> |
| <DispatchMouseEvent target="stage" type="mouseMove" buttonDown="true" stageX="200" stageY="60" /> |
| <DispatchMouseEvent target="stage" type="mouseMove" buttonDown="true" stageX="300" stageY="60" /> |
| <DispatchMouseEvent target="stage" type="mouseMove" buttonDown="true" stageX="350" stageY="75" /> |
| |
| <WaitForEffectsToEnd /> |
| <DispatchMouseEvent target="stage" type="mouseUp" stageX="350" stageY="75" waitTarget="tree2" waitEvent="dragDrop" /> |
| <WaitForEffectsToEnd /> |
| <CompareBitmap numColorVariances="10" ignoreMaxColorVariance="true" target="hb" url="../Properties/baselines/Tree_Custom_Array_Copy.png" /> |
| |
| </body> |
| </TestCase> |
| |
| <TestCase testID="CustomTree_DP_Array_Move_End" description="dataProvider set to Array object" keywords="[dataProvider, Array, Tree, DragDrop" > |
| <setup> |
| <ResetComponent target="tree" className="comps.treeDragDropComp" /> |
| <RunCode code="addArrayData(application.tree);" waitEvent="updateComplete" waitTarget="tree"/> |
| <WaitForEffectsToEnd/> |
| |
| </setup> |
| <body> |
| <DispatchKeyEvent keys="[TAB]" waitEvent="focusIn" waitTarget="tree" /> |
| <DispatchKeyEvent keys="[DOWN,RIGHT,DOWN,RIGHT]" waitEvent="change" waitTarget="tree"/> |
| <WaitForEffectsToEnd /> |
| <DispatchMouseEvent target="tree" type="mouseOver" buttonDown="false" localX="40" localY="30" /> |
| <DispatchMouseEvent target="tree" type="mouseDown" buttonDown="true" localX="40" localY="30" /> |
| <DispatchMouseEvent target="tree" type="mouseMove" buttonDown="true" localX="40" localY="50" /> |
| <DispatchMouseEvent target="tree" type="mouseMove" buttonDown="true" localX="30" localY="70" /> |
| <DispatchMouseEvent target="tree" type="mouseMove" buttonDown="true" localX="20" localY="90" /> |
| <WaitForEffectsToEnd /> |
| <DispatchMouseEvent target="tree" type="mouseUp" localX="10" localY="110" waitTarget="tree" waitEvent="dragDrop" /> |
| <WaitForEffectsToEnd /> |
| <CompareBitmap numColorVariances="10" ignoreMaxColorVariance="true" target="tree" url="../Properties/baselines/Tree_Custom_Array_Move_End.png" /> |
| |
| </body> |
| </TestCase> |
| |
| <TestCase testID="CustomTree_DP_Array_Move_Home" description="dataProvider set to Array object" keywords="[dataProvider, Array, Tree, DragDrop" > |
| <setup> |
| <ResetComponent target="tree" className="comps.treeDragDropComp" /> |
| <RunCode code="addArrayData(application.tree);" waitEvent="updateComplete" waitTarget="tree"/> |
| <WaitForEffectsToEnd/> |
| |
| </setup> |
| <body> |
| <DispatchKeyEvent keys="[TAB]" waitEvent="focusIn" waitTarget="tree" /> |
| <DispatchKeyEvent keys="[DOWN,DOWN,RIGHT,DOWN,DOWN]" waitEvent="change" waitTarget="tree"/> |
| <WaitForEffectsToEnd /> |
| <DispatchMouseEvent target="tree" type="mouseOver" buttonDown="false" localX="70" localY="100" /> |
| <DispatchMouseEvent target="tree" type="mouseDown" buttonDown="true" localX="70" localY="100" /> |
| <DispatchMouseEvent target="tree" type="mouseMove" buttonDown="true" localX="40" localY="80" /> |
| <DispatchMouseEvent target="tree" type="mouseMove" buttonDown="true" localX="30" localY="50" /> |
| <DispatchMouseEvent target="tree" type="mouseMove" buttonDown="true" localX="20" localY="20" /> |
| <WaitForEffectsToEnd /> |
| <DispatchMouseEvent target="tree" type="mouseUp" localX="5" localY="5" waitTarget="tree" waitEvent="dragDrop" /> |
| <WaitForEffectsToEnd /> |
| <CompareBitmap numColorVariances="10" ignoreMaxColorVariance="true" target="tree" url="../Properties/baselines/Tree_Custom_Array_Move_Home.png" /> |
| |
| </body> |
| </TestCase> |
| <!--******************************dataProvider XML*******************************--> |
| |
| <TestCase testID="CustomTree_DP_XML_Move" keywords="[dataProvider, XML, Tree, DragDrop"> |
| <setup> |
| <ResetComponent target="tree" className="comps.treeDragDropComp" waitEvent="updateComplete" waitTarget="tree"/> |
| <ResetComponent target="tree2" className="comps.treeDragDropComp" waitEvent="updateComplete" waitTarget="tree2"/> |
| <RunCode code="addXMLData(application.tree, application.treeXMLEmptyBranches);" waitEvent="updateComplete" waitTarget="tree" /> |
| <RunCode code="addXMLData(application.tree2, application.treeXML);" waitEvent="updateComplete" waitTarget="tree2" /> |
| <WaitForEffectsToEnd/> |
| |
| <RunCode code="application.tree.expandChildrenOf(application.tree.dataProvider.children()[0], true)" waitEvent="updateComplete" waitTarget="tree" /> |
| <WaitForEffectsToEnd/> |
| <RunCode code="application.tree2.expandChildrenOf(application.tree2.dataProvider.children()[1], true)" waitEvent="updateComplete" waitTarget="tree2" /> |
| <WaitForEffectsToEnd/> |
| |
| </setup> |
| <body> |
| <DispatchMouseEvent target="tree" type="mouseOver" buttonDown="false" localX="40" localY="30" /> |
| <DispatchMouseEvent target="tree" type="mouseDown" buttonDown="true" localX="40" localY="30" /> |
| <DispatchMouseEvent target="stage" type="mouseMove" buttonDown="true" stageX="100" stageY="60" /> |
| <DispatchMouseEvent target="stage" type="mouseMove" buttonDown="true" stageX="200" stageY="60" /> |
| <DispatchMouseEvent target="stage" type="mouseMove" buttonDown="true" stageX="300" stageY="60" /> |
| <DispatchMouseEvent target="stage" type="mouseMove" buttonDown="true" stageX="350" stageY="75" /> |
| <DispatchMouseEvent target="stage" type="mouseMove" buttonDown="true" stageX="350" stageY="75" /> |
| <WaitForEffectsToEnd /> |
| <DispatchMouseEvent target="stage" type="mouseUp" stageX="350" stageY="75" waitTarget="tree2" waitEvent="updateComplete" /> |
| <WaitForEffectsToEnd /> |
| |
| <CompareBitmap numColorVariances="10" ignoreMaxColorVariance="true" target="hb" url="../Properties/baselines/Tree_Custom_XML_Move.png" /> |
| |
| </body> |
| </TestCase> |
| |
| <TestCase testID="CustomTree_DP_XML_Copy" keywords="[dataProvider, XML, Tree, DragDrop"> |
| <setup> |
| <ResetComponent target="tree" className="comps.treeDragDropComp" waitEvent="updateComplete" waitTarget="tree"/> |
| <ResetComponent target="tree2" className="comps.treeDragDropComp" waitEvent="updateComplete" waitTarget="tree2"/> |
| <RunCode code="addXMLData(application.tree, application.treeXMLEmptyBranches);" waitEvent="updateComplete" waitTarget="tree" /> |
| <RunCode code="addXMLData(application.tree2, application.treeXML);" waitEvent="updateComplete" waitTarget="tree2" /> |
| <SetProperty target="tree" propertyName="dragMoveEnabled" value="false" /> |
| <SetProperty target="tree2" propertyName="dragMoveEnabled" value="false" /> |
| <WaitForEffectsToEnd/> |
| |
| <RunCode code="application.tree.expandChildrenOf(application.tree.dataProvider.children()[0], true)" waitEvent="updateComplete" waitTarget="tree" /> |
| <WaitForEffectsToEnd/> |
| <RunCode code="application.tree2.expandChildrenOf(application.tree2.dataProvider.children()[1], true)" waitEvent="updateComplete" waitTarget="tree2" /> |
| <WaitForEffectsToEnd/> |
| |
| </setup> |
| <body> |
| <DispatchMouseEvent target="tree" type="mouseOver" buttonDown="false" localX="40" localY="30" /> |
| <DispatchMouseEvent target="tree" type="mouseDown" buttonDown="true" localX="40" localY="30" /> |
| <DispatchMouseEvent target="stage" type="mouseMove" buttonDown="true" stageX="100" stageY="60" /> |
| <DispatchMouseEvent target="stage" type="mouseMove" buttonDown="true" stageX="200" stageY="60" /> |
| <DispatchMouseEvent target="stage" type="mouseMove" buttonDown="true" stageX="300" stageY="60" /> |
| <DispatchMouseEvent target="stage" type="mouseMove" buttonDown="true" stageX="350" stageY="75" /> |
| <DispatchMouseEvent target="stage" type="mouseMove" buttonDown="true" stageX="350" stageY="75" /> |
| <WaitForEffectsToEnd /> |
| <DispatchMouseEvent target="stage" type="mouseUp" stageX="350" stageY="75" waitTarget="tree2" waitEvent="updateComplete" /> |
| <WaitForEffectsToEnd /> |
| |
| <CompareBitmap numColorVariances="10" ignoreMaxColorVariance="true" target="hb" url="../Properties/baselines/Tree_Custom_XML_Copy.png" /> |
| |
| </body> |
| </TestCase> |
| |
| <TestCase testID="CustomTree_DP_XML_Move_End" keywords="[dataProvider, XML, Tree, DragDrop"> |
| <setup> |
| <ResetComponent target="tree" className="comps.treeDragDropComp" waitEvent="updateComplete" waitTarget="tree"/> |
| <ResetComponent target="tree2" className="comps.treeDragDropComp" waitEvent="updateComplete" waitTarget="tree2"/> |
| <RunCode code="addXMLData(application.tree, application.treeXMLEmptyBranches);" waitEvent="updateComplete" waitTarget="tree" /> |
| <WaitForEffectsToEnd/> |
| |
| <RunCode code="application.tree.expandChildrenOf(application.tree.dataProvider.children()[1], true)" waitEvent="updateComplete" waitTarget="tree" /> |
| <WaitForEffectsToEnd/> |
| |
| </setup> |
| <body> |
| <DispatchMouseEvent target="tree" type="mouseOver" buttonDown="false" localX="50" localY="50" /> |
| <DispatchMouseEvent target="tree" type="mouseDown" buttonDown="true" localX="50" localY="50" /> |
| <DispatchMouseEvent target="tree" type="mouseMove" buttonDown="true" localX="40" localY="85" /> |
| <DispatchMouseEvent target="tree" type="mouseMove" buttonDown="true" localX="30" localY="120" /> |
| <DispatchMouseEvent target="tree" type="mouseMove" buttonDown="true" localX="15" localY="145" /> |
| <WaitForEffectsToEnd /> |
| <DispatchMouseEvent target="tree" type="mouseUp" localX="5" localY="145" waitTarget="tree" waitEvent="dragDrop" /> |
| <WaitForEffectsToEnd /> |
| |
| <CompareBitmap numColorVariances="10" ignoreMaxColorVariance="true" target="tree" url="../Properties/baselines/Tree_Custom_XML_Move_End.png" /> |
| |
| </body> |
| </TestCase> |
| |
| <TestCase testID="CustomTree_DP_XML_Copy_Home" keywords="[dataProvider, XML, Tree, DragDrop"> |
| <setup> |
| <ResetComponent target="tree" className="comps.treeDragDropComp" waitEvent="updateComplete" waitTarget="tree"/> |
| <ResetComponent target="tree2" className="comps.treeDragDropComp" waitEvent="updateComplete" waitTarget="tree2"/> |
| <RunCode code="addXMLData(application.tree, application.treeXMLEmptyBranches);" waitEvent="updateComplete" waitTarget="tree" /> |
| <SetProperty target="tree" propertyName="dragMoveEnabled" value="false" /> |
| |
| <RunCode code="application.tree.expandChildrenOf(application.tree.dataProvider.children()[0], true)" waitEvent="updateComplete" waitTarget="tree" /> |
| <WaitForEffectsToEnd/> |
| |
| </setup> |
| <body> |
| <DispatchMouseEvent target="tree" type="mouseOver" buttonDown="false" localX="70" localY="100" waitTarget="tree" waitEvent="mouseOver"/> |
| <DispatchMouseEvent target="tree" type="mouseDown" buttonDown="true" localX="70" localY="100" waitTarget="tree" waitEvent="mouseDown"/> |
| <DispatchMouseEvent target="tree" type="mouseMove" buttonDown="true" localX="40" localY="80" /> |
| <DispatchMouseEvent target="tree" type="mouseMove" buttonDown="true" localX="30" localY="50" /> |
| <DispatchMouseEvent target="tree" type="mouseMove" buttonDown="true" localX="20" localY="20" /> |
| <DispatchMouseEvent target="tree" type="mouseUp" localX="5" localY="5" waitTarget="tree" waitEvent="dragDrop" /> |
| <WaitForEffectsToEnd /> |
| |
| <CompareBitmap numColorVariances="10" ignoreMaxColorVariance="true" target="tree" url="../Properties/baselines/Tree_Custom_XML_Copy_Home.png" /> |
| |
| </body> |
| </TestCase> |
| <!--************************* Bug 12634 ***************************************/--> |
| <TestCase testID="CustomTree_DP_XML_Move_Bug_12634" keywords="[bug, 12634, Tree, DragDrop"> |
| <setup> |
| <ResetComponent target="tree" className="comps.treeDragDropComp" waitEvent="updateComplete" waitTarget="tree"/> |
| <ResetComponent target="tree2" className="comps.treeDragDropComp" waitEvent="updateComplete" waitTarget="tree2"/> |
| |
| <RunCode code="addXMLData(application.tree, application.treeXMLEmptyBranches);" waitEvent="updateComplete" waitTarget="tree" /> |
| <RunCode code="addXMLData(application.tree2, application.treeXML);" waitEvent="updateComplete" waitTarget="tree2" /> |
| <WaitForEffectsToEnd/> |
| |
| </setup> |
| <body> |
| <DispatchMouseClickEvent target="tree" localX="30" localY="10" /> |
| <DispatchMouseClickEvent target="tree" shiftKey="true" localX="30" localY="40" /> |
| <WaitForEffectsToEnd /> |
| |
| <DispatchMouseEvent target="tree" type="mouseOver" buttonDown="false" localX="30" localY="10" /> |
| <DispatchMouseEvent target="tree" type="mouseDown" buttonDown="true" localX="30" localY="10" /> |
| |
| <DispatchMouseEvent target="stage" type="mouseMove" buttonDown="true" stageX="100" stageY="60" /> |
| <DispatchMouseEvent target="stage" type="mouseMove" buttonDown="true" stageX="150" stageY="70" /> |
| <DispatchMouseEvent target="stage" type="mouseMove" buttonDown="true" stageX="200" stageY="70" /> |
| <DispatchMouseEvent target="stage" type="mouseMove" buttonDown="true" stageX="250" stageY="70" /> |
| <DispatchMouseEvent target="stage" type="mouseMove" buttonDown="true" stageX="300" stageY="70" /> |
| <WaitForEffectsToEnd /> |
| <DispatchMouseEvent target="stage" type="mouseUp" stageX="300" stageY="70" waitTarget="tree2" waitEvent="updateComplete" /> |
| <WaitForEffectsToEnd /> |
| |
| <CompareBitmap numColorVariances="10" ignoreMaxColorVariance="true" target="tree2" url="../Properties/baselines/Tree_Custom_XML_Move_Bug_12634.png" /> |
| |
| </body> |
| </TestCase> |
| |
| </testCases> |
| </UnitTester> |