From e5176e18bd2d1be73888ee90a17b4e6145c75291 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Wed, 1 Feb 2017 12:33:47 +0100 Subject: [PATCH] tests: Fix QtWebEngine focus checking --- tests/end2end/fixtures/quteprocess.py | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/tests/end2end/fixtures/quteprocess.py b/tests/end2end/fixtures/quteprocess.py index 8b2134769..831e210ce 100644 --- a/tests/end2end/fixtures/quteprocess.py +++ b/tests/end2end/fixtures/quteprocess.py @@ -196,13 +196,17 @@ class QuteProc(testprocess.Process): start_okay_message_load = ( "load status for : LoadStatus.success") - start_okay_message_focus = ( + start_okay_messages_focus = [ + # QtWebKit "Focus object changed: " - "") - # With QtWebEngine the QOpenGLWidget has the actual focus - start_okay_message_focus_qtwe = ( - "Focus object changed: " - ) + "", + # QtWebEngine + "Focus object changed: " + "", + # QtWebEngine with Qt >= 5.8 + "Focus object changed: " + "", + ] if (log_line.category == 'ipc' and log_line.message.startswith("Listening as ")): @@ -213,13 +217,8 @@ class QuteProc(testprocess.Process): if not self._load_ready: log_line.waited_for = True self._is_ready('load') - elif (log_line.category == 'misc' and - testutils.pattern_match(pattern=start_okay_message_focus, - value=log_line.message)): - self._is_ready('focus') - elif (log_line.category == 'misc' and - testutils.pattern_match(pattern=start_okay_message_focus_qtwe, - value=log_line.message)): + elif log_line.category == 'misc' and any(testutils.pattern_match( + pattern=pattern, value=log_line.message) for pattern in start_okay_messages_focus): self._is_ready('focus') elif (log_line.category == 'init' and log_line.module == 'standarddir' and