diff options
author | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-09-09 05:31:43 (GMT) |
---|---|---|
committer | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-09-09 05:31:43 (GMT) |
commit | ae7a3485c0e6748361789491af33ee7b7fe093bc (patch) | |
tree | 7d653db085947561419efbea4f9d66659eecae05 /tests/auto/qpushbutton/tst_qpushbutton.cpp | |
parent | bd54370a759db272ce06d2fcdcce3e90c1dd17e8 (diff) | |
parent | dc4d2b260debda80b8a0d81c9a032050232fdaab (diff) | |
download | Qt-ae7a3485c0e6748361789491af33ee7b7fe093bc.zip Qt-ae7a3485c0e6748361789491af33ee7b7fe093bc.tar.gz Qt-ae7a3485c0e6748361789491af33ee7b7fe093bc.tar.bz2 |
Merge branch 'kinetic-declarativeui' of git@scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
Diffstat (limited to 'tests/auto/qpushbutton/tst_qpushbutton.cpp')
-rw-r--r-- | tests/auto/qpushbutton/tst_qpushbutton.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/tests/auto/qpushbutton/tst_qpushbutton.cpp b/tests/auto/qpushbutton/tst_qpushbutton.cpp index 5059578..2013258 100644 --- a/tests/auto/qpushbutton/tst_qpushbutton.cpp +++ b/tests/auto/qpushbutton/tst_qpushbutton.cpp @@ -54,6 +54,8 @@ #include <QStyleFactory> #include <QTabWidget> +#include "../../shared/util.h" + Q_DECLARE_METATYPE(QPushButton*) //TESTED_CLASS= @@ -413,6 +415,7 @@ void tst_QPushButton::setAccel() // The shortcut will not be activated unless the button is in a active // window and has focus + QApplication::setActiveWindow(testWidget); testWidget->setFocus(); for (int i = 0; !testWidget->isActiveWindow() && i < 1000; ++i) { testWidget->activateWindow(); @@ -421,8 +424,8 @@ void tst_QPushButton::setAccel() } QVERIFY(testWidget->isActiveWindow()); QTest::keyClick( testWidget, 'A', Qt::AltModifier ); - QTest::qWait( 500 ); - QVERIFY( click_count == 1 ); + QTest::qWait( 50 ); + QTRY_VERIFY( click_count == 1 ); QVERIFY( press_count == 1 ); QVERIFY( release_count == 1 ); QVERIFY( toggle_count == 0 ); @@ -430,6 +433,7 @@ void tst_QPushButton::setAccel() // wait 200 ms because setAccel uses animateClick. // if we don't wait this may screw up a next test. QTest::qWait(200); + QTRY_VERIFY( !testWidget->isDown() ); } void tst_QPushButton::animateClick() |