mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1026290 - Push chrome test files to device; r=jmaher
This commit is contained in:
parent
63fe354c0e
commit
312788bae2
@ -765,6 +765,12 @@ class MochitestUtilsMixin(object):
|
|||||||
with open(os.path.join(options.profilePath, "extensions", "staged", "mochikit@mozilla.org", "chrome.manifest"), "a") as mfile:
|
with open(os.path.join(options.profilePath, "extensions", "staged", "mochikit@mozilla.org", "chrome.manifest"), "a") as mfile:
|
||||||
mfile.write(chrome)
|
mfile.write(chrome)
|
||||||
|
|
||||||
|
def getChromeTestDir(self, options):
|
||||||
|
dir = os.path.join(os.path.abspath("."), SCRIPT_DIR) + "/"
|
||||||
|
if mozinfo.isWin:
|
||||||
|
dir = "file:///" + dir.replace("\\", "/")
|
||||||
|
return dir
|
||||||
|
|
||||||
def addChromeToProfile(self, options):
|
def addChromeToProfile(self, options):
|
||||||
"Adds MochiKit chrome tests to the profile."
|
"Adds MochiKit chrome tests to the profile."
|
||||||
|
|
||||||
@ -789,9 +795,7 @@ toolbar#nav-bar {
|
|||||||
manifest = os.path.join(options.profilePath, "tests.manifest")
|
manifest = os.path.join(options.profilePath, "tests.manifest")
|
||||||
with open(manifest, "w") as manifestFile:
|
with open(manifest, "w") as manifestFile:
|
||||||
# Register chrome directory.
|
# Register chrome directory.
|
||||||
chrometestDir = os.path.join(os.path.abspath("."), SCRIPT_DIR) + "/"
|
chrometestDir = self.getChromeTestDir(options)
|
||||||
if mozinfo.isWin:
|
|
||||||
chrometestDir = "file:///" + chrometestDir.replace("\\", "/")
|
|
||||||
manifestFile.write("content mochitests %s contentaccessible=yes\n" % chrometestDir)
|
manifestFile.write("content mochitests %s contentaccessible=yes\n" % chrometestDir)
|
||||||
|
|
||||||
if options.testingModulesDir is not None:
|
if options.testingModulesDir is not None:
|
||||||
|
@ -249,6 +249,9 @@ class MochiRemote(Mochitest):
|
|||||||
self.remoteNSPR = os.path.join(options.remoteTestRoot, "nspr")
|
self.remoteNSPR = os.path.join(options.remoteTestRoot, "nspr")
|
||||||
self._dm.removeDir(self.remoteNSPR);
|
self._dm.removeDir(self.remoteNSPR);
|
||||||
self._dm.mkDir(self.remoteNSPR);
|
self._dm.mkDir(self.remoteNSPR);
|
||||||
|
self.remoteChromeTestDir = os.path.join(options.remoteTestRoot, "chrome")
|
||||||
|
self._dm.removeDir(self.remoteChromeTestDir);
|
||||||
|
self._dm.mkDir(self.remoteChromeTestDir);
|
||||||
|
|
||||||
def cleanup(self, options):
|
def cleanup(self, options):
|
||||||
if self._dm.fileExists(self.remoteLog):
|
if self._dm.fileExists(self.remoteLog):
|
||||||
@ -257,6 +260,7 @@ class MochiRemote(Mochitest):
|
|||||||
else:
|
else:
|
||||||
self.log.warning("Unable to retrieve log file (%s) from remote device" % self.remoteLog)
|
self.log.warning("Unable to retrieve log file (%s) from remote device" % self.remoteLog)
|
||||||
self._dm.removeDir(self.remoteProfile)
|
self._dm.removeDir(self.remoteProfile)
|
||||||
|
self._dm.removeDir(self.remoteChromeTestDir);
|
||||||
# Don't leave an old robotium.config hanging around; the
|
# Don't leave an old robotium.config hanging around; the
|
||||||
# profile it references was just deleted!
|
# profile it references was just deleted!
|
||||||
deviceRoot = self._dm.getDeviceRoot()
|
deviceRoot = self._dm.getDeviceRoot()
|
||||||
@ -413,19 +417,14 @@ class MochiRemote(Mochitest):
|
|||||||
else:
|
else:
|
||||||
return super(MochiRemote, self).buildTestPath(options, testsToFilter)
|
return super(MochiRemote, self).buildTestPath(options, testsToFilter)
|
||||||
|
|
||||||
def installChromeFile(self, filename, options):
|
def getChromeTestDir(self, options):
|
||||||
parts = options.app.split('/')
|
local = super(MochiRemote, self).getChromeTestDir(options)
|
||||||
if (parts[0] == options.app):
|
local = os.path.join(local, "chrome")
|
||||||
return "NO_CHROME_ON_DROID"
|
remote = self.remoteChromeTestDir
|
||||||
path = '/'.join(parts[:-1])
|
if options.chrome:
|
||||||
manifest = path + "/chrome/" + os.path.basename(filename)
|
self.log.info("pushing %s to %s on device..." % (local, remote))
|
||||||
try:
|
self._dm.pushDir(local, remote)
|
||||||
self._dm.pushFile(filename, manifest)
|
return remote
|
||||||
except devicemanager.DMError:
|
|
||||||
self.log.error("Automation Error: Unable to install Chrome files on device.")
|
|
||||||
raise
|
|
||||||
|
|
||||||
return manifest
|
|
||||||
|
|
||||||
def getLogFilePath(self, logFile):
|
def getLogFilePath(self, logFile):
|
||||||
return logFile
|
return logFile
|
||||||
|
Loading…
Reference in New Issue
Block a user