| <?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/ComboBox/Methods/" xmlns:mx="http://www.adobe.com/2006/mxml" xmlns="*" testSWF="ComboBoxMain.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; |
| ]]> |
| </mx:Script> |
| |
| <testCases> |
| <TestCase testID="combobox_methods_open_close" keywords="[comboBox, methods, open, close]"> |
| <setup> |
| <ResetComponent target="mybox" className="ComboBoxComp" waitEvent="updateComplete" waitTarget="mybox"/> |
| </setup> |
| <body> |
| <RunCode code="application.mybox.myCB.open()" waitEvent="open" waitTarget="mybox.myCB" /> |
| <CompareBitmap target="mybox" url="../Methods/Baselines/cb_open.png" /> |
| <RunCode code="application.mybox.myCB.close()" waitEvent="close" waitTarget="mybox.myCB"/> |
| <CompareBitmap target="mybox" url="../Methods/Baselines/cb_close.png" /> |
| </body> |
| </TestCase> |
| <TestCase testID="combobox_methods_itemToLabel" keywords="[comboBox, methods, itemToLabel]"> |
| <setup> |
| <ResetComponent target="mybox" className="ComboBoxComp" waitEvent="updateComplete" waitTarget="mybox"/> |
| </setup> |
| <body> |
| <DispatchMouseClickEvent target="mybox.myCB" localX="2" localY="2" waitEvent="focusIn" waitTarget="mybox.myCB"/> |
| <DispatchKeyEvent key="DOWN" ctrlKey="true" waitEvent="open" waitTarget="mybox.myCB"/> |
| <DispatchKeyEvent key="DOWN" ctrlKey="false" repeatCount="4" /> |
| <DispatchKeyEvent key="ENTER" ctrlKey="true" waitEvent="close" waitTarget="mybox.myCB"/> |
| <AssertMethodValue target="mybox.myCB" method="value=application.mybox.myCB.itemToLabel(application.mybox.myCB.selectedItem)" |
| value="Rick"/> |
| </body> |
| </TestCase> |
| </testCases> |
| </UnitTester> |