From 42b71bbe23eaed2a097c25f325713c453ae45c48 Mon Sep 17 00:00:00 2001 From: Dmytro Poplavskiy Date: Mon, 19 Apr 2010 12:50:01 +1000 Subject: Fixed QVideoWidget test, waiting for video surface painted. It's not always sufficient just to call QCoreApplication::processEvents(QEventLoop::AllEvents) to ensure update is processed (at least on mac), so wait for some time until the video frame is rendered. Reviewed-by: Kurt Korbatits --- tests/auto/qvideowidget/tst_qvideowidget.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/auto/qvideowidget/tst_qvideowidget.cpp b/tests/auto/qvideowidget/tst_qvideowidget.cpp index 32a4e7c..8a54789 100644 --- a/tests/auto/qvideowidget/tst_qvideowidget.cpp +++ b/tests/auto/qvideowidget/tst_qvideowidget.cpp @@ -1589,7 +1589,9 @@ void tst_QVideoWidget::paintRendererControl() QCOMPARE(surface->isActive(), true); QCOMPARE(surface->isReady(), false); - QCoreApplication::processEvents(QEventLoop::AllEvents); + //wait up to 2 seconds for the frame to be presented + for (int i=0; i<200 && !surface->isReady(); i++) + QTest::qWait(10); QCOMPARE(surface->isActive(), true); QCOMPARE(surface->isReady(), true); -- cgit v0.12