aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/skp
diff options
context:
space:
mode:
authorGravatar rmistry <rmistry@google.com>2015-04-23 12:47:33 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-04-23 12:47:33 -0700
commitaa31ee78eecef34128aa1eaf0e1bb9398a7caec5 (patch)
tree7aa99962b25b99b2201e16943fe6372df386c2d5 /tools/skp
parente1d7e0f0a5de883fa1a2ff935c718220c7643101 (diff)
Add ability to specify extra browser args and a prefix for SKP names to webpages_playback.py
BUG=skia:3763 NOTRY=true Review URL: https://codereview.chromium.org/1066933006
Diffstat (limited to 'tools/skp')
-rw-r--r--tools/skp/webpages_playback.py20
1 files changed, 18 insertions, 2 deletions
diff --git a/tools/skp/webpages_playback.py b/tools/skp/webpages_playback.py
index e81f77c57c..1bd2163911 100644
--- a/tools/skp/webpages_playback.py
+++ b/tools/skp/webpages_playback.py
@@ -138,6 +138,10 @@ class SkPicturePlayback(object):
"""Constructs a SkPicturePlayback BuildStep instance."""
assert parse_options.browser_executable, 'Must specify --browser_executable'
self._browser_executable = parse_options.browser_executable
+ self._browser_args = '--disable-setuid-sandbox'
+ if parse_options.browser_extra_args:
+ self._browser_args = '%s %s' % (
+ self._browser_args, parse_options.browser_extra_args)
self._chrome_page_sets_path = os.path.join(parse_options.chrome_src_path,
CHROMIUM_PAGE_SETS_PATH)
@@ -148,6 +152,7 @@ class SkPicturePlayback(object):
self._skia_tools = parse_options.skia_tools
self._non_interactive = parse_options.non_interactive
self._upload = parse_options.upload
+ self._skp_prefix = parse_options.skp_prefix
data_store_location = parse_options.data_store
if data_store_location.startswith(gs_utils.GS_PREFIX):
self.gs = GoogleStorageDataStore(data_store_location)
@@ -247,7 +252,7 @@ class SkPicturePlayback(object):
'PYTHONPATH=%s:$PYTHONPATH' % page_set_dir,
'DISPLAY=%s' % X11_DISPLAY,
os.path.join(self._telemetry_binaries_dir, 'record_wpr'),
- '--extra-browser-args=--disable-setuid-sandbox',
+ '--extra-browser-args="%s"' % self._browser_args,
'--browser=exact',
'--browser-executable=%s' % self._browser_executable,
'%s_page_set' % page_set_basename,
@@ -286,7 +291,7 @@ class SkPicturePlayback(object):
'DISPLAY=%s' % X11_DISPLAY,
'timeout', '300',
os.path.join(self._telemetry_binaries_dir, 'run_benchmark'),
- '--extra-browser-args=--disable-setuid-sandbox',
+ '--extra-browser-args="%s"' % self._browser_args,
'--browser=exact',
'--browser-executable=%s' % self._browser_executable,
SKP_BENCHMARK,
@@ -409,6 +414,9 @@ class SkPicturePlayback(object):
filename = self._GetSkiaSkpFileName(page_set)
filename = filename.lower()
+ if self._skp_prefix:
+ filename = '%s%s' % (self._skp_prefix, filename)
+
# We choose the largest .skp as the most likely to be interesting.
largest_skp = max(glob.glob(os.path.join(site, '*.skp')),
key=lambda path: os.stat(path).st_size)
@@ -546,6 +554,10 @@ if '__main__' == __name__:
help='The exact browser executable to run.',
default=None)
option_parser.add_option(
+ '', '--browser_extra_args',
+ help='Additional arguments to pass to the browser.',
+ default=None)
+ option_parser.add_option(
'', '--chrome_src_path',
help='Path to the chromium src directory.',
default=None)
@@ -554,6 +566,10 @@ if '__main__' == __name__:
help='Runs the script without any prompts. If this flag is specified and '
'--skia_tools is specified then the debugger is not run.',
default=False)
+ option_parser.add_option(
+ '', '--skp_prefix',
+ help='Prefix to add to the names of generated SKPs.',
+ default=None)
options, unused_args = option_parser.parse_args()
playback = SkPicturePlayback(options)