From 4899904070e3384fd7b804b77ce50c4e5e547e3d Mon Sep 17 00:00:00 2001 From: Geoff Brown Date: Thu, 3 May 2012 06:22:33 -0400 Subject: [PATCH] Bug 748489 - Provide a writable TMPDIR for android xpcshell tests. r=jmaher --- testing/xpcshell/remotexpcshelltests.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/testing/xpcshell/remotexpcshelltests.py b/testing/xpcshell/remotexpcshelltests.py index 1cc333e8da51..b40ba98405b7 100644 --- a/testing/xpcshell/remotexpcshelltests.py +++ b/testing/xpcshell/remotexpcshelltests.py @@ -58,6 +58,7 @@ class XPCShellRemote(xpcshell.XPCShellTests, object): # 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") self.profileDir = self.remoteJoin(self.remoteTestRoot, "p") @@ -97,6 +98,9 @@ class XPCShellRemote(xpcshell.XPCShellTests, object): def setupUtilities(self): remotePrefDir = self.remoteJoin(self.remoteBinDir, "defaults/pref") + if (self.device.dirExists(self.remoteTmpDir)): + self.device.removeDir(self.remoteTmpDir) + self.device.mkDir(self.remoteTmpDir) if (not self.device.dirExists(remotePrefDir)): self.device.mkDirs(self.remoteJoin(remotePrefDir, "extra")) if (not self.device.dirExists(self.remoteScriptsDir)): @@ -223,6 +227,7 @@ class XPCShellRemote(xpcshell.XPCShellTests, object): if (self.appRoot): env["GRE_HOME"]=self.appRoot env["XPCSHELL_TEST_PROFILE_DIR"]=self.profileDir + env["TMPDIR"]=self.remoteTmpDir outputFile = "xpcshelloutput" f = open(outputFile, "w+") self.shellReturnCode = self.device.shell(cmd, f, cwd=self.remoteHere, env=env)