summaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2010-08-27 01:46:45 (GMT)
committerMartin Jones <martin.jones@nokia.com>2010-08-27 01:46:45 (GMT)
commit94d7ec29f177665e8e2a218a161df517f3ae51d5 (patch)
tree6e8d331f877e8e0aefcc8fa4d7532abae5215e60 /tests/auto/declarative
parent93c8a38e5f4912c51c4484975ebd433bec43a0f1 (diff)
downloadQt-94d7ec29f177665e8e2a218a161df517f3ae51d5.zip
Qt-94d7ec29f177665e8e2a218a161df517f3ae51d5.tar.gz
Qt-94d7ec29f177665e8e2a218a161df517f3ae51d5.tar.bz2
Improve test reliability when running in parallel with other tests.
Diffstat (limited to 'tests/auto/declarative')
-rw-r--r--tests/auto/declarative/qdeclarativegridview/tst_qdeclarativegridview.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/auto/declarative/qdeclarativegridview/tst_qdeclarativegridview.cpp b/tests/auto/declarative/qdeclarativegridview/tst_qdeclarativegridview.cpp
index 896d69e..d4d8bf6 100644
--- a/tests/auto/declarative/qdeclarativegridview/tst_qdeclarativegridview.cpp
+++ b/tests/auto/declarative/qdeclarativegridview/tst_qdeclarativegridview.cpp
@@ -655,6 +655,15 @@ void tst_QDeclarativeGridView::currentIndex()
gridview->setFlow(QDeclarativeGridView::TopToBottom);
+ qApp->setActiveWindow(canvas);
+#ifdef Q_WS_X11
+ // to be safe and avoid failing setFocus with window managers
+ qt_x11_wait_for_window_manager(canvas);
+#endif
+ QTRY_VERIFY(canvas->hasFocus());
+ QTRY_VERIFY(canvas->scene()->hasFocus());
+ qApp->processEvents();
+
QTest::keyClick(canvas, Qt::Key_Right);
QCOMPARE(gridview->currentIndex(), 5);