summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlivier Goffart <ogoffart@trolltech.com>2009-09-22 08:55:55 (GMT)
committerOlivier Goffart <ogoffart@trolltech.com>2009-09-22 09:18:47 (GMT)
commit4771c0c950ddca12ebadf69f2baf312609ce18d7 (patch)
tree55b5ff1bbf9cf52fe5d9e3e41546b0eae4b9bf83
parentb7647b38103676c68ad603d1391e62c5d01dc3b2 (diff)
downloadQt-4771c0c950ddca12ebadf69f2baf312609ce18d7.zip
Qt-4771c0c950ddca12ebadf69f2baf312609ce18d7.tar.gz
Qt-4771c0c950ddca12ebadf69f2baf312609ce18d7.tar.bz2
Make QDialog, and QTreeView test more robust
-rw-r--r--tests/auto/qdialog/tst_qdialog.cpp8
-rw-r--r--tests/auto/qtreeview/tst_qtreeview.cpp8
2 files changed, 10 insertions, 6 deletions
diff --git a/tests/auto/qdialog/tst_qdialog.cpp b/tests/auto/qdialog/tst_qdialog.cpp
index 5f2ccd3..dc6878d 100644
--- a/tests/auto/qdialog/tst_qdialog.cpp
+++ b/tests/auto/qdialog/tst_qdialog.cpp
@@ -194,7 +194,7 @@ void tst_QDialog::showExtension()
QCOMPARE( testWidget->size(), dlgSize );
QPoint oldPosition = testWidget->pos();
-
+
#ifdef Q_WS_S60
const int htDiff = ext->size().height() - testWidget->size().height();
#endif
@@ -202,7 +202,7 @@ void tst_QDialog::showExtension()
((DummyDialog*)testWidget)->showExtension( TRUE );
// while ( testWidget->size() == dlgSize )
// qApp->processEvents();
-
+
#ifdef Q_WS_S60
QPoint expectedPosition;
if (!horizontal) {
@@ -584,6 +584,7 @@ void tst_QDialog::reject()
{
TestRejectDialog dialog;
dialog.show();
+ QTest::qWaitForWindowShown(&dialog);
QTest::qWait(100);
QVERIFY(dialog.isVisible());
dialog.reject();
@@ -592,7 +593,9 @@ void tst_QDialog::reject()
QCOMPARE(dialog.called, 1);
dialog.show();
+ QTest::qWaitForWindowShown(&dialog);
QTest::qWait(100);
+
QVERIFY(dialog.isVisible());
QVERIFY(dialog.close());
QTest::qWait(100);
@@ -601,6 +604,7 @@ void tst_QDialog::reject()
dialog.cancelReject = true;
dialog.show();
+ QTest::qWaitForWindowShown(&dialog);
QTest::qWait(100);
QVERIFY(dialog.isVisible());
dialog.reject();
diff --git a/tests/auto/qtreeview/tst_qtreeview.cpp b/tests/auto/qtreeview/tst_qtreeview.cpp
index bad36c1..112bcc8 100644
--- a/tests/auto/qtreeview/tst_qtreeview.cpp
+++ b/tests/auto/qtreeview/tst_qtreeview.cpp
@@ -906,7 +906,7 @@ void tst_QTreeView::iconSize()
view.show();
view.update();
- QTest::qWait(100);
+ QTest::qWaitForWindowShown(&view);
QTRY_VERIFY(view.repainted);
QCOMPARE(view.iconSize(), QSize());
@@ -3055,7 +3055,7 @@ void tst_QTreeView::task216717_updateChildren()
bool refreshed;
} tree;
tree.show();
- QTest::qWait(100);
+ QTest::qWaitForWindowShown(&tree);
tree.refreshed = false;
QTreeWidgetItem *parent = new QTreeWidgetItem(QStringList() << "parent");
tree.addTopLevelItem(parent);
@@ -3344,7 +3344,7 @@ void tst_QTreeView::task246536_scrollbarsNotWorking()
QStandardItemModel model;
tree.setModel(&model);
tree.show();
- QTest::qWait(100);
+ QTest::qWaitForWindowShown(&tree);
QList<QStandardItem *> items;
for(int i=0; i<100; ++i){
items << new QStandardItem(QString::fromLatin1("item %1").arg(i));
@@ -3399,7 +3399,7 @@ void tst_QTreeView::task239271_addRowsWithFirstColumnHidden()
view.hideColumn(0);
view.show();
- QTest::qWait(200);
+ QTest::qWaitForWindowShown(&view);
delegate.paintedIndexes.clear();
QStandardItem sub1("sub1"), sub11("sub11");
root0.appendRow(QList<QStandardItem*>() << &sub1 << &sub11);