Bug 882932 - (2) Fix httpdPath setting for remote mochitest; r=jmaher

This commit is contained in:
Geoff Brown 2013-06-28 19:20:08 -07:00
parent 58ff17f803
commit ebbc52a9f8
4 changed files with 21 additions and 13 deletions

View File

@ -182,7 +182,7 @@ class ReftestServer:
self.httpPort = options.httpPort
self.scriptDir = scriptDir
self.pidFile = options.pidFile
self._httpdPath = options.httpdPath
self._httpdPath = os.path.abspath(options.httpdPath)
self.shutdownURL = "http://%(server)s:%(port)s/server/shutdown" % { "server" : self.webServer, "port" : self.httpPort }
def start(self):

View File

@ -263,6 +263,11 @@ class MochitestOptions(optparse.OptionParser):
help = "launches tests in immersive browser")
defaults["immersiveMode"] = False
self.add_option("--httpd-path", action = "store",
type = "string", dest = "httpdPath",
help = "path to the httpd.js file")
defaults["httpdPath"] = None
# -h, --help are automatically handled by OptionParser
self.set_defaults(**defaults)
@ -316,7 +321,6 @@ See <http://mochikit.com/doc/html/MochiKit/Logging.html> for details on the logg
options.httpPort = self._automation.DEFAULT_HTTP_PORT
options.sslPort = self._automation.DEFAULT_SSL_PORT
options.webSocketPort = self._automation.DEFAULT_WEBSOCKET_PORT
options.httpdPath = '.'
if options.vmwareRecording:
if not self._automation.IS_WIN32:
@ -411,7 +415,11 @@ class MochitestServer:
self.httpPort = options.httpPort
self.shutdownURL = "http://%(server)s:%(port)s/server/shutdown" % { "server" : self.webServer, "port" : self.httpPort }
self.testPrefix = "'webapprt_'" if options.webapprtContent else "undefined"
if options.httpdPath:
self._httpdPath = options.httpdPath
else:
self._httpdPath = '.'
self._httpdPath = os.path.abspath(self._httpdPath)
def start(self):
"Run the Mochitest server, returning the process ID of the server."

View File

@ -475,6 +475,11 @@ class B2GDeviceMochitest(B2GMochitest):
if options.utilityPath == None:
print "ERROR: unable to find utility path for %s, please specify with --utility-path" % (os.name)
sys.exit(1)
# httpd-path is specified by standard makefile targets and may be specified
# on the command line to select a particular version of httpd.js. If not
# specified, try to select the one from xre.zip, as required in bug 882932.
if not options.httpdPath:
options.httpdPath = os.path.join(options.utilityPath, "components")
options.profilePath = tempfile.mkdtemp()
self.server = MochitestServer(localAutomation, options)

View File

@ -70,11 +70,6 @@ class RemoteOptions(MochitestOptions):
help = "http port of the remote web server")
defaults["httpPort"] = automation.DEFAULT_HTTP_PORT
self.add_option("--httpd-path", action = "store",
type = "string", dest = "httpdPath",
help = "path to the httpd.js file")
defaults["httpdPath"] = None
self.add_option("--ssl-port", action = "store",
type = "string", dest = "sslPort",
help = "ssl port of the remote web server")
@ -218,11 +213,6 @@ class RemoteOptions(MochitestOptions):
tempPort = options.httpPort
tempSSL = options.sslPort
tempIP = options.webServer
# httpd-path is specified by standard makefile targets and may be specified
# on the command line to select a particular version of httpd.js. If not
# specified, try to select the one from hostutils.zip, as required in bug 882932.
if not options.httpdPath:
options.httpdPath = options.utilityPath + "/components"
options = MochitestOptions.verifyOptions(self, options, mochitest)
options.webServer = tempIP
options.app = temp
@ -312,6 +302,11 @@ class MochiRemote(Mochitest):
if options.utilityPath == None:
print "ERROR: unable to find utility path for %s, please specify with --utility-path" % (os.name)
sys.exit(1)
# httpd-path is specified by standard makefile targets and may be specified
# on the command line to select a particular version of httpd.js. If not
# specified, try to select the one from hostutils.zip, as required in bug 882932.
if not options.httpdPath:
options.httpdPath = os.path.join(options.utilityPath, "components")
xpcshell_path = os.path.join(options.utilityPath, xpcshell)
if localAutomation.elf_arm(xpcshell_path):