diff options
author | maruel@chromium.org <maruel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-08-22 11:58:36 +0000 |
---|---|---|
committer | maruel@chromium.org <maruel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-08-22 11:58:36 +0000 |
commit | 498d75881326f756d7bff2d8d1f1ead77df172c0 (patch) | |
tree | e9258b8e0fe0c79f824c7d2c3af9febeca90fb8d /testing/xvfb.py | |
parent | 2bb9d188044d905baf4a6eec3c25eabf2e63960e (diff) | |
download | chromium_src-498d75881326f756d7bff2d8d1f1ead77df172c0.zip chromium_src-498d75881326f756d7bff2d8d1f1ead77df172c0.tar.gz chromium_src-498d75881326f756d7bff2d8d1f1ead77df172c0.tar.bz2 |
Make xvfb.py error easier to understand when xvfb or icewm are not installed.
Add limited support for openat() trace on strace. These are appearing on ubuntu
12.04 with strace version 4.5.20.
Fix a race condition where trace_test_cases.py could not print all the output.
R=cmp@chromium.org
NOTRY=true
BUG=
Review URL: https://chromiumcodereview.appspot.com/10854252
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@152753 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'testing/xvfb.py')
-rwxr-xr-x | testing/xvfb.py | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/testing/xvfb.py b/testing/xvfb.py index b132efc..7a42d47 100755 --- a/testing/xvfb.py +++ b/testing/xvfb.py @@ -49,10 +49,13 @@ def start_xvfb(xvfb_path, display): Args: xvfb_path: Path to Xvfb. """ - proc = subprocess.Popen( - [xvfb_path, display, '-screen', '0', '1024x768x24', '-ac'], - stdout=subprocess.PIPE, - stderr=subprocess.STDOUT) + cmd = [xvfb_path, display, '-screen', '0', '1024x768x24', '-ac'] + try: + proc = subprocess.Popen( + cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) + except OSError: + print >> sys.stderr, 'Failed to run %s' % ' '.join(cmd) + return 0 return proc.pid @@ -96,6 +99,8 @@ def run_executable(cmd, build_dir, env): # Defaults to X display 9. display = ':9' pid = start_xvfb(xvfb, display) + if not pid: + return 1 env['DISPLAY'] = display if not wait_for_xvfb(os.path.join(build_dir, 'xdisplaycheck'), env): return 3 @@ -103,8 +108,13 @@ def run_executable(cmd, build_dir, env): env['_CHROMIUM_INSIDE_XVFB'] = '1' # Some ChromeOS tests need a window manager. Technically, it could be # another script but that would be overkill. - subprocess.Popen( - 'icewm', stdout=subprocess.PIPE, stderr=subprocess.STDOUT, env=env) + try: + cmd = ['icewm'] + subprocess.Popen( + cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, env=env) + except OSError: + print >> sys.stderr, 'Failed to run %s' % ' '.join(cmd) + return 1 return test_env.run_executable(cmd, env) finally: if pid: |