incubator-flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cframp...@apache.org
Subject svn commit: r1384922 - in /incubator/flex/sdk/branches/develop/mustella/tests/containers/tabnavigator: SWFs/comps/button_swf_runtime.mxml Styles/TabNavigator_Styles_SkinStates.mxml Styles/TabNavigator_Styles_SkinStates_Spark.mxml
Date Fri, 14 Sep 2012 21:01:55 GMT
Author: cframpton
Date: Fri Sep 14 21:01:55 2012
New Revision: 1384922

URL: http://svn.apache.org/viewvc?rev=1384922&view=rev
Log:
Work on button images loaded at runtime.  The tests are still flaky but I want Alex to look
at them.

Modified:
    incubator/flex/sdk/branches/develop/mustella/tests/containers/tabnavigator/SWFs/comps/button_swf_runtime.mxml
    incubator/flex/sdk/branches/develop/mustella/tests/containers/tabnavigator/Styles/TabNavigator_Styles_SkinStates.mxml
    incubator/flex/sdk/branches/develop/mustella/tests/containers/tabnavigator/Styles/TabNavigator_Styles_SkinStates_Spark.mxml

Modified: incubator/flex/sdk/branches/develop/mustella/tests/containers/tabnavigator/SWFs/comps/button_swf_runtime.mxml
URL: http://svn.apache.org/viewvc/incubator/flex/sdk/branches/develop/mustella/tests/containers/tabnavigator/SWFs/comps/button_swf_runtime.mxml?rev=1384922&r1=1384921&r2=1384922&view=diff
==============================================================================
--- incubator/flex/sdk/branches/develop/mustella/tests/containers/tabnavigator/SWFs/comps/button_swf_runtime.mxml
(original)
+++ incubator/flex/sdk/branches/develop/mustella/tests/containers/tabnavigator/SWFs/comps/button_swf_runtime.mxml
Fri Sep 14 21:01:55 2012
@@ -17,70 +17,8 @@
   limitations under the License.
 
 -->
-<mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml" currentStateChange="currentStateChangeHandler(event)">

-    <mx:Script>
-        <![CDATA[    	     
-            import flash.events.IEventDispatcher;
-
-            private function currentStateChangeHandler(event:Event):void
-            {
-                 checkIfImageLoaded();
-            }
- 
-            private function completeHandler(event:Event):void
-            {
-                checkIfImageLoaded();
-            }
-            
-            // For the runtime SWF tests we want also want to know the image is loaded even
-            // if it has already been loaded so we can wait on an event for every test.
-            private function checkIfImageLoaded():void
-            {
-                if (!parentApplication || !parentApplication.tn || !parentApplication.tn.tabn
is IEventDispatcher)
-                    return;
-                
-                var loaded:Boolean = false;
-                
-                switch (currentState)
-                {
-                    case "over":
-                        if (overImage.bytesLoaded == overImage.bytesTotal)
-                            loaded = true;   
-                        break;
-                    case "selectedOver":
-                        if (selectedOverImage.bytesLoaded == selectedOverImage.bytesTotal)
-                            loaded = true;   
-                        break;
-                    case "down":
-                        if (downImage.bytesLoaded == downImage.bytesTotal)
-                            loaded = true;   
-                        break;
-                    case "selectedDown":
-                        if (selectedDownImage.bytesLoaded == selectedDownImage.bytesTotal)
-                            loaded = true;   
-                        break;
-                    case "up":
-                        if (baseButton.bytesLoaded == baseButton.bytesTotal)
-                            loaded = true;   
-                        break;
-                    case "selectedUp":
-                        if (selectedUpImage.bytesLoaded == selectedUpImage.bytesTotal)
-                            loaded = true;   
-                        break;
-                    default:
-                        trace("checkIfImageLoaded state not handled", "currentState", currentState);
-                }
-                
-                if (loaded)
-                {
-                    var tabn:IEventDispatcher = IEventDispatcher(parentApplication.tn.tabn);
-                    trace("dispatch", currentState + "ImageLoaded");
-                    tabn.dispatchEvent(new Event(currentState + "ImageLoaded")); 
-                }
-             }
-        ]]>   
-    </mx:Script>
-	<mx:states>
+<mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml">	
+ 	<mx:states>
 		<mx:State name="notBase">
 			<mx:RemoveChild target="{baseButton}"/>
 		</mx:State>
