Back out f151cccff911, 2c463faae83f, d7a8aefd3e8a (bug 719697, 713970, 720614) because of build bustage.
authorMatt Brubeck <mbrubeck@mozilla.com>
Thu, 26 Jan 2012 11:41:29 -0800
changeset 86742 547cea3b54fdcc10164e1333743ae7c56516e719
parent 86741 863a1db98fbe52af7e862755f3b75dd1245b4ef7
child 86743 ff7d18fbe8c8642a6ebd163e5c51d62946c25988
push id805
push userakeybl@mozilla.com
push dateWed, 01 Feb 2012 18:17:35 +0000
treeherdermozilla-aurora@6fb3bf232436 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs719697, 713970, 720614
milestone12.0a1
backs outf151cccff911b8a690e6497a3aaa8d8a46d282a9
Back out f151cccff911, 2c463faae83f, d7a8aefd3e8a (bug 719697, 713970, 720614) because of build bustage.
build/mobile/devicemanager.py
build/mobile/robocop/Makefile.in
configure.in
testing/testsuite-targets.mk
toolkit/mozapps/installer/packager.mk
--- a/build/mobile/devicemanager.py
+++ b/build/mobile/devicemanager.py
@@ -61,20 +61,20 @@ class DMError(Exception):
   def __str__(self):
     return self.msg
 
 
 def abstractmethod(method):
   line = method.func_code.co_firstlineno
   filename = method.func_code.co_filename
   def not_implemented(*args, **kwargs):
