flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From p...@apache.org
Subject svn commit: r1370009 [14/34] - in /incubator/flex/trunk/mustella/tests/apollo: ./ DragManager/ DragManager/SWFs/ DragManager/SWFs/assets/ DragManager/SWFs/comps/ DragManager/Spark/ DragManager/Spark/baselines/ FileComboBox/ FileComboBox/SWFs/ FileCombo...
Date Mon, 06 Aug 2012 20:51:43 GMT
Added: incubator/flex/trunk/mustella/tests/apollo/spark/components/Window/methods/window_methods_elementChange_beforeOpen.mxml
URL: http://svn.apache.org/viewvc/incubator/flex/trunk/mustella/tests/apollo/spark/components/Window/methods/window_methods_elementChange_beforeOpen.mxml?rev=1370009&view=auto
==============================================================================
--- incubator/flex/trunk/mustella/tests/apollo/spark/components/Window/methods/window_methods_elementChange_beforeOpen.mxml (added)
+++ incubator/flex/trunk/mustella/tests/apollo/spark/components/Window/methods/window_methods_elementChange_beforeOpen.mxml Mon Aug  6 20:51:08 2012
@@ -0,0 +1,415 @@
+<?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="apollo/spark/components/Window/methods/"  xmlns:mx="http://www.adobe.com/2006/mxml" xmlns="*" testSWF="window_basic_003.mxml">
+
+	
+<!-- this set of lines form a template that must be in each unit test -->
+	
+    <mx:Script>
+	<![CDATA[
+	public static function init(o:DisplayObject):void
+	{
+	}
+	]]>
+    </mx:Script>
+    <mx:Metadata>
+	<![CDATA[
+		[Mixin]
+	]]>
+    </mx:Metadata>
+	<!-- end of set of lines that must be in each unit test -->
+
+    <mx:Script>
+	<![CDATA[
+	 import mx.core.FlexGlobals;
+	 import spark.components.Button;
+	 import spark.components.TextInput;
+	 import spark.components.CheckBox;
+	 import spark.components.TextArea;
+	 import spark.components.Window;
+	 import mx.controls.DataGrid;
+	 import mx.controls.Label;
+	 import mx.core.IVisualElement;
+	 import comps.*;
+	 import mx.collections.ArrayCollection;
+	 public var windowObj:Window;
+	 
+	 [Bindable]
+	 private var d:ArrayCollection=new ArrayCollection([{slno:"1",name:"Joseph",age:"23"},{slno:"2",name:"Jeena",age:"21"},{slno:"3",name:"Jerry",age:"4"}
+	 ,{slno:"4",name:"Tom",age:"1"},{slno:"5",name:"Rick",age:"12"},{slno:"6",name:"John",age:"52"}]);
+	   
+	 public function initWindowObj():void
+	 {
+	 	windowObj=new Window();
+		windowObj.width=400;
+		windowObj.height=500;
+	 }
+	 public function addButtonForPlainWindow():void
+	 {
+	 	var b:Button =new Button();
+	 	b.name="childButton2";
+	 	b.label="childButton2";
+	 	initWindowObj();
+	 	windowObj.addElement(b);		
+	 }
+	 public function addTextInputForPlainWindow():void
+	 {
+	 	var t:TextInput =new TextInput();
+	 	t.name="textInput2";
+	 	initWindowObj();
+	 	windowObj.addElement(t);		
+	 }
+	 
+	 
+	 public function addCheckBox():void
+	 {
+	 	var checkBox:CheckBox=new CheckBox();
+	 	checkBox.name="checkBox11";
+	 	checkBox.label="available";
+	 	checkBox.y=10;
+	 	FlexGlobals.topLevelApplication.myWin.addElement(checkBox);
+	 }
+	 public function addTextInput():void
+	 {
+	 	var ti:TextInput=new TextInput();
+	 	ti.name="textInput11";
+	 	ti.text="this is a test";
+	 	ti.y=100;
+	 	FlexGlobals.topLevelApplication.myWin.addElement(ti);
+	 }
+
+	 public function addTextArea():void
+	 {
+	 	var ti:TextArea=new TextArea();
+	 	ti.name="textArea11";
+	 	ti.text="this is a test";
+	 	ti.y=100;
+	 	FlexGlobals.topLevelApplication.myWin.addElement(ti);
+	 }
+	 
+	 public function addDatagrid():void
+	 {
+	 	var dg1:DataGrid=new DataGrid();
+	 	dg1.y=120;
+	 	dg1.name="dataGrid11";
+	 	dg1.dataProvider=d;
+	 	FlexGlobals.topLevelApplication.myWin.addElement(dg1);
+	 }
+
+	public function removeCheckBox():void
+	{
+		removeElementByClass(CheckBox);
+		
+	}
+	public function removeButton():void
+	{
+		
+		removeElementByClass(Button);
+	}
+	public function removeLabel():void
+	{
+		
+		removeElementByClass(mx.controls.Label);
+	}
+	public function removeDataGrid():void
+	{
+		
+		removeElementByClass(DataGrid);
+	}	
+	
+	public function removeTextArea():void
+	{
+		
+		removeElementByClass(TextArea);
+	}
+	
+	public function removeElementByClass(classObj:Class):void
+	{
+		
+		var numElements:Number=5;//FlexGlobals.topLevelApplication.myWin.contentGroup.numElements;
+		var element:IVisualElement;
+		for (var i:Number=0;i<numElements;i++)
+		{
+			element=FlexGlobals.topLevelApplication.myWin.getElementAt(i);
+			if (element as classObj)
+			{
+				FlexGlobals.topLevelApplication.myWin.removeElementAt(i);
+				break;
+			}
+		}
+		
+	}
+
+	public function removeAllElements():void
+	{
+		
+		var numElements:Number=FlexGlobals.topLevelApplication.myWin.numElements;
+		var element:IVisualElement;
+		while(numElements>0)
+		{
+		    FlexGlobals.topLevelApplication.myWin.removeElementAt(0);
+		    numElements=FlexGlobals.topLevelApplication.myWin.numElements;
+		}
+	}
+
+
+	]]>
+    </mx:Script>
+
+	
+    <testCases>
+
+	<!--
+	========================================================
+	Test method addElement before window open
+	========================================================
+	-->
+        
+        <TestCase testID="addElement_beforeWindowOpen_test1" keywords="[Window,methods,addElement]" 
+        description="add a button to an non opened Window">
+
+	    <setup> 
+		<RunCode code="FlexGlobals.topLevelApplication.closeAllChildWindow()"/>   
+		<RunCode code="FlexGlobals.topLevelApplication.myWin=FlexGlobals.topLevelApplication.createANoOpenWindowByClass(MyWindowWithContents,'test1')"/>
+	    </setup>
+
+	    <body>
+		<RunCode code="FlexGlobals.topLevelApplication.testAddElement()"/>
+		<RunCode code="FlexGlobals.topLevelApplication.myWin.open(true)" waitTarget="" waitEvent="myWindowComplete" />  
+		<AssertMethodValue method="value=FlexGlobals.topLevelApplication.myWin.contentGroup.getChildByName('addElementTest')!=null" value="true" />
+		<WaitForEvent target="stage" eventName="enterFrame" numExpectedEvents="2"/>
+		<RunCode code="FlexGlobals.topLevelApplication.closeAllChildWindow()"/>
+	    </body>
+        </TestCase>
+
+
+        <TestCase testID="addElement_beforeWindowOpen_test2" keywords="[Window,methods,addElement]" 
+        description="add a textinput to an non opened Window">
+
+	    <setup> 
+		<RunCode code="FlexGlobals.topLevelApplication.closeAllChildWindow()" />   
+		<RunCode code="FlexGlobals.topLevelApplication.myWin=FlexGlobals.topLevelApplication.createANoOpenWindowByClass(MyWindowWithContents,'test1')"/>
+	    </setup>
+
+	    <body>
+		<RunCode code="addTextInput()"/>
+		<RunCode code="FlexGlobals.topLevelApplication.myWin.open(true)" waitTarget="" waitEvent="myWindowComplete" />  
+		<AssertMethodValue method="value=FlexGlobals.topLevelApplication.myWin.contentGroup.getChildByName('textInput11')!=null" value="true" />
+		<WaitForEvent target="stage" eventName="enterFrame" numExpectedEvents="2"/>
+		<RunCode code="FlexGlobals.topLevelApplication.closeAllChildWindow()"/>
+	    </body>
+        </TestCase>
+      
+        <TestCase testID="addElement_beforeWindowOpen_test3" keywords="[Window,methods,addElement]" 
+        description="add a textArea to an non opened Window">
+
+	    <setup> 
+		<RunCode code="FlexGlobals.topLevelApplication.closeAllChildWindow()"/>   
+		<RunCode code="FlexGlobals.topLevelApplication.myWin=FlexGlobals.topLevelApplication.createANoOpenWindowByClass(MyWindowWithContents,'test1')"/>
+	    </setup>
+
+	    <body>
+		<RunCode code="addTextArea()"/>
+		<RunCode code="FlexGlobals.topLevelApplication.myWin.open(true)" waitTarget="" waitEvent="myWindowComplete" />  
+		<AssertMethodValue method="value=FlexGlobals.topLevelApplication.myWin.contentGroup.getChildByName('textArea11')!=null" value="true" />
+		<WaitForEvent target="stage" eventName="enterFrame" numExpectedEvents="2"/>
+		<RunCode code="FlexGlobals.topLevelApplication.closeAllChildWindow()"/>
+	    </body>
+        </TestCase>
+        
+ 
+         <TestCase testID="addElement_beforeWindowOpen_test4" keywords="[Window,methods,addElement]" 
+         description="add a datagrid to an non opened Window">
+ 
+ 	    <setup> 
+ 		<RunCode code="FlexGlobals.topLevelApplication.closeAllChildWindow()"  />   
+ 		<RunCode code="FlexGlobals.topLevelApplication.myWin=FlexGlobals.topLevelApplication.createANoOpenWindowByClass(MyWindowWithContents,'test1')"/>
+ 	    </setup>
+ 
+ 	    <body>
+ 		<RunCode code="addDatagrid()"/>
+ 		<RunCode code="FlexGlobals.topLevelApplication.myWin.open(true)" waitTarget="" waitEvent="myWindowComplete" />  
+ 		<AssertMethodValue method="value=FlexGlobals.topLevelApplication.myWin.contentGroup.getChildByName('dataGrid11')!=null" value="true" />
+ 		<WaitForEvent target="stage" eventName="enterFrame" numExpectedEvents="2"/>
+ 		<RunCode code="FlexGlobals.topLevelApplication.closeAllChildWindow()"/>
+ 	    </body>
+        </TestCase>
+ 
+          <TestCase testID="addElement_beforeWindowOpen_test5" keywords="[Window,methods,addElement]" 
+          description="add a checkbox to an non opened Window">
+  
+  	    <setup> 
+  		<RunCode code="FlexGlobals.topLevelApplication.closeAllChildWindow()" />   
+  		<RunCode code="FlexGlobals.topLevelApplication.myWin=FlexGlobals.topLevelApplication.createANoOpenWindowByClass(MyWindowWithContents,'test1')"/>
+  	    </setup>
+  
+  	    <body>
+  		<RunCode code="addCheckBox()"/>
+  		<RunCode code="FlexGlobals.topLevelApplication.myWin.open(true)" waitTarget="" waitEvent="myWindowComplete" />  
+  		<AssertMethodValue method="value=FlexGlobals.topLevelApplication.myWin.contentGroup.getChildByName('checkBox11')!=null" value="true" />
+ 		
+  		<WaitForEvent target="stage" eventName="enterFrame" numExpectedEvents="2"/>
+  		<RunCode code="FlexGlobals.topLevelApplication.closeAllChildWindow()"/>
+  	    </body>
+        </TestCase>
+        
+  
+        <TestCase testID="addElement_beforeWindowOpen_test6" keywords="[Window,methods,addElement]" 
+        description="add a button to an non opened, plain Window">
+
+	    <setup> 
+		<RunCode code="FlexGlobals.topLevelApplication.closeAllChildWindow()"/>   
+		<RunCode code="addButtonForPlainWindow()"/>
+	    </setup>
+
+	    <body>
+		<RunCode code="windowObj.open(true)"/>  
+		<WaitForEvent target="stage" eventName="enterFrame" numExpectedEvents="2"/>
+		<AssertMethodValue method="value=windowObj.contentGroup.getChildByName('childButton2')!=null" value="true" />
+		<WaitForEvent target="stage" eventName="enterFrame" numExpectedEvents="2"/>
+		<RunCode code="windowObj.close()"/>
+	    </body>
+        </TestCase>
+
+  
+        <TestCase testID="addElement_beforeWindowOpen_test7" keywords="[Window,methods,addElement]" 
+        description="add a textInput to an non opened, plain Window">
+
+	    <setup> 
+		<RunCode code="FlexGlobals.topLevelApplication.closeAllChildWindow()"/>   
+		<RunCode code="addTextInputForPlainWindow()"/>
+	    </setup>
+
+	    <body>
+		<RunCode code="windowObj.open(true)"/>  
+		<WaitForEvent target="stage" eventName="enterFrame" numExpectedEvents="2"/>
+		<AssertMethodValue method="value=windowObj.contentGroup.getChildByName('textInput2')!=null" value="true" />
+		<WaitForEvent target="stage" eventName="enterFrame" numExpectedEvents="2"/>
+		<RunCode code="windowObj.close()"/>
+	    </body>
+        </TestCase>
+        
+        
+	
+	    <!--
+	========================================================
+	Test method removeElement before window.open
+	========================================================
+	-->
+
+          <TestCase testID="removeElement_beforeWindowOpen_test1" keywords="[Window,methods,removeElement]" 
+          description="remove a checkbox from an non opened Window">
+  
+  	    <setup> 
+  		<RunCode code="FlexGlobals.topLevelApplication.closeAllChildWindow()"  />   
+  		<RunCode code="FlexGlobals.topLevelApplication.myWin=FlexGlobals.topLevelApplication.createANoOpenWindowByClass(MyWindowWithContents,'test1')"/>
+  	    </setup>
+  
+  	    <body>
+  		<RunCode code="removeCheckBox()"/>
+  		<RunCode code="FlexGlobals.topLevelApplication.myWin.open(true)" waitTarget="" waitEvent="myWindowComplete" />  
+  		<AssertMethodValue method="value=FlexGlobals.topLevelApplication.myWin.contentGroup.getChildByName('checkBox1')==null" value="true" />
+ 		
+  		<WaitForEvent target="stage" eventName="enterFrame" numExpectedEvents="2"/>
+  		<RunCode code="FlexGlobals.topLevelApplication.closeAllChildWindow()"/>
+  	    </body>
+        </TestCase>
+
+          <TestCase testID="removeElement_beforeWindowOpen_test2" keywords="[Window,methods,removeElement]" 
+          description="remove a Button from an non opened Window">
+  
+  	    <setup> 
+  		<RunCode code="FlexGlobals.topLevelApplication.closeAllChildWindow()" />   
+  		<RunCode code="FlexGlobals.topLevelApplication.myWin=FlexGlobals.topLevelApplication.createANoOpenWindowByClass(MyWindowWithContents,'test1')"/>
+  	    </setup>
+  
+  	    <body>
+  		<RunCode code="removeButton()"/>
+  		<RunCode code="FlexGlobals.topLevelApplication.myWin.open(true)" waitTarget="" waitEvent="myWindowComplete" />  
+  		<AssertMethodValue method="value=FlexGlobals.topLevelApplication.myWin.contentGroup.getChildByName('childButton')==null" value="true" />
+ 		
+  		<WaitForEvent target="stage" eventName="enterFrame" numExpectedEvents="2"/>
+  		<RunCode code="FlexGlobals.topLevelApplication.closeAllChildWindow()"/>
+  	    </body>
+        </TestCase>
+        
+          <TestCase testID="removeElement_beforeWindowOpen_test3" keywords="[Window,methods,removeElement]" 
+          description="remove a Label from an non opened Window">
+  
+  	    <setup> 
+  		<RunCode code="FlexGlobals.topLevelApplication.closeAllChildWindow()"/>   
+  		<RunCode code="FlexGlobals.topLevelApplication.myWin=FlexGlobals.topLevelApplication.createANoOpenWindowByClass(MyWindowWithContents,'test1')"/>
+  	    </setup>
+  
+  	    <body>
+  		<RunCode code="removeLabel()"/>
+  		<RunCode code="FlexGlobals.topLevelApplication.myWin.open(true)" waitTarget="" waitEvent="myWindowComplete" />  
+  		<AssertMethodValue method="value=FlexGlobals.topLevelApplication.myWin.contentGroup.getChildByName('childLabel')==null" value="true" />
+ 		
+  		<WaitForEvent target="stage" eventName="enterFrame" numExpectedEvents="2"/>
+  		<RunCode code="FlexGlobals.topLevelApplication.closeAllChildWindow()"/>
+  	    </body>
+        </TestCase>
+        
+          <TestCase testID="removeElement_beforeWindowOpen_test4" keywords="[Window,methods,removeElement]" 
+          description="remove a datagrid from an non opened Window">
+  
+  	    <setup> 
+  		<RunCode code="FlexGlobals.topLevelApplication.closeAllChildWindow()"/>   
+  		<RunCode code="FlexGlobals.topLevelApplication.myWin=FlexGlobals.topLevelApplication.createANoOpenWindowByClass(MyWindowWithContents,'test1')"/>
+  	    </setup>
+  
+  	    <body>
+  		<RunCode code="removeDataGrid()"/>
+  		<RunCode code="FlexGlobals.topLevelApplication.myWin.open(true)" waitTarget="" waitEvent="myWindowComplete" />  
+  		<AssertMethodValue method="value=FlexGlobals.topLevelApplication.myWin.contentGroup.getChildByName('datagrid1')==null" value="true" />
+ 		
+  		<WaitForEvent target="stage" eventName="enterFrame" numExpectedEvents="2"/>
+  		<RunCode code="FlexGlobals.topLevelApplication.closeAllChildWindow()"/>
+  	    </body>
+        </TestCase>
+	<!--
+	========================================================
+	Test method removeAllElements
+	========================================================
+	-->
+          <TestCase testID="removeElement_beforeWindowOpen_test5" keywords="[Window,methods,removeElement]" 
+          description="remove a datagrid from an non opened Window">
+  
+  	    <setup> 
+  		<RunCode code="FlexGlobals.topLevelApplication.closeAllChildWindow()"  />   
+  		<RunCode code="FlexGlobals.topLevelApplication.myWin=FlexGlobals.topLevelApplication.createANoOpenWindowByClass(MyWindowWithContents,'test1')"/>
+  	    </setup>
+  
+  	    <body>
+  		<RunCode code="removeAllElements()"/>
+  		<RunCode code="FlexGlobals.topLevelApplication.myWin.open(true)" waitTarget="" waitEvent="myWindowComplete" />  
+  		<AssertMethodValue method="value=FlexGlobals.topLevelApplication.myWin.contentGroup.numElements" value="0"/>
+ 		
+  		<WaitForEvent target="stage" eventName="enterFrame" numExpectedEvents="2"/>
+  		<RunCode code="FlexGlobals.topLevelApplication.closeAllChildWindow()"/>
+  	    </body>
+        </TestCase>
+        
+
+</testCases>
+
+</UnitTester>

