summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authortonyg@chromium.org <tonyg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-06 00:33:09 +0000
committertonyg@chromium.org <tonyg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-06 00:33:09 +0000
commit6e2ae447c11d46feab5a01ef562513a743aa560b (patch)
treee29c2557d7f5297b7f3873a74ed116f281944fab /tools
parentaab1b9ead19f21af4f752c4a52beed65009d96fb (diff)
downloadchromium_src-6e2ae447c11d46feab5a01ef562513a743aa560b.zip
chromium_src-6e2ae447c11d46feab5a01ef562513a743aa560b.tar.gz
chromium_src-6e2ae447c11d46feab5a01ef562513a743aa560b.tar.bz2
[chrome-remote-control] Move multipage_benchmark_runner to chrome_remote_control
BUG=None TEST=None Review URL: https://codereview.chromium.org/11369083 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@166092 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools')
-rwxr-xr-xtools/chrome_remote_control/chrome_remote_control/multi_page_benchmark_runner.py (renamed from tools/perf/perf_tools/multipage_benchmark_runner.py)15
-rwxr-xr-xtools/perf/run_multipage_benchmarks7
2 files changed, 13 insertions, 9 deletions
diff --git a/tools/perf/perf_tools/multipage_benchmark_runner.py b/tools/chrome_remote_control/chrome_remote_control/multi_page_benchmark_runner.py
index 0a8cd6d..7b58a97 100755
--- a/tools/perf/perf_tools/multipage_benchmark_runner.py
+++ b/tools/chrome_remote_control/chrome_remote_control/multi_page_benchmark_runner.py
@@ -26,7 +26,7 @@ def _Discover(start_dir, clazz):
Returns:
dict of {module_name: class}.
"""
- top_level_dir = os.path.join(os.path.dirname(__file__), '..')
+ top_level_dir = os.path.join(start_dir, '..')
classes = {}
for dirpath, _, filenames in os.walk(start_dir):
for filename in filenames:
@@ -49,13 +49,13 @@ def _Discover(start_dir, clazz):
return classes
-def Main():
+def Main(benchmark_dir):
"""Turns a MultiPageBenchmark into a command-line program.
- If args is not specified, sys.argv[1:] is used.
+ Args:
+ benchmark_dir: Path to directory containing MultiPageBenchmarks.
"""
- start_dir = os.path.dirname(__file__)
- benchmarks = _Discover(start_dir, multi_page_benchmark.MultiPageBenchmark)
+ benchmarks = _Discover(benchmark_dir, multi_page_benchmark.MultiPageBenchmark)
# 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.
@@ -78,9 +78,10 @@ def Main():
parser.print_usage()
import page_sets # pylint: disable=F0401
print >> sys.stderr, 'Available benchmarks:\n%s\n' % ',\n'.join(
- benchmarks.keys())
+ sorted(benchmarks.keys()))
print >> sys.stderr, 'Available page_sets:\n%s\n' % ',\n'.join(
- [os.path.relpath(f) for f in page_sets.GetAllPageSetFilenames()])
+ sorted([os.path.relpath(f)
+ for f in page_sets.GetAllPageSetFilenames()]))
sys.exit(1)
ps = page_set.PageSet.FromFile(args[1])
diff --git a/tools/perf/run_multipage_benchmarks b/tools/perf/run_multipage_benchmarks
index 602ec19..c859c30 100755
--- a/tools/perf/run_multipage_benchmarks
+++ b/tools/perf/run_multipage_benchmarks
@@ -2,9 +2,12 @@
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+import os
import sys
-import perf_tools.multipage_benchmark_runner
+import perf_tools
+from chrome_remote_control import multi_page_benchmark_runner
if __name__ == '__main__':
- sys.exit(perf_tools.multipage_benchmark_runner.Main())
+ benchmark_dir = os.path.join(os.path.dirname(__file__), 'perf_tools')
+ sys.exit(multi_page_benchmark_runner.Main(benchmark_dir))