| <?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/DataGrid/DataGrid_HaloSkin/Events/" xmlns:mx="http://www.adobe.com/2006/mxml" xmlns="*" testSWF="DataGrid_Events_Main_halo.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 mx.utils.ObjectUtil; |
| import mx.effects.Fade; |
| |
| private function startEffect():void |
| { |
| var fade:Fade = new Fade(application.mydatagrid) |
| fade.play(); |
| } |
| ]]> |
| </mx:Script> |
| |
| <testCases> |
| |
| <TestCase testID="event_toolTipCreate_halo" keywords="['event,toolTipCreate']"> |
| <setup> |
| <ResetComponent target="mydatagrid" className="mx.controls.DataGrid" waitTarget="mydatagrid" waitEvent="updateComplete"/> |
| <SetProperty target="mydatagrid" propertyName="dataProvider" valueExpression="value=ObjectUtil.copy(application.dataArray1)" waitEvent="updateComplete" /> |
| <SetProperty target="mydatagrid" propertyName="toolTip" value="tip"/> |
| </setup> |
| <body> |
| <DispatchMouseEvent type="mouseOver" target="mydatagrid" localX="122.65" localY="120" /> |
| <AssertEvent target="mydatagrid" eventName="toolTipCreate" eventClass="mx.events::ToolTipEvent" /> |
| </body> |
| </TestCase> |
| |
| <TestCase testID="event_toolTipStart_halo" keywords="['event,toolTipStart']"> |
| <setup> |
| <ResetComponent target="mydatagrid" className="mx.controls.DataGrid" waitTarget="mydatagrid" waitEvent="updateComplete"/> |
| <SetProperty target="mydatagrid" propertyName="dataProvider" valueExpression="value=ObjectUtil.copy(application.dataArray1)" waitEvent="updateComplete" /> |
| <SetProperty target="mydatagrid" propertyName="toolTip" value="tip"/> |
| </setup> |
| <body> |
| <DispatchMouseEvent type="mouseOver" target="mydatagrid" localX="122.65" localY="120" /> |
| <AssertEvent target="mydatagrid" eventName="toolTipStart" eventClass="mx.events::ToolTipEvent" /> |
| </body> |
| </TestCase> |
| |
| <TestCase testID="event_toolTipShow_halo" keywords="['event,toolTipShow']"> |
| <setup> |
| <ResetComponent target="mydatagrid" className="mx.controls.DataGrid" waitTarget="mydatagrid" waitEvent="updateComplete"/> |
| <SetProperty target="mydatagrid" propertyName="dataProvider" valueExpression="value=ObjectUtil.copy(application.dataArray1)" waitEvent="updateComplete" /> |
| <SetProperty target="mydatagrid" propertyName="toolTip" value="tip"/> |
| </setup> |
| <body> |
| <DispatchMouseEvent type="mouseOver" target="mydatagrid" localX="122.65" localY="120"/> |
| <AssertEvent target="mydatagrid" eventName="toolTipShow" eventClass="mx.events::ToolTipEvent" /> |
| </body> |
| </TestCase> |
| |
| <TestCase testID="event_toolTipShown_halo" keywords="['event,toolTipShown']"> |
| <setup> |
| <ResetComponent target="mydatagrid" className="mx.controls.DataGrid" waitTarget="mydatagrid" waitEvent="updateComplete"/> |
| <SetProperty target="mydatagrid" propertyName="dataProvider" valueExpression="value=ObjectUtil.copy(application.dataArray1)" waitEvent="updateComplete" /> |
| <SetProperty target="mydatagrid" propertyName="toolTip" value="tip"/> |
| </setup> |
| <body> |
| <DispatchMouseEvent type="mouseOver" target="mydatagrid" localX="122.65" localY="120" /> |
| <AssertEvent target="mydatagrid" eventName="toolTipShown" eventClass="mx.events::ToolTipEvent" /> |
| </body> |
| </TestCase> |
| |
| <TestCase testID="event_resize_halo" keywords="['event,resize']"> |
| <setup> |
| <ResetComponent target="mydatagrid" className="mx.controls.DataGrid" waitTarget="mydatagrid" waitEvent="updateComplete"/> |
| <SetProperty target="mydatagrid" propertyName="dataProvider" valueExpression="value=ObjectUtil.copy(application.dataArray1)" waitEvent="updateComplete" /> |
| <SetProperty target="mydatagrid" propertyName="width" value="80"/> |
| </setup> |
| <body> |
| <AssertEvent target="mydatagrid" eventName="resize" eventClass="mx.events::ResizeEvent" /> |
| </body> |
| </TestCase> |
| |
| <TestCase testID="event_move_halo" keywords="['event,move']"> |
| <setup> |
| <ResetComponent target="mydatagrid" className="mx.controls.DataGrid" waitTarget="mydatagrid" waitEvent="updateComplete"/> |
| <SetProperty target="mydatagrid" propertyName="dataProvider" valueExpression="value=ObjectUtil.copy(application.dataArray1)" waitEvent="updateComplete" /> |
| <SetProperty target="mydatagrid" propertyName="x" value="40"/> |
| </setup> |
| <body> |
| <AssertEvent target="mydatagrid" eventName="move" eventClass="mx.events::MoveEvent" /> |
| </body> |
| </TestCase> |
| |
| <TestCase testID="event_scroll_halo" keywords="['event,scroll']"> |
| <setup> |
| <ResetComponent target="mydatagrid" className="mx.controls.DataGrid" waitTarget="mydatagrid" waitEvent="updateComplete"/> |
| <SetProperty target="mydatagrid" propertyName="dataProvider" valueExpression="value=ObjectUtil.copy(application.dataArray1)" waitEvent="updateComplete" /> |
| </setup> |
| <body> |
| <DispatchMouseClickEvent target="mydatagrid" localX="292" localY="149" waitEvent="scroll" waitTarget="mydatagrid"/> |
| <AssertEvent target="mydatagrid" eventName="scroll" eventClass="mx.events::ScrollEvent" numExpectedEvents="2" /> |
| </body> |
| </TestCase> |
| |
| <TestCase testID="event_dragenter_halo" keywords="['event,dragenter']"> |
| <setup> |
| <ResetComponent target="mydatagrid" className="mx.controls.DataGrid" waitTarget="mydatagrid" waitEvent="updateComplete"/> |
| <SetProperty target="mydatagrid" propertyName="dataProvider" valueExpression="value=ObjectUtil.copy(application.dataArray1)" waitEvent="updateComplete" /> |
| <SetProperty target="mydatagrid" propertyName="dragEnabled" value="true"/> |
| </setup> |
| <body> |
| <DispatchMouseEvent type="mouseDown" target="mydatagrid" localX="122.65" localY="120"/> |
| <DispatchMouseEvent type="mouseMove" buttonDown="true" target="mydatagrid" localX="122.65" localY="100"/> |
| <DispatchMouseEvent type="mouseMove" buttonDown="true" target="mydatagrid" localX="122.65" localY="80"/> |
| <AssertEvent target="mydatagrid" eventName="dragEnter" eventClass="mx.events::DragEvent" /> |
| </body> |
| </TestCase> |
| |
| </testCases> |
| |
| </UnitTester> |