summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorOlivier Goffart <ogoffart@trolltech.com>2009-09-23 17:48:16 (GMT)
committerOlivier Goffart <ogoffart@trolltech.com>2009-09-23 18:12:40 (GMT)
commitd2180e2fc3c56d56cd073a896d8449181ca28136 (patch)
treeb0e2cd889f700e82920ff706c591457e00680c60 /tests
parent0f462990247d71e598346a8f96faf6d04cd4515e (diff)
downloadQt-d2180e2fc3c56d56cd073a896d8449181ca28136.zip
Qt-d2180e2fc3c56d56cd073a896d8449181ca28136.tar.gz
Qt-d2180e2fc3c56d56cd073a896d8449181ca28136.tar.bz2
Stabilize more test
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qcompleter/tst_qcompleter.cpp4
-rw-r--r--tests/auto/qfiledialog/tst_qfiledialog.cpp3
-rw-r--r--tests/auto/qheaderview/tst_qheaderview.cpp3
-rw-r--r--tests/auto/qmenu/tst_qmenu.cpp2
-rw-r--r--tests/auto/qspinbox/tst_qspinbox.cpp2
-rw-r--r--tests/auto/qstyle/tst_qstyle.cpp2
-rw-r--r--tests/auto/qtableview/tst_qtableview.cpp2
-rw-r--r--tests/auto/qtextbrowser/tst_qtextbrowser.cpp4
8 files changed, 12 insertions, 10 deletions
diff --git a/tests/auto/qcompleter/tst_qcompleter.cpp b/tests/auto/qcompleter/tst_qcompleter.cpp
index 1baae90..f7b9d98 100644
--- a/tests/auto/qcompleter/tst_qcompleter.cpp
+++ b/tests/auto/qcompleter/tst_qcompleter.cpp
@@ -1011,6 +1011,7 @@ void tst_QCompleter::multipleWidgets()
QWidget window;
window.show();
QApplication::setActiveWindow(&window);
+ QApplicaion::qWaitForWindowShown(&window);
QTRY_VERIFY(qApp->activeWindow() == &window);
QFocusEvent focusIn(QEvent::FocusIn);
@@ -1022,9 +1023,6 @@ void tst_QCompleter::multipleWidgets()
comboBox->setFocus();
comboBox->show();
window.activateWindow();
-#ifdef Q_WS_X11
- qt_x11_wait_for_window_manager(&window);
-#endif
QApplication::setActiveWindow(&window);
QTest::qWait(50);
QTRY_VERIFY(qApp->focusWidget() == comboBox);
diff --git a/tests/auto/qfiledialog/tst_qfiledialog.cpp b/tests/auto/qfiledialog/tst_qfiledialog.cpp
index 18875e7..d6225cd 100644
--- a/tests/auto/qfiledialog/tst_qfiledialog.cpp
+++ b/tests/auto/qfiledialog/tst_qfiledialog.cpp
@@ -1039,7 +1039,10 @@ void tst_QFiledialog::focus()
QNonNativeFileDialog fd;
fd.setDirectory(QDir::currentPath());
fd.show();
+ QApplication::setActiveWindow(&fd);
+ QTest::qWaitForWindowShown(&fd);
QTRY_COMPARE(fd.isVisible(), true);
+ QTRY_COMPARE(QApplication::activeWindow(), &fd);
qApp->processEvents();
// make sure the tests work with focus follows mouse
diff --git a/tests/auto/qheaderview/tst_qheaderview.cpp b/tests/auto/qheaderview/tst_qheaderview.cpp
index 0be895b..920231d 100644
--- a/tests/auto/qheaderview/tst_qheaderview.cpp
+++ b/tests/auto/qheaderview/tst_qheaderview.cpp
@@ -1434,7 +1434,8 @@ void tst_QHeaderView::focusPolicy()
widget.show();
widget.setFocus(Qt::OtherFocusReason);
- QTest::qWait(100);
+ QApplication::setActiveWindow(&widget);
+ QTest::qWaitForWindowShown(&widget);
widget.activateWindow();
QTest::qWait(100);
diff --git a/tests/auto/qmenu/tst_qmenu.cpp b/tests/auto/qmenu/tst_qmenu.cpp
index a5bac37..d7f453e 100644
--- a/tests/auto/qmenu/tst_qmenu.cpp
+++ b/tests/auto/qmenu/tst_qmenu.cpp
@@ -440,7 +440,9 @@ void tst_QMenu::overrideMenuAction()
m->addAction(aQuit);
w.show();
+ QApplication::setActiveWindow(&w);
w.setFocus();
+ QTest::qWaitForWindowShown(&w);
QTRY_VERIFY(w.hasFocus());
//test of the action inside the menu
diff --git a/tests/auto/qspinbox/tst_qspinbox.cpp b/tests/auto/qspinbox/tst_qspinbox.cpp
index 80f185a..69347c4 100644
--- a/tests/auto/qspinbox/tst_qspinbox.cpp
+++ b/tests/auto/qspinbox/tst_qspinbox.cpp
@@ -752,8 +752,8 @@ void tst_QSpinBox::editingFinished()
testFocusWidget->show();
QApplication::setActiveWindow(testFocusWidget);
+ QTest::qWaitForWindowShown(testFocusWidget);
box->activateWindow();
- QTest::qWait(100);//qApp->processEvents();
box->setFocus();
QTRY_COMPARE(qApp->focusWidget(), box);
diff --git a/tests/auto/qstyle/tst_qstyle.cpp b/tests/auto/qstyle/tst_qstyle.cpp
index 8526be1..56776d7 100644
--- a/tests/auto/qstyle/tst_qstyle.cpp
+++ b/tests/auto/qstyle/tst_qstyle.cpp
@@ -219,7 +219,7 @@ void tst_QStyle::testStyleFactory()
foreach (QString styleName , keys) {
QStyle *style = QStyleFactory::create(styleName);
- QVERIFY(style != 0);
+ QVERIFY2(style != 0, qPrintable(QString::fromLatin1("Fail to load style '%1'").arg(styleName)));
delete style;
}
}
diff --git a/tests/auto/qtableview/tst_qtableview.cpp b/tests/auto/qtableview/tst_qtableview.cpp
index ce13d31..f5d5040 100644
--- a/tests/auto/qtableview/tst_qtableview.cpp
+++ b/tests/auto/qtableview/tst_qtableview.cpp
@@ -2908,11 +2908,11 @@ void tst_QTableView::tabFocus()
QLineEdit *edit = new QLineEdit(&window);
window.show();
+ QApplication::setActiveWindow(&window);
QTest::qWaitForWindowShown(&window);
window.setFocus();
QTest::qWait(100);
window.activateWindow();
- QApplication::setActiveWindow(&window);
QTest::qWait(100);
qApp->processEvents();
diff --git a/tests/auto/qtextbrowser/tst_qtextbrowser.cpp b/tests/auto/qtextbrowser/tst_qtextbrowser.cpp
index 1f06dcf..829d580 100644
--- a/tests/auto/qtextbrowser/tst_qtextbrowser.cpp
+++ b/tests/auto/qtextbrowser/tst_qtextbrowser.cpp
@@ -63,10 +63,8 @@ class TestBrowser : public QTextBrowser
public:
inline TestBrowser() : htmlLoadAttempts(0) {
show();
-#ifdef Q_WS_X11
- qt_x11_wait_for_window_manager(this);
-#endif
QApplication::setActiveWindow(this);
+ QTest::qWaitForWindowShown(this);
activateWindow();
setFocus();
QTest::qWait(50);