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/10/07 07:09:22 UTC

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

Author: aharui
Date: Sun Oct  7 05:09:22 2012
New Revision: 1395212

URL: http://svn.apache.org/viewvc?rev=1395212&view=rev
Log:
Try a singleton URLLoader to see if it reduces mid-test timeouts.

Modified:
    incubator/flex/sdk/branches/develop/mustella/as3/src/mustella/SendResultsToRunner.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=1395212&r1=1395211&r2=1395212&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 Sun Oct  7 05:09:22 2012
@@ -49,7 +49,7 @@ public class SendResultsToRunner 
 
 	public static var regExp5:RegExp = /%3D/g;
 
-
+	public static var u:URLLoader;
 
 	/**
   	 * the way out for the result data
@@ -128,7 +128,19 @@ public class SendResultsToRunner 
 		if (!noSend) { 
 			trace ("sending: " + baseURL + midURL + final + " at: " + new Date());
 			// var u:String= baseURL + midURL + final;
-			var u:URLLoader = new URLLoader (new URLRequest (baseURL + midURL + final));
+			if (u == null)
+			{
+				u = new URLLoader();
+				u.addEventListener("complete", completeHandler);
+				u.addEventListener("complete", httpEvents);
+				u.addEventListener("ioError", httpEvents);
+				u.addEventListener("open", httpEvents);
+				u.addEventListener("progress", httpEvents);
+				u.addEventListener("httpStatus", httpEvents);
+				u.addEventListener("securityError", httpEvents);
+			}
+			UnitTester.pendingOutput++;
+			u.load (new URLRequest (baseURL + midURL + final));
 
 			/*	
 			var sock:Socket = new Socket ("localhost",  UnitTester.runnerPort);
@@ -137,28 +149,14 @@ public class SendResultsToRunner 
 			sock.flush();
 			*/
 		
-			u.addEventListener("complete", completeHandler);
-			u.addEventListener("complete", httpEvents);
-			u.addEventListener("ioError", httpEvents);
-			u.addEventListener("open", httpEvents);
-			u.addEventListener("progress", httpEvents);
-			u.addEventListener("httpStatus", httpEvents);
-			u.addEventListener("securityError", httpEvents);
-			u.load (new URLRequest (baseURL + midURL + final));
-			UnitTester.pendingOutput++;
-			dict[u] = baseURL + midURL + final;
 		}
 
 		
 
 	}
 	
-	public static var dict:Dictionary = new Dictionary();
-
 	public static function completeHandler (e:Event):void  {
 		UnitTester.pendingOutput--;
-		//trace("received complete for", dict[e.target]);
-		delete dict[e.target];
 	}
 
 	public static function httpEvents (e:Event):void  {