Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(328)

Unified Diff: testing/scripts/run_telemetry_as_googletest.py

Issue 2526663002: Refactor xvfb.py (Closed)
Patch Set: Fix tests Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | testing/xvfb.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: testing/scripts/run_telemetry_as_googletest.py
diff --git a/testing/scripts/run_telemetry_as_googletest.py b/testing/scripts/run_telemetry_as_googletest.py
index db489b8156a224a02f9b9203c70fde80dbf8f33b..77f45e8bbc5e7f760be91abe4751827e991b8e9f 100755
--- a/testing/scripts/run_telemetry_as_googletest.py
+++ b/testing/scripts/run_telemetry_as_googletest.py
@@ -48,17 +48,10 @@ def main():
break
index += 1
- xvfb_proc = None
- openbox_proc = None
- xcompmgr_proc = None
- env = os.environ.copy()
- if args.xvfb and xvfb.should_start_xvfb(env):
- xvfb_proc, openbox_proc, xcompmgr_proc = xvfb.start_xvfb(env=env,
- build_dir='.')
- assert xvfb_proc and openbox_proc and xcompmgr_proc, 'Failed to start xvfb'
# Compatibility with gtest-based sharding.
total_shards = None
shard_index = None
+ env = os.environ.copy()
if 'GTEST_TOTAL_SHARDS' in env:
total_shards = int(env['GTEST_TOTAL_SHARDS'])
del env['GTEST_TOTAL_SHARDS']
@@ -71,14 +64,12 @@ def main():
'--total-shards=%d' % total_shards,
'--shard-index=%d' % shard_index
]
- try:
- return common.run_command([sys.executable] + rest_args + sharding_args + [
- '--write-full-results-to', args.isolated_script_test_output], env=env)
- finally:
- xvfb.kill(xvfb_proc)
- xvfb.kill(openbox_proc)
- xvfb.kill(xcompmgr_proc)
-
+ cmd = [sys.executable] + rest_args + sharding_args + [
+ '--write-full-results-to', args.isolated_script_test_output]
+ if args.xvfb:
+ return xvfb.run_executable(cmd, '.', env)
+ else:
+ return common.run_command(cmd, env=env)
# This is not really a "script test" so does not need to manually add
« no previous file with comments | « no previous file | testing/xvfb.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698