Added: incubator/flex/trunk/mustella/tests/apollo/spark/components/Window/methods/window_methods_elementRelated.mxml
URL: http://svn.apache.org/viewvc/incubator/flex/trunk/mustella/tests/apollo/spark/components/Window/methods/window_methods_elementRelated.mxml?rev=1370009&view=auto
==============================================================================
--- incubator/flex/trunk/mustella/tests/apollo/spark/components/Window/methods/window_methods_elementRelated.mxml (added)
+++ incubator/flex/trunk/mustella/tests/apollo/spark/components/Window/methods/window_methods_elementRelated.mxml Mon Aug  6 20:51:08 2012
@@ -0,0 +1,930 @@
+<?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="apollo/spark/components/Window/methods/"  xmlns:mx="http://www.adobe.com/2006/mxml" xmlns="*" testSWF="window_basic_003.mxml">
+
+
+
+	
+
+<!-- this set of lines form a template that must be in each unit test -->
+
+	
+
+    <mx:Script>
+
+	<![CDATA[
+
+	public static function init(o:DisplayObject):void
+
+	{
+
+	}
+
+	]]>
+
+    </mx:Script>
+
+    <mx:Metadata>
+
+	<![CDATA[
+
+		[Mixin]
+
+	]]>
+
+    </mx:Metadata>
+
+	<!-- end of set of lines that must be in each unit test -->
+
+
+
+    <mx:Script>
+
+	<![CDATA[
+
+	 import mx.core.FlexGlobals;
+
+	 private  var dispObj:DisplayObject;
+
+	]]>
+
+    </mx:Script>
+
+
+
+	
+
+    <testCases>
+
+
+
+	<!--
+
+	========================================================
+
+	Test method addElement
+
+	========================================================
+
+	-->
+
+
+
+        <TestCase testID="method_addElement_test1" keywords="[Window,methods,addElement]" 
+
+        description="add an element to a Window">
+
+
+
+	    <setup> 
+
+		<RunCode code="FlexGlobals.topLevelApplication.resetWindow()" waitTarget="" waitEvent="myWindowComplete" />   
+
+	    </setup>
+
+
+
+	    <body>
+
+	    	<WaitForEvent target="stage" eventName="enterFrame" numExpectedEvents="2"/><!-- add timeout in case window isn't ready -->
+
+		<RunCode code="FlexGlobals.topLevelApplication.testAddElement()"/>
+
+		<WaitForEvent numExpectedEvents="-1" eventName="updateComplete" target="myWin" timeout="2000" /> 
+
+		<MyCompareBitmap target="myWin"  numColorVariances="15" maxColorVariance="20" url="../methods/baselines/$testID.png" mac_url="../methods/baselines/$testID_mac.png"  />
+
+
+
+		<!-- use pause in case if the close window happened so quickly, set myWin=null
+
+		this will give enough time for image comparision 
+
+		Rest Pause API has same purpose
+
+		-->
+
+		<WaitForEvent target="stage" eventName="enterFrame" numExpectedEvents="5"/>
+
+		<RunCode code="FlexGlobals.topLevelApplication.closeAllChildWindow()"/>
+
+	    </body>
+
+        </TestCase>
+
+
+
+	<!--
+
+	========================================================
+
+	Test method addElementAt
+
+	========================================================
+
+	-->
+
+
+
+
+
+    	<TestCase testID="method_addElementAt_test1" keywords="[Window,methods,addElementAt]" 
+
+    	description="add an element at a valid index=0 for a Window">
+
+	    <setup> 
+
+		<RunCode code="FlexGlobals.topLevelApplication.resetWindow()" waitTarget="" waitEvent="myWindowComplete" />   
+
+	    </setup>
+
+	    <body>
+
+	   	<WaitForEvent target="stage" eventName="enterFrame" numExpectedEvents="2"/><!-- make sure window has time to be ready -->
+
+		<AssertMethodValue method="value=FlexGlobals.topLevelApplication.testAddElementAt(0)" value="true" />
+
+		<!-- make sure the window has time to update added Element-->
+
+		<SetProperty target="myWin" propertyName="width" value="400"  waitTarget="myWin" waitEvent="updateComplete"/>
+
+		<WaitForEvent numExpectedEvents="-1" eventName="updateComplete" target="myWin" timeout="2000" /> 
+
+		<MyCompareBitmap target="myWin"  numColorVariances="10" maxColorVariance="10" url="../methods/baselines/$testID.png" mac_url="../methods/baselines/$testID_mac.png"  />
+
+		<WaitForEvent target="stage" eventName="enterFrame" numExpectedEvents="2"/>
+
+		<RunCode code="FlexGlobals.topLevelApplication.closeAllChildWindow()"/>
+
+	    </body>
+
+	</TestCase>
+
+
+
+
+
+	<TestCase testID="method_addElementAt_test2" keywords="[Window,methods,addElementAt]" 
+
+	description="add an element at a valid index=2 for a Window">
+
+	    <setup> 
+
+		<RunCode code="FlexGlobals.topLevelApplication.resetWindow()" waitTarget="" waitEvent="myWindowComplete" />   
+
+	    </setup>
+
+	    <body>
+
+	    	<WaitForEvent target="stage" eventName="enterFrame" numExpectedEvents="2"/><!-- add timeout in case window isn't ready -->
+
+		<AssertMethodValue method="value=FlexGlobals.topLevelApplication.testAddElementAt(2)" value="true" />
+
+		<!-- make sure the window has time to update added Element-->
+
+		<SetProperty target="myWin" propertyName="width" value="400"  waitTarget="myWin" waitEvent="updateComplete"/>
+
+		<WaitForEvent target="stage" eventName="enterFrame" numExpectedEvents="2"/>
+
+		<MyCompareBitmap target="myWin"  numColorVariances="10" maxColorVariance="10" url="../methods/baselines/$testID.png" mac_url="../methods/baselines/$testID_mac.png"  />
+
+		<WaitForEvent target="stage" eventName="enterFrame" numExpectedEvents="2"/>
+
+		<RunCode code="FlexGlobals.topLevelApplication.closeAllChildWindow()"/>
+
+	    </body>
+
+	</TestCase>
+
+
+
+
+
+	<TestCase testID="method_addElementAt_test3" keywords="[Window,methods,addElementAt,negative]" 
+
+	description="add an element at invalid index=-1 for a Window">
+
+
+
+	    <setup> 
+
+		<RunCode code="FlexGlobals.topLevelApplication.resetWindow()" waitTarget="" waitEvent="myWindowComplete" />   
+
+	    </setup>
+
+
+
+	    <body>
+
+	    	<WaitForEvent target="stage" eventName="enterFrame" numExpectedEvents="2"/><!-- add timeout in case window isn't ready -->
+
+		<AssertMethodValue method="value=FlexGlobals.topLevelApplication.testAddElementAtNegative(-1)" value="true" />
+
+		<!-- make sure the window has time to update added Element-->
+
+		<SetProperty target="myWin" propertyName="width" value="400"  waitTarget="myWin" waitEvent="updateComplete"/>
+
+		<WaitForEvent target="stage" eventName="enterFrame" numExpectedEvents="2"/>
+
+		<MyCompareBitmap target="myWin"  numColorVariances="10" maxColorVariance="10" url="../methods/baselines/$testID.png" mac_url="../methods/baselines/$testID_mac.png"  />
+
+		<WaitForEvent target="stage" eventName="enterFrame" numExpectedEvents="2"/>
+
+		<RunCode code="FlexGlobals.topLevelApplication.closeAllChildWindow()"/>
+
+	    </body>
+
+	</TestCase>
+
+
+
+
+
+	<TestCase testID="method_addElementAt_test4" keywords="[Window,methods,addElementAt,negative]" 
+
+	description="add an element at invalid index=9 for a Window">
+
+
+
+	    <setup> 
+
+		<RunCode code="FlexGlobals.topLevelApplication.resetWindow()" waitTarget="" waitEvent="myWindowComplete" />   
+
+	    </setup>
+
+	    <body>
+
+	    	<WaitForEvent target="stage" eventName="enterFrame" numExpectedEvents="2"/><!-- add timeout in case window isn't ready -->
+
+		<AssertMethodValue method="value=FlexGlobals.topLevelApplication.testAddElementAtNegative(9)" value="true" />
+
+		<!-- make sure the window has time to update added Element-->
+
+		<SetProperty target="myWin" propertyName="width" value="400"  waitTarget="myWin" waitEvent="updateComplete"/>
+
+		<WaitForEvent target="stage" eventName="enterFrame" numExpectedEvents="2"/>
+
+		<MyCompareBitmap target="myWin"  numColorVariances="10" maxColorVariance="10" url="../methods/baselines/$testID.png" mac_url="../methods/baselines/$testID_mac.png"  />
+
+		<WaitForEvent target="stage" eventName="enterFrame" numExpectedEvents="2"/>
+
+		<RunCode code="FlexGlobals.topLevelApplication.closeAllChildWindow()"/>
+
+	    </body>
+
+	</TestCase>
+
+
+
+	<!--
+
+	========================================================
+
+	Test method getElementAt
+
+	========================================================
+
+	-->
+
+
+
+	<TestCase testID="method_getElementAt_test1" keywords="[Window,methods,getElementAt]" 
+
+	description="get an element at a valid index=0 for a Window">
+
+	    <setup> 
+
+		<RunCode code="FlexGlobals.topLevelApplication.resetWindow()" waitTarget="" waitEvent="myWindowComplete" />   
+
+	    </setup>
+
+	    <body>
+
+	    	<WaitForEvent target="stage" eventName="enterFrame" numExpectedEvents="2"/><!-- add timeout in case window isn't ready -->
+
+		<AssertMethodValue method="value=FlexGlobals.topLevelApplication.testGetElementAt(0)" value="true" />
+
+		<RunCode code="FlexGlobals.topLevelApplication.closeAllChildWindow()"/>
+
+	    </body>
+
+	</TestCase>
+
+
+
+
+
+
+
+	<TestCase testID="method_getElementAt_test2" keywords="[Window,methods,getElementAt]" 
+
+	description="get an element at a valid index=2 for a Window">
+
+
+
+	    <setup> 
+
+		<RunCode code="FlexGlobals.topLevelApplication.resetWindow()" waitTarget="" waitEvent="myWindowComplete" />   
+
+	    </setup>
+
+	    <body>
+
+	    	<WaitForEvent target="stage" eventName="enterFrame" numExpectedEvents="2"/><!-- add timeout in case window isn't ready -->
+
+		<AssertMethodValue method="value=FlexGlobals.topLevelApplication.testGetElementAt(2)" value="true" />
+
+		<RunCode code="FlexGlobals.topLevelApplication.closeAllChildWindow()"/>
+
+	    </body>
+
+	</TestCase>
+
+
+
+
+
+	<TestCase testID="method_getElementAt_test3" keywords="[Window,methods,getElementAt]" 
+
+	description="get first element of a Window">
+
+
+
+	    <setup> 
+
+		<RunCode code="FlexGlobals.topLevelApplication.resetWindow()" waitTarget="" waitEvent="myWindowComplete" />   
+
+	    </setup>
+
+	    <body>
+
+	        <WaitForEvent target="stage" eventName="enterFrame" numExpectedEvents="2"/><!-- add timeout in case window isn't ready -->
+
+		<AssertMethodValue method="value=FlexGlobals.topLevelApplication.testGetFirstButton()" value="true" />
+
+		<RunCode code="FlexGlobals.topLevelApplication.closeAllChildWindow()"/>
+
+	    </body>
+
+	</TestCase>
+
+
+
+
+
+
+
+
+
+	<TestCase testID="method_getElementAt_test4" keywords="[Window,methods,getElementAt,negative]" 
+
+	description="get an element at invalid index=-1 for a Window">
+
+
+
+	    <setup> 
+
+		<RunCode code="FlexGlobals.topLevelApplication.resetWindow()" waitTarget="" waitEvent="myWindowComplete" />   
+
+	    </setup>
+
+	    <body>
+
+	        <WaitForEvent target="stage" eventName="enterFrame" numExpectedEvents="2"/><!-- add timeout in case window isn't ready -->
+
+		<AssertMethodValue method="value=FlexGlobals.topLevelApplication.testGetElementAtNegative(-1)" value="true" />
+
+		<RunCode code="FlexGlobals.topLevelApplication.closeAllChildWindow()"/>
+
+	    </body>
+
+	</TestCase>
+
+
+
+	<TestCase testID="method_getElementAt_test5" keywords="[Window,methods,getElementAt,negative]" 
+
+	description="get an element at invalid index=10 for a Window">
+
+
+
+	    <setup> 
+
+		<RunCode code="FlexGlobals.topLevelApplication.resetWindow()" waitTarget="" waitEvent="myWindowComplete" />   
+
+	    </setup>
+
+	    <body>
+
+	    	<WaitForEvent target="stage" eventName="enterFrame" numExpectedEvents="2"/><!-- add timeout in case window isn't ready -->
+
+		<AssertMethodValue method="value=FlexGlobals.topLevelApplication.testGetElementAtNegative(10)" value="true" />
+
+		<RunCode code="FlexGlobals.topLevelApplication.closeAllChildWindow()"/>
+
+	    </body>
+
+	</TestCase>
+
+
+
+	<!--
+
+	========================================================
+
+	Test method getElementIndex
+
+	========================================================
+
+	-->
+
+
+
+	<TestCase testID="method_getElementIndex_test1" keywords="[Window,methods,getElementIndex]" 
+
+	description="get an element by index for a Window">
+
+	    <setup> 
+
+		<RunCode code="FlexGlobals.topLevelApplication.resetWindow()" waitTarget="" waitEvent="myWindowComplete" />   
+
+	    </setup>
+
+	    <body>
+
+	   	<WaitForEvent target="stage" eventName="enterFrame" numExpectedEvents="2"/><!-- add timeout in case window isn't ready -->
+
+		<AssertMethodValue method="value=FlexGlobals.topLevelApplication.testGetElementAt(0)" value="true" />
+
+		<RunCode code="FlexGlobals.topLevelApplication.closeAllChildWindow()"/>
+
+	    </body>
+
+	</TestCase>
+
+
+
+	<TestCase testID="method_getElementIndex_test2" keywords="[Window,methods,getElementIndex]" 
+
+	description="get an element by index for a Window">
+
+
+
+	    <setup> 
+
+		<RunCode code="FlexGlobals.topLevelApplication.resetWindow()" waitTarget="" waitEvent="myWindowComplete" />   
+
+	    </setup>
+
+	    <body>
+
+	    	<WaitForEvent target="stage" eventName="enterFrame" numExpectedEvents="2"/><!-- add timeout in case window isn't ready -->
+
+		<AssertMethodValue method="value=FlexGlobals.topLevelApplication.testGetElementAt(2)" value="true" />
+
+		<RunCode code="FlexGlobals.topLevelApplication.closeAllChildWindow()"/>
+
+	    </body>
+
+	</TestCase>
+
+
+
+	<TestCase testID="method_getElementIndex_test3" keywords="[Window,methods,getElementIndex,negative ]" 
+
+	description="get an element by invalid index for a Window">
+
+
+
+	    <setup> 
+
+		<RunCode code="FlexGlobals.topLevelApplication.resetWindow()" waitTarget="" waitEvent="myWindowComplete" />   
+
+	    </setup>
+
+	    <body>
+	    <WaitForEvent target="stage" eventName="enterFrame" numExpectedEvents="2"/><!-- add timeout in case window isn't ready -->
+
+		<AssertMethodValue method="value=FlexGlobals.topLevelApplication.testGetElementIndexNegative()" value="true" />
+
+		<RunCode code="FlexGlobals.topLevelApplication.closeAllChildWindow()"/>
+
+	    </body>
+
+	</TestCase>
+
+
+
+	    <!--
+
+	========================================================
+
+	Test method removeElement
+
+	========================================================
+
+	-->
+
+
+
+	<TestCase testID="method_removeElement_test1" keywords="[Window,methods,removeElement]" 
+
+	description="remove an element from window">
+
+
+
+	    <setup> 
+
+		<RunCode code="FlexGlobals.topLevelApplication.resetWindow()" waitTarget="" waitEvent="myWindowComplete" />   
+
+	    </setup>
+
+	    <body>
+
+	    	<WaitForEvent target="stage" eventName="enterFrame" numExpectedEvents="2"/><!-- add timeout in case window isn't ready -->
+
+		<AssertMethodValue method="value=FlexGlobals.topLevelApplication.testRemoveElement()" value="true" />
+
+		<!-- make sure the window has time to update added Element-->
+
+		<SetProperty target="myWin" propertyName="width" value="400"  waitTarget="myWin" waitEvent="updateComplete"/>
+
+		<WaitForEvent target="stage" eventName="enterFrame" numExpectedEvents="2"/>
+
+		<!-- verify the element should be removed, image comparision -->
+
+		<MyCompareBitmap target="myWin"  numColorVariances="10" maxColorVariance="10" url="../methods/baselines/$testID.png" mac_url="../methods/baselines/$testID_mac.png"  />
+
+		<WaitForEvent target="stage" eventName="enterFrame" numExpectedEvents="2"/>
+
+		<RunCode code="FlexGlobals.topLevelApplication.closeAllChildWindow()"/>
+
+	    </body>
+
+	</TestCase>
+
+
+
+
+
+	<TestCase testID="method_removeElement_test2" keywords="[Window,methods,removeElement]" 
+
+	description="remove all elements from  a Window even the one added">
+
+	    <setup> 
+
+		<RunCode code="FlexGlobals.topLevelApplication.resetWindow()" waitTarget="" waitEvent="myWindowComplete" />   
+
+	    </setup>
+
+	    <body>
+
+	    	<WaitForEvent target="stage" eventName="enterFrame" numExpectedEvents="2"/><!-- add timeout in case window isn't ready -->
+
+		<AssertMethodValue method="value=FlexGlobals.topLevelApplication.testRemoveElement2()" value="true" />
+
+		<!-- make sure the window has time to update added Element-->
+
+		<SetProperty target="myWin" propertyName="width" value="400"  waitTarget="myWin" waitEvent="updateComplete"/>
+
+		<WaitForEvent target="stage" eventName="enterFrame" numExpectedEvents="2"/>
+
+		<!-- verify all elements should be removed, image comparision -->
+
+		<MyCompareBitmap target="myWin"  numColorVariances="10" maxColorVariance="10" url="../methods/baselines/$testID.png" mac_url="../methods/baselines/$testID_mac.png"  />
+
+		<WaitForEvent target="stage" eventName="enterFrame" numExpectedEvents="2"/>
+
+		<RunCode code="FlexGlobals.topLevelApplication.closeAllChildWindow()"/>
+
+	    </body>
+
+	</TestCase>
+
+
+
+
+
+	<TestCase testID="method_removeElement_test3" keywords="[Window,methods,removeElement,negative]" 
+
+	description="remove the same elements twice from  a Window">
+
+
+
+	    <setup> 
+
+		<RunCode code="FlexGlobals.topLevelApplication.resetWindow()" waitTarget="" waitEvent="myWindowComplete" />   
+
+	    </setup>
+
+	    <body>
+
+	    	<WaitForEvent target="stage" eventName="enterFrame" numExpectedEvents="2"/><!-- add timeout in case window isn't ready -->
+
+		<AssertMethodValue method="value=FlexGlobals.topLevelApplication.testRemoveElementNegative()" value="true" />
+
+		<!-- make sure the window has time to update added Element-->
+
+		<SetProperty target="myWin" propertyName="width" value="400"  waitTarget="myWin" waitEvent="updateComplete"/>
+
+		<WaitForEvent target="stage" eventName="enterFrame" numExpectedEvents="2"/>
+
+		<!-- verify all elements should be removed, image comparision -->
+
+		<MyCompareBitmap target="myWin"  numColorVariances="10" maxColorVariance="10" url="../methods/baselines/$testID.png" mac_url="../methods/baselines/$testID_mac.png"  />
+
+		<WaitForEvent target="stage" eventName="enterFrame" numExpectedEvents="2"/>
+
+		<RunCode code="FlexGlobals.topLevelApplication.closeAllChildWindow()"/>
+
+	    </body>
+
+	</TestCase>
+
+
+
+
+
+
+
+	<TestCase testID="method_removeElement_test4" keywords="[Window,methods,removeElement,negative]" 
+
+	description="remove  an element not own from a Window">
+
+
+
+	    <setup> 
+
+		<RunCode code="FlexGlobals.topLevelApplication.resetWindow()" waitTarget="" waitEvent="myWindowComplete" />   
+
+	    </setup>
+
+	    <body>
+
+	    	<WaitForEvent target="stage" eventName="enterFrame" numExpectedEvents="2"/><!-- add timeout in case window isn't ready -->
+
+		<AssertMethodValue method="value=FlexGlobals.topLevelApplication.testRemoveElementNegative2()" value="true" />
+
+		<!-- make sure the window has time to update added Element-->
+
+		<SetProperty target="myWin" propertyName="width" value="400"  waitTarget="myWin" waitEvent="updateComplete"/>
+
+		<WaitForEvent target="stage" eventName="enterFrame" numExpectedEvents="2"/>
+
+		<!-- image comparision -->
+
+		<MyCompareBitmap target="myWin"  numColorVariances="10" maxColorVariance="10" url="../methods/baselines/$testID.png" mac_url="../methods/baselines/$testID_mac.png"  />
+
+		<WaitForEvent target="stage" eventName="enterFrame" numExpectedEvents="2"/>
+
+		<RunCode code="FlexGlobals.topLevelApplication.closeAllChildWindow()"/>
+
+	    </body>
+
+	</TestCase>
+
+
+
+
+
+	<!--
+
+	========================================================
+
+	Test method removeElementAt
+
+	========================================================
+
+	-->
+
+
+
+	<TestCase testID="method_removeElementAt_test1" keywords="[Window,methods,removeElementAt]" 
+
+	description="remove a dropdown list from window">
+
+
+
+	    <setup> 
+
+		<RunCode code="FlexGlobals.topLevelApplication.resetWindow()" waitTarget="" waitEvent="myWindowComplete" />   
+
+	    </setup>
+
+	    <body>
+
+	    	<WaitForEvent target="stage" eventName="enterFrame" numExpectedEvents="2"/><!-- add timeout in case window isn't ready -->
+
+		<AssertMethodValue method="value=FlexGlobals.topLevelApplication.testRemoveElementAt()" value="true" />
+
+		<!-- make sure the window has time to update added Element-->
+
+		<SetProperty target="myWin" propertyName="width" value="400"  waitTarget="myWin" waitEvent="updateComplete"/>
+
+		<WaitForEvent target="stage" eventName="enterFrame" numExpectedEvents="2"/>
+
+		<!-- verify the element should be removed, image comparision -->
+
+		<MyCompareBitmap target="myWin"  numColorVariances="10" maxColorVariance="10" url="../methods/baselines/$testID.png" mac_url="../methods/baselines/$testID_mac.png"  />
+
+		<WaitForEvent target="stage" eventName="enterFrame" numExpectedEvents="2"/>
+
+		<RunCode code="FlexGlobals.topLevelApplication.closeAllChildWindow()"/>
+
+	    </body>
+
+	</TestCase>
+
+
+
+	<TestCase testID="method_removeElementAt_test2" keywords="[Window,methods,removeElementAt]" 
+
+	description="remove all elements from window">
+
+
+
+	    <setup> 
+
+		<RunCode code="FlexGlobals.topLevelApplication.resetWindow()" waitTarget="" waitEvent="myWindowComplete" />   
+
+	    </setup>
+
+	    <body>
+
+	    	<WaitForEvent target="stage" eventName="enterFrame" numExpectedEvents="2"/><!-- add timeout in case window isn't ready -->
+
+		<AssertMethodValue method="value=FlexGlobals.topLevelApplication.testRemoveElementAt2()" value="true" />
+
+		<!-- make sure the window has time to update added Element-->
+
+		<SetProperty target="myWin" propertyName="width" value="400"  waitTarget="myWin" waitEvent="updateComplete"/>
+
+		<WaitForEvent target="stage" eventName="enterFrame" numExpectedEvents="2"/>
+
+		<!-- verify the element should be removed, image comparision -->
+
+		<MyCompareBitmap target="myWin"  numColorVariances="10" maxColorVariance="10" url="../methods/baselines/$testID.png" mac_url="../methods/baselines/$testID_mac.png"  />
+
+		<WaitForEvent target="stage" eventName="enterFrame" numExpectedEvents="2"/>
+
+		<RunCode code="FlexGlobals.topLevelApplication.closeAllChildWindow()"/>
+
+	    </body>
+
+	</TestCase>
+
+
+
+
+
+
+
+
+
+	<TestCase testID="method_removeElementAt_test3" keywords="[Window,methods,removeElementAt,negativ]" 
+
+	description="remove an invalid indexed element from a window ">
+
+
+
+	    <setup> 
+
+		<RunCode code="FlexGlobals.topLevelApplication.resetWindow()" waitTarget="" waitEvent="myWindowComplete" />   
+
+	    </setup>
+
+	    <body>
+
+	    	<WaitForEvent target="stage" eventName="enterFrame" numExpectedEvents="2"/><!-- add timeout in case window isn't ready -->
+
+		<AssertMethodValue method="value=FlexGlobals.topLevelApplication.testRemoveElementAtNegative(-1)" value="true" />
+
+		<WaitForEvent target="stage" eventName="enterFrame" numExpectedEvents="2"/>
+
+		<!-- verify the element should be removed, image comparision -->
+
+		<MyCompareBitmap target="myWin"  numColorVariances="10" maxColorVariance="10" url="../methods/baselines/$testID.png" mac_url="../methods/baselines/$testID_mac.png"  />
+
+		<WaitForEvent target="stage" eventName="enterFrame" numExpectedEvents="2"/>
+
+		<RunCode code="FlexGlobals.topLevelApplication.closeAllChildWindow()"/>
+
+	    </body>
+
+	</TestCase>
+
+
+
+
+
+	<TestCase testID="method_removeElementAt_test4" keywords="[Window,methods,removeElementAt,negativ]" 
+
+	description="remove an invalid indexed element from a window ">
+
+
+
+	    <setup> 
+
+		<RunCode code="FlexGlobals.topLevelApplication.resetWindow()" waitTarget="" waitEvent="myWindowComplete" />   
+
+	    </setup>
+
+	    <body>
+
+	    	<WaitForEvent target="stage" eventName="enterFrame" numExpectedEvents="2"/><!-- add timeout in case window isn't ready -->
+
+		<AssertMethodValue method="value=FlexGlobals.topLevelApplication.testRemoveElementAtNegative(-9)" value="true" />
+
+		<WaitForEvent target="stage" eventName="enterFrame" numExpectedEvents="2"/>
+
+		<!-- verify the element should be removed, image comparision -->
+
+		<MyCompareBitmap target="myWin"  numColorVariances="10" maxColorVariance="10" url="../methods/baselines/$testID.png" mac_url="../methods/baselines/$testID_mac.png"  />
+
+		<WaitForEvent target="stage" eventName="enterFrame" numExpectedEvents="2"/>
+
+		<RunCode code="FlexGlobals.topLevelApplication.closeAllChildWindow()"/>
+
+	    </body>
+
+	</TestCase>
+
+
+
+
+
+	<!--
+
+	========================================================
+
+	Test method removeAllElements
+
+	========================================================
+
+	-->
+
+
+
+	<TestCase testID="method_removeAllElements_test1" keywords="[Window,methods,removeAllElements]" 
+
+	description="remove all elements from window">
+
+
+
+	    <setup> 
+
+		<RunCode code="FlexGlobals.topLevelApplication.resetWindow()" waitTarget="" waitEvent="myWindowComplete" />   
+
+	    </setup>
+
+	    <body>
+	    <WaitForEvent target="stage" eventName="enterFrame" numExpectedEvents="2"/><!-- add timeout in case window isn't ready -->
+
+		<AssertMethodValue method="value=FlexGlobals.topLevelApplication.testRemoveAllElements()" value="" />
+
+		<!-- make sure the window has time to update added Element-->
+
+		<SetProperty target="myWin" propertyName="width" value="400"  waitTarget="myWin" waitEvent="updateComplete"/>
+
+		<WaitForEvent target="stage" eventName="enterFrame" numExpectedEvents="2"/>
+
+		<!-- verify all elements should be removed, image comparision -->
+
+		<MyCompareBitmap target="myWin"  numColorVariances="10" maxColorVariance="10" url="../methods/baselines/$testID.png" mac_url="../methods/baselines/$testID_mac.png"  />
+
+		<WaitForEvent target="stage" eventName="enterFrame" numExpectedEvents="2"/>
+
+		<RunCode code="FlexGlobals.topLevelApplication.closeAllChildWindow()"/>
+
+	    </body>
+
+	</TestCase>
+
+
+
+</testCases>
+
+
+
+</UnitTester>
+

