|
1 /* |
|
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 |
|
18 #include "ut_cpdivertplugin.h" |
|
19 #include "qtestmains60ui.h" |
|
20 #include <psetcalldivertingwrapper.h> |
|
21 #include <hbdialog.h> |
|
22 #include <qaction> |
|
23 #include <hblabel.h> |
|
24 #include <HbListWidgetItem> |
|
25 #include <HbListWidget> |
|
26 #include <HbDialog> |
|
27 #include <HbLineEdit> |
|
28 #include <HbAbstractViewItem> |
|
29 #include <HbDataFormModel> |
|
30 #include "cpitemdatahelper.h" |
|
31 #include "cpdivertitemdata.h" |
|
32 #include "psetwrappertypes.h" |
|
33 |
|
34 #define private public |
|
35 #include "cpdivertplugin.h" |
|
36 #include "cpdivertplugingroup.h" |
|
37 |
|
38 |
|
39 |
|
40 Q_EXTERN_C const char * qt_plugin_query_verification_data(); |
|
41 Q_EXTERN_C ::QObject * qt_plugin_instance(); |
|
42 |
|
43 class CPsetContainer |
|
44 { |
|
45 public: |
|
46 CPsetContainer(){}; |
|
47 ~CPsetContainer(){}; |
|
48 }; |
|
49 |
|
50 /*! |
|
51 UT_CpDivertPlugin::UT_CpDivertPlugin |
|
52 */ |
|
53 UT_CpDivertPlugin::UT_CpDivertPlugin() |
|
54 : m_divertplugin(NULL) |
|
55 { |
|
56 const char * verificationData = qt_plugin_query_verification_data(); |
|
57 } |
|
58 |
|
59 /*! |
|
60 UT_CpDivertPlugin::~UT_CpDivertPlugin |
|
61 */ |
|
62 UT_CpDivertPlugin::~UT_CpDivertPlugin() |
|
63 { |
|
64 delete m_divertplugin; |
|
65 } |
|
66 |
|
67 /*! |
|
68 UT_CpDivertPlugin::init |
|
69 */ |
|
70 void UT_CpDivertPlugin::init() |
|
71 { |
|
72 initialize(); |
|
73 |
|
74 CPsetContainer tmpPsetContainer; |
|
75 PSetCallDivertingWrapper *tmpDivWrapper = |
|
76 new PSetCallDivertingWrapper(tmpPsetContainer, this); |
|
77 expect("PSetWrapper::callDivertingWrapper").returns(tmpDivWrapper); // FIXME to mock framework |
|
78 m_divertplugin = (CpDivertPlugin*)qt_plugin_instance(); |
|
79 |
|
80 QVERIFY(m_divertplugin); |
|
81 |
|
82 m_helper = new CpItemDataHelper; |
|
83 m_divertpluginGroup = qobject_cast<CpDivertPluginGroup *>( |
|
84 m_divertplugin->createSettingFormItemData(*m_helper)); |
|
85 QVERIFY(m_divertpluginGroup); |
|
86 |
|
87 QVERIFY(verify()); |
|
88 } |
|
89 |
|
90 /*! |
|
91 UT_CpDivertPlugin::cleanup |
|
92 */ |
|
93 void UT_CpDivertPlugin::cleanup() |
|
94 { |
|
95 reset(); |
|
96 |
|
97 delete m_divertplugin; |
|
98 m_divertplugin = NULL; |
|
99 |
|
100 delete m_divertpluginGroup; |
|
101 m_divertpluginGroup = NULL; |
|
102 |
|
103 delete m_helper; |
|
104 m_helper = NULL; |
|
105 } |
|
106 |
|
107 /*! |
|
108 UT_CpDivertPlugin::t_memleak |
|
109 */ |
|
110 void UT_CpDivertPlugin::t_memleak() |
|
111 { |
|
112 |
|
113 } |
|
114 |
|
115 /*! |
|
116 UT_CpDivertPlugin::t_createSettingFormItemData |
|
117 */ |
|
118 void UT_CpDivertPlugin::t_createSettingFormItemData() |
|
119 { |
|
120 CpItemDataHelper itemDataHelper; |
|
121 CPsetContainer tmpContainer; |
|
122 PSetCallDivertingWrapper tmpDivWrapper(tmpContainer); |
|
123 |
|
124 expect("PSetWrapper::callDivertingWrapper").returns(&tmpDivWrapper); |
|
125 |
|
126 CpDivertPlugin* p = (CpDivertPlugin*)qt_plugin_instance(); |
|
127 CpSettingFormItemData *pSettingFormItemData = p->createSettingFormItemData(itemDataHelper); |
|
128 |
|
129 QVERIFY(verify()); |
|
130 } |
|
131 |
|
132 /*! |
|
133 UT_CpDivertPlugin::t_changeDivertingStateRequested |
|
134 */ |
|
135 void UT_CpDivertPlugin::t_changeDivertingStateRequested() |
|
136 { |
|
137 //except user cancels |
|
138 appendAction("All voice calls:", selectAction, "Cancel"); |
|
139 expect("PSetCallDivertingWrapper::getDefaultNumbers"); |
|
140 m_divertpluginGroup->m_DataItemAllVoiceCalls->setContentWidgetData("number", ""); |
|
141 m_divertpluginGroup->m_DataItemAllVoiceCalls->thisItemClicked(); |
|
142 QVERIFY(verify()); |
|
143 |
|
144 //except user selects vmb and inserts number |
|
145 appendAction("All voice calls:", selectItem, "Voice mail box"); |
|
146 appendAction("Voice mail box number:", insertText, "12345"); |
|
147 appendAction("Voice mail box number:", selectAction, "OK"); |
|
148 expect("PSetCallDivertingWrapper::getDefaultNumbers"); |
|
149 expect("SsSettingsWrapper::get"); |
|
150 expect("PSetCallDivertingWrapper::setCallDiverting"); |
|
151 expect("CpPhoneNotes::noteShowing").returns(false); |
|
152 expect("CpPhoneNotes::showGlobalProgressNote"); |
|
153 m_divertpluginGroup->m_DataItemAllVoiceCalls->thisItemClicked(); |
|
154 PSCallDivertingCommand command; |
|
155 command.iNumber = "12345"; |
|
156 command.iStatus = DivertingStatusActive; |
|
157 command.iCondition = m_divertpluginGroup->m_DataItemAllVoiceCalls->condition(); |
|
158 expect("CpPhoneNotes::showGlobalNote"); |
|
159 m_divertpluginGroup->handleDivertingChanged(command, false); |
|
160 expect("CpPhoneNotes::cancelNote"); |
|
161 m_divertpluginGroup->divertRequestProcessed(); |
|
162 QVERIFY(verify()); |
|
163 |
|
164 //except user selects one of the default numbers |
|
165 m_divertpluginGroup->m_DataItemAllVoiceCalls->setContentWidgetData("number",""); |
|
166 appendAction("All voice calls:", selectItem, "0401234567"); |
|
167 expect("PSetCallDivertingWrapper::getDefaultNumbers"); |
|
168 expect("SsSettingsWrapper::get"); |
|
169 expect("PSetCallDivertingWrapper::setCallDiverting"); |
|
170 expect("CpPhoneNotes::noteShowing").returns(false); |
|
171 expect("CpPhoneNotes::showGlobalProgressNote"); |
|
172 m_divertpluginGroup->m_DataItemAllVoiceCalls->thisItemClicked(); |
|
173 command.iNumber = "0401234567"; |
|
174 command.iStatus = DivertingStatusActive; |
|
175 command.iCondition = m_divertpluginGroup->m_DataItemAllVoiceCalls->condition(); |
|
176 expect("CpPhoneNotes::cancelNote"); |
|
177 expect("CpPhoneNotes::showGlobalNote"); |
|
178 expect("PSetCallDivertingWrapper::setNewDefaultNumber").with(QString("0401234567")); |
|
179 expect("Tools::voipSupported").returns(false); |
|
180 m_divertpluginGroup->handleDivertingChanged(command, true); |
|
181 expect("CpPhoneNotes::cancelNote"); |
|
182 m_divertpluginGroup->divertRequestProcessed(); |
|
183 QVERIFY(verify()); |
|
184 |
|
185 // Divert is disabled |
|
186 expect("SsSettingsWrapper::get"); |
|
187 expect("PSetCallDivertingWrapper::setCallDiverting"); // Disable divert |
|
188 expect("CpPhoneNotes::noteShowing").returns(false); |
|
189 expect("CpPhoneNotes::showGlobalProgressNote"); |
|
190 m_divertpluginGroup->m_DataItemAllVoiceCalls->thisItemClicked(); |
|
191 command.iNumber = ""; |
|
192 command.iStatus = DivertingStatusInactive; |
|
193 command.iCondition = m_divertpluginGroup->m_DataItemAllVoiceCalls->condition(); |
|
194 expect("CpPhoneNotes::showGlobalNote"); |
|
195 m_divertpluginGroup->handleDivertingChanged(command, false); |
|
196 expect("CpPhoneNotes::cancelNote"); |
|
197 m_divertpluginGroup->divertRequestProcessed(); |
|
198 QVERIFY(verify()); |
|
199 |
|
200 //except user selects other number, inserts number and cancels |
|
201 appendAction("All voice calls:", selectItem, "Other number"); |
|
202 appendAction("Number:", insertText, "12345"); |
|
203 appendAction("Number:", selectAction, "Cancel"); |
|
204 expect("PSetCallDivertingWrapper::getDefaultNumbers"); |
|
205 m_divertpluginGroup->m_DataItemAllVoiceCalls->thisItemClicked(); |
|
206 QVERIFY(verify()); |
|
207 } |
|
208 |
|
209 /*! |
|
210 UT_CpDivertPlugin::t_itemShown |
|
211 */ |
|
212 void UT_CpDivertPlugin::t_itemShown() |
|
213 { |
|
214 HbDataFormModel* model = |
|
215 qobject_cast<HbDataFormModel*>(m_divertpluginGroup->model()); |
|
216 |
|
217 expect("PSetCallDivertingWrapper::getCallDivertingStatus"); |
|
218 expect("CpPhoneNotes::noteShowing").returns(false); |
|
219 expect("CpPhoneNotes::showGlobalProgressNote"); |
|
220 m_divertpluginGroup->itemShown( |
|
221 model->indexFromItem(m_divertpluginGroup->m_DataItemAllVoiceCalls)); |
|
222 m_divertpluginGroup->itemShown( |
|
223 model->indexFromItem(m_divertpluginGroup->m_DataItemIfBusy)); |
|
224 m_divertpluginGroup->itemShown( |
|
225 model->indexFromItem(m_divertpluginGroup->m_DataItemIfNotAnswered)); |
|
226 m_divertpluginGroup->itemShown( |
|
227 model->indexFromItem(m_divertpluginGroup->m_DataItemIfOutOfReach)); |
|
228 m_divertpluginGroup->itemShown( |
|
229 model->indexFromItem(m_divertpluginGroup->m_DataItemIfNotAvailable)); |
|
230 |
|
231 QList<PSCallDivertingStatus*> list; |
|
232 PSCallDivertingStatus divertStatus; |
|
233 list.append(&divertStatus); |
|
234 divertStatus.iCondition = m_divertpluginGroup->m_DataItemAllVoiceCalls->condition(); |
|
235 m_divertpluginGroup->handleDivertingStatus(list, true); |
|
236 m_divertpluginGroup->divertRequestProcessed(); |
|
237 divertStatus.iCondition = m_divertpluginGroup->m_DataItemIfBusy->condition(); |
|
238 m_divertpluginGroup->handleDivertingStatus(list, true); |
|
239 m_divertpluginGroup->divertRequestProcessed(); |
|
240 divertStatus.iCondition = m_divertpluginGroup->m_DataItemIfNotAnswered->condition(); |
|
241 m_divertpluginGroup->handleDivertingStatus(list, true); |
|
242 m_divertpluginGroup->divertRequestProcessed(); |
|
243 divertStatus.iCondition = m_divertpluginGroup->m_DataItemIfOutOfReach->condition(); |
|
244 m_divertpluginGroup->handleDivertingStatus(list, true); |
|
245 m_divertpluginGroup->divertRequestProcessed(); |
|
246 divertStatus.iCondition = m_divertpluginGroup->m_DataItemIfNotAvailable->condition(); |
|
247 m_divertpluginGroup->handleDivertingStatus(list, true); |
|
248 m_divertpluginGroup->divertRequestProcessed(); |
|
249 |
|
250 m_divertpluginGroup->divertRequestProcessed(); // Test overflow |
|
251 |
|
252 // Test, Do not check status again |
|
253 m_divertpluginGroup->itemShown( |
|
254 model->indexFromItem(m_divertpluginGroup->m_DataItemAllVoiceCalls)); |
|
255 m_divertpluginGroup->itemShown( |
|
256 model->indexFromItem(m_divertpluginGroup->m_DataItemIfBusy)); |
|
257 m_divertpluginGroup->itemShown( |
|
258 model->indexFromItem(m_divertpluginGroup->m_DataItemIfNotAnswered)); |
|
259 m_divertpluginGroup->itemShown( |
|
260 model->indexFromItem(m_divertpluginGroup->m_DataItemIfOutOfReach)); |
|
261 m_divertpluginGroup->itemShown( |
|
262 model->indexFromItem(m_divertpluginGroup->m_DataItemIfNotAvailable)); |
|
263 |
|
264 |
|
265 QVERIFY(verify()); |
|
266 } |
|
267 |
|
268 /*! |
|
269 UT_CpDivertPlugin::t_popUpTimerQuery |
|
270 */ |
|
271 void UT_CpDivertPlugin::t_popUpTimerQuery() |
|
272 { |
|
273 appendAction("If not answered:", selectItem, "0401234567"); |
|
274 appendAction("Time out", selectAction, "Cancel"); |
|
275 expect("PSetCallDivertingWrapper::getDefaultNumbers"); |
|
276 m_divertpluginGroup->m_DataItemIfNotAnswered->thisItemClicked(); |
|
277 QVERIFY(verify()); |
|
278 |
|
279 appendAction("If not answered:", selectItem, "Other number"); |
|
280 appendAction("Number:", insertText, "12345"); |
|
281 appendAction("Number:", selectAction, "OK"); |
|
282 appendAction("Time out", selectItem, "15 second"); |
|
283 //except user chooses other number and inserts number and timeout |
|
284 expect("PSetCallDivertingWrapper::getDefaultNumbers"); |
|
285 expect("SsSettingsWrapper::get"); |
|
286 expect("PSetCallDivertingWrapper::setCallDiverting"); |
|
287 m_divertpluginGroup->m_DataItemIfNotAnswered->thisItemClicked(); |
|
288 PSCallDivertingCommand command; |
|
289 command.iNumber = "12345"; |
|
290 command.iNoReplyTimer = 15; |
|
291 command.iStatus = DivertingStatusActive; |
|
292 command.iCondition = m_divertpluginGroup->m_DataItemIfNotAnswered->condition(); |
|
293 expect("CpPhoneNotes::showGlobalNote"); |
|
294 m_divertpluginGroup->handleDivertingChanged(command, false); |
|
295 expect("CpPhoneNotes::cancelNote"); |
|
296 m_divertpluginGroup->divertRequestProcessed(); |
|
297 QVERIFY(verify()); |
|
298 |
|
299 expect("SsSettingsWrapper::get"); |
|
300 expect("PSetCallDivertingWrapper::setCallDiverting"); |
|
301 m_divertpluginGroup->m_DataItemIfNotAnswered->thisItemClicked(); |
|
302 command.iNumber = ""; |
|
303 command.iNoReplyTimer = 0; |
|
304 command.iStatus = DivertingStatusInactive; |
|
305 command.iCondition = m_divertpluginGroup->m_DataItemIfNotAnswered->condition(); |
|
306 expect("CpPhoneNotes::showGlobalNote"); |
|
307 m_divertpluginGroup->handleDivertingChanged(command, false); |
|
308 expect("CpPhoneNotes::cancelNote"); |
|
309 m_divertpluginGroup->divertRequestProcessed(); |
|
310 QVERIFY(verify()); |
|
311 |
|
312 } |
|
313 |
|
314 /*! |
|
315 UT_CpDivertPlugin::t_handleDivertingChanged |
|
316 */ |
|
317 void UT_CpDivertPlugin::t_handleDivertingChanged() |
|
318 { |
|
319 PSCallDivertingCommand c; |
|
320 |
|
321 c.iStatus = DivertingStatusActive; |
|
322 bool bRet = false; |
|
323 expect("PSetCallDivertingWrapper::setNewDefaultNumber"); |
|
324 expect("Tools::voipSupported").returns(bRet); |
|
325 m_divertpluginGroup->handleDivertingChanged(c, true); |
|
326 |
|
327 expect("PSetCallDivertingWrapper::setNewDefaultNumber"); |
|
328 bRet = true; |
|
329 c.iServiceGroup = ServiceGroupVoice; |
|
330 expect("Tools::voipSupported").returns(bRet); |
|
331 m_divertpluginGroup->handleDivertingChanged(c, false); |
|
332 |
|
333 c.iStatus = DivertingStatusInactive; |
|
334 m_divertpluginGroup->handleDivertingChanged(c, true); |
|
335 m_divertpluginGroup->handleDivertingChanged(c, false); |
|
336 |
|
337 c.iStatus = DivertingStatusNotRegistered; |
|
338 m_divertpluginGroup->handleDivertingChanged(c, true); |
|
339 |
|
340 c.iStatus = DivertingStatusNotProvisioned; |
|
341 m_divertpluginGroup->handleDivertingChanged(c, true); |
|
342 |
|
343 c.iStatus = DivertingStatusUnknown; |
|
344 m_divertpluginGroup->handleDivertingChanged(c, true); |
|
345 |
|
346 c.iStatus = (PsCallDivertingStatus)5; |
|
347 m_divertpluginGroup->handleDivertingChanged(c, true); |
|
348 |
|
349 QVERIFY(verify()); |
|
350 } |
|
351 |
|
352 /*! |
|
353 UT_CpDivertPlugin::t_handleDivertingStatus |
|
354 */ |
|
355 void UT_CpDivertPlugin::t_handleDivertingStatus() |
|
356 { |
|
357 QList<PSCallDivertingStatus*> list; |
|
358 PSCallDivertingStatus divertStatus; |
|
359 |
|
360 divertStatus.iTimeout =5; |
|
361 divertStatus.iStatus = DivertingStatusActive; |
|
362 list.append(&divertStatus); |
|
363 m_divertpluginGroup->handleDivertingStatus(list, true); |
|
364 divertStatus.iTimeout =0; |
|
365 list.replace(0, &divertStatus); |
|
366 m_divertpluginGroup->handleDivertingStatus(list, true); |
|
367 |
|
368 divertStatus.iStatus = DivertingStatusInactive; |
|
369 list.replace(0, &divertStatus); |
|
370 m_divertpluginGroup->handleDivertingStatus(list, true); |
|
371 |
|
372 divertStatus.iStatus = DivertingStatusNotRegistered; |
|
373 list.replace(0, &divertStatus); |
|
374 m_divertpluginGroup->handleDivertingStatus(list, true); |
|
375 m_divertpluginGroup->handleDivertingStatus(list, false); |
|
376 |
|
377 divertStatus.iStatus = DivertingStatusNotProvisioned; |
|
378 list.replace(0, &divertStatus); |
|
379 m_divertpluginGroup->handleDivertingStatus(list, true); |
|
380 |
|
381 divertStatus.iStatus = DivertingStatusUnknown; |
|
382 list.replace(0, &divertStatus); |
|
383 m_divertpluginGroup->handleDivertingStatus(list, true); |
|
384 |
|
385 divertStatus.iStatus = (PsCallDivertingStatus)5; |
|
386 list.replace(0, &divertStatus); |
|
387 m_divertpluginGroup->handleDivertingStatus(list, true); |
|
388 |
|
389 } |
|
390 |
|
391 /*! |
|
392 UT_CpDivertPlugin::t_handleDivertingError |
|
393 */ |
|
394 void UT_CpDivertPlugin::t_handleDivertingError() |
|
395 { |
|
396 m_divertpluginGroup->handleDivertingError(-1); |
|
397 } |
|
398 |
|
399 /*! |
|
400 UT_CpDivertPlugin::appendAction |
|
401 */ |
|
402 void UT_CpDivertPlugin::appendAction( |
|
403 const QString& dialog, actionType actionType, const QString& action) |
|
404 { |
|
405 if (!actionQueue.count()) { |
|
406 startTimer(2000); |
|
407 } |
|
408 actionQueue.append(new dialogAction(dialog, actionType, action)); |
|
409 } |
|
410 |
|
411 /*! |
|
412 UT_CpDivertPlugin::executeAction |
|
413 */ |
|
414 void UT_CpDivertPlugin::executeAction( const dialogAction &action ) |
|
415 { |
|
416 switch (action.type) { |
|
417 case selectAction: |
|
418 doAndVerifyAction(action.dialog, action.item); |
|
419 break; |
|
420 case selectItem: |
|
421 selectItemFromListWidget(action.dialog, action.item); |
|
422 break; |
|
423 case insertText: |
|
424 HbDialog *dialog = visibleDialog(action.dialog); |
|
425 QVERIFY( dialog ); |
|
426 HbLineEdit* editor = qobject_cast<HbLineEdit*>( |
|
427 dialog->contentWidget() ); |
|
428 QVERIFY( editor ); |
|
429 editor->setText(action.item); |
|
430 break; |
|
431 default: |
|
432 break; |
|
433 } |
|
434 } |
|
435 |
|
436 /*! |
|
437 UT_CpDivertPlugin::visibleDialog |
|
438 */ |
|
439 HbDialog *UT_CpDivertPlugin::visibleDialog( const QString &heading ) |
|
440 { |
|
441 QList<QGraphicsItem*> items = mainWindow->scene()->items(); |
|
442 foreach (QGraphicsItem* item, items) { |
|
443 HbDialog *w = qobject_cast<HbDialog*>(item->parentWidget()); |
|
444 if (w && w->isVisible() && ( qobject_cast<HbLabel*>(w->headingWidget())->plainText() == heading )) { |
|
445 qDebug() << "visibleDialog: " << w->getStaticMetaObject().className() << |
|
446 "contentWidget: " << w->contentWidget()->getStaticMetaObject().className(); |
|
447 return w; |
|
448 } |
|
449 } |
|
450 |
|
451 return 0; |
|
452 } |
|
453 |
|
454 /*! |
|
455 UT_CpDivertPlugin::selectItemFromListWidget |
|
456 */ |
|
457 void UT_CpDivertPlugin::selectItemFromListWidget( |
|
458 const QString& dialog, const QString& item ) |
|
459 { |
|
460 HbDialog* d = visibleDialog(dialog); |
|
461 QVERIFY(d); |
|
462 HbListWidget *list = qobject_cast<HbListWidget*>(d->contentWidget()); |
|
463 QVERIFY(list); |
|
464 |
|
465 bool ok=true; |
|
466 HbListWidgetItem *itemObject = 0; |
|
467 for (int i=0; i < list->count();i++) { |
|
468 itemObject = list->item(i); |
|
469 if (itemObject->text() == item) { |
|
470 ok=true; |
|
471 QSignalSpy spy( d, SIGNAL(aboutToClose())); |
|
472 list->setCurrentItem(itemObject); |
|
473 d->close(); |
|
474 qDebug() << "selectItemFromListWidget: " << itemObject->text(); |
|
475 while (!spy.count()) { |
|
476 QTest::qWait(50); |
|
477 } |
|
478 QTest::qWait(50); |
|
479 } |
|
480 |
|
481 } |
|
482 |
|
483 QVERIFY(ok); |
|
484 } |
|
485 |
|
486 /*! |
|
487 UT_CpDivertPlugin::doAndVerifyAction |
|
488 */ |
|
489 void UT_CpDivertPlugin::doAndVerifyAction( |
|
490 const QString& dialog, const QString& action ) |
|
491 { |
|
492 HbDialog* d = visibleDialog(dialog); |
|
493 QVERIFY(d); |
|
494 |
|
495 QAction* o; |
|
496 bool ok=false; |
|
497 foreach (o, d->actions()) { |
|
498 if (o->text() == action) { |
|
499 ok=true; |
|
500 QSignalSpy spy( d, SIGNAL(aboutToClose())); |
|
501 o->trigger(); |
|
502 qDebug() << "doAndVerifyAction: " << o->text(); |
|
503 while (!spy.count()) { |
|
504 QTest::qWait(50); |
|
505 } |
|
506 QTest::qWait(50); |
|
507 } |
|
508 } |
|
509 QVERIFY(ok); |
|
510 } |
|
511 |
|
512 /*! |
|
513 UT_CpDivertPlugin::timerEvent |
|
514 */ |
|
515 void UT_CpDivertPlugin::timerEvent( |
|
516 QTimerEvent* event ) |
|
517 { |
|
518 QString currentTest(QTest::currentTestFunction()); |
|
519 qDebug() << "timerEvent:" << currentTest; |
|
520 killTimer(event->timerId()); |
|
521 executeAction(*actionQueue.takeFirst()); |
|
522 if (actionQueue.count()) { |
|
523 startTimer(1000); |
|
524 } |
|
525 |
|
526 qDebug() << "timerEvent, OUT"; |
|
527 } |
|
528 |
|
529 QTEST_MAIN_S60UI(UT_CpDivertPlugin) |