summaryrefslogtreecommitdiff
path: root/chromium/testing/xvfb.py
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2020-10-12 14:27:29 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2020-10-13 09:35:20 +0000
commitc30a6232df03e1efbd9f3b226777b07e087a1122 (patch)
treee992f45784689f373bcc38d1b79a239ebe17ee23 /chromium/testing/xvfb.py
parent7b5b123ac58f58ffde0f4f6e488bcd09aa4decd3 (diff)
downloadqtwebengine-chromium-85-based.tar.gz
BASELINE: Update Chromium to 85.0.4183.14085-based
Change-Id: Iaa42f4680837c57725b1344f108c0196741f6057 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/testing/xvfb.py')
-rwxr-xr-xchromium/testing/xvfb.py35
1 files changed, 33 insertions, 2 deletions
diff --git a/chromium/testing/xvfb.py b/chromium/testing/xvfb.py
index cabfd6985bf..d868072aa38 100755
--- a/chromium/testing/xvfb.py
+++ b/chromium/testing/xvfb.py
@@ -142,6 +142,7 @@ def _run_with_xvfb(cmd, env, stdoutfile, use_openbox, use_xcompmgr):
openbox_proc = None
xcompmgr_proc = None
xvfb_proc = None
+ xwmstartupcheck_proc = None
xvfb_ready = MutableBoolean()
def set_xvfb_ready(*_):
xvfb_ready.setvalue(True)
@@ -181,8 +182,34 @@ def _run_with_xvfb(cmd, env, stdoutfile, use_openbox, use_xcompmgr):
dbus_pid = launch_dbus(env)
if use_openbox:
+ # This is not ideal, but x11_unittests require that (other X11 tests have
+ # a race with the openbox as well, but they take more time to initialize.
+ # And thus, they do no time out compate to the x11_unittests that are
+ # quick enough to start up before openbox is ready.
+ # TODO(dpranke): remove this nasty hack once the test() template is
+ # reworked.
+ wait_for_openbox = False
+ wait_openbox_program = './xwmstartupcheck'
+ if not os.path.isfile(wait_openbox_program):
+ wait_for_openbox = False
+ # Creates a dummy window that waits for a ReparentNotify event that is
+ # sent whenever Openbox WM starts. Must be started before the OpenBox WM
+ # so that it does not miss the event. This helper program is located in
+ # the current build directory. The program terminates automatically after
+ # 30 seconds of waiting for the event.
+ if wait_for_openbox:
+ xwmstartupcheck_proc = subprocess.Popen(
+ wait_openbox_program, stderr=subprocess.STDOUT, env=env)
+
openbox_proc = subprocess.Popen(
- 'openbox', stderr=subprocess.STDOUT, env=env)
+ ['openbox', '--sm-disable'], stderr=subprocess.STDOUT, env=env)
+
+ # Wait until execution is done. Does not block if the process has already
+ # been terminated. In that case, it's safe to read the return value.
+ if wait_for_openbox:
+ xwmstartupcheck_proc.wait()
+ if xwmstartupcheck_proc.returncode is not 0:
+ raise _XvfbProcessError('Failed to get OpenBox up.')
if use_xcompmgr:
xcompmgr_proc = subprocess.Popen(
@@ -230,8 +257,12 @@ def _run_with_weston(cmd, env, stdoutfile):
# to enter idle state. Otherwise, Weston stops to send frame callbacks,
# and tests start to time out (this typically happens after 300 seconds -
# the default time after which Weston enters the idle state).
+ # 3) --width && --height set size of a virtual display: we need to set
+ # an adequate size so that tests can have more room for managing size
+ # of windows.
weston_proc = subprocess.Popen(
- ('./weston', '--backend=headless-backend.so', '--idle-time=0'),
+ ('./weston', '--backend=headless-backend.so', '--idle-time=0',
+ '--width=1024', '--height=768'),
stderr=subprocess.STDOUT, env=env)
# Get the $WAYLAND_DISPLAY set by Weston and pass it to the test launcher.