bug 402139 - allow talos to run with no base profile specified a=anodelman/dougt r=rcampbell

This commit is contained in:
anodelman@mozilla.com 2007-11-06 10:44:32 -08:00
parent e90614c67c
commit edfbaf40e0
2 changed files with 24 additions and 14 deletions

View File

@ -278,7 +278,8 @@ def test_file(filename):
'init_url' : yaml_config['init_url']}
#normalize paths to work accross platforms
browser_config['firefox'] = os.path.normpath(browser_config['firefox'])
browser_config['profile_path'] = os.path.normpath(browser_config['profile_path'])
if browser_config['profile_path'] != {}:
browser_config['profile_path'] = os.path.normpath(browser_config['profile_path'])
for dir in browser_config['dirs']:
browser_config['dirs'][dir] = os.path.normpath(browser_config['dirs'][dir])
tests = yaml_config['tests']

View File

@ -102,19 +102,25 @@ def runTest(browser_config, test_config):
# add any provided directories to the installed firefox
for dir in browser_config['dirs']:
ffsetup.InstallInBrowser(browser_config['firefox'], browser_config['dirs'][dir])
# Create the new profile
profile_dir = ffsetup.CreateTempProfileDir(browser_config['profile_path'],
browser_config['preferences'],
browser_config['extensions'])
utils.debug("created profile")
# Run Firefox once with new profile so initializing it doesn't cause
# a performance hit, and the second Firefox that gets created is properly
# terminated.
res = ffsetup.InitializeNewProfile(browser_config['firefox'], profile_dir, browser_config['init_url'])
if not res:
print "FAIL: couldn't initialize firefox"
return (res, all_browser_results, all_counter_results)
res = 0
if browser_config["profile_path"] != {}:
# Create the new profile
profile_dir = ffsetup.CreateTempProfileDir(browser_config['profile_path'],
browser_config['preferences'],
browser_config['extensions'])
utils.debug("created profile")
# Run Firefox once with new profile so initializing it doesn't cause
# a performance hit, and the second Firefox that gets created is properly
# terminated.
res = ffsetup.InitializeNewProfile(browser_config['firefox'], profile_dir, browser_config['init_url'])
if not res:
print "FAIL: couldn't initialize firefox"
return (res, all_browser_results, all_counter_results)
res = 0
else:
# no profile path was set in the config, set the profile_dir to an empty string.
profile_dir = ""
utils.debug("initialized firefox")
sys.stdout.flush()
@ -130,6 +136,9 @@ def runTest(browser_config, test_config):
if 'url_mod' in test_config:
url += eval(test_config['url_mod'])
command_line = ffprocess.GenerateFirefoxCommandLine(browser_config['firefox'], profile_dir, url)
utils.debug("command line: " + command_line)
process = subprocess.Popen(command_line, stdout=subprocess.PIPE, universal_newlines=True, shell=True, bufsize=0, env=os.environ)
handle = process.stdout