From 16cf097972a72656142ab0ed797282ad95ee5713 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Wed, 13 Jun 2018 10:21:47 +0200 Subject: Attempt to stabilize tst_qquickwindow::openglContextCreatedSignal MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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ø --- tests/auto/quick/qquickwindow/tst_qquickwindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests') 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(ctx), window.openglContext()); -- cgit v1.2.3