@@ -88,47 +26,47 @@
 		<mx:State name="over" basedOn="notBase">
 			<mx:AddChild creationPolicy="all">
 				<mx:Image id="overImage" source="../../../../Assets/Images/ButtonImages/buttonOver.swf"

-                    complete="completeHandler(event)" maintainAspectRatio="false" width="100%"
height="100%"/> 
+                          maintainAspectRatio="false" width="100%" height="100%"/> 
 			</mx:AddChild>
 		</mx:State>
 		<mx:State name="down" basedOn="notBase">
 			<mx:AddChild creationPolicy="all">
 				<mx:Image id="downImage" source="../../../../Assets/Images/ButtonImages/buttonDown.swf"

-                          complete="completeHandler(event)" maintainAspectRatio="false" width="100%"
height="100%"/> 
+                          maintainAspectRatio="false" width="100%" height="100%"/> 
 			</mx:AddChild>
 		</mx:State>
 		<mx:State name="disabled" basedOn="notBase">
 			<mx:AddChild creationPolicy="all">
 				<mx:Image id="disabledImage" source="../../../../Assets/Images/ButtonImages/buttonDisabled.swf"

-                          complete="completeHandler(event)" maintainAspectRatio="false" width="100%"
height="100%"/> 
+                          maintainAspectRatio="false" width="100%" height="100%"/> 
 			</mx:AddChild>
 		</mx:State>
 		<mx:State name="selectedUp" basedOn="notBase">
 			<mx:AddChild creationPolicy="all">
 				<mx:Image id="selectedUpImage" source="../../../../Assets/Images/ButtonImages/buttonSelectedUp.swf"

-                          complete="completeHandler(event)" maintainAspectRatio="false" width="100%"
height="100%"/> 
+                          maintainAspectRatio="false" width="100%" height="100%"/> 
 			</mx:AddChild>
 		</mx:State>
 		<mx:State name="selectedOver" basedOn="notBase">
 			<mx:AddChild creationPolicy="all">
 				<mx:Image id="selectedOverImage" source="../../../../Assets/Images/ButtonImages/buttonSelectedOver.swf"

-                          complete="completeHandler(event)" maintainAspectRatio="false" width="100%"
height="100%"/> 
+                          maintainAspectRatio="false" width="100%" height="100%"/> 
 			</mx:AddChild>
 		</mx:State>
 		<mx:State name="selectedDown" basedOn="notBase">
 			<mx:AddChild creationPolicy="all">
 				<mx:Image id="selectedDownImage" source="../../../../Assets/Images/ButtonImages/buttonSelectedDown.swf"

-                          complete="completeHandler(event)" maintainAspectRatio="false" width="100%"
height="100%"/> 
+                          maintainAspectRatio="false" width="100%" height="100%"/> 
 			</mx:AddChild>
 		</mx:State>
 		<mx:State name="selectedDisabled" basedOn="notBase">
 			<mx:AddChild creationPolicy="all">
 				<mx:Image id="selectedDisabledImage" source="../../../../Assets/Images/ButtonImages/buttonSelectedDown.swf"

-                          complete="completeHandler(event)" maintainAspectRatio="false" width="100%"
height="100%"/> 
+                          maintainAspectRatio="false" width="100%" height="100%"/> 
 			</mx:AddChild>
 		</mx:State>
 	</mx:states>
 		
 	<mx:Image id="baseButton" source="../../../../Assets/Images/ButtonImages/buttonUp.swf"

-              complete="completeHandler(event)" maintainAspectRatio="false"  width="100%"
height="100%"/>
+              maintainAspectRatio="false" width="100%" height="100%"/>
 </mx:Canvas>
\ No newline at end of file

