summaryrefslogtreecommitdiffstats
path: root/tests/auto/qitemdelegate/tst_qitemdelegate.cpp
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/qitemdelegate/tst_qitemdelegate.cpp
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/qitemdelegate/tst_qitemdelegate.cpp')
-rw-r--r--tests/auto/qitemdelegate/tst_qitemdelegate.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/tests/auto/qitemdelegate/tst_qitemdelegate.cpp b/tests/auto/qitemdelegate/tst_qitemdelegate.cpp
index 1ef77c0e28..9871da3399 100644
--- a/tests/auto/qitemdelegate/tst_qitemdelegate.cpp
+++ b/tests/auto/qitemdelegate/tst_qitemdelegate.cpp
@@ -63,6 +63,8 @@
#include <QPlainTextEdit>
#include <QDialog>
+#include "../../shared/util.h"
+
Q_DECLARE_METATYPE(QAbstractItemDelegate::EndEditHint)
//TESTED_CLASS=
@@ -862,6 +864,8 @@ void tst_QItemDelegate::decoration()
#ifdef Q_WS_X11
qt_x11_wait_for_window_manager(&table);
#endif
+ QApplication::setActiveWindow(&table);
+ QTRY_COMPARE(QApplication::activeWindow(), &table);
QVariant value;
switch ((QVariant::Type)type) {
@@ -1164,10 +1168,7 @@ void tst_QItemDelegate::task257859_finalizeEdit()
QDialog dialog;
QTimer::singleShot(100, &dialog, SLOT(close()));
dialog.exec();
-
- QTest::qWait(100);
-
- QVERIFY(!editor);
+ QTRY_VERIFY(!editor);
}