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: Unit tests for PhoneUIQtViewAdapter. |
|
15 * |
|
16 */ |
|
17 |
|
18 #include <QtTest/QtTest> |
|
19 #include <QtGui> |
|
20 #include <QList> |
|
21 #include <hbapplication.h> |
|
22 #include <phoneappcommands.hrh> |
|
23 #include "phoneuiqtviewif.h" |
|
24 #include "pevirtualengine.h" |
|
25 #include "bubblemanagerif.h" |
|
26 #include "phonebubblewrapper.h" |
|
27 #include "phoneuicommandcontroller.h" |
|
28 |
|
29 extern bool m_setActions; |
|
30 extern bool m_setInvalidCommand; |
|
31 extern QList<HbAction*> m_menuActions; |
|
32 extern bool m_setInvalidButtonCommands; |
|
33 |
|
34 #define PHONE_QT_VIEW_ADAPTER_TEST_MAIN(TestObject) \ |
|
35 int main(int argc, char *argv[]) \ |
|
36 { \ |
|
37 HbApplication app(argc, argv); \ |
|
38 TestObject tc; \ |
|
39 QResource::registerResource("../hbcore.rcc"); \ |
|
40 int ret = QTest::qExec(&tc, argc, argv); \ |
|
41 /* Core dump if HbIconLoader instance is not destroyed before the application instance. */ \ |
|
42 /* HbIconLoader uses QCoreApplication::aboutToQuit() signal to destroy itself. */ \ |
|
43 /* app.exec() where the signal is normally emitted is not called here. */ \ |
|
44 /* So, invoking the signal explicitly. */ \ |
|
45 QMetaObject::invokeMethod(&app, "aboutToQuit", Qt::DirectConnection); \ |
|
46 return ret; \ |
|
47 } |
|
48 |
|
49 |
|
50 class TestPhoneUiCommandController : public QObject, public PhoneUIQtViewIF, public BubbleManagerIF |
|
51 { |
|
52 Q_OBJECT |
|
53 public: |
|
54 TestPhoneUiCommandController(); |
|
55 virtual ~TestPhoneUiCommandController(); |
|
56 |
|
57 // From PhoneUIQtViewIF |
|
58 BubbleManagerIF& bubbleManager (); |
|
59 void addBubbleCommand (int bubbleId, const PhoneAction& action); |
|
60 void clearBubbleCommands (int bubbleId); |
|
61 void addParticipantListAction( |
|
62 int commandId, |
|
63 const QString &text, |
|
64 const HbIcon &icon); |
|
65 void clearParticipantListActions(); |
|
66 void hideToolbar () { }; |
|
67 void showToolbar () { m_showToolbarCalled = true; }; |
|
68 void setToolbarActions (const QList<PhoneAction*>& actions) {m_toolbarActionCount = actions.count(); }; |
|
69 int volumeSliderValue () { m_volumeSliderValueCalled = true; return 5; }; |
|
70 void removeVolumeSlider () { m_removeVolumeSliderCalled = true; }; |
|
71 void setVolumeSliderValue ( |
|
72 int value, |
|
73 int commandId, |
|
74 int maxVolumeValue, |
|
75 int minVolumeValue ) { m_setVolumeSliderValueCalled = true; m_volumeSliderValue = value; }; |
|
76 |
|
77 void setExpandAction(int bubbleId, int commandId) {m_expandAction[bubbleId]=commandId;}; |
|
78 void removeExpandAction(int bubbleId) {}; |
|
79 void showDialpad() {m_showDialpadCalled = true;}; |
|
80 void hideDialpad() {m_hideDialpadCalled = true;}; |
|
81 bool isDialpadVisible() |
|
82 {m_dialpadVisibilityCalled = true; |
|
83 return m_isDialpadVisible; } |
|
84 QString dialpadText() {return m_dialpadText;}; |
|
85 void clearAndHideDialpad() { m_clearAndHideDialpadCalled = true;}; |
|
86 void bringToForeground() {;}; |
|
87 void setMenuActions(const QList<PhoneAction*>& actions) { m_setMenuActionsCalled = true;}; |
|
88 void shutdownPhoneApp() {;}; |
|
89 void setBackButtonVisible(bool visible) {;}; |
|
90 HbMenu &menuReference(){return m_menu;}; |
|
91 |
|
92 // From BubbleManagerIF |
|
93 void startChanges () { m_startChangesCalled=true; }; |
|
94 void endChanges () { m_endChangesCalled=true; }; |
|
95 int createCallHeader () { return 0; }; |
|
96 void removeCallHeader (int bubbleId) {}; |
|
97 void setState (int bubbleId, PhoneCallState state) {}; |
|
98 void setLabel ( |
|
99 int bubbleId, |
|
100 const QString& text, |
|
101 Qt::TextElideMode clipDirection) {}; |
|
102 void setCli (int bubbleId, |
|
103 const QString& cliText, |
|
104 Qt::TextElideMode clipDirection) {}; |
|
105 void updateCLI ( |
|
106 int bubbleId, |
|
107 const QString& cliText, |
|
108 Qt::TextElideMode clipDirection) {}; |
|
109 void setSecondaryCli ( |
|
110 int bubbleId, |
|
111 const QString& cliText, |
|
112 Qt::TextElideMode clipDirection = Qt::ElideLeft) {}; |
|
113 void setCallTime (int bubbleId, const QString& callTime) {}; |
|
114 void updateCallTime (int bubbleId, const QString& callTime) { m_updateCallTimeCalled=true; m_int=bubbleId; m_string=callTime; }; |
|
115 void setCallObjectImage (int bubbleId, const QString &fileName) {}; |
|
116 void setCallObjectFromTheme (int bubbleId) {}; |
|
117 void setCallObjectText (int bubbleId, const QString &text) {}; |
|
118 void setCallFlags (int bubbleId, int flags) {}; |
|
119 void setCallFlag (int bubbleId, PhoneCallFlags flag, bool set) {}; |
|
120 void setNumberType (int bubbleId, PhoneNumberType type) {}; |
|
121 void updateCallHeaderText( |
|
122 int bubbleId, |
|
123 const QString &longText, |
|
124 const QString &shortText, |
|
125 Qt::TextElideMode clipDirection) {}; |
|
126 void setPhoneMuted (bool muted) { m_setPhoneMutedCalled = muted; }; |
|
127 int createConference (int bubble1, int bubble2) { return 1; }; |
|
128 void removeConference () {}; |
|
129 void addRowToConference (int bubbleId) {}; |
|
130 void removeRowFromConference (int bubbleId) {}; |
|
131 int conferenceRowCount () const { return 2; }; |
|
132 void setSelectionInConference (int rowNumber) {}; |
|
133 void setSelectionIdInConference (int bubbleId) {}; |
|
134 int selectionInConference () const { return 0; }; |
|
135 int selectionIdInConference () const { return 0; }; |
|
136 void moveHighlightOneUpInConference () {}; |
|
137 void moveHighlightOneDownInConference () {}; |
|
138 void setExpandedConferenceCallHeader (bool expanded) { m_ExpandConferenceCalled = true; }; |
|
139 bool isConferenceExpanded () const { return false; }; |
|
140 int shownHeaderCount () const { return 1; }; |
|
141 void setParticipantListCli (int aBubbleId, ParticipantListCli aParticipantCli) {}; |
|
142 void addAction (int bubble, HbAction *action) {}; |
|
143 void clearActions (int bubble) {}; |
|
144 QGraphicsWidget* graphicsWidgetForAction (HbAction *action) const { return 0;}; |
|
145 void addParticipantListAction (HbAction *action) {}; |
|
146 int expandedBubble() const { return 1; }; |
|
147 void setExpandAction(int bubbleId, HbAction* action) {}; |
|
148 void setBubbleSelectionDisabled(bool b) {}; |
|
149 |
|
150 signals: |
|
151 void dialpadAboutToClose(); |
|
152 void keyPressReleased(QKeyEvent *event); |
|
153 |
|
154 public slots: |
|
155 void initTestCase (); |
|
156 void cleanupTestCase (); |
|
157 void init (); |
|
158 void cleanup (); |
|
159 |
|
160 private slots: |
|
161 void testSetCallMenuActions(); |
|
162 void testSetDialpadMenuActions(); |
|
163 void testPushButtonActionsForCall(); |
|
164 |
|
165 |
|
166 private: |
|
167 PhoneUiCommandController *m_commandController; // class under test |
|
168 |
|
169 bool m_showToolbarCalled; |
|
170 bool m_updateCallTimeCalled; |
|
171 int m_int; |
|
172 QString m_string; |
|
173 HbAction *m_action; |
|
174 int m_toolbarActionCount; |
|
175 bool m_startChangesCalled; |
|
176 bool m_endChangesCalled; |
|
177 bool m_volumeSliderValueCalled; |
|
178 bool m_removeVolumeSliderCalled; |
|
179 bool m_setVolumeSliderValueCalled; |
|
180 int m_volumeSliderValue; |
|
181 bool m_setPhoneMutedCalled; |
|
182 QMap<int, QList<int> *> m_actionMap; |
|
183 QMap<int,int> m_expandAction; |
|
184 bool m_showDialpadCalled; |
|
185 bool m_hideDialpadCalled; |
|
186 bool m_dialpadVisibilityCalled; |
|
187 bool m_clearAndHideDialpadCalled; |
|
188 bool m_ExpandConferenceCalled; |
|
189 bool m_setMenuActionsCalled; |
|
190 bool m_isDialpadVisible; |
|
191 QString m_dialpadText; |
|
192 HbMenu m_menu; |
|
193 |
|
194 }; |
|
195 |
|
196 TestPhoneUiCommandController::TestPhoneUiCommandController () |
|
197 { |
|
198 } |
|
199 |
|
200 TestPhoneUiCommandController::~TestPhoneUiCommandController () |
|
201 { |
|
202 } |
|
203 |
|
204 void TestPhoneUiCommandController::initTestCase () |
|
205 { |
|
206 m_commandController = new PhoneUiCommandController (*this); |
|
207 } |
|
208 |
|
209 void TestPhoneUiCommandController::cleanupTestCase () |
|
210 { |
|
211 delete m_commandController; |
|
212 } |
|
213 |
|
214 void TestPhoneUiCommandController::init () |
|
215 { |
|
216 m_startChangesCalled = false; |
|
217 m_endChangesCalled = false; |
|
218 } |
|
219 |
|
220 void TestPhoneUiCommandController::cleanup () |
|
221 { |
|
222 } |
|
223 |
|
224 BubbleManagerIF& TestPhoneUiCommandController::bubbleManager () |
|
225 { |
|
226 return *this; |
|
227 } |
|
228 |
|
229 void TestPhoneUiCommandController::addBubbleCommand ( |
|
230 int bubbleId, const PhoneAction& action) |
|
231 { |
|
232 |
|
233 } |
|
234 |
|
235 void TestPhoneUiCommandController::clearBubbleCommands (int bubbleId) |
|
236 { |
|
237 |
|
238 } |
|
239 |
|
240 void TestPhoneUiCommandController::addParticipantListAction( |
|
241 int commandId, |
|
242 const QString& text, |
|
243 const HbIcon& icon) |
|
244 { |
|
245 |
|
246 } |
|
247 |
|
248 void TestPhoneUiCommandController::clearParticipantListActions() |
|
249 { |
|
250 |
|
251 } |
|
252 |
|
253 void TestPhoneUiCommandController::testSetCallMenuActions() |
|
254 { |
|
255 QMap<int,int> callStates; |
|
256 QMap<int,int> serviceIds; |
|
257 int serviceId(2); |
|
258 int expandedCallId(1); |
|
259 callStates[expandedCallId] = EPEStateConnected; |
|
260 serviceIds[expandedCallId] = serviceId; |
|
261 |
|
262 |
|
263 m_commandController->setCallMenuActions(callStates,serviceIds,serviceId,expandedCallId); |
|
264 QVERIFY(m_setMenuActionsCalled); |
|
265 m_setMenuActionsCalled = false; |
|
266 |
|
267 m_setActions = true; |
|
268 m_commandController->setCallMenuActions(callStates,serviceIds,serviceId,expandedCallId); |
|
269 QVERIFY(m_setMenuActionsCalled); |
|
270 m_setMenuActionsCalled = false; |
|
271 m_setActions = false; |
|
272 |
|
273 m_setInvalidCommand = true; |
|
274 callStates[expandedCallId] = EPEStateHeld; |
|
275 m_commandController->setCallMenuActions(callStates,serviceIds,serviceId,expandedCallId); |
|
276 QVERIFY(m_setMenuActionsCalled); |
|
277 m_setMenuActionsCalled = false; |
|
278 m_setInvalidCommand = false; |
|
279 |
|
280 callStates[0] = EPEStateConnected; |
|
281 serviceIds[0] = serviceId; |
|
282 |
|
283 m_commandController->setCallMenuActions(callStates,serviceIds,serviceId,expandedCallId); |
|
284 QVERIFY(m_setMenuActionsCalled); |
|
285 m_setMenuActionsCalled = false; |
|
286 |
|
287 callStates[0] = EPEStateRinging; |
|
288 |
|
289 m_commandController->setCallMenuActions(callStates,serviceIds,serviceId,expandedCallId); |
|
290 QVERIFY(m_setMenuActionsCalled); |
|
291 m_setMenuActionsCalled = false; |
|
292 |
|
293 serviceIds[0] = 3; |
|
294 callStates[0] = EPEStateConnected; |
|
295 |
|
296 m_commandController->setCallMenuActions(callStates,serviceIds,3,expandedCallId); |
|
297 QVERIFY(m_setMenuActionsCalled); |
|
298 m_setMenuActionsCalled = false; |
|
299 |
|
300 callStates[2] = EPEStateRinging; |
|
301 serviceIds[2] = 3; |
|
302 |
|
303 m_commandController->setCallMenuActions(callStates,serviceIds,serviceId,expandedCallId); |
|
304 QVERIFY(m_setMenuActionsCalled); |
|
305 m_setMenuActionsCalled = false; |
|
306 |
|
307 callStates[3] = EPEStateDisconnecting; |
|
308 serviceIds[3] = 3; |
|
309 |
|
310 m_commandController->setCallMenuActions(callStates,serviceIds,serviceId,expandedCallId); |
|
311 QVERIFY(m_setMenuActionsCalled); |
|
312 m_setMenuActionsCalled = false; |
|
313 } |
|
314 |
|
315 void TestPhoneUiCommandController::testSetDialpadMenuActions() |
|
316 { |
|
317 m_setMenuActionsCalled = false; |
|
318 m_commandController->setDialpadMenuActions(); |
|
319 QVERIFY(m_setMenuActionsCalled); |
|
320 } |
|
321 |
|
322 void TestPhoneUiCommandController::testPushButtonActionsForCall() |
|
323 { |
|
324 int callState = EPEStateConnected; |
|
325 bool emergencyCall = false; |
|
326 QMap<int,int> callStates; |
|
327 QMap<int,int> serviceIds; |
|
328 int serviceId(2); |
|
329 int callId(1); |
|
330 callStates[callId] = EPEStateConnected; |
|
331 serviceIds[callId] = serviceId; |
|
332 |
|
333 QMap<PhoneAction::ActionType, PhoneAction *> actions = |
|
334 m_commandController->pushButtonActionsForCall( |
|
335 callState, |
|
336 emergencyCall, |
|
337 callStates, |
|
338 serviceIds, |
|
339 serviceId, |
|
340 callId); |
|
341 |
|
342 QVERIFY(0<actions.values().count()); |
|
343 |
|
344 qDeleteAll(actions.values()); |
|
345 actions.clear(); |
|
346 |
|
347 m_setInvalidButtonCommands = true; |
|
348 actions = m_commandController->pushButtonActionsForCall( |
|
349 callState, |
|
350 emergencyCall, |
|
351 callStates, |
|
352 serviceIds, |
|
353 serviceId, |
|
354 callId); |
|
355 |
|
356 QVERIFY(0==actions.values().count()); |
|
357 qDeleteAll(actions.values()); |
|
358 actions.clear(); |
|
359 m_setInvalidButtonCommands = false; |
|
360 |
|
361 actions = m_commandController->pushButtonActionsForCall( |
|
362 callState, |
|
363 true, |
|
364 callStates, |
|
365 serviceIds, |
|
366 serviceId, |
|
367 callId); |
|
368 |
|
369 QVERIFY(0<actions.values().count()); |
|
370 qDeleteAll(actions.values()); |
|
371 actions.clear(); |
|
372 |
|
373 callStates[callId] = EPEStateHeld; |
|
374 callState = EPEStateHeld; |
|
375 actions = m_commandController->pushButtonActionsForCall( |
|
376 callState, |
|
377 emergencyCall, |
|
378 callStates, |
|
379 serviceIds, |
|
380 serviceId, |
|
381 callId); |
|
382 |
|
383 QVERIFY(0<actions.values().count()); |
|
384 qDeleteAll(actions.values()); |
|
385 actions.clear(); |
|
386 |
|
387 callStates[callId] = EPEStateRinging; |
|
388 callState = EPEStateRinging; |
|
389 actions = m_commandController->pushButtonActionsForCall( |
|
390 callState, |
|
391 emergencyCall, |
|
392 callStates, |
|
393 serviceIds, |
|
394 serviceId, |
|
395 callId); |
|
396 |
|
397 QVERIFY(0<actions.values().count()); |
|
398 qDeleteAll(actions.values()); |
|
399 actions.clear(); |
|
400 |
|
401 callStates[callId] = EPEStateIdle; |
|
402 callState = EPEStateIdle; |
|
403 actions = m_commandController->pushButtonActionsForCall( |
|
404 callState, |
|
405 emergencyCall, |
|
406 callStates, |
|
407 serviceIds, |
|
408 serviceId, |
|
409 callId); |
|
410 |
|
411 QVERIFY(0==actions.values().count()); |
|
412 qDeleteAll(actions.values()); |
|
413 actions.clear(); |
|
414 |
|
415 callStates[callId] = EPEStateDisconnecting; |
|
416 callState = EPEStateDisconnecting; |
|
417 actions = m_commandController->pushButtonActionsForCall( |
|
418 callState, |
|
419 emergencyCall, |
|
420 callStates, |
|
421 serviceIds, |
|
422 serviceId, |
|
423 callId); |
|
424 |
|
425 QVERIFY(0==actions.values().count()); |
|
426 qDeleteAll(actions.values()); |
|
427 actions.clear(); |
|
428 |
|
429 callStates[callId] = EPEStateConferenceIdle; |
|
430 callState = EPEStateConferenceIdle; |
|
431 actions = m_commandController->pushButtonActionsForCall( |
|
432 callState, |
|
433 emergencyCall, |
|
434 callStates, |
|
435 serviceIds, |
|
436 serviceId, |
|
437 callId); |
|
438 |
|
439 QVERIFY(0==actions.values().count()); |
|
440 qDeleteAll(actions.values()); |
|
441 actions.clear(); |
|
442 |
|
443 callStates[callId] = EPEStateUnknown; |
|
444 callState = EPEStateUnknown; |
|
445 actions = m_commandController->pushButtonActionsForCall( |
|
446 callState, |
|
447 emergencyCall, |
|
448 callStates, |
|
449 serviceIds, |
|
450 serviceId, |
|
451 callId); |
|
452 |
|
453 QVERIFY(0==actions.values().count()); |
|
454 qDeleteAll(actions.values()); |
|
455 actions.clear(); |
|
456 |
|
457 callStates[callId] = EPEStateDialing; |
|
458 callState = EPEStateDialing; |
|
459 actions = m_commandController->pushButtonActionsForCall( |
|
460 callState, |
|
461 emergencyCall, |
|
462 callStates, |
|
463 serviceIds, |
|
464 serviceId, |
|
465 callId); |
|
466 |
|
467 QVERIFY(0<actions.values().count()); |
|
468 qDeleteAll(actions.values()); |
|
469 actions.clear(); |
|
470 |
|
471 callStates[callId] = EPEStateConnecting; |
|
472 callState = EPEStateConnecting; |
|
473 actions = m_commandController->pushButtonActionsForCall( |
|
474 callState, |
|
475 emergencyCall, |
|
476 callStates, |
|
477 serviceIds, |
|
478 serviceId, |
|
479 callId); |
|
480 |
|
481 QVERIFY(0<actions.values().count()); |
|
482 qDeleteAll(actions.values()); |
|
483 actions.clear(); |
|
484 |
|
485 callStates[callId] = EPEStateConnectedConference; |
|
486 callState = EPEStateConnectedConference; |
|
487 actions = m_commandController->pushButtonActionsForCall( |
|
488 callState, |
|
489 emergencyCall, |
|
490 callStates, |
|
491 serviceIds, |
|
492 serviceId, |
|
493 callId); |
|
494 |
|
495 QVERIFY(0<actions.values().count()); |
|
496 qDeleteAll(actions.values()); |
|
497 actions.clear(); |
|
498 |
|
499 callStates[callId] = EPEStateHeldConference; |
|
500 callState = EPEStateHeldConference; |
|
501 actions = m_commandController->pushButtonActionsForCall( |
|
502 callState, |
|
503 emergencyCall, |
|
504 callStates, |
|
505 serviceIds, |
|
506 serviceId, |
|
507 callId); |
|
508 |
|
509 QVERIFY(0<actions.values().count()); |
|
510 qDeleteAll(actions.values()); |
|
511 actions.clear(); |
|
512 |
|
513 ////////////////////////////////////////////////////////////////////////// |
|
514 //2 calls |
|
515 ////////////////////////////////////////////////////////////////////////// |
|
516 |
|
517 callStates[2] = EPEStateHeldConference; |
|
518 actions = m_commandController->pushButtonActionsForCall( |
|
519 callState, |
|
520 emergencyCall, |
|
521 callStates, |
|
522 serviceIds, |
|
523 serviceId, |
|
524 callId); |
|
525 |
|
526 QVERIFY(0<actions.values().count()); |
|
527 qDeleteAll(actions.values()); |
|
528 actions.clear(); |
|
529 |
|
530 callStates[2] = EPEStateHeldConference; |
|
531 callState = EPEStateHeldConference; |
|
532 actions = m_commandController->pushButtonActionsForCall( |
|
533 callState, |
|
534 emergencyCall, |
|
535 callStates, |
|
536 serviceIds, |
|
537 serviceId, |
|
538 callId); |
|
539 |
|
540 QVERIFY(0<actions.values().count()); |
|
541 qDeleteAll(actions.values()); |
|
542 actions.clear(); |
|
543 |
|
544 serviceId = 3; |
|
545 serviceIds[callId] = serviceId; |
|
546 callStates[2] = EPEStateHeld; |
|
547 serviceIds[2] = serviceId; |
|
548 actions = m_commandController->pushButtonActionsForCall( |
|
549 callState, |
|
550 emergencyCall, |
|
551 callStates, |
|
552 serviceIds, |
|
553 serviceId, |
|
554 callId); |
|
555 |
|
556 QVERIFY(0<actions.values().count()); |
|
557 qDeleteAll(actions.values()); |
|
558 actions.clear(); |
|
559 |
|
560 actions = m_commandController->pushButtonActionsForCall( |
|
561 callState, |
|
562 true, |
|
563 callStates, |
|
564 serviceIds, |
|
565 serviceId, |
|
566 callId); |
|
567 |
|
568 QVERIFY(0<actions.values().count()); |
|
569 qDeleteAll(actions.values()); |
|
570 actions.clear(); |
|
571 |
|
572 callStates[2] = EPEStateHeldConference; |
|
573 callState = EPEStateHeldConference; |
|
574 actions = m_commandController->pushButtonActionsForCall( |
|
575 callState, |
|
576 emergencyCall, |
|
577 callStates, |
|
578 serviceIds, |
|
579 serviceId, |
|
580 callId); |
|
581 |
|
582 QVERIFY(0<actions.values().count()); |
|
583 qDeleteAll(actions.values()); |
|
584 actions.clear(); |
|
585 |
|
586 callStates[2] = EPEStateConnectedConference; |
|
587 callState = EPEStateHeld; |
|
588 callStates[callId] = EPEStateHeld; |
|
589 actions = m_commandController->pushButtonActionsForCall( |
|
590 callState, |
|
591 emergencyCall, |
|
592 callStates, |
|
593 serviceIds, |
|
594 serviceId, |
|
595 callId); |
|
596 |
|
597 QVERIFY(0<actions.values().count()); |
|
598 qDeleteAll(actions.values()); |
|
599 actions.clear(); |
|
600 |
|
601 callState = EPEStateConnectedConference; |
|
602 actions = m_commandController->pushButtonActionsForCall( |
|
603 callState, |
|
604 emergencyCall, |
|
605 callStates, |
|
606 serviceIds, |
|
607 serviceId, |
|
608 callId); |
|
609 |
|
610 QVERIFY(0<actions.values().count()); |
|
611 qDeleteAll(actions.values()); |
|
612 actions.clear(); |
|
613 |
|
614 callStates[callId] = EPEStateConnected; |
|
615 callStates[2] = EPEStateHeldConference; |
|
616 callState = EPEStateConnected; |
|
617 |
|
618 callState = EPEStateConnectedConference; |
|
619 actions = m_commandController->pushButtonActionsForCall( |
|
620 callState, |
|
621 emergencyCall, |
|
622 callStates, |
|
623 serviceIds, |
|
624 serviceId, |
|
625 callId); |
|
626 |
|
627 QVERIFY(0<actions.values().count()); |
|
628 qDeleteAll(actions.values()); |
|
629 actions.clear(); |
|
630 |
|
631 callStates[callId] = EPEStateConnected; |
|
632 callStates[2] = EPEStateHeldConference; |
|
633 callState = EPEStateHeldConference; |
|
634 |
|
635 ////////////////////////////////////////////////////////////////////////// |
|
636 //3 calls |
|
637 ////////////////////////////////////////////////////////////////////////// |
|
638 callStates[3] = EPEStateRinging; |
|
639 serviceIds[3] = serviceId; |
|
640 actions = m_commandController->pushButtonActionsForCall( |
|
641 callState, |
|
642 emergencyCall, |
|
643 callStates, |
|
644 serviceIds, |
|
645 serviceId, |
|
646 callId); |
|
647 |
|
648 QVERIFY(0<actions.values().count()); |
|
649 qDeleteAll(actions.values()); |
|
650 actions.clear(); |
|
651 |
|
652 actions = m_commandController->pushButtonActionsForCall( |
|
653 EPEStateRinging, |
|
654 emergencyCall, |
|
655 callStates, |
|
656 serviceIds, |
|
657 serviceId, |
|
658 3); |
|
659 |
|
660 QVERIFY(0<actions.values().count()); |
|
661 qDeleteAll(actions.values()); |
|
662 actions.clear(); |
|
663 |
|
664 actions = m_commandController->pushButtonActionsForCall( |
|
665 EPEStateHeld, |
|
666 emergencyCall, |
|
667 callStates, |
|
668 serviceIds, |
|
669 serviceId, |
|
670 2); |
|
671 |
|
672 QVERIFY(0<actions.values().count()); |
|
673 qDeleteAll(actions.values()); |
|
674 actions.clear(); |
|
675 |
|
676 } |
|
677 |
|
678 |
|
679 PHONE_QT_VIEW_ADAPTER_TEST_MAIN(TestPhoneUiCommandController) |
|
680 #include "unit_tests.moc" |
|