diff options
author | Olivier Goffart <ogoffart@trolltech.com> | 2009-09-16 13:34:01 (GMT) |
---|---|---|
committer | Olivier Goffart <ogoffart@trolltech.com> | 2009-09-16 13:46:09 (GMT) |
commit | c80529584a955bea1b9e49cde0775c9ce53ce1c8 (patch) | |
tree | d801eefab2d5e9d420f5612301a1060b361ca972 | |
parent | 51d2e7756e33ee510fdcf53d5e2ae6f96f2b1c70 (diff) | |
download | Qt-c80529584a955bea1b9e49cde0775c9ce53ce1c8.zip Qt-c80529584a955bea1b9e49cde0775c9ce53ce1c8.tar.gz Qt-c80529584a955bea1b9e49cde0775c9ce53ce1c8.tar.bz2 |
Stabilize tests
-rw-r--r-- | tests/auto/qdoublespinbox/tst_qdoublespinbox.cpp | 4 | ||||
-rw-r--r-- | tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp | 9 | ||||
-rw-r--r-- | tests/auto/qgroupbox/tst_qgroupbox.cpp | 1 | ||||
-rw-r--r-- | tests/auto/qlineedit/tst_qlineedit.cpp | 1 | ||||
-rw-r--r-- | tests/auto/qtoolbar/tst_qtoolbar.cpp | 8 |
5 files changed, 19 insertions, 4 deletions
diff --git a/tests/auto/qdoublespinbox/tst_qdoublespinbox.cpp b/tests/auto/qdoublespinbox/tst_qdoublespinbox.cpp index e7bb93f..502e983 100644 --- a/tests/auto/qdoublespinbox/tst_qdoublespinbox.cpp +++ b/tests/auto/qdoublespinbox/tst_qdoublespinbox.cpp @@ -775,9 +775,11 @@ void tst_QDoubleSpinBox::editingFinished() layout->addWidget(box2); testFocusWidget->show(); + QApplication::setActiveWindow(testFocusWidget); QTest::qWait(10); - QTRY_VERIFY(box->isActiveWindow()); + QTRY_VERIFY(testFocusWidget->isActiveWindow()); box->setFocus(); + QTRY_VERIFY(box->hasFocus()); QSignalSpy editingFinishedSpy1(box, SIGNAL(editingFinished())); QSignalSpy editingFinishedSpy2(box2, SIGNAL(editingFinished())); diff --git a/tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp b/tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp index c86d9e3..32b4420 100644 --- a/tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp +++ b/tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp @@ -1316,6 +1316,7 @@ void tst_QGraphicsProxyWidget::paintEvent() //make sure we flush all the paint events QTest::qWait(250); + QTRY_VERIFY(proxy.paintCount > 1); proxy.paintCount = 0; w->update(); @@ -2071,6 +2072,7 @@ void tst_QGraphicsProxyWidget::tabFocus_complexTwoWidgets() QApplication::setActiveWindow(&window); window.activateWindow(); QTest::qWait(125); + QTRY_COMPARE(QApplication::activeWindow(), &window); leftDial->setFocus(); QTest::qWait(125); @@ -2207,6 +2209,7 @@ void tst_QGraphicsProxyWidget::setFocus_simpleWidget() QApplication::setActiveWindow(&window); window.activateWindow(); QTest::qWait(125); + QTRY_COMPARE(QApplication::activeWindow(), &window); leftDial->setFocus(); QTest::qWait(125); @@ -2279,6 +2282,7 @@ void tst_QGraphicsProxyWidget::setFocus_simpleTwoWidgets() QApplication::setActiveWindow(&window); window.activateWindow(); QTest::qWait(125); + QTRY_COMPARE(QApplication::activeWindow(), &window); leftDial->setFocus(); QTest::qWait(125); @@ -2358,6 +2362,7 @@ void tst_QGraphicsProxyWidget::setFocus_complexTwoWidgets() QApplication::setActiveWindow(&window); window.activateWindow(); QTest::qWait(125); + QTRY_COMPARE(QApplication::activeWindow(), &window); leftDial->setFocus(); QTest::qWait(125); @@ -3350,7 +3355,9 @@ void tst_QGraphicsProxyWidget::clickFocus() #ifdef Q_WS_X11 qt_x11_wait_for_window_manager(&view); #endif - QTest::qWait(250); + QApplication::setActiveWindow(&view); + QTest::qWait(25); + QTRY_COMPARE(QApplication::activeWindow(), &view); QVERIFY(!proxy->hasFocus()); QVERIFY(!proxy->widget()->hasFocus()); diff --git a/tests/auto/qgroupbox/tst_qgroupbox.cpp b/tests/auto/qgroupbox/tst_qgroupbox.cpp index 5773804..20eec7e 100644 --- a/tests/auto/qgroupbox/tst_qgroupbox.cpp +++ b/tests/auto/qgroupbox/tst_qgroupbox.cpp @@ -467,6 +467,7 @@ void tst_QGroupBox::propagateFocus() QGroupBox box; QLineEdit lineEdit(&box); box.show(); + QApplication::setActiveWindow(&box); box.setFocus(); QTest::qWait(250); QTRY_COMPARE(qApp->focusWidget(), static_cast<QWidget*>(&lineEdit)); diff --git a/tests/auto/qlineedit/tst_qlineedit.cpp b/tests/auto/qlineedit/tst_qlineedit.cpp index 3a81212..1417e69 100644 --- a/tests/auto/qlineedit/tst_qlineedit.cpp +++ b/tests/auto/qlineedit/tst_qlineedit.cpp @@ -339,6 +339,7 @@ void tst_QLineEdit::initTestCase() testWidget->resize(200,50); testWidget->show(); + QApplication::setActiveWindow(testWidget); #ifdef Q_WS_X11 // to be safe and avoid failing setFocus with window managers qt_x11_wait_for_window_manager(testWidget); diff --git a/tests/auto/qtoolbar/tst_qtoolbar.cpp b/tests/auto/qtoolbar/tst_qtoolbar.cpp index 90d7cf4..e4f317c 100644 --- a/tests/auto/qtoolbar/tst_qtoolbar.cpp +++ b/tests/auto/qtoolbar/tst_qtoolbar.cpp @@ -55,6 +55,8 @@ #include <qlineedit.h> #include <qkeysequence.h> +#include "../../shared/util.h" + //TESTED_FILES= QT_FORWARD_DECLARE_CLASS(QAction) @@ -973,12 +975,14 @@ void tst_QToolBar::accel() QSignalSpy spy(action, SIGNAL(triggered(bool))); mw.show(); - QTest::qWait(1000); + QApplication::setActiveWindow(&mw); + QTest::qWait(100); + QTRY_COMPARE(QApplication::activeWindow(), &mw); QTest::keyClick(&mw, Qt::Key_T, Qt::AltModifier); QTest::qWait(300); - QCOMPARE(spy.count(), 1); + QTRY_COMPARE(spy.count(), 1); #ifdef Q_WS_MAC qt_set_sequence_auto_mnemonic(false); #endif |