summaryrefslogtreecommitdiffstats
path: root/tests/auto/qfocusevent
diff options
context:
space:
mode:
authorOlivier Goffart <ogoffart@trolltech.com>2009-09-25 09:29:44 (GMT)
committerOlivier Goffart <ogoffart@trolltech.com>2009-09-25 09:44:17 (GMT)
commit03abf8a298193c3e77896b99bac047b542424bbd (patch)
tree9f8b4439e32b705110e9816e22676bfdd854bc5b /tests/auto/qfocusevent
parent67e729c03db7c2f4e1e3e12a859bb9d2c0db2b5a (diff)
downloadQt-03abf8a298193c3e77896b99bac047b542424bbd.zip
Qt-03abf8a298193c3e77896b99bac047b542424bbd.tar.gz
Qt-03abf8a298193c3e77896b99bac047b542424bbd.tar.bz2
Stabilize GraphicsView and QFocusEvent test
Diffstat (limited to 'tests/auto/qfocusevent')
-rw-r--r--tests/auto/qfocusevent/tst_qfocusevent.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/auto/qfocusevent/tst_qfocusevent.cpp b/tests/auto/qfocusevent/tst_qfocusevent.cpp
index 6c47530..121bd41 100644
--- a/tests/auto/qfocusevent/tst_qfocusevent.cpp
+++ b/tests/auto/qfocusevent/tst_qfocusevent.cpp
@@ -399,10 +399,10 @@ void tst_QFocusEvent::checkReason_ActiveWindow()
QDialog* d = new QDialog( testFocusWidget );
d->show();
d->activateWindow(); // ### CDE
- // wait 1 secs to give some visible feedback
- QTest::qWait(1000);
+ QApplication::setActiveWindow(d);
+ QTest::qWaitForWindowShown(d);
- QVERIFY(childFocusWidgetOne->focusOutEventRecieved);
+ QTRY_VERIFY(childFocusWidgetOne->focusOutEventRecieved);
QVERIFY(childFocusWidgetOne->focusOutEventLostFocus);
QVERIFY( !childFocusWidgetOne->focusInEventRecieved );
@@ -411,12 +411,12 @@ void tst_QFocusEvent::checkReason_ActiveWindow()
QVERIFY( !childFocusWidgetOne->hasFocus() );
d->hide();
- QTest::qWait(1000);
+ QTest::qWait(100);
#if defined(Q_OS_IRIX)
QEXPECT_FAIL("", "IRIX requires explicit activateWindow(), so this test does not make any sense.", Abort);
#endif
- QVERIFY(childFocusWidgetOne->focusInEventRecieved);
+ QTRY_VERIFY(childFocusWidgetOne->focusInEventRecieved);
QVERIFY(childFocusWidgetOne->focusInEventGotFocus);
QVERIFY( childFocusWidgetOne->hasFocus() );