# HG changeset patch # Parent cc0c3f9fb9fa1e6c9fd35167c5995e1feb5a2db8 diff --git a/PerfConfigurator.py b/PerfConfigurator.py --- a/PerfConfigurator.py +++ b/PerfConfigurator.py @@ -23,17 +23,18 @@ import optparse defaultTitle = "qm-pxp01" class PerfConfigurator: attributes = ['exePath', 'configPath', 'sampleConfig', 'outputName', 'title', 'branch', 'branchName', 'buildid', 'currentDate', 'browserWait', 'verbose', 'testDate', 'useId', 'resultsServer', 'resultsLink', 'activeTests', 'noChrome', 'fast', 'testPrefix', 'extension', - 'masterIniSubpath', 'test_timeout', 'symbolsPath', 'addonID', 'noShutdown']; + 'masterIniSubpath', 'test_timeout', 'symbolsPath', 'addonID', + 'noShutdown', 'extraPrefs']; masterIniSubpath = "application.ini" def _dumpConfiguration(self): """dump class configuration for convenient pickup or perusal""" print "Writing configuration:" for i in self.attributes: print " - %s = %s" % (i, getattr(self, i)) @@ -150,16 +151,26 @@ class PerfConfigurator: printMe = True if (test == 'tp') and self.fast: #only affects the tp test name newline = newline.replace('tp', 'tp_fast') if self.testPrefix: newline = newline.replace(test, self.testPrefix + '_' + test) if self.noChrome: #if noChrome is True remove --tpchrome option newline = line.replace('-tpchrome ','') + + if self.extraPrefs != [] and (re.match('^\s*preferences :\s*$', line)): + newline = 'preferences :\n' + for v in self.extraPrefs: + thispref = v.split("=") + if len(thispref) < 2: + print "Error: syntax error in --setPref=" + v + sys.exit(1) + newline += ' %s: %s\n' % (thispref[0], thispref[1]) + return printMe, newline def writeConfigFile(self): try: configFile = open(path.join(self.configPath, self.sampleConfig)) except: raise Configuration("unable to find %s, please check your filename for --sampleConfig" % path.join(self.configPath, self.sampleConfig)) @@ -317,16 +328,22 @@ class TalosOptions(optparse.OptionParser action = "store", dest = "addonID", help = "ID of the extension being tested") defaults["addonID"] = '' self.add_option("--noShutdown", action = "store_true", dest = "noShutdown", help = "Record time browser takes to shutdown after testing") defaults["noShutdown"] = 'False' + self.add_option("--setPref", + action = "append", type = "string", + dest = "extraPrefs", metavar = "PREF=VALUE", + help = "defines an extra user preference") + defaults["extraPrefs"] = [] + self.set_defaults(**defaults) def main(argv=None): parser = TalosOptions() options, args = parser.parse_args() configurator = PerfConfigurator(options); try: configurator.writeConfigFile() diff --git a/sample.config b/sample.config --- a/sample.config +++ b/sample.config @@ -99,16 +99,28 @@ tests : cycles : 20 timeout: 150 win_counters : [] w7_counters : [] linux_counters : [] mac_counters : [] shutdown : True profile_path: base_profile +- name: ts_paint + url : startup_test/tspaint_test.html?begin= + url_mod : str(int(time.time()*1000)) + resolution : 1 + cycles : 20 + timeout: 150 + win_counters : [] + w7_counters : [] + linux_counters : [] + mac_counters : [] + shutdown : False + profile_path: base_profile - name: ts_cold url : startup_test/startup_test.html?begin= url_mod : str(int(time.time()*1000)) resolution : 1 cycles : 20 win_counters : [] w7_counters : [] linux_counters : [] @@ -271,16 +283,27 @@ tests : cycles : 1 timeout : 300 win_counters: [] w7_counters : [] linux_counters : [] mac_counters : [] shutdown : False profile_path: base_profile +- name: tpaint + url: startup_test/twinopen/winopen.xul?mozafterpaint=1%26phase1=20 + resolution: 1 + cycles : 1 + timeout : 300 + win_counters: [] + w7_counters : [] + linux_counters : [] + mac_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 cycles : 1 win_counters : [] w7_counters : [] linux_counters : [] mac_counters : [] diff --git a/startup_test/tspaint_test.html b/startup_test/tspaint_test.html new file mode 100755 --- /dev/null +++ b/startup_test/tspaint_test.html @@ -0,0 +1,66 @@ + + + + + + + + + + + + + diff --git a/startup_test/twinopen/tpaint-window.html b/startup_test/twinopen/tpaint-window.html new file mode 100644 --- /dev/null +++ b/startup_test/twinopen/tpaint-window.html @@ -0,0 +1,14 @@ + + + + + diff --git a/startup_test/twinopen/winopen.js b/startup_test/twinopen/winopen.js --- a/startup_test/twinopen/winopen.js +++ b/startup_test/twinopen/winopen.js @@ -1,10 +1,10 @@ // target for window.open() -const KID_URL = "child-window.html"; +var KID_URL = "child-window.html"; // formats final results const SERVER_URL = "http://jrgm.mcom.com/cgi-bin/window-open-2.0/openreport.pl"; // let system settle between each window.open const OPENER_DELAY = 1000; // three phases: single open/close; overlapped open/close; open-all/close-all @@ -20,34 +20,39 @@ var CYCLES = 1; // autoclose flag var AUTOCLOSE = 1; // Chrome url for child windows. var KID_CHROME = null; var SAVED_CHROME = null; +// measure after receiving the mozafterpaint event +var MOZ_AFTER_PAINT = 0; + // URL options and correspnding vars. const options = [ [ "phase1", "PHASE_ONE", false ], [ "phase2", "PHASE_TWO", false ], [ "phase3", "PHASE_THREE", false ], [ "overlap", "OVERLAP_COUNT", false ], [ "cycles", "CYCLES", false ], [ "chrome", "KID_CHROME", true ], + [ "mozafterpaint", "MOZ_AFTER_PAINT", false ], [ "close", "AUTOCLOSE", false ] ]; // Note: You can attach search options to the url for this file to control // any of the options in the array above. E.g., specifying // mozilla -chrome "file:///D|/mozilla/xpfe/test/winopen.xul?phase1=16&close=0" // will run this script with PHASE_ONE=16 and AUTOCLOSE=0. // // On Win32, you must enclose the -chrome option in quotes in order pass funny Win32 shell // characters such as '&' or '|'! -var opts = window.location.search.substring(1).split( '&' ); +var s = window.location.search.substring(1); +var opts = s.replace("%26", "&").split('&'); for ( opt in opts ) { for ( var i in options ) { if ( opts[opt].indexOf( options[i][0]+"=" ) == 0 ) { var newVal = opts[opt].split( '=' )[ 1 ]; // wrap with quotes, if required. if ( options[i][2] ) { newVal = '"' + newVal + '"'; } @@ -232,17 +237,22 @@ function restoreChromeURL() { // Restore browser.chromeURL pref. if ( KID_CHROME && SAVED_CHROME.length ) { netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); prefs.setCharPref( "browser.chromeURL", SAVED_CHROME ); } } function openWindow() { + if (MOZ_AFTER_PAINT == 1) { + KID_URL = "tpaint-window.html"; + } + startingTimes[currentIndex] = (new Date()).getTime(); var path = window.location.pathname.substring( 0, window.location.pathname.lastIndexOf('/') ); var url = window.location.protocol + "//" + window.location.hostname + path + "/" + KID_URL; + windowList[currentIndex] = window.open(url, currentIndex); }