You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by ah...@apache.org on 2012/09/24 21:45:51 UTC

svn commit: r1389537 - in /incubator/flex/sdk/branches/develop/mustella/as3/src/mustella: SendResultsToRunner.as UnitTester.as

Author: aharui
Date: Mon Sep 24 19:45:50 2012
New Revision: 1389537

URL: http://svn.apache.org/viewvc?rev=1389537&view=rev
Log:
Try to fix logging of reports.  I think the player could exit before the URLLoader sent requests to the runner/server

Modified:
    incubator/flex/sdk/branches/develop/mustella/as3/src/mustella/SendResultsToRunner.as
    incubator/flex/sdk/branches/develop/mustella/as3/src/mustella/UnitTester.as

Modified: incubator/flex/sdk/branches/develop/mustella/as3/src/mustella/SendResultsToRunner.as
URL: http://svn.apache.org/viewvc/incubator/flex/sdk/branches/develop/mustella/as3/src/mustella/SendResultsToRunner.as?rev=1389537&r1=1389536&r2=1389537&view=diff
==============================================================================
--- incubator/flex/sdk/branches/develop/mustella/as3/src/mustella/SendResultsToRunner.as (original)
+++ incubator/flex/sdk/branches/develop/mustella/as3/src/mustella/SendResultsToRunner.as Mon Sep 24 19:45:50 2012
@@ -136,6 +136,7 @@ public class SendResultsToRunner 
 			sock.flush();
 			*/
 		
+			u.addEventListener("complete", completeHandler);
 			u.addEventListener("complete", httpEvents);
 			u.addEventListener("ioError", httpEvents);
 			u.addEventListener("open", httpEvents);
@@ -143,12 +144,16 @@ public class SendResultsToRunner 
 			u.addEventListener("httpStatus", httpEvents);
 			u.addEventListener("securityError", httpEvents);
 			u.load (new URLRequest (baseURL + midURL + final));
+			UnitTester.pendingOutput++;
 		}
 
 		
 
 	}
 
+	public static function completeHandler (e:Event):void  {
+		UnitTester.pendingOutput--;
+	}
 
 	public static function httpEvents (e:Event):void  {
 		trace (e);

Modified: incubator/flex/sdk/branches/develop/mustella/as3/src/mustella/UnitTester.as
URL: http://svn.apache.org/viewvc/incubator/flex/sdk/branches/develop/mustella/as3/src/mustella/UnitTester.as?rev=1389537&r1=1389536&r2=1389537&view=diff
==============================================================================
--- incubator/flex/sdk/branches/develop/mustella/as3/src/mustella/UnitTester.as (original)
+++ incubator/flex/sdk/branches/develop/mustella/as3/src/mustella/UnitTester.as Mon Sep 24 19:45:50 2012
@@ -1207,9 +1207,22 @@ public class UnitTester extends EventDis
 
 		if (exitWhenDone) 
 		{
-			setTimeout(exit, UnitTester.coverageTimeout);
+			callback = waitForOutput;
 		}
 	}
+	
+	public static var pendingOutput:int = 0;
+	
+	private static function waitForOutput(event:Event):void
+	{
+		if (pendingOutput > 0)
+		{
+			trace("waiting on pending output", pendingOutput);
+			callback = waitForOutput;
+		}
+		else
+			setTimeout(exit, UnitTester.coverageTimeout);
+	}
 
 	private static var frameCounter:int = 0;