Causing oranges -- Backed out changeset b3c18f150531
authorClint Talbert <ctalbert@mozilla.com>
Wed, 25 Nov 2009 18:00:31 -0800
changeset 35240 6710e8de07e73d91a643bef264756def282769f1
parent 35239 b3c18f15053123fe9f4a8d7818a3b66797b0c11c
child 35241 d2c981b11f92bc8039959094ff9637e3940c673a
push idunknown
push userunknown
push dateunknown
milestone1.9.3a1pre
Causing oranges -- Backed out changeset b3c18f150531
build/automation.py.in
testing/mochitest/runtests.py.in
testing/mochitest/server.js
--- a/build/automation.py.in
+++ b/build/automation.py.in
@@ -97,18 +97,16 @@ IS_CYGWIN = False
 UNIXISH = not IS_WIN32 and not IS_MAC
 
 #expand DEFAULT_APP = "./" + __BROWSER_PATH__
 #expand CERTS_SRC_DIR = __CERTS_SRC_DIR__
 #expand IS_TEST_BUILD = __IS_TEST_BUILD__
 #expand IS_DEBUG_BUILD = __IS_DEBUG_BUILD__
 #expand CRASHREPORTER = __CRASHREPORTER__ == 1
 
-DEFAULT_WEB_SERVER = "localhost:8888"
-
 ###########
 # LOGGING #
 ###########
 
 # We use the logging system here primarily because it'll handle multiple
 # threads, which is needed to process the output of the server and application
 # processes simultaneously.
 log = logging.getLogger()
@@ -169,17 +167,17 @@ class Location:
 
   def __init__(self, scheme, host, port, options):
     self.scheme = scheme
     self.host = host
     self.port = port
     self.options = options
 
 
-def readLocations(locationsPath = "server-locations.txt", remoteServer = DEFAULT_WEB_SERVER):
+def readLocations(locationsPath = "server-locations.txt"):
   """
   Reads the locations at which the Mochitest HTTP server is available from
   server-locations.txt.
   """
 
   locationFile = codecs.open(locationsPath, "r", "UTF-8")
 
   # Perhaps more detail than necessary, but it's the easiest way to make sure
