blob: 4e5696695892f7859b48fd0b002892f63f54a012 [file] [log] [blame]
<?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="list_events_itemFocusIn_mouse" keywords="[list, events, itemFocusIn, mouse]">
<setup>
<ResetComponent target="mybox" className="ListComp" waitEvent="updateComplete" waitTarget="mybox"/>
<SetProperty target="mybox.mylist" propertyName="editable" value= "true"/>
</setup>
<body>
<WaitForEffectsToEnd/>
<DispatchMouseClickEvent target="mybox.mylist" localX="100" localY="100" />
<AssertEvent target="mybox.mylist" eventName="itemFocusIn" eventClass="mx.events::ListEvent"/>
<DispatchMouseClickEvent target="mybox" localX="5" localY="5" />
</body>
</TestCase>
<TestCase testID="list_events_itemFocusIn_keyboard" keywords="[list, events, itemFocusIn, keyboard]">
<setup>
<ResetComponent target="mybox" className="ListComp" waitEvent="updateComplete" waitTarget="mybox"/>
<SetProperty target="mybox.mylist" propertyName="editable" value= "true"/>
</setup>
<body>
<WaitForEffectsToEnd/>
<DispatchKeyEvent key="TAB" /> <DispatchKeyEvent key="TAB" />
<AssertEvent target="mybox.mylist" eventName="itemFocusIn" eventClass="mx.events::ListEvent"/>
</body>
</TestCase>
<TestCase testID="list_events_itemFocusOut_mouse" keywords="[list, events, itemFocusOut, mouse]">
<setup>
<ResetComponent target="mybox" className="ListComp" waitEvent="updateComplete" waitTarget="mybox"/>
<SetProperty target="mybox.mylist" propertyName="editable" value= "true"/>
</setup>
<body>
<WaitForEffectsToEnd/>
<DispatchMouseClickEvent target="mybox.mylist" localX="100" localY="100" />
<AssertEvent target="mybox.mylist" eventName="itemFocusIn" eventClass="mx.events::ListEvent"/>
<DispatchMouseClickEvent target="mybox.mylist" localX="100" localY="140" />
<AssertEvent target="mybox.mylist" eventName="itemFocusOut" eventClass="mx.events::ListEvent"/>
<DispatchMouseClickEvent target="mybox" localX="5" localY="5" />
</body>
</TestCase>
<TestCase testID="list_events_itemEditBegin_keyboard" keywords="[list, events, itemEditBegin, keyboard]">
<setup>
<ResetComponent target="mybox" className="ListComp" waitEvent="updateComplete" waitTarget="mybox"/>
<SetProperty target="mybox.mylist" propertyName="editable" value= "true"/>
</setup>
<body>
<WaitForEffectsToEnd/>
<DispatchKeyEvent key="TAB" />
<AssertEvent target="mybox.mylist" eventName="itemEditBegin" eventClass="mx.events::ListEvent"/>
<DispatchMouseClickEvent target="mybox" localX="5" localY="5" />
</body>
</TestCase>
<TestCase testID="list_events_itemEditBegin_mouse" keywords="[list, events, itemEditBegin, mouse]">
<setup>
<ResetComponent target="mybox" className="ListComp" waitEvent="updateComplete" waitTarget="mybox"/>
<SetProperty target="mybox.mylist" propertyName="editable" value= "true"/>
</setup>
<body>
<WaitForEffectsToEnd/>
<DispatchMouseClickEvent target="mybox.mylist" localX="100" localY="100" />
<AssertEvent target="mybox.mylist" eventName="itemEditBegin" eventClass="mx.events::ListEvent"/>
<DispatchMouseClickEvent target="mybox" localX="5" localY="5" />
</body>
</TestCase>
<TestCase testID="list_events_itemEditBeginning_mouse" keywords="[list, events, itemEditBeginning, mouse]">
<setup>
<ResetComponent target="mybox" className="ListComp" waitEvent="updateComplete" waitTarget="mybox"/>
<SetProperty target="mybox.mylist" propertyName="editable" value= "true"/>
</setup>
<body>
<WaitForEffectsToEnd/>
<DispatchMouseClickEvent target="mybox.mylist" localX="100" localY="100" />
<AssertEvent target="mybox.mylist" eventName="itemEditBeginning" eventClass="mx.events::ListEvent"/>
<DispatchMouseClickEvent target="mybox" localX="5" localY="5" waitEvent="focusOut" waitTarget="mybox.mylist"/>
</body>
</TestCase>
<TestCase testID="list_events_itemEditEnd_keyboard" keywords="[list, events, itemEditEnd, keyboard]">
<setup>
<ResetComponent target="mybox" className="ListComp" waitEvent="updateComplete" waitTarget="mybox"/>
<SetProperty target="mybox.mylist" propertyName="editable" value= "true"/>
</setup>
<body>
<WaitForEffectsToEnd/>
<DispatchKeyEvent key="TAB" waitEvent="itemEditBegin" waitTarget="mybox.mylist"/>
<DispatchKeyEvent char="B" /> <DispatchKeyEvent char="U" />
<DispatchKeyEvent char="G" />
<DispatchKeyEvent key="TAB" />
<DispatchMouseClickEvent target="mybox" localX="5" localY="5" />
<AssertEvent target="mybox.mylist" eventName="itemEditEnd" eventClass="mx.events::ListEvent"/>
</body>
</TestCase>
<TestCase testID="list_events_itemEditEnd_mouse" keywords="[list, events, itemEditEnd, mouse]">
<setup>
<ResetComponent target="mybox" className="ListComp" waitEvent="updateComplete" waitTarget="mybox"/>
<SetProperty target="mybox.mylist" propertyName="editable" value= "true"/>
</setup>
<body>
<WaitForEffectsToEnd/>
<DispatchMouseClickEvent target="mybox.mylist" localX="100" localY="70" />
<WaitForEffectsToEnd/>
<DispatchMouseClickEvent target="mybox" localX="5" localY="5" />
<AssertEvent target="mybox.mylist" eventName="itemEditEnd" eventClass="mx.events::ListEvent"/>
</body>
</TestCase>
</testCases>
</UnitTester>