Added: incubator/flex/trunk/mustella/tests/apollo/spark/components/Window/methods/window_methods_getChildByName.mxml
URL: http://svn.apache.org/viewvc/incubator/flex/trunk/mustella/tests/apollo/spark/components/Window/methods/window_methods_getChildByName.mxml?rev=1370009&view=auto
==============================================================================
--- incubator/flex/trunk/mustella/tests/apollo/spark/components/Window/methods/window_methods_getChildByName.mxml (added)
+++ incubator/flex/trunk/mustella/tests/apollo/spark/components/Window/methods/window_methods_getChildByName.mxml Mon Aug  6 20:51:08 2012
@@ -0,0 +1,141 @@
+<?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="apollo/spark/components/Window/methods/"  xmlns:mx="http://www.adobe.com/2006/mxml" xmlns="*" testSWF="window_basic_002.mxml">
+
+	
+<!-- this set of lines form a template that must be in each unit test -->
+	
+    <mx:Script>
+	<![CDATA[
+	public static function init(o:DisplayObject):void
+	{
+	}
+	]]>
+    </mx:Script>
+    <mx:Metadata>
+	<![CDATA[
+		[Mixin]
+	]]>
+    </mx:Metadata>
+	<!-- end of set of lines that must be in each unit test -->
+
+    <mx:Script>
+	<![CDATA[
+	 import mx.core.FlexGlobals;
+	]]>
+    </mx:Script>
+
+	
+    <testCases>
+	<!--
+	========================================================
+	Test method getChildByName
+	========================================================
+	-->
+	<TestCase testID="method_getChildByName_test1" keywords="[Window,methods,getChildByName]" 
+		description="call the method on a button child of a Window">
+
+	    <setup> 
+		<RunCode code="FlexGlobals.topLevelApplication.closeAllChildWindow()"/>
+		<RunCode code="FlexGlobals.topLevelApplication.createAWindow()" waitTarget="" waitEvent="myWindowComplete" />   
+	    </setup>
+	    <body>
+		<AssertMethodValue method="value=FlexGlobals.topLevelApplication.testButtonOnWindow('childButton')" value="true" />   
+		<RunCode code="FlexGlobals.topLevelApplication.closeAllChildWindow()"/>
+	    </body>
+	</TestCase>
+
+
+
+	<TestCase testID="method_getChildByName_test2" keywords="[Window,methods,getChildByName]" 
+		description="call the method on a button child added later" >
+
+	    <setup>        
+	        <RunCode code="FlexGlobals.topLevelApplication.closeAllChildWindow()"/>
+	        <WaitForEvent target="stage" eventName="enterFrame" numExpectedEvents="2"/>
+		<RunCode code="FlexGlobals.topLevelApplication.createAWindow()" waitTarget="" waitEvent="myWindowComplete" />   
+	    </setup>
+	    <body>
+		<AssertMethodValue method="value=FlexGlobals.topLevelApplication.testButtonOnWindow('testButton')" value="true" />    
+		<RunCode code="FlexGlobals.topLevelApplication.closeAllChildWindow()"/>
+	    </body>
+	</TestCase>
+
+
+	<TestCase testID="method_getChildByName_test3" keywords="[Window,methods,getChildByName]" 
+		description="call the method on a button child of a WindowedApplication">
+
+	    <setup>        
+	        <RunCode code="FlexGlobals.topLevelApplication.closeAllChildWindow()"/>
+	        <WaitForEvent target="stage" eventName="enterFrame" numExpectedEvents="2"/>
+	        <RunCode code="FlexGlobals.topLevelApplication.createAWindow()" waitTarget="" waitEvent="myWindowComplete" />   
+	    </setup>
+            <body>
+	        <AssertMethodValue method="value=FlexGlobals.topLevelApplication.testButtonOnWindowedApplication('button1')" value="true" />    
+	        <RunCode code="FlexGlobals.topLevelApplication.closeAllChildWindow()"/>
+	    </body>
+	</TestCase>
+
+
+	<TestCase testID="method_getChildByName_test4" keywords="[Window,methods,getChildByName,negative]" 
+		description="call the method on a button which is NOT a child of a Window">
+
+	    <setup>        
+	        <RunCode code="FlexGlobals.topLevelApplication.closeAllChildWindow()"/>
+	        <WaitForEvent target="stage" eventName="enterFrame" numExpectedEvents="2"/>
+	        <RunCode code="FlexGlobals.topLevelApplication.createAWindow()" waitTarget="" waitEvent="myWindowComplete" />   
+	    </setup>
+            <body>
+	        <AssertMethodValue method="value=FlexGlobals.topLevelApplication.testButtonOnWindow('button1')" value="false" />    
+	        <RunCode code="FlexGlobals.topLevelApplication.closeAllChildWindow()"/>
+	    </body>
+	</TestCase>
+
+
+	<TestCase testID="method_getChildByName_test5" keywords="[Window,methods,getChildByName,negative]" 
+		description="call the method on a button which is NOT a child of a WindowedApplication">
+	    <setup>        
+	        <RunCode code="FlexGlobals.topLevelApplication.closeAllChildWindow()"/>
+	        <RunCode code="FlexGlobals.topLevelApplication.createAWindow()" waitTarget="" waitEvent="myWindowComplete" />   
+	    </setup>
+	    <body>
+	        <AssertMethodValue method="value=FlexGlobals.topLevelApplication.testButtonOnWindowedApplication('testButton')" value="false" />    
+	        <RunCode code="FlexGlobals.topLevelApplication.closeAllChildWindow()"/>
+	    </body>
+	</TestCase>
+
+
+	<TestCase testID="method_getChildByName_test6" keywords="[Window,methods,getChildByName,negative]" 
+		description="call the method on a button which is NOT existing">
+
+	    <setup>        
+	        <RunCode code="FlexGlobals.topLevelApplication.closeAllChildWindow()"/>
+	        <WaitForEvent target="stage" eventName="enterFrame" numExpectedEvents="2"/>
+	        <RunCode code="FlexGlobals.topLevelApplication.createAWindow()" waitTarget="" waitEvent="myWindowComplete" />   
+	    </setup>
+	    <body>
+	        <AssertMethodValue method="value=FlexGlobals.topLevelApplication.testButtonOnWindow('buttonblabla')" value="false" />    
+	        <RunCode code="FlexGlobals.topLevelApplication.closeAllChildWindow()"/>
+	    </body>
+	</TestCase>
+
+</testCases>
+
+</UnitTester>