-    raise NotImplementedError('Abstract method %s at File "%s", line %s '
-                              'should be implemented by a concrete class' %
+    raise NotImplementedError('Abstract method %s at File "%s", line %s \
+                              should be implemented by a concrete class' %
                               (repr(method), filename,line))
-  return not_implemented
+    return not_implemented
   
 class DeviceManager:
   
   @abstractmethod
   def pushFile(self, localname, destname):
     """
     external function
     returns:
@@ -231,24 +231,24 @@ class DeviceManager:
     #ex: '"name=value;name2=value2;etc=..." process args' -> 'process args'
     parts = appname.split('"')
     if (len(parts) > 2):
       appname = ' '.join(parts[2:]).strip()
   
     pieces = appname.split(' ')
     parts = pieces[0].split('/')
     app = parts[-1]
+    procre = re.compile('.*' + app + '.*')
 
     procList = self.getProcessList()
     if (procList == []):
       return None
       
     for proc in procList:
-      procName = proc[1].split('/')[-1]
-      if (procName == app):
+      if (procre.match(proc[1])):
         pid = proc[0]
         break
     return pid
 
 
   @abstractmethod
   def killProcess(self, appname):
     """
@@ -352,49 +352,68 @@ class DeviceManager:
       if not data:
         break
       mdsum.update(data)
 
     file.close()
     hexval = mdsum.hexdigest()
     if (self.debug >= 3): print "local hash returned: '" + hexval + "'"
     return hexval
-
+  
   @abstractmethod
   def getDeviceRoot(self):
     """
     Gets the device root for the testing area on the device
     For all devices we will use / type slashes and depend on the device-agent
     to sort those out.  The agent will return us the device location where we
     should store things, we will then create our /tests structure relative to
     that returned path.
     Structure on the device is as follows:
     /tests
           /<fennec>|<firefox>  --> approot
           /profile
           /xpcshell
           /reftest
           /mochitest
-    external
+    external 
     returns:
     success: path for device root
     failure: None
     """
-
-  @abstractmethod
+  
   def getAppRoot(self):
     """
     Either we will have /tests/fennec or /tests/firefox but we will never have
     both.  Return the one that exists
     TODO: ensure we can support org.mozilla.firefox
     external function
     returns:
     success: path for app root
     failure: None
     """
+    
+    devroot = self.getDeviceRoot()
+    if (devroot == None):
+      return None
+
+    if (self.dirExists(devroot + '/fennec')):
+      return devroot + '/fennec'
+    elif (self.dirExists(devroot + '/firefox')):
+      return devroot + '/firefox'
+    elif (self.dirExsts('/data/data/org.mozilla.fennec')):
+      return 'org.mozilla.fennec'
+    elif (self.dirExists('/data/data/org.mozilla.firefox')):
+      return 'org.mozilla.firefox'
+    elif (self.dirExists('/data/data/org.mozilla.fennec_aurora')):
+      return 'org.mozilla.fennec_aurora'
+    elif (self.dirExists('/data/data/org.mozilla.firefox_beta')):
+      return 'org.mozilla.firefox_beta'
+
+    # Failure (either not installed or not a recognized platform)
+    return None
 
   def getTestRoot(self, type):
     """
     Gets the directory location on the device for a specific test type
     Type is one of: xpcshell|reftest|mochitest
     external function
     returns:
     success: path for test root
@@ -490,17 +509,17 @@ class DeviceManager:
   @abstractmethod
   def installApp(self, appBundlePath, destPath=None):
     """
     external function
     returns:
     success: output from agent for inst command
     failure: None
     """
-
+    
   @abstractmethod
   def uninstallAppAndReboot(self, appName, installPath=None):
     """
     external function
     returns:
     success: True
     failure: None
     """
@@ -518,17 +537,17 @@ class DeviceManager:
   @abstractmethod
   def getCurrentTime(self):
     """
     external function
     returns:
     success: time in ms
     failure: None
     """
-    
+
 class NetworkTools:
   def __init__(self):
     pass
 
   # Utilities to get the local ip address
   def getInterfaceIp(self, ifname):
     if os.name != "nt":
       import fcntl
@@ -538,20 +557,17 @@ class NetworkTools:
                               s.fileno(),
                               0x8915,  # SIOCGIFADDR
                               struct.pack('256s', ifname[:15])
                               )[20:24])
     else:
       return None
 
   def getLanIp(self):
-    try:
-      ip = socket.gethostbyname(socket.gethostname())
-    except socket.gaierror:
-      ip = socket.gethostbyname(socket.gethostname() + ".local") # for Mac OS X
+    ip = socket.gethostbyname(socket.gethostname())
     if ip.startswith("127.") and os.name != "nt":
       interfaces = ["eth0","eth1","eth2","wlan0","wlan1","wifi0","ath0","ath1","ppp0"]
       for ifname in interfaces:
         try:
           ip = self.getInterfaceIp(ifname)
           break;
         except IOError:
           pass
--- a/build/mobile/robocop/Makefile.in
+++ b/build/mobile/robocop/Makefile.in
@@ -125,15 +125,20 @@ classes.dex: $(_JAVA_TESTS)
 	$(NSINSTALL) -D classes
 	$(JAVAC) $(JAVAC_FLAGS) -d classes $(JAVAFILES) $(_JAVA_HARNESS) $(addprefix $(DEPTH)/mobile/android/base/tests/,$(_JAVA_TESTS))
 	$(DX) --dex --output=$@ classes $(ROBOTIUM_PATH)
 
 robocop.ap_: AndroidManifest.xml
 	$(AAPT) package -f -M AndroidManifest.xml -I $(ANDROID_SDK)/android.jar -I . -S res -F $@ -J ./
 
 robocop.apk: robocop.ap_ classes.dex
+	$(APKBUILDER) robocop-raw.apk -v $(APKBUILDER_FLAGS) -z robocop.ap_ -f classes.dex
+ifdef JARSIGNER
+	$(JARSIGNER) robocop-raw.apk
+endif
+	$(ZIPALIGN) -f -v 4 robocop-raw.apk $@
 	cp $(TESTPATH)/robocop.ini robocop.ini
 	cp $(srcdir)/parse_ids.py parse_ids.py
 
 export::
 	$(NSINSTALL) -D res
 	@(cd $(srcdir)/res && tar $(TAR_CREATE_FLAGS) - *) | (cd $(DEPTH)/build/mobile/robocop/res && tar -xf -)
 
--- a/configure.in
+++ b/configure.in
@@ -4628,17 +4628,17 @@ MOZ_DISABLE_DOMCRYPTO=
 NSS_DISABLE_DBM=
 NECKO_WIFI=1
 NECKO_COOKIES=1
 NECKO_PROTOCOLS_DEFAULT="about data file ftp http res viewsource websocket wyciwyg device"
 USE_ARM_KUSER=
 BUILD_CTYPES=1
 MOZ_USE_NATIVE_POPUP_WINDOWS=
 MOZ_ANDROID_HISTORY=
-MOZ_WEBSMS_BACKEND=
+MOZ_WEBSMS_BACKEND=1
 MOZ_GRAPHITE=1
 
 case "${target}" in
 *darwin*)
     ACCESSIBILITY=
     ;;
 *)
     ACCESSIBILITY=1
--- a/testing/testsuite-targets.mk
+++ b/testing/testsuite-targets.mk
@@ -289,16 +289,17 @@ robotium-id-map:
 ifeq ($(MOZ_BUILD_APP),mobile/android)
 	$(PYTHON) $(DEPTH)/build/mobile/robocop/parse_ids.py -i $(DEPTH)/mobile/android/base/R.java -o $(DEPTH)/build/mobile/robocop/fennec_ids.txt
 endif
 
 stage-mochitest: robotium-id-map
 stage-mochitest: make-stage-dir
 	$(MAKE) -C $(DEPTH)/testing/mochitest stage-package
 ifeq ($(MOZ_BUILD_APP),mobile/android)
+	$(NSINSTALL) $(DEPTH)/build/mobile/robocop/robocop.apk $(PKG_STAGE)/bin
 	$(NSINSTALL) $(DEPTH)/build/mobile/robocop/fennec_ids.txt $(PKG_STAGE)/mochitest
 endif
 
 stage-reftest: make-stage-dir
 	$(MAKE) -C $(DEPTH)/layout/tools/reftest stage-package
 
 stage-xpcshell: make-stage-dir
 	$(MAKE) -C $(DEPTH)/testing/xpcshell stage-package
--- a/toolkit/mozapps/installer/packager.mk
+++ b/toolkit/mozapps/installer/packager.mk
@@ -330,26 +330,16 @@ endif
 endif
 
 ifneq (,$(filter mobile/xul b2g,$(MOZ_BUILD_APP)))
 GECKO_APP_AP_PATH = $(call core_abspath,$(DEPTH)/embedding/android)
 else
 GECKO_APP_AP_PATH = $(call core_abspath,$(DEPTH)/mobile/android/base)
 endif
 
-INNER_ROBOCOP_PACKAGE=echo
-ifeq ($(MOZ_BUILD_APP),mobile/android)
-UPLOAD_EXTRA_FILES += robocop.apk
-ROBOCOP_PATH = $(call core_abspath,$(_ABS_DIST)/../build/mobile/robocop)
-INNER_ROBOCOP_PACKAGE= \
-  $(APKBUILDER) $(_ABS_DIST)/robocop-raw.apk -v $(APKBUILDER_FLAGS) -z $(ROBOCOP_PATH)/robocop.ap_ -f $(ROBOCOP_PATH)/classes.dex && \
-  $(JARSIGNER) $(_ABS_DIST)/robocop-raw.apk && \
-  $(ZIPALIGN) -f -v 4 $(_ABS_DIST)/robocop-raw.apk $(_ABS_DIST)/robocop.apk
-endif
-
 PKG_SUFFIX      = .apk
 INNER_MAKE_PACKAGE	= \
   make -C $(GECKO_APP_AP_PATH) gecko.ap_ && \
   cp $(GECKO_APP_AP_PATH)/gecko.ap_ $(_ABS_DIST) && \
   ( cd $(STAGEPATH)$(MOZ_PKG_DIR)$(_BINPATH) && \
     mkdir -p lib/$(ABI_DIR) && \
     mv libmozglue.so $(MOZ_CHILD_PROCESS_NAME) lib/$(ABI_DIR) && \
     rm -f lib.id && \
@@ -540,19 +530,19 @@ ifdef MOZ_EXTERNAL_SIGNING_FORMAT
 MOZ_SIGN_PACKAGE_CMD=$(MOZ_SIGN_CMD) $(foreach f,$(MOZ_EXTERNAL_SIGNING_FORMAT),-f $(f))
 ifeq (gpg,$(findstring gpg,$(MOZ_EXTERNAL_SIGNING_FORMAT)))
 UPLOAD_EXTRA_FILES += $(PACKAGE).asc
 endif
 endif
 
 ifdef MOZ_SIGN_PREPARED_PACKAGE_CMD
 MAKE_PACKAGE    = $(PREPARE_PACKAGE) && $(MOZ_SIGN_PREPARED_PACKAGE_CMD) \
-		  $(MOZ_PKG_DIR) && $(INNER_MAKE_PACKAGE) && $(INNER_ROBOCOP_PACKAGE)
+		  $(MOZ_PKG_DIR) && $(INNER_MAKE_PACKAGE)
 else
-MAKE_PACKAGE    = $(PREPARE_PACKAGE) && $(INNER_MAKE_PACKAGE) && $(INNER_ROBOCOP_PACKAGE)
+MAKE_PACKAGE    = $(PREPARE_PACKAGE) && $(INNER_MAKE_PACKAGE)
 endif
 
 ifdef MOZ_SIGN_PACKAGE_CMD
 MAKE_PACKAGE    += && $(MOZ_SIGN_PACKAGE_CMD) "$(PACKAGE)"
 endif
 
 # dummy macro if we don't have PSM built
 SIGN_NSS		=