diff options
author | Janne Anttila <janne.anttila@digia.com> | 2009-10-23 12:29:00 (GMT) |
---|---|---|
committer | Janne Anttila <janne.anttila@digia.com> | 2009-10-23 12:29:00 (GMT) |
commit | 2e635923ef0061397966258fa8a792ae744d1dc9 (patch) | |
tree | b9a9e4423d3d2d192f6abde9a63dc50f18edddb5 | |
parent | dd48c27fcdded149c8db7d08107632c2476178ca (diff) | |
parent | 97d28c26ba981332f51ab81024bb8b0224afeb81 (diff) | |
download | Qt-2e635923ef0061397966258fa8a792ae744d1dc9.zip Qt-2e635923ef0061397966258fa8a792ae744d1dc9.tar.gz Qt-2e635923ef0061397966258fa8a792ae744d1dc9.tar.bz2 |
Merge branch '4.6' of git@scm.dev.troll.no:qt/qt-s60-public into 4.6
-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) |