Added: incubator/flex/trunk/mustella/tests/apollo/spark/components/Window/methods/window_methods_getCurrentSkinState_tests.mxml
URL: http://svn.apache.org/viewvc/incubator/flex/trunk/mustella/tests/apollo/spark/components/Window/methods/window_methods_getCurrentSkinState_tests.mxml?rev=1370009&view=auto
==============================================================================
--- incubator/flex/trunk/mustella/tests/apollo/spark/components/Window/methods/window_methods_getCurrentSkinState_tests.mxml (added)
+++ incubator/flex/trunk/mustella/tests/apollo/spark/components/Window/methods/window_methods_getCurrentSkinState_tests.mxml Mon Aug  6 20:51:08 2012
@@ -0,0 +1,79 @@
+<?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="apollo/spark/components/Window/methods/"  xmlns:mx="http://www.adobe.com/2006/mxml" xmlns="*" testSWF="window_basic_005.mxml">
+
+	<!-- this set of lines form a template that must be in each unit test -->
+	<mx:Script>
+	<![CDATA[
+	public static function init(o:DisplayObject):void
+	{
+	}
+	]]>
+	</mx:Script>
+	<mx:Metadata>
+	<![CDATA[
+		[Mixin]
+	]]>
+	</mx:Metadata>
+	<!-- end of set of lines that must be in each unit test -->
+
+	<mx:Script>
+	<![CDATA[
+
+        import mx.core.FlexGlobals;
+        import comps.*;
+
+	]]>
+	</mx:Script>
+
+    <testCases>
+
+        <!--
+	========================================================
+	getCurrentSkinState method
+	Override this method.
+	========================================================
+	-->
+	<TestCase testID="getCurrentSkinState_test1" keywords="[Window,getCurrentSkinState]" description="Trigger a change." >
+	    <setup>
+		<RunCode code="FlexGlobals.topLevelApplication.closeAllChildWindow()"/>
+		<RunCode code="FlexGlobals.topLevelApplication.windowObj=FlexGlobals.topLevelApplication.createAWindowByClass(WindowWithStates2,'window1');" waitTarget="" waitEvent="myWindowComplete" />
+	    </setup>
+	    <body>
+		<RunCode code="FlexGlobals.topLevelApplication.windowObj.getHappySkinState();" waitTarget="windowObj" waitEvent="updateComplete" />
+		<WaitForEvent target="stage" eventName="enterFrame" numExpectedEvents="4"/>
+		<MyCompareBitmap target="windowObj"  numColorVariances="10" maxColorVariance="10" url="../methods/baselines/$testID.png" mac_url="../methods/baselines/$testID_mac.png" />
+	    </body>
+	</TestCase>
+
+	<TestCase testID="getCurrentSkinState_test2" keywords="[Window,getCurrentSkinState]" description="Trigger a change." >
+	    <setup>
+		<RunCode code="FlexGlobals.topLevelApplication.closeAllChildWindow()"/>
+		<RunCode code="FlexGlobals.topLevelApplication.windowObj=FlexGlobals.topLevelApplication.createAWindowByClass(WindowWithStates2,'window1');" waitTarget="" waitEvent="myWindowComplete" />
+	    </setup>
+	    <body>
+		<RunCode code="FlexGlobals.topLevelApplication.windowObj.getSadSkinState();" waitTarget="windowObj" waitEvent="updateComplete" />
+		<WaitForEvent target="stage" eventName="enterFrame" numExpectedEvents="4"/>
+		<MyCompareBitmap target="windowObj"  numColorVariances="10" maxColorVariance="10" url="../methods/baselines/$testID.png"  mac_url="../methods/baselines/$testID_mac.png" />
+	    </body>
+	</TestCase>
+
+    </testCases>
+</UnitTester>

