diff options
author | Janne Anttila <janne.anttila@digia.com> | 2009-10-23 11:16:38 (GMT) |
---|---|---|
committer | Frans Englich <frans.englich@nokia.com> | 2009-10-23 13:50:53 (GMT) |
commit | 1c6bd7f61d2cbe0b8c0fa451f5f9a7efdfaf04c7 (patch) | |
tree | ee9cea6348059a061ca8d2a7b52eafcc27472845 | |
parent | d54bc7379de145995534058dd2f6b400c9ab160e (diff) | |
download | Qt-1c6bd7f61d2cbe0b8c0fa451f5f9a7efdfaf04c7.zip Qt-1c6bd7f61d2cbe0b8c0fa451f5f9a7efdfaf04c7.tar.gz Qt-1c6bd7f61d2cbe0b8c0fa451f5f9a7efdfaf04c7.tar.bz2 |
Fixed softkey autotest build after 5370e5ff.
Reviewed-by: axis
-rw-r--r-- | tests/auto/qsoftkeymanager/tst_qsoftkeymanager.cpp | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/tests/auto/qsoftkeymanager/tst_qsoftkeymanager.cpp b/tests/auto/qsoftkeymanager/tst_qsoftkeymanager.cpp index 6efa85b..87e0533 100644 --- a/tests/auto/qsoftkeymanager/tst_qsoftkeymanager.cpp +++ b/tests/auto/qsoftkeymanager/tst_qsoftkeymanager.cpp @@ -47,6 +47,10 @@ #include "qdialogbuttonbox.h" #include "private/qsoftkeymanager_p.h" +#ifdef Q_OS_SYMBIAN +#include "qsymbianevent.h" +#endif + #ifdef Q_WS_S60 static const int s60CommandStart = 6000; #endif @@ -69,6 +73,13 @@ private slots: void updateSoftKeysCompressed(); void handleCommand(); void checkSoftkeyEnableStates(); + +private: // utils + inline void simulateSymbianCommand(int command) + { + QSymbianEvent event1(QSymbianEvent::CommandEvent, command); + qApp->symbianProcessEvent(&event1); + }; }; class EventListener : public QObject @@ -167,8 +178,8 @@ void tst_QSoftKeyManager::handleCommand() // QTest::keyPress(&w, Qt::Key_Context1); // QTest::keyPress(&w, Qt::Key_Context2); - qApp->symbianHandleCommand(6000); - qApp->symbianHandleCommand(6001); + simulateSymbianCommand(6000); + simulateSymbianCommand(6001); QApplication::processEvents(); @@ -200,9 +211,9 @@ void tst_QSoftKeyManager::checkSoftkeyEnableStates() //disabled button gets none. for (int i = 0; i < 10; i++) { //simulate "Restore Defaults" softkey press - qApp->symbianHandleCommand(s60CommandStart); + simulateSymbianCommand(s60CommandStart); //simulate "help" softkey press - qApp->symbianHandleCommand(s60CommandStart + 1); + simulateSymbianCommand(s60CommandStart + 1); } QApplication::processEvents(); QCOMPARE(spy0.count(), 10); @@ -212,16 +223,16 @@ void tst_QSoftKeyManager::checkSoftkeyEnableStates() for (int i = 0; i < 10; i++) { //simulate "Restore Defaults" softkey press - qApp->symbianHandleCommand(s60CommandStart); + simulateSymbianCommand(s60CommandStart); //simulate "help" softkey press - qApp->symbianHandleCommand(s60CommandStart + 1); + simulateSymbianCommand(s60CommandStart + 1); //switch enabled button to disabled and vice versa pBHelp->setEnabled(!pBHelp->isEnabled()); pBDefaults->setEnabled(!pBDefaults->isEnabled()); } QApplication::processEvents(); QCOMPARE(spy0.count(), 5); - QCOMPARE(spy1.count(), 5); + QCOMPARE(spy1.count(), 5); } QTEST_MAIN(tst_QSoftKeyManager) |