Bug 420659 - initial Mochitest support for running Camino. r=jwalden, a=test-only, Camino-only
authoralqahira@ardisson.org
Tue, 06 May 2008 10:52:26 -0700
changeset 14977 2a87a85efe6be128f2c02216a08f46da4c47c23e
parent 14976 ea4ce326a291f9f0b40b3d78fc3b7ed4193cfd53
child 14978 059a060788d6d8bd12cfae254fa03e70737e95ae
push idunknown
push userunknown
push dateunknown
reviewersjwalden, test-only, Camino-only
bugs420659
milestone1.9pre
Bug 420659 - initial Mochitest support for running Camino. r=jwalden, a=test-only, Camino-only
build/pgo/Makefile.in
build/pgo/automation.py.in
testing/mochitest/Makefile.in
--- a/build/pgo/Makefile.in
+++ b/build/pgo/Makefile.in
@@ -57,37 +57,47 @@ include $(topsrcdir)/config/rules.mk
 
 
 ifeq ($(USE_SHORT_LIBNAME), 1)
 PROGRAM = $(MOZ_APP_NAME)$(BIN_SUFFIX)
 else
 PROGRAM = $(MOZ_APP_NAME)-bin$(BIN_SUFFIX)
 endif
 
+ifeq ($(MOZ_BUILD_APP),camino)
+browser_path = \"$(DIST)/Camino.app/Contents/MacOS/Camino\"
+else
 ifeq ($(OS_ARCH),Darwin)
 ifdef MOZ_DEBUG
 browser_path = \"$(DIST)/$(MOZ_APP_DISPLAYNAME)Debug.app/Contents/MacOS/$(PROGRAM)\"
 else
 browser_path = \"$(DIST)/$(MOZ_APP_DISPLAYNAME).app/Contents/MacOS/$(PROGRAM)\"
 endif
 else
 browser_path = \"$(DIST)/bin/$(PROGRAM)\"
 endif
+endif
 
 AUTOMATION_PPARGS = 	\
 			-DBROWSER_PATH=$(browser_path) \
 			-DXPC_BIN_PATH=\"$(DIST)/bin\" \
 			$(NULL)
 
 ifeq ($(OS_ARCH),Darwin)
 AUTOMATION_PPARGS += -DIS_MAC=1
 else
 AUTOMATION_PPARGS += -DIS_MAC=0
 endif
 
+ifeq ($(MOZ_BUILD_APP),camino)
+AUTOMATION_PPARGS += -DIS_CAMINO=1
+else
+AUTOMATION_PPARGS += -DIS_CAMINO=0
+endif
+
 ifeq ($(host_os), cygwin)
 AUTOMATION_PPARGS += -DIS_CYGWIN=1
 endif
 
 automation.py: automation.py.in
 	$(PYTHON) $(topsrcdir)/config/Preprocessor.py \
 	$(AUTOMATION_PPARGS) $(DEFINES) $(ACDEFINES) $^ > $@
 