Modified: incubator/flex/sdk/branches/develop/mustella/tests/containers/tabnavigator/Styles/TabNavigator_Styles_SkinStates.mxml
URL: http://svn.apache.org/viewvc/incubator/flex/sdk/branches/develop/mustella/tests/containers/tabnavigator/Styles/TabNavigator_Styles_SkinStates.mxml?rev=1384922&r1=1384921&r2=1384922&view=diff
==============================================================================
--- incubator/flex/sdk/branches/develop/mustella/tests/containers/tabnavigator/Styles/TabNavigator_Styles_SkinStates.mxml
(original)
+++ incubator/flex/sdk/branches/develop/mustella/tests/containers/tabnavigator/Styles/TabNavigator_Styles_SkinStates.mxml
Fri Sep 14 21:01:55 2012
@@ -413,9 +413,9 @@
             <setup>
                 <ResetComponent target="tn" className="TNComp"  waitEvent="updateComplete"
waitTarget="tn"/>
                 <SetStyle target="tn.tabn" styleName="tabStyleName" value="myTabNavigatorSWFRunTime"
waitEvent="updateComplete" waitTarget="tn.tabn" /> 
-                <DispatchMouseEvent type="rollOver" localX="10" localY="10" target="tn.tabn"
waitEvent="selectedOverImageLoaded" waitTarget="tn.tabn" /> 
+                <DispatchMouseEvent type="rollOver" localX="10" localY="10" target="tn.tabn"
waitEvent="rollOver" waitTarget="tn.tabn" /> 
+                <WaitForEvent eventName="complete" target="tn.tabn.rawChildren.getChildAt(2).getChildAt(0).getChildAt(0).selectedOverImage"
/>                
                 <WaitForEffectsToEnd />
-                <WaitForLayoutManager />
             </setup>
             <body>
                 <CompareBitmap target="tn.tabn" url="../Styles/baselines/TabNavigator_Styles_SkinStates_runtime_SWF_mouseOver_selectedTab.png"
timeout="5000" />
@@ -425,9 +425,9 @@
             <setup>
                 <ResetComponent target="tn" className="TNComp"  waitEvent="updateComplete"
waitTarget="tn"/>
                 <SetStyle target="tn.tabn" styleName="tabStyleName" value="myTabNavigatorSWFRunTime"
waitEvent="updateComplete" waitTarget="tn.tabn" /> 
-                <DispatchMouseEvent type="rollOver" localX="109" localY="10" target="tn.tabn"
waitEvent="overImageLoaded" waitTarget="tn.tabn" /> 
+                <DispatchMouseEvent type="rollOver" localX="109" localY="10" target="tn.tabn"
waitEvent="rollOver" waitTarget="tn.tabn" /> 
+                <WaitForEvent eventName="complete" target="tn.tabn.rawChildren.getChildAt(2).getChildAt(1).getChildAt(0).overImage"
/>                
                 <WaitForEffectsToEnd />
-                <WaitForLayoutManager />
             </setup>
             <body>
                 <CompareBitmap target="tn.tabn" url="../Styles/baselines/TabNavigator_Styles_SkinStates_runtime_SWF_mouseOver_NonselectedTab.png"
timeout="5000" />
@@ -439,9 +439,9 @@
                 <ResetComponent target="tn" className="TNComp"  waitEvent="updateComplete"
waitTarget="tn"/>
                 <SetStyle target="tn.tabn" styleName="tabStyleName" value="myTabNavigatorSWFRunTime"
waitEvent="updateComplete" waitTarget="tn.tabn" /> 
                 <DispatchMouseEvent type="rollOver" localX="10" localY="10" target="tn.tabn"
waitEvent="rollOver" waitTarget="tn.tabn" /> 
-                <DispatchMouseEvent type="mouseDown" localX="10" localY="10" target="tn.tabn"
waitEvent="selectedUpImageLoaded" waitTarget="tn.tabn" /> 
+                <DispatchMouseEvent type="mouseDown" localX="10" localY="10" target="tn.tabn"
waitEvent="mouseDown" waitTarget="tn.tabn" /> 
+                <WaitForEvent eventName="complete" target="tn.tabn.rawChildren.getChildAt(2).getChildAt(0).getChildAt(0).selectedUpImage"
/>                
                 <WaitForEffectsToEnd />
-                <WaitForLayoutManager />
             </setup>
             <body>
                 <CompareBitmap target="tn.tabn" url="../Styles/baselines/TabNavigator_Styles_SkinStates_runtime_SWF_mouseDown_selectedTab.png"
timeout="5000" />
@@ -453,9 +453,9 @@
                 <ResetComponent target="tn" className="TNComp"  waitEvent="updateComplete"
