summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorvollick@chromium.org <vollick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-10-22 19:49:11 +0000
committervollick@chromium.org <vollick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-10-22 19:49:11 +0000
commitf4900c1aecffdde4ef4953368e527451fd380667 (patch)
tree40e2b38a7d39463ec5652eb388af5e5d315a379b /tools
parent6fbb01f5b00c8d430a7f8a153c25dd4dca30f70b (diff)
downloadchromium_src-f4900c1aecffdde4ef4953368e527451fd380667.zip
chromium_src-f4900c1aecffdde4ef4953368e527451fd380667.tar.gz
chromium_src-f4900c1aecffdde4ef4953368e527451fd380667.tar.bz2
Allow benchmark-specific options
Cannot currently use --report-all-results with the scrolling benchmark. We could make an argument for a common set of benchmark options, and --report-all-results seems like exactly the sort of option that would fit there, but in any case, we should support browser-specific options. BUG=None R=tonyg Review URL: https://chromiumcodereview.appspot.com/11231040 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@163345 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools')
-rwxr-xr-xtools/perf/perf_tools/multipage_benchmark_runner.py20
1 files changed, 15 insertions, 5 deletions
diff --git a/tools/perf/perf_tools/multipage_benchmark_runner.py b/tools/perf/perf_tools/multipage_benchmark_runner.py
index 551828e..db7861c 100755
--- a/tools/perf/perf_tools/multipage_benchmark_runner.py
+++ b/tools/perf/perf_tools/multipage_benchmark_runner.py
@@ -36,11 +36,25 @@ def Main():
If args is not specified, sys.argv[1:] is used.
"""
+
+ # Naively find the benchmark. If we use the browser options parser, we run
+ # the risk of failing to parse if we use a benchmark-specific parameter.
+ benchmark_name = None
+ for arg in sys.argv:
+ if arg in _BENCHMARKS:
+ benchmark_name = arg
+
options = browser_options.BrowserOptions()
parser = options.CreateParser('%prog [options] <benchmark> <page_set>')
+
+ benchmark = None
+ if benchmark_name is not None:
+ benchmark = _BENCHMARKS[benchmark_name]()
+ benchmark.AddOptions(parser)
+
_, args = parser.parse_args()
- if len(args) != 2 or args[0] not in _BENCHMARKS:
+ if benchmark is None or len(args) != 2:
parser.print_usage()
import page_sets # pylint: disable=F0401
print >> sys.stderr, 'Available benchmarks:\n%s\n' % ',\n'.join(
@@ -49,12 +63,8 @@ def Main():
[os.path.relpath(f) for f in page_sets.GetAllPageSetFilenames()])
sys.exit(1)
- benchmark = _BENCHMARKS[args[0]]()
ps = page_set.PageSet.FromFile(args[1])
- benchmark.AddOptions(parser)
- _, args = parser.parse_args()
-
benchmark.CustomizeBrowserOptions(options)
possible_browser = browser_finder.FindBrowser(options)
if not possible_browser: