aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@qt.io>2018-06-13 10:21:47 +0200
committerSimon Hausmann <simon.hausmann@qt.io>2018-06-19 13:30:29 +0000
commit16cf097972a72656142ab0ed797282ad95ee5713 (patch)
tree17401269f884640ddee5b81649d6b5e8400284e8 /tests
parentac00839eb91e22d58e9f3de519333d879a268c4d (diff)
Attempt to stabilize tst_qquickwindow::openglContextCreatedSignal
The test creates a QQuickWindow, calls show() on it and then waits with qWaitForWindowExposed() to return true. The expectation of the test is that when that call returns, an expose event was also successfully delivered to the window and the scene graph's render loop has attempted rendering the window contents - using *RenderLoop*::renderWindow(), which would - in the case of the gui thread loop - create the GL context. This expectation is expressed using a QVERIFY on a signal spy that observes the emission of the GL context created signal of QQuickWindow. There is no guarantee that by the time qWaitForWindowExposed returned true, an expose event was delivered to the window. Therefore let's use QTRY_VERIFY. Change-Id: I604cbf40dfb7980448f406e26b77678a65faf359 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/quick/qquickwindow/tst_qquickwindow.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp b/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp
index 042908bf0c..44cd1dd656 100644
--- a/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp
+++ b/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp
@@ -501,7 +501,7 @@ void tst_qquickwindow::openglContextCreatedSignal()
if (window.rendererInterface()->graphicsApi() != QSGRendererInterface::OpenGL)
QSKIP("Skipping OpenGL context test due to not running with OpenGL");
- QVERIFY(spy.size() > 0);
+ QTRY_VERIFY(spy.size() > 0);
QVariant ctx = spy.at(0).at(0);
QCOMPARE(qvariant_cast<QOpenGLContext *>(ctx), window.openglContext());