--- a/build/pgo/automation.py.in
+++ b/build/pgo/automation.py.in
@@ -115,16 +115,17 @@ unprivilegedServers = [
 #expand DIST_BIN = "./" + __XPC_BIN_PATH__
 #expand IS_WIN32 = len("__WIN32__") != 0
 #expand IS_MAC = __IS_MAC__ != 0
 #ifdef IS_CYGWIN
 #expand IS_CYGWIN = __IS_CYGWIN__ == 1
 #else
 IS_CYGWIN = False
 #endif
+#expand IS_CAMINO = __IS_CAMINO__ != 0
 
 UNIXISH = not IS_WIN32 and not IS_MAC
 
 #expand DEFAULT_APP = "./" + __BROWSER_PATH__
 
 ###########
 # LOGGING #
 ###########
@@ -237,16 +238,18 @@ user_pref("dom.max_script_run_time", 0);
 user_pref("signed.applets.codebase_principal_support", true);
 user_pref("security.warn_submit_insecure", false);
 user_pref("browser.shell.checkDefaultBrowser", false);
 user_pref("browser.warnOnQuit", false);
 user_pref("accessibility.typeaheadfind.autostart", false);
 user_pref("javascript.options.showInConsole", true);
 user_pref("layout.debug.enable_data_xbl", true);
 user_pref("browser.EULA.override", true);
+
+user_pref("camino.warn_when_closing", false); // Camino-only, harmless to others
 """
   prefs.append(part)
 
   # Grant God-power to all the servers on which tests can run.
   for (i, server) in itertools.izip(itertools.count(1), servers):
     part = """
 user_pref("capability.principal.codebase.p%(i)d.granted",
           "UniversalXPConnect UniversalBrowserRead UniversalBrowserWrite \
@@ -281,16 +284,18 @@ function FindProxyForURL(url, host)
     return 'PROXY localhost:8888';
   return 'DIRECT';
 }""" % {"quotedServers": quotedServers}
   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}
   prefs.append(part)
 
   # write the preferences
   prefsFile = open(profileDir + "/" + "user.js", "a")
   prefsFile.write("".join(prefs))
   prefsFile.close()
 
@@ -301,30 +306,34 @@ user_pref("network.proxy.autoconfig_url"
 
 def runApp(testURL, env, app, profileDir, extraArgs):
   "Run the app, returning the time at which it was started."
   # mark the start
   start = datetime.now()
 
   # now run with the profile we created
   cmd = app
-  if IS_MAC and not cmd.endswith("-bin"):
+  if IS_MAC and not IS_CAMINO and not cmd.endswith("-bin"):
     cmd += "-bin"
   cmd = os.path.abspath(cmd)
 
   args = []
   if IS_MAC:
     args.append("-foreground")
 
   if IS_CYGWIN:
     profileDirectory = commands.getoutput("cygpath -w \"" + profileDir + "/\"")
   else:
     profileDirectory = profileDir + "/"
 
-  args.extend(("-no-remote", "-profile", profileDirectory, testURL))
+  args.extend(("-no-remote", "-profile", profileDirectory))
+  if IS_CAMINO:
+    args.extend(("-url", testURL))
+  else:
+    args.append((testURL))
   args.extend(extraArgs)
   proc = Process(cmd, args, env = env)
   log.info("Application pid: %d", proc.pid)
   status = proc.wait()
   if status != 0:
     log.info("ERROR FAIL Exited with code %d during test run", status)
 
   return start
--- a/testing/mochitest/Makefile.in
+++ b/testing/mochitest/Makefile.in
@@ -75,38 +75,48 @@ include $(topsrcdir)/config/rules.mk
 _DEST_DIR = $(DEPTH)/_tests/$(relativesrcdir)
 
 ifeq ($(USE_SHORT_LIBNAME), 1)
 PROGRAM = $(MOZ_APP_NAME)$(BIN_SUFFIX)
 else
 PROGRAM = $(MOZ_APP_NAME)-bin$(BIN_SUFFIX)
 endif
 
+ifeq ($(MOZ_BUILD_APP),camino)
+browser_path = \"../$(DIST)/Camino.app/Contents/MacOS/Camino\"
+else
 ifeq ($(OS_ARCH),Darwin)
 ifdef MOZ_DEBUG
 browser_path = \"../$(DIST)/$(MOZ_APP_DISPLAYNAME)Debug.app/Contents/MacOS/$(PROGRAM)\"
 else
 browser_path = \"../$(DIST)/$(MOZ_APP_DISPLAYNAME).app/Contents/MacOS/$(PROGRAM)\"
 endif
 else
 browser_path = \"../$(DIST)/bin/$(PROGRAM)\"
 endif
+endif
 
 # These go in _tests/ so they need to go up an extra path segement
 TEST_DRIVER_PPARGS = 	\
 			-DBROWSER_PATH=$(browser_path) \
 			-DXPC_BIN_PATH=\"../$(DIST)/bin\" \
 			$(NULL)
 
 ifeq ($(OS_ARCH),Darwin)
 TEST_DRIVER_PPARGS += -DIS_MAC=1
 else
 TEST_DRIVER_PPARGS += -DIS_MAC=0
 endif
 
+ifeq ($(MOZ_BUILD_APP),camino)
+TEST_DRIVER_PPARGS += -DIS_CAMINO=1
+else
+TEST_DRIVER_PPARGS += -DIS_CAMINO=0
+endif
+
 ifeq ($(host_os), cygwin)
 TEST_DRIVER_PPARGS += -DIS_CYGWIN=1
 endif
 
 runtests.pl: runtests.pl.in
 	$(PYTHON) $(topsrcdir)/config/Preprocessor.py \
 	$(TEST_DRIVER_PPARGS) $(DEFINES) $(ACDEFINES) $^ > $@