Added: incubator/flex/trunk/mustella/tests/apollo/spark/components/Window/methods/window_methods_maximize_tests.mxml
URL: http://svn.apache.org/viewvc/incubator/flex/trunk/mustella/tests/apollo/spark/components/Window/methods/window_methods_maximize_tests.mxml?rev=1370009&view=auto
==============================================================================
--- incubator/flex/trunk/mustella/tests/apollo/spark/components/Window/methods/window_methods_maximize_tests.mxml (added)
+++ incubator/flex/trunk/mustella/tests/apollo/spark/components/Window/methods/window_methods_maximize_tests.mxml Mon Aug  6 20:51:08 2012
@@ -0,0 +1,174 @@
+<?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="apollo/spark/components/Window/methods/"  xmlns:mx="http://www.adobe.com/2006/mxml" xmlns="*" testSWF="window_basic_005.mxml">
+
+	<!-- this set of lines form a template that must be in each unit test -->
+    <mx:Script>
+	<![CDATA[
+	public static function init(o:DisplayObject):void
+	{
+	}
+	]]>
+    </mx:Script>
+    <mx:Metadata>
+	<![CDATA[
+		[Mixin]
+	]]>
+    </mx:Metadata>
+	<!-- end of set of lines that must be in each unit test -->
+
+    <mx:Script>
+	<![CDATA[
+
+        import flash.system.Capabilities;
+        import mx.core.FlexGlobals;
+        import spark.components.*;
+        import spark.skins.spark.SparkChromeWindowedApplicationSkin ;
+	public function checkMaxSizeValue(actualSize:Number, expectSize:Number, delta:Number):Boolean
+	{
+		trace("expectSize-actualSize="+(expectSize-actualSize)+";delta="+delta);
+		if ((expectSize-actualSize)<delta) 
+			return true;
+		else 
+			return false;
+	}
+	]]>
+    </mx:Script>
+
+    <testCases>
+
+	<!--
+	========================================================
+	Test maximize()
+	- The maximizable property is tested elsewhere.  Here,
+	we're just testing that maximmize() maximizes, which is
+	a similar, partly duplicated, set of tests.
+	- Clicking the maximize button to maximize is also
+	tested in the maximizable tests.
+	========================================================
+	-->
+
+	<TestCase testID="maximize_test1_SparkChrome" keywords="[Window,maximize]" description="Maximize when in the restored state." >
+	    <setup>
+		<RunCode code="FlexGlobals.topLevelApplication.closeAllChildWindow()"/>
+		<RunCode code="FlexGlobals.topLevelApplication.createAWindow()" waitTarget="" waitEvent="myWindowComplete"/>
+		<SetProperty target="windowObj" propertyName="maxHeight" value="10000" />
+		<SetProperty target="windowObj" propertyName="maxWidth" value="10000" />
+	    </setup>
+	    <body>
+		<SetStyle target="windowObj" styleName="skinClass" valueExpression="value = SparkChromeWindowedApplicationSkin" waitEvent="updateComplete" />
+		<RunCode code="FlexGlobals.topLevelApplication.windowObj.maximize()" waitTarget="windowObj" waitEvent="displayStateChange" />        
+		<AssertPropertyValue target="windowObj.nativeWindow" propertyName="displayState" value="maximized" />
+		<AssertMethodValue method="value =checkMaxSizeValue( FlexGlobals.topLevelApplication.windowObj.width,Capabilities.screenResolutionX,130)" value="true" />
+		<AssertMethodValue method="value =checkMaxSizeValue( FlexGlobals.topLevelApplication.windowObj.height,Capabilities.screenResolutionY,130)" value="false" />
+		<AssertMethodValue method="value =checkMaxSizeValue( FlexGlobals.topLevelApplication.windowObj.skin.titleBar.width,Capabilities.screenResolutionX,130)" value="true" />
+	    </body>
+	</TestCase>
+
+	<TestCase testID="maximize_test1_WindowedApplicationSkin " keywords="[Window,maximize]" description="Maximize when in the restored state." >
+	    <setup>
+		<RunCode code="FlexGlobals.topLevelApplication.closeAllChildWindow()"/>
+		<RunCode code="FlexGlobals.topLevelApplication.createAWindow()" waitTarget="" waitEvent="myWindowComplete"/>
+		<SetProperty target="windowObj" propertyName="maxHeight" value="10000" />
+		<SetProperty target="windowObj" propertyName="maxWidth" value="10000" />
+	    </setup>
+	    <body>
+		<SetStyle target="windowObj" styleName="skinClass" valueExpression="value = SparkChromeWindowedApplicationSkin" waitEvent="updateComplete" />
+		<RunCode code="FlexGlobals.topLevelApplication.windowObj.maximize()" waitTarget="windowObj" waitEvent="displayStateChange" />        
+		<AssertPropertyValue target="windowObj.nativeWindow" propertyName="displayState" value="maximized" />
+		<AssertMethodValue method="value =checkMaxSizeValue( FlexGlobals.topLevelApplication.windowObj.width,Capabilities.screenResolutionX,130)" value="true" />
+		<AssertMethodValue method="value =checkMaxSizeValue( FlexGlobals.topLevelApplication.windowObj.height,Capabilities.screenResolutionY,130)" value="false" />
+	    </body>
+	</TestCase>
+
+	<TestCase testID="maximize_test2_SparkChrome" keywords="[Window,maximize]" description="Maximize when maximized.  We must use Pause." >
+	    <setup>
+		<RunCode code="FlexGlobals.topLevelApplication.closeAllChildWindow()"/>
+		<RunCode code="FlexGlobals.topLevelApplication.createAWindow()" waitTarget="" waitEvent="myWindowComplete"/>
+		<SetProperty target="windowObj" propertyName="maxHeight" value="10000" />
+		<SetProperty target="windowObj" propertyName="maxWidth" value="10000" />
+	    </setup>
+	    <body>
+		<SetStyle target="windowObj" styleName="skinClass" valueExpression="value = SparkChromeWindowedApplicationSkin" waitEvent="updateComplete" />
+		<RunCode code="FlexGlobals.topLevelApplication.windowObj.maximize()" waitTarget="windowObj" waitEvent="displayStateChange" />        
+		<RunCode code="FlexGlobals.topLevelApplication.windowObj.maximize()" />
+		<WaitForEvent target="stage" eventName="enterFrame" numExpectedEvents="2"/>
+		<AssertPropertyValue target="windowObj.nativeWindow" propertyName="displayState" value="maximized" />
+		<AssertMethodValue method="value =checkMaxSizeValue( FlexGlobals.topLevelApplication.windowObj.width,Capabilities.screenResolutionX,130)" value="true" />
+		<AssertMethodValue method="value =checkMaxSizeValue( FlexGlobals.topLevelApplication.windowObj.height,Capabilities.screenResolutionY,130)" value="false" />
+		<AssertMethodValue method="value =checkMaxSizeValue( FlexGlobals.topLevelApplication.windowObj.skin.titleBar.width,Capabilities.screenResolutionX,130)" value="true" />
+	    </body>
+	</TestCase>
+
+	<TestCase testID="maximize_test2_WindowedApplicationSkin " keywords="[Window,maximize]" description="Maximize when maximized.  We must use Pause." >
+	    <setup>
+		<RunCode code="FlexGlobals.topLevelApplication.closeAllChildWindow()"/>
+		<RunCode code="FlexGlobals.topLevelApplication.createAWindow()" waitTarget="" waitEvent="myWindowComplete"/>
+		<SetProperty target="windowObj" propertyName="maxHeight" value="10000" />
+		<SetProperty target="windowObj" propertyName="maxWidth" value="10000" />
+	    </setup>
+	    <body>
+		<SetStyle target="windowObj" styleName="skinClass" valueExpression="value = SparkChromeWindowedApplicationSkin" waitEvent="updateComplete" />
+		<WaitForEvent target="stage" eventName="enterFrame" numExpectedEvents="2"/>
+		<RunCode code="FlexGlobals.topLevelApplication.windowObj.maximize()" waitTarget="windowObj" waitEvent="displayStateChange" />        
+		<WaitForEvent target="stage" eventName="enterFrame" numExpectedEvents="4"/>
+		<AssertPropertyValue target="windowObj.nativeWindow" propertyName="displayState" value="maximized" />
+		<AssertMethodValue method="value =checkMaxSizeValue( FlexGlobals.topLevelApplication.windowObj.width,Capabilities.screenResolutionX,130)" value="true" />
+		<AssertMethodValue method="value =checkMaxSizeValue( FlexGlobals.topLevelApplication.windowObj.height,Capabilities.screenResolutionY,130)" value="false" />
+	    </body>
+	</TestCase>
+
+	<TestCase testID="maximize_test3_SparkChrome" keywords="[Window,maximize]" description="Maximize when minimized." >
+	    <setup>
+		<RunCode code="FlexGlobals.topLevelApplication.closeAllChildWindow()"/>
+		<RunCode code="FlexGlobals.topLevelApplication.createAWindow()" waitTarget="" waitEvent="myWindowComplete"/>
+		<SetProperty target="windowObj" propertyName="maxHeight" value="10000" />
+		<SetProperty target="windowObj" propertyName="maxWidth" value="10000" />
+	    </setup>
+	    <body>
+		<SetStyle target="windowObj" styleName="skinClass" valueExpression="value = SparkChromeWindowedApplicationSkin" waitEvent="updateComplete" />
+		<RunCode code="FlexGlobals.topLevelApplication.windowObj.minimize()" waitTarget="windowObj" waitEvent="displayStateChange" />
+		<RunCode code="FlexGlobals.topLevelApplication.windowObj.maximize()" waitTarget="windowObj" waitEvent="displayStateChange" />
+		<AssertPropertyValue target="windowObj.nativeWindow" propertyName="displayState" value="maximized" />
+		<AssertMethodValue method="value =checkMaxSizeValue( FlexGlobals.topLevelApplication.windowObj.width,Capabilities.screenResolutionX,130)" value="true" />
+		<AssertMethodValue method="value =checkMaxSizeValue( FlexGlobals.topLevelApplication.windowObj.height,Capabilities.screenResolutionY,130)" value="false" />
+		<AssertMethodValue method="value =checkMaxSizeValue( FlexGlobals.topLevelApplication.windowObj.skin.titleBar.width,Capabilities.screenResolutionX,130)" value="true" />
+        </body>
+	</TestCase>
+
+	<TestCase testID="maximize_test3_WindowedApplicationSkin " keywords="[Window,maximize]" description="Maximize when minimized." >
+	    <setup>
+		<RunCode code="FlexGlobals.topLevelApplication.closeAllChildWindow()"/>
+		<RunCode code="FlexGlobals.topLevelApplication.createAWindow()" waitTarget="" waitEvent="myWindowComplete"/>
+		<SetProperty target="windowObj" propertyName="maxHeight" value="10000" />
+		<SetProperty target="windowObj" propertyName="maxWidth" value="10000" />
+	    </setup>
+	    <body>
+		<SetStyle target="windowObj" styleName="skinClass" valueExpression="value = SparkChromeWindowedApplicationSkin" waitEvent="updateComplete" />
+		<RunCode code="FlexGlobals.topLevelApplication.windowObj.minimize()" waitTarget="windowObj" waitEvent="displayStateChange" />
+		<RunCode code="FlexGlobals.topLevelApplication.windowObj.maximize()" waitTarget="windowObj" waitEvent="displayStateChange" />
+		<AssertPropertyValue target="windowObj.nativeWindow" propertyName="displayState" value="maximized" />
+		<AssertMethodValue method="value =checkMaxSizeValue( FlexGlobals.topLevelApplication.windowObj.width,Capabilities.screenResolutionX,130)" value="true" />
+		<AssertMethodValue method="value =checkMaxSizeValue( FlexGlobals.topLevelApplication.windowObj.height,Capabilities.screenResolutionY,130)" value="false" />
+	    </body>
+	</TestCase>
+
+    </testCases>
+</UnitTester>

