| <?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="gumbo/components/List/integration/" xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:mx="library://ns.adobe.com/flex/mx" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:m="http://ns.adobe.com/mxml/2009" xmlns="*" testSWF="ListBasic.mxml"> |
| |
| <!-- this set of lines form a template that must be in each unit test --> |
| |
| <fx:Script> |
| <![CDATA[ |
| public static function init(o:DisplayObject):void |
| { |
| } |
| ]]> |
| </fx:Script> |
| |
| <fx:Metadata> |
| <![CDATA[ |
| [Mixin] |
| ]]> |
| </fx:Metadata> |
| <!-- end of set of lines that must be in each unit test --> |
| <fx:Script> |
| <![CDATA[ |
| import comps.*; |
| import spark.layouts.*; |
| import mx.collections.ArrayCollection; |
| import mx.managers.ToolTipManager; |
| import mx.controls.PopUpMenuButton; |
| import mx.controls.ToolTip; |
| private var myPUMB:PopUpMenuButton; |
| |
| |
| public function addPUMB():void{ |
| myPUMB = new PopUpMenuButton(); |
| myPUMB.dataProvider = ['one', 'two', 'gggg', 'yyyy', 'jjjj', 'pppp', 'qqqq']; |
| application.list2.dataProvider.addItemAt(myPUMB,0); |
| } |
| |
| private function toolTipValue():String |
| { |
| return application.list1.selectedItem.lastName; |
| } |
| |
| public var myTip:ToolTip; |
| |
| private function createBigTip( event:Event ):void |
| { |
| var s:String = "This is a custom ToolTip." |
| myTip = ToolTipManager.createToolTip(s,10,10) as ToolTip; |
| myTip.setStyle("backgroundColor",0xFFCC00); |
| myTip.width = 250; |
| myTip.height = 50; |
| } |
| |
| private function destroyBigTip():void |
| { |
| ToolTipManager.destroyToolTip(myTip); |
| } |
| |
| |
| ]]> |
| </fx:Script> |
| |
| <testCases> |
| |
| <TestCase testID="list_toolTip_dynamic_custom_gumbo" keywords="[list, toolTip]"> |
| <setup> |
| <ResetComponent target="list1" className="spark.components.List" waitEvent="updateComplete" /> |
| |
| <RunCode code="application.list1.itemRenderer=new ClassFactory(comps.PlayerRenderer);" /> |
| <RunCode code="application.createPlayersAC()" /> |
| <SetProperty target="list1" propertyName="dataProvider" valueExpression="value=application.players" waitEvent="updateComplete" waitTarget="list1.dataGroup"/> |
| <RunCode code="application.list1.addEventListener(MouseEvent.CLICK, createBigTip);" /> |
| <Pause timeout="100"/> |
| </setup> |
| <body> |
| <DispatchMouseClickEvent target="list1" localX="10" localY="10" waitEvent="updateComplete" /> |
| <Pause timeout="100"/> |
| <AssertPropertyValue target="script:myTip" propertyName="text" value="This is a custom ToolTip." /> |
| <AssertPropertyValue target="script:myTip" propertyName="width" value="250" /> |
| <AssertPropertyValue target="script:myTip" propertyName="height" value="50" /> |
| <AssertStyleValue target="script:myTip" styleName="backgroundColor" value="0xFFCC00" /> |
| <RunCode code="destroyBigTip();" /> |
| |
| </body> |
| </TestCase> |
| |
| |
| </testCases> |
| |
| |
| </UnitTester> |