@@ -206,47 +204,42 @@ def readLocations(locationsPath = "serve
     lineno += 1
     if line.startswith("#") or line == "\n":
       continue
       
     match = lineRe.match(line)
     if not match:
       raise SyntaxError(lineno)
 
-    host = match.group("host")
-    port = match.group("port")
     options = match.group("options")
     if options:
       options = options.split(",")
       if "primary" in options:
         if seenPrimary:
           raise SyntaxError(lineno, "multiple primary locations")
-
-        #we can have only 1 primary, make it the remoteServer
-        host, port = remoteServer.split(':')
         seenPrimary = True
     else:
       options = []
 
-    locations.append(Location(match.group("scheme"), host, port, options))
+    locations.append(Location(match.group("scheme"), match.group("host"),
+                              match.group("port"), options))
 
   if not seenPrimary:
     raise SyntaxError(lineno + 1, "missing primary location")
 
   return locations
 
 
-def initializeProfile(profileDir, extraPrefs = [], webServer = DEFAULT_WEB_SERVER):
+def initializeProfile(profileDir, extraPrefs = []):
   "Sets up the standard testing profile."
 
   # Start with a clean slate.
   shutil.rmtree(profileDir, True)
   os.mkdir(profileDir)
 
-  remoteIP = webServer.split(':')[0]
   prefs = []
 
   part = """\
 user_pref("browser.dom.window.dump.enabled", true);
 user_pref("dom.allow_scripts_to_close_windows", true);
 user_pref("dom.disable_open_during_load", false);
 user_pref("dom.max_script_run_time", 0); // no slow script dialogs
 user_pref("dom.max_chrome_script_run_time", 0);
@@ -265,33 +258,33 @@ user_pref("gfx.color_management.force_sr
 user_pref("network.manage-offline-status", false);
 user_pref("test.mousescroll", true);
 user_pref("security.default_personal_cert", "Select Automatically"); // Need to client auth test be w/o any dialogs
 user_pref("network.http.prompt-temp-redirect", false);
 user_pref("svg.smil.enabled", true); // Needed for SMIL mochitests until bug 482402 lands
 user_pref("media.cache_size", 100);
 user_pref("security.warn_viewing_mixed", false);
 
-user_pref("geo.wifi.uri", "http://example.com/tests/dom/tests/mochitest/geolocation/network_geolocation.sjs");
+user_pref("geo.wifi.uri", "http://localhost:8888/tests/dom/tests/mochitest/geolocation/network_geolocation.sjs");
 user_pref("geo.wifi.testing", true);
 
 user_pref("camino.warn_when_closing", false); // Camino-only, harmless to others
 
 // Make url-classifier updates so rare that they won't affect tests
 user_pref("urlclassifier.updateinterval", 172800);
 // Point the url-classifier to the local testing server for fast failures
-user_pref("browser.safebrowsing.provider.0.gethashURL", "http://example.com/safebrowsing-dummy/gethash");
-user_pref("browser.safebrowsing.provider.0.keyURL", "http://example.com/safebrowsing-dummy/newkey");
-user_pref("browser.safebrowsing.provider.0.lookupURL", "http://example.com/safebrowsing-dummy/lookup");
-user_pref("browser.safebrowsing.provider.0.updateURL", "http://example.com/safebrowsing-dummy/update");
+user_pref("browser.safebrowsing.provider.0.gethashURL", "http://localhost:8888/safebrowsing-dummy/gethash");
+user_pref("browser.safebrowsing.provider.0.keyURL", "http://localhost:8888/safebrowsing-dummy/newkey");
+user_pref("browser.safebrowsing.provider.0.lookupURL", "http://localhost:8888/safebrowsing-dummy/lookup");
+user_pref("browser.safebrowsing.provider.0.updateURL", "http://localhost:8888/safebrowsing-dummy/update");
 """
   
   prefs.append(part)
 
-  locations = readLocations(remoteServer=webServer)
+  locations = readLocations()
 
   # Grant God-power to all the privileged servers on which tests run.
   privileged = filter(lambda loc: "privileged" in loc.options, locations)
   for (i, l) in itertools.izip(itertools.count(1), privileged):
     part = """
 user_pref("capability.principal.codebase.p%(i)d.granted",
           "UniversalXPConnect UniversalBrowserRead UniversalBrowserWrite \
            UniversalPreferencesRead UniversalPreferencesWrite \
@@ -305,17 +298,17 @@ user_pref("capability.principal.codebase
   # We need to proxy every server but the primary one.
   origins = ["'%s://%s:%s'" % (l.scheme, l.host, l.port)
              for l in filter(lambda l: "primary" not in l.options, locations)]
   origins = ", ".join(origins)
 
   pacURL = """data:text/plain,
 function FindProxyForURL(url, host)
 {
-  var origins = ['http://%(remote)s:8888', %(origins)s];
+  var origins = [%(origins)s];
   var regex = new RegExp('^([a-z][-a-z0-9+.]*)' +
                          '://' +
                          '(?:[^/@]*@)?' +
                          '(.*?)' +
                          '(?::(\\\\\\\\d+))?/');
   var matches = regex.exec(url);
   if (!matches)
     return 'DIRECT';
@@ -326,21 +319,21 @@ function FindProxyForURL(url, host)
     if (isHttp) matches[3] = '80';
     if (isHttps) matches[3] = '443';
   }
     
   var origin = matches[1] + '://' + matches[2] + ':' + matches[3];
   if (origins.indexOf(origin) < 0)
     return 'DIRECT';
   if (isHttp)
-    return 'PROXY %(remote)s:8888';
+    return 'PROXY 127.0.0.1:8888';
   if (isHttps)
-    return 'PROXY %(remote)s:4443';
+    return 'PROXY 127.0.0.1:4443';
   return 'DIRECT';
-}""" % { "origins": origins, "remote":remoteIP }
+}""" % { "origins": origins }
   pacURL = "".join(pacURL.splitlines())
 
   part = """
 user_pref("network.proxy.type", 2);
 user_pref("network.proxy.autoconfig_url", "%(pacURL)s");
 
 user_pref("camino.use_system_proxy_settings", false); // Camino-only, harmless to others
 """ % {"pacURL": pacURL}
--- a/testing/mochitest/runtests.py.in
+++ b/testing/mochitest/runtests.py.in
@@ -49,23 +49,26 @@ import os.path
 import sys
 import time
 import shutil
 from urllib import quote_plus as encodeURIComponent
 import urllib2
 import commands
 import automation
 from automationutils import *
-import tempfile
 
 # Path to the test script on the server
+TEST_SERVER_HOST = "localhost:8888"
 TEST_PATH = "/tests/"
 CHROME_PATH = "/redirect.html";
 A11Y_PATH = "/redirect-a11y.html"
