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/qtextbrowser | |
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/qtextbrowser')
-rw-r--r-- | tests/auto/qtextbrowser/tst_qtextbrowser.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/auto/qtextbrowser/tst_qtextbrowser.cpp b/tests/auto/qtextbrowser/tst_qtextbrowser.cpp index 0311900..966e9c9 100644 --- a/tests/auto/qtextbrowser/tst_qtextbrowser.cpp +++ b/tests/auto/qtextbrowser/tst_qtextbrowser.cpp @@ -49,6 +49,8 @@ #include <qtextbrowser.h> #include <qtextobject.h> +#include "../../shared/util.h" + //TESTED_CLASS= //TESTED_FILES= @@ -64,9 +66,11 @@ public: #ifdef Q_WS_X11 qt_x11_wait_for_window_manager(this); #endif + QApplication::setActiveWindow(this); activateWindow(); setFocus(); - QTest::qWait(100); + QTest::qWait(50); + QTRY_VERIFY(hasFocus()); } virtual QVariant loadResource(int type, const QUrl &name); |