Added: incubator/flex/trunk/mustella/tests/apollo/spark/components/Window/methods/window_methods_minimize_tests.mxml
URL: http://svn.apache.org/viewvc/incubator/flex/trunk/mustella/tests/apollo/spark/components/Window/methods/window_methods_minimize_tests.mxml?rev=1370009&view=auto
==============================================================================
--- incubator/flex/trunk/mustella/tests/apollo/spark/components/Window/methods/window_methods_minimize_tests.mxml (added)
+++ incubator/flex/trunk/mustella/tests/apollo/spark/components/Window/methods/window_methods_minimize_tests.mxml Mon Aug  6 20:51:08 2012
@@ -0,0 +1,155 @@
+<?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="apollo/spark/components/Window/methods/"  xmlns:mx="http://www.adobe.com/2006/mxml" xmlns="*" testSWF="window_basic_005.mxml">
+
+	<!-- this set of lines form a template that must be in each unit test -->
+    <mx:Script>
+	<![CDATA[
+	public static function init(o:DisplayObject):void
+	{
+	}
+	]]>
+	</mx:Script>
+    <mx:Metadata>
+	<![CDATA[
+		[Mixin]
+	]]>
+    </mx:Metadata>
+	<!-- end of set of lines that must be in each unit test -->
+
+    <mx:Script>
+	<![CDATA[
+
+        import flash.system.Capabilities;
+        import mx.core.FlexGlobals;
+        import spark.components.*;
+        import spark.skins.spark.*;
+
+	]]>
+    </mx:Script>
+
+    <testCases>
+
+	<!--
+	========================================================
+	Test minimize()
+	- The minimizable property is tested elsewhere.  Here,
+	we're just testing that minimmize() minimizes, which is
+	a similar, partly duplicated, set of tests.
+	- Clicking the minimize button to minimize is also
+	tested in the minimizable tests.
+	- There's not much we can do (e.g. CompareBitmap
+	and such) in mustella.  There will be manual tests.
+	========================================================
+	-->
+
+	<TestCase testID="minimize_test1_SparkChrome" keywords="[Window,minimize]" description="Minimize when in the restored state." >
+	    <setup>
+		<RunCode code="FlexGlobals.topLevelApplication.closeAllChildWindow()"/>
+		<RunCode code="FlexGlobals.topLevelApplication.createAWindow()" waitTarget="" waitEvent="myWindowComplete"/>
+	    </setup>
+	    <body>
+		<SetStyle target="windowObj" styleName="skinClass" valueExpression="value = SparkChromeWindowedApplicationSkin" waitEvent="updateComplete" />
+		<WaitForEvent target="stage" eventName="enterFrame" numExpectedEvents="2"/>
+		<RunCode code="FlexGlobals.topLevelApplication.windowObj.minimize()" waitTarget="windowObj" waitEvent="displayStateChange" />        
+		<WaitForEvent target="stage" eventName="enterFrame" numExpectedEvents="2"/>
+		<AssertPropertyValue target="windowObj.nativeWindow" propertyName="displayState" value="minimized" />
+	    </body>
+	</TestCase>
+
+	<TestCase testID="minimize_test1_WindowedApplicationSkin" keywords="[Window,minimize]" description="Minimize when in the restored state." >
+	    <setup>
+		<RunCode code="FlexGlobals.topLevelApplication.closeAllChildWindow()"/>
+		<RunCode code="FlexGlobals.topLevelApplication.createAWindow()" waitTarget="" waitEvent="myWindowComplete"/>
+	    </setup>
+	    <body>
+	       <SetStyle target="windowObj" styleName="skinClass" valueExpression="value = WindowedApplicationSkin" waitEvent="updateComplete" />
+		<WaitForEvent target="stage" eventName="enterFrame" numExpectedEvents="2"/>	
+		<RunCode code="FlexGlobals.topLevelApplication.windowObj.minimize()" waitTarget="windowObj" waitEvent="displayStateChange" />     
+		<WaitForEvent target="stage" eventName="enterFrame" numExpectedEvents="2"/>	
+		<AssertPropertyValue target="windowObj.nativeWindow" propertyName="displayState" value="minimized" />
+	    </body>
+	</TestCase>
+
+
+
+
+	<TestCase testID="minimize_test2_SparkChrome" keywords="[Window,minimize]" description="Minimize when maximized." >
+	    <setup>
+		<RunCode code="FlexGlobals.topLevelApplication.closeAllChildWindow()"/>
+		<RunCode code="FlexGlobals.topLevelApplication.createAWindow()" waitTarget="" waitEvent="myWindowComplete"/>
+	    </setup>
+	    <body>
+		<SetStyle target="windowObj" styleName="skinClass" valueExpression="value = SparkChromeWindowedApplicationSkin" waitEvent="updateComplete" />
+		<RunCode code="FlexGlobals.topLevelApplication.windowObj.maximize()" waitTarget="windowObj" waitEvent="displayStateChange" />
+		<RunCode code="FlexGlobals.topLevelApplication.windowObj.minimize()" waitTarget="windowObj" waitEvent="displayStateChange" />
+		<WaitForEvent target="stage" eventName="enterFrame" numExpectedEvents="2"/>
+		<AssertPropertyValue target="windowObj.nativeWindow" propertyName="displayState" value="minimized" />
+	    </body>
+	</TestCase>
+
+	<TestCase testID="minimize_test2_WindowedApplicationSkin " keywords="[Window,minimize]" description="Minimize when maximized." >
+	    <setup>
+		<RunCode code="FlexGlobals.topLevelApplication.closeAllChildWindow()"/>
+		<RunCode code="FlexGlobals.topLevelApplication.createAWindow()" waitTarget="" waitEvent="myWindowComplete"/>
+	    </setup>
+	    <body>
+		<SetStyle target="windowObj" styleName="skinClass" valueExpression="value = WindowedApplicationSkin" waitEvent="updateComplete" />
+		<RunCode code="FlexGlobals.topLevelApplication.windowObj.maximize()" waitTarget="windowObj" waitEvent="displayStateChange" />
+		<RunCode code="FlexGlobals.topLevelApplication.windowObj.minimize()" waitTarget="windowObj" waitEvent="displayStateChange" />
+		<WaitForEvent target="stage" eventName="enterFrame" numExpectedEvents="2"/>
+		<AssertPropertyValue target="windowObj.nativeWindow" propertyName="displayState" value="minimized" />
+	    </body>
+	</TestCase>
+
+
+
+	<TestCase testID="minimize_test3_SparkChrome" keywords="[Window,minimize]" description="Minimize when minimized.  We must use Pause." >
+	    <setup>
+		<RunCode code="FlexGlobals.topLevelApplication.closeAllChildWindow()"/>
+		<RunCode code="FlexGlobals.topLevelApplication.createAWindow()" waitTarget="" waitEvent="myWindowComplete"/>
+	    </setup>
+	    <body>
+		<SetStyle target="windowObj" styleName="skinClass" valueExpression="value = SparkChromeWindowedApplicationSkin" waitEvent="updateComplete" />
+		<RunCode code="FlexGlobals.topLevelApplication.windowObj.minimize()" waitTarget="windowObj" waitEvent="displayStateChange" />
+		<RunCode code="FlexGlobals.topLevelApplication.windowObj.minimize()" />
+		<WaitForEvent target="stage" eventName="enterFrame" numExpectedEvents="4"/>
+		<AssertPropertyValue target="windowObj.nativeWindow" propertyName="displayState" value="minimized" />
+	    </body>
+	</TestCase>
+
+	<TestCase testID="minimize_test3_WindowedApplicationSkin " keywords="[Window,minimize]" description="Minimize when minimized.  We must use Pause." >
+	    <setup>
+		<RunCode code="FlexGlobals.topLevelApplication.closeAllChildWindow()"/>
+		<RunCode code="FlexGlobals.topLevelApplication.createAWindow()" waitTarget="" waitEvent="myWindowComplete"/>
+	    </setup>
+	    <body>
+		<SetStyle target="windowObj" styleName="skinClass" valueExpression="value = WindowedApplicationSkin" waitEvent="updateComplete" />
+
+		<RunCode code="FlexGlobals.topLevelApplication.windowObj.minimize()" waitTarget="windowObj" waitEvent="displayStateChange" />
+		<RunCode code="FlexGlobals.topLevelApplication.windowObj.minimize()" />
+		<WaitForEvent target="stage" eventName="enterFrame" numExpectedEvents="4"/>
+		<AssertPropertyValue target="windowObj.nativeWindow" propertyName="displayState" value="minimized" />
+	    </body>
+	</TestCase>
+
+
+    </testCases>
+</UnitTester>

