summaryrefslogtreecommitdiffstats
path: root/tests/auto/qgraphicsview
diff options
context:
space:
mode:
authorOlivier Goffart <ogoffart@trolltech.com>2009-09-22 16:56:24 (GMT)
committerOlivier Goffart <ogoffart@trolltech.com>2009-09-22 16:57:11 (GMT)
commitf5d6022f4ca4af32de2b683dfb9f41173e7c8934 (patch)
treef573bdfe72a6bee62372d46e624b118fa26c6558 /tests/auto/qgraphicsview
parent0691350e14632dea6c12a2d37e605dc0628b4ceb (diff)
downloadQt-f5d6022f4ca4af32de2b683dfb9f41173e7c8934.zip
Qt-f5d6022f4ca4af32de2b683dfb9f41173e7c8934.tar.gz
Qt-f5d6022f4ca4af32de2b683dfb9f41173e7c8934.tar.bz2
Stabilize more test
Diffstat (limited to 'tests/auto/qgraphicsview')
-rw-r--r--tests/auto/qgraphicsview/tst_qgraphicsview.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/tests/auto/qgraphicsview/tst_qgraphicsview.cpp b/tests/auto/qgraphicsview/tst_qgraphicsview.cpp
index 41f9660..ae00e34 100644
--- a/tests/auto/qgraphicsview/tst_qgraphicsview.cpp
+++ b/tests/auto/qgraphicsview/tst_qgraphicsview.cpp
@@ -2250,6 +2250,7 @@ void tst_QGraphicsView::viewportUpdateMode2()
view.resize(200 + left + right, 200 + top + bottom);
view.show();
QTest::qWaitForWindowShown(&view);
+ QTest::qWait(50);
const QRect viewportRect = view.viewport()->rect();
QCOMPARE(viewportRect, QRect(0, 0, 200, 200));
@@ -2911,6 +2912,7 @@ void tst_QGraphicsView::task239729_noViewUpdate()
view->show();
QTest::qWaitForWindowShown(view);
+ QTest::qWait(150);
EventSpy spy(view->viewport(), QEvent::Paint);
QCOMPARE(spy.count(), 0);
@@ -2919,7 +2921,7 @@ void tst_QGraphicsView::task239729_noViewUpdate()
QCOMPARE(spy.count(), 0);
scene.update();
QTest::qWait(150);
- QCOMPARE(spy.count(), 1);
+ QTRY_COMPARE(spy.count(), 1);
delete view;
}
@@ -3342,7 +3344,7 @@ void tst_QGraphicsView::render()
qApp->processEvents();
- QCOMPARE(r1->paints, 1);
+ QTRY_COMPARE(r1->paints, 1);
QCOMPARE(r2->paints, 1);
QCOMPARE(r3->paints, 1);
QCOMPARE(r4->paints, 1);
@@ -3429,14 +3431,15 @@ void tst_QGraphicsView::update()
view.resize(200 + left + right, 200 + top + bottom);
view.show();
QTest::qWaitForWindowShown(&view);
- const QRect viewportRect = view.viewport()->rect();
- QCOMPARE(viewportRect, QRect(0, 0, 200, 200));
-#if defined QT_BUILD_INTERNAL
QApplication::setActiveWindow(&view);
QTest::qWait(50);
QTRY_COMPARE(QApplication::activeWindow(), &view);
+ const QRect viewportRect = view.viewport()->rect();
+ QCOMPARE(viewportRect, QRect(0, 0, 200, 200));
+
+#if defined QT_BUILD_INTERNAL
const bool intersects = updateRect.intersects(viewportRect);
QGraphicsViewPrivate *viewPrivate = static_cast<QGraphicsViewPrivate *>(qt_widget_private(&view));
QCOMPARE(viewPrivate->updateRect(updateRect), intersects);