author | hgs |
Mon, 23 Aug 2010 15:42:12 +0300 | |
changeset 60 | 1eef62f5c541 |
parent 46 | bc5a64e5bc3c |
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 Phone Services. |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
#include <QtTest/QtTest> |
|
19 |
#include "phoneservices.h" |
|
20 |
#include "dialservice.h" |
|
21 |
#include "dtmfservice.h" |
|
60 | 22 |
#include "dialservicedepricated.h" |
23 |
#include "dtmfservicedepricated.h" |
|
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
24 |
#include "urischemehandlerservice.h" |
37 | 25 |
|
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
26 |
bool g_dialServiceConstructed; |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
27 |
MPECallControlIF* g_dialServiceCallPointer; |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
28 |
MPECallSettersIF* g_dialServiceParameterPointer; |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
29 |
|
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
30 |
bool g_dtmfServiceConstructed; |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
31 |
MPECallControlIF* g_dtmfServiceCallPointer; |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
32 |
MPECallSettersIF* g_dtmfServiceParameterPointer; |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
33 |
|
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
34 |
bool g_uriSchemeHandlerServiceConstructed; |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
35 |
MPECallControlIF* g_uriSchemeServiceCallPointer; |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
36 |
MPECallSettersIF* g_uriSchemeServiceParameterPointer; |
37 | 37 |
|
38 |
class TestPhoneServices |
|
39 |
: |
|
40 |
public QObject, |
|
41 |
public MPECallControlIF, |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
42 |
public MPECallSettersIF |
37 | 43 |
{ |
44 |
Q_OBJECT |
|
45 |
public: |
|
46 |
TestPhoneServices(); |
|
47 |
virtual ~TestPhoneServices(); |
|
48 |
||
49 |
public slots: |
|
50 |
void initTestCase (); |
|
51 |
void cleanupTestCase (); |
|
52 |
void init (); |
|
53 |
void cleanup (); |
|
54 |
||
55 |
public: |
|
56 |
void SetKeyCode( const TChar& aKeyCode ); |
|
57 |
void SetPhoneNumber( const TPEPhoneNumber& aPhoneNumber ); |
|
58 |
void SetCallTypeCommand( const TPECallType& aCallType ); |
|
59 |
TInt HandleDialServiceCall( const TBool aClientCall = EFalse ); |
|
60 |
void HandlePlayDTMFL(); |
|
61 |
TInt HandleEndDTMF(); |
|
62 |
void SetContactId2( const TInt aContactId ); |
|
63 |
void SetServiceIdCommand( TUint32 aServiceId ); |
|
64 |
||
65 |
private slots: |
|
66 |
void testPhoneServiceStartup(); |
|
67 |
||
68 |
private: |
|
69 |
PhoneServices *m_phoneServices; // class under test |
|
70 |
bool m_setPhoneNumberCalled; |
|
71 |
bool m_setCallTypeCommandCalled; |
|
72 |
bool m_handleDialCallCalled; |
|
73 |
TPEPhoneNumber m_phoneNumber; |
|
74 |
TPECallType m_callType; |
|
75 |
bool m_clientCall; |
|
76 |
int m_contactId; |
|
77 |
bool m_setContactIdCalled; |
|
78 |
bool m_handleEndDTMFCalled; |
|
79 |
bool m_handlePlayDTMFLCalled; |
|
80 |
bool m_setKeyCodeCalled; |
|
81 |
ushort keyValue; |
|
82 |
}; |
|
83 |
||
84 |
DialService::DialService(MPECallControlIF &call, MPECallSettersIF ¶meters, QObject* parent) : |
|
85 |
XQServiceProvider(QLatin1String("com.nokia.symbian.ICallDial"), parent), m_call (call), m_parameters (parameters) |
|
86 |
{ |
|
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
87 |
g_dialServiceConstructed = true; |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
88 |
g_dialServiceCallPointer = &call; |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
89 |
g_dialServiceParameterPointer = ¶meters; |
37 | 90 |
} |
91 |
||
92 |
DialService::~DialService() |
|
93 |
{ |
|
94 |
} |
|
95 |
||
96 |
int DialService::dial(const QString& number) |
|
97 |
{ |
|
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
98 |
Q_UNUSED(number) |
37 | 99 |
return 0; |
100 |
} |
|
101 |
||
102 |
int DialService::dial(const QString& number, int contactId) |
|
103 |
{ |
|
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
104 |
Q_UNUSED(number) |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
105 |
Q_UNUSED (contactId) |
37 | 106 |
return 0; |
107 |
} |
|
108 |
||
60 | 109 |
int DialService::dialVideo(const QString& number) |
37 | 110 |
{ |
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
111 |
Q_UNUSED(number) |
37 | 112 |
} |
113 |
||
60 | 114 |
int DialService::dialVideo(const QString& number, int contactId) |
37 | 115 |
{ |
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
116 |
Q_UNUSED(number) |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
117 |
Q_UNUSED(contactId) |
37 | 118 |
} |
119 |
||
60 | 120 |
int DialService::dialVoip(const QString& address) |
37 | 121 |
{ |
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
122 |
Q_UNUSED(address) |
37 | 123 |
} |
124 |
||
60 | 125 |
int DialService::dialVoip(const QString& address, int contactId) |
37 | 126 |
{ |
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
127 |
Q_UNUSED(address) |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
128 |
Q_UNUSED(contactId) |
37 | 129 |
} |
130 |
||
60 | 131 |
int DialService::dialVoipService(const QString& address, int serviceId) |
37 | 132 |
{ |
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
133 |
Q_UNUSED(address) |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
134 |
Q_UNUSED(serviceId) |
37 | 135 |
} |
136 |
||
60 | 137 |
int DialService::dialVoipService( |
37 | 138 |
const QString& address, int serviceId, int contactId) |
139 |
{ |
|
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
140 |
Q_UNUSED(address) |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
141 |
Q_UNUSED(serviceId) |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
142 |
Q_UNUSED(contactId) |
37 | 143 |
} |
144 |
||
60 | 145 |
DialServiceDepricated::DialServiceDepricated(MPECallControlIF &call, MPECallSettersIF ¶meters, QObject* parent) : |
146 |
XQServiceProvider(QLatin1String("com.nokia.symbian.ICallDial"), parent), m_call (call), m_parameters (parameters) |
|
147 |
{ |
|
148 |
} |
|
149 |
||
150 |
DialServiceDepricated::~DialServiceDepricated() |
|
151 |
{ |
|
152 |
} |
|
153 |
||
154 |
int DialServiceDepricated::dial(const QString& number) |
|
155 |
{ |
|
156 |
Q_UNUSED(number) |
|
157 |
} |
|
158 |
||
159 |
int DialServiceDepricated::dial(const QString& number, int contactId) |
|
160 |
{ |
|
161 |
Q_UNUSED(number) |
|
162 |
Q_UNUSED(contactId) |
|
163 |
} |
|
164 |
||
165 |
void DialServiceDepricated::dialVideo(const QString& number) |
|
166 |
{ |
|
167 |
Q_UNUSED(number) |
|
168 |
} |
|
169 |
||
170 |
void DialServiceDepricated::dialVideo(const QString& number, int contactId) |
|
171 |
{ |
|
172 |
Q_UNUSED(number) |
|
173 |
Q_UNUSED(contactId) |
|
174 |
} |
|
175 |
||
176 |
void DialServiceDepricated::dialVoip(const QString& address) |
|
177 |
{ |
|
178 |
Q_UNUSED(address) |
|
179 |
} |
|
180 |
||
181 |
void DialServiceDepricated::dialVoip(const QString& address, int contactId) |
|
182 |
{ |
|
183 |
Q_UNUSED(address) |
|
184 |
Q_UNUSED(contactId) |
|
185 |
} |
|
186 |
||
187 |
void DialServiceDepricated::dialVoipService(const QString& address, int serviceId) |
|
188 |
{ |
|
189 |
Q_UNUSED(address) |
|
190 |
Q_UNUSED(serviceId) |
|
191 |
} |
|
192 |
||
193 |
void DialServiceDepricated::dialVoipService( |
|
194 |
const QString& address, int serviceId, int contactId) |
|
195 |
{ |
|
196 |
Q_UNUSED(address) |
|
197 |
Q_UNUSED(serviceId) |
|
198 |
Q_UNUSED(contactId) |
|
199 |
} |
|
200 |
||
201 |
QString DialServiceDepricated::modifyPhoneNumber(const QString &number) |
|
202 |
{ |
|
203 |
return number; |
|
204 |
} |
|
205 |
||
206 |
QString DialServiceDepricated::simplified(const QString &number) |
|
207 |
{ |
|
208 |
return number; |
|
209 |
} |
|
210 |
||
211 |
QString DialServiceDepricated::japanPrefixModifications(const QString &number) |
|
212 |
{ |
|
213 |
return number; |
|
214 |
} |
|
215 |
||
216 |
||
37 | 217 |
DTMFService::DTMFService(MPECallControlIF &call, MPECallSettersIF ¶meters, QObject* parent) : |
218 |
XQServiceProvider(QLatin1String("com.nokia.symbian.IDtmfPlay"), parent), m_call (call), m_parameters (parameters) |
|
219 |
{ |
|
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
220 |
g_dtmfServiceConstructed = true; |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
221 |
g_dtmfServiceCallPointer = &call; |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
222 |
g_dtmfServiceParameterPointer = ¶meters; |
37 | 223 |
} |
224 |
||
225 |
DTMFService::~DTMFService() |
|
226 |
{ |
|
227 |
} |
|
228 |
||
60 | 229 |
int DTMFService::playDTMFTone(const QChar& keyToPlay) |
37 | 230 |
{ |
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
231 |
Q_UNUSED(keyToPlay) |
37 | 232 |
} |
233 |
||
60 | 234 |
int DTMFService::stopDTMFPlay() |
37 | 235 |
{ |
236 |
} |
|
237 |
||
60 | 238 |
DTMFServiceDepricated::DTMFServiceDepricated( |
239 |
MPECallControlIF &call, |
|
240 |
MPECallSettersIF ¶meters, |
|
241 |
QObject* parent) |
|
242 |
: |
|
243 |
XQServiceProvider( |
|
244 |
QLatin1String("com.nokia.symbian.IDtmfPlay"), parent), |
|
245 |
m_call(call), |
|
246 |
m_parameters(parameters) |
|
247 |
{ |
|
248 |
||
249 |
} |
|
250 |
||
251 |
DTMFServiceDepricated::~DTMFServiceDepricated() |
|
252 |
{ |
|
253 |
} |
|
254 |
||
255 |
void DTMFServiceDepricated::playDTMFTone(const QChar& /*keyToPlay*/) |
|
256 |
{ |
|
257 |
} |
|
258 |
||
259 |
void DTMFServiceDepricated::stopDTMFPlay() |
|
260 |
{ |
|
261 |
||
262 |
} |
|
263 |
||
264 |
||
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
265 |
UriSchemeHandlerService::UriSchemeHandlerService( |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
266 |
MPECallControlIF &call, MPECallSettersIF ¶meters, QObject* parent) |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
267 |
: |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
268 |
XQServiceProvider( |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
269 |
QLatin1String("phoneui.com.nokia.symbian.IUriView"), parent), |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
270 |
m_callControlIf(call), |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
271 |
m_callParameters(parameters) |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
272 |
{ |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
273 |
g_uriSchemeHandlerServiceConstructed = true; |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
274 |
g_uriSchemeServiceCallPointer = &call; |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
275 |
g_uriSchemeServiceParameterPointer = ¶meters; |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
276 |
} |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
277 |
|
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
278 |
UriSchemeHandlerService::~UriSchemeHandlerService() |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
279 |
{ |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
280 |
|
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
281 |
} |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
282 |
|
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
283 |
bool UriSchemeHandlerService::view(const QString &uri) |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
284 |
{ |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
285 |
Q_UNUSED(uri) |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
286 |
return true; |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
287 |
} |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
288 |
|
37 | 289 |
TestPhoneServices::TestPhoneServices () |
290 |
{ |
|
291 |
} |
|
292 |
||
293 |
TestPhoneServices::~TestPhoneServices () |
|
294 |
{ |
|
295 |
} |
|
296 |
||
297 |
void TestPhoneServices::initTestCase () |
|
298 |
{ |
|
299 |
} |
|
300 |
||
301 |
void TestPhoneServices::cleanupTestCase () |
|
302 |
{ |
|
303 |
} |
|
304 |
||
305 |
void TestPhoneServices::init () |
|
306 |
{ |
|
307 |
m_setPhoneNumberCalled = false; |
|
308 |
m_setCallTypeCommandCalled = false; |
|
309 |
m_handleDialCallCalled = false; |
|
310 |
m_clientCall = false; |
|
311 |
m_setContactIdCalled = false; |
|
312 |
m_contactId = -1; |
|
313 |
m_handleEndDTMFCalled = false; |
|
314 |
m_handlePlayDTMFLCalled = false; |
|
315 |
m_setKeyCodeCalled = false; |
|
316 |
keyValue = -1; |
|
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
317 |
g_dialServiceConstructed = false; |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
318 |
g_dtmfServiceConstructed = false; |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
319 |
|
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
320 |
g_uriSchemeHandlerServiceConstructed = false; |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
321 |
g_uriSchemeServiceCallPointer = NULL; |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
322 |
g_uriSchemeServiceParameterPointer = NULL; |
37 | 323 |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
324 |
m_phoneServices = new PhoneServices(*this, *this, this); |
37 | 325 |
|
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
326 |
QVERIFY(g_dialServiceConstructed == true); |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
327 |
QVERIFY(g_dialServiceCallPointer == this); |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
328 |
QVERIFY(g_dialServiceParameterPointer == this); |
37 | 329 |
|
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
330 |
QVERIFY(g_dtmfServiceConstructed == true); |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
331 |
QVERIFY(g_dtmfServiceCallPointer == this); |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
332 |
QVERIFY(g_dtmfServiceParameterPointer == this); |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
333 |
|
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
334 |
QVERIFY(g_uriSchemeHandlerServiceConstructed == true); |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
335 |
QVERIFY(g_uriSchemeServiceCallPointer == this); |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
336 |
QVERIFY(g_uriSchemeServiceParameterPointer == this); |
37 | 337 |
} |
338 |
||
339 |
void TestPhoneServices::cleanup () |
|
340 |
{ |
|
341 |
delete m_phoneServices; |
|
342 |
} |
|
343 |
||
344 |
void TestPhoneServices::SetKeyCode( const TChar& aKeyCode ) |
|
345 |
{ |
|
346 |
m_setKeyCodeCalled = true; |
|
347 |
keyValue = aKeyCode; |
|
348 |
} |
|
349 |
||
350 |
void TestPhoneServices::SetPhoneNumber( const TPEPhoneNumber& aPhoneNumber ) |
|
351 |
{ |
|
352 |
m_setPhoneNumberCalled = true; |
|
353 |
m_phoneNumber = aPhoneNumber; |
|
354 |
} |
|
355 |
||
356 |
void TestPhoneServices::SetCallTypeCommand( const TPECallType& aCallType ) |
|
357 |
{ |
|
358 |
m_setCallTypeCommandCalled = true; |
|
359 |
m_callType = aCallType; |
|
360 |
} |
|
361 |
||
362 |
void TestPhoneServices::HandlePlayDTMFL() |
|
363 |
{ |
|
364 |
m_handlePlayDTMFLCalled = true; |
|
365 |
} |
|
366 |
||
367 |
TInt TestPhoneServices::HandleEndDTMF() |
|
368 |
{ |
|
369 |
m_handleEndDTMFCalled = true; |
|
370 |
return 0; |
|
371 |
} |
|
372 |
||
373 |
void TestPhoneServices::SetContactId2( const TInt aContactId ) |
|
374 |
{ |
|
375 |
m_setContactIdCalled = true; |
|
376 |
m_contactId = aContactId; |
|
377 |
} |
|
378 |
||
379 |
void TestPhoneServices::SetServiceIdCommand( TUint32 aServiceId ) |
|
380 |
{ |
|
381 |
Q_UNUSED(aServiceId) |
|
382 |
} |
|
383 |
||
384 |
TInt TestPhoneServices::HandleDialServiceCall( const TBool aClientCall ) |
|
385 |
{ |
|
386 |
m_handleDialCallCalled = true; |
|
387 |
m_clientCall = aClientCall; |
|
388 |
return KErrNone; |
|
389 |
} |
|
390 |
||
391 |
void TestPhoneServices::testPhoneServiceStartup() |
|
392 |
{ |
|
393 |
||
394 |
} |
|
395 |
||
396 |
QTEST_MAIN(TestPhoneServices) |
|
397 |
#include "unit_tests.moc" |