From 60aeacd28c974a17b53fe9f48b54040a159bcbc1 Mon Sep 17 00:00:00 2001
From: Fabien Morin <fabien@nexedi.com>
Date: Wed, 1 Oct 2008 12:25:23 +0000
Subject: [PATCH] make prefs.js dinamic. This is made to be able to test file
 upload in zelenium tests : url have to be dinamic

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@23929 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5Type/tests/runFunctionalTest.py | 37 +++++++++++++++++++--
 1 file changed, 35 insertions(+), 2 deletions(-)

diff --git a/product/ERP5Type/tests/runFunctionalTest.py b/product/ERP5Type/tests/runFunctionalTest.py
index c423a4f813..313d24e381 100755
--- a/product/ERP5Type/tests/runFunctionalTest.py
+++ b/product/ERP5Type/tests/runFunctionalTest.py
@@ -138,9 +138,42 @@ def runXvfb():
 def prepareFirefox():
   os.system("rm -rf %s" % profile_dir)
   os.mkdir(profile_dir)
-  pref = file(os.path.join(os.path.dirname(__file__), 'prefs.js')).read()
+  prefs_js = """
+// Don't ask if we want to switch default browsers
+user_pref("browser.shell.checkDefaultBrowser", false);
+
+// Disable pop-up blocking
+user_pref("browser.allowpopups", true);
+user_pref("dom.disable_open_during_load", false);
+
+// Configure us as the local proxy
+//user_pref("network.proxy.type", 2);
+
+// Disable security warnings
+user_pref("security.warn_submit_insecure", false);
+user_pref("security.warn_submit_insecure.show_once", false);
+user_pref("security.warn_entering_secure", false);
+user_pref("security.warn_entering_secure.show_once", false);
+user_pref("security.warn_entering_weak", false);
+user_pref("security.warn_entering_weak.show_once", false);
+user_pref("security.warn_leaving_secure", false);
+user_pref("security.warn_leaving_secure.show_once", false);
+user_pref("security.warn_viewing_mixed", false);
+user_pref("security.warn_viewing_mixed.show_once", false);
+
+// Disable "do you want to remember this password?"
+user_pref("signon.rememberSignons", false);
+
+// this is required to upload files
+user_pref("capability.principal.codebase.p1.id", %s);
+user_pref("capability.principal.codebase.p1.subjectName", "");
+user_pref("signed.applets.codebase_principal_support", true);""" % \
+    '%s:%s' % (host, port)
+  
+#  pref = file(os.path.join(os.path.dirname(__file__), 'prefs.js')).read()
+ 
   pref_file = open(os.path.join(profile_dir, 'prefs.js'), 'w')
-  pref_file.write(pref)
+  pref_file.write(prefs_js)
   pref_file.close()
 
 def runFirefox():
-- 
2.30.9