bug 414660: Add ts test to talos that uses a dirty profile - support dirty profile testing in talos. r=bhearsum, patch=anodelman
git-svn-id: svn://10.0.0.236/trunk@258188 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0"?>
|
||||
<RDF:RDF xmlns:NC="http://home.netscape.com/NC-rdf#"
|
||||
xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
|
||||
<RDF:Description RDF:about="chrome://browser/content/browser.xul#toolbar-menubar"
|
||||
currentset="menubar-items,spring,gwa-status-button,gwa-speedo-button,throbber-box" />
|
||||
<RDF:Description RDF:about="chrome://browser/content/browser.xul#main-window"
|
||||
width="1024"
|
||||
height="768"
|
||||
sizemode="normal"
|
||||
screenX="0"
|
||||
screenY="0" />
|
||||
<RDF:Description RDF:about="chrome://browser/content/browser.xul">
|
||||
<NC:persist RDF:resource="chrome://browser/content/browser.xul#main-window"/>
|
||||
<NC:persist RDF:resource="chrome://browser/content/browser.xul#toolbar-menubar"/>
|
||||
<NC:persist RDF:resource="chrome://browser/content/browser.xul#sidebar-box"/>
|
||||
<NC:persist RDF:resource="chrome://browser/content/browser.xul#sidebar-title"/>
|
||||
</RDF:Description>
|
||||
<RDF:Description RDF:about="chrome://browser/content/browser.xul#sidebar-box"
|
||||
sidebarcommand=""
|
||||
width=""
|
||||
src="" />
|
||||
</RDF:RDF>
|
||||
@@ -0,0 +1,11 @@
|
||||
// This file is needed to work around a Firefox bug where capability.principal
|
||||
// prefs in user.js don't get recognized until the second browser launch
|
||||
// which is too late for our purposes of using quit.js. Loading the principals
|
||||
// from prefs.js avoids this issue.
|
||||
user_pref("capability.principal.codebase.p0.granted", "UniversalPreferencesWrite UniversalXPConnect UniversalPreferencesRead");
|
||||
user_pref("capability.principal.codebase.p0.id", "file://");
|
||||
user_pref("capability.principal.codebase.p0.subjectName", "");
|
||||
user_pref("capability.principal.codebase.p1.granted", "UniversalPreferencesWrite UniversalXPConnect UniversalPreferencesRead");
|
||||
user_pref("capability.principal.codebase.p1.id", "http://localhost");
|
||||
user_pref("capability.principal.codebase.p1.subjectName", "");
|
||||
user_pref("signed.applets.codebase_principal_support", true);
|
||||
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0"?>
|
||||
<RDF:RDF xmlns:NC="http://home.netscape.com/NC-rdf#"
|
||||
xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
|
||||
<RDF:Description RDF:about="chrome://browser/content/browser.xul#toolbar-menubar"
|
||||
currentset="menubar-items,spring,gwa-status-button,gwa-speedo-button,throbber-box" />
|
||||
<RDF:Description RDF:about="chrome://browser/content/browser.xul#main-window"
|
||||
width="1024"
|
||||
height="768"
|
||||
sizemode="normal"
|
||||
screenX="0"
|
||||
screenY="0" />
|
||||
<RDF:Description RDF:about="chrome://browser/content/browser.xul">
|
||||
<NC:persist RDF:resource="chrome://browser/content/browser.xul#main-window"/>
|
||||
<NC:persist RDF:resource="chrome://browser/content/browser.xul#toolbar-menubar"/>
|
||||
<NC:persist RDF:resource="chrome://browser/content/browser.xul#sidebar-box"/>
|
||||
<NC:persist RDF:resource="chrome://browser/content/browser.xul#sidebar-title"/>
|
||||
</RDF:Description>
|
||||
<RDF:Description RDF:about="chrome://browser/content/browser.xul#sidebar-box"
|
||||
sidebarcommand=""
|
||||
width=""
|
||||
src="" />
|
||||
</RDF:RDF>
|
||||
@@ -0,0 +1,11 @@
|
||||
// This file is needed to work around a Firefox bug where capability.principal
|
||||
// prefs in user.js don't get recognized until the second browser launch
|
||||
// which is too late for our purposes of using quit.js. Loading the principals
|
||||
// from prefs.js avoids this issue.
|
||||
user_pref("capability.principal.codebase.p0.granted", "UniversalPreferencesWrite UniversalXPConnect UniversalPreferencesRead");
|
||||
user_pref("capability.principal.codebase.p0.id", "file://");
|
||||
user_pref("capability.principal.codebase.p0.subjectName", "");
|
||||
user_pref("capability.principal.codebase.p1.granted", "UniversalPreferencesWrite UniversalXPConnect UniversalPreferencesRead");
|
||||
user_pref("capability.principal.codebase.p1.id", "http://localhost");
|
||||
user_pref("capability.principal.codebase.p1.subjectName", "");
|
||||
user_pref("signed.applets.codebase_principal_support", true);
|
||||
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0"?>
|
||||
<RDF:RDF xmlns:NC="http://home.netscape.com/NC-rdf#"
|
||||
xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
|
||||
<RDF:Description RDF:about="chrome://browser/content/browser.xul#toolbar-menubar"
|
||||
currentset="menubar-items,spring,gwa-status-button,gwa-speedo-button,throbber-box" />
|
||||
<RDF:Description RDF:about="chrome://browser/content/browser.xul#main-window"
|
||||
width="1024"
|
||||
height="768"
|
||||
sizemode="normal"
|
||||
screenX="0"
|
||||
screenY="0" />
|
||||
<RDF:Description RDF:about="chrome://browser/content/browser.xul">
|
||||
<NC:persist RDF:resource="chrome://browser/content/browser.xul#main-window"/>
|
||||
<NC:persist RDF:resource="chrome://browser/content/browser.xul#toolbar-menubar"/>
|
||||
<NC:persist RDF:resource="chrome://browser/content/browser.xul#sidebar-box"/>
|
||||
<NC:persist RDF:resource="chrome://browser/content/browser.xul#sidebar-title"/>
|
||||
</RDF:Description>
|
||||
<RDF:Description RDF:about="chrome://browser/content/browser.xul#sidebar-box"
|
||||
sidebarcommand=""
|
||||
width=""
|
||||
src="" />
|
||||
</RDF:RDF>
|
||||
@@ -0,0 +1,11 @@
|
||||
// This file is needed to work around a Firefox bug where capability.principal
|
||||
// prefs in user.js don't get recognized until the second browser launch
|
||||
// which is too late for our purposes of using quit.js. Loading the principals
|
||||
// from prefs.js avoids this issue.
|
||||
user_pref("capability.principal.codebase.p0.granted", "UniversalPreferencesWrite UniversalXPConnect UniversalPreferencesRead");
|
||||
user_pref("capability.principal.codebase.p0.id", "file://");
|
||||
user_pref("capability.principal.codebase.p0.subjectName", "");
|
||||
user_pref("capability.principal.codebase.p1.granted", "UniversalPreferencesWrite UniversalXPConnect UniversalPreferencesRead");
|
||||
user_pref("capability.principal.codebase.p1.id", "http://localhost");
|
||||
user_pref("capability.principal.codebase.p1.subjectName", "");
|
||||
user_pref("signed.applets.codebase_principal_support", true);
|
||||
@@ -99,7 +99,7 @@ def send_to_csv(csv_dir, results):
|
||||
for res in results:
|
||||
browser_dump, counter_dump = results[res]
|
||||
writer = csv.writer(open(os.path.join(csv_dir, res + '.csv'), "wb"))
|
||||
if res in ('ts', 'twinopen'):
|
||||
if res in ('ts', 'twinopen', 'ts_places_generated_max', 'ts_places_generated_min', 'ts_places_generated_med'):
|
||||
i = 0
|
||||
writer.writerow(['i', 'val'])
|
||||
for val in browser_dump:
|
||||
@@ -191,7 +191,7 @@ def send_to_graph(results_server, results_link, machine, date, browser_config, r
|
||||
utils.debug("Working with test: " + testname)
|
||||
utils.debug("Sending results: " + " ".join(browser_dump))
|
||||
utils.stamped_msg("Generating results file: " + testname, "Started")
|
||||
if testname in ('ts', 'twinopen'):
|
||||
if testname in ('ts', 'twinopen', 'ts_places_generated_max', 'ts_places_generated_min', 'ts_places_generated_med'):
|
||||
#non-tpformat results
|
||||
for bd in browser_dump:
|
||||
vals.extend([[x, 'NULL'] for x in bd.split('|')])
|
||||
@@ -211,7 +211,7 @@ def send_to_graph(results_server, results_link, machine, date, browser_config, r
|
||||
for count_type in cd:
|
||||
vals = [[x, 'NULL'] for x in cd[count_type]]
|
||||
counterName = testname + '_' + shortName(count_type)
|
||||
if testname not in ('ts', 'twinopen'):
|
||||
if testname in ('ts', 'twinopen', 'ts_places_generated_max', 'ts_places_generated_min', 'ts_places_generated_med'):
|
||||
counterName += browser_config['test_name_extension']
|
||||
utils.stamped_msg("Generating results file: " + counterName, "Started")
|
||||
files.append(construct_file(machine, counterName, browser_config['branch_name'], browser_config['sourcestamp'], browser_config['buildid'], date, vals))
|
||||
@@ -340,7 +340,6 @@ def test_file(filename):
|
||||
'extra_args' : yaml_config['extra_args'],
|
||||
'branch' : yaml_config['branch'],
|
||||
'buildid' : yaml_config['buildid'],
|
||||
'profile_path' : yaml_config['profile_path'],
|
||||
'env' : yaml_config['env'],
|
||||
'dirs' : yaml_config['dirs'],
|
||||
'init_url' : yaml_config['init_url']}
|
||||
@@ -352,8 +351,6 @@ def test_file(filename):
|
||||
browser_config['test_name_extension'] = ''
|
||||
#normalize paths to work accross platforms
|
||||
browser_config['browser_path'] = os.path.normpath(browser_config['browser_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']
|
||||
|
||||
@@ -23,8 +23,6 @@ branch: testbranch
|
||||
|
||||
buildid: testbuildid
|
||||
|
||||
profile_path: base_profile
|
||||
|
||||
init_url: getInfo.html
|
||||
|
||||
# Preferences to set in the test (use "preferences : {}" for no prefs)
|
||||
@@ -91,13 +89,47 @@ tests :
|
||||
win_counters : []
|
||||
unix_counters : []
|
||||
shutdown : True
|
||||
profile_path: base_profile
|
||||
- name: ts_places_generated_max
|
||||
url : startup_test/startup_test.html?begin=
|
||||
url_mod : str(int(time.time()*1000))
|
||||
resolution : 1
|
||||
cycles : 20
|
||||
timeout: 150
|
||||
win_counters : []
|
||||
unix_counters : []
|
||||
shutdown : True
|
||||
profile_path: places_generated_max
|
||||
- name: ts_places_generated_min
|
||||
url : startup_test/startup_test.html?begin=
|
||||
url_mod : str(int(time.time()*1000))
|
||||
resolution : 1
|
||||
cycles : 20
|
||||
timeout: 150
|
||||
win_counters : []
|
||||
unix_counters : []
|
||||
shutdown : True
|
||||
profile_path: places_generated_min
|
||||
- name: ts_places_generated_med
|
||||
url : startup_test/startup_test.html?begin=
|
||||
url_mod : str(int(time.time()*1000))
|
||||
resolution : 1
|
||||
cycles : 20
|
||||
timeout: 150
|
||||
win_counters : []
|
||||
unix_counters : []
|
||||
shutdown : True
|
||||
profile_path: places_generated_med
|
||||
- name: tp
|
||||
o
|
||||
url : '-tp page_load_test/tp3.manifest -tpchrome -tpnoisy -tpformat tinderbox -tpcycles 10'
|
||||
|
||||
resolution : 20
|
||||
cycles : 1
|
||||
win_counters : ['Working Set', 'Private Bytes', '% Processor Time']
|
||||
unix_counters : [ 'Private Bytes', 'RSS']
|
||||
shutdown : True
|
||||
profile_path: base_profile
|
||||
- name: tp4
|
||||
url : '-tp page_load_test/tp4.manifest -tpchrome -tpnoisy -tpformat tinderbox -tpcycles 10'
|
||||
resolution : 20
|
||||
@@ -105,6 +137,7 @@ tests :
|
||||
win_counters : ['Working Set', 'Private Bytes', '% Processor Time']
|
||||
unix_counters : [ 'Private Bytes', 'RSS']
|
||||
shutdown : True
|
||||
profile_path: base_profile
|
||||
- name: tp_js
|
||||
url : '"http://localhost/page_load_test/framecycler.html?quit=1&cycles=5"'
|
||||
resolution : 1
|
||||
@@ -112,6 +145,7 @@ tests :
|
||||
win_counters : ['Working Set', 'Private Bytes', '% Processor Time']
|
||||
unix_counters : [ 'Private Bytes', 'RSS']
|
||||
shutdown : False
|
||||
profile_path: base_profile
|
||||
- name: tdhtml
|
||||
url: '-tp page_load_test/dhtml/dhtml.manifest -tpchrome -tpnoisy -tpformat tinderbox -tpcycles 5'
|
||||
resolution : 1
|
||||
@@ -119,6 +153,7 @@ tests :
|
||||
win_counters : []
|
||||
unix_counters : []
|
||||
shutdown : False
|
||||
profile_path: base_profile
|
||||
- name: tgfx
|
||||
url: '-tp page_load_test/gfx/gfx.manifest -tpchrome -tpnoisy -tpformat tinderbox -tpcycles 5 -tprender'
|
||||
resolution : 1
|
||||
@@ -126,6 +161,7 @@ tests :
|
||||
win_counters : []
|
||||
unix_counters : []
|
||||
shutdown : False
|
||||
profile_path: base_profile
|
||||
- name: tsvg
|
||||
url: '-tp page_load_test/svg/svg.manifest -tpchrome -tpnoisy -tpformat tinderbox -tpcycles 5'
|
||||
resolution : 1
|
||||
@@ -133,6 +169,7 @@ tests :
|
||||
win_counters : []
|
||||
unix_counters : []
|
||||
shutdown : False
|
||||
profile_path: base_profile
|
||||
- name: twinopen
|
||||
url: startup_test/twinopen/winopen.xul?phase1=20
|
||||
resolution: 1
|
||||
@@ -141,6 +178,7 @@ tests :
|
||||
win_counters: []
|
||||
unix_counters : []
|
||||
shutdown : False
|
||||
profile_path: base_profile
|
||||
- name: tjss
|
||||
url: '-tp page_load_test/jss/jss.manifest -tpchrome -tpnoisy -tpformat tinderbox -tpcycles 1'
|
||||
resolution : 1
|
||||
@@ -148,6 +186,7 @@ tests :
|
||||
win_counters : []
|
||||
unix_counters : []
|
||||
shutdown : False
|
||||
profile_path: base_profile
|
||||
- name: tsspider
|
||||
url: '-tp page_load_test/sunspider/sunspider.manifest -tpchrome -tpnoisy -tpformat tinderbox -tpcycles 5'
|
||||
resolution : 1
|
||||
@@ -155,3 +194,4 @@ tests :
|
||||
win_counters : []
|
||||
unix_counters : []
|
||||
shutdown : False
|
||||
profile_path: base_profile
|
||||
|
||||
@@ -84,33 +84,27 @@ RESULTS_TP_REGEX = re.compile('__start_tp_report(.*?)__end_tp_report.*?__startTi
|
||||
re.DOTALL | re.MULTILINE)
|
||||
RESULTS_REGEX_FAIL = re.compile('__FAIL(.*?)__FAIL', re.DOTALL|re.MULTILINE)
|
||||
|
||||
def createProfile(browser_config):
|
||||
if browser_config["profile_path"] != {}:
|
||||
# Create the new profile
|
||||
temp_dir, profile_dir = ffsetup.CreateTempProfileDir(browser_config['profile_path'],
|
||||
browser_config['preferences'],
|
||||
browser_config['extensions'])
|
||||
utils.debug("created profile")
|
||||
else:
|
||||
# no profile path was set in the config, set the profile_dir to an empty string.
|
||||
profile_dir = ""
|
||||
def createProfile(profile_path, browser_config):
|
||||
# Create the new profile
|
||||
temp_dir, profile_dir = ffsetup.CreateTempProfileDir(profile_path,
|
||||
browser_config['preferences'],
|
||||
browser_config['extensions'])
|
||||
utils.debug("created profile")
|
||||
return profile_dir, temp_dir
|
||||
|
||||
def initializeProfile(profile_dir, browser_config):
|
||||
if browser_config["profile_path"] != {}:
|
||||
if not (ffsetup.InitializeNewProfile(browser_config['browser_path'], browser_config['process'], browser_config['browser_wait'], browser_config['extra_args'], profile_dir, browser_config['init_url'], browser_config['browser_log'])):
|
||||
raise talosError("failed to initialize browser")
|
||||
time.sleep(browser_config['browser_wait'])
|
||||
if ffprocess.checkAllProcesses(browser_config['process']):
|
||||
raise talosError("browser failed to close after being initialized")
|
||||
if not (ffsetup.InitializeNewProfile(browser_config['browser_path'], browser_config['process'], browser_config['browser_wait'], browser_config['extra_args'], profile_dir, browser_config['init_url'], browser_config['browser_log'])):
|
||||
raise talosError("failed to initialize browser")
|
||||
time.sleep(browser_config['browser_wait'])
|
||||
if ffprocess.checkAllProcesses(browser_config['process']):
|
||||
raise talosError("browser failed to close after being initialized")
|
||||
|
||||
def cleanupProfile(dir, browser_config):
|
||||
def cleanupProfile(dir):
|
||||
# Delete the temp profile directory Make it writeable first,
|
||||
# because every once in a while browser seems to drop a read-only
|
||||
# file into it.
|
||||
if browser_config["profile_path"] != {}:
|
||||
ffsetup.MakeDirectoryContentsWritable(dir)
|
||||
shutil.rmtree(dir)
|
||||
ffsetup.MakeDirectoryContentsWritable(dir)
|
||||
shutil.rmtree(dir)
|
||||
|
||||
def checkForCrashes(browser_config, profile_dir):
|
||||
if platform.system() in ('Windows', 'Microsoft'):
|
||||
@@ -171,8 +165,10 @@ def runTest(browser_config, test_config):
|
||||
# add any provided directories to the installed browser
|
||||
for dir in browser_config['dirs']:
|
||||
ffsetup.InstallInBrowser(browser_config['browser_path'], browser_config['dirs'][dir])
|
||||
|
||||
profile_dir, temp_dir = createProfile(browser_config)
|
||||
|
||||
# make profile path work cross-platform
|
||||
test_config['profile_path'] = os.path.normpath(test_config['profile_path'])
|
||||
profile_dir, temp_dir = createProfile(test_config['profile_path'], browser_config)
|
||||
if os.path.isfile(browser_config['browser_log']):
|
||||
os.chmod(browser_config['browser_log'], 0777)
|
||||
os.remove(browser_config['browser_log'])
|
||||
@@ -285,7 +281,7 @@ def runTest(browser_config, test_config):
|
||||
all_counter_results.append(counter_results)
|
||||
|
||||
ffprocess.cleanupProcesses(browser_config['process'], browser_config['browser_wait'])
|
||||
cleanupProfile(temp_dir, browser_config)
|
||||
cleanupProfile(temp_dir)
|
||||
|
||||
utils.restoreEnvironmentVars()
|
||||
if test_config['shutdown']:
|
||||
@@ -311,7 +307,7 @@ def runTest(browser_config, test_config):
|
||||
pass
|
||||
|
||||
if vars().has_key('temp_dir'):
|
||||
cleanupProfile(temp_dir, browser_config)
|
||||
cleanupProfile(temp_dir)
|
||||
except talosError, te:
|
||||
utils.debug("cleanup error: " + te.msg)
|
||||
except:
|
||||
|
||||
Reference in New Issue
Block a user