Mustella tests to go with "FLEX-34657: SelectedIndices order is messed up"

Signed-off-by: Erik de Bruin <[email protected]>


Project: http://git-wip-us.apache.org/repos/asf/flex-sdk/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-sdk/commit/789a0ca7
Tree: http://git-wip-us.apache.org/repos/asf/flex-sdk/tree/789a0ca7
Diff: http://git-wip-us.apache.org/repos/asf/flex-sdk/diff/789a0ca7

Branch: refs/heads/develop
Commit: 789a0ca73bdc0b92ea17386045e774331fc9957a
Parents: 93c486a
Author: Erik de Bruin <[email protected]>
Authored: Tue Dec 23 15:51:28 2014 +0100
Committer: Erik de Bruin <[email protected]>
Committed: Tue Dec 23 22:22:33 2014 +0100

----------------------------------------------------------------------
 .../List/Properties/SparkList_Properties.mxml   | 89 ++++++++++++++++++++
 .../components/List/SWFs/SparkList_Basic.mxml   | 63 ++++++++++++++
 2 files changed, 152 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/789a0ca7/mustella/tests/components/List/Properties/SparkList_Properties.mxml
----------------------------------------------------------------------
diff --git 
a/mustella/tests/components/List/Properties/SparkList_Properties.mxml 
b/mustella/tests/components/List/Properties/SparkList_Properties.mxml
new file mode 100644
index 0000000..0590c14
--- /dev/null
+++ b/mustella/tests/components/List/Properties/SparkList_Properties.mxml
@@ -0,0 +1,89 @@
+<?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 xmlns:s="library://ns.adobe.com/flex/spark"                        
+                       xmlns:mx="http://www.adobe.com/2006/mxml"; 
+                       xmlns="*" 
+                       testDir="components/List/Properties/"   
+                       testSWF="SparkList_Basic.mxml">
+
+       <mx:Metadata><![CDATA[
+               [Mixin]
+       ]]></mx:Metadata>
+
+       <mx:Script><![CDATA[
+               
+               import mx.collections.ArrayCollection;
+               
+               public static function init(o:DisplayObject):void {}
+               
+               [Bindable]
+               private var dp_:ArrayCollection = new ArrayCollection(
+                       [ '1', '2', '3', '4', '5', '6' ]);
+               
+               [Bindable]
+               private var si_:Vector.<int> = new <int>[4, 5];
+               
+       ]]></mx:Script>
+       
+       <testCases>                     
+               <TestCase testID="Spark_list_properties_bugs_FLEX-34657" 
+                                 keywords="[Spark, List, selectedIndices, 
bugs, FLEX-34657]">
+                       <setup>
+                               <SetProperty target="sprkList" 
propertyName="allowMultipleSelection" 
+                                                        value= "true" />
+                               <SetProperty target="sprkList" 
propertyName="dataProvider" 
+                                                        value= "{dp_}" />
+                       </setup>
+                       <body>
+                               <DispatchKeyEvent keys="[TAB]" 
waitTarget="sprkList" waitEvent="focusIn" />
+                               <DispatchKeyEvent keys="[END]" 
waitTarget="sprkList" waitEvent="updateComplete" />
+
+                               <DispatchMouseClickEvent target="sprkList" 
localX="5" localY="5" waitEvent="change" waitTarget="sprkList" /> <!-- 1 -->
+                               <WaitForEffectsToEnd/>
+                               <AssertPropertyValue target="sprkList" 
propertyName="selectedIndices" valueExpression="value=[0]" />
+
+                               <DispatchMouseClickEvent target="sprkList" 
localX="5" localY="30" ctrlKey="true" waitEvent="change" waitTarget="sprkList" 
/> <!-- 2 -->
+                               <WaitForEffectsToEnd/>
+                               <AssertPropertyValue target="sprkList" 
propertyName="selectedIndices" valueExpression="value=[1,0]" />
+                               
+                               <DispatchMouseClickEvent target="sprkList" 
localX="5" localY="55" ctrlKey="true" waitEvent="change" waitTarget="sprkList" 
/> <!-- 3 -->
+                               <WaitForEffectsToEnd/>
+                               <!-- AssertPropertyValue target="sprkList" 
propertyName="selectedIndices" valueExpression="value=[2,0,1]" / -->
+                               <AssertPropertyValue target="sprkList" 
propertyName="selectedIndices" valueExpression="value=[2,1,0]" />
+                               
+                               <DispatchMouseClickEvent target="sprkList" 
localX="5" localY="80" ctrlKey="true" waitEvent="change" waitTarget="sprkList" 
/> <!-- 4 -->
+                               <WaitForEffectsToEnd/>
+                               <!-- AssertPropertyValue target="sprkList" 
propertyName="selectedIndices" valueExpression="value=[3,1,0,2]" / -->
+                               <AssertPropertyValue target="sprkList" 
propertyName="selectedIndices" valueExpression="value=[3,2,1,0]" />
+                               
+                               <DispatchMouseClickEvent target="sprkList" 
localX="5" localY="105" ctrlKey="true" waitEvent="change" waitTarget="sprkList" 
/> <!-- 5 -->
+                               <WaitForEffectsToEnd/>
+                               <!-- AssertPropertyValue target="sprkList" 
propertyName="selectedIndices" valueExpression="value=[4,2,0,1,3]" / -->
+                               <AssertPropertyValue target="sprkList" 
propertyName="selectedIndices" valueExpression="value=[4,3,2,1,0]" />
+                               
+                               <DispatchMouseClickEvent target="sprkList" 
localX="5" localY="135" ctrlKey="true" waitEvent="change" waitTarget="sprkList" 
/> <!-- 6 -->
+                               <WaitForEffectsToEnd/>
+                               <!-- AssertPropertyValue target="sprkList" 
propertyName="selectedIndices" valueExpression="value=[5,3,1,0,2,4]" /-->
+                               <AssertPropertyValue target="sprkList" 
propertyName="selectedIndices" valueExpression="value=[5,4,3,2,1,0]" />
+                       </body>
+               </TestCase>
+       </testCases>
+
+</UnitTester>

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/789a0ca7/mustella/tests/components/List/SWFs/SparkList_Basic.mxml
----------------------------------------------------------------------
diff --git a/mustella/tests/components/List/SWFs/SparkList_Basic.mxml 
b/mustella/tests/components/List/SWFs/SparkList_Basic.mxml
new file mode 100644
index 0000000..4530dab
--- /dev/null
+++ b/mustella/tests/components/List/SWFs/SparkList_Basic.mxml
@@ -0,0 +1,63 @@
+<?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.
+
+-->
+<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"; 
+                          xmlns:s="library://ns.adobe.com/flex/spark"          
        