waitTarget="tn"/>
                 <SetStyle target="tn.tabn" styleName="tabStyleName" value="myTabNavigatorSWFRunTime"
waitEvent="updateComplete" waitTarget="tn.tabn" /> 
                 <DispatchMouseEvent type="rollOver" localX="109" localY="10" target="tn.tabn"
waitEvent="rollOver" waitTarget="tn.tabn" /> 
-                <DispatchMouseEvent type="mouseDown" localX="109" localY="10" target="tn.tabn"
waitEvent="selectedUpImageLoaded" waitTarget="tn.tabn" /> 
+                <DispatchMouseEvent type="mouseDown" localX="109" localY="10" target="tn.tabn"
waitEvent="mouseDown" waitTarget="tn.tabn" /> 
+                <WaitForEvent eventName="complete" target="tn.tabn.rawChildren.getChildAt(2).getChildAt(1).getChildAt(0).selectedUpImage"
/>                
                 <WaitForEffectsToEnd />
-                <WaitForLayoutManager />
             </setup>
             <body>
                 <CompareBitmap target="tn.tabn" url="../Styles/baselines/TabNavigator_Styles_SkinStates_runtime_SWF_mouseDown_NonselectedTab.png"
timeout="5000" />

Modified: incubator/flex/sdk/branches/develop/mustella/tests/containers/tabnavigator/Styles/TabNavigator_Styles_SkinStates_Spark.mxml
URL: http://svn.apache.org/viewvc/incubator/flex/sdk/branches/develop/mustella/tests/containers/tabnavigator/Styles/TabNavigator_Styles_SkinStates_Spark.mxml?rev=1384922&r1=1384921&r2=1384922&view=diff
==============================================================================
--- incubator/flex/sdk/branches/develop/mustella/tests/containers/tabnavigator/Styles/TabNavigator_Styles_SkinStates_Spark.mxml
(original)
+++ incubator/flex/sdk/branches/develop/mustella/tests/containers/tabnavigator/Styles/TabNavigator_Styles_SkinStates_Spark.mxml
Fri Sep 14 21:01:55 2012
@@ -41,6 +41,17 @@
     import mx.controls.*;
     import mx.styles.StyleManager;
     import mx.managers.SystemManager;
+      
+     // the tabBar is
+     //     application.tn.tabn.rawChildren.getChildAt(2)
+     // the first tab is
+     //     application.tn.tabn.rawChildren.getChildAt(2).getChildAt(0)
+     // the skin the first tab is 
+     //     application.tn.tabn.rawChildren.getChildAt(2).getChildAt(0).getChildAt(0)
+     // and, for example, the selectedOverImage for the first tab is
+     //     application.tn.tabn.rawChildren.getChildAt(2).getChildAt(0).getChildAt(0).selectedOverImage
+     // the second tab is
+     //     application.tn.tabn.rawChildren.getChildAt(2).getChildAt(1)
     ]]>
     
     </mx:Script>
@@ -412,11 +423,11 @@
         <TestCase testID="TabNavigator_Styles_SkinStates_runtime_SWF_mouseOver_selectedTab"
keywords="[enabled, SkinStates,runtimeSWF, TabNavigator]" >
             <setup>
                 <ResetComponent target="tn" className="TNComp"  waitEvent="updateComplete"
waitTarget="tn"/>
-                <SetStyle target="tn.tabn" styleName="tabStyleName" value="myTabNavigatorSWFRunTime"
waitEvent="updateComplete" waitTarget="tn.tabn" /> 
-                <DispatchMouseEvent type="rollOver" localX="10" localY="10" target="tn.tabn"
waitEvent="selectedOverImageLoaded" waitTarget="tn.tabn" /> 
+                <SetStyle target="tn.tabn" styleName="tabStyleName" value="myTabNavigatorSWFRunTime"
waitEvent="updateComplete" waitTarget="tn.tabn" />
+                <DispatchMouseEvent type="rollOver" localX="10" localY="10" target="tn.tabn"
waitEvent="rollOver"/>
+                <WaitForEvent eventName="complete" target="tn.tabn.rawChildren.getChildAt(2).getChildAt(0).getChildAt(0).selectedOverImage"
/> 
                 <WaitForEffectsToEnd />