-
+TESTS_URL = "http://" + TEST_SERVER_HOST + TEST_PATH
+CHROMETESTS_URL = "http://" + TEST_SERVER_HOST + CHROME_PATH
+A11YTESTS_URL = "http://" + TEST_SERVER_HOST + A11Y_PATH
+SERVER_SHUTDOWN_URL = "http://" + TEST_SERVER_HOST + "/server/shutdown"
 # main browser chrome URL, same as browser.chromeURL pref
 #ifdef MOZ_SUITE
 BROWSER_CHROME_URL = "chrome://navigator/content/navigator.xul"
 #else
 BROWSER_CHROME_URL = "chrome://browser/content/browser.xul"
 #endif
 
 # Max time in seconds to wait for server startup before tests will fail -- if
@@ -75,16 +78,19 @@ if automation.IS_DEBUG_BUILD:
     SERVER_STARTUP_TIMEOUT = 180
 else:
     SERVER_STARTUP_TIMEOUT = 90
 
 oldcwd = os.getcwd()
 SCRIPT_DIRECTORY = os.path.abspath(os.path.realpath(os.path.dirname(sys.argv[0])))
 os.chdir(SCRIPT_DIRECTORY)
 
+PROFILE_DIRECTORY = os.path.abspath("./mochitesttestingprofile")
+
+LEAK_REPORT_FILE = os.path.join(PROFILE_DIRECTORY, "runtests_leaks.log")
 
 #######################
 # COMMANDLINE OPTIONS #
 #######################
 
 class MochitestOptions(optparse.OptionParser):
   """Parses Mochitest commandline options."""
   def __init__(self, **kwargs):
@@ -217,30 +223,16 @@ class MochitestOptions(optparse.OptionPa
                            "(requires a debug build to be effective)")
     defaults["fatalAssertions"] = False
 
     self.add_option("--extra-profile-file",
                     action = "append", dest = "extraProfileFiles",
                     help = "copy specified files/dirs to testing profile")
     defaults["extraProfileFiles"] = []
 
