From bff2101994c558855bb7ca3aa374e5d90eae8e0c Mon Sep 17 00:00:00 2001 From: Kari Oikarinen Date: Thu, 5 Apr 2018 15:03:17 +0300 Subject: tests/auto/widgets/dialogs: Avoid unconditional qWait()s Task-number: QTBUG-63992 Change-Id: I679a0f482ec2c3ed5d896f1c40c67d9932c6fc18 Reviewed-by: Qt CI Bot Reviewed-by: Friedemann Kleint Reviewed-by: Richard Moe Gustavsen --- tests/auto/widgets/dialogs/qfiledialog/tst_qfiledialog.cpp | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'tests/auto/widgets/dialogs/qfiledialog') diff --git a/tests/auto/widgets/dialogs/qfiledialog/tst_qfiledialog.cpp b/tests/auto/widgets/dialogs/qfiledialog/tst_qfiledialog.cpp index 90f8457b7f..c3bdf3701f 100644 --- a/tests/auto/widgets/dialogs/qfiledialog/tst_qfiledialog.cpp +++ b/tests/auto/widgets/dialogs/qfiledialog/tst_qfiledialog.cpp @@ -494,9 +494,6 @@ void tst_QFiledialog::completer() QAbstractItemModel *cModel = completer->completionModel(); QVERIFY(cModel); - //wait a bit - QTest::qWait(500); - // path C:\depot\qt\examples\dialogs\standarddialogs // files // [debug] [release] [tmp] dialog dialog main makefile makefile.debug makefile.release standarddialgos @@ -509,7 +506,7 @@ void tst_QFiledialog::completer() // \ -> \_viminfo // c:\depot -> 'nothing' // c:\depot\ -> C:\depot\devtools, C:\depot\dteske - QCOMPARE(model->index(fd.directory().path()), model->index(startPath)); + QTRY_COMPARE(model->index(fd.directory().path()), model->index(startPath)); if (input.isEmpty()) { // Try to find a suitable directory under root that does not @@ -1331,7 +1328,6 @@ void tst_QFiledialog::clearLineEdit() // saving a file the text shouldn't be cleared fd.setDirectory(QDir::home()); - QTest::qWait(1000); #ifdef QT_KEYPAD_NAVIGATION list->setEditFocus(true); #endif @@ -1342,8 +1338,7 @@ void tst_QFiledialog::clearLineEdit() QTest::keyClick(list, Qt::Key_O, Qt::ControlModifier); #endif - QTest::qWait(2000); - QVERIFY(fd.directory().absolutePath() != QDir::home().absolutePath()); + QTRY_VERIFY(fd.directory().absolutePath() != QDir::home().absolutePath()); QVERIFY(!lineEdit->text().isEmpty()); // selecting a dir the text should be cleared so one can just hit ok @@ -1351,7 +1346,6 @@ void tst_QFiledialog::clearLineEdit() fd.setFileMode(QFileDialog::Directory); fd.setDirectory(QDir::home()); - QTest::qWait(1000); QTest::keyClick(list, Qt::Key_Down); #ifndef Q_OS_MAC QTest::keyClick(list, Qt::Key_Return); @@ -1359,8 +1353,7 @@ void tst_QFiledialog::clearLineEdit() QTest::keyClick(list, Qt::Key_O, Qt::ControlModifier); #endif - QTest::qWait(2000); - QVERIFY(fd.directory().absolutePath() != QDir::home().absolutePath()); + QTRY_VERIFY(fd.directory().absolutePath() != QDir::home().absolutePath()); QVERIFY(lineEdit->text().isEmpty()); //remove the dir -- cgit v1.2.3