diff --git a/layout/tools/reftest/remotereftest.py b/layout/tools/reftest/remotereftest.py index 1671a91a2568..85afbbf7f71c 100644 --- a/layout/tools/reftest/remotereftest.py +++ b/layout/tools/reftest/remotereftest.py @@ -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): diff --git a/testing/mochitest/runtests.py b/testing/mochitest/runtests.py index 876a2e8e0013..a26c3ade513c 100644 --- a/testing/mochitest/runtests.py +++ b/testing/mochitest/runtests.py @@ -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 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" - self._httpdPath = options.httpdPath + 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." diff --git a/testing/mochitest/runtestsb2g.py b/testing/mochitest/runtestsb2g.py index 64f3383b96d2..22ff02357996 100644 --- a/testing/mochitest/runtestsb2g.py +++ b/testing/mochitest/runtestsb2g.py @@ -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) diff --git a/testing/mochitest/runtestsremote.py b/testing/mochitest/runtestsremote.py index 1d2e9021450f..364cd553cf4d 100644 --- a/testing/mochitest/runtestsremote.py +++ b/testing/mochitest/runtestsremote.py @@ -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):