Added: incubator/flex/trunk/mustella/tests/apollo/spark/components/Window/methods/window_methods_mouseDownHandler.mxml
URL: http://svn.apache.org/viewvc/incubator/flex/trunk/mustella/tests/apollo/spark/components/Window/methods/window_methods_mouseDownHandler.mxml?rev=1370009&view=auto
==============================================================================
--- incubator/flex/trunk/mustella/tests/apollo/spark/components/Window/methods/window_methods_mouseDownHandler.mxml (added)
+++ incubator/flex/trunk/mustella/tests/apollo/spark/components/Window/methods/window_methods_mouseDownHandler.mxml Mon Aug  6 20:51:08 2012
@@ -0,0 +1,67 @@
+<?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="apollo/spark/components/Window/methods/"  
+    xmlns:mx="http://www.adobe.com/2006/mxml" 
+    xmlns="*"
+    testSWF="window_basic_005.mxml">
+    
+<!-- this set of lines form a template that must be in each unit test -->
+    
+    <mx:Script>
+    <![CDATA[
+    public static function init(o:DisplayObject):void
+    {
+    }
+    ]]>
+    </mx:Script>
+    <mx:Metadata>
+    <![CDATA[
+        [Mixin]
+    ]]>
+    </mx:Metadata>
+    <!-- end of set of lines that must be in each unit test -->
+
+    <mx:Script>
+    <![CDATA[
+        import mx.core.FlexGlobals;
+        import comps.*;
+     
+    ]]>
+    </mx:Script>
+    
+    <testCases>
+
+    <TestCase testID="mouseDownHandler_test1" keywords="[Window,methods,mouseDownHandler]" description="verify override mouseDownHandler method.">         
+        <setup> 
+	     <RunCode code="FlexGlobals.topLevelApplication.closeAllChildWindow()"/>
+	     <RunCode code="FlexGlobals.topLevelApplication.createAWindowByClass(WindowWithDeferredContent,'none')" waitTarget="" waitEvent="myWindowComplete" />
+	 </setup>
+	 <body>
+	     <WaitForEvent target="stage" eventName="enterFrame" numExpectedEvents="2"/><!-- wait for window is created, opened -->
+	     <DispatchMouseEvent target="windowObj" type="mouseDown" localX="50" localY="50" />
+             <AssertEvent target="windowObj" eventName="myMouseDown_handled" eventClass="flash.events::MouseEvent" />
+	     <WaitForEvent target="stage" eventName="enterFrame" numExpectedEvents="2"/>
+	     <RunCode code="FlexGlobals.topLevelApplication.closeAllChildWindow()"/>
+	 </body>
+    </TestCase>
+
+</testCases>
+
+</UnitTester>

