14 * Description: |
14 * Description: |
15 * |
15 * |
16 */ |
16 */ |
17 #include "ut_lcvtindicatorplugin.h" |
17 #include "ut_lcvtindicatorplugin.h" |
18 #include "lcvtindicatorplugin.h" |
18 #include "lcvtindicatorplugin.h" |
19 #include "symbianstubs_helper.h" |
19 #include "qprocess.h" |
20 |
20 |
21 #include <QtTest/QtTest> |
21 #include <QtTest/QtTest> |
22 |
22 |
23 const static QString lcVtIndicator = "com.nokia.hb.indicator.lcvtindicatorplugin/1.0"; |
23 const static QString lcVtIndicator = "com.nokia.hb.indicator.lcvtindicatorplugin/1.0"; |
24 |
24 |
76 //No interation requered |
76 //No interation requered |
77 QVERIFY( !mLcVtIndicatorPlugin->handleInteraction( |
77 QVERIFY( !mLcVtIndicatorPlugin->handleInteraction( |
78 HbIndicatorInterface::NoInteraction) ); |
78 HbIndicatorInterface::NoInteraction) ); |
79 QCOMPARE( spy.count(), 0 ); |
79 QCOMPARE( spy.count(), 0 ); |
80 |
80 |
81 //Indicator activated, no VT running => deactivating |
81 //Indicator activated, no VT running => deactivating |
82 SymbianStubHelper::setVtTaskExists(false); |
|
83 QVERIFY( !mLcVtIndicatorPlugin->handleInteraction( |
82 QVERIFY( !mLcVtIndicatorPlugin->handleInteraction( |
84 HbIndicatorInterface::InteractionActivated) ); |
83 HbIndicatorInterface::InteractionActivated) ); |
85 QCOMPARE( spy.count(), 1 ); |
84 QCOMPARE( spy.count(), 1 ); |
86 |
85 |
87 //Indicator activated, VT running => bringing to FG |
86 //Indicator activated, VT running => bringing to FG |
88 SymbianStubHelper::setVtTaskExists(true); |
|
89 spy.clear(); |
87 spy.clear(); |
90 QVERIFY( mLcVtIndicatorPlugin->bringVtToForeground() ); |
88 QVERIFY( mLcVtIndicatorPlugin->bringVtToForeground() ); |
|
89 QVERIFY( QProcess::isRunning ); |
91 QCOMPARE( spy.count(), 0 ); |
90 QCOMPARE( spy.count(), 0 ); |
92 } |
91 } |
93 |
92 |
94 void UT_LcVtIndicatorPlugin::testIndicatorData() |
93 void UT_LcVtIndicatorPlugin::testIndicatorData() |
95 { |
94 { |
162 HbIndicatorInterface::RequestActivate, QVariant(parameters)) ); |
161 HbIndicatorInterface::RequestActivate, QVariant(parameters)) ); |
163 QCOMPARE( spy.count(), 0 ); |
162 QCOMPARE( spy.count(), 0 ); |
164 } |
163 } |
165 |
164 |
166 void UT_LcVtIndicatorPlugin::testBringVtToForeground() |
165 void UT_LcVtIndicatorPlugin::testBringVtToForeground() |
167 { |
166 { |
168 SymbianStubHelper::setVtTaskExists(false); |
|
169 QVERIFY( !mLcVtIndicatorPlugin->bringVtToForeground() ); |
167 QVERIFY( !mLcVtIndicatorPlugin->bringVtToForeground() ); |
170 |
168 QVERIFY( QProcess::isRunning ); |
171 SymbianStubHelper::setVtTaskExists(true); |
|
172 QVERIFY( mLcVtIndicatorPlugin->bringVtToForeground() ); |
|
173 } |
169 } |
|
170 |