Bug 681810 - Avoid xpcshell test failure when device not rooted and cp not available; r=jmaher
authorGeoff Brown <gbrown@mozilla.com>
Sat, 27 Aug 2011 00:23:02 +0100
changeset 77282 7d3f4aafd9ea7f783c962b14d454f45c0360b7f6
parent 77281 0938cf5252cd5ea0b79c4c165385bbf170418a76
child 77283 7d6ebd18ecb6929212350814f8ab35b29e9f3202
push id78
push userclegnitto@mozilla.com
push dateFri, 16 Dec 2011 17:32:24 +0000
treeherdermozilla-release@79d24e644fdd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjmaher
bugs681810
milestone9.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 681810 - Avoid xpcshell test failure when device not rooted and cp not available; r=jmaher
build/mobile/devicemanagerADB.py
testing/xpcshell/remotexpcshelltests.py
--- a/build/mobile/devicemanagerADB.py
+++ b/build/mobile/devicemanagerADB.py
@@ -8,16 +8,17 @@ class DeviceManagerADB(DeviceManager):
 
   def __init__(self, host = None, port = 20701, retrylimit = 5, packageName = None):
     self.host = host
     self.port = port
     self.retrylimit = retrylimit
     self.retries = 0
     self._sock = None
     self.useRunAs = False
+    self.packageName = None
     if packageName == None:
       if os.getenv('USER'):
         packageName = 'org.mozilla.fennec_' + os.getenv('USER')
       else:
         packageName = 'org.mozilla.fennec_'
     self.Init(packageName)
 
   def Init(self, packageName):
--- a/testing/xpcshell/remotexpcshelltests.py
+++ b/testing/xpcshell/remotexpcshelltests.py
@@ -190,17 +190,19 @@ class XPCShellRemote(xpcshell.XPCShellTe
             cmd[index] = part
           index = index + 1
 
         xpcshell = self.remoteJoin(self.remoteBinDir, "xpcshell")
 
         shellArgs = "cd "+self.remoteHere
         shellArgs += "; LD_LIBRARY_PATH="+self.remoteBinDir
         shellArgs += "; export CACHE_PATH="+self.remoteBinDir
-        shellArgs += "; export GRE_HOME="+self.device.getAppRoot()
+        if (self.device.getAppRoot()):
+          # xpcshell still runs without GRE_HOME; it may not be necessary
+          shellArgs += "; export GRE_HOME="+self.device.getAppRoot()
         shellArgs += "; export XPCSHELL_TEST_PROFILE_DIR="+self.profileDir
         shellArgs += "; "+xpcshell+" "
         shellArgs += " ".join(cmd[1:])
 
         if self.verbose:
           self.log.info(shellArgs)
 
         # If the adb version of devicemanager is used and the arguments passed