testing/xvfb.py
def run_executable(
    cmd, env, stdoutfile=None, use_openbox=True, use_xcompmgr=True):
  """Runs an executable within Weston or Xvfb on Linux or normally on other
     platforms.

  The method sets SIGUSR1 handler for Xvfb to return SIGUSR1
  when it is ready for connections.
  https://www.x.org/archive/X11R7.5/doc/man/man1/Xserver.1.html under Signals.

  Args:
    cmd: Command to be executed.
    env: A copy of environment variables. "DISPLAY" and will be set if Xvfb is
      used. "WAYLAND_DISPLAY" will be set if Weston is used.
    stdoutfile: If provided, symbolization via script is disabled and stdout
      is written to this file as well as to stdout.
    use_openbox: A flag to use openbox process.
      Some ChromeOS tests need a window manager.
    use_xcompmgr: A flag to use xcompmgr process.
      Some tests need a compositing wm to make use of transparent visuals.

  Returns:
    the exit code of the specified commandline, or 1 on failure.
  """

  # It might seem counterintuitive to support a --no-xvfb flag in a script
  # whose only job is to start xvfb, but doing so allows us to consolidate
  # the logic in the layers of buildbot scripts so that we *always* use
  # xvfb by default and don't have to worry about the distinction, it
  # can remain solely under the control of the test invocation itself.
  use_xvfb = True
  if '--no-xvfb' in cmd:
    use_xvfb = False
    cmd.remove('--no-xvfb')

  # Tests that run on Linux platforms with Ozone/Wayland backend require
  # a Weston instance. However, it is also required to disable xvfb so
  # that Weston can run in a pure headless environment.
  use_weston = False
  if '--use-weston' in cmd:
    if use_xvfb:
      print('Unable to use Weston with xvfb.\n', file=sys.stderr)
      return 1
    use_weston = True
    cmd.remove('--use-weston')

  if sys.platform.startswith('linux') and use_xvfb:
    return _run_with_xvfb(cmd, env, stdoutfile, use_openbox, use_xcompmgr)
  elif use_weston:
    return _run_with_weston(cmd, env, stdoutfile)
  else:
    return test_env.run_executable(cmd, env, stdoutfile)
Runs an executable within Weston or Xvfb on Linux or normally on other
     platforms.

  The method sets SIGUSR1 handler for Xvfb to return SIGUSR1
  when it is ready for connections.
  https://www.x.org/archive/X11R7.5/doc/man/man1/Xserver.1.html under Signals.

  Args:
    cmd: Command to be executed.
    env: A copy of environment variables. "DISPLAY" and will be set if Xvfb is
      used. "WAYLAND_DISPLAY" will be set if Weston is used.
    stdoutfile: If provided, symbolization via script is disabled and stdout
      is written to this file as well as to stdout.
    use_openbox: A flag to use openbox process.
      Some ChromeOS tests need a window manager.
    use_xcompmgr: A flag to use xcompmgr process.
      Some tests need a compositing wm to make use of transparent visuals.

  Returns:
    the exit code of the specified commandline, or 1 on failure.
  
Runs an executable within Weston or Xvfb on Linux or normally on other
platforms.

The method sets SIGUSR1 handler for Xvfb to return SIGUSR1
when it is ready for connections.
Runs an executable within Weston or Xvfb on Linux or normally on other platforms . The method sets SIGUSR1 handler for Xvfb to return SIGUSR1 when it is ready for connections .
def run_executable(
    cmd, env, stdoutfile=None, use_openbox=True, use_xcompmgr=True):
  use_xvfb = True
  if '--no-xvfb' in cmd:
    use_xvfb = False
    cmd.remove('--no-xvfb')
  use_weston = False
  if '--use-weston' in cmd:
    if use_xvfb:
      print('Unable to use Weston with xvfb.\n', file=sys.stderr)
      return 1
    use_weston = True
    cmd.remove('--use-weston')
  if sys.platform.startswith('linux') and use_xvfb:
    return _run_with_xvfb(cmd, env, stdoutfile, use_openbox, use_xcompmgr)
  elif use_weston:
    return _run_with_weston(cmd, env, stdoutfile)
  else:
    return test_env.run_executable(cmd, env, stdoutfile)
def run_executable ( cmd , env , stdoutfile = None , use_openbox = True , use_xcompmgr = True ) : use_xvfb = True if '--no-xvfb' in cmd : use_xvfb = False cmd . remove ( '--no-xvfb' ) use_weston = False if '--use-weston' in cmd : if use_xvfb : print ( 'Unable to use Weston with xvfb.\n' , file = sys . stderr ) return 1 use_weston = True cmd . remove ( '--use-weston' ) if sys . platform . startswith ( 'linux' ) and use_xvfb : return _run_with_xvfb ( cmd , env , stdoutfile , use_openbox , use_xcompmgr ) elif use_weston : return _run_with_weston ( cmd , env , stdoutfile ) else : return test_env . run_executable ( cmd , env , stdoutfile )
Runs an executable within Weston or Xvfb on Linux or normally on other
platforms.
Runs an executable within Weston or Xvfb on Linux or normally on other platforms .
"""Runs an executable within Weston or Xvfb on Linux or normally on other
     platforms.

  The method sets SIGUSR1 handler for Xvfb to return SIGUSR1
  when it is ready for connections.
  https://www.x.org/archive/X11R7.5/doc/man/man1/Xserver.1.html under Signals.

  Args:
    cmd: Command to be executed.
    env: A copy of environment variables. "DISPLAY" and will be set if Xvfb is
      used. "WAYLAND_DISPLAY" will be set if Weston is used.
    stdoutfile: If provided, symbolization via script is disabled and stdout
      is written to this file as well as to stdout.
    use_openbox: A flag to use openbox process.
      Some ChromeOS tests need a window manager.
    use_xcompmgr: A flag to use xcompmgr process.
      Some tests need a compositing wm to make use of transparent visuals.

  Returns:
    the exit code of the specified commandline, or 1 on failure.
  """ # It might seem counterintuitive to support a --no-xvfb flag in a script # whose only job is to start xvfb, but doing so allows us to consolidate # the logic in the layers of buildbot scripts so that we *always* use # xvfb by default and don't have to worry about the distinction, it # can remain solely under the control of the test invocation itself. # Tests that run on Linux platforms with Ozone/Wayland backend require # a Weston instance. However, it is also required to disable xvfb so # that Weston can run in a pure headless environment.
the exit code of the specified commandline, or 1 on failure.
the exit code of the specified commandline or 1 on failure .
cmd
Command to be executed.
Command to be executed .
env
A copy of environment variables. "DISPLAY" and will be set if Xvfb is
used. "WAYLAND_DISPLAY" will be set if Weston is used.
A copy of environment variables . " DISPLAY " and will be set if Xvfb is used . " WAYLAND_DISPLAY " will be set if Weston is used .
stdoutfile
If provided, symbolization via script is disabled and stdout
is written to this file as well as to stdout.
If provided symbolization via script is disabled and stdout is written to this file as well as to stdout .
use_openbox
A flag to use openbox process.
Some ChromeOS tests need a window manager.
A flag to use openbox process . Some ChromeOS tests need a window manager .
use_xcompmgr
A flag to use xcompmgr process.
Some tests need a compositing wm to make use of transparent visuals.
A flag to use xcompmgr process . Some tests need a compositing wm to make use of transparent visuals .