diff options
author | tonyg@chromium.org <tonyg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-12 01:44:09 +0000 |
---|---|---|
committer | tonyg@chromium.org <tonyg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-12 01:44:09 +0000 |
commit | 06cc11993112486b5bcb926e31b9c657465be614 (patch) | |
tree | 24c2e741add28388196d1b34075d3433f796903c /tools | |
parent | 8f083e3f816eed65d59a1dfda4d07d86ed85d47a (diff) | |
download | chromium_src-06cc11993112486b5bcb926e31b9c657465be614.zip chromium_src-06cc11993112486b5bcb926e31b9c657465be614.tar.gz chromium_src-06cc11993112486b5bcb926e31b9c657465be614.tar.bz2 |
[Telemetry] Add an --extra-wpr-args flag.
This is useful for running telemetry under simulated bandwidth conditions. For
example, to run with DSL speed, pass:
--extra-wpr-args="--shaping_type=proxy --net=dsl"
BUG=None
TEST=tools/perf/run_multipage_benchmarks --extra-wpr-args="--shaping_type=proxy --net=dsl" --browser=system loading_benchmark tools/perf/page_sets/top_25.json
NOTRY=True
Review URL: https://codereview.chromium.org/12224111
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@181815 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools')
-rw-r--r-- | tools/telemetry/telemetry/browser_options.py | 10 | ||||
-rw-r--r-- | tools/telemetry/telemetry/wpr_server.py | 2 |
2 files changed, 11 insertions, 1 deletions
diff --git a/tools/telemetry/telemetry/browser_options.py b/tools/telemetry/telemetry/browser_options.py index a174e13..631499c 100644 --- a/tools/telemetry/telemetry/browser_options.py +++ b/tools/telemetry/telemetry/browser_options.py @@ -24,6 +24,7 @@ class BrowserOptions(optparse.Values): self.dont_override_profile = False self.extra_browser_args = [] + self.extra_wpr_args = [] self.show_stdout = False self.cros_remote = None @@ -86,6 +87,10 @@ class BrowserOptions(optparse.Values): group.add_option('--extra-browser-args', dest='extra_browser_args_as_string', help='Additional arguments to pass to the browser when it starts') + group.add_option('--extra-wpr-args', + dest='extra_wpr_args_as_string', + help=('Additional arguments to pass to Web Page Replay. ' + 'See third_party/webpagereplay/replay.py for usage.')) group.add_option('--show-stdout', action='store_true', help='When possible, will display the stdout of the process') @@ -151,6 +156,11 @@ class BrowserOptions(optparse.Values): self.extra_browser_args_as_string) # pylint: disable=E1101 self.extra_browser_args.extend(tmp) delattr(self, 'extra_browser_args_as_string') + if self.extra_wpr_args_as_string: # pylint: disable=E1101 + tmp = shlex.split( + self.extra_wpr_args_as_string) # pylint: disable=E1101 + self.extra_wpr_args.extend(tmp) + delattr(self, 'extra_wpr_args_as_string') return ret parser.parse_args = ParseArgs return parser diff --git a/tools/telemetry/telemetry/wpr_server.py b/tools/telemetry/telemetry/wpr_server.py index 3a3bc00..ca155dd 100644 --- a/tools/telemetry/telemetry/wpr_server.py +++ b/tools/telemetry/telemetry/wpr_server.py @@ -37,7 +37,7 @@ class ReplayServer(object): util.PortPair(self._webpagereplay_local_https_port, self._webpagereplay_remote_https_port)) - options = [] + options = browser_backend.options.extra_wpr_args if self._is_record_mode: options.append('--record') if not browser_backend.options.wpr_make_javascript_deterministic: |