Bug 817235 - Make xpcshell tests work with sutAgent; r=jmaher

This commit is contained in:
Geoff Brown 2012-12-18 22:18:03 -07:00
Родитель 15f2adef52
Коммит a810388f04
1 изменённых файлов: 10 добавлений и 2 удалений

Просмотреть файл

@ -25,12 +25,16 @@ class XPCShellRemote(xpcshell.XPCShellTests, object):
self.device = devmgr
self.pathMapping = []
self.remoteTestRoot = self.device.getTestRoot("xpcshell")
# Terse directory names are used here ("b" for a binaries directory)
# remoteBinDir contains xpcshell and its wrapper script, both of which must
# be executable. Since +x permissions cannot usually be set on /mnt/sdcard,
# and the test root may be on /mnt/sdcard, remoteBinDir is set to be on
# /data/local, always.
self.remoteBinDir = "/data/local/xpcb"
# Terse directory names are used here ("c" for the components directory)
# to minimize the length of the command line used to execute
# xpcshell on the remote device. adb has a limit to the number
# of characters used in a shell command, and the xpcshell command
# line can be quite complex.
self.remoteBinDir = self.remoteJoin(self.remoteTestRoot, "b")
self.remoteTmpDir = self.remoteJoin(self.remoteTestRoot, "tmp")
self.remoteScriptsDir = self.remoteTestRoot
self.remoteComponentsDir = self.remoteJoin(self.remoteTestRoot, "c")
@ -83,6 +87,10 @@ class XPCShellRemote(xpcshell.XPCShellTests, object):
return local
def setupUtilities(self):
if (not self.device.dirExists(self.remoteBinDir)):
# device.mkDir may fail here where shellCheckOutput may succeed -- see bug 817235
self.device.shellCheckOutput(["mkdir", self.remoteBinDir]);
remotePrefDir = self.remoteJoin(self.remoteBinDir, "defaults/pref")
if (self.device.dirExists(self.remoteTmpDir)):
self.device.removeDir(self.remoteTmpDir)