blob: 7052fd2109ab514baa1050faf3118c2b93142162 [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/ComboBox/Integration/" 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;
import mx.managers.ToolTipManager;
import mx.controls.TextArea;
private var ta:TextArea;
private function attachListener():void{
application.mybox.myCB.addEventListener('change',changeListener);
}
private function setToolTipDelays():void{
ToolTipManager.hideDelay = 500;
ToolTipManager.showDelay = 500;
}
private function changeListener(evt:Event):void{
ta.text+="\n change listened";
}
private function addTA():void{
ta = new TextArea();
application.mybox.addChild(ta);
}
private function setErrorString():void{
application.mybox.myCB.errorString="ComboBox Error";
}
private function resetErrorString():void{
application.mybox.myCB.errorString="";
}
public function remove_and_repopulate():void
{
application.mybox.myCB.dataProvider.removeAll();
application.mybox.myCB.dataProvider=[{slno:"1",label:"Joseph",age:"23"},{slno:"2",label:"Jeena",age:"21"},{slno:"3",label:"Jerry",age:"4"}
,{slno:"4",label:"Tom",age:"1"},{slno:"5",label:"Rick",age:"12"},{slno:"6",label:"John",age:"52"}];
}
]]>
</mx:Script>
<testCases>
<TestCase testID="combobox_bugs_190590" keywords="[comboBox, bugs, 190590]">
<setup>
<ResetComponent target="mybox" className="ComboBoxComp" waitEvent="updateComplete" waitTarget="mybox"/>
<RunCode code="addTA()" waitEvent="updateComplete" waitTarget="mybox"/>
<RunCode code="attachListener()"/>
<SetProperty target="mybox.myCB" propertyName="editable" value="true" waitEvent="updateComplete" waitTarget="mybox.myCB"/>
</setup>
<body>
<AssertPropertyValue target="mybox.myCB" propertyName ="editable" value="true"/>
<DispatchMouseClickEvent target="mybox.myCB" localX="2" localY="2" waitEvent="focusIn" waitTarget="mybox.myCB"/>
<DispatchKeyEvent char="t" waitEvent="change" waitTarget="mybox.myCB"/>
<DispatchKeyEvent char="y" waitEvent="change" waitTarget="mybox.myCB"/>
<DispatchKeyEvent char="p" waitEvent="change" waitTarget="mybox.myCB"/>
<DispatchKeyEvent char="e" waitEvent="change" waitTarget="mybox.myCB"/>
</body>
</TestCase>
<TestCase testID="combobox_bugs_173712" keywords="[comboBox, bugs, 173712]">
<setup>
<ResetComponent target="mybox" className="ComboBoxComp" waitEvent="updateComplete" waitTarget="mybox"/>
<RunCode code="setToolTipDelays()"/>
</setup>
<body>
<DispatchKeyEvent key="TAB" />
<CompareBitmap target="mybox" url="../Integration/Baselines/cb_bugs_priorityA_173712_inital.png" numColorVariances="15" ignoreMaxColorVariance="true" />
<RunCode code="setErrorString()" waitEvent="updateComplete" waitTarget="mybox.myCB"/>
<DispatchMouseEvent target="mybox.myCB" type ="mouseOver" localX="2" localY="2" />
<!-- wait for ToolTip - see setToolTipDelays() ToolTipManager.showDisplay -->
<Pause timeout="600"/>
<CompareBitmap target="mybox" url="../Integration/Baselines/cb_bugs_priorityA_173712_error_string_set.png" numColorVariances="15" ignoreMaxColorVariance="true" />
<RunCode code="resetErrorString()" waitEvent="updateComplete" waitTarget="mybox.myCB"/>
<DispatchMouseEvent target="mybox.myCB" type ="mouseOver" localX="2" localY="2" />
<!-- wait for ToolTip - see setToolTipDelays() ToolTipManager.showDisplay -->
<Pause timeout="600"/>
<CompareBitmap target="mybox" url="../Integration/Baselines/cb_bugs_priorityA_173712_error_string_reset.png" numColorVariances="15" ignoreMaxColorVariance="true" />
<RunCode code="setErrorString()" waitEvent="updateComplete" waitTarget="mybox.myCB"/>
<DispatchMouseClickEvent target="mybox.myCB" stageX="2" stageY="2" />
<DispatchMouseEvent target="mybox.myCB" type ="mouseOver" localX="2" localY="2" />
<!-- wait for ToolTip - see setToolTipDelays() ToolTipManager.showDisplay -->
<Pause timeout="600"/>
<CompareBitmap target="mybox" url="../Integration/Baselines/cb_bugs_priorityA_173712_error_string_setAgain.png" numColorVariances="15" ignoreMaxColorVariance="true" />
</body>
<cleanup>
<RunCode code="resetErrorString()" waitEvent="updateComplete" waitTarget="mybox.myCB"/>
<WaitForLayoutManager/>
</cleanup>
</TestCase>
</testCases>
</UnitTester>