diff --git a/testing/xpcshell/remotexpcshelltests.py b/testing/xpcshell/remotexpcshelltests.py index 46539c80a7ea..f08cbf0c094e 100644 --- a/testing/xpcshell/remotexpcshelltests.py +++ b/testing/xpcshell/remotexpcshelltests.py @@ -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)