Added: incubator/flex/trunk/mustella/tests/apollo/spark/components/Window/methods/window_methods_move.mxml
URL: http://svn.apache.org/viewvc/incubator/flex/trunk/mustella/tests/apollo/spark/components/Window/methods/window_methods_move.mxml?rev=1370009&view=auto
==============================================================================
--- incubator/flex/trunk/mustella/tests/apollo/spark/components/Window/methods/window_methods_move.mxml (added)
+++ incubator/flex/trunk/mustella/tests/apollo/spark/components/Window/methods/window_methods_move.mxml Mon Aug  6 20:51:08 2012
@@ -0,0 +1,189 @@
+<?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="apollo/spark/components/Window/methods/"  xmlns:mx="http://www.adobe.com/2006/mxml" xmlns="*" testSWF="window_basic_002.mxml">
+
+	
+<!-- this set of lines form a template that must be in each unit test -->
+	
+    <mx:Script>
+	<![CDATA[
+	public static function init(o:DisplayObject):void
+	{
+	}
+	]]>
+    </mx:Script>
+    <mx:Metadata>
+	<![CDATA[
+		[Mixin]
+	]]>
+    </mx:Metadata>
+	<!-- end of set of lines that must be in each unit test -->
+
+    <mx:Script>
+	<![CDATA[
+	 import mx.core.FlexGlobals;
+	]]>
+    </mx:Script>
+
+	
+    <testCases>
+	<!--
+	========================================================
+	Test method move
+	========================================================
+	-->
+	<TestCase testID="method_move_test1" keywords="[Window,methods,move]" 
+		description="call the method window.move(x,y), x=0,y=0">
+
+	    <setup>
+	        <RunCode code="FlexGlobals.topLevelApplication.closeAllChildWindow()"/>
+		<RunCode code="FlexGlobals.topLevelApplication.createAWindow()" waitTarget="" waitEvent="myWindowComplete" />   
+	    </setup>
+	    <body>
+		<WaitForEvent target="stage" eventName="enterFrame" numExpectedEvents="2"/>
+		<RunCode code="FlexGlobals.topLevelApplication.myWin.move(0,0)" waitTarget="myWin" waitEvent="windowMove"/>
+		<WaitForEvent target="stage" eventName="enterFrame" numExpectedEvents="2"/>
+		<AssertMethodValue method="value=FlexGlobals.topLevelApplication.assertValueBaseOnOS('bounds.x',FlexGlobals.topLevelApplication.myWin.nativeWindow.bounds.x,0,0,0)" value=""/>
+		 <WaitForEvent target="stage" eventName="enterFrame" numExpectedEvents="2"/>
+		 <AssertMethodValue method="value=FlexGlobals.topLevelApplication.assertValueBaseOnOS('bounds.y',FlexGlobals.topLevelApplication.myWin.nativeWindow.bounds.y,0,22,0)" value=""/>
+		<RunCode code="FlexGlobals.topLevelApplication.closeAllChildWindow()"/>
+	    </body>
+	</TestCase>
+
+
+	<TestCase testID="method_move_test2" keywords="[Window,methods,move]" 
+		description="call the method window.move(x,y), x=100,y=0">
+
+	    <setup>
+	        <RunCode code="FlexGlobals.topLevelApplication.closeAllChildWindow()"/>
+		<RunCode code="FlexGlobals.topLevelApplication.createAWindow()" waitTarget="" waitEvent="myWindowComplete" />   
+	    </setup>
+	    <body>
+		<WaitForEvent target="stage" eventName="enterFrame" numExpectedEvents="2"/>
+		<RunCode code="FlexGlobals.topLevelApplication.myWin.move(100,0)" waitTarget="myWin" waitEvent="windowMove"/>
+		<WaitForEvent target="stage" eventName="enterFrame" numExpectedEvents="2"/>
+		<AssertMethodValue method="value=FlexGlobals.topLevelApplication.assertValueBaseOnOS('bounds.x',FlexGlobals.topLevelApplication.myWin.nativeWindow.bounds.x,100,100,100)" value=""/>
+		 <WaitForEvent target="stage" eventName="enterFrame" numExpectedEvents="2"/>
+		 <AssertMethodValue method="value=FlexGlobals.topLevelApplication.assertValueBaseOnOS('bounds.y',FlexGlobals.topLevelApplication.myWin.nativeWindow.bounds.y,0,22,0)" value=""/>
+		<RunCode code="FlexGlobals.topLevelApplication.closeAllChildWindow()"/>
+	    </body>
+	</TestCase>
+	
+	<TestCase testID="method_move_test3" keywords="[Window,methods,move]" 
+		description="call the method window.move(x,y), x=900,y=0">
+
+	    <setup>
+	        <RunCode code="FlexGlobals.topLevelApplication.closeAllChildWindow()"/>
+		<RunCode code="FlexGlobals.topLevelApplication.createAWindow()" waitTarget="" waitEvent="myWindowComplete" />   
+	    </setup>
+	    <body>
+		<WaitForEvent target="stage" eventName="enterFrame" numExpectedEvents="2"/>
+		<RunCode code="FlexGlobals.topLevelApplication.myWin.move(900,0)" waitTarget="myWin" waitEvent="windowMove" />
+		<WaitForEvent target="stage" eventName="enterFrame" numExpectedEvents="2"/>
+		<AssertMethodValue method="value=FlexGlobals.topLevelApplication.assertValueBaseOnOS('bounds.x',FlexGlobals.topLevelApplication.myWin.nativeWindow.bounds.x,900,900,900)" value=""/>
+		 <WaitForEvent target="stage" eventName="enterFrame" numExpectedEvents="2"/>
+		 <AssertMethodValue method="value=FlexGlobals.topLevelApplication.assertValueBaseOnOS('bounds.y',FlexGlobals.topLevelApplication.myWin.nativeWindow.bounds.y,0,22,0)" value=""/>
+		 
+		<RunCode code="FlexGlobals.topLevelApplication.closeAllChildWindow()"/>
+            </body>
+	</TestCase>
+	
+
+	<TestCase testID="method_move_test4" keywords="[Window,methods,move]" 
+		description="call the method window.move(x,y), x=0,y=500">
+
+	    <setup>
+	        <RunCode code="FlexGlobals.topLevelApplication.closeAllChildWindow()"/>
+		<RunCode code="FlexGlobals.topLevelApplication.createAWindow()" waitTarget="" waitEvent="myWindowComplete" />   
+	    </setup>
+	    <body>
+		<WaitForEvent target="stage" eventName="enterFrame" numExpectedEvents="2"/>
+		<RunCode code="FlexGlobals.topLevelApplication.myWin.move(0,500)" waitTarget="myWin" waitEvent="windowMove"/>
+		<WaitForEvent target="stage" eventName="enterFrame" numExpectedEvents="2"/>
+		<AssertPropertyValue target="myWin.nativeWindow.bounds" propertyName="x" value="0" />
+		<WaitForEvent target="stage" eventName="enterFrame" numExpectedEvents="2"/>
+		<AssertPropertyValue target="myWin.nativeWindow.bounds" propertyName="y" value="500" />
+		<RunCode code="FlexGlobals.topLevelApplication.closeAllChildWindow()"/>
+	    </body>
+	</TestCase>
+	
+	
+	<TestCase testID="method_move_test5" keywords="[Window,methods,move]" 
+		description="call the method window.move(x,y), x=-100,y=-100">
+
+	    <setup>
+	        <RunCode code="FlexGlobals.topLevelApplication.closeAllChildWindow()"/>
+		<RunCode code="FlexGlobals.topLevelApplication.createAWindow()" waitTarget="" waitEvent="myWindowComplete" />   
+	    </setup>
+	    <body>
+		<WaitForEvent target="stage" eventName="enterFrame" numExpectedEvents="2"/>
+		<RunCode code="FlexGlobals.topLevelApplication.myWin.move(-100,-100)" waitTarget="myWin" waitEvent="windowMove"/>
+		<WaitForEvent target="stage" eventName="enterFrame" numExpectedEvents="2"/>
+		<AssertMethodValue method="value=FlexGlobals.topLevelApplication.assertValueBaseOnOS('bounds.x',FlexGlobals.topLevelApplication.myWin.nativeWindow.bounds.x,-100,-100,-100)" value=""/>
+		 <WaitForEvent target="stage" eventName="enterFrame" numExpectedEvents="2"/>
+		 <AssertMethodValue method="value=FlexGlobals.topLevelApplication.assertValueBaseOnOS('bounds.y',FlexGlobals.topLevelApplication.myWin.nativeWindow.bounds.y,-100,22,-100)" value=""/>
+		<RunCode code="FlexGlobals.topLevelApplication.closeAllChildWindow()"/>
+	    </body>
+	</TestCase>
+	
+	
+	<TestCase testID="method_move_test6" keywords="[Window,methods,move]" 
+		description="call the method window.move(x,y), x=500,y=900">
+
+	    <setup>
+	        <RunCode code="FlexGlobals.topLevelApplication.closeAllChildWindow()"/>
+		<RunCode code="FlexGlobals.topLevelApplication.createAWindow()" waitTarget="" waitEvent="myWindowComplete" />   
+	    </setup>
+	    <body>
+		<WaitForEvent target="stage" eventName="enterFrame" numExpectedEvents="2"/>
+		<RunCode code="FlexGlobals.topLevelApplication.myWin.move(500,900)" waitTarget="myWin" waitEvent="windowMove"/>
+		<WaitForEvent target="stage" eventName="enterFrame" numExpectedEvents="2"/>
+		<AssertMethodValue method="value=FlexGlobals.topLevelApplication.assertValueBaseOnOS('bounds.x',FlexGlobals.topLevelApplication.myWin.nativeWindow.bounds.x,500,500,500)" value=""/>
+		 <WaitForEvent target="stage" eventName="enterFrame" numExpectedEvents="2"/>
+		 <AssertMethodValue method="value=FlexGlobals.topLevelApplication.assertValueBaseOnOS('bounds.y',FlexGlobals.topLevelApplication.myWin.nativeWindow.bounds.y,900,710,900)" value="bounds.y on os=mac os 10.7.4, actual value=900;expected value=710"/>
+		<RunCode code="FlexGlobals.topLevelApplication.closeAllChildWindow()"/>
+	    </body>
+	</TestCase>
+	
+	
+	
+	<TestCase testID="method_move_test7" keywords="[Window,methods,move]" 
+		description="call the method window.move(x,y), x=3500,y=3900" >
+
+	    <setup>
+	        <RunCode code="FlexGlobals.topLevelApplication.closeAllChildWindow()"/>
+		<RunCode code="FlexGlobals.topLevelApplication.createAWindow()" waitTarget="" waitEvent="myWindowComplete" />   
+	    </setup>
+	    <body>
+		<WaitForEvent target="stage" eventName="enterFrame" numExpectedEvents="2"/>
+		<RunCode code="FlexGlobals.topLevelApplication.myWin.move(3500,3900)" waitTarget="myWin" waitEvent="windowMove"/>
+		<WaitForEvent target="stage" eventName="enterFrame" numExpectedEvents="2"/>
+		<AssertMethodValue method="value=FlexGlobals.topLevelApplication.assertValueBaseOnOS('bounds.x',FlexGlobals.topLevelApplication.myWin.nativeWindow.bounds.x,3500,flash.system.Capabilities.screenResolutionX-40,3900)" value="bounds.x on os=mac os 10.7.4, actual value=3500;expected value=2520"/>
+		 <WaitForEvent target="stage" eventName="enterFrame" numExpectedEvents="2"/>
+		 <AssertMethodValue method="value=FlexGlobals.topLevelApplication.assertValueBaseOnOS('bounds.y',FlexGlobals.topLevelApplication.myWin.nativeWindow.bounds.y,3900,710,3900)" value="bounds.y on os=mac os 10.7.4, actual value=1238;expected value=710"/>
+		 
+		<WaitForEvent target="stage" eventName="enterFrame" numExpectedEvents="2"/>
+		<RunCode code="FlexGlobals.topLevelApplication.closeAllChildWindow()"/>
+	    </body>
+	</TestCase>
+		
+    </testCases>
+
+</UnitTester>



Mime
View raw message