+                          xmlns:mx="library://ns.adobe.com/flex/mx" 
+                          xmlns="*" 
+                          height="480" width="640">
+
+       <!-- Embed fonts for cross platform compatibility of bitmap compares. 
-->
+       <fx:Style>
+               
+               @namespace s "library://ns.adobe.com/flex/spark";
+               @namespace mx "library://ns.adobe.com/flex/mx";
+               
+               @font-face {
+                       src: 
url("../../../../Assets/Fonts/Open_Sans/OpenSans-Regular.ttf");
+                       fontFamily: EmbeddedVerdana;
+                       embedAsCFF: true;
+               }
+               
+               @font-face {
+                       src: 
url("../../../../Assets/Fonts/Open_Sans/OpenSans-Bold.ttf");
+                       fontWeight: bold;
+                       fontFamily: EmbeddedVerdana;
+                       embedAsCFF: true;
+               }
+               
+               @font-face {
+                       src: 
url("../../../../Assets/Fonts/Open_Sans/OpenSans-Italic.ttf");
+                       fontStyle: italic;
+                       fontFamily: EmbeddedVerdana;
+                       embedAsCFF: true;
+               }
+                       
+               global {
+                       fontFamily: EmbeddedVerdana;
+                       fontAntiAliasType: normal;
+               }
+               
+       </fx:Style>
+       
+       <s:List id="sprkList"
+                       left="10" top="10"
+                       width="150" height="250" /> 
+
+</s:Application>

Reply via email to