summaryrefslogtreecommitdiffstats
path: root/tests/auto/qgroupbox
diff options
context:
space:
mode:
authorOlivier Goffart <ogoffart@trolltech.com>2009-09-08 10:45:57 +0200
committerOlivier Goffart <ogoffart@trolltech.com>2009-09-08 10:49:39 +0200
commitfa889cf4b80868249c70715275069eb150b597cc (patch)
treeab98dc0979d7c2874902e7f2a9812843104e1c49 /tests/auto/qgroupbox
parentdeff8fcf0ed060b949c3ec0fa0ec4bd81c253825 (diff)
Try to make test more robust.
By using QTRY_{COMPARE,VERIFY} instead of waiting an arbitrary amount of time waiting for the window manager to do his job. Also use QApplication::setActiveWindow which seems to be more robust then QWidget::activateWindow
Diffstat (limited to 'tests/auto/qgroupbox')
-rw-r--r--tests/auto/qgroupbox/tst_qgroupbox.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/auto/qgroupbox/tst_qgroupbox.cpp b/tests/auto/qgroupbox/tst_qgroupbox.cpp
index 94b70e62e1..7346700356 100644
--- a/tests/auto/qgroupbox/tst_qgroupbox.cpp
+++ b/tests/auto/qgroupbox/tst_qgroupbox.cpp
@@ -49,6 +49,8 @@
#include "qgroupbox.h"
+#include "../../shared/util.h"
+
//TESTED_CLASS=
//TESTED_FILES=
@@ -81,7 +83,7 @@ private slots:
void toggledVsClicked();
void childrenAreDisabled();
void propagateFocus();
-
+
private:
bool checked;
qint64 timeStamp;
@@ -467,7 +469,7 @@ void tst_QGroupBox::propagateFocus()
box.show();
box.setFocus();
QTest::qWait(250);
- QCOMPARE(qApp->focusWidget(), static_cast<QWidget*>(&lineEdit));
+ QTRY_COMPARE(qApp->focusWidget(), static_cast<QWidget*>(&lineEdit));
}
QTEST_MAIN(tst_QGroupBox)