summaryrefslogtreecommitdiffstats
path: root/tests/auto/qdoublespinbox
diff options
context:
space:
mode:
authorOlivier Goffart <ogoffart@trolltech.com>2009-09-08 08:45:57 (GMT)
committerOlivier Goffart <ogoffart@trolltech.com>2009-09-08 08:49:39 (GMT)
commitfa889cf4b80868249c70715275069eb150b597cc (patch)
treeab98dc0979d7c2874902e7f2a9812843104e1c49 /tests/auto/qdoublespinbox
parentdeff8fcf0ed060b949c3ec0fa0ec4bd81c253825 (diff)
downloadQt-fa889cf4b80868249c70715275069eb150b597cc.zip
Qt-fa889cf4b80868249c70715275069eb150b597cc.tar.gz
Qt-fa889cf4b80868249c70715275069eb150b597cc.tar.bz2
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/qdoublespinbox')
-rw-r--r--tests/auto/qdoublespinbox/tst_qdoublespinbox.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/auto/qdoublespinbox/tst_qdoublespinbox.cpp b/tests/auto/qdoublespinbox/tst_qdoublespinbox.cpp
index 6162be0..aa3ccb7 100644
--- a/tests/auto/qdoublespinbox/tst_qdoublespinbox.cpp
+++ b/tests/auto/qdoublespinbox/tst_qdoublespinbox.cpp
@@ -52,6 +52,9 @@
#include <qlineedit.h>
#include <qdebug.h>
+
+#include "../../shared/util.h"
+
//TESTED_CLASS=
//TESTED_FILES=gui/widgets/qspinbox.h gui/widgets/qspinbox.cpp gui/widgets/qabstractspinbox.cpp gui/widgets/qabstractspinbox_p.h gui/widgets/qabstractspinbox.h
@@ -772,8 +775,8 @@ void tst_QDoubleSpinBox::editingFinished()
layout->addWidget(box2);
testFocusWidget->show();
- QTest::qWait(100);
- QVERIFY(box->isActiveWindow());
+ QTest::qWait(10);
+ QTRY_VERIFY(box->isActiveWindow());
box->setFocus();
QSignalSpy editingFinishedSpy1(box, SIGNAL(editingFinished()));