incubator-flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From p...@apache.org
Subject svn commit: r1406841 - in /incubator/flex/sdk/branches/develop/mustella/java/src: mustella/CompileMustellaSwfs.java mustella/GetDeviceSpecsTask.java mustella/MobileConfigWriter.java utils/MobileUtil.java
Date Wed, 07 Nov 2012 22:06:58 GMT
Author: pent
Date: Wed Nov  7 22:06:58 2012
New Revision: 1406841

URL: http://svn.apache.org/viewvc?rev=1406841&view=rev
Log:
Modifications made to support testing on mobile platform, mainly for use through the desktop
emulator. Added a new property to ConditionalValue, targetOS, to allow tests to be run on
the emulator OS yet target a mobile OS such as 'android' or 'ios'. There will probably be
refinement of this process, but allows the desktop emulator to generate images for a specific
mobile OS at different ppi values.

Modified:
    incubator/flex/sdk/branches/develop/mustella/java/src/mustella/CompileMustellaSwfs.java
    incubator/flex/sdk/branches/develop/mustella/java/src/mustella/GetDeviceSpecsTask.java
    incubator/flex/sdk/branches/develop/mustella/java/src/mustella/MobileConfigWriter.java
    incubator/flex/sdk/branches/develop/mustella/java/src/utils/MobileUtil.java

Modified: incubator/flex/sdk/branches/develop/mustella/java/src/mustella/CompileMustellaSwfs.java
URL: http://svn.apache.org/viewvc/incubator/flex/sdk/branches/develop/mustella/java/src/mustella/CompileMustellaSwfs.java?rev=1406841&r1=1406840&r2=1406841&view=diff
==============================================================================
--- incubator/flex/sdk/branches/develop/mustella/java/src/mustella/CompileMustellaSwfs.java
(original)
+++ incubator/flex/sdk/branches/develop/mustella/java/src/mustella/CompileMustellaSwfs.java
Wed Nov  7 22:06:58 2012
@@ -964,6 +964,9 @@ public class CompileMustellaSwfs extends
 		
 		// System.out.println ("Adding qa fwk dir: " + mustella_framework_dir);
 		
+		// Now add the rest.
+		args+= " -source-path="+mustella_framework_dir;	
+		
 		// If we're using android or iOS, use the CompareBitmap which handles file I/O. MXMLC will
 		// keep whichever CompareBitmap it encounters first.
 		if( target_os_name.equalsIgnoreCase( MobileUtil.ANDROID_OS ) ||
@@ -972,10 +975,7 @@ public class CompileMustellaSwfs extends
 		{
 			//System.out.println("AIR files will override.");
 			args+= " -source-path="+mustella_framework_dir+File.separator+"AIR";
-		}
-		
-		// Now add the rest.
-		args+= " -source-path="+mustella_framework_dir;		
+		}	
 	}
 
 	/// this is the include for the fwk to send stuff to the Runner