-    self.add_option("--remote-webserver", action = "store",
-                    type = "string", dest = "remoteWebServer",
-                    help = "ip address where the remote web server is hosted at")
-    defaults["remoteWebServer"] = None
-
-    self.add_option("--profile-path", action = "store",
-                    type = "string", dest = "profilePath",
-                    help = "directory where the profile will be stored")
-    defaults["profilePath"] = tempfile.mkdtemp()
-
-    self.add_option("--setup-only", action = "store_true",
-                    dest = "setupOnly", help = "only setup the profile, do not run tests")
-    defaults["setupOnly"] = False
-
     # -h, --help are automatically handled by OptionParser
 
     self.set_defaults(**defaults)
 
     usage = """\
 Usage instructions for runtests.py.
 All arguments are optional.
 If --chrome is specified, chrome tests will be run instead of web content tests.
@@ -256,61 +248,58 @@ See <http://mochikit.com/doc/html/MochiK
 
 class MochitestServer:
   "Web server used to serve Mochitests, for closer fidelity to the real web."
 
   def __init__(self, options):
     self._closeWhenDone = options.closeWhenDone
     self._utilityPath = options.utilityPath
     self._xrePath = options.xrePath
-    self._shutdownPath = "http://" + options.webServer + "/server/shutdown"
-    self._profilePath = options.profilePath
 
   def start(self):
     "Run the Mochitest server, returning the process ID of the server."
     
     env = automation.environment(xrePath = self._xrePath)
     env["XPCOM_DEBUG_BREAK"] = "warn"
     if automation.IS_WIN32:
       env["PATH"] = env["PATH"] + ";" + self._xrePath
 
     args = ["-g", self._xrePath,
             "-v", "170",
             "-f", "./" + "httpd.js",
-            "-e", "const _PROFILE_PATH = '" + self._profilePath + "'",
             "-f", "./" + "server.js"]
 
     xpcshell = os.path.join(self._utilityPath,
                             "xpcshell" + automation.BIN_SUFFIX)
     self._process = automation.Process([xpcshell] + args, env = env)
     pid = self._process.pid
     if pid < 0:
       print "Error starting server."
       sys.exit(2)
     automation.log.info("INFO | runtests.py | Server pid: %d", pid)
     
 
   def ensureReady(self, timeout):
     assert timeout >= 0
 
-    aliveFile = os.path.join(self._profilePath, "server_alive.txt")
+    aliveFile = os.path.join(PROFILE_DIRECTORY, "server_alive.txt")
     i = 0
     while i < timeout:
       if os.path.exists(aliveFile):
         break
       time.sleep(1)
       i += 1
     else:
       print "Timed out while waiting for server startup."
       self.stop()
       sys.exit(1)
 
   def stop(self):
     try:
-      c = urllib2.urlopen(self._shutdownPath)
+      c = urllib2.urlopen(SERVER_SHUTDOWN_URL)
       c.read()
       c.close()
       self._process.wait()
     except:
       self._process.kill()
 
 def getFullPath(path):
   "Get an absolute path relative to oldcwd."
@@ -338,38 +327,29 @@ def main():
       options.xrePath = os.path.dirname(options.app)
     else:
       # otherwise default to dist/bin
       options.xrePath = automation.DIST_BIN
 
   # allow relative paths
   options.xrePath = getFullPath(options.xrePath)
 
-  options.profilePath = getFullPath(options.profilePath)
-
   options.app = getFullPath(options.app)
   if not os.path.exists(options.app):
     msg = """\
 Error: Path %(app)s doesn't exist.
 Are you executing $objdir/_tests/testing/mochitest/runtests.py?"""
     print msg % {"app": options.app}
     sys.exit(1)
 
   options.utilityPath = getFullPath(options.utilityPath)
   options.certPath = getFullPath(options.certPath)
   if options.symbolsPath:
     options.symbolsPath = getFullPath(options.symbolsPath)
 
-  if (options.remoteWebServer):
-    if (len(options.remoteWebServer.split(':')) == 1):
-      options.remoteWebServer += ":8888"
-    options.webServer = options.remoteWebServer
-  else:
-    options.webServer = "localhost:8888"
-
   debuggerInfo = getDebuggerInfo(oldcwd, options.debugger, options.debuggerArgs,
     options.debuggerInteractive);
 
   # browser environment
   browserEnv = automation.environment(xrePath = options.xrePath)
 
   # These variables are necessary for correct application startup; change
   # via the commandline at your own risk.
@@ -377,54 +357,50 @@ Are you executing $objdir/_tests/testing
 
   for v in options.environment:
     ix = v.find("=")
     if ix <= 0:
       print "Error: syntax error in --setenv=" + v
       sys.exit(1)
     browserEnv[v[:ix]] = v[ix + 1:]
 
-  automation.initializeProfile(options.profilePath, options.extraPrefs, options.webServer)
+  automation.initializeProfile(PROFILE_DIRECTORY, options.extraPrefs)
   manifest = addChromeToProfile(options)
   copyExtraFilesToProfile(options)
-  if (options.setupOnly):
-    return
+  server = MochitestServer(options)
+  server.start()
 
-  if (not options.remoteWebServer):
-    server = MochitestServer(options)
-    server.start()
-
-    # If we're lucky, the server has fully started by now, and all paths are
-    # ready, etc.  However, xpcshell cold start times suck, at least for debug
-    # builds.  We'll try to connect to the server for awhile, and if we fail,
-    # we'll try to kill the server and exit with an error.
-    server.ensureReady(SERVER_STARTUP_TIMEOUT)
+  # If we're lucky, the server has fully started by now, and all paths are
+  # ready, etc.  However, xpcshell cold start times suck, at least for debug
+  # builds.  We'll try to connect to the server for awhile, and if we fail,
+  # we'll try to kill the server and exit with an error.
+  server.ensureReady(SERVER_STARTUP_TIMEOUT)
 
   # URL parameters to test URL:
   #
   # autorun -- kick off tests automatically
   # closeWhenDone -- runs quit.js after tests
   # logFile -- logs test run to an absolute path
   # totalChunks -- how many chunks to split tests into
   # thisChunk -- which chunk to run
   # timeout -- per-test timeout in seconds
   #
   
   # consoleLevel, fileLevel: set the logging level of the console and
   # file logs, if activated.
   # <http://mochikit.com/doc/html/MochiKit/Logging.html>
 
-  testURL = "http://" + options.webServer + "/tests/" + options.testPath
+  testURL = TESTS_URL + options.testPath
   urlOpts = []
   if options.chrome:
-    testURL = "http://" + options.webServer + CHROME_PATH
+    testURL = CHROMETESTS_URL
     if options.testPath:
       urlOpts.append("testPath=" + encodeURIComponent(options.testPath))
   elif options.a11y:
-    testURL = "http://" + options.webServer + A11Y_PATH
+    testURL = A11YTESTS_URL
     if options.testPath:
       urlOpts.append("testPath=" + encodeURIComponent(options.testPath))
   elif options.browserChrome:
     testURL = "about:blank"
 
   # allow relative paths for logFile
   if options.logFile:
     options.logFile = getFullPath(options.logFile)
@@ -447,71 +423,65 @@ Are you executing $objdir/_tests/testing
         urlOpts.append("thisChunk=%d" % options.thisChunk)
         if options.chunkByDir:
             urlOpts.append("chunkByDir=%d" % options.chunkByDir)
     if options.shuffle:
         urlOpts.append("shuffle=1")
     if len(urlOpts) > 0:
       testURL += "?" + "&".join(urlOpts)
 
-  leak_report_file = os.path.join(options.profilePath, "runtests_leaks.log")
-  browserEnv["XPCOM_MEM_BLOAT_LOG"] = leak_report_file
+  browserEnv["XPCOM_MEM_BLOAT_LOG"] = LEAK_REPORT_FILE
 
   if options.fatalAssertions:
     browserEnv["XPCOM_DEBUG_BREAK"] = "stack-and-abort"
 
-  try:
-    # run once with -silent to let the extension manager do its thing
-    # and then exit the app
-    automation.log.info("INFO | runtests.py | Performing extension manager registration: start.\n")
-    # Don't care about this |status|: |runApp()| reporting it should be enough.
-    status = automation.runApp(None, browserEnv, options.app,
-                               options.profilePath, ["-silent"],
-                               utilityPath = options.utilityPath,
-                               xrePath = options.xrePath,
-                               symbolsPath=options.symbolsPath)
-    # We don't care to call |processLeakLog()| for this step.
-    automation.log.info("\nINFO | runtests.py | Performing extension manager registration: end.")
+  # run once with -silent to let the extension manager do its thing
+  # and then exit the app
+  automation.log.info("INFO | runtests.py | Performing extension manager registration: start.\n")
+  # Don't care about this |status|: |runApp()| reporting it should be enough.
+  status = automation.runApp(None, browserEnv, options.app,
+                             PROFILE_DIRECTORY, ["-silent"],
+                             utilityPath = options.utilityPath,
+                             xrePath = options.xrePath,
+                             symbolsPath=options.symbolsPath)
+  # We don't care to call |processLeakLog()| for this step.
+  automation.log.info("\nINFO | runtests.py | Performing extension manager registration: end.")
 
-    # Remove the leak detection file so it can't "leak" to the tests run.
-    # The file is not there if leak logging was not enabled in the application build.
-    if os.path.exists(leak_report_file):
-      os.remove(leak_report_file)
+  # Remove the leak detection file so it can't "leak" to the tests run.
+  # The file is not there if leak logging was not enabled in the application build.
+  if os.path.exists(LEAK_REPORT_FILE):
+    os.remove(LEAK_REPORT_FILE)
 
-    # then again to actually run mochitest
-    if options.timeout:
-        timeout = options.timeout + 30
-    elif options.autorun:
-        timeout = None
-    else:
-        timeout = 330.0 # default JS harness timeout is 300 seconds
-    automation.log.info("INFO | runtests.py | Running tests: start.\n")
-    status = automation.runApp(testURL, browserEnv, options.app,
-                               options.profilePath, options.browserArgs,
-                               runSSLTunnel = True,
-                               utilityPath = options.utilityPath,
-                               xrePath = options.xrePath,
-                               certPath=options.certPath,
-                               debuggerInfo=debuggerInfo,
-                               symbolsPath=options.symbolsPath,
-                               timeout = timeout)
+  # then again to actually run mochitest
+  if options.timeout:
+      timeout = options.timeout + 30
+  elif options.autorun:
+      timeout = None
+  else:
+      timeout = 330.0 # default JS harness timeout is 300 seconds
+  automation.log.info("INFO | runtests.py | Running tests: start.\n")
+  status = automation.runApp(testURL, browserEnv, options.app,
+                             PROFILE_DIRECTORY, options.browserArgs,
+                             runSSLTunnel = True,
+                             utilityPath = options.utilityPath,
+                             xrePath = options.xrePath,
+                             certPath=options.certPath,
+                             debuggerInfo=debuggerInfo,
+                             symbolsPath=options.symbolsPath,
+                             timeout = timeout)
 
-    if (not options.remoteWebServer):
-      # Server's no longer needed, and perhaps more importantly, anything it might
-      # spew to console shouldn't disrupt the leak information table we print next.
-      server.stop()
+  # Server's no longer needed, and perhaps more importantly, anything it might
+  # spew to console shouldn't disrupt the leak information table we print next.
+  server.stop()
 
-    processLeakLog(leak_report_file, options.leakThreshold)
-    automation.log.info("\nINFO | runtests.py | Running tests: end.")
+  processLeakLog(LEAK_REPORT_FILE, options.leakThreshold)
+  automation.log.info("\nINFO | runtests.py | Running tests: end.")
 
-  finally:
-    # delete the profile and manifest
-    if (options.profilePath):
-      shutil.rmtree(options.profilePath)
-    os.remove(manifest)
+  # delete the profile and manifest
+  os.remove(manifest)
 
   # hanging due to non-halting threads is no fun; assume we hit the errors we
   # were going to hit already and exit.
   sys.exit(status)
 
 
 
 #######################
@@ -533,25 +503,25 @@ def makeTestConfig(options):
   closeWhenDone: %(closeWhenDone)s,
   logPath: "%(logPath)s",
   testPath: "%(testPath)s"
 })""" % {"autorun": boolString(options.autorun),
          "closeWhenDone": boolString(options.closeWhenDone),
          "logPath": logFile,
          "testPath": testPath}
 
