diff options
author | Bradley T. Hughes <bradley.hughes@nokia.com> | 2009-10-05 14:06:20 (GMT) |
---|---|---|
committer | Bradley T. Hughes <bradley.hughes@nokia.com> | 2009-10-05 14:36:27 (GMT) |
commit | d763b9a56c5f488a6a4187f6aa454405ab75d09b (patch) | |
tree | 286aab9c82440ebce586f1f01bf575e1ef7b3cb0 /tests | |
parent | c4571223a0ebb2f00a6c29477d0a4a55ae3cd2b5 (diff) | |
download | Qt-d763b9a56c5f488a6a4187f6aa454405ab75d09b.zip Qt-d763b9a56c5f488a6a4187f6aa454405ab75d09b.tar.gz Qt-d763b9a56c5f488a6a4187f6aa454405ab75d09b.tar.bz2 |
use QTRY_VERIFY instead of qWait() in tst_QDialog::reject()
This test already uses qWaitForWindowManager(), but on X11, reshowing
a dialog can take long as the window manager has to do more work
before remapping the window. we should give it more time (hence the
change to QTRY_VERIFY)
Reviewed-by: Rohan McGovern
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/qdialog/tst_qdialog.cpp | 28 |
1 files changed, 11 insertions, 17 deletions
diff --git a/tests/auto/qdialog/tst_qdialog.cpp b/tests/auto/qdialog/tst_qdialog.cpp index dc6878d..e95bc53 100644 --- a/tests/auto/qdialog/tst_qdialog.cpp +++ b/tests/auto/qdialog/tst_qdialog.cpp @@ -50,6 +50,8 @@ #include <QVBoxLayout> #include <QSizeGrip> +#include "../../shared/util.h" + Q_DECLARE_METATYPE(QSize) @@ -160,8 +162,8 @@ void tst_QDialog::initTestCase() void tst_QDialog::cleanupTestCase() { if (testWidget) { - delete testWidget; - testWidget = 0; + delete testWidget; + testWidget = 0; } } @@ -585,35 +587,27 @@ void tst_QDialog::reject() TestRejectDialog dialog; dialog.show(); QTest::qWaitForWindowShown(&dialog); - QTest::qWait(100); - QVERIFY(dialog.isVisible()); + QTRY_VERIFY(dialog.isVisible()); dialog.reject(); - QTest::qWait(100); - QVERIFY(!dialog.isVisible()); + QTRY_VERIFY(!dialog.isVisible()); QCOMPARE(dialog.called, 1); dialog.show(); QTest::qWaitForWindowShown(&dialog); - QTest::qWait(100); - - QVERIFY(dialog.isVisible()); + QTRY_VERIFY(dialog.isVisible()); QVERIFY(dialog.close()); - QTest::qWait(100); - QVERIFY(!dialog.isVisible()); + QTRY_VERIFY(!dialog.isVisible()); QCOMPARE(dialog.called, 2); dialog.cancelReject = true; dialog.show(); QTest::qWaitForWindowShown(&dialog); - QTest::qWait(100); - QVERIFY(dialog.isVisible()); + QTRY_VERIFY(dialog.isVisible()); dialog.reject(); - QTest::qWait(100); - QVERIFY(dialog.isVisible()); + QTRY_VERIFY(dialog.isVisible()); QCOMPARE(dialog.called, 3); QVERIFY(!dialog.close()); - QTest::qWait(100); - QVERIFY(dialog.isVisible()); + QTRY_VERIFY(dialog.isVisible()); QCOMPARE(dialog.called, 4); } |