| <?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/List/Events/" xmlns:mx="http://www.adobe.com/2006/mxml" xmlns="*" testSWF="ListMain.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.controls.Button; |
| private function addButton():void{ |
| var btn:Button = new Button(); |
| btn.label = "Button to Focus Out"; |
| application.addChild(btn); |
| } |
| ]]> |
| </mx:Script> |
| |
| <testCases> |
| <TestCase testID="listbase_events_change_keyboard" keywords="[list, events, change, keyboard]"> |
| <setup> |
| <ResetComponent target="mybox" className="ListComp" waitEvent="updateComplete" waitTarget="mybox"/> |
| </setup> |
| <body> |
| <DispatchKeyEvent key="TAB" /> <DispatchKeyEvent key="DOWN" /> <DispatchKeyEvent key="DOWN" /> |
| <AssertEvent target="mybox.mylist" eventName="change" eventClass="mx.events::ListEvent"/> |
| </body> |
| </TestCase> |
| <TestCase testID="listbase_events_change_mouse" keywords="[list, events, change, mouse]"> |
| <setup> |
| <ResetComponent target="mybox" className="ListComp" waitEvent="updateComplete" waitTarget="mybox"/> |
| </setup> |
| <body> |
| <WaitForEffectsToEnd/> |
| <DispatchMouseClickEvent target="mybox.mylist" localX="100" localY="125" /> |
| <AssertEvent target="mybox.mylist" eventName="change" eventClass="mx.events::ListEvent"/> |
| </body> |
| </TestCase> |
| <TestCase testID="listbase_events_itemClick" keywords="[list, events, itemClick, mouse]"> |
| <setup> |
| <ResetComponent target="mybox" className="ListComp" waitEvent="updateComplete" waitTarget="mybox"/> |
| </setup> |
| <body> |
| <WaitForEffectsToEnd/> |
| <DispatchMouseClickEvent target="mybox.mylist" localX="100" localY="125" /> |
| <AssertEvent target="mybox.mylist" eventName="itemClick" eventClass="mx.events::ListEvent"/> |
| </body> |
| </TestCase> |
| <TestCase testID="listbase_events_itemRollOver" keywords="[list, events, itemRollOver, mouse]"> |
| <setup> |
| <ResetComponent target="mybox" className="ListComp" waitEvent="updateComplete" waitTarget="mybox"/> |
| </setup> |
| <body> |
| <WaitForEffectsToEnd/> |
| <DispatchMouseEvent target="mybox.mylist" type ="mouseOver" localX="100" localY="125" /> |
| <DispatchMouseEvent target="mybox.mylist" type ="mouseOver" localX="100" localY="100" /> |
| <DispatchMouseEvent target="mybox.mylist" type ="mouseOver" localX="100" localY="80" /> |
| <AssertEvent target="mybox.mylist" eventName="itemRollOver" eventClass="mx.events::ListEvent"/> |
| </body> |
| </TestCase> |
| |
| <TestCase testID="listbase_events_itemRollOut" keywords="[list, events, itemRollOut, mouse]"> |
| <setup> |
| <ResetComponent target="mybox" className="ListComp" waitEvent="updateComplete" waitTarget="mybox"/> |
| </setup> |
| <body> |
| <WaitForEffectsToEnd/> |
| <DispatchMouseEvent target="mybox.mylist" type ="mouseOver" localX="100" localY="125" /> |
| <WaitForEffectsToEnd/> |
| <DispatchMouseEvent target="mybox.mylist" type ="mouseOver" localX="100" localY="100" /> |
| <DispatchMouseEvent target="mybox.mylist" type ="mouseOut" localX="100" localY="50" /> |
| <AssertEvent target="mybox.mylist" eventName="itemRollOut" eventClass="mx.events::ListEvent"/> |
| </body> |
| </TestCase> |
| <TestCase testID="listbase_events_itemDoubleClick" keywords="[list, events, itemDoubleClick, mouse]"> |
| <setup> |
| <ResetComponent target="mybox" className="ListComp" waitEvent="updateComplete" waitTarget="mybox"/> |
| <SetProperty target="mybox.mylist" propertyName="doubleClickEnabled" value="true"/> |
| </setup> |
| <body> |
| <WaitForEffectsToEnd/> |
| <DispatchMouseClickEvent target="mybox.mylist" localX="100" localY="125" /> |
| <DispatchMouseClickEvent target="mybox.mylist" localX="100" localY="125" /> |
| <AssertEvent target="mybox.mylist" eventName="itemClick" eventClass="mx.events::ListEvent"/> |
| </body> |
| </TestCase> |
| |
| </testCases> |
| </UnitTester> |