summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2011-03-31 00:47:30 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2011-03-31 00:47:30 (GMT)
commit97902c7f81228fa669acc6e075681dc05b404b1a (patch)
tree1d45a501d77829247a8f5a6c5cda19507a251767
parent917102fedeef6a22237fd426c28268856984965e (diff)
parent0b2446df2908a17496aadb70f403ba361cfc2142 (diff)
downloadQt-97902c7f81228fa669acc6e075681dc05b404b1a.zip
Qt-97902c7f81228fa669acc6e075681dc05b404b1a.tar.gz
Qt-97902c7f81228fa669acc6e075681dc05b404b1a.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-s60-public into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/qt-s60-public: QSoftkeyManager auto test update
-rw-r--r--tests/auto/qsoftkeymanager/tst_qsoftkeymanager.cpp34
1 files changed, 19 insertions, 15 deletions
diff --git a/tests/auto/qsoftkeymanager/tst_qsoftkeymanager.cpp b/tests/auto/qsoftkeymanager/tst_qsoftkeymanager.cpp
index 910d437..bd19afb 100644
--- a/tests/auto/qsoftkeymanager/tst_qsoftkeymanager.cpp
+++ b/tests/auto/qsoftkeymanager/tst_qsoftkeymanager.cpp
@@ -179,8 +179,8 @@ void tst_QSoftKeyManager::handleCommand()
// QTest::keyPress(&w, Qt::Key_Context1);
// QTest::keyPress(&w, Qt::Key_Context2);
- simulateSymbianCommand(6000);
- simulateSymbianCommand(6001);
+ simulateSymbianCommand(s60CommandStart); //0 = LSK position
+ simulateSymbianCommand(s60CommandStart + 2); //2 = RSK position
QApplication::processEvents();
@@ -205,28 +205,32 @@ void tst_QSoftKeyManager::checkSoftkeyEnableStates()
w.show();
QApplication::processEvents();
- QSignalSpy spy0(w.actions()[0], SIGNAL(triggered())); //restore defaults action
- QSignalSpy spy1(w.actions()[1], SIGNAL(triggered())); //disabled help action
+ //According to StandardButton enum in QDialogButtonBox the Help action
+ //is inserted before RestoreDefaults and thus help action is in index 0
+ QSignalSpy spy0(w.actions()[0], SIGNAL(triggered())); //disabled help action
+ QSignalSpy spy1(w.actions()[1], SIGNAL(triggered())); //restore defaults action
//Verify that enabled button gets all the action trigger signals and
//disabled button gets none.
for (int i = 0; i < 10; i++) {
- //simulate "Restore Defaults" softkey press
- simulateSymbianCommand(s60CommandStart);
//simulate "help" softkey press
- simulateSymbianCommand(s60CommandStart + 1);
+ simulateSymbianCommand(s60CommandStart);
+ //simulate "Restore Defaults" softkey press
+ simulateSymbianCommand(s60CommandStart + 2);
}
QApplication::processEvents();
- QCOMPARE(spy0.count(), 10);
- QCOMPARE(spy1.count(), 0);
+ //Restore defaults button is enabled and its signals are recorded to spy1
+ QCOMPARE(spy0.count(), 0);
+ QCOMPARE(spy1.count(), 10);
+
spy0.clear();
spy1.clear();
for (int i = 0; i < 10; i++) {
- //simulate "Restore Defaults" softkey press
- simulateSymbianCommand(s60CommandStart);
//simulate "help" softkey press
- simulateSymbianCommand(s60CommandStart + 1);
+ simulateSymbianCommand(s60CommandStart);
+ //simulate "Restore Defaults" softkey press
+ simulateSymbianCommand(s60CommandStart + 2);
//switch enabled button to disabled and vice versa
pBHelp->setEnabled(!pBHelp->isEnabled());
pBDefaults->setEnabled(!pBDefaults->isEnabled());
@@ -261,7 +265,7 @@ void tst_QSoftKeyManager::noMergingOverWindowBoundary()
//Verify that both base softkeys emit triggered signals
simulateSymbianCommand(s60CommandStart);
- simulateSymbianCommand(s60CommandStart + 1);
+ simulateSymbianCommand(s60CommandStart + 2);
QCOMPARE(baseLeftSpy.count(), 1);
QCOMPARE(baseRightSpy.count(), 1);
@@ -275,7 +279,7 @@ void tst_QSoftKeyManager::noMergingOverWindowBoundary()
QApplication::processEvents();
simulateSymbianCommand(s60CommandStart);
- simulateSymbianCommand(s60CommandStart + 1);
+ simulateSymbianCommand(s60CommandStart + 2);
QCOMPARE(baseLeftSpy.count(), 0);
QCOMPARE(baseRightSpy.count(), 0);
@@ -291,7 +295,7 @@ void tst_QSoftKeyManager::noMergingOverWindowBoundary()
QApplication::processEvents();
simulateSymbianCommand(s60CommandStart);
- simulateSymbianCommand(s60CommandStart + 1);
+ simulateSymbianCommand(s60CommandStart + 2);
QCOMPARE(baseLeftSpy.count(), 0);
QCOMPARE(baseRightSpy.count(), 0);