author | hgs |
Fri, 09 Jul 2010 15:40:55 +0300 | |
changeset 50 | 377c906a8701 |
parent 46 | bc5a64e5bc3c |
child 65 | 2a5d4ab426d3 |
permissions | -rw-r--r-- |
37 | 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 <QKeyEvent> |
|
22 |
#include <hbapplication.h> |
|
23 |
#include <QSignalSpy> |
|
24 |
#include <hbmainwindow.h> |
|
25 |
#include <phoneappcommands.hrh> |
|
26 |
#include <hbmenu.h> |
|
27 |
//#include <hbglobal_p.h> |
|
28 |
#include "phoneuiqtviewadapter.h" |
|
29 |
#include "tphonecmdparaminteger.h" |
|
30 |
#include "tphonecmdparamaudiooutput.h" |
|
31 |
#include "phoneuiqtviewif.h" |
|
32 |
#include "tphonecmdparamcallstatedata.h" |
|
33 |
#include "tphonecmdparamcallheaderdata.h" |
|
34 |
#include "tphonecmdparamemergencycallheaderdata.h" |
|
35 |
#include "tphonecmdparamboolean.h" |
|
36 |
#include "tphonecmdparamringtone.h" |
|
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
37 |
#include "tphonecmdparamkeycapture.h" |
37 | 38 |
#include "pevirtualengine.h" |
39 |
#include "bubblemanagerif.h" |
|
40 |
#include "phoneresourceids.h" |
|
41 |
#include "phonebubblewrapper.h" |
|
42 |
#include "phoneuiqtbuttonscontroller.h" |
|
43 |
#include "tphonecmdparamglobalnote.h" |
|
44 |
#include "tphonecmdparamstring.h" |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
45 |
#include "phoneindicatorcontroller.h" |
37 | 46 |
|
47 |
extern int m_phoneButtonFlags; |
|
48 |
extern bool m_EPhoneViewMuteRingToneOnAnswer_called; |
|
49 |
extern bool m_EPhoneViewStopRingTone_called; |
|
50 |
extern bool m_EPhoneViewMuteRingTone_called; |
|
51 |
extern bool m_EPhoneViewPlayRingTone_called; |
|
52 |
extern bool m_showGlobalNoteCalled; |
|
53 |
extern bool m_removeCallHeaderCalled; |
|
54 |
extern bool m_addToConferenceBubbleCalled; |
|
55 |
extern bool m_showQueryCalled; |
|
56 |
extern bool m_removeDtmfNoteCalled; |
|
57 |
extern bool m_removeNoteCalled; |
|
58 |
extern bool m_removeQueryCalled; |
|
59 |
extern bool m_showNoteCalled; |
|
60 |
extern bool m_removeGlobalWaitNoteCalled; |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
61 |
extern bool m_ordinalPositionCalled; |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
62 |
extern bool m_sendToBackgroundCalled; |
37 | 63 |
|
64 |
#define PHONE_QT_VIEW_ADAPTER_TEST_MAIN(TestObject) \ |
|
65 |
int main(int argc, char *argv[]) \ |
|
66 |
{ \ |
|
67 |
HbApplication app(argc, argv); \ |
|
68 |
TestObject tc; \ |
|
69 |
QResource::registerResource("../hbcore.rcc"); \ |
|
70 |
int ret = QTest::qExec(&tc, argc, argv); \ |
|
71 |
/* Core dump if HbIconLoader instance is not destroyed before the application instance. */ \ |
|
72 |
/* HbIconLoader uses QCoreApplication::aboutToQuit() signal to destroy itself. */ \ |
|
73 |
/* app.exec() where the signal is normally emitted is not called here. */ \ |
|
74 |
/* So, invoking the signal explicitly. */ \ |
|
75 |
QMetaObject::invokeMethod(&app, "aboutToQuit", Qt::DirectConnection); \ |
|
76 |
return ret; \ |
|
77 |
} |
|
78 |
||
79 |
// Own assert initialization |
|
80 |
/*void qt_assert(const char *assertion, const char *file, int line) |
|
81 |
{ |
|
82 |
qDebug () << "View test assert FAIL"; |
|
83 |
}*/ |
|
84 |
||
85 |
class TestPhoneUIQtViewAdapter : public QObject, public PhoneUIQtViewIF, public BubbleManagerIF |
|
86 |
{ |
|
87 |
Q_OBJECT |
|
88 |
public: |
|
89 |
TestPhoneUIQtViewAdapter(); |
|
90 |
virtual ~TestPhoneUIQtViewAdapter(); |
|
91 |
||
92 |
// From PhoneUIQtViewIF |
|
93 |
BubbleManagerIF& bubbleManager (); |
|
94 |
void addBubbleCommand (int bubbleId, const PhoneAction& action); |
|
95 |
void clearBubbleCommands (int bubbleId); |
|
96 |
void addParticipantListAction( |
|
97 |
int commandId, |
|
98 |
const QString &text, |
|
99 |
const HbIcon &icon); |
|
100 |
void clearParticipantListActions(); |
|
101 |
void hideToolbar () { }; |
|
102 |
void showToolbar () { m_showToolbarCalled = true; }; |
|
103 |
void setToolbarActions (const QList<PhoneAction*>& actions) {m_toolbarActionCount = actions.count(); }; |
|
104 |
int volumeSliderValue () { m_volumeSliderValueCalled = true; return 5; }; |
|
105 |
void removeVolumeSlider () { m_removeVolumeSliderCalled = true; }; |
|
106 |
void setVolumeSliderValue ( |
|
107 |
int value, |
|
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
108 |
int , |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
109 |
int , |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
110 |
int ) { m_setVolumeSliderValueCalled = true; m_volumeSliderValue = value; }; |
37 | 111 |
|
112 |
void setExpandAction(int bubbleId, int commandId) {m_expandAction[bubbleId]=commandId;}; |
|
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
113 |
void removeExpandAction(int ) {}; |
37 | 114 |
void showDialpad() {m_showDialpadCalled = true;}; |
115 |
void hideDialpad() {m_hideDialpadCalled = true;}; |
|
116 |
bool isDialpadVisible() |
|
117 |
{m_dialpadVisibilityCalled = true; |
|
118 |
return m_isDialpadVisible; } |
|
119 |
QString dialpadText() {return m_dialpadText;}; |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
120 |
void clearDialpad() {}; |
37 | 121 |
void clearAndHideDialpad() { m_clearAndHideDialpadCalled = true;}; |
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
122 |
void bringToForeground() {}; |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
123 |
void setMenuActions(const QList<PhoneAction*>& ) { m_setMenuActionsCalled = true;}; |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
124 |
void shutdownPhoneApp() {}; |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
125 |
void setBackButtonVisible(bool ) {}; |
37 | 126 |
HbMenu &menuReference(){return m_menu;}; |
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
127 |
void captureKey(Qt::Key key, bool capture) { |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
128 |
m_capturedKey = key; |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
129 |
m_captured = capture;}; |
37 | 130 |
|
131 |
// From BubbleManagerIF |
|
132 |
void startChanges () { m_startChangesCalled=true; }; |
|
133 |
void endChanges () { m_endChangesCalled=true; }; |
|
134 |
int createCallHeader () { return 0; }; |
|
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
135 |
void removeCallHeader (int ) {}; |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
136 |
void setState (int , PhoneCallState ) {}; |
37 | 137 |
void setLabel ( |
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
138 |
int , |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
139 |
const QString& , |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
140 |
Qt::TextElideMode ) {}; |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
141 |
void setCli (int , |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
142 |
const QString& , |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
143 |
Qt::TextElideMode ) {}; |
37 | 144 |
void updateCLI ( |
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
145 |
int , |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
146 |
const QString& , |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
147 |
Qt::TextElideMode ) {}; |
37 | 148 |
void setSecondaryCli ( |
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
149 |
int , |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
150 |
const QString& , |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
151 |
Qt::TextElideMode ) {}; |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
152 |
void setCallTime (int , const QString& ) {}; |
37 | 153 |
void updateCallTime (int bubbleId, const QString& callTime) { m_updateCallTimeCalled=true; m_int=bubbleId; m_string=callTime; }; |
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
154 |
void setCallObjectImage (int , const QString &) {}; |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
155 |
void setCallObjectFromTheme (int ) {}; |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
156 |
void setCallObjectText (int , const QString &) {}; |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
157 |
void setCallFlags (int , int ) {}; |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
158 |
void setCallFlag (int , PhoneCallFlags , bool ) {}; |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
159 |
void setNumberType (int , PhoneNumberType ) {}; |
37 | 160 |
void updateCallHeaderText( |
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
161 |
int , |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
162 |
const QString &, |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
163 |
const QString &, |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
164 |
Qt::TextElideMode ) {}; |
37 | 165 |
void setPhoneMuted (bool muted) { m_setPhoneMutedCalled = muted; }; |
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
166 |
int createConference (int , int ) { return 1; }; |
37 | 167 |
void removeConference () {}; |
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
168 |
void addRowToConference (int ) {}; |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
169 |
void removeRowFromConference (int ) {}; |
37 | 170 |
int conferenceRowCount () const { return 2; }; |
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
171 |
void setSelectionInConference (int ) {}; |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
172 |
void setSelectionIdInConference (int ) {}; |
37 | 173 |
int selectionInConference () const { return 0; }; |
174 |
int selectionIdInConference () const { return 0; }; |
|
175 |
void moveHighlightOneUpInConference () {}; |
|
176 |
void moveHighlightOneDownInConference () {}; |
|
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
177 |
void setExpandedConferenceCallHeader (bool ) { m_ExpandConferenceCalled = true; }; |
37 | 178 |
bool isConferenceExpanded () const { return false; }; |
179 |
int shownHeaderCount () const { return 1; }; |
|
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
180 |
void setParticipantListCli (int , ParticipantListCli ) {}; |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
181 |
void addAction (int , HbAction *) {}; |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
182 |
void clearActions (int ) {}; |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
183 |
QGraphicsWidget* graphicsWidgetForAction (HbAction *) const { return 0;}; |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
184 |
void addParticipantListAction (HbAction *) {}; |
37 | 185 |
int expandedBubble() const { return 1; }; |
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
186 |
void setExpandAction(int , HbAction* ) {}; |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
187 |
void setBubbleSelectionDisabled(bool ) {}; |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
188 |
void setRestrictedMode(bool ) {}; |
37 | 189 |
|
190 |
signals: |
|
191 |
void dialpadAboutToClose(); |
|
192 |
void keyPressReleased(QKeyEvent *event); |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
193 |
void windowActivated(); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
194 |
void windowDeactivated(); |
37 | 195 |
|
196 |
public slots: |
|
197 |
void initTestCase (); |
|
198 |
void cleanupTestCase (); |
|
199 |
void init (); |
|
200 |
void cleanup (); |
|
201 |
||
202 |
private slots: |
|
203 |
void testEPhoneViewSetTopApplicationCommand (); |
|
204 |
void testEPhoneViewSetIdleTopApplicationCommand (); |
|
205 |
void testEPhoneViewUpdateCallHeaderCallDurationCommand (); |
|
206 |
void testEPhoneViewCreateCallHeaderCommand (); |
|
207 |
void testEPhoneViewCreateEmergencyCallHeader (); |
|
208 |
void testEPhoneViewUpdateBubble (); |
|
209 |
void testEPhoneViewUpdateCallHeaderRemoteInfoData (); |
|
210 |
void testEPhoneViewUpdateCallHeaderRemoteInfoDataAndLabel(); |
|
211 |
void testCallIdByState (); |
|
212 |
void testSetToolbarButtons (); |
|
213 |
void testHoldFlag (); |
|
214 |
void testEPhoneViewHideNaviPaneAudioVolume (); |
|
215 |
void testEPhoneViewSetNaviPaneAudioVolume (); |
|
216 |
void testEPhoneViewGetAudioVolumeLevel (); |
|
217 |
void testEPhoneViewActivateMuteUIChanges (); |
|
218 |
void testEPhoneViewGetCountOfActiveCallss (); |
|
219 |
void testExecuteCommandLwithCmdId (); |
|
220 |
void testExecuteCommandLwithCmdIdAndCallId (); |
|
221 |
void testExecuteCommandLwithCmdIdAndCmdParam (); |
|
222 |
void testSetTouchButtons (); |
|
223 |
void testCreateConferenceBubble (); |
|
224 |
void testHandleCommandL (); |
|
225 |
void testGetSelectedConferenceMember (); |
|
226 |
void testSetAudioPath (); |
|
227 |
void testMuteRingToneOnAnswer (); |
|
228 |
void testStopRingTone (); |
|
229 |
void testMuteRingTone (); |
|
230 |
void testPlayRingTone (); |
|
231 |
void testShowGlobalNote (); |
|
232 |
void testSetExpandActions(); |
|
233 |
void testShowDialpad (); |
|
234 |
void testDialpadVisibility (); |
|
235 |
void removeAllCallHeaders (); |
|
236 |
void testRemoveDialpad(); |
|
237 |
void testGetDialpadStringLength(); |
|
238 |
void testGetDialpadString(); |
|
239 |
void testAddToConference(); |
|
240 |
void testSetConferenceExpanded(); |
|
241 |
void testSetMenuActions(); |
|
242 |
void testNoteController(); |
|
243 |
void testHsToForegroundAfterCall(); |
|
244 |
void testCipheringInfoChange(); |
|
245 |
void testSetHidden(); |
|
246 |
void testBeginEndUiUpdate(); |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
247 |
void testIndicatorController(); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
248 |
void testOpenLogs(); |
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
249 |
void testSetFlags(); |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
250 |
void testCaptureEndKey(); |
37 | 251 |
|
252 |
private: |
|
253 |
PhoneUIQtViewAdapter *m_adapter; // class under test |
|
254 |
bool m_showToolbarCalled; |
|
255 |
bool m_updateCallTimeCalled; |
|
256 |
int m_int; |
|
257 |
QString m_string; |
|
258 |
HbAction *m_action; |
|
259 |
int m_toolbarActionCount; |
|
260 |
bool m_startChangesCalled; |
|
261 |
bool m_endChangesCalled; |
|
262 |
bool m_volumeSliderValueCalled; |
|
263 |
bool m_removeVolumeSliderCalled; |
|
264 |
bool m_setVolumeSliderValueCalled; |
|
265 |
int m_volumeSliderValue; |
|
266 |
bool m_setPhoneMutedCalled; |
|
267 |
QMap<int, QList<int> *> m_actionMap; |
|
268 |
QMap<int,int> m_expandAction; |
|
269 |
bool m_showDialpadCalled; |
|
270 |
bool m_hideDialpadCalled; |
|
271 |
bool m_dialpadVisibilityCalled; |
|
272 |
bool m_clearAndHideDialpadCalled; |
|
273 |
bool m_ExpandConferenceCalled; |
|
274 |
bool m_setMenuActionsCalled; |
|
275 |
bool m_isDialpadVisible; |
|
276 |
QString m_dialpadText; |
|
277 |
HbMenu m_menu; |
|
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
278 |
bool m_captured; |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
279 |
Qt::Key m_capturedKey; |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
280 |
QList<int> mParticipantListActions; |
37 | 281 |
}; |
282 |
||
283 |
TestPhoneUIQtViewAdapter::TestPhoneUIQtViewAdapter () : |
|
284 |
m_isDialpadVisible(false), |
|
285 |
m_dialpadText("1234567") |
|
286 |
{ |
|
287 |
} |
|
288 |
||
289 |
TestPhoneUIQtViewAdapter::~TestPhoneUIQtViewAdapter () |
|
290 |
{ |
|
291 |
} |
|
292 |
||
293 |
void TestPhoneUIQtViewAdapter::initTestCase () |
|
294 |
{ |
|
295 |
m_adapter = new PhoneUIQtViewAdapter (*this); |
|
296 |
} |
|
297 |
||
298 |
void TestPhoneUIQtViewAdapter::cleanupTestCase () |
|
299 |
{ |
|
300 |
delete m_adapter; |
|
301 |
} |
|
302 |
||
303 |
void TestPhoneUIQtViewAdapter::init () |
|
304 |
{ |
|
305 |
m_startChangesCalled = false; |
|
306 |
m_endChangesCalled = false; |
|
307 |
m_setCipheringCalled = false; |
|
308 |
} |
|
309 |
||
310 |
void TestPhoneUIQtViewAdapter::cleanup () |
|
311 |
{ |
|
312 |
} |
|
313 |
||
314 |
BubbleManagerIF& TestPhoneUIQtViewAdapter::bubbleManager () |
|
315 |
{ |
|
316 |
return *this; |
|
317 |
} |
|
318 |
||
319 |
void TestPhoneUIQtViewAdapter::addBubbleCommand ( |
|
320 |
int bubbleId, const PhoneAction& action) |
|
321 |
{ |
|
322 |
if (m_actionMap.keys().contains(bubbleId)) { |
|
323 |
m_actionMap.value(bubbleId)->append(action.command()); |
|
324 |
} else { |
|
325 |
QList<int> *list = new QList<int>(); |
|
326 |
list->append(action.command()); |
|
327 |
m_actionMap.insert( bubbleId, list); |
|
328 |
} |
|
329 |
} |
|
330 |
||
331 |
void TestPhoneUIQtViewAdapter::clearBubbleCommands (int bubbleId) |
|
332 |
{ |
|
333 |
if (m_actionMap.keys().contains(bubbleId)) { |
|
334 |
QList<int> *list = m_actionMap.value(bubbleId); |
|
335 |
list->clear(); |
|
336 |
delete list; |
|
337 |
m_actionMap.remove(bubbleId); |
|
338 |
} |
|
339 |
} |
|
340 |
||
341 |
void TestPhoneUIQtViewAdapter::addParticipantListAction( |
|
342 |
int commandId, |
|
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
343 |
const QString& , |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
344 |
const HbIcon& ) |
37 | 345 |
{ |
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
346 |
mParticipantListActions.append(commandId); |
37 | 347 |
} |
348 |
||
349 |
void TestPhoneUIQtViewAdapter::clearParticipantListActions() |
|
350 |
{ |
|
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
351 |
mParticipantListActions.clear(); |
37 | 352 |
} |
353 |
||
354 |
void TestPhoneUIQtViewAdapter::testEPhoneViewSetTopApplicationCommand () |
|
355 |
{ |
|
356 |
TPhoneCmdParamInteger intParam; |
|
357 |
intParam.SetInteger (12345); |
|
358 |
m_adapter->ExecuteCommandL (EPhoneViewSetTopApplication, &intParam); |
|
359 |
} |
|
360 |
||
361 |
void TestPhoneUIQtViewAdapter::testEPhoneViewSetIdleTopApplicationCommand () |
|
362 |
{ |
|
363 |
m_adapter->ExecuteCommandL (EPhoneViewSetIdleTopApplication); |
|
364 |
} |
|
365 |
||
366 |
void TestPhoneUIQtViewAdapter::testEPhoneViewUpdateCallHeaderCallDurationCommand () |
|
367 |
{ |
|
368 |
TPhoneCmdParamInteger time; |
|
369 |
time.SetInteger(73); |
|
370 |
m_adapter->ExecuteCommandL (EPhoneViewUpdateCallHeaderCallDuration, 1, &time); |
|
371 |
QCOMPARE (m_updateCallTimeCalled, true); |
|
372 |
QCOMPARE (m_int, 2); |
|
373 |
QVERIFY (m_string == "0:01:13"); |
|
374 |
} |
|
375 |
||
376 |
void TestPhoneUIQtViewAdapter::testEPhoneViewCreateCallHeaderCommand () |
|
377 |
{ |
|
378 |
TPhoneCmdParamCallHeaderData callHeader; |
|
379 |
callHeader.SetDiverted (ETrue); |
|
380 |
callHeader.SetCallState (3); |
|
381 |
callHeader.SetLabelText (_L("Foo")); |
|
382 |
callHeader.SetCLIText (_L("Bar"), TPhoneCmdParamCallHeaderData::ERight); |
|
383 |
callHeader.SetCNAPText (_L("CNAP"), TPhoneCmdParamCallHeaderData::ERight); |
|
384 |
callHeader.SetCallType (3); |
|
385 |
callHeader.SetCipheringIndicatorAllowed(true); |
|
386 |
callHeader.SetCiphering(false); |
|
387 |
m_adapter->ExecuteCommandL (EPhoneViewCreateCallHeader, 2, &callHeader); |
|
388 |
||
389 |
QVERIFY (m_startChangesCalled == true); |
|
390 |
||
391 |
QVERIFY (m_createCallHeaderCalled == true); |
|
392 |
QCOMPARE (m_createCallHeaderInt, 2); |
|
393 |
||
394 |
QVERIFY (m_setStateCalled == true); |
|
395 |
QCOMPARE (m_setStateCallId, 2); |
|
396 |
QCOMPARE (m_setStateBubbleId, 1); |
|
397 |
QCOMPARE (m_setStateCallState, 3); |
|
398 |
||
399 |
QVERIFY (m_setLabelCalled == true); |
|
400 |
QString labelText = QString::fromUtf16 (m_setLabelText->Ptr (), m_setLabelText->Length ()); |
|
401 |
QCOMPARE (m_setLabelBubbleId, 1); |
|
402 |
QCOMPARE (labelText, QString("Foo")); |
|
403 |
||
404 |
QVERIFY (m_setCliCalled == true); |
|
405 |
QString cliText = QString::fromUtf16 (m_setCliText->Ptr (), m_setCliText->Length ()); |
|
406 |
QCOMPARE (m_setCliBubbleId, 1); |
|
407 |
QCOMPARE (cliText, QString("Bar")); |
|
408 |
||
409 |
QVERIFY (m_setSecondaryCliCalled == true); |
|
410 |
QString cnapText = QString::fromUtf16 (m_setSecondaryCliText->Ptr (), m_setSecondaryCliText->Length ()); |
|
411 |
QCOMPARE (m_setSecondaryCliBubbleId, 1); |
|
412 |
QCOMPARE (cnapText, QString("CNAP")); |
|
413 |
||
414 |
QVERIFY (m_setCallTypeCalled == true); |
|
415 |
QCOMPARE (m_setCallTypeBubbleId, 1); |
|
416 |
QCOMPARE (m_setCallTypeType, 3); |
|
417 |
||
418 |
QVERIFY (m_setDivertCalled == true); |
|
419 |
QVERIFY (m_bubblewrapperbool == true); |
|
420 |
QCOMPARE (m_bubblewrapperint, 1); |
|
421 |
||
422 |
QVERIFY (m_setCipheringCalled == true); |
|
423 |
||
424 |
QVERIFY (m_endChangesCalled == true); |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
425 |
|
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
426 |
QVERIFY (m_setActiveCallCalled == true); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
427 |
|
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
428 |
|
37 | 429 |
} |
430 |
||
431 |
void TestPhoneUIQtViewAdapter::testEPhoneViewCreateEmergencyCallHeader () |
|
432 |
{ |
|
433 |
TPhoneCmdParamEmergencyCallHeaderData callHeader; |
|
434 |
callHeader.SetLabelText (_L("Attempting")); |
|
435 |
callHeader.SetHeaderText (_L("emergency") ); |
|
436 |
m_adapter->ExecuteCommandL (EPhoneViewCreateEmergencyCallHeader, 2, &callHeader); |
|
437 |
callHeader.SetCipheringIndicatorAllowed(true); |
|
438 |
callHeader.SetCiphering(false); |
|
439 |
||
440 |
QVERIFY (m_startChangesCalled == true); |
|
441 |
||
442 |
QVERIFY (m_createCallHeaderCalled == true); |
|
443 |
QCOMPARE (m_createCallHeaderInt, 2); |
|
444 |
||
445 |
QVERIFY (m_setLabelCalled == true); |
|
446 |
QString labelText = QString::fromUtf16 (m_setLabelText->Ptr (), m_setLabelText->Length ()); |
|
447 |
QCOMPARE (m_setLabelBubbleId, 1); |
|
448 |
QCOMPARE (labelText, QString("Attempting")); |
|
449 |
||
450 |
QVERIFY (m_setCliCalled == true); |
|
451 |
QString cliText = QString::fromUtf16 (m_setCliText->Ptr (), m_setCliText->Length ()); |
|
452 |
QCOMPARE (m_setCliBubbleId, 1); |
|
453 |
QCOMPARE (cliText, QString("emergency")); |
|
454 |
||
455 |
QVERIFY (m_setCipheringCalled == true); |
|
456 |
||
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
457 |
QVERIFY (m_endChangesCalled == true); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
458 |
|
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
459 |
QVERIFY (m_setActiveCallCalled == true); |
37 | 460 |
} |
461 |
||
462 |
void TestPhoneUIQtViewAdapter::testEPhoneViewUpdateBubble () |
|
463 |
{ |
|
464 |
// Bubble id will return -1 |
|
465 |
m_bubble_id = -1; |
|
466 |
||
467 |
TPhoneCmdParamCallHeaderData callHeader; |
|
468 |
callHeader.SetCallState (2); |
|
469 |
callHeader.SetLabelText (_L("Foo2")); |
|
470 |
callHeader.SetDiverted (EFalse); |
|
471 |
m_adapter->ExecuteCommandL (EPhoneViewUpdateBubble, 3, &callHeader); |
|
472 |
QVERIFY (m_startChangesCalled == false); |
|
473 |
||
474 |
//Test with available bubble id |
|
475 |
m_bubble_id = -2; |
|
476 |
||
477 |
m_adapter->ExecuteCommandL (EPhoneViewUpdateBubble, 3, &callHeader); |
|
478 |
||
479 |
QVERIFY (m_startChangesCalled == true); |
|
480 |
||
481 |
QVERIFY (m_bubbleIdCalled == true); |
|
482 |
QCOMPARE (m_bubbleIdCallId, 3); |
|
483 |
||
484 |
QVERIFY (m_setStateCalled == true); |
|
485 |
QCOMPARE (m_setStateCallId, 3); |
|
486 |
QCOMPARE (m_setStateBubbleId, 2); |
|
487 |
QCOMPARE (m_setStateCallState, 2); |
|
488 |
||
489 |
QVERIFY (m_setLabelCalled == true); |
|
490 |
QString labelText = QString::fromUtf16 (m_setLabelText->Ptr (), m_setLabelText->Length ()); |
|
491 |
QCOMPARE (m_setLabelBubbleId, 2); |
|
492 |
QCOMPARE (labelText, QString("Foo2")); |
|
493 |
||
494 |
QVERIFY (m_setDivertCalled == true); |
|
495 |
QVERIFY (m_bubblewrapperbool == false); |
|
496 |
QCOMPARE (m_bubblewrapperint, 2); |
|
497 |
||
498 |
QVERIFY (m_endChangesCalled == true); |
|
499 |
} |
|
500 |
||
501 |
void TestPhoneUIQtViewAdapter::testEPhoneViewUpdateCallHeaderRemoteInfoData () |
|
502 |
{ |
|
503 |
// Bubble id will return -1 |
|
504 |
m_bubble_id = -1; |
|
505 |
TPhoneCmdParamCallHeaderData callHeader; |
|
506 |
callHeader.SetCLIText (_L("Bar3"), TPhoneCmdParamCallHeaderData::ERight); |
|
507 |
callHeader.SetCNAPText (_L("CNAP3"), TPhoneCmdParamCallHeaderData::ERight); |
|
508 |
callHeader.SetDiverted (ETrue); |
|
509 |
m_adapter->ExecuteCommandL (EPhoneViewUpdateCallHeaderRemoteInfoData, 4, &callHeader); |
|
510 |
QVERIFY (m_startChangesCalled == false); |
|
511 |
||
512 |
//Test with available bubble id |
|
513 |
m_bubble_id = -2; |
|
514 |
||
515 |
m_adapter->ExecuteCommandL (EPhoneViewUpdateCallHeaderRemoteInfoData, 4, &callHeader); |
|
516 |
||
517 |
QVERIFY (m_startChangesCalled == true); |
|
518 |
||
519 |
QVERIFY (m_bubbleIdCalled == true); |
|
520 |
QCOMPARE (m_bubbleIdCallId, 4); |
|
521 |
||
522 |
QVERIFY (m_setCliCalled == true); |
|
523 |
QString cliText = QString::fromUtf16 (m_setCliText->Ptr (), m_setCliText->Length ()); |
|
524 |
QCOMPARE (m_setCliBubbleId, 2); |
|
525 |
QCOMPARE (cliText, QString("Bar3")); |
|
526 |
||
527 |
QVERIFY (m_setSecondaryCliCalled == true); |
|
528 |
QString cnapText = QString::fromUtf16 (m_setSecondaryCliText->Ptr (), m_setSecondaryCliText->Length ()); |
|
529 |
QCOMPARE (m_setSecondaryCliBubbleId, 2); |
|
530 |
QCOMPARE (cnapText, QString("CNAP3")); |
|
531 |
||
532 |
QVERIFY (m_setDivertCalled == true); |
|
533 |
QVERIFY (m_bubblewrapperbool == true); |
|
534 |
QCOMPARE (m_bubblewrapperint, 2); |
|
535 |
||
536 |
QVERIFY (m_endChangesCalled == true); |
|
537 |
} |
|
538 |
||
539 |
void TestPhoneUIQtViewAdapter::testEPhoneViewUpdateCallHeaderRemoteInfoDataAndLabel () |
|
540 |
{ |
|
541 |
// Bubble id will return -1 |
|
542 |
m_bubble_id = -1; |
|
543 |
TPhoneCmdParamCallHeaderData callHeader; |
|
544 |
callHeader.SetLabelText (_L("Foo4")); |
|
545 |
callHeader.SetCLIText (_L("Bar4"), TPhoneCmdParamCallHeaderData::ERight); |
|
546 |
callHeader.SetCNAPText (_L("CNAP4"), TPhoneCmdParamCallHeaderData::ERight); |
|
547 |
callHeader.SetDiverted (ETrue); |
|
548 |
m_adapter->ExecuteCommandL (EPhoneViewUpdateCallHeaderRemoteInfoDataAndLabel, 4, &callHeader); |
|
549 |
||
550 |
QVERIFY (m_startChangesCalled == false); |
|
551 |
||
552 |
||
553 |
//Test with available bubble id |
|
554 |
m_bubble_id = -2; |
|
555 |
m_adapter->ExecuteCommandL (EPhoneViewUpdateCallHeaderRemoteInfoDataAndLabel, 4, &callHeader); |
|
556 |
||
557 |
QVERIFY (m_startChangesCalled == true); |
|
558 |
||
559 |
QVERIFY (m_bubbleIdCalled == true); |
|
560 |
QCOMPARE (m_bubbleIdCallId, 4); |
|
561 |
||
562 |
QVERIFY (m_setLabelCalled == true); |
|
563 |
QString labelText = QString::fromUtf16 (m_setLabelText->Ptr (), m_setLabelText->Length ()); |
|
564 |
QCOMPARE (m_setLabelBubbleId, 2); |
|
565 |
QCOMPARE (labelText, QString("Foo4")); |
|
566 |
||
567 |
QVERIFY (m_setCliCalled == true); |
|
568 |
QString cliText = QString::fromUtf16 (m_setCliText->Ptr (), m_setCliText->Length ()); |
|
569 |
QCOMPARE (m_setCliBubbleId, 2); |
|
570 |
QCOMPARE (cliText, QString("Bar4")); |
|
571 |
||
572 |
QVERIFY (m_setSecondaryCliCalled == true); |
|
573 |
QString cnapText = QString::fromUtf16 (m_setSecondaryCliText->Ptr (), m_setSecondaryCliText->Length ()); |
|
574 |
QCOMPARE (m_setSecondaryCliBubbleId, 2); |
|
575 |
QCOMPARE (cnapText, QString("CNAP4")); |
|
576 |
||
577 |
QVERIFY (m_setDivertCalled == true); |
|
578 |
QVERIFY (m_bubblewrapperbool == true); |
|
579 |
QCOMPARE (m_bubblewrapperint, 2); |
|
580 |
||
581 |
QVERIFY (m_endChangesCalled == true); |
|
582 |
} |
|
583 |
||
584 |
void TestPhoneUIQtViewAdapter::testCallIdByState () |
|
585 |
{ |
|
586 |
TPhoneCmdParamCallHeaderData callHeader; |
|
587 |
TPhoneCmdParamCallStateData data; |
|
588 |
callHeader.SetCallState (EPEStateConnected); |
|
589 |
m_adapter->ExecuteCommandL (EPhoneViewUpdateBubble, 0, &callHeader); |
|
590 |
data.SetCallState (EPEStateConnected); |
|
591 |
m_adapter->HandleCommandL (EPhoneViewGetCallIdByState, &data); |
|
592 |
QCOMPARE (data.CallId(), 0); |
|
593 |
} |
|
594 |
||
595 |
void TestPhoneUIQtViewAdapter::testSetToolbarButtons () |
|
596 |
{ |
|
597 |
m_toolbarActionCount = 0; |
|
598 |
TPhoneCmdParamInteger intParam; |
|
599 |
intParam.SetInteger (R_PHONEUI_CALLHANDLING_INCOMINGCALL_CBA); |
|
600 |
m_adapter->ExecuteCommandL (EPhoneViewUpdateCba, &intParam); |
|
601 |
QCOMPARE(m_toolbarActionCount,2); |
|
602 |
||
603 |
m_toolbarActionCount = 0; |
|
604 |
intParam.SetInteger (R_PHONEUI_DIALER_CBA); |
|
605 |
m_adapter->ExecuteCommandL (EPhoneViewUpdateCba, &intParam); |
|
606 |
QCOMPARE(m_toolbarActionCount,4); |
|
607 |
} |
|
608 |
||
609 |
void TestPhoneUIQtViewAdapter::testHoldFlag () |
|
610 |
{ |
|
611 |
TPhoneCmdParamBoolean boolParam; |
|
612 |
m_adapter->ExecuteCommandL (EPhoneViewGetHoldFlag, &boolParam); |
|
613 |
QCOMPARE ((bool)boolParam.Boolean (), false); |
|
614 |
||
615 |
boolParam.SetBoolean (ETrue); |
|
616 |
m_adapter->ExecuteCommandL (EPhoneViewSetHoldFlag, &boolParam); |
|
617 |
m_adapter->ExecuteCommandL (EPhoneViewGetHoldFlag, &boolParam); |
|
618 |
QCOMPARE ((bool)boolParam.Boolean (), true); |
|
619 |
||
620 |
boolParam.SetBoolean (EFalse); |
|
621 |
m_adapter->ExecuteCommandL (EPhoneViewSetHoldFlag, &boolParam); |
|
622 |
m_adapter->ExecuteCommandL (EPhoneViewGetHoldFlag, &boolParam); |
|
623 |
QCOMPARE ((bool)boolParam.Boolean (), false); |
|
624 |
} |
|
625 |
||
626 |
void TestPhoneUIQtViewAdapter::testEPhoneViewHideNaviPaneAudioVolume () |
|
627 |
{ |
|
628 |
m_adapter->ExecuteCommandL (EPhoneViewHideNaviPaneAudioVolume); |
|
629 |
QCOMPARE (m_removeVolumeSliderCalled, true); |
|
630 |
} |
|
631 |
||
632 |
void TestPhoneUIQtViewAdapter::testEPhoneViewSetNaviPaneAudioVolume () |
|
633 |
{ |
|
634 |
TPhoneCmdParamInteger intParam; |
|
635 |
intParam.SetInteger (3); |
|
636 |
m_adapter->ExecuteCommandL (EPhoneViewSetNaviPaneAudioVolume, &intParam); |
|
637 |
QCOMPARE (m_setVolumeSliderValueCalled, true); |
|
638 |
QCOMPARE (m_volumeSliderValue, 3); |
|
639 |
} |
|
640 |
||
641 |
void TestPhoneUIQtViewAdapter::testEPhoneViewGetAudioVolumeLevel () |
|
642 |
{ |
|
643 |
TPhoneCmdParamInteger intParam; |
|
644 |
m_adapter->ExecuteCommand (EPhoneViewGetAudioVolumeLevel, &intParam); |
|
645 |
QCOMPARE (m_volumeSliderValueCalled, true); |
|
646 |
QCOMPARE (intParam.Integer (), 5); |
|
647 |
} |
|
648 |
||
649 |
void TestPhoneUIQtViewAdapter::testEPhoneViewActivateMuteUIChanges () |
|
650 |
{ |
|
651 |
TPhoneCmdParamBoolean boolParam; |
|
652 |
boolParam.SetBoolean (true); |
|
653 |
m_adapter->ExecuteCommandL (EPhoneViewActivateMuteUIChanges, &boolParam); |
|
654 |
QCOMPARE (m_setPhoneMutedCalled, true); |
|
655 |
} |
|
656 |
||
657 |
void TestPhoneUIQtViewAdapter::testEPhoneViewGetCountOfActiveCallss () |
|
658 |
{ |
|
659 |
TPhoneCmdParamInteger intParam; |
|
660 |
m_adapter->ExecuteCommandL (EPhoneViewGetCountOfActiveCalls, &intParam); |
|
661 |
QVERIFY (m_activeCallCountCalled == true); |
|
662 |
} |
|
663 |
||
664 |
void TestPhoneUIQtViewAdapter::testExecuteCommandLwithCmdId () |
|
665 |
{ |
|
666 |
// Default |
|
667 |
m_adapter->ExecuteCommandL (0); |
|
668 |
} |
|
669 |
||
670 |
void TestPhoneUIQtViewAdapter::testExecuteCommandLwithCmdIdAndCallId () |
|
671 |
{ |
|
672 |
// Default |
|
673 |
m_adapter->ExecuteCommandL (0, 0); |
|
674 |
||
675 |
m_adapter->ExecuteCommandL (EPhoneViewRemoveCallHeader, 0); |
|
676 |
QVERIFY (m_startChangesCalled == true); |
|
677 |
QVERIFY (m_endChangesCalled == true); |
|
678 |
||
679 |
m_removeCallFromConference = false; |
|
680 |
m_adapter->ExecuteCommandL (EPhoneViewRemoveFromConference, 0); |
|
681 |
QVERIFY (m_startChangesCalled == true); |
|
682 |
QVERIFY (m_endChangesCalled == true); |
|
683 |
QVERIFY (m_removeCallFromConference == true); |
|
684 |
||
685 |
m_removeCallFromConference = false; |
|
686 |
m_adapter->ExecuteCommandL (EPhoneViewPrivateFromConference, 0); |
|
687 |
QVERIFY (m_startChangesCalled == true); |
|
688 |
QVERIFY (m_endChangesCalled == true); |
|
689 |
QVERIFY (m_removeCallFromConference == true); |
|
690 |
} |
|
691 |
||
692 |
void TestPhoneUIQtViewAdapter::testExecuteCommandLwithCmdIdAndCmdParam () |
|
693 |
{ |
|
694 |
TPhoneCmdParamBoolean boolParam; |
|
695 |
// Default |
|
696 |
m_adapter->ExecuteCommandL (0, &boolParam); |
|
697 |
||
698 |
||
699 |
// Is conference |
|
700 |
m_adapter->ExecuteCommandL (EPhoneViewGetIsConference, &boolParam); |
|
701 |
QCOMPARE ((bool)boolParam.Boolean (), false); |
|
702 |
||
703 |
||
704 |
// Get expand bubble call id |
|
705 |
TPhoneCmdParamInteger intParam; |
|
706 |
m_adapter->ExecuteCommandL (EPhoneViewGetExpandedBubbleCallId, &intParam); |
|
707 |
QCOMPARE ((int)intParam.Integer(), -1); |
|
708 |
||
709 |
m_callStateMap.insert(0, EPEStateConnected); |
|
710 |
m_bubblesMap.insert(0, 0); |
|
711 |
m_callStateMap.insert(1, EPEStateHeld); |
|
712 |
m_bubblesMap.insert(1, 1); |
|
713 |
||
714 |
m_adapter->ExecuteCommandL (EPhoneViewGetExpandedBubbleCallId, &intParam); |
|
715 |
QCOMPARE ((int)intParam.Integer(), 1); |
|
716 |
||
717 |
m_callStateMap.clear(); |
|
718 |
m_bubblesMap.clear(); |
|
719 |
} |
|
720 |
||
721 |
void TestPhoneUIQtViewAdapter::testSetTouchButtons () |
|
722 |
{ |
|
723 |
TPhoneCmdParamBoolean boolParam; |
|
724 |
boolParam.SetBoolean( false ); |
|
725 |
||
726 |
||
727 |
||
728 |
//Connected call |
|
729 |
m_callStateMap.insert(0, EPEStateConnected); |
|
730 |
m_bubblesMap.insert(0, 0); |
|
731 |
m_adapter->ExecuteCommandL (EPhoneViewSetTouchPaneButtons, &boolParam); |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
732 |
QVERIFY(m_actionMap.value(0)->contains(EPhoneInCallCmdMute)); |
37 | 733 |
QVERIFY(m_actionMap.value(0)->contains(EPhoneInCallCmdEndThisActiveCall)); |
734 |
||
735 |
//Emergency |
|
736 |
boolParam.SetBoolean(true); |
|
737 |
m_adapter->ExecuteCommandL (EPhoneViewSetTouchPaneButtons, &boolParam); |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
738 |
QVERIFY(false == m_actionMap.value(0)->contains(EPhoneInCallCmdMute)); |
37 | 739 |
QVERIFY(m_actionMap.value(0)->contains(EPhoneInCallCmdEndThisActiveCall)); |
740 |
||
741 |
//Held and active |
|
742 |
boolParam.SetBoolean(false); |
|
743 |
m_callStateMap.insert(1, EPEStateHeld); |
|
744 |
m_bubblesMap.insert(1, 1); |
|
745 |
m_adapter->ExecuteCommandL (EPhoneViewSetTouchPaneButtons, &boolParam); |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
746 |
QVERIFY(m_actionMap.value(0)->contains(EPhoneInCallCmdMute)); |
37 | 747 |
QVERIFY(m_actionMap.value(0)->contains(EPhoneInCallCmdEndThisActiveCall)); |
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
748 |
QVERIFY(m_actionMap.value(1)->contains(EPhoneInCallCmdMute)); |
37 | 749 |
QVERIFY(m_actionMap.value(1)->contains(EPhoneInCallCmdEndThisActiveCall)); |
750 |
clearBubbleCommands(0); |
|
751 |
clearBubbleCommands(1); |
|
752 |
||
753 |
//Connected call and waiting |
|
754 |
m_callStateMap.insert(0, EPEStateConnected); |
|
755 |
m_bubblesMap.insert(0, 0); |
|
756 |
||
757 |
boolParam.SetBoolean(false); |
|
758 |
m_callStateMap.insert(1, EPEStateRinging); |
|
759 |
m_bubblesMap.insert(1, 1); |
|
760 |
m_adapter->ExecuteCommandL (EPhoneViewSetTouchPaneButtons, &boolParam); |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
761 |
QVERIFY(m_actionMap.value(0)->contains(EPhoneInCallCmdMute)); |
37 | 762 |
QVERIFY(m_actionMap.value(0)->contains(EPhoneInCallCmdEndThisActiveCall)); |
763 |
QVERIFY(m_actionMap.value(1)->contains(EPhoneCallComingCmdReject)); |
|
764 |
clearBubbleCommands(0); |
|
765 |
clearBubbleCommands(1); |
|
766 |
||
767 |
//Held call and waiting |
|
768 |
m_callStateMap.insert(0, EPEStateHeld); |
|
769 |
m_bubblesMap.insert(0, 0); |
|
770 |
||
771 |
boolParam.SetBoolean(false); |
|
772 |
m_callStateMap.insert(1, EPEStateRinging); |
|
773 |
m_bubblesMap.insert(1, 1); |
|
774 |
m_adapter->ExecuteCommandL (EPhoneViewSetTouchPaneButtons, &boolParam); |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
775 |
QVERIFY(m_actionMap.value(0)->contains(EPhoneInCallCmdMute)); |
37 | 776 |
QVERIFY(m_actionMap.value(0)->contains(EPhoneInCallCmdEndThisActiveCall)); |
777 |
QVERIFY(m_actionMap.value(1)->contains(EPhoneCallComingCmdReject)); |
|
778 |
clearBubbleCommands(0); |
|
779 |
clearBubbleCommands(1); |
|
780 |
||
781 |
//Idle |
|
782 |
m_callStateMap.clear(); |
|
783 |
m_bubblesMap.clear(); |
|
784 |
m_callStateMap.insert(0, EPEStateIdle); |
|
785 |
m_bubblesMap.insert(0, 0); |
|
786 |
m_adapter->ExecuteCommandL (EPhoneViewSetTouchPaneButtons, &boolParam); |
|
787 |
QVERIFY(0==m_actionMap.keys().size()); |
|
788 |
clearBubbleCommands(0); |
|
789 |
||
790 |
//Conference Idle |
|
791 |
m_callStateMap.clear(); |
|
792 |
m_bubblesMap.clear(); |
|
793 |
m_callStateMap.insert(0, EPEStateConferenceIdle); |
|
794 |
m_bubblesMap.insert(0, 0); |
|
795 |
m_adapter->ExecuteCommandL (EPhoneViewSetTouchPaneButtons, &boolParam); |
|
796 |
QVERIFY(0==m_actionMap.keys().size()); |
|
797 |
clearBubbleCommands(0); |
|
798 |
||
799 |
//Disconnecting |
|
800 |
m_callStateMap.clear(); |
|
801 |
m_bubblesMap.clear(); |
|
802 |
m_callStateMap.insert(0, EPEStateDisconnecting); |
|
803 |
m_bubblesMap.insert(0, 0); |
|
804 |
m_adapter->ExecuteCommandL (EPhoneViewSetTouchPaneButtons, &boolParam); |
|
805 |
QVERIFY(0==m_actionMap.keys().size()); |
|
806 |
clearBubbleCommands(0); |
|
807 |
||
808 |
//Dialling |
|
809 |
m_callStateMap.clear(); |
|
810 |
m_bubblesMap.clear(); |
|
811 |
m_callStateMap.insert(0, EPEStateDialing); |
|
812 |
m_bubblesMap.insert(0, 0); |
|
813 |
m_adapter->ExecuteCommandL (EPhoneViewSetTouchPaneButtons, &boolParam); |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
814 |
QVERIFY(2==m_actionMap.value(0)->size()); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
815 |
QVERIFY(m_actionMap.value(0)->contains(EPhoneInCallCmdMute)); |
37 | 816 |
QVERIFY(m_actionMap.value(0)->contains(EPhoneInCallCmdEndThisOutgoingCall)); |
817 |
clearBubbleCommands(0); |
|
818 |
||
819 |
//Ringing |
|
820 |
m_callStateMap.clear(); |
|
821 |
m_bubblesMap.clear(); |
|
822 |
m_callStateMap.insert(0, EPEStateRinging); |
|
823 |
m_bubblesMap.insert(0, 0); |
|
824 |
m_adapter->ExecuteCommandL (EPhoneViewSetTouchPaneButtons, &boolParam); |
|
825 |
QVERIFY(2==m_actionMap.value(0)->size()); |
|
826 |
QVERIFY(m_actionMap.value(0)->contains(EPhoneCallComingCmdAnswer)); |
|
827 |
QVERIFY(m_actionMap.value(0)->contains(EPhoneCallComingCmdReject)); |
|
828 |
clearBubbleCommands(0); |
|
829 |
||
830 |
//Connecting |
|
831 |
m_callStateMap.clear(); |
|
832 |
m_bubblesMap.clear(); |
|
833 |
m_callStateMap.insert(0, EPEStateConnecting); |
|
834 |
m_bubblesMap.insert(0, 0); |
|
835 |
m_adapter->ExecuteCommandL (EPhoneViewSetTouchPaneButtons, &boolParam); |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
836 |
QVERIFY(2==m_actionMap.value(0)->size()); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
837 |
QVERIFY(m_actionMap.value(0)->contains(EPhoneInCallCmdMute)); |
37 | 838 |
QVERIFY(m_actionMap.value(0)->contains(EPhoneInCallCmdEndThisOutgoingCall)); |
839 |
clearBubbleCommands(0); |
|
840 |
||
841 |
//Connected Conference |
|
842 |
m_callStateMap.clear(); |
|
843 |
m_bubblesMap.clear(); |
|
844 |
m_callStateMap.insert(0, EPEStateConnectedConference); |
|
845 |
m_bubblesMap.insert(0, 0); |
|
846 |
m_adapter->ExecuteCommandL (EPhoneViewSetTouchPaneButtons, &boolParam); |
|
847 |
QVERIFY(2==m_actionMap.value(0)->size()); |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
848 |
QVERIFY(m_actionMap.value(0)->contains(EPhoneInCallCmdMute)); |
37 | 849 |
QVERIFY(m_actionMap.value(0)->contains(EPhoneInCallCmdEndThisActiveCall)); |
850 |
||
851 |
// Conference and held |
|
852 |
m_callStateMap.insert(1, EPEStateHeld); |
|
853 |
m_bubblesMap.insert(1, 1); |
|
854 |
m_adapter->ExecuteCommandL (EPhoneViewSetTouchPaneButtons, &boolParam); |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
855 |
QVERIFY(m_actionMap.value(0)->contains(EPhoneInCallCmdMute)); |
37 | 856 |
QVERIFY(m_actionMap.value(0)->contains(EPhoneInCallCmdEndThisActiveCall)); |
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
857 |
QVERIFY(m_actionMap.value(1)->contains(EPhoneInCallCmdMute)); |
37 | 858 |
QVERIFY(m_actionMap.value(1)->contains(EPhoneInCallCmdEndThisActiveCall)); |
859 |
clearBubbleCommands(0); |
|
860 |
clearBubbleCommands(1); |
|
861 |
||
862 |
//Held conference |
|
863 |
m_conferenceCallList.append(1); //for coverage |
|
864 |
m_callStateMap.clear(); |
|
865 |
m_bubblesMap.clear(); |
|
866 |
m_callStateMap.insert(0, EPEStateHeldConference); |
|
867 |
m_bubblesMap.insert(0, 0); |
|
868 |
m_adapter->ExecuteCommandL (EPhoneViewSetTouchPaneButtons, &boolParam); |
|
869 |
QVERIFY(2==m_actionMap.value(0)->size()); |
|
870 |
QVERIFY(m_actionMap.value(0)->contains(EPhoneInCallCmdEndThisActiveCall)); |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
871 |
QVERIFY(m_actionMap.value(0)->contains(EPhoneInCallCmdMute)); |
37 | 872 |
clearBubbleCommands(0); |
873 |
m_conferenceCallList.clear(); |
|
874 |
||
875 |
//Unknown state |
|
876 |
m_callStateMap.clear(); |
|
877 |
m_bubblesMap.clear(); |
|
878 |
m_callStateMap.insert(0, EPEStateUnknown); |
|
879 |
m_bubblesMap.insert(0, 0); |
|
880 |
m_adapter->ExecuteCommandL (EPhoneViewSetTouchPaneButtons, &boolParam); |
|
881 |
QVERIFY(0==m_actionMap.keys().size()); |
|
882 |
clearBubbleCommands(0); |
|
883 |
||
884 |
//Default case |
|
885 |
m_callStateMap.clear(); |
|
886 |
m_bubblesMap.clear(); |
|
887 |
m_callStateMap.insert(0, 100); |
|
888 |
m_bubblesMap.insert(0, 0); |
|
889 |
m_adapter->ExecuteCommandL (EPhoneViewSetTouchPaneButtons, &boolParam); |
|
890 |
QVERIFY(0==m_actionMap.keys().size()); |
|
891 |
clearBubbleCommands(0); |
|
892 |
} |
|
893 |
||
894 |
void TestPhoneUIQtViewAdapter::testCreateConferenceBubble () |
|
895 |
{ |
|
896 |
m_callStateMap.clear(); |
|
897 |
m_bubblesMap.clear(); |
|
898 |
m_callStateMap.insert(0, EPEStateConnected); |
|
899 |
m_bubblesMap.insert(0, 0); |
|
900 |
m_callStateMap.insert(1, EPEStateHeld); |
|
901 |
m_bubblesMap.insert(1, 1); |
|
902 |
||
903 |
//Create conference |
|
904 |
TPhoneCmdParamCallHeaderData callHeader; |
|
905 |
callHeader.SetCallState (2); |
|
906 |
callHeader.SetLabelText (_L("Foo2")); |
|
907 |
callHeader.SetDiverted (EFalse); |
|
908 |
callHeader.SetCipheringIndicatorAllowed(true); |
|
909 |
callHeader.SetCiphering(false); |
|
910 |
||
911 |
m_adapter->ExecuteCommandL (EPhoneViewCreateConference, 3, &callHeader); |
|
912 |
QVERIFY (m_creataConferenceCalled == true); |
|
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
913 |
QVERIFY (mParticipantListActions.count()==2); |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
914 |
QVERIFY (mParticipantListActions.at(0)==EPhoneInCallCmdPrivate); |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
915 |
QVERIFY (mParticipantListActions.at(1)==EPhoneInCallCmdDrop); |
37 | 916 |
|
917 |
// |
|
918 |
TPhoneCmdParamBoolean conferenceDataValue; |
|
919 |
m_adapter->ExecuteCommandL (EPhoneViewGetCallExistsInConference, 0, &conferenceDataValue); |
|
920 |
QVERIFY (conferenceDataValue.Boolean() == true); |
|
921 |
||
922 |
m_adapter->ExecuteCommandL(EPhoneViewRemoveConferenceBubble); |
|
923 |
QVERIFY (m_removeConferenceCalled == true); |
|
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
924 |
QVERIFY (mParticipantListActions.count()==0); |
37 | 925 |
|
926 |
m_adapter->ExecuteCommandL (EPhoneViewGetCallExistsInConference, 0, &conferenceDataValue); |
|
927 |
QVERIFY (conferenceDataValue.Boolean() == false); |
|
928 |
||
929 |
QVERIFY (m_setCipheringCalled == true); |
|
930 |
} |
|
931 |
||
932 |
void TestPhoneUIQtViewAdapter::testHandleCommandL () |
|
933 |
{ |
|
934 |
QVERIFY( EPhoneViewResponseFailed == m_adapter->HandleCommandL ( |
|
935 |
EPhoneIsDTMFDialerVisible) ); |
|
936 |
QVERIFY( EPhoneViewResponseFailed == m_adapter->HandleCommandL ( |
|
937 |
EPhoneViewGetNumberEntryIsVisibleStatus) ); |
|
938 |
/*QVERIFY( EPhoneViewResponseFailed == m_adapter->HandleCommandL ( |
|
939 |
EPhoneViewGetNumberEntryIsUsedStatus) );*/ |
|
940 |
QVERIFY( EPhoneViewResponseFailed == m_adapter->HandleCommandL ( |
|
941 |
EPhoneIsCustomizedDialerVisible) ); |
|
942 |
QVERIFY( EPhoneViewResponseFailed == m_adapter->HandleCommandL ( |
|
943 |
EPhoneViewGetNeedToSendToBackgroundStatus) ); |
|
944 |
||
945 |
//Default handling for coverage |
|
946 |
QVERIFY( EPhoneViewResponseSuccess == m_adapter->HandleCommandL (0) ); |
|
947 |
TPhoneCmdParamBoolean boolean; |
|
948 |
QVERIFY( EPhoneViewResponseSuccess == m_adapter->HandleCommandL (0, &boolean) ); |
|
949 |
||
950 |
m_adapter->ExecuteCommand(0); |
|
951 |
m_adapter->ExecuteCommand(0, &boolean); |
|
952 |
m_adapter->ExecuteCommandL(0, 0, &boolean); |
|
953 |
_LIT (KText, "test"); |
|
954 |
TBufC<8> textBuf (KText); |
|
955 |
m_adapter->ExecuteCommandL(0, 0, textBuf); |
|
956 |
m_adapter->FetchContent(); |
|
957 |
||
958 |
} |
|
959 |
||
960 |
void TestPhoneUIQtViewAdapter::testGetSelectedConferenceMember () |
|
961 |
{ |
|
962 |
m_callStateMap.clear(); |
|
963 |
m_bubblesMap.clear(); |
|
964 |
||
965 |
TPhoneCmdParamInteger integerParam; |
|
966 |
QVERIFY( EPhoneViewResponseFailed == m_adapter->HandleCommandL( |
|
967 |
EPhoneViewSelectedConfMember, &integerParam) ); |
|
968 |
||
969 |
m_callStateMap.insert(1, EPEStateConnected); |
|
970 |
m_bubblesMap.insert(1, 0); |
|
971 |
||
972 |
QVERIFY( EPhoneViewResponseSuccess == m_adapter->HandleCommandL( |
|
973 |
EPhoneViewSelectedConfMember, &integerParam) ); |
|
974 |
||
975 |
QVERIFY( integerParam.Integer() == 1 ); |
|
976 |
} |
|
977 |
||
978 |
void TestPhoneUIQtViewAdapter::testSetAudioPath () |
|
979 |
{ |
|
980 |
TPhoneCmdParamAudioOutput audioOutput; |
|
981 |
audioOutput.SetAudioOutput( EPELoudspeaker ); |
|
982 |
m_adapter->ExecuteCommandL(EPhoneViewActivateAudioPathUIChanges, &audioOutput); |
|
983 |
QVERIFY( m_phoneButtonFlags == PhoneUIQtButtonsController::Ihf ); |
|
984 |
||
985 |
audioOutput.SetAudioOutput( EPEWiredAudioAccessory ); |
|
986 |
m_adapter->ExecuteCommandL(EPhoneViewActivateAudioPathUIChanges, &audioOutput); |
|
987 |
QVERIFY( m_phoneButtonFlags == PhoneUIQtButtonsController::Wired ); |
|
988 |
||
989 |
audioOutput.SetAudioOutput( EPEBTAudioAccessory ); |
|
990 |
m_adapter->ExecuteCommandL(EPhoneViewActivateAudioPathUIChanges, &audioOutput); |
|
991 |
QVERIFY( m_phoneButtonFlags == PhoneUIQtButtonsController::Btaa ); |
|
992 |
||
993 |
} |
|
994 |
||
995 |
void TestPhoneUIQtViewAdapter::testMuteRingToneOnAnswer () |
|
996 |
{ |
|
997 |
m_adapter->ExecuteCommandL(EPhoneViewMuteRingToneOnAnswer); |
|
998 |
QVERIFY( m_EPhoneViewMuteRingToneOnAnswer_called == true ); |
|
999 |
} |
|
1000 |
||
1001 |
void TestPhoneUIQtViewAdapter::testStopRingTone () |
|
1002 |
{ |
|
1003 |
m_adapter->ExecuteCommandL(EPhoneViewStopRingTone); |
|
1004 |
QVERIFY( m_EPhoneViewStopRingTone_called == true ); |
|
1005 |
} |
|
1006 |
||
1007 |
void TestPhoneUIQtViewAdapter::testMuteRingTone () |
|
1008 |
{ |
|
1009 |
m_adapter->ExecuteCommandL(EPhoneViewMuteRingTone); |
|
1010 |
QVERIFY( m_EPhoneViewMuteRingTone_called == true ); |
|
1011 |
} |
|
1012 |
||
1013 |
void TestPhoneUIQtViewAdapter::testPlayRingTone () |
|
1014 |
{ |
|
1015 |
TPhoneCmdParamRingTone ringToneParam; |
|
1016 |
m_adapter->ExecuteCommandL(EPhoneViewPlayRingTone, &ringToneParam); |
|
1017 |
QVERIFY( m_EPhoneViewPlayRingTone_called == true ); |
|
1018 |
} |
|
1019 |
||
1020 |
void TestPhoneUIQtViewAdapter::testShowGlobalNote () |
|
1021 |
{ |
|
1022 |
TPhoneCmdParamGlobalNote param; |
|
1023 |
m_adapter->ExecuteCommandL(EPhoneViewShowGlobalNote, ¶m); |
|
1024 |
QVERIFY( m_showGlobalNoteCalled == true ); |
|
1025 |
} |
|
1026 |
||
1027 |
void TestPhoneUIQtViewAdapter::testSetExpandActions() |
|
1028 |
{ |
|
1029 |
TPhoneCmdParamBoolean boolParam; |
|
1030 |
boolParam.SetBoolean( false ); |
|
1031 |
||
1032 |
m_callStateMap.clear(); |
|
1033 |
m_bubblesMap.clear(); |
|
1034 |
m_callStateMap.insert(0, EPEStateConnected); |
|
1035 |
m_callStateMap.insert(1, EPEStateHeld); |
|
1036 |
m_bubblesMap.insert(0, 0); |
|
1037 |
m_bubblesMap.insert(1, 1); |
|
1038 |
m_expandAction.clear(); |
|
1039 |
||
1040 |
m_adapter->ExecuteCommandL (EPhoneViewSetTouchPaneButtons, &boolParam); |
|
1041 |
QVERIFY(m_expandAction.contains(0)); |
|
1042 |
QVERIFY(m_expandAction[0]==EPhoneCmdUpdateUiControls); |
|
1043 |
QVERIFY(m_expandAction.contains(1)); |
|
1044 |
QVERIFY(m_expandAction[1]==EPhoneInCallCmdSwap); |
|
1045 |
} |
|
1046 |
||
1047 |
void TestPhoneUIQtViewAdapter::testShowDialpad () |
|
1048 |
{ |
|
1049 |
m_adapter->ExecuteCommandL(EPhoneViewOpenDialer); |
|
1050 |
QVERIFY( m_showDialpadCalled == true ); |
|
1051 |
} |
|
1052 |
||
1053 |
void TestPhoneUIQtViewAdapter::testDialpadVisibility () |
|
1054 |
{ |
|
1055 |
m_showDialpadCalled = false; |
|
1056 |
m_hideDialpadCalled = false; |
|
1057 |
||
1058 |
TPhoneCmdParamBoolean param; |
|
1059 |
param.SetBoolean(ETrue); |
|
1060 |
m_adapter->ExecuteCommandL(EPhoneViewSetNumberEntryVisible, ¶m); |
|
1061 |
QVERIFY( m_showDialpadCalled == true ); |
|
1062 |
QVERIFY( m_hideDialpadCalled == false ); |
|
1063 |
||
1064 |
m_showDialpadCalled = false; |
|
1065 |
m_hideDialpadCalled = false; |
|
1066 |
||
1067 |
param.SetBoolean(EFalse); |
|
1068 |
m_adapter->ExecuteCommandL(EPhoneViewSetNumberEntryVisible, ¶m); |
|
1069 |
QVERIFY( m_showDialpadCalled == false ); |
|
1070 |
QVERIFY( m_hideDialpadCalled == true ); |
|
1071 |
} |
|
1072 |
||
1073 |
void TestPhoneUIQtViewAdapter::removeAllCallHeaders() |
|
1074 |
{ |
|
1075 |
m_removeConferenceCalled = false; |
|
1076 |
m_removeCallHeaderCalled = false; |
|
1077 |
m_conferenceCallList.clear(); |
|
1078 |
m_conferenceCallList.append(0); |
|
1079 |
m_conferenceCallList.append(1); |
|
1080 |
||
1081 |
m_bubblesMap.clear(); |
|
1082 |
m_bubblesMap.insert(0,0); |
|
1083 |
m_bubblesMap.insert(1,1); |
|
1084 |
m_bubblesMap.insert(2,2); |
|
1085 |
m_bubblesMap.insert(7,3); |
|
1086 |
||
1087 |
m_callStateMap.clear(); |
|
1088 |
m_callStateMap.insert(0,0); |
|
1089 |
m_callStateMap.insert(1,1); |
|
1090 |
m_callStateMap.insert(2,2); |
|
1091 |
m_callStateMap.insert(7,3); |
|
1092 |
||
1093 |
m_adapter->ExecuteCommandL(EPhoneViewRemoveAllCallHeaders); |
|
1094 |
||
1095 |
QVERIFY(m_removeConferenceCalled); |
|
1096 |
QVERIFY(m_removeCallHeaderCalled); |
|
1097 |
} |
|
1098 |
||
1099 |
void TestPhoneUIQtViewAdapter::testRemoveDialpad () |
|
1100 |
{ |
|
1101 |
m_clearAndHideDialpadCalled = false; |
|
1102 |
||
1103 |
m_adapter->ExecuteCommandL(EPhoneViewRemoveNumberEntry); |
|
1104 |
QVERIFY( m_clearAndHideDialpadCalled == true ); |
|
1105 |
||
1106 |
m_clearAndHideDialpadCalled = false; |
|
1107 |
||
1108 |
m_adapter->ExecuteCommandL(EPhoneViewClearNumberEntryContent); |
|
1109 |
QVERIFY( m_clearAndHideDialpadCalled == true ); |
|
1110 |
} |
|
1111 |
||
1112 |
void TestPhoneUIQtViewAdapter::testGetDialpadStringLength () |
|
1113 |
{ |
|
1114 |
TPhoneCmdParamInteger integerParam; |
|
1115 |
||
1116 |
m_adapter->ExecuteCommandL(EPhoneViewGetNumberEntryCount, &integerParam ); |
|
1117 |
QVERIFY( integerParam.Integer() == 7 ); |
|
1118 |
||
1119 |
} |
|
1120 |
||
1121 |
void TestPhoneUIQtViewAdapter::testGetDialpadString () |
|
1122 |
{ |
|
1123 |
HBufC *numberEntryContent = 0; |
|
1124 |
||
1125 |
TRAP_IGNORE( numberEntryContent = HBufC::NewL( KPhoneNumberEntryBufferSize ) ); |
|
1126 |
if (numberEntryContent) { |
|
1127 |
TPtr ptr( numberEntryContent->Des() ); |
|
1128 |
ptr.Zero(); |
|
1129 |
||
1130 |
TPhoneCmdParamString stringParam; |
|
1131 |
stringParam.SetString( &ptr ); |
|
1132 |
m_adapter->ExecuteCommand( |
|
1133 |
EPhoneViewGetNumberFromEntry, |
|
1134 |
&stringParam ); |
|
1135 |
||
1136 |
QVERIFY( 0 == numberEntryContent->Des().Compare(_L("1234567")) ); |
|
1137 |
||
1138 |
TPtr ptr2( numberEntryContent->Des() ); |
|
1139 |
ptr2.Zero(); |
|
1140 |
TPhoneCmdParamString stringParam2; |
|
1141 |
stringParam2.SetString( &ptr2 ); |
|
1142 |
m_adapter->ExecuteCommandL( |
|
1143 |
EPhoneViewGetNumberFromEntry, |
|
1144 |
&stringParam2 ); |
|
1145 |
||
1146 |
QVERIFY( 0 == numberEntryContent->Des().Compare(_L("1234567")) ); |
|
1147 |
} |
|
1148 |
} |
|
1149 |
||
1150 |
void TestPhoneUIQtViewAdapter::testAddToConference() |
|
1151 |
{ |
|
1152 |
m_adapter->ExecuteCommandL(EPhoneViewAddToConference); |
|
1153 |
QVERIFY( m_addToConferenceBubbleCalled == true ); |
|
1154 |
||
1155 |
} |
|
1156 |
||
1157 |
void TestPhoneUIQtViewAdapter::testSetConferenceExpanded() |
|
1158 |
{ |
|
1159 |
m_adapter->ExecuteCommand(EPhoneSetConferenceExpanded); |
|
1160 |
QVERIFY( m_ExpandConferenceCalled == true ); |
|
1161 |
||
1162 |
} |
|
1163 |
||
1164 |
void TestPhoneUIQtViewAdapter::testSetMenuActions() |
|
1165 |
{ |
|
1166 |
m_setMenuActionsCalled = false; |
|
1167 |
m_isDialpadVisible = false; |
|
1168 |
TPhoneCmdParamBoolean boolParam; |
|
1169 |
boolParam.SetBoolean( false ); |
|
1170 |
||
1171 |
m_adapter->ExecuteCommandL (EPhoneViewSetTouchPaneButtons, &boolParam); |
|
1172 |
||
1173 |
QVERIFY(m_setMenuActionsCalled); |
|
1174 |
||
1175 |
m_setMenuActionsCalled = false; |
|
1176 |
m_isDialpadVisible = true; |
|
1177 |
m_adapter->ExecuteCommandL (EPhoneViewSetTouchPaneButtons, &boolParam); |
|
1178 |
QVERIFY(m_setMenuActionsCalled); |
|
1179 |
||
1180 |
m_dialpadText = QString(""); |
|
1181 |
m_setMenuActionsCalled = false; |
|
1182 |
m_isDialpadVisible = true; |
|
1183 |
m_adapter->ExecuteCommandL (EPhoneViewSetTouchPaneButtons, &boolParam); |
|
1184 |
QVERIFY(m_setMenuActionsCalled); |
|
1185 |
||
1186 |
connect(this, SIGNAL(dialpadAboutToClose()), m_adapter, SLOT(dialpadClosed())); |
|
1187 |
connect(this, SIGNAL(keyPressReleased(QKeyEvent*)), |
|
1188 |
m_adapter, SLOT(keyReleased(QKeyEvent*))); |
|
1189 |
||
1190 |
m_setMenuActionsCalled = false; |
|
1191 |
m_isDialpadVisible = true; |
|
1192 |
QKeyEvent keyEvent(QEvent::MouseButtonPress, 0, Qt::NoModifier); |
|
1193 |
||
1194 |
emit keyPressReleased(&keyEvent); |
|
1195 |
QVERIFY(m_setMenuActionsCalled); |
|
1196 |
||
1197 |
m_setMenuActionsCalled = false; |
|
1198 |
m_isDialpadVisible = false; |
|
1199 |
emit keyPressReleased(&keyEvent); |
|
1200 |
QVERIFY(false == m_setMenuActionsCalled); |
|
1201 |
||
1202 |
m_setMenuActionsCalled = false; |
|
1203 |
m_isDialpadVisible = true; |
|
1204 |
emit dialpadAboutToClose(); |
|
1205 |
QVERIFY(m_setMenuActionsCalled); |
|
1206 |
||
1207 |
m_setMenuActionsCalled = false; |
|
1208 |
emit keyPressReleased(&keyEvent); |
|
1209 |
QVERIFY(false == m_setMenuActionsCalled); |
|
1210 |
} |
|
1211 |
||
1212 |
void TestPhoneUIQtViewAdapter::testNoteController() |
|
1213 |
{ |
|
1214 |
m_showQueryCalled = false; |
|
1215 |
m_removeDtmfNoteCalled = false; |
|
1216 |
m_removeNoteCalled = false; |
|
1217 |
m_removeQueryCalled = false; |
|
1218 |
m_showNoteCalled = false; |
|
1219 |
m_removeGlobalWaitNoteCalled = false; |
|
1220 |
||
1221 |
QVERIFY( (0 != m_adapter->noteController()) ); |
|
1222 |
||
1223 |
m_adapter->ExecuteCommandL(EPhoneViewRemoveDtmfNote); |
|
1224 |
QVERIFY( m_removeDtmfNoteCalled == true ); |
|
1225 |
||
1226 |
m_adapter->ExecuteCommandL(EPhoneViewRemoveNote); |
|
1227 |
QVERIFY( m_removeNoteCalled == true ); |
|
1228 |
||
1229 |
m_adapter->ExecuteCommandL(EPhoneViewRemoveQuery); |
|
1230 |
QVERIFY( m_removeQueryCalled == true ); |
|
1231 |
||
1232 |
TPhoneCmdParamGlobalNote param; |
|
1233 |
m_adapter->ExecuteCommandL(EPhoneViewShowQuery, ¶m); |
|
1234 |
QVERIFY( m_showQueryCalled == true ); |
|
1235 |
||
1236 |
m_adapter->ExecuteCommandL(EPhoneViewShowNote, ¶m); |
|
1237 |
QVERIFY( m_showNoteCalled == true ); |
|
1238 |
||
1239 |
m_adapter->ExecuteCommandL(EPhoneViewRemoveGlobalNote); |
|
1240 |
QVERIFY( m_removeGlobalWaitNoteCalled == true ); |
|
1241 |
||
1242 |
m_removeGlobalWaitNoteCalled = false; |
|
1243 |
m_adapter->ExecuteCommandL(EPhoneViewRemoveGlobalWaitNote); |
|
1244 |
QVERIFY( m_removeGlobalWaitNoteCalled == true ); |
|
1245 |
||
1246 |
m_showQueryCalled = false; |
|
1247 |
m_removeDtmfNoteCalled = false; |
|
1248 |
m_removeNoteCalled = false; |
|
1249 |
m_removeQueryCalled = false; |
|
1250 |
m_showNoteCalled = false; |
|
1251 |
||
1252 |
m_adapter->ExecuteCommandL(EPhoneViewRemovePhoneDialogs); |
|
1253 |
QVERIFY( m_removeQueryCalled == true ); |
|
1254 |
QVERIFY( m_removeNoteCalled == true ); |
|
1255 |
||
1256 |
} |
|
1257 |
||
1258 |
void TestPhoneUIQtViewAdapter::testHsToForegroundAfterCall() |
|
1259 |
{ |
|
1260 |
TPhoneCmdParamBoolean booleanParam; |
|
1261 |
booleanParam.SetBoolean( ETrue ); |
|
1262 |
m_adapter->ExecuteCommand( EPhoneViewHsToForegroundAfterCall, |
|
1263 |
&booleanParam ); |
|
1264 |
} |
|
1265 |
||
1266 |
void TestPhoneUIQtViewAdapter::testCipheringInfoChange() |
|
1267 |
{ |
|
1268 |
m_bubble_id = 1; |
|
1269 |
TPhoneCmdParamCallHeaderData callHeader; |
|
1270 |
callHeader.SetCipheringIndicatorAllowed(true); |
|
1271 |
callHeader.SetCiphering(false); |
|
1272 |
m_adapter->ExecuteCommandL (EPhoneViewCipheringInfoChange, 1, &callHeader); |
|
1273 |
QVERIFY (m_startChangesCalled == true); |
|
1274 |
QVERIFY (m_setCipheringCalled == true); |
|
1275 |
QVERIFY (m_endChangesCalled == true); |
|
1276 |
m_setCipheringCalled = false; |
|
1277 |
m_bubble_id = -1; |
|
1278 |
m_adapter->ExecuteCommandL (EPhoneViewCipheringInfoChange, -1, &callHeader); |
|
1279 |
QVERIFY (m_setCipheringCalled == false); |
|
1280 |
} |
|
1281 |
||
1282 |
void TestPhoneUIQtViewAdapter::testSetHidden() |
|
1283 |
{ |
|
1284 |
m_adapter->ExecuteCommandL(EPhoneViewUpdateFSW); |
|
1285 |
} |
|
1286 |
||
1287 |
void TestPhoneUIQtViewAdapter::testBeginEndUiUpdate() |
|
1288 |
{ |
|
1289 |
m_adapter->ExecuteCommand(EPhoneViewBeginUpdate); |
|
1290 |
QVERIFY (m_startChangesCalled == true); |
|
1291 |
||
1292 |
m_adapter->ExecuteCommand(EPhoneViewEndUpdate); |
|
1293 |
QVERIFY (m_endChangesCalled == true); |
|
1294 |
} |
|
1295 |
||
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
1296 |
void TestPhoneUIQtViewAdapter::testIndicatorController() |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
1297 |
{ |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
1298 |
connect( this, SIGNAL(windowActivated()), m_adapter, SLOT(handleWindowActivated())); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
1299 |
connect( this, SIGNAL(windowDeactivated()), m_adapter, SLOT(handleWindowDeactivated())); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
1300 |
emit windowActivated(); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
1301 |
QVERIFY( m_disableCallIndCalled ); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
1302 |
emit windowDeactivated(); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
1303 |
QVERIFY( m_enableCallIndCalled ); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
1304 |
|
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
1305 |
} |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
1306 |
|
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
1307 |
void TestPhoneUIQtViewAdapter::testOpenLogs() |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
1308 |
{ |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
1309 |
m_ordinalPositionCalled = false; |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
1310 |
m_sendToBackgroundCalled = false; |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
1311 |
TPhoneCmdParamString param; |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
1312 |
m_adapter->ExecuteCommandL(EPhoneViewLaunchLogs, ¶m); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
1313 |
QVERIFY(m_ordinalPositionCalled); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
1314 |
QVERIFY(m_sendToBackgroundCalled); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
1315 |
} |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
1316 |
|
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
1317 |
void TestPhoneUIQtViewAdapter::testSetFlags() |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
1318 |
{ |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
1319 |
TPhoneCmdParamBoolean param; |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
1320 |
param.SetBoolean( ETrue ); |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
1321 |
m_phoneButtonFlags = 0; |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
1322 |
|
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
1323 |
m_adapter->ExecuteCommand(EPhoneViewSetBlueToothFlag,¶m); |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
1324 |
m_adapter->ExecuteCommand(EPhoneViewSetIhfFlag,¶m); |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
1325 |
m_adapter->ExecuteCommand(EPhoneViewSetMuteFlag,¶m); |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
1326 |
m_adapter->ExecuteCommand(EPhoneViewSetBluetoothAvailableFlag,¶m); |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
1327 |
|
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
1328 |
QVERIFY(m_phoneButtonFlags & PhoneUIQtButtonsController::Ihf); |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
1329 |
QVERIFY(m_phoneButtonFlags & PhoneUIQtButtonsController::Mute); |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
1330 |
QVERIFY(m_phoneButtonFlags & PhoneUIQtButtonsController::Btaa); |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
1331 |
QVERIFY(m_phoneButtonFlags & PhoneUIQtButtonsController::BluetoothAvailable); |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
1332 |
} |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
1333 |
|
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
1334 |
void TestPhoneUIQtViewAdapter::testCaptureEndKey() |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
1335 |
{ |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
1336 |
TPhoneCmdParamKeyCapture captureParam; |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
1337 |
captureParam.SetKeyCode( EKeyNo ); |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
1338 |
m_captured = false; |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
1339 |
m_capturedKey = Qt::Key_0; |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
1340 |
|
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
1341 |
m_adapter->ExecuteCommand(EPhoneViewStartCapturingKey,&captureParam); |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
1342 |
QVERIFY(m_captured); |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
1343 |
QVERIFY(m_capturedKey == Qt::Key_No); |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
1344 |
|
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
1345 |
m_adapter->ExecuteCommand(EPhoneViewStopCapturingKey,&captureParam); |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
1346 |
QVERIFY(false == m_captured); |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
1347 |
QVERIFY(m_capturedKey == Qt::Key_No); |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
1348 |
|
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
1349 |
m_capturedKey = Qt::Key_0; |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
1350 |
captureParam.SetKeyCode( EKeyYes ); |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
1351 |
|
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
1352 |
m_adapter->ExecuteCommand(EPhoneViewStartCapturingKey,&captureParam); |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
1353 |
QVERIFY(false == m_captured); |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
1354 |
QVERIFY(m_capturedKey == Qt::Key_0); |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
1355 |
|
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
1356 |
m_adapter->ExecuteCommand(EPhoneViewStopCapturingKey,&captureParam); |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
1357 |
QVERIFY(false == m_captured); |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
1358 |
QVERIFY(m_capturedKey == Qt::Key_0); |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
1359 |
} |
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
1360 |
|
37 | 1361 |
PHONE_QT_VIEW_ADAPTER_TEST_MAIN(TestPhoneUIQtViewAdapter) |
1362 |
#include "unit_tests.moc" |