-  config = open(os.path.join(options.profilePath, "testConfig.js"), "w")
+  config = open(os.path.join(PROFILE_DIRECTORY, "testConfig.js"), "w")
   config.write(content)
   config.close() 
 
 
 def addChromeToProfile(options):
   "Adds MochiKit chrome tests to the profile."
 
-  chromedir = os.path.join(options.profilePath, "chrome")
+  chromedir = os.path.join(PROFILE_DIRECTORY, "chrome")
   os.mkdir(chromedir)
 
   chrome = []
 
   part = """
 @namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); /* set default namespace to XUL */
 toolbar,
 toolbarpalette {
@@ -561,17 +531,17 @@ toolbar#nav-bar {
   background-image: none !important;
 }
 """
   chrome.append(part)
 
 
 
   # write userChrome.css
-  chromeFile = open(os.path.join(options.profilePath, "userChrome.css"), "a")
+  chromeFile = open(os.path.join(PROFILE_DIRECTORY, "userChrome.css"), "a")
   chromeFile.write("".join(chrome))
   chromeFile.close()
 
 
   # register our chrome dir
   chrometestDir = os.path.abspath(".") + "/"
   if automation.IS_WIN32:
     chrometestDir = "file:///" + chrometestDir.replace("\\", "/")
@@ -588,17 +558,17 @@ toolbar#nav-bar {
   manifestFile.close()
 
   return manifest
 
 def copyExtraFilesToProfile(options):
   "Copy extra files or dirs specified on the command line to the testing profile."
   for f in options.extraProfileFiles:
     abspath = getFullPath(f)
