diff options
author | Olivier Goffart <ogoffart@trolltech.com> | 2009-09-08 08:45:57 (GMT) |
---|---|---|
committer | Olivier Goffart <ogoffart@trolltech.com> | 2009-09-08 08:49:39 (GMT) |
commit | fa889cf4b80868249c70715275069eb150b597cc (patch) | |
tree | ab98dc0979d7c2874902e7f2a9812843104e1c49 /tests/auto/qitemdelegate | |
parent | deff8fcf0ed060b949c3ec0fa0ec4bd81c253825 (diff) | |
download | Qt-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/qitemdelegate')
-rw-r--r-- | tests/auto/qitemdelegate/tst_qitemdelegate.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/tests/auto/qitemdelegate/tst_qitemdelegate.cpp b/tests/auto/qitemdelegate/tst_qitemdelegate.cpp index 1ef77c0..9871da3 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); } |