summaryrefslogtreecommitdiffstats
path: root/testing/xvfb.py
diff options
context:
space:
mode:
authormaruel@chromium.org <maruel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-07-05 18:24:52 +0000
committermaruel@chromium.org <maruel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-07-05 18:24:52 +0000
commit5934ca7d413e501300c74bbcf81cd47bb98612b6 (patch)
tree8f58f3fb75cdda14d30fe873e984b0c426565e93 /testing/xvfb.py
parent26698d04e23fa3ce0db11f627bdcdfa2ef62b6fc (diff)
downloadchromium_src-5934ca7d413e501300c74bbcf81cd47bb98612b6.zip
chromium_src-5934ca7d413e501300c74bbcf81cd47bb98612b6.tar.gz
chromium_src-5934ca7d413e501300c74bbcf81cd47bb98612b6.tar.bz2
Inhibit recursion when starting xvfb.py recursively.
This permits to start trace_test_cases.py/isolate.py trace inside an xvfb buffer and not have the inner xvfb be created. TBR=cmp@chromium.org NOTRY=true BUG= TEST=tested manually Review URL: https://chromiumcodereview.appspot.com/10702103 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@145546 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'testing/xvfb.py')
-rwxr-xr-xtesting/xvfb.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/testing/xvfb.py b/testing/xvfb.py
index 73bcd16..b132efc 100755
--- a/testing/xvfb.py
+++ b/testing/xvfb.py
@@ -80,7 +80,15 @@ def run_executable(cmd, build_dir, env):
platforms.
Requires that both xvfb and icewm are installed on linux.
+
+ Detects recursion with an environment variable and do not create a recursive X
+ buffer if present.
"""
+ # First look if we are inside a display.
+ if env.get('_CHROMIUM_INSIDE_XVFB') == '1':
+ # No need to recurse.
+ return test_env.run_executable(cmd, env)
+
pid = None
xvfb = 'Xvfb'
try:
@@ -91,6 +99,8 @@ def run_executable(cmd, build_dir, env):
env['DISPLAY'] = display
if not wait_for_xvfb(os.path.join(build_dir, 'xdisplaycheck'), env):
return 3
+ # Inhibit recursion.
+ 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(