| <?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/Properties/" xmlns:mx="http://www.adobe.com/2006/mxml" xmlns="*" testSWF="List_Basic.mxml"> |
| <mx:Script> |
| <![CDATA[ |
| public static function init(o:DisplayObject):void |
| { |
| } |
| ]]> |
| </mx:Script> |
| <mx:Metadata> |
| <![CDATA[ |
| [Mixin] |
| ]]> |
| </mx:Metadata> |
| <mx:Script> |
| <![CDATA[ |
| import mx.collections.ArrayCollection; |
| [Bindable] |
| private var colNull:ArrayCollection = |
| new ArrayCollection(['','Aaaaaaaaaa1','B','C',null,' ','D','E','F','G','Hhhhhhhhhh1',' ']); |
| |
| private function setData():void |
| { |
| application.list.dataProvider = colNull; |
| } |
| |
| ]]> |
| </mx:Script> |
| |
| <testCases> |
| |
| <!--************************ bug 12233 ****************************************--> |
| <TestCase testID="list_property_selectedItem_bug_12233" keywords="[list, bug, 12233, property, selectedItem]"> |
| <setup> |
| <ResetComponent target="list" className="mx.controls.List" waitEvent="updateComplete" waitTarget="list"/> |
| <RunCode code="{setData();}" /> |
| <SetProperty target="list" propertyName="selectedIndex" value= "1"/> |
| </setup> |
| <body> |
| <DispatchMouseEvent type="mouseOver" target="list" localX="15" localY="12" waitEvent="mouseOver" waitTarget="list" /> |
| <DispatchMouseClickEvent target="list" localX="15" localY="12" waitEvent="change" waitTarget="list" /> |
| <WaitForEffectsToEnd /> |
| <AssertPropertyValue target="list" propertyName="selectedIndex" value="0" /> |
| <AssertPixelValue target="list" x="15" y="12" value="0x7FCEFF" /> |
| |
| |
| </body> |
| </TestCase> |
| <!--************************ bug 12852 ****************************************--> |
| <TestCase testID="list_property_selectedItem_bug_12852" keywords="[list, bug, 12852, property, selectedItem]"> |
| <setup> |
| <ResetComponent target="list" className="mx.controls.List" waitEvent="updateComplete" waitTarget="list"/> |
| <RunCode code="{setData();}" /> |
| <SetProperty target="list" propertyName="allowMultipleSelection" value= "true"/> |
| </setup> |
| <body> |
| <SetProperty target="list" propertyName="selectedIndex" value= "2"/> |
| <RunCode code="{application.list.dataProvider.removeItemAt(2);application.list.validateNow();}" /> |
| <WaitForEffectsToEnd /> |
| <DispatchMouseEvent type="mouseOver" target="list" localX="15" localY="35" waitEvent="mouseOver" waitTarget="list" /> |
| <DispatchMouseClickEvent target="list" localX="15" localY="35" waitEvent="change" waitTarget="list"/> |
| <DispatchMouseClickEvent target="list" localX="15" localY="55" shiftKey="true" waitEvent="change" waitTarget="list"/> |
| <WaitForEffectsToEnd /> |
| <AssertPropertyValue target="list" propertyName="selectedIndices" valueExpression="value=[2,1]" /> |
| </body> |
| </TestCase> |
| </testCases> |
| </UnitTester> |