Modified: incubator/flex/sdk/branches/develop/mustella/java/src/mustella/GetDeviceSpecsTask.java
URL: http://svn.apache.org/viewvc/incubator/flex/sdk/branches/develop/mustella/java/src/mustella/GetDeviceSpecsTask.java?rev=1406841&r1=1406840&r2=1406841&view=diff
==============================================================================
--- incubator/flex/sdk/branches/develop/mustella/java/src/mustella/GetDeviceSpecsTask.java
(original)
+++ incubator/flex/sdk/branches/develop/mustella/java/src/mustella/GetDeviceSpecsTask.java
Wed Nov  7 22:06:58 2012
@@ -213,7 +213,12 @@ public class GetDeviceSpecsTask extends 
 				project.setProperty( "os", os );
 				project.setProperty( "exclude_filename", mustellaDir + File.separator + "tests" + File.separator
+ "ExcludeList" + os + ".txt");				
 			}else{
-				System.out.println("Skipping mobile device setup; " + deviceName + " is not a supported
mobile device.  Maybe this is a 'mobile on desktop' run or a new device.");
+				String targetOS = project.getProperty("target_os_name");
+				if( targetOS != null ) {
+					System.out.println("Skipping mobile device setup; "+deviceName+" is not a mobile device,
maybe emulating target OS "+targetOS+" on desktop.");
+				} else {
+					System.out.println("Skipping mobile device setup; " + deviceName + " is not a supported
mobile device.  Maybe this is a 'mobile on desktop' run or a new device.");
+				}
 			}
 		}catch(Exception e){
 			e.printStackTrace();

Modified: incubator/flex/sdk/branches/develop/mustella/java/src/mustella/MobileConfigWriter.java
URL: http://svn.apache.org/viewvc/incubator/flex/sdk/branches/develop/mustella/java/src/mustella/MobileConfigWriter.java?rev=1406841&r1=1406840&r2=1406841&view=diff
==============================================================================
--- incubator/flex/sdk/branches/develop/mustella/java/src/mustella/MobileConfigWriter.java
(original)
+++ incubator/flex/sdk/branches/develop/mustella/java/src/mustella/MobileConfigWriter.java
Wed Nov  7 22:06:58 2012
@@ -156,18 +156,34 @@ public class MobileConfigWriter {
 				// ConditionalValue stuff
 				ret += "		if( UnitTester.cv == null ){\n";
 				ret += "			UnitTester.cv = new ConditionalValue();\n";
-				ret += "		}";
+				ret += "		}\n";
 				ret += "		UnitTester.cv.device = \"" + device_name + "\";\n";
 				ret += "		UnitTester.cv.os = \"" + target_os + "\";\n";
+				ret += "		UnitTester.cv.targetOS = \"" + target_os + "\";\n";
 				ret += "		UnitTester.cv.osVersion = \"" + os_version + "\";\n";
+				
 				// If device, get the proper dpi bucket (160/240/320) for the device.
 				if( (target_os.compareToIgnoreCase(MobileUtil.MAC) == 0) || (target_os.compareToIgnoreCase(MobileUtil.WIN)
== 0) ){
 					if( adl_extras_XscreenDPI == -1 ){
-					ret += "		UnitTester.cv.deviceDensity = flash.system.Capabilities.screenDPI;\n";
-				}else{
+						ret += "		UnitTester.cv.deviceDensity = flash.system.Capabilities.screenDPI;\n";
+					}else{
 						ret += "		UnitTester.cv.deviceDensity = Util.roundDeviceDensity( flash.system.Capabilities.screenDPI
);\n";
 					}
-				}else{
+				}
+				// if the target OS is android or iOS, the device_name might not be a real device but
mac or win, indicating a desktop
+				// emulator. If that's the case, treat this the same as above. 
+				else if((target_os.compareToIgnoreCase(MobileUtil.ANDROID) == 0) || (target_os.compareToIgnoreCase(MobileUtil.IOS)
== 0)) {
+					if( (device_name.compareToIgnoreCase(MobileUtil.MAC) == 0 ) || (device_name.compareToIgnoreCase(MobileUtil.WIN2)
== 0) ) {
+						if( adl_extras_XscreenDPI == -1 ){
+							ret += "		UnitTester.cv.deviceDensity = flash.system.Capabilities.screenDPI;\n";
+						}else{
+							ret += "		UnitTester.cv.deviceDensity = Util.roundDeviceDensity( flash.system.Capabilities.screenDPI
);\n";
+						}
+					} else {
+						ret += "		UnitTester.cv.deviceDensity = " + Integer.toString(MobileUtil.getDeviceDensity(device_name))
+ ";\n";
+					}
+				}
+				else{
 					ret += "		UnitTester.cv.deviceDensity = " + Integer.toString(MobileUtil.getDeviceDensity(device_name))
+ ";\n";
 				}
 

Modified: incubator/flex/sdk/branches/develop/mustella/java/src/utils/MobileUtil.java
URL: http://svn.apache.org/viewvc/incubator/flex/sdk/branches/develop/mustella/java/src/utils/MobileUtil.java?rev=1406841&r1=1406840&r2=1406841&view=diff
==============================================================================
--- incubator/flex/sdk/branches/develop/mustella/java/src/utils/MobileUtil.java (original)
+++ incubator/flex/sdk/branches/develop/mustella/java/src/utils/MobileUtil.java Wed Nov  7
22:06:58 2012
@@ -31,7 +31,7 @@ public class MobileUtil {
 
 	// OSs
 	public static final String ANDROID_OS = "android";
-	public static final String IOS = "iphone";	// "iPhone OS" is what the iPod Touch 4G returns,
anyway.
+	public static final String IOS = "ios";	// "iPhone OS" is what the iPod Touch 4G returns,
anyway.
 	public static final String QNX = "qnx";
 	public static final String MAC = "mac";
 	public static final String WIN = "windows";
@@ -54,19 +54,22 @@ public class MobileUtil {
 	public static final String SDCARD_DIR = "/sdcard/mustella";
 	public static final String IPAD = "iPad";
 	public static final String IPAD2 = "iPad2";
+	public static final String IPAD3 = "iPad3";
+	public static final String IPAD4 = "iPad4";
 	public static final String IPOD_TOUCH_3GS = "iPodTouch3GS";
 	public static final String IPOD_TOUCH_4G = "iPodTouch4G";
+	public static final String IPOD_TOUCH_5G = "iPodTouch5G";
 	public static final String ANDROID_TABLET = "androidTablet"; // not used anywhere yet, not
sure if this is a good name.
 
 
 	// Useful collections
     public static final String[] DEVICES_USING_ANDROID = {ANDROID, ANDROID2, DESIRE, DROID,
DROID_2, DROID_X, DROID_PRO, NEXUS_ONE, EVO, INCREDIBLE, ANDROID_TABLET, XOOM};
-	public static final String[] DEVICES_USING_IOS = {IPAD, IPAD2, IPOD_TOUCH_3GS, IPOD_TOUCH_4G};
+	public static final String[] DEVICES_USING_IOS = {IPAD, IPAD2, IPOD_TOUCH_3GS, IPOD_TOUCH_4G,
IPOD_TOUCH_5G};
 	public static final String[] DEVICES_USING_QNX = {PLAYBOOK};
     public static final String[] DEVICES_USING_SDCARD = {ANDROID, ANDROID2, DESIRE, DROID,
DROID_2, DROID_X, DROID_PRO, NEXUS_ONE, EVO, INCREDIBLE, ANDROID_TABLET, XOOM};
     public static final String[] DEVICES_AROUND_160PPI = {DROID_PRO, ANDROID_TABLET, XOOM,
IPOD_TOUCH_3GS, IPAD, IPAD2, PLAYBOOK};
 	public static final String[] DEVICES_AROUND_240PPI = {ANDROID, ANDROID2, DESIRE, DROID,
DROID_2, DROID_X, NEXUS_ONE, EVO, INCREDIBLE};
-	public static final String[] DEVICES_AROUND_320PPI = {IPOD_TOUCH_4G};
+	public static final String[] DEVICES_AROUND_320PPI = {IPOD_TOUCH_4G, IPOD_TOUCH_5G, IPAD3,
IPAD4};
 
 	// Other
 	public static final String MOBILE_FRAMEWORK_DIR = "MobileConfig";



Mime
View raw message