summaryrefslogtreecommitdiffstats
path: root/tests/auto/qvideowidget
diff options
context:
space:
mode:
authorDmytro Poplavskiy <dmytro.poplavskiy@nokia.com>2010-04-19 02:50:01 (GMT)
committerDmytro Poplavskiy <dmytro.poplavskiy@nokia.com>2010-04-19 02:50:01 (GMT)
commit42b71bbe23eaed2a097c25f325713c453ae45c48 (patch)
tree82e29e139ea9a855c34a7ae2d957b1f0c148e133 /tests/auto/qvideowidget
parentc6048dcff55f4809d984e50ddadb38348cae72d3 (diff)
downloadQt-42b71bbe23eaed2a097c25f325713c453ae45c48.zip
Qt-42b71bbe23eaed2a097c25f325713c453ae45c48.tar.gz
Qt-42b71bbe23eaed2a097c25f325713c453ae45c48.tar.bz2
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
Diffstat (limited to 'tests/auto/qvideowidget')
-rw-r--r--tests/auto/qvideowidget/tst_qvideowidget.cpp4
1 files changed, 3 insertions, 1 deletions
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);