-                <WaitForLayoutManager/>
-            </setup>
+             </setup>
             <body>
                 <CompareBitmap target="tn.tabn" url="../Styles/baselines/spark/TabNavigator_Styles_SkinStates_runtime_SWF_mouseOver_selectedTab.png"
timeout="5000" />
             </body>
@@ -425,9 +436,9 @@
             <setup>
                 <ResetComponent target="tn" className="TNComp"  waitEvent="updateComplete"
waitTarget="tn"/>
                 <SetStyle target="tn.tabn" styleName="tabStyleName" value="myTabNavigatorSWFRunTime"
waitEvent="updateComplete" waitTarget="tn.tabn" /> 
-                <DispatchMouseEvent type="rollOver" localX="109" localY="10" target="tn.tabn"
waitEvent="overImageLoaded" waitTarget="tn.tabn" /> 
+                <DispatchMouseEvent type="rollOver" localX="109" localY="10" target="tn.tabn"
waitEvent="rollOver"/>
+                <WaitForEvent eventName="complete" target="tn.tabn.rawChildren.getChildAt(2).getChildAt(1).getChildAt(0).overImage"
/> 
                 <WaitForEffectsToEnd />
-                <WaitForLayoutManager/>
             </setup>
             <body>
                 <CompareBitmap target="tn.tabn" url="../Styles/baselines/spark/TabNavigator_Styles_SkinStates_runtime_SWF_mouseOver_NonselectedTab.png"
timeout="5000" />
@@ -439,9 +450,9 @@
                 <ResetComponent target="tn" className="TNComp"  waitEvent="updateComplete"
waitTarget="tn"/>
                 <SetStyle target="tn.tabn" styleName="tabStyleName" value="myTabNavigatorSWFRunTime"
waitEvent="updateComplete" waitTarget="tn.tabn" /> 
                 <DispatchMouseEvent type="rollOver" localX="10" localY="10" target="tn.tabn"
waitEvent="rollOver" waitTarget="tn.tabn" /> 
-                <DispatchMouseEvent type="mouseDown" localX="10" localY="10" target="tn.tabn"
waitEvent="selectedUpImageLoaded" waitTarget="tn.tabn" /> 
+                <DispatchMouseEvent type="mouseDown" localX="10" localY="10" target="tn.tabn"
waitEvent="mouseDown"/>
+                <WaitForEvent eventName="complete" target="tn.tabn.rawChildren.getChildAt(2).getChildAt(0).getChildAt(0).selectedUpImage"
/> 
                 <WaitForEffectsToEnd />
-                <WaitForLayoutManager/>
             </setup>
             <body>
                 <CompareBitmap target="tn.tabn" url="../Styles/baselines/spark/TabNavigator_Styles_SkinStates_runtime_SWF_mouseDown_selectedTab.png"
timeout="5000" />
@@ -453,9 +464,9 @@
                 <ResetComponent target="tn" className="TNComp"  waitEvent="updateComplete"
waitTarget="tn"/>
                 <SetStyle target="tn.tabn" styleName="tabStyleName" value="myTabNavigatorSWFRunTime"
waitEvent="updateComplete" waitTarget="tn.tabn" /> 
                 <DispatchMouseEvent type="rollOver" localX="109" localY="10" target="tn.tabn"
waitEvent="rollOver" waitTarget="tn.tabn" /> 
-                <DispatchMouseEvent type="mouseDown" localX="109" localY="10" target="tn.tabn"
waitEvent="selectedUpImageLoaded" waitTarget="tn.tabn" /> 
-               <WaitForEffectsToEnd />
-                <WaitForLayoutManager/>
+                <DispatchMouseEvent type="mouseDown" localX="109" localY="10" target="tn.tabn"
waitEvent="mouseDown"/>
+                <WaitForEvent eventName="complete" target="tn.tabn.rawChildren.getChildAt(2).getChildAt(1).getChildAt(0).selectedUpImage"
/> 
+                <WaitForEffectsToEnd />
             </setup>
             <body>
                 <CompareBitmap target="tn.tabn" url="../Styles/baselines/spark/TabNavigator_Styles_SkinStates_runtime_SWF_mouseDown_NonselectedTab.png"
timeout="5000" />



Mime
View raw message