-    dest = os.path.join(options.profilePath, os.path.basename(abspath))
+    dest = os.path.join(PROFILE_DIRECTORY, os.path.basename(abspath))
     if os.path.isdir(abspath):
       shutil.copytree(abspath, dest)
     else:
       shutil.copy(abspath, dest)
 
 #########
 # DO IT #
 #########
--- a/testing/mochitest/server.js
+++ b/testing/mochitest/server.js
@@ -152,23 +152,18 @@ function runServer()
   server = createMochitestServer(serverBasePath);
   server.start(SERVER_PORT);
 
   // touch a file in the profile directory to indicate we're alive
   var foStream = Cc["@mozilla.org/network/file-output-stream;1"]
                    .createInstance(Ci.nsIFileOutputStream);
   var serverAlive = Cc["@mozilla.org/file/local;1"]
                       .createInstance(Ci.nsILocalFile);
-
-  if (typeof(_PROFILE_PATH) == "undefined") {
-    serverAlive.initWithFile(serverBasePath);
-    serverAlive.append("mochitesttestingprofile");
-  } else {
-    serverAlive.initWithPath(_PROFILE_PATH);
-  }
+  serverAlive.initWithFile(serverBasePath);
+  serverAlive.append("mochitesttestingprofile");
 
   // If we're running outside of the test harness, there might
   // not be a test profile directory present
   if (serverAlive.exists()) {
     serverAlive.append("server_alive.txt");
     foStream.init(serverAlive,
                   0x02 | 0x08 | 0x20, 0664, 0); // write, create, truncate
     data = "It's alive!";