From d763b9a56c5f488a6a4187f6aa454405ab75d09b Mon Sep 17 00:00:00 2001 From: "Bradley T. Hughes" Date: Mon, 5 Oct 2009 16:06:20 +0200 Subject: 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 --- tests/auto/qdialog/tst_qdialog.cpp | 28 +++++++++++----------------- 1 file 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 #include +#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); } -- cgit v0.12