24
|
1 |
// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
|
|
2 |
// All rights reserved.
|
|
3 |
// This component and the accompanying materials are made available
|
|
4 |
// under the terms of "Eclipse Public License v1.0"
|
|
5 |
// which accompanies this distribution, and is available
|
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
7 |
//
|
|
8 |
// Initial Contributors:
|
|
9 |
// Nokia Corporation - initial contribution.
|
|
10 |
//
|
|
11 |
// Contributors:
|
|
12 |
//
|
|
13 |
// Description:
|
|
14 |
//
|
|
15 |
|
|
16 |
#include <e32test.h>
|
|
17 |
|
|
18 |
#include "TE_EtelMMTestStepBase.h"
|
|
19 |
#include "TE_mmphone.h"
|
|
20 |
#include "testdef.h"
|
|
21 |
#include "TE_mmcall.h"
|
|
22 |
#include <e32debug.h>
|
|
23 |
#include <s32file.h>
|
|
24 |
#include <f32file.h>
|
|
25 |
#include <etelmmerr.h>
|
|
26 |
|
|
27 |
|
|
28 |
CTestPhone::CTestPhone()
|
|
29 |
/** Each test step initialises it's own name
|
|
30 |
*/
|
|
31 |
{
|
|
32 |
// store the name of this test case
|
|
33 |
// this is the name that is used by the script file
|
|
34 |
SetTestStepName(_L("TestPhone"));
|
|
35 |
}
|
|
36 |
|
|
37 |
enum TVerdict CTestPhone::doTestStepL()
|
|
38 |
{
|
|
39 |
|
|
40 |
iTestCount=0;
|
|
41 |
INFO_PRINTF1(_L(""));
|
|
42 |
INFO_PRINTF1(_L("Test Mobile Phone Functionality"));
|
|
43 |
|
|
44 |
RMobilePhone mmPhone;
|
|
45 |
TInt ret=mmPhone.Open(iTelServer,DMMTSY_PHONE_NAME);
|
|
46 |
TEST(ret==KErrNone);
|
|
47 |
|
|
48 |
// local variables used throughout the phone tests
|
|
49 |
TRequestStatus reqStatus;
|
|
50 |
|
|
51 |
TestCapabilityL(mmPhone,reqStatus);
|
|
52 |
TestSimAccessL(mmPhone,reqStatus);
|
|
53 |
TestMobilePowerL(mmPhone,reqStatus);
|
|
54 |
TestMobileSignalL(mmPhone,reqStatus);
|
|
55 |
TestMobileIndicatorL(mmPhone,reqStatus);
|
|
56 |
TestMobileIdentityL(mmPhone,reqStatus);
|
|
57 |
TestMobileDTMFL(mmPhone,reqStatus);
|
|
58 |
TestMobileNetworkL(mmPhone,reqStatus);
|
|
59 |
TestMobileCellInfoL(mmPhone,reqStatus);
|
|
60 |
TestHSUPAMobileNetworkL(mmPhone,reqStatus);
|
|
61 |
TestTMobilePhoneNetworkInfoV8(reqStatus);
|
|
62 |
//TestMobileNetworkISVL(mmPhone,reqStatus);
|
|
63 |
TestMobilePrivacyL(mmPhone,reqStatus);
|
|
64 |
TestMobileCallServiceCapsL(mmPhone,reqStatus);
|
|
65 |
TestMobileUserNetworkL(mmPhone,reqStatus);
|
|
66 |
TestMobileCallForwardingL(mmPhone,reqStatus);
|
|
67 |
TestMobileIdentityServiceL(mmPhone,reqStatus);
|
|
68 |
TestMobileCallBarringL(mmPhone,reqStatus);
|
|
69 |
TestMobileCallWaitingL(mmPhone,reqStatus);
|
|
70 |
TestMobileCallCompletionL(mmPhone,reqStatus);
|
|
71 |
TestMobileAlternatingCallL(mmPhone,reqStatus);
|
|
72 |
TestMobileAlternateLineServiceL(mmPhone,reqStatus);
|
|
73 |
TestMobileCallCostL(mmPhone,reqStatus);
|
|
74 |
TestMobileSecurityL(mmPhone,reqStatus);
|
|
75 |
TestMobileMessageWaitingL(mmPhone,reqStatus);
|
|
76 |
TestMobileFixedDiallingNumbersL(mmPhone,reqStatus);
|
|
77 |
TestMobileMulticallSettings(mmPhone,reqStatus);
|
|
78 |
TestMobileIncomingCallTypes(mmPhone,reqStatus);
|
|
79 |
TestMobileUUSSetting(mmPhone,reqStatus);
|
|
80 |
TestMultimediaCallSettings(mmPhone,reqStatus);
|
|
81 |
TestNetworkSecurity(mmPhone,reqStatus);
|
|
82 |
TestUSimHandling(mmPhone,reqStatus);
|
|
83 |
TestMobileMailboxNumbersFunctionality(mmPhone, reqStatus);
|
|
84 |
TestMobileMmsFunctionality(mmPhone, reqStatus);
|
|
85 |
TestMobileAPNControlList(mmPhone, reqStatus);
|
|
86 |
TestMobileAPNControlListServiceStatus(mmPhone, reqStatus);
|
|
87 |
TestMobileAirTime(mmPhone, reqStatus);
|
|
88 |
TestTerminateAllCalls(mmPhone, reqStatus);
|
|
89 |
TestTerminateActiveCalls(mmPhone, reqStatus);
|
|
90 |
TestMobileAutoRedial(mmPhone, reqStatus);
|
|
91 |
TestMobilePersonalisation(mmPhone, reqStatus);
|
|
92 |
TestSmartCardHandling(mmPhone, reqStatus);
|
|
93 |
TestGBAAuthenticationL(mmPhone, reqStatus);
|
|
94 |
TestMBMSAuthenticationL(mmPhone, reqStatus);
|
|
95 |
TestWlanParametersL(mmPhone, reqStatus);
|
|
96 |
|
|
97 |
mmPhone.Close();
|
|
98 |
INFO_PRINTF1(_L(""));
|
|
99 |
return TestStepResult();
|
|
100 |
}
|
|
101 |
|
|
102 |
|
|
103 |
void CTestPhone::TestCapabilityL(RMobilePhone& aPhone, TRequestStatus &aReqStatus)
|
|
104 |
{
|
|
105 |
TUint32 caps;
|
|
106 |
TInt version;
|
|
107 |
|
|
108 |
iTestCount=1;
|
|
109 |
|
|
110 |
// Get Multimode API Version
|
|
111 |
TEST(aPhone.GetMultimodeAPIVersion(version)==KErrNone);
|
|
112 |
TEST(version==KEtelExtMultimodeV6);
|
|
113 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::GetMultimodeAPIVersion (sync) passed"), iTestCount++);
|
|
114 |
|
|
115 |
// Get Multimode capabilities
|
|
116 |
TEST(aPhone.GetMultimodeCaps(caps)==KErrNone);
|
|
117 |
TEST(caps==DMMTSY_PHONE_MULTIMODE_CAPS);
|
|
118 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::GetMultimodeCaps (sync) passed"), iTestCount++);
|
|
119 |
|
|
120 |
// Get Phone Store Info
|
|
121 |
RMobilePhoneStore::TMobilePhoneStoreInfoV1 asyncStoreInfo;
|
|
122 |
RMobilePhoneStore::TMobilePhoneStoreInfoV1Pckg asyncStoreInfoPckg(asyncStoreInfo);
|
|
123 |
|
|
124 |
TBuf<32> storeName1(DMMTSY_PHONE_STORE_NAME1);
|
|
125 |
TBuf<32> iccType1(DMMTSY_PHONEBOOK_TYPE);
|
|
126 |
aPhone.GetPhoneStoreInfo(aReqStatus,asyncStoreInfoPckg,storeName1,iccType1);
|
|
127 |
User::WaitForRequest(aReqStatus);
|
|
128 |
TEST(aReqStatus.Int() == KErrNone);
|
|
129 |
ValidatePhoneStoreInfo(asyncStoreInfo,0);
|
|
130 |
|
|
131 |
TEST(asyncStoreInfo.ExtensionId()==RMobilePhoneStore::KETelMobilePhoneStoreV1);
|
|
132 |
|
|
133 |
TBuf<32> storeName2(DMMTSY_PHONE_STORE_NAME2);
|
|
134 |
aPhone.GetPhoneStoreInfo(aReqStatus,asyncStoreInfoPckg,storeName2);
|
|
135 |
User::WaitForRequest(aReqStatus);
|
|
136 |
TEST(aReqStatus.Int() == KErrNone);
|
|
137 |
ValidatePhoneStoreInfo(asyncStoreInfo,1);
|
|
138 |
|
|
139 |
aPhone.GetPhoneStoreInfo(aReqStatus, asyncStoreInfoPckg, storeName2);
|
|
140 |
aPhone.CancelAsyncRequest(EMobilePhoneGetPhoneStoreInfo);
|
|
141 |
User::WaitForRequest(aReqStatus);
|
|
142 |
TEST(aReqStatus.Int()==KErrNone || aReqStatus.Int()==KErrCancel);
|
|
143 |
if (aReqStatus.Int() == KErrCancel)
|
|
144 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::GetPhoneStoreInfo (async & cancel (Cancelled Requests)) passed"), iTestCount++);
|
|
145 |
else
|
|
146 |
{
|
|
147 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::GetPhoneStoreInfo (async & cancel (Request Not Cancelled)) passed"), iTestCount++);
|
|
148 |
ValidatePhoneStoreInfo(asyncStoreInfo,1);
|
|
149 |
}
|
|
150 |
|
|
151 |
// test.Next(_L("OK: RMobilePhone's MobilePhoneCapability"));
|
|
152 |
}
|
|
153 |
|
|
154 |
void CTestPhone::TestSimAccessL(RMobilePhone& aPhone, TRequestStatus &aReqStatus)
|
|
155 |
{
|
|
156 |
// Get SIM access capabilities
|
|
157 |
|
|
158 |
TUint32 caps;
|
|
159 |
|
|
160 |
TEST(aPhone.GetIccAccessCaps(caps)==KErrNone);
|
|
161 |
TEST(caps==DMMTSY_PHONE_SIM_ACCESS_CAPS1);
|
|
162 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::GetIccAccessCaps (sync) passed"), iTestCount++);
|
|
163 |
|
|
164 |
// Notify change of SIM access capabilities
|
|
165 |
|
|
166 |
// asynchronous
|
|
167 |
|
|
168 |
aPhone.NotifyIccAccessCapsChange(aReqStatus, caps);
|
|
169 |
User::WaitForRequest(aReqStatus);
|
|
170 |
TEST(aReqStatus.Int()==KErrNone);
|
|
171 |
TEST(caps==DMMTSY_PHONE_SIM_ACCESS_CAPS2);
|
|
172 |
|
|
173 |
// asynchronous & cancel
|
|
174 |
|
|
175 |
aPhone.NotifyIccAccessCapsChange(aReqStatus, caps);
|
|
176 |
aPhone.CancelAsyncRequest(EMobilePhoneNotifyIccAccessCapsChange);
|
|
177 |
User::WaitForRequest(aReqStatus);
|
|
178 |
TEST(aReqStatus.Int()==KErrNone || aReqStatus.Int()==KErrCancel);
|
|
179 |
|
|
180 |
if (aReqStatus.Int()==KErrCancel)
|
|
181 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::NotifyIccAccessCapsChange (async & cancel (Cancelled Request)) passed"), iTestCount++);
|
|
182 |
else
|
|
183 |
{
|
|
184 |
TEST(caps==DMMTSY_PHONE_SIM_ACCESS_CAPS2);
|
|
185 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::NotifyIccAccessCapsChange (async & cancel (Request Not Cancelled)) passed"), iTestCount++);
|
|
186 |
}
|
|
187 |
|
|
188 |
// Get ICC identity
|
|
189 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::GetIccIdentity."), iTestCount++);
|
|
190 |
RMobilePhone::TIccIdentity id;
|
|
191 |
aPhone.GetIccIdentity(aReqStatus, id);
|
|
192 |
User::WaitForRequest(aReqStatus);
|
|
193 |
TEST(aReqStatus.Int()==KErrNone);
|
|
194 |
TEST(id == DMMTSY_PHONE_ICC_ID);
|
|
195 |
|
|
196 |
// Get ICC identity & Cancel
|
|
197 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::GetIccIdentity & Cancel."), iTestCount++);
|
|
198 |
aPhone.GetIccIdentity(aReqStatus, id);
|
|
199 |
aPhone.CancelAsyncRequest(EMobilePhoneGetIccIdentity);
|
|
200 |
User::WaitForRequest(aReqStatus);
|
|
201 |
TEST(aReqStatus.Int()==KErrCancel);
|
|
202 |
|
|
203 |
//
|
|
204 |
|
|
205 |
// Get Customer Service Profile - both synchronously & asynchronously
|
|
206 |
|
|
207 |
// asynchronous
|
|
208 |
|
|
209 |
RMobilePhone::TMobilePhoneCspFileV1 asyncCspFile;
|
|
210 |
RMobilePhone::TMobilePhoneCspFileV1Pckg asyncCspFilePckg(asyncCspFile);
|
|
211 |
|
|
212 |
aPhone.GetCustomerServiceProfile(aReqStatus, asyncCspFilePckg);
|
|
213 |
User::WaitForRequest(aReqStatus);
|
|
214 |
TEST(aReqStatus.Int()==KErrNone);
|
|
215 |
|
|
216 |
// extract the returned CSP file from the package
|
|
217 |
asyncCspFile=asyncCspFilePckg();
|
|
218 |
|
|
219 |
ValidateCustomerServiceProfile(asyncCspFile);
|
|
220 |
TEST(asyncCspFile.ExtensionId()==KETelExtMultimodeV1);
|
|
221 |
|
|
222 |
aPhone.GetCustomerServiceProfile(aReqStatus, asyncCspFilePckg);
|
|
223 |
aPhone.CancelAsyncRequest(EMobilePhoneGetCustomerServiceProfile);
|
|
224 |
User::WaitForRequest(aReqStatus);
|
|
225 |
TEST(aReqStatus.Int()==KErrNone || aReqStatus.Int()==KErrCancel);
|
|
226 |
|
|
227 |
if (aReqStatus.Int()==KErrCancel)
|
|
228 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::GetCustomerServiceProfile (async & cancel (Cancelled Request) passed"), iTestCount++);
|
|
229 |
else
|
|
230 |
{
|
|
231 |
asyncCspFile=asyncCspFilePckg();
|
|
232 |
ValidateCustomerServiceProfile(asyncCspFile);
|
|
233 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::GetCustomerServiceProfile (async & cancel (Request Not Cancelled) passed"), iTestCount++);
|
|
234 |
}
|
|
235 |
|
|
236 |
// Get SIM Service Table
|
|
237 |
|
|
238 |
// asynchronous
|
|
239 |
|
|
240 |
RMobilePhone::TMobilePhoneServiceTableV1 asyncSstFile;
|
|
241 |
RMobilePhone::TMobilePhoneServiceTableV1Pckg asyncSstFilePckg(asyncSstFile);
|
|
242 |
RMobilePhone::TMobilePhoneServiceTable serviceTableType=DMMTSY_PHONE_SERVICE_TABLE;
|
|
243 |
|
|
244 |
aPhone.GetServiceTable(aReqStatus, serviceTableType, asyncSstFilePckg);
|
|
245 |
User::WaitForRequest(aReqStatus);
|
|
246 |
TEST(aReqStatus.Int()==KErrNone);
|
|
247 |
|
|
248 |
// extract the returned SST file from the package
|
|
249 |
asyncSstFile=asyncSstFilePckg();
|
|
250 |
ValidateServiceTable(asyncSstFile);
|
|
251 |
TEST(asyncSstFile.ExtensionId()==KETelExtMultimodeV1);
|
|
252 |
|
|
253 |
// asynchronous & cancel
|
|
254 |
|
|
255 |
aPhone.GetServiceTable(aReqStatus, serviceTableType, asyncSstFilePckg);
|
|
256 |
aPhone.CancelAsyncRequest(EMobilePhoneGetServiceTable);
|
|
257 |
User::WaitForRequest(aReqStatus);
|
|
258 |
TEST(aReqStatus.Int()==KErrNone || aReqStatus.Int()==KErrCancel);
|
|
259 |
|
|
260 |
if (aReqStatus.Int()==KErrCancel)
|
|
261 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::GetServiceTable (async & cancel (Cancelled Request)) passed"), iTestCount++);
|
|
262 |
else
|
|
263 |
{
|
|
264 |
// extract the returned SST file from the package
|
|
265 |
asyncSstFile=asyncSstFilePckg();
|
|
266 |
ValidateServiceTable(asyncSstFile);
|
|
267 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::GetServiceTable (async & cancel (Request Not Cancelled)) passed"), iTestCount++);
|
|
268 |
}
|
|
269 |
|
|
270 |
// asynchronous
|
|
271 |
|
|
272 |
RMobilePhone::TMobilePhoneServiceTableV2 asyncSstV2File;
|
|
273 |
RMobilePhone::TMobilePhoneServiceTableV2Pckg asyncSstV2FilePckg(asyncSstV2File);
|
|
274 |
|
|
275 |
aPhone.GetServiceTable(aReqStatus, serviceTableType, asyncSstV2FilePckg);
|
|
276 |
User::WaitForRequest(aReqStatus);
|
|
277 |
TEST(aReqStatus.Int()==KErrNone);
|
|
278 |
|
|
279 |
// extract the returned SST file from the package
|
|
280 |
asyncSstV2File=asyncSstV2FilePckg();
|
|
281 |
ValidateServiceTable(asyncSstV2File);
|
|
282 |
TEST(asyncSstV2File.ExtensionId()==KETelExtMultimodeV2);
|
|
283 |
|
|
284 |
// asynchronous & cancel
|
|
285 |
|
|
286 |
aPhone.GetServiceTable(aReqStatus, serviceTableType, asyncSstV2FilePckg);
|
|
287 |
aPhone.CancelAsyncRequest(EMobilePhoneGetServiceTable);
|
|
288 |
User::WaitForRequest(aReqStatus);
|
|
289 |
TEST(aReqStatus.Int()==KErrNone || aReqStatus.Int()==KErrCancel);
|
|
290 |
|
|
291 |
if (aReqStatus.Int()==KErrCancel)
|
|
292 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::GetServiceTable V2table (async & cancel (Cancelled Request)) passed"), iTestCount++);
|
|
293 |
else
|
|
294 |
{
|
|
295 |
// extract the returned SST file from the package
|
|
296 |
asyncSstFile=asyncSstFilePckg();
|
|
297 |
ValidateServiceTable(asyncSstV2File);
|
|
298 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::GetServiceTable V2table (async & cancel (Request Not Cancelled)) passed"), iTestCount++);
|
|
299 |
}
|
|
300 |
|
|
301 |
// test.Next(_L("OK: RMobilePhone's MobilePhoneSimAccess"));
|
|
302 |
}
|
|
303 |
|
|
304 |
void CTestPhone::TestMobilePowerL(RMobilePhone& aPhone, TRequestStatus &aReqStatus)
|
|
305 |
{
|
|
306 |
// Get Battery Caps
|
|
307 |
|
|
308 |
TUint32 caps;
|
|
309 |
|
|
310 |
TEST(aPhone.GetBatteryCaps(caps)==KErrNone);
|
|
311 |
TEST(caps==DMMTSY_PHONE_BATTERY_CAPS);
|
|
312 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::GetBatteryCaps (sync) passed"), iTestCount++);
|
|
313 |
|
|
314 |
// asynchronous
|
|
315 |
|
|
316 |
RMobilePhone::TMobilePhoneBatteryInfoV1 asyncBatteryInfo;
|
|
317 |
|
|
318 |
aPhone.GetBatteryInfo(aReqStatus, asyncBatteryInfo);
|
|
319 |
User::WaitForRequest(aReqStatus);
|
|
320 |
TEST(aReqStatus.Int()==KErrNone);
|
|
321 |
TEST(asyncBatteryInfo.iStatus==DMMTSY_PHONE_BATTERY_STATUS1);
|
|
322 |
TEST(asyncBatteryInfo.iChargeLevel==DMMTSY_PHONE_BATTERY_CHARGE1);
|
|
323 |
|
|
324 |
// asynchronous & cancel
|
|
325 |
|
|
326 |
aPhone.GetBatteryInfo(aReqStatus, asyncBatteryInfo);
|
|
327 |
aPhone.CancelAsyncRequest(EMobilePhoneGetBatteryInfo);
|
|
328 |
User::WaitForRequest(aReqStatus);
|
|
329 |
TEST(aReqStatus.Int()==KErrNone || aReqStatus.Int()==KErrCancel);
|
|
330 |
if (aReqStatus.Int()==KErrCancel)
|
|
331 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::GetBatteryInfo (async & cancel (Cancelled Request)) passed"), iTestCount++);
|
|
332 |
else
|
|
333 |
{
|
|
334 |
TEST(asyncBatteryInfo.iStatus==DMMTSY_PHONE_BATTERY_STATUS1);
|
|
335 |
TEST(asyncBatteryInfo.iChargeLevel==DMMTSY_PHONE_BATTERY_CHARGE1);
|
|
336 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::GetBatteryInfo (async & cancel (Request Not Cancelled)) passed"), iTestCount++);
|
|
337 |
}
|
|
338 |
|
|
339 |
// Notify change of battery info
|
|
340 |
|
|
341 |
// asynchronous
|
|
342 |
|
|
343 |
aPhone.NotifyBatteryInfoChange(aReqStatus, asyncBatteryInfo);
|
|
344 |
User::WaitForRequest(aReqStatus);
|
|
345 |
TEST(aReqStatus.Int()==KErrNone);
|
|
346 |
TEST(asyncBatteryInfo.iStatus==DMMTSY_PHONE_BATTERY_STATUS2);
|
|
347 |
TEST(asyncBatteryInfo.iChargeLevel==DMMTSY_PHONE_BATTERY_CHARGE2);
|
|
348 |
|
|
349 |
// asynchronous & cancel
|
|
350 |
|
|
351 |
aPhone.NotifyBatteryInfoChange(aReqStatus, asyncBatteryInfo);
|
|
352 |
aPhone.CancelAsyncRequest(EMobilePhoneNotifyBatteryInfoChange);
|
|
353 |
User::WaitForRequest(aReqStatus);
|
|
354 |
TEST(aReqStatus.Int()==KErrNone || aReqStatus.Int()==KErrCancel);
|
|
355 |
if (aReqStatus.Int()==KErrCancel)
|
|
356 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::NotifyBatteryInfoChange (async & cancel (Cancelled Request)) passed"), iTestCount++);
|
|
357 |
else
|
|
358 |
{
|
|
359 |
TEST(asyncBatteryInfo.iStatus==DMMTSY_PHONE_BATTERY_STATUS2);
|
|
360 |
TEST(asyncBatteryInfo.iChargeLevel==DMMTSY_PHONE_BATTERY_CHARGE2);
|
|
361 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::NotifyBatteryInfoChange (async & cancel (Request Not Cancelled)) passed"), iTestCount++);
|
|
362 |
}
|
|
363 |
|
|
364 |
// test.Next(_L("OK: RMobilePhone's MobilePhonePower"));
|
|
365 |
}
|
|
366 |
|
|
367 |
void CTestPhone::TestMobileSignalL(RMobilePhone& aPhone, TRequestStatus &aReqStatus)
|
|
368 |
{
|
|
369 |
// Get Signal Caps
|
|
370 |
|
|
371 |
TUint32 caps;
|
|
372 |
|
|
373 |
TEST(aPhone.GetSignalCaps(caps)==KErrNone);
|
|
374 |
TEST(caps==DMMTSY_PHONE_SIGNAL_CAPS);
|
|
375 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::GetSignalCaps (sync) passed"), iTestCount++);
|
|
376 |
|
|
377 |
// Get Signal Strength Info
|
|
378 |
|
|
379 |
// asynchronous
|
|
380 |
|
|
381 |
TInt32 asyncSigStrength;
|
|
382 |
TInt8 asyncSigBar;
|
|
383 |
|
|
384 |
aPhone.GetSignalStrength(aReqStatus, asyncSigStrength, asyncSigBar);
|
|
385 |
User::WaitForRequest(aReqStatus);
|
|
386 |
TEST(aReqStatus.Int()==KErrNone);
|
|
387 |
TEST(asyncSigStrength==DMMTSY_PHONE_SIGNAL_STRENGTH1);
|
|
388 |
TEST(asyncSigBar==DMMTSY_PHONE_SIGNAL_BAR1);
|
|
389 |
|
|
390 |
// asynchronous & cancel
|
|
391 |
|
|
392 |
aPhone.GetSignalStrength(aReqStatus, asyncSigStrength, asyncSigBar);
|
|
393 |
aPhone.CancelAsyncRequest(EMobilePhoneGetSignalStrength);
|
|
394 |
User::WaitForRequest(aReqStatus);
|
|
395 |
TEST(aReqStatus.Int()==KErrNone || aReqStatus.Int()==KErrCancel);
|
|
396 |
if (aReqStatus.Int()==KErrCancel)
|
|
397 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::GetSignalStrength (async & cancel (Cancelled Request)) passed"), iTestCount++);
|
|
398 |
else
|
|
399 |
{
|
|
400 |
TEST(asyncSigStrength==DMMTSY_PHONE_SIGNAL_STRENGTH1);
|
|
401 |
TEST(asyncSigBar==DMMTSY_PHONE_SIGNAL_BAR1);
|
|
402 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::GetSignalStrength (async & cancel (Request Not Cancelled)) passed"), iTestCount++);
|
|
403 |
}
|
|
404 |
|
|
405 |
// Notify change of signal strength
|
|
406 |
|
|
407 |
// asynchronous
|
|
408 |
|
|
409 |
aPhone.NotifySignalStrengthChange(aReqStatus, asyncSigStrength, asyncSigBar);
|
|
410 |
User::WaitForRequest(aReqStatus);
|
|
411 |
TEST(aReqStatus.Int()==KErrNone);
|
|
412 |
TEST(asyncSigStrength==DMMTSY_PHONE_SIGNAL_STRENGTH2);
|
|
413 |
TEST(asyncSigBar==DMMTSY_PHONE_SIGNAL_BAR2);
|
|
414 |
|
|
415 |
// asynchronous & cancel
|
|
416 |
|
|
417 |
aPhone.NotifySignalStrengthChange(aReqStatus, asyncSigStrength, asyncSigBar);
|
|
418 |
aPhone.CancelAsyncRequest(EMobilePhoneNotifySignalStrengthChange);
|
|
419 |
User::WaitForRequest(aReqStatus);
|
|
420 |
TEST(aReqStatus.Int()==KErrNone || aReqStatus.Int()==KErrCancel);
|
|
421 |
if (aReqStatus.Int()==KErrCancel)
|
|
422 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::NotifySignalStrengthChange (async & cancel (Cancelled Request)) passed"), iTestCount++);
|
|
423 |
else
|
|
424 |
{
|
|
425 |
TEST(asyncSigStrength==DMMTSY_PHONE_SIGNAL_STRENGTH2);
|
|
426 |
TEST(asyncSigBar==DMMTSY_PHONE_SIGNAL_BAR2);
|
|
427 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::NotifySignalStrengthChange (async & cancel (Request Not Cancelled)) passed"), iTestCount++);
|
|
428 |
}
|
|
429 |
|
|
430 |
// test.Next(_L("OK: RMobilePhone's MobilePhoneSignal"));
|
|
431 |
}
|
|
432 |
|
|
433 |
void CTestPhone::TestMobileIndicatorL(RMobilePhone& aPhone, TRequestStatus &aReqStatus)
|
|
434 |
{
|
|
435 |
// Get Signal Caps
|
|
436 |
|
|
437 |
TUint32 actionCaps;
|
|
438 |
TUint32 indCaps;
|
|
439 |
|
|
440 |
TEST(aPhone.GetIndicatorCaps(actionCaps, indCaps)==KErrNone);
|
|
441 |
TEST(actionCaps==DMMTSY_PHONE_ACTION_INDICATOR_CAPS);
|
|
442 |
TEST(indCaps==DMMTSY_PHONE_INDICATOR_CAPS);
|
|
443 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::GetIndicatorCaps (sync) passed"), iTestCount++);
|
|
444 |
|
|
445 |
// Get Signal Strength Info
|
|
446 |
|
|
447 |
// asynchronous
|
|
448 |
|
|
449 |
TUint32 asyncIndicator;
|
|
450 |
|
|
451 |
aPhone.GetIndicator(aReqStatus, asyncIndicator);
|
|
452 |
User::WaitForRequest(aReqStatus);
|
|
453 |
TEST(aReqStatus.Int()==KErrNone);
|
|
454 |
TEST(asyncIndicator==DMMTSY_PHONE_INDICATOR1);
|
|
455 |
|
|
456 |
// asynchronous & cancel
|
|
457 |
|
|
458 |
aPhone.GetIndicator(aReqStatus, asyncIndicator);
|
|
459 |
aPhone.CancelAsyncRequest(EMobilePhoneGetIndicator);
|
|
460 |
User::WaitForRequest(aReqStatus);
|
|
461 |
TEST(aReqStatus.Int()==KErrNone || aReqStatus.Int()==KErrCancel);
|
|
462 |
if (aReqStatus.Int()==KErrCancel)
|
|
463 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::GetIndicator (async & cancel (Cancelled Request)) passed"), iTestCount++);
|
|
464 |
else
|
|
465 |
{
|
|
466 |
TEST(asyncIndicator==DMMTSY_PHONE_INDICATOR1);
|
|
467 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::GetIndicator (async & cancel (Request Not Cancelled)) passed"), iTestCount++);
|
|
468 |
}
|
|
469 |
|
|
470 |
// Notify change of signal strength
|
|
471 |
|
|
472 |
// asynchronous
|
|
473 |
|
|
474 |
aPhone.NotifyIndicatorChange(aReqStatus, asyncIndicator);
|
|
475 |
User::WaitForRequest(aReqStatus);
|
|
476 |
TEST(aReqStatus.Int()==KErrNone);
|
|
477 |
TEST(asyncIndicator==DMMTSY_PHONE_INDICATOR2);
|
|
478 |
|
|
479 |
// asynchronous & cancel
|
|
480 |
|
|
481 |
aPhone.NotifyIndicatorChange(aReqStatus, asyncIndicator);
|
|
482 |
aPhone.CancelAsyncRequest(EMobilePhoneNotifyIndicatorChange);
|
|
483 |
User::WaitForRequest(aReqStatus);
|
|
484 |
TEST(aReqStatus.Int()==KErrNone || aReqStatus.Int()==KErrCancel);
|
|
485 |
if (aReqStatus.Int()==KErrCancel)
|
|
486 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::NotifyIndicatorChange (async & cancel (Cancelled Request)) passed"), iTestCount++);
|
|
487 |
else
|
|
488 |
{
|
|
489 |
TEST(asyncIndicator==DMMTSY_PHONE_INDICATOR2);
|
|
490 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::NotifyIndicatorChange (async & cancel (Request Not Cancelled)) passed"), iTestCount++);
|
|
491 |
}
|
|
492 |
|
|
493 |
// test.Next(_L("OK: RMobilePhone's MobilePhoneIndicator"));
|
|
494 |
}
|
|
495 |
|
|
496 |
void CTestPhone::TestMobileIdentityL(RMobilePhone& aPhone, TRequestStatus &aReqStatus)
|
|
497 |
{
|
|
498 |
// Get Identity Caps
|
|
499 |
|
|
500 |
TUint32 caps;
|
|
501 |
|
|
502 |
TEST(aPhone.GetIdentityCaps(caps)==KErrNone);
|
|
503 |
TEST(caps==DMMTSY_PHONE_IDENTITY_CAPS);
|
|
504 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::GetIdentityCaps (sync) passed"), iTestCount++);
|
|
505 |
|
|
506 |
// Phone ID
|
|
507 |
RMobilePhone::TMobilePhoneIdentityV1 asyncPhoneId;
|
|
508 |
|
|
509 |
// asynchronous
|
|
510 |
|
|
511 |
aPhone.GetPhoneId(aReqStatus,asyncPhoneId);
|
|
512 |
User::WaitForRequest(aReqStatus);
|
|
513 |
TEST(aReqStatus.Int()==KErrNone);
|
|
514 |
ValidatePhoneId(asyncPhoneId);
|
|
515 |
|
|
516 |
// asynchronous & cancel
|
|
517 |
|
|
518 |
aPhone.GetPhoneId(aReqStatus,asyncPhoneId);
|
|
519 |
aPhone.CancelAsyncRequest(EMobilePhoneGetPhoneId);
|
|
520 |
User::WaitForRequest(aReqStatus);
|
|
521 |
TEST(aReqStatus.Int()==KErrNone || aReqStatus.Int()==KErrCancel);
|
|
522 |
if (aReqStatus.Int()==KErrCancel)
|
|
523 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::GetPhoneId (sync & async & cancel (Cancelled Request)) passed"), iTestCount++);
|
|
524 |
else
|
|
525 |
{
|
|
526 |
ValidatePhoneId(asyncPhoneId);
|
|
527 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::GetPhoneId (sync & async & cancel (Request Not Cancelled)) passed"), iTestCount++);
|
|
528 |
}
|
|
529 |
|
|
530 |
|
|
531 |
// Subscriber ID - IMSI retrieval
|
|
532 |
RMobilePhone::TMobilePhoneSubscriberId asyncSubId;
|
|
533 |
|
|
534 |
// asynchronous
|
|
535 |
|
|
536 |
aPhone.GetSubscriberId(aReqStatus,asyncSubId);
|
|
537 |
User::WaitForRequest(aReqStatus);
|
|
538 |
TEST(aReqStatus.Int()==KErrNone);
|
|
539 |
TEST(asyncSubId.Compare(DMMTSY_PHONE_SUBSCRIBER_ID)==0);
|
|
540 |
|
|
541 |
// asynchronous & cancel
|
|
542 |
|
|
543 |
aPhone.GetSubscriberId(aReqStatus,asyncSubId);
|
|
544 |
aPhone.CancelAsyncRequest(EMobilePhoneGetSubscriberId);
|
|
545 |
User::WaitForRequest(aReqStatus);
|
|
546 |
TEST(aReqStatus.Int()==KErrNone || aReqStatus.Int()==KErrCancel);
|
|
547 |
if (aReqStatus.Int()==KErrCancel)
|
|
548 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::GetSubscriberId (sync & async & cancel (Cancelled Request)) passed"), iTestCount++);
|
|
549 |
else
|
|
550 |
{
|
|
551 |
TEST(asyncSubId.Compare(DMMTSY_PHONE_SUBSCRIBER_ID)==0);
|
|
552 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::GetSubscriberId (sync & async & cancel (Request Not Cancelled)) passed"), iTestCount++);
|
|
553 |
}
|
|
554 |
|
|
555 |
// test.Next(_L("OK: RMobilePhone's MobilePhoneIdentity"));
|
|
556 |
}
|
|
557 |
|
|
558 |
void CTestPhone::TestMobileDTMFL(RMobilePhone& aPhone, TRequestStatus &aReqStatus)
|
|
559 |
{
|
|
560 |
// Get DTMF caps
|
|
561 |
|
|
562 |
TUint32 caps;
|
|
563 |
|
|
564 |
TEST(aPhone.GetDTMFCaps(caps)==KErrNone);
|
|
565 |
TEST(caps==DMMTSY_PHONE_DTMF_CAPS1);
|
|
566 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::GetDTMFCaps (sync) passed"), iTestCount++);
|
|
567 |
|
|
568 |
// notify DTMFCapsChange asynchronous
|
|
569 |
|
|
570 |
aPhone.NotifyDTMFCapsChange(aReqStatus, caps);
|
|
571 |
User::WaitForRequest(aReqStatus);
|
|
572 |
TEST(aReqStatus.Int()==KErrNone);
|
|
573 |
TEST(caps==DMMTSY_PHONE_DTMF_CAPS2);
|
|
574 |
|
|
575 |
// asynchronous & cancel
|
|
576 |
|
|
577 |
aPhone.NotifyDTMFCapsChange(aReqStatus, caps);
|
|
578 |
aPhone.CancelAsyncRequest(EMobilePhoneNotifyDTMFCapsChange);
|
|
579 |
User::WaitForRequest(aReqStatus);
|
|
580 |
TEST(aReqStatus.Int()==KErrNone || aReqStatus.Int()==KErrCancel);
|
|
581 |
if (aReqStatus.Int()==KErrCancel)
|
|
582 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::NotifyDTMFCapsChange (async & cancel (Cancelled Request)) passed"), iTestCount++);
|
|
583 |
else
|
|
584 |
{
|
|
585 |
TEST(caps==DMMTSY_PHONE_DTMF_CAPS2);
|
|
586 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::NotifyDTMFCapsChange (async & cancel (Request Not Cancelled)) passed"), iTestCount++);
|
|
587 |
}
|
|
588 |
|
|
589 |
// Test SendDTMFTones
|
|
590 |
|
|
591 |
// Send buffer of DTMF tones
|
|
592 |
TBuf<DMMTSY_PHONE_SEND_TONES_LENGTH> tones(DMMTSY_PHONE_SEND_TONES);
|
|
593 |
|
|
594 |
// asynchronous
|
|
595 |
|
|
596 |
aPhone.SendDTMFTones(aReqStatus, tones);
|
|
597 |
User::WaitForRequest(aReqStatus);
|
|
598 |
TEST(aReqStatus.Int()==KErrNone);
|
|
599 |
|
|
600 |
// asynchronous & cancel
|
|
601 |
|
|
602 |
aPhone.SendDTMFTones(aReqStatus, tones);
|
|
603 |
aPhone.CancelAsyncRequest(EMobilePhoneSendDTMFTones);
|
|
604 |
User::WaitForRequest(aReqStatus);
|
|
605 |
TEST(aReqStatus.Int()==KErrNone || aReqStatus.Int()==KErrCancel);
|
|
606 |
if (aReqStatus.Int()==KErrCancel)
|
|
607 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::SendDTMFTones (async & cancel (Cancelled Request)) passed"), iTestCount++);
|
|
608 |
else
|
|
609 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::SendDTMFTones (async & cancel (Request Not Cancelled)) passed"), iTestCount++);
|
|
610 |
|
|
611 |
// Test StartDTMFTone
|
|
612 |
|
|
613 |
// Send one DTMF tone
|
|
614 |
TChar tone(DMMTSY_PHONE_SINGLE_TONE);
|
|
615 |
|
|
616 |
// synchronous
|
|
617 |
|
|
618 |
TEST(aPhone.StartDTMFTone(tone)==KErrNone);
|
|
619 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::StartDTMFTone (sync) passed"), iTestCount++);
|
|
620 |
|
|
621 |
TEST(aPhone.StopDTMFTone()==KErrNone);
|
|
622 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::StopDTMFTone (sync) passed"), iTestCount++);
|
|
623 |
|
|
624 |
// Test ReadDTMFTones
|
|
625 |
|
|
626 |
// Read buffer for DTMF tones
|
|
627 |
TBuf<DMMTSY_PHONE_READ_TONES_LENGTH> readtones;
|
|
628 |
|
|
629 |
// asynchronous
|
|
630 |
|
|
631 |
aPhone.ReadDTMFTones(aReqStatus, readtones);
|
|
632 |
User::WaitForRequest(aReqStatus);
|
|
633 |
TEST(aReqStatus.Int()==KErrNone);
|
|
634 |
TEST(readtones.Compare(DMMTSY_PHONE_READ_TONES)==0);
|
|
635 |
|
|
636 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::ReadDTMFTones (async) passed"), iTestCount++);
|
|
637 |
|
|
638 |
// asynchronous & cancel
|
|
639 |
|
|
640 |
aPhone.ReadDTMFTones(aReqStatus, readtones);
|
|
641 |
aPhone.CancelAsyncRequest(EMobilePhoneReadDTMFTones);
|
|
642 |
User::WaitForRequest(aReqStatus);
|
|
643 |
TEST(aReqStatus.Int()==KErrNone || aReqStatus.Int()==KErrCancel);
|
|
644 |
if (aReqStatus.Int()==KErrCancel)
|
|
645 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::ReadDTMFTones (async & cancel (Cancelled Request)) passed"), iTestCount++);
|
|
646 |
else
|
|
647 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::ReadDTMFTones (async & cancel (Request Not Cancelled)) passed"), iTestCount++);
|
|
648 |
|
|
649 |
// Test NotifyStopInDTMF String
|
|
650 |
|
|
651 |
// asynchronous
|
|
652 |
|
|
653 |
aPhone.NotifyStopInDTMFString(aReqStatus);
|
|
654 |
User::WaitForRequest(aReqStatus);
|
|
655 |
TEST(aReqStatus.Int() == KErrNone);
|
|
656 |
|
|
657 |
// asynchronous & cancel
|
|
658 |
|
|
659 |
aPhone.NotifyStopInDTMFString(aReqStatus);
|
|
660 |
aPhone.CancelAsyncRequest(EMobilePhoneNotifyStopInDTMFString);
|
|
661 |
User::WaitForRequest(aReqStatus);
|
|
662 |
TEST(aReqStatus.Int() == KErrNone || aReqStatus.Int() == KErrCancel);
|
|
663 |
|
|
664 |
if (aReqStatus.Int() == KErrCancel)
|
|
665 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::NotifyStopInDTMFString (async & cancel (Cancelled Request)) passed"), iTestCount++);
|
|
666 |
else
|
|
667 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::NotifyStopInDTMFString (async & cancel (Request Not Cancelled)) passed"), iTestCount++);
|
|
668 |
|
|
669 |
// Test ContinueDTMFStringSending
|
|
670 |
|
|
671 |
TEST(aPhone.ContinueDTMFStringSending(DMMTSY_PHONE_CONTINUE_DTMF_SENDING) == KErrNone);
|
|
672 |
|
|
673 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::ContinueDTMFStringSending (sync) passed"), iTestCount++);
|
|
674 |
|
|
675 |
//Test NotifyDTMFEvent
|
|
676 |
|
|
677 |
// asynchronous
|
|
678 |
|
|
679 |
RMobilePhone:: TMobilePhoneDTMFEvent dtmfEvent;
|
|
680 |
aPhone.NotifyDTMFEvent(aReqStatus, dtmfEvent);
|
|
681 |
User::WaitForRequest(aReqStatus);
|
|
682 |
TEST(aReqStatus.Int() == KErrNone);
|
|
683 |
TEST(dtmfEvent == DMMTSY_PHONE_NOTIFY_DTMFEVENT_ON);
|
|
684 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::NotifyDTMFEvent (async) passed"), iTestCount++);
|
|
685 |
|
|
686 |
// asynchronous & cancel
|
|
687 |
|
|
688 |
aPhone.NotifyDTMFEvent(aReqStatus, dtmfEvent);
|
|
689 |
aPhone.CancelAsyncRequest(EMobilePhoneNotifyDTMFEvent);
|
|
690 |
User::WaitForRequest(aReqStatus);
|
|
691 |
TEST(aReqStatus.Int() == KErrNone || aReqStatus.Int() == KErrCancel);
|
|
692 |
|
|
693 |
if (aReqStatus.Int() == KErrCancel)
|
|
694 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::NotifyDTMFEvent (async & cancel (Cancelled Request)) passed"), iTestCount++);
|
|
695 |
else
|
|
696 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::NotifyDTMFEvent (async & cancel (Request Not Cancelled)) passed"), iTestCount++);
|
|
697 |
|
|
698 |
// test.Next(_L("OK: RMobilePhone's MobilePhoneDTMF"));
|
|
699 |
}
|
|
700 |
|
|
701 |
void CTestPhone::TestHSUPAMobileNetworkL(RMobilePhone &aPhone, TRequestStatus &aReqStatus)
|
|
702 |
{
|
|
703 |
|
|
704 |
/* Get Current Network - Start*/
|
|
705 |
RMobilePhone::TMobilePhoneNetworkInfoV8 asyncCurrentNetwork8;
|
|
706 |
RMobilePhone::TMobilePhoneNetworkInfoV8Pckg asyncCurrentNetworkPckg8(asyncCurrentNetwork8);
|
|
707 |
RMobilePhone::TMobilePhoneLocationAreaV1 asyncLocArea;
|
|
708 |
|
|
709 |
aPhone.GetCurrentNetwork(aReqStatus, asyncCurrentNetworkPckg8, asyncLocArea);
|
|
710 |
User::WaitForRequest(aReqStatus);
|
|
711 |
TEST(aReqStatus.Int()==KErrNone);
|
|
712 |
|
|
713 |
// extract the returned Current network info from the package
|
|
714 |
asyncCurrentNetwork8=asyncCurrentNetworkPckg8();
|
|
715 |
ValidateCurrentNetworkforHSUPA(asyncCurrentNetwork8, asyncLocArea);
|
|
716 |
|
|
717 |
/* Get Current Network - End*/
|
|
718 |
|
|
719 |
/* Get Current Network - Cancelling of the request - Start */
|
|
720 |
|
|
721 |
aPhone.GetCurrentNetwork(aReqStatus, asyncCurrentNetworkPckg8, asyncLocArea);
|
|
722 |
aPhone.CancelAsyncRequest(EMobilePhoneGetCurrentNetwork);
|
|
723 |
User::WaitForRequest(aReqStatus);
|
|
724 |
TEST(aReqStatus.Int()==KErrNone || aReqStatus.Int()==KErrCancel);
|
|
725 |
|
|
726 |
if (aReqStatus.Int()==KErrNone)
|
|
727 |
{
|
|
728 |
INFO_PRINTF1(_L("The Return Status for User::WaitForRequest - KErrNone "));
|
|
729 |
INFO_PRINTF1(_L("GetCurrentNetwork is already completed"));
|
|
730 |
INFO_PRINTF1(_L("Cancelling of the GetCurrentNetwork Request is NOT Successfully Completed"));
|
|
731 |
}
|
|
732 |
else
|
|
733 |
{
|
|
734 |
INFO_PRINTF1(_L("The Return Status for User::WaitForRequest - KErrCancel "));
|
|
735 |
INFO_PRINTF1(_L("Cancelling of the GetCurrentNetwork Request is Successfully Completed"));
|
|
736 |
}
|
|
737 |
|
|
738 |
/* Get Current Network - Cancelling of the request - End */
|
|
739 |
|
|
740 |
/* Get Home Network - Start */
|
|
741 |
RMobilePhone::TMobilePhoneNetworkInfoV8 asyncHomeNetwork8;
|
|
742 |
RMobilePhone::TMobilePhoneNetworkInfoV8Pckg asyncHomeNetworkPckg8(asyncHomeNetwork8);
|
|
743 |
|
|
744 |
aPhone.GetHomeNetwork(aReqStatus, asyncHomeNetworkPckg8);
|
|
745 |
User::WaitForRequest(aReqStatus);
|
|
746 |
TEST(aReqStatus.Int()==KErrNone);
|
|
747 |
|
|
748 |
asyncHomeNetwork8=asyncHomeNetworkPckg8();
|
|
749 |
ValidateHomeNetworkforHSUPA(asyncHomeNetwork8);
|
|
750 |
/* Get Home Network - End*/
|
|
751 |
|
|
752 |
/* Get Home Network- Cancelling of the request - Start */
|
|
753 |
|
|
754 |
aPhone.GetHomeNetwork(aReqStatus, asyncHomeNetworkPckg8);
|
|
755 |
aPhone.CancelAsyncRequest(EMobilePhoneGetHomeNetwork);
|
|
756 |
User::WaitForRequest(aReqStatus);
|
|
757 |
TEST(aReqStatus.Int()==KErrNone || aReqStatus.Int()==KErrCancel);
|
|
758 |
|
|
759 |
if (aReqStatus.Int()==KErrNone)
|
|
760 |
{
|
|
761 |
INFO_PRINTF1(_L("The Return Status for User::WaitForRequest - KErrNone "));
|
|
762 |
INFO_PRINTF1(_L("GetHomeNetwork is already completed"));
|
|
763 |
INFO_PRINTF1(_L("Cancelling of the GetHomeNetwork Request is NOT Successfully Completed"));
|
|
764 |
}
|
|
765 |
else
|
|
766 |
{
|
|
767 |
INFO_PRINTF1(_L("The Return Status for User::WaitForRequest - KErrCancel "));
|
|
768 |
INFO_PRINTF1(_L("Cancelling of the GetHomeNetwork Request is Successfully Completed"));
|
|
769 |
}
|
|
770 |
|
|
771 |
/* Get Home Network- Cancelling of the request - End */
|
|
772 |
|
|
773 |
|
|
774 |
/* Get Detected Networks - Start */
|
|
775 |
|
|
776 |
CTestGetDetectedNetworks* getNetworks8=CTestGetDetectedNetworks::NewLC(aPhone, this);
|
|
777 |
|
|
778 |
//Set test version to ETestV1 to test the V1 list class and list retrieval method
|
|
779 |
getNetworks8->SetTestVersion(CTestGetDetectedNetworks::ETestV8);
|
|
780 |
getNetworks8->TestRetrieve();
|
|
781 |
|
|
782 |
//Delete test object and start afresh
|
|
783 |
CleanupStack::PopAndDestroy(); //getNetworks
|
|
784 |
|
|
785 |
// getNetworks8=CTestGetDetectedNetworks::NewLC(aPhone,this);
|
|
786 |
|
|
787 |
//Set test version to ETestV8 and test starting and then cancelling retrieve method
|
|
788 |
// getNetworks8->SetTestVersion(CTestGetDetectedNetworks::ETestV8);
|
|
789 |
// getNetworks8->TestCancel();
|
|
790 |
|
|
791 |
// CleanupStack::PopAndDestroy(); //getNetworks
|
|
792 |
|
|
793 |
/* Get Detected Networks - End */
|
|
794 |
|
|
795 |
/* Notify Current Change - Start */
|
|
796 |
RMobilePhone mmPhonev8;
|
|
797 |
TInt ret=mmPhonev8.Open(iTelServer,DMMTSY_PHONE_NAME);
|
|
798 |
TEST(ret==KErrNone);
|
|
799 |
|
|
800 |
//set up first notification request using V2 package format
|
|
801 |
mmPhonev8.NotifyCurrentNetworkChange(aReqStatus, asyncCurrentNetworkPckg8, asyncLocArea);
|
|
802 |
User::WaitForRequest(aReqStatus);
|
|
803 |
TEST(aReqStatus.Int() == KErrNone);
|
|
804 |
asyncCurrentNetwork8=asyncCurrentNetworkPckg8();
|
|
805 |
ValidateNotifyCurrentNetworkChangeforHSUPA(asyncCurrentNetwork8,asyncLocArea);
|
|
806 |
|
|
807 |
/* Notify Current Network Change - End */
|
|
808 |
|
|
809 |
/* Notify Current Network Change and Cancel - Start */
|
|
810 |
|
|
811 |
mmPhonev8.NotifyCurrentNetworkChange(aReqStatus, asyncCurrentNetworkPckg8, asyncLocArea);
|
|
812 |
mmPhonev8.CancelAsyncRequest(EMobilePhoneNotifyCurrentNetworkChange);
|
|
813 |
User::WaitForRequest(aReqStatus);
|
|
814 |
TEST(aReqStatus.Int()==KErrNone || aReqStatus.Int()==KErrCancel);
|
|
815 |
|
|
816 |
if (aReqStatus.Int()==KErrNone)
|
|
817 |
{
|
|
818 |
INFO_PRINTF1(_L("The Return Status for User::WaitForRequest - KErrNone "));
|
|
819 |
INFO_PRINTF1(_L("NotifyCurrentNetworkChange is already completed"));
|
|
820 |
INFO_PRINTF1(_L("Cancelling of the NotifyCurrentNetworkChange Request is NOT Successfully Completed"));
|
|
821 |
}
|
|
822 |
else
|
|
823 |
{
|
|
824 |
INFO_PRINTF1(_L("The Return Status for User::WaitForRequest - KErrCancel "));
|
|
825 |
INFO_PRINTF1(_L("Canceling of the Notify Request is Scceussfully Completed"));
|
|
826 |
}
|
|
827 |
|
|
828 |
mmPhonev8.Close();
|
|
829 |
/* Notify Current Network Change and Cancel - End */
|
|
830 |
|
|
831 |
}
|
|
832 |
|
|
833 |
void CTestPhone::TestTMobilePhoneNetworkInfoV8(TRequestStatus &aReqStatus)
|
|
834 |
{
|
|
835 |
RMobilePhone::TMobilePhoneNetworkInfoV8 mobilePhoneNetworkInfoV8;
|
|
836 |
if((mobilePhoneNetworkInfoV8.iHsupaAvailableIndicator==EFalse) && (mobilePhoneNetworkInfoV8.ExtensionId()==KEtelExtMultimodeV8))
|
|
837 |
{
|
|
838 |
INFO_PRINTF1(_L("TMobilePhoneNetworkInfoV8 Instance creation successful "));
|
|
839 |
INFO_PRINTF1(_L("Value of iHsupaAvailableIndicator = EFalse"));
|
|
840 |
INFO_PRINTF1(_L("Value of iExtensionID = KEtelExtMultimodeV8"));
|
|
841 |
aReqStatus= KErrNone;
|
|
842 |
}
|
|
843 |
else
|
|
844 |
{
|
|
845 |
INFO_PRINTF1(_L("TMobilePhoneNetworkInfoV8 Instance creation NOT successful" ));
|
|
846 |
aReqStatus = KErrNotFound;
|
|
847 |
}
|
|
848 |
|
|
849 |
}
|
|
850 |
|
|
851 |
void CTestPhone::TestCRetrievePhoneDetectedNetworksL(RMobilePhone &aPhone,TRequestStatus &aReqStatus)
|
|
852 |
{
|
|
853 |
|
|
854 |
CRetrieveMobilePhoneDetectedNetworks *pRetrieve = CRetrieveMobilePhoneDetectedNetworks::NewL(aPhone);
|
|
855 |
|
|
856 |
CleanupStack::PushL(pRetrieve);
|
|
857 |
|
|
858 |
CMobilePhoneNetworkListV8* networkList=NULL;
|
|
859 |
networkList=pRetrieve->RetrieveListV8L();
|
|
860 |
|
|
861 |
TEST(networkList==NULL);
|
|
862 |
|
|
863 |
if(networkList == NULL)
|
|
864 |
INFO_PRINTF1(_L("The instance value is NULL"));
|
|
865 |
else
|
|
866 |
INFO_PRINTF1(_L("The instance value is NOT NULL"));
|
|
867 |
|
|
868 |
CleanupStack::PopAndDestroy();
|
|
869 |
aReqStatus = KErrNone;
|
|
870 |
|
|
871 |
}
|
|
872 |
|
|
873 |
|
|
874 |
void CTestPhone::TestMobileNetworkL(RMobilePhone& aPhone, TRequestStatus &aReqStatus)
|
|
875 |
{
|
|
876 |
|
|
877 |
TUint32 caps;
|
|
878 |
|
|
879 |
// Get network caps
|
|
880 |
|
|
881 |
TEST(aPhone.GetNetworkCaps(caps)==KErrNone);
|
|
882 |
TEST(caps==DMMTSY_PHONE_NETWORK_CAPS);
|
|
883 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::GetNetworkCaps (sync) passed"), iTestCount++);
|
|
884 |
|
|
885 |
// Get Current Mobile mode
|
|
886 |
|
|
887 |
RMobilePhone::TMobilePhoneNetworkMode syncMode, asyncMode;
|
|
888 |
|
|
889 |
// synchronous
|
|
890 |
|
|
891 |
TEST(aPhone.GetCurrentMode(syncMode) == KErrNone);
|
|
892 |
TEST(syncMode==DMMTSY_PHONE_NETWORK_MODE1);
|
|
893 |
|
|
894 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::GetCurrentMode (sync) passed"), iTestCount++);
|
|
895 |
|
|
896 |
// NotifyModeChange
|
|
897 |
|
|
898 |
// asynchronous
|
|
899 |
|
|
900 |
aPhone.NotifyModeChange(aReqStatus, asyncMode);
|
|
901 |
User::WaitForRequest(aReqStatus);
|
|
902 |
TEST(aReqStatus.Int()==KErrNone);
|
|
903 |
TEST(asyncMode==DMMTSY_PHONE_NETWORK_MODE2);
|
|
904 |
|
|
905 |
// asynchronous & cancel
|
|
906 |
|
|
907 |
aPhone.NotifyModeChange(aReqStatus, asyncMode);
|
|
908 |
aPhone.CancelAsyncRequest(EMobilePhoneNotifyModeChange);
|
|
909 |
User::WaitForRequest(aReqStatus);
|
|
910 |
TEST(aReqStatus.Int()==KErrNone || aReqStatus.Int()==KErrCancel);
|
|
911 |
if (aReqStatus.Int()==KErrCancel)
|
|
912 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::NotifyModeChange (async & cancel (Cancelled Request)) passed"), iTestCount++);
|
|
913 |
else
|
|
914 |
{
|
|
915 |
TEST(asyncMode==DMMTSY_PHONE_NETWORK_MODE2);
|
|
916 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::NotifyModeChange (async & cancel (Request Not Cancelled)) passed"), iTestCount++);
|
|
917 |
}
|
|
918 |
|
|
919 |
// Get Home Network Info
|
|
920 |
|
|
921 |
// asynchronous
|
|
922 |
|
|
923 |
RMobilePhone::TMobilePhoneNetworkInfoV1 asyncHomeNetwork;
|
|
924 |
RMobilePhone::TMobilePhoneNetworkInfoV1Pckg asyncHomeNetworkPckg(asyncHomeNetwork);
|
|
925 |
|
|
926 |
aPhone.GetHomeNetwork(aReqStatus, asyncHomeNetworkPckg);
|
|
927 |
User::WaitForRequest(aReqStatus);
|
|
928 |
TEST(aReqStatus.Int()==KErrNone);
|
|
929 |
ValidateHomeNetwork(asyncHomeNetwork);
|
|
930 |
|
|
931 |
aPhone.GetHomeNetwork(aReqStatus, asyncHomeNetworkPckg);
|
|
932 |
aPhone.CancelAsyncRequest(EMobilePhoneGetHomeNetwork);
|
|
933 |
User::WaitForRequest(aReqStatus);
|
|
934 |
TEST(aReqStatus.Int()==KErrNone || aReqStatus.Int()==KErrCancel);
|
|
935 |
if (aReqStatus.Int()==KErrCancel)
|
|
936 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::GetHomeNetwork (async & cancel (Cancelled Request)) passed"), iTestCount++);
|
|
937 |
else
|
|
938 |
{
|
|
939 |
asyncHomeNetwork=asyncHomeNetworkPckg();
|
|
940 |
ValidateHomeNetwork(asyncHomeNetwork);
|
|
941 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::GetHomeNetwork (async & cancel (Request Not Cancelled)) passed"), iTestCount++);
|
|
942 |
}
|
|
943 |
|
|
944 |
// GetHomeNetworkSearchPeriod
|
|
945 |
|
|
946 |
// asynchronous
|
|
947 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::GetHomeNetworkSearchPeriod async."), iTestCount++);
|
|
948 |
TInt searchIntv;
|
|
949 |
aPhone.GetHomeNetworkSearchPeriod(aReqStatus, searchIntv);
|
|
950 |
User::WaitForRequest(aReqStatus);
|
|
951 |
TEST(aReqStatus.Int()==KErrNone);
|
|
952 |
TEST(searchIntv == DMMTSY_PHONE_HOME_NETWORK_SEARCHINTV);
|
|
953 |
|
|
954 |
// asynchronous & cancel
|
|
955 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::GetHomeNetworkSearchPeriod async & cancel."), iTestCount++);
|
|
956 |
aPhone.GetHomeNetworkSearchPeriod(aReqStatus, searchIntv);
|
|
957 |
aPhone.CancelAsyncRequest(EMobilePhoneGetHomeNetworkSearchPeriod);
|
|
958 |
User::WaitForRequest(aReqStatus);
|
|
959 |
TEST(aReqStatus.Int()==KErrCancel);
|
|
960 |
|
|
961 |
// GetLastUsedAccessTechnology
|
|
962 |
|
|
963 |
// asynchronous
|
|
964 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::GetLastUsedAccessTechnology async."), iTestCount++);
|
|
965 |
RMobilePhone::TMobilePhoneNetworkAccess accessTech;
|
|
966 |
aPhone.GetLastUsedAccessTechnology(aReqStatus, accessTech);
|
|
967 |
User::WaitForRequest(aReqStatus);
|
|
968 |
TEST(aReqStatus.Int()==KErrNone);
|
|
969 |
TEST(accessTech == DMMTSY_PHONE_LAST_USED_ACCESS_TECH);
|
|
970 |
|
|
971 |
// asynchronous & cancel
|
|
972 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::GetLastUsedAccessTechnology async & cancel."), iTestCount++);
|
|
973 |
aPhone.GetLastUsedAccessTechnology(aReqStatus, accessTech);
|
|
974 |
aPhone.CancelAsyncRequest(EMobilePhoneGetLastUsedAccessTechnology);
|
|
975 |
User::WaitForRequest(aReqStatus);
|
|
976 |
TEST(aReqStatus.Int()==KErrCancel);
|
|
977 |
|
|
978 |
// Get Current Network Info
|
|
979 |
|
|
980 |
// asynchronous
|
|
981 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::GetCurrentNetwork async."), iTestCount++);
|
|
982 |
RMobilePhone::TMobilePhoneNetworkInfoV1 asyncCurrentNetwork;
|
|
983 |
RMobilePhone::TMobilePhoneNetworkInfoV1Pckg asyncCurrentNetworkPckg(asyncCurrentNetwork);
|
|
984 |
RMobilePhone::TMobilePhoneLocationAreaV1 asyncLocArea;
|
|
985 |
|
|
986 |
aPhone.GetCurrentNetwork(aReqStatus, asyncCurrentNetworkPckg, asyncLocArea);
|
|
987 |
User::WaitForRequest(aReqStatus);
|
|
988 |
TEST(aReqStatus.Int()==KErrNone);
|
|
989 |
|
|
990 |
// extract the returned Current network info from the package
|
|
991 |
asyncCurrentNetwork=asyncCurrentNetworkPckg();
|
|
992 |
ValidateCurrentNetwork(asyncCurrentNetwork, asyncLocArea);
|
|
993 |
|
|
994 |
// asynchronous & cancel
|
|
995 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::GetCurrentNetwork async & cancel."), iTestCount++);
|
|
996 |
aPhone.GetCurrentNetwork(aReqStatus, asyncCurrentNetworkPckg, asyncLocArea);
|
|
997 |
aPhone.CancelAsyncRequest(EMobilePhoneGetCurrentNetwork);
|
|
998 |
User::WaitForRequest(aReqStatus);
|
|
999 |
TEST(aReqStatus.Int()==KErrCancel || aReqStatus.Int()==KErrNone);
|
|
1000 |
if (aReqStatus.Int()==KErrNone)
|
|
1001 |
{
|
|
1002 |
asyncCurrentNetwork=asyncCurrentNetworkPckg();
|
|
1003 |
ValidateCurrentNetwork(asyncCurrentNetwork, asyncLocArea);
|
|
1004 |
}
|
|
1005 |
|
|
1006 |
// Notify Current Network Change
|
|
1007 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::NotifyCurrentNetworkChange async."), iTestCount++);
|
|
1008 |
aPhone.NotifyCurrentNetworkChange(aReqStatus, asyncCurrentNetworkPckg, asyncLocArea);
|
|
1009 |
User::WaitForRequest(aReqStatus);
|
|
1010 |
TEST(aReqStatus.Int()==KErrNone);
|
|
1011 |
|
|
1012 |
asyncCurrentNetwork=asyncCurrentNetworkPckg();
|
|
1013 |
ValidateNotifyCurrentNetworkChange(asyncCurrentNetwork,asyncLocArea);
|
|
1014 |
|
|
1015 |
// asynchronous & cancel
|
|
1016 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::NotifyCurrentNetworkChange async & cancel."), iTestCount++);
|
|
1017 |
aPhone.NotifyCurrentNetworkChange(aReqStatus, asyncCurrentNetworkPckg, asyncLocArea);
|
|
1018 |
aPhone.CancelAsyncRequest(EMobilePhoneNotifyCurrentNetworkChange);
|
|
1019 |
User::WaitForRequest(aReqStatus);
|
|
1020 |
|
|
1021 |
TEST(aReqStatus.Int()==KErrNone || aReqStatus.Int()==KErrCancel);
|
|
1022 |
if (aReqStatus.Int()==KErrNone)
|
|
1023 |
{
|
|
1024 |
asyncCurrentNetwork=asyncCurrentNetworkPckg();
|
|
1025 |
ValidateNotifyCurrentNetworkChange(asyncCurrentNetwork,asyncLocArea);
|
|
1026 |
}
|
|
1027 |
|
|
1028 |
|
|
1029 |
TestMobileNetworkISVL(aPhone, aReqStatus);
|
|
1030 |
|
|
1031 |
//Multiple complete Notify Current Network Change
|
|
1032 |
//use a second phone client object
|
|
1033 |
RMobilePhone mmPhone2;
|
|
1034 |
TInt ret=mmPhone2.Open(iTelServer,DMMTSY_PHONE_NAME);
|
|
1035 |
TEST(ret==KErrNone);
|
|
1036 |
|
|
1037 |
//set up a second parameter package
|
|
1038 |
TRequestStatus aReqStatus2;
|
|
1039 |
RMobilePhone::TMobilePhoneNetworkInfoV2 asyncCurrentNetwork2;
|
|
1040 |
RMobilePhone::TMobilePhoneNetworkInfoV2Pckg asyncCurrentNetworkPckg2(asyncCurrentNetwork2);
|
|
1041 |
RMobilePhone::TMobilePhoneLocationAreaV1 asyncLocArea2;
|
|
1042 |
|
|
1043 |
//set up first notification request using V2 package format
|
|
1044 |
mmPhone2.NotifyCurrentNetworkChange(aReqStatus, asyncCurrentNetworkPckg2, asyncLocArea2);
|
|
1045 |
User::WaitForRequest(aReqStatus2);
|
|
1046 |
TEST(aReqStatus.Int()==KErrNone);
|
|
1047 |
|
|
1048 |
//set up second notification request using V1 package format
|
|
1049 |
aPhone.NotifyCurrentNetworkChange(aReqStatus, asyncCurrentNetworkPckg, asyncLocArea);
|
|
1050 |
User::WaitForRequest(aReqStatus);
|
|
1051 |
TEST(aReqStatus.Int()==KErrNone);
|
|
1052 |
|
|
1053 |
//validate the version 2 package
|
|
1054 |
ValidateNotifyCurrentNetworkChange(asyncCurrentNetwork2,asyncLocArea2);
|
|
1055 |
TEST(asyncCurrentNetwork2.iAccess == DMMTSY_PHONE_CURRENT_NETWORK_ACCESS_GSM);
|
|
1056 |
mmPhone2.Close();
|
|
1057 |
|
|
1058 |
asyncCurrentNetwork=asyncCurrentNetworkPckg();
|
|
1059 |
ValidateNotifyCurrentNetworkChange(asyncCurrentNetwork,asyncLocArea);
|
|
1060 |
|
|
1061 |
// asynchronous & cancel
|
|
1062 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::NotifyCurrentNetworkChange async & cancel."), iTestCount++);
|
|
1063 |
aPhone.NotifyCurrentNetworkChange(aReqStatus, asyncCurrentNetworkPckg, asyncLocArea);
|
|
1064 |
aPhone.CancelAsyncRequest(EMobilePhoneNotifyCurrentNetworkChange);
|
|
1065 |
User::WaitForRequest(aReqStatus);
|
|
1066 |
TEST(aReqStatus.Int()==KErrNone || aReqStatus.Int()==KErrCancel);
|
|
1067 |
if (aReqStatus.Int()==KErrNone)
|
|
1068 |
{
|
|
1069 |
INFO_PRINTF1(_L("The Return Status for User::WaitForRequest - KErrNone "));
|
|
1070 |
INFO_PRINTF1(_L("NotifyCurrentNetworkChange is already completed"));
|
|
1071 |
INFO_PRINTF1(_L("Cancelling of the NotifyCurrentNetworkChange Request is NOT Successfully Completed"));
|
|
1072 |
}
|
|
1073 |
else
|
|
1074 |
{
|
|
1075 |
INFO_PRINTF1(_L("The Return Status for User::WaitForRequest - KErrCancel "));
|
|
1076 |
INFO_PRINTF1(_L("Cancelling of the NotifyCurrentNetworkChange Request is Successfully Completed"));
|
|
1077 |
}
|
|
1078 |
|
|
1079 |
// Get network registration status
|
|
1080 |
|
|
1081 |
RMobilePhone::TMobilePhoneRegistrationStatus asyncRegStatus;
|
|
1082 |
|
|
1083 |
// asynchronous
|
|
1084 |
|
|
1085 |
aPhone.GetNetworkRegistrationStatus(aReqStatus, asyncRegStatus);
|
|
1086 |
User::WaitForRequest(aReqStatus);
|
|
1087 |
TEST(aReqStatus.Int()==KErrNone);
|
|
1088 |
TEST(asyncRegStatus==DMMTSY_PHONE_REGISTRATION_STATUS1);
|
|
1089 |
|
|
1090 |
// asynchronous & cancel
|
|
1091 |
|
|
1092 |
aPhone.GetNetworkRegistrationStatus(aReqStatus, asyncRegStatus);
|
|
1093 |
aPhone.CancelAsyncRequest(EMobilePhoneGetNetworkRegistrationStatus);
|
|
1094 |
User::WaitForRequest(aReqStatus);
|
|
1095 |
TEST(aReqStatus.Int()==KErrNone || aReqStatus.Int()==KErrCancel);
|
|
1096 |
|
|
1097 |
if (aReqStatus.Int()==KErrCancel)
|
|
1098 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::GetNetworkRegistrationStatus (async & cancel (Cancelled Request)) passed"), iTestCount++);
|
|
1099 |
else
|
|
1100 |
{
|
|
1101 |
TEST(asyncRegStatus==DMMTSY_PHONE_REGISTRATION_STATUS1);
|
|
1102 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::GetNetworkRegistrationStatus (async & cancel (Request Not Cancelled)) passed"), iTestCount++);
|
|
1103 |
}
|
|
1104 |
|
|
1105 |
// NotifyNetworkRegistrationStatusChange
|
|
1106 |
|
|
1107 |
aPhone.NotifyNetworkRegistrationStatusChange(aReqStatus, asyncRegStatus);
|
|
1108 |
User::WaitForRequest(aReqStatus);
|
|
1109 |
TEST(aReqStatus.Int()==KErrNone);
|
|
1110 |
TEST(asyncRegStatus==DMMTSY_PHONE_REGISTRATION_STATUS2);
|
|
1111 |
|
|
1112 |
aPhone.NotifyNetworkRegistrationStatusChange(aReqStatus, asyncRegStatus);
|
|
1113 |
aPhone.CancelAsyncRequest(EMobilePhoneNotifyNetworkRegistrationStatusChange);
|
|
1114 |
User::WaitForRequest(aReqStatus);
|
|
1115 |
TEST(aReqStatus.Int()==KErrNone || aReqStatus.Int()==KErrCancel);
|
|
1116 |
if (aReqStatus.Int()==KErrCancel)
|
|
1117 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::NotifyNetworkRegistrationStatusChange (async & cancel (Cancelled Request)) passed"), iTestCount++);
|
|
1118 |
else
|
|
1119 |
{
|
|
1120 |
TEST(asyncRegStatus==DMMTSY_PHONE_REGISTRATION_STATUS2);
|
|
1121 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::NotifyNetworkRegistrationStatusChange (async & cancel (Request Not Cancelled)) passed"), iTestCount++);
|
|
1122 |
}
|
|
1123 |
|
|
1124 |
//Test deletion of list object whilst async request in progress
|
|
1125 |
CRetrieveMobilePhoneDetectedNetworks* retrieve=CRetrieveMobilePhoneDetectedNetworks::NewL(aPhone);
|
|
1126 |
retrieve->Start(aReqStatus);
|
|
1127 |
delete retrieve;
|
|
1128 |
retrieve = NULL;
|
|
1129 |
User::WaitForRequest(aReqStatus);
|
|
1130 |
TEST(aReqStatus == KErrCancel);
|
|
1131 |
|
|
1132 |
|
|
1133 |
//
|
|
1134 |
// Get Detected Networks
|
|
1135 |
//
|
|
1136 |
// Get detected networks using asynchronous AO version
|
|
1137 |
CTestGetDetectedNetworks* getNetworks=CTestGetDetectedNetworks::NewLC(aPhone, this);
|
|
1138 |
|
|
1139 |
//Set test version to ETestV1 to test the V1 list class and list retrieval method
|
|
1140 |
getNetworks->SetTestVersion(CTestGetDetectedNetworks::ETestV1);
|
|
1141 |
getNetworks->TestRetrieve();
|
|
1142 |
|
|
1143 |
//Delete test object and start afresh
|
|
1144 |
CleanupStack::PopAndDestroy(); //getNetworks
|
|
1145 |
getNetworks=CTestGetDetectedNetworks::NewLC(aPhone, this);
|
|
1146 |
|
|
1147 |
//Set test version to ETestV2 to test the V2 list class and list retrieval method
|
|
1148 |
getNetworks->SetTestVersion(CTestGetDetectedNetworks::ETestV2);
|
|
1149 |
getNetworks->TestRetrieve();
|
|
1150 |
|
|
1151 |
//Delete test object and start afresh
|
|
1152 |
CleanupStack::PopAndDestroy(); //getNetworks
|
|
1153 |
getNetworks=CTestGetDetectedNetworks::NewLC(aPhone, this);
|
|
1154 |
|
|
1155 |
//Set test version to ETestV5 to test the V5 list class and list retrieval method
|
|
1156 |
getNetworks->SetTestVersion(CTestGetDetectedNetworks::ETestV5);
|
|
1157 |
getNetworks->TestRetrieve();
|
|
1158 |
|
|
1159 |
//Delete test object and start afresh
|
|
1160 |
CleanupStack::PopAndDestroy(); //getNetworks
|
|
1161 |
|
|
1162 |
getNetworks=CTestGetDetectedNetworks::NewLC(aPhone, this);
|
|
1163 |
|
|
1164 |
//Set test version to ETestV1 and test starting and then cancelling retrieve method
|
|
1165 |
getNetworks->SetTestVersion(CTestGetDetectedNetworks::ETestV1);
|
|
1166 |
getNetworks->TestCancel();
|
|
1167 |
|
|
1168 |
//Delete test object and start afresh
|
|
1169 |
CleanupStack::PopAndDestroy(); //getNetworks
|
|
1170 |
getNetworks=CTestGetDetectedNetworks::NewLC(aPhone, this);
|
|
1171 |
|
|
1172 |
//Set test version to ETestV2 and test starting and then cancelling retrieve method
|
|
1173 |
getNetworks->SetTestVersion(CTestGetDetectedNetworks::ETestV2);
|
|
1174 |
getNetworks->TestCancel();
|
|
1175 |
|
|
1176 |
CleanupStack::PopAndDestroy(); //getNetworks
|
|
1177 |
/* - commenting as the server side is updated without V5 - start */
|
|
1178 |
/*
|
|
1179 |
getNetworks=CTestGetDetectedNetworks::NewLC(aPhone, this);
|
|
1180 |
|
|
1181 |
//Set test version to ETestV5 and test starting and then cancelling retrieve method
|
|
1182 |
getNetworks->SetTestVersion(CTestGetDetectedNetworks::ETestV5);
|
|
1183 |
getNetworks->TestCancel();
|
|
1184 |
|
|
1185 |
CleanupStack::PopAndDestroy();//getNetworks*/
|
|
1186 |
|
|
1187 |
/* - commenting as the server side is updated without V5 - end */
|
|
1188 |
|
|
1189 |
//
|
|
1190 |
|
|
1191 |
// Test Network Selection Setting
|
|
1192 |
|
|
1193 |
// Get Network Selection
|
|
1194 |
|
|
1195 |
RMobilePhone::TMobilePhoneNetworkSelectionV1 networkSelection;
|
|
1196 |
RMobilePhone::TMobilePhoneNetworkSelectionV1Pckg networkSelectionPckg(networkSelection);
|
|
1197 |
|
|
1198 |
TEST(aPhone.GetNetworkSelectionSetting(networkSelectionPckg) == KErrNone);
|
|
1199 |
|
|
1200 |
TEST(networkSelection.iMethod==DMMTSY_PHONE_NETWORK_SELECTION_METHOD1);
|
|
1201 |
TEST(networkSelection.iBandClass==DMMTSY_PHONE_NETWORK_SELECTION_BAND1);
|
|
1202 |
TEST(networkSelection.iOperationMode==DMMTSY_PHONE_NETWORK_SELECTION_OPERATION1);
|
|
1203 |
|
|
1204 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::GetNetworkSelectionSetting (sync) passed"), iTestCount++);
|
|
1205 |
|
|
1206 |
// Set Network Selection
|
|
1207 |
networkSelection.iMethod=DMMTSY_PHONE_NETWORK_SELECTION_METHOD2;
|
|
1208 |
networkSelection.iBandClass=DMMTSY_PHONE_NETWORK_SELECTION_BAND2;
|
|
1209 |
networkSelection.iOperationMode=DMMTSY_PHONE_NETWORK_SELECTION_OPERATION2;
|
|
1210 |
|
|
1211 |
aPhone.SetNetworkSelectionSetting(aReqStatus,networkSelectionPckg);
|
|
1212 |
User::WaitForRequest(aReqStatus);
|
|
1213 |
TEST(aReqStatus.Int() == KErrNone);
|
|
1214 |
|
|
1215 |
aPhone.SetNetworkSelectionSetting(aReqStatus,networkSelectionPckg);
|
|
1216 |
aPhone.CancelAsyncRequest(EMobilePhoneSetNetworkSelectionSetting);
|
|
1217 |
User::WaitForRequest(aReqStatus);
|
|
1218 |
TEST(aReqStatus.Int() == KErrNone || aReqStatus.Int() == KErrCancel);
|
|
1219 |
if (aReqStatus.Int() == KErrCancel)
|
|
1220 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::SetNetworkSelectionSetting (async & cancel (Cancelled Request)) passed"), iTestCount++);
|
|
1221 |
else
|
|
1222 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::SetNetworkSelectionSetting (async & cancel (Request Not Cancelled)) passed"), iTestCount++);
|
|
1223 |
|
|
1224 |
// Test Notify Network Selection Setting Change & Cancel
|
|
1225 |
|
|
1226 |
aPhone.NotifyNetworkSelectionSettingChange(aReqStatus, networkSelectionPckg);
|
|
1227 |
User::WaitForRequest(aReqStatus);
|
|
1228 |
TEST(aReqStatus.Int() == KErrNone);
|
|
1229 |
|
|
1230 |
TEST(networkSelection.iMethod==DMMTSY_PHONE_NETWORK_SELECTION_METHOD1);
|
|
1231 |
TEST(networkSelection.iBandClass==DMMTSY_PHONE_NETWORK_SELECTION_BAND1);
|
|
1232 |
TEST(networkSelection.iOperationMode==DMMTSY_PHONE_NETWORK_SELECTION_OPERATION1);
|
|
1233 |
|
|
1234 |
aPhone.NotifyNetworkSelectionSettingChange(aReqStatus, networkSelectionPckg);
|
|
1235 |
aPhone.CancelAsyncRequest(EMobilePhoneNotifyNetworkSelectionSettingChange);
|
|
1236 |
User::WaitForRequest(aReqStatus);
|
|
1237 |
TEST(aReqStatus.Int() == KErrNone || aReqStatus.Int() == KErrCancel);
|
|
1238 |
if (aReqStatus.Int() == KErrCancel)
|
|
1239 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::NotifyNetworkSelectionSettingChange (async & cancel (Cancelled Request)) passed"), iTestCount++);
|
|
1240 |
else
|
|
1241 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::NotifyNetworkSelectionSettingChange (async & cancel (Request Not Cancelled)) passed"), iTestCount++);
|
|
1242 |
|
|
1243 |
// Test SelecttNetwork
|
|
1244 |
|
|
1245 |
// asynchronous
|
|
1246 |
|
|
1247 |
TBool isManual=ETrue;
|
|
1248 |
RMobilePhone::TMobilePhoneNetworkManualSelection manualSelection;
|
|
1249 |
manualSelection.iCountry=DMMTSY_PHONE_COUNTRY_ID;
|
|
1250 |
manualSelection.iNetwork=DMMTSY_PHONE_NETWORK_ID;
|
|
1251 |
aPhone.SelectNetwork(aReqStatus, isManual, manualSelection);
|
|
1252 |
User::WaitForRequest(aReqStatus);
|
|
1253 |
TEST(aReqStatus.Int() == KErrNone);
|
|
1254 |
|
|
1255 |
// asynchronous & cancel
|
|
1256 |
|
|
1257 |
aPhone.SelectNetwork(aReqStatus, isManual, manualSelection);
|
|
1258 |
aPhone.CancelAsyncRequest(EMobilePhoneSelectNetwork);
|
|
1259 |
User::WaitForRequest(aReqStatus);
|
|
1260 |
TEST(aReqStatus.Int() == KErrNone || aReqStatus.Int() == KErrCancel);
|
|
1261 |
|
|
1262 |
if (aReqStatus.Int() == KErrCancel)
|
|
1263 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::SelectNetwork (async & cancel (Cancelled Request)) passed"), iTestCount++);
|
|
1264 |
else
|
|
1265 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::SelectNetwork (async & cancel (Request Not Cancelled)) passed"), iTestCount++);
|
|
1266 |
|
|
1267 |
// test.Next(_L("OK: RMobilePhone's SelectNetwork OK"));
|
|
1268 |
// Test Network Time Information Methods
|
|
1269 |
|
|
1270 |
RMobilePhone::TMobilePhoneNITZ networkTimeInfo;
|
|
1271 |
RMobilePhone::TMobilePhoneNITZ asyncNetworkTimeInfo(DMMTSY_YEAR, DMMTSY_MONTH, DMMTSY_DAY, DMMTSY_HOUR, DMMTSY_MIN, DMMTSY_SEC, DMMTSY_MICROSEC);
|
|
1272 |
|
|
1273 |
TEST(aPhone.GetNITZInfo(networkTimeInfo) == KErrNone);
|
|
1274 |
ValidateNITZInfo(networkTimeInfo);
|
|
1275 |
|
|
1276 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::GetNITZInfo (sync) passed"), iTestCount++);
|
|
1277 |
|
|
1278 |
// Test NotifyNITZInfoChange async and cancel
|
|
1279 |
|
|
1280 |
aPhone.NotifyNITZInfoChange(aReqStatus,asyncNetworkTimeInfo);
|
|
1281 |
User::WaitForRequest(aReqStatus);
|
|
1282 |
TEST(aReqStatus.Int() == KErrNone);
|
|
1283 |
ValidateNITZInfo(asyncNetworkTimeInfo);
|
|
1284 |
|
|
1285 |
aPhone.NotifyNITZInfoChange(aReqStatus,asyncNetworkTimeInfo);
|
|
1286 |
aPhone.CancelAsyncRequest(EMobilePhoneNotifyNITZInfoChange);
|
|
1287 |
User::WaitForRequest(aReqStatus);
|
|
1288 |
TEST(aReqStatus.Int() == KErrNone || aReqStatus.Int() == KErrCancel);
|
|
1289 |
if (aReqStatus.Int() == KErrCancel)
|
|
1290 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::NotifyNITZInfoChange (async & cancel (Cancelled Request)) passed"), iTestCount++);
|
|
1291 |
else
|
|
1292 |
{
|
|
1293 |
ValidateNITZInfo(asyncNetworkTimeInfo);
|
|
1294 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::NotifyNITZInfoChange (async & cancel (Request Not Cancelled)) passed"), iTestCount++);
|
|
1295 |
}
|
|
1296 |
|
|
1297 |
// test.Next(_L("OK: RMobilePhone's NITZ Info OK"));
|
|
1298 |
|
|
1299 |
// Test Service Provider Name
|
|
1300 |
|
|
1301 |
// asynchronous
|
|
1302 |
RMobilePhone::TMobilePhoneServiceProviderNameV2 serviceProvider;
|
|
1303 |
RMobilePhone::TMobilePhoneServiceProviderNameV2Pckg serviceProviderPckg(serviceProvider);
|
|
1304 |
|
|
1305 |
aPhone.GetServiceProviderName(aReqStatus,serviceProviderPckg);
|
|
1306 |
User::WaitForRequest(aReqStatus);
|
|
1307 |
TEST(aReqStatus.Int() == KErrNone);
|
|
1308 |
ValidateSPName(serviceProvider);
|
|
1309 |
|
|
1310 |
// asynchronous & cancel
|
|
1311 |
aPhone.GetServiceProviderName(aReqStatus,serviceProviderPckg);
|
|
1312 |
aPhone.CancelAsyncRequest(EMobilePhoneGetServiceProviderName);
|
|
1313 |
User::WaitForRequest(aReqStatus);
|
|
1314 |
TEST(aReqStatus.Int() == KErrNone || aReqStatus.Int() == KErrCancel);
|
|
1315 |
if (aReqStatus.Int() == KErrCancel)
|
|
1316 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::GetServiceProviderName (async & cancel (Cancelled Request)) passed"), iTestCount++);
|
|
1317 |
else
|
|
1318 |
{
|
|
1319 |
ValidateSPName(serviceProvider);
|
|
1320 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::GetServiceProviderName (async & cancel (Request Not Cancelled)) passed"), iTestCount++);
|
|
1321 |
}
|
|
1322 |
|
|
1323 |
// GetNetworkInvScanSetting
|
|
1324 |
|
|
1325 |
// synchronous
|
|
1326 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::GetNetworkInvScanSetting sync."), iTestCount++);
|
|
1327 |
RMobilePhone::TMobilePhoneInvestigationScan setting;
|
|
1328 |
TInt error = aPhone.GetNetworkInvScanSetting(setting);
|
|
1329 |
TEST(error==KErrNone);
|
|
1330 |
TEST(setting == DMMTSY_PHONE_NETWORK_INV_SCAN);
|
|
1331 |
|
|
1332 |
// NotifyNetworkInvScanChange
|
|
1333 |
|
|
1334 |
// asynchronous
|
|
1335 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::NotifyNetworkInvScanChange async."), iTestCount++);
|
|
1336 |
aPhone.NotifyNetworkInvScanChange(aReqStatus, setting);
|
|
1337 |
User::WaitForRequest(aReqStatus);
|
|
1338 |
TEST(aReqStatus.Int()==KErrNone);
|
|
1339 |
TEST(setting == DMMTSY_PHONE_NETWORK_INV_SCAN);
|
|
1340 |
|
|
1341 |
// asynchronous & cancel
|
|
1342 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::NotifyNetworkInvScanChange async & cancel."), iTestCount++);
|
|
1343 |
aPhone.NotifyNetworkInvScanChange(aReqStatus, setting);
|
|
1344 |
aPhone.CancelAsyncRequest(EMobilePhoneNotifyNetworkInvScanChange);
|
|
1345 |
User::WaitForRequest(aReqStatus);
|
|
1346 |
TEST(aReqStatus.Int()==KErrCancel);
|
|
1347 |
|
|
1348 |
|
|
1349 |
// NotifyNetworkInvScanEvent
|
|
1350 |
RMobilePhone::TMobilePhoneInvestigationScanEvent event;
|
|
1351 |
// asynchronous
|
|
1352 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::NotifyNetworkInvScanEvent async."), iTestCount++);
|
|
1353 |
aPhone.NotifyNetworkInvScanEvent(aReqStatus, event);
|
|
1354 |
User::WaitForRequest(aReqStatus);
|
|
1355 |
TEST(aReqStatus.Int()==KErrNone);
|
|
1356 |
TEST(event == DMMTSY_PHONE_NETWORK_INV_SCAN_EVENT);
|
|
1357 |
|
|
1358 |
// asynchronous & cancel
|
|
1359 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::NotifyNetworkInvScanEvent async & cancel."), iTestCount++);
|
|
1360 |
aPhone.NotifyNetworkInvScanEvent(aReqStatus, event);
|
|
1361 |
aPhone.CancelAsyncRequest(EMobilePhoneNotifyNetworkInvScanEvent);
|
|
1362 |
User::WaitForRequest(aReqStatus);
|
|
1363 |
TEST(aReqStatus.Int()==KErrCancel);
|
|
1364 |
|
|
1365 |
//Test GetCurrentNetworkName
|
|
1366 |
|
|
1367 |
RMobilePhone::TMobilePhoneNetworkNameV3 networkName;
|
|
1368 |
RMobilePhone::TMobilePhoneNetworkNameV3Pckg networkNamePckg(networkName);
|
|
1369 |
|
|
1370 |
RMobilePhone::TMobilePhoneOPlmnV3 plmn;
|
|
1371 |
RMobilePhone::TMobilePhoneOPlmnV3Pckg plmnPckg(plmn);
|
|
1372 |
|
|
1373 |
//asynchronous
|
|
1374 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::GetCurrentNetworkName async."), iTestCount++);
|
|
1375 |
aPhone.GetCurrentNetworkName(aReqStatus, networkNamePckg, plmnPckg);
|
|
1376 |
User::WaitForRequest(aReqStatus);
|
|
1377 |
|
|
1378 |
TEST(aReqStatus.Int() == KErrNone);
|
|
1379 |
|
|
1380 |
TEST(networkName.iLongName == DMMTSY_PHONE_HOME_NETWORK_LONG_NAME);
|
|
1381 |
TEST(networkName.iShortName == DMMTSY_PHONE_HOME_NETWORK_SHORT_NAME);
|
|
1382 |
TEST(networkName.iOtherNames == DMMTSY_PHONE_HOME_NETWORK_OTHER_NAMES);
|
|
1383 |
|
|
1384 |
TEST(plmn.iCountryCode == DMMTSY_PHONE_COUNTRY_ID);
|
|
1385 |
TEST(plmn.iNetworkId == DMMTSY_PHONE_NETWORK_ID);
|
|
1386 |
TEST(plmn.iPNNid == DMMTSY_PHONE_HOME_NETWORK_NAME_LOC_ID);
|
|
1387 |
TEST(plmn.iFirstLocationAreaCode == DMMTSY_PHONE_HOME_NETWORK_FIRST_ID);
|
|
1388 |
TEST(plmn.iLastLocationAreaCode == DMMTSY_PHONE_HOME_NETWORK_LAST_ID);
|
|
1389 |
|
|
1390 |
// asynchronous & cancel
|
|
1391 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::GetCurrentNetworkName async & cancel."), iTestCount++);
|
|
1392 |
aPhone.GetCurrentNetworkName(aReqStatus, networkNamePckg, plmnPckg);
|
|
1393 |
aPhone.CancelAsyncRequest(EMobilePhoneGetNetworkName);
|
|
1394 |
User::WaitForRequest(aReqStatus);
|
|
1395 |
TEST(aReqStatus.Int() == KErrCancel);
|
|
1396 |
|
|
1397 |
//Test Get Preferred Networks
|
|
1398 |
RMobilePhone::TMobilePreferredNetworkEntryV3 preferredNetworkEntry1;
|
|
1399 |
RMobilePhone::TMobilePreferredNetworkEntryV3 preferredNetworkEntry2;
|
|
1400 |
RMobilePhone::TMobilePreferredNetworkEntryV3 preferredNetworkEntry3;
|
|
1401 |
RMobilePhone::TMobilePreferredNetworkEntryV3 preferredNetworkEntry4; //- FOR WLAN
|
|
1402 |
RMobilePhone::TMobilePreferredNetworkEntryV3 preferredNetworkEntryFetch;
|
|
1403 |
|
|
1404 |
preferredNetworkEntry1.iAccess = DMMTSY_PHONE_NTWK_LIST_ACCESS_CAPS_GSM;
|
|
1405 |
preferredNetworkEntry1.iUserDefined = DMMTSY_PHONE_NTWK_LIST_USER_DEFINED_FALSE;
|
|
1406 |
preferredNetworkEntry1.iCountryCode = DMMTSY_PHONE_NTWK_LIST_COUNTRY_ID1;
|
|
1407 |
preferredNetworkEntry1.iNetworkId = DMMTSY_PHONE_NTWK_LIST_NETWORK_ID1;
|
|
1408 |
|
|
1409 |
preferredNetworkEntry2.iAccess = DMMTSY_PHONE_NTWK_LIST_ACCESS_CAPS_GSMC;
|
|
1410 |
preferredNetworkEntry2.iUserDefined = DMMTSY_PHONE_NTWK_LIST_USER_DEFINED_FALSE;
|
|
1411 |
preferredNetworkEntry2.iCountryCode = DMMTSY_PHONE_NTWK_LIST_COUNTRY_ID2;
|
|
1412 |
preferredNetworkEntry2.iNetworkId = DMMTSY_PHONE_NTWK_LIST_NETWORK_ID2;
|
|
1413 |
|
|
1414 |
preferredNetworkEntry3.iAccess = DMMTSY_PHONE_NTWK_LIST_ACCESS_CAPS_UTRAN;
|
|
1415 |
preferredNetworkEntry3.iUserDefined = DMMTSY_PHONE_NTWK_LIST_USER_DEFINED_TRUE;
|
|
1416 |
preferredNetworkEntry3.iCountryCode = DMMTSY_PHONE_NTWK_LIST_COUNTRY_ID2;
|
|
1417 |
preferredNetworkEntry3.iNetworkId = DMMTSY_PHONE_NTWK_LIST_NETWORK_ID1;
|
|
1418 |
|
|
1419 |
preferredNetworkEntry4.iAccess = DMMTSY_PHONE_NTWK_LIST_ACCESS_CAPS_WLAN;
|
|
1420 |
preferredNetworkEntry4.iUserDefined = DMMTSY_PHONE_NTWK_LIST_USER_DEFINED_TRUE;
|
|
1421 |
preferredNetworkEntry4.iCountryCode = DMMTSY_PHONE_NTWK_LIST_COUNTRY_ID2;
|
|
1422 |
preferredNetworkEntry4.iNetworkId = DMMTSY_PHONE_NTWK_LIST_NETWORK_ID1;
|
|
1423 |
CMobilePhoneStoredNetworkList* networklist = CMobilePhoneStoredNetworkList::NewL();
|
|
1424 |
CleanupStack::PushL(networklist);
|
|
1425 |
|
|
1426 |
//add an entry
|
|
1427 |
networklist->AddEntryL(preferredNetworkEntry1);
|
|
1428 |
|
|
1429 |
preferredNetworkEntryFetch = networklist->GetEntryL(0);
|
|
1430 |
TEST(preferredNetworkEntryFetch.iAccess == DMMTSY_PHONE_NTWK_LIST_ACCESS_CAPS_GSM);
|
|
1431 |
TEST(preferredNetworkEntryFetch.iUserDefined == DMMTSY_PHONE_NTWK_LIST_USER_DEFINED_FALSE);
|
|
1432 |
TEST(preferredNetworkEntryFetch.iCountryCode == DMMTSY_PHONE_NTWK_LIST_COUNTRY_ID1);
|
|
1433 |
TEST(preferredNetworkEntryFetch.iNetworkId == DMMTSY_PHONE_NTWK_LIST_NETWORK_ID1);
|
|
1434 |
|
|
1435 |
//try and insert an entry in amongst non-user defined entries
|
|
1436 |
TInt err = networklist->InsertEntryL(0, preferredNetworkEntry2);
|
|
1437 |
TEST(err==KErrArgument);
|
|
1438 |
|
|
1439 |
//add at the end
|
|
1440 |
networklist->AddEntryL(preferredNetworkEntry3);
|
|
1441 |
networklist->AddEntryL(preferredNetworkEntry4); //- FOR WLAN
|
|
1442 |
|
|
1443 |
err = networklist->InsertEntryL(1, preferredNetworkEntry2);
|
|
1444 |
TEST(err==KErrNone);
|
|
1445 |
|
|
1446 |
TInt count = networklist->Enumerate();
|
|
1447 |
TEST(count==DMMTSY_PHONE_NTWK_LIST_ENTRIES);
|
|
1448 |
|
|
1449 |
//try deleting a non-user define entry
|
|
1450 |
err = networklist->DeleteEntryL(1);
|
|
1451 |
TEST(err==KErrArgument);
|
|
1452 |
|
|
1453 |
//try deleting a user define entry
|
|
1454 |
err = networklist->DeleteEntryL(2);
|
|
1455 |
TEST(err==KErrNone);
|
|
1456 |
|
|
1457 |
count = networklist->Enumerate();
|
|
1458 |
TEST(count==(DMMTSY_PHONE_NTWK_LIST_ENTRIES-1));
|
|
1459 |
|
|
1460 |
//re-add it
|
|
1461 |
networklist->AddEntryL(preferredNetworkEntry3);
|
|
1462 |
|
|
1463 |
//try changing a non-user define entry
|
|
1464 |
err = networklist->ChangeEntryL(1, preferredNetworkEntry1);
|
|
1465 |
TEST(err==KErrArgument);
|
|
1466 |
|
|
1467 |
//try changing a user define entry
|
|
1468 |
err = networklist->ChangeEntryL(2, preferredNetworkEntry1);
|
|
1469 |
TEST(err==KErrNone);
|
|
1470 |
|
|
1471 |
//check its been updated
|
|
1472 |
preferredNetworkEntryFetch = networklist->GetEntryL(2);
|
|
1473 |
TEST(preferredNetworkEntryFetch.iAccess == DMMTSY_PHONE_NTWK_LIST_ACCESS_CAPS_GSM);
|
|
1474 |
TEST(preferredNetworkEntryFetch.iUserDefined == DMMTSY_PHONE_NTWK_LIST_USER_DEFINED_FALSE);
|
|
1475 |
TEST(preferredNetworkEntryFetch.iCountryCode == DMMTSY_PHONE_NTWK_LIST_COUNTRY_ID1);
|
|
1476 |
TEST(preferredNetworkEntryFetch.iNetworkId == DMMTSY_PHONE_NTWK_LIST_NETWORK_ID1);
|
|
1477 |
|
|
1478 |
CleanupStack::PopAndDestroy(); //networklist
|
|
1479 |
|
|
1480 |
//Test retrieval of the list
|
|
1481 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::GetPreferredNetworks async."), iTestCount++);
|
|
1482 |
|
|
1483 |
//Test deletion of list object whilst async request in progress
|
|
1484 |
CRetrieveMobilePhonePreferredNetworks* retrievepn=CRetrieveMobilePhonePreferredNetworks::NewL(aPhone);
|
|
1485 |
retrievepn->Start(aReqStatus);
|
|
1486 |
delete retrievepn;
|
|
1487 |
retrievepn = NULL;
|
|
1488 |
User::WaitForRequest(aReqStatus);
|
|
1489 |
TEST(aReqStatus.Int() == KErrCancel);
|
|
1490 |
|
|
1491 |
//Get prefrred stored networks
|
|
1492 |
|
|
1493 |
// Get prefrred stored networks using asynchronous AO version
|
|
1494 |
CTestGetPreferredNetworks* prefNetworks=CTestGetPreferredNetworks::NewLC(aPhone, this);
|
|
1495 |
prefNetworks->Start();
|
|
1496 |
CActiveScheduler::Start();
|
|
1497 |
|
|
1498 |
// ensure that the same AO can be used to retrieve more than one list in succession
|
|
1499 |
|
|
1500 |
prefNetworks->Start();
|
|
1501 |
CActiveScheduler::Start();
|
|
1502 |
|
|
1503 |
// I only need to delete the search object because the destructor
|
|
1504 |
// of this will also delete the list object.
|
|
1505 |
CleanupStack::PopAndDestroy(); // prefNetworks
|
|
1506 |
|
|
1507 |
// Now test the cancelling
|
|
1508 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::GetPreferredNetworks async & cancel."), iTestCount++);
|
|
1509 |
|
|
1510 |
prefNetworks=CTestGetPreferredNetworks::NewLC(aPhone, this);
|
|
1511 |
prefNetworks->Start();
|
|
1512 |
|
|
1513 |
CTestCanceller* cancelPrefNetworks = prefNetworks->RetrieveCancelPtr();
|
|
1514 |
cancelPrefNetworks->Call();
|
|
1515 |
|
|
1516 |
CActiveScheduler::Start();
|
|
1517 |
TEST(prefNetworks->iStatus==KErrCancel);
|
|
1518 |
|
|
1519 |
// Ensure that AO can be used after its previous transaction was cancelled
|
|
1520 |
|
|
1521 |
prefNetworks->Start();
|
|
1522 |
CActiveScheduler::Start();
|
|
1523 |
|
|
1524 |
CleanupStack::PopAndDestroy(); // prefNetworks
|
|
1525 |
|
|
1526 |
//Test RMobilePhone::StorePreferredNetworksListL
|
|
1527 |
|
|
1528 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::StorePreferredNetworksListL async."), iTestCount++);
|
|
1529 |
|
|
1530 |
networklist = CMobilePhoneStoredNetworkList::NewL();
|
|
1531 |
CleanupStack::PushL(networklist);
|
|
1532 |
|
|
1533 |
networklist->AddEntryL(preferredNetworkEntry4); // FOR WLAN
|
|
1534 |
networklist->AddEntryL(preferredNetworkEntry3);
|
|
1535 |
networklist->AddEntryL(preferredNetworkEntry2);
|
|
1536 |
networklist->AddEntryL(preferredNetworkEntry1);
|
|
1537 |
|
|
1538 |
aPhone.StorePreferredNetworksListL(aReqStatus, networklist);
|
|
1539 |
User::WaitForRequest(aReqStatus);
|
|
1540 |
|
|
1541 |
TEST(aReqStatus==KErrNone);
|
|
1542 |
|
|
1543 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::StorePreferredNetworksListL async & cancel."), iTestCount++);
|
|
1544 |
|
|
1545 |
aPhone.StorePreferredNetworksListL(aReqStatus, networklist);
|
|
1546 |
aPhone.CancelAsyncRequest(EMobilePhoneStorePreferredNetworksList);
|
|
1547 |
User::WaitForRequest(aReqStatus);
|
|
1548 |
TEST(aReqStatus.Int() == KErrCancel);
|
|
1549 |
|
|
1550 |
CleanupStack::PopAndDestroy(); // networklist
|
|
1551 |
|
|
1552 |
//Test RMobilePhone::NotifyPreferredNetworksListChange
|
|
1553 |
|
|
1554 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::NotifyPreferredNetworksListChange async."), iTestCount++);
|
|
1555 |
aPhone.NotifyPreferredNetworksListChange(aReqStatus);
|
|
1556 |
User::WaitForRequest(aReqStatus);
|
|
1557 |
TEST(aReqStatus==KErrNone);
|
|
1558 |
|
|
1559 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::NotifyPreferredNetworksListChange async & cancel."), iTestCount++);
|
|
1560 |
|
|
1561 |
aPhone.NotifyPreferredNetworksListChange(aReqStatus);
|
|
1562 |
aPhone.CancelAsyncRequest(EMobilePhoneNotifyStorePreferredNetworksListChange);
|
|
1563 |
User::WaitForRequest(aReqStatus);
|
|
1564 |
TEST(aReqStatus.Int() == KErrCancel);
|
|
1565 |
|
|
1566 |
|
|
1567 |
}
|
|
1568 |
|
|
1569 |
void CTestPhone::TestMobileCellInfoL(RMobilePhone& aPhone, TRequestStatus& aReqStatus)
|
|
1570 |
{
|
|
1571 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::TestMobileCellInfoL"), iTestCount++);
|
|
1572 |
|
|
1573 |
// test get API
|
|
1574 |
|
|
1575 |
RMobilePhone::TMobilePhoneCellInfoV9 expCellInfo;
|
|
1576 |
expCellInfo.iCellId = DMMTSY_PHONE_CELL_INFO_CELLID;
|
|
1577 |
expCellInfo.iMode = DMMTSY_PHONE_CELL_INFO_MODE;
|
|
1578 |
expCellInfo.iTimingAdvance = DMMTSY_PHONE_CELL_INFO_TIMING_ADVANCE;
|
|
1579 |
expCellInfo.iStatus = DMMTSY_PHONE_CELL_INFO_STATUS;
|
|
1580 |
|
|
1581 |
RMobilePhone::TMobilePhoneCellInfoV9 actCellInfo;
|
|
1582 |
RMobilePhone::TMobilePhoneCellInfoV9Pckg actCellInfoPckg(actCellInfo);
|
|
1583 |
|
|
1584 |
aPhone.GetCellInfo(aReqStatus,actCellInfoPckg);
|
|
1585 |
User::WaitForRequest(aReqStatus);
|
|
1586 |
|
|
1587 |
TEST(aReqStatus.Int()==KErrNone);
|
|
1588 |
TEST(actCellInfo.iCellId == expCellInfo.iCellId);
|
|
1589 |
TEST(actCellInfo.iMode == expCellInfo.iMode);
|
|
1590 |
TEST(actCellInfo.iTimingAdvance == expCellInfo.iTimingAdvance);
|
|
1591 |
TEST(actCellInfo.iStatus == expCellInfo.iStatus);
|
|
1592 |
|
|
1593 |
// test cancel get API
|
|
1594 |
|
|
1595 |
aPhone.GetCellInfo(aReqStatus,actCellInfoPckg);
|
|
1596 |
aPhone.CancelAsyncRequest(EMobilePhoneGetCellInfo);
|
|
1597 |
User::WaitForRequest(aReqStatus);
|
|
1598 |
TEST(aReqStatus.Int()==KErrNone || aReqStatus.Int()==KErrCancel);
|
|
1599 |
|
|
1600 |
// test notify API
|
|
1601 |
|
|
1602 |
RMobilePhone::TMobilePhoneCellInfoV9 expCellInfo2;
|
|
1603 |
expCellInfo2.iCellId = DMMTSY_PHONE_CELL_INFO_CELLID2;
|
|
1604 |
expCellInfo2.iMode = DMMTSY_PHONE_CELL_INFO_MODE2;
|
|
1605 |
expCellInfo2.iTimingAdvance = DMMTSY_PHONE_CELL_INFO_TIMING_ADVANCE2;
|
|
1606 |
expCellInfo2.iStatus = DMMTSY_PHONE_CELL_INFO_STATUS2;
|
|
1607 |
|
|
1608 |
aPhone.NotifyCellInfoChange(aReqStatus,actCellInfoPckg);
|
|
1609 |
User::WaitForRequest(aReqStatus);
|
|
1610 |
|
|
1611 |
TEST(aReqStatus.Int()==KErrNone);
|
|
1612 |
TEST(actCellInfo.iCellId == expCellInfo2.iCellId);
|
|
1613 |
TEST(actCellInfo.iMode == expCellInfo2.iMode);
|
|
1614 |
TEST(actCellInfo.iTimingAdvance == expCellInfo2.iTimingAdvance);
|
|
1615 |
TEST(actCellInfo.iStatus == expCellInfo2.iStatus);
|
|
1616 |
|
|
1617 |
// test cancel notify API
|
|
1618 |
|
|
1619 |
aPhone.NotifyCellInfoChange(aReqStatus,actCellInfoPckg);
|
|
1620 |
aPhone.CancelAsyncRequest(EMobilePhoneNotifyCellInfoChange);
|
|
1621 |
User::WaitForRequest(aReqStatus);
|
|
1622 |
TEST(aReqStatus.Int()==KErrNone || aReqStatus.Int()==KErrCancel);
|
|
1623 |
|
|
1624 |
}
|
|
1625 |
|
|
1626 |
void CTestPhone::TestMobileNetworkISVL(RMobilePhone& aPhone, TRequestStatus &aReqStatus)
|
|
1627 |
{
|
|
1628 |
// Get Current Network 3rdParty Info
|
|
1629 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::GetCurrentNetwork Etel3rdParty async."), iTestCount++);
|
|
1630 |
// asynchronous
|
|
1631 |
|
|
1632 |
RMobilePhone::TEtel3rdPartyMobileNetworkInfoV1 asyncCurrentNetworkISV;
|
|
1633 |
RMobilePhone::TEtel3rdPartyMobileNetworkInfoV1Pckg asyncCurrentNetworkISVPckg(asyncCurrentNetworkISV);
|
|
1634 |
RMobilePhone::TMobilePhoneLocationAreaV1 asyncLocArea;
|
|
1635 |
|
|
1636 |
aPhone.GetCurrentNetwork(aReqStatus, asyncCurrentNetworkISVPckg, asyncLocArea);
|
|
1637 |
User::WaitForRequest(aReqStatus);
|
|
1638 |
TEST(aReqStatus.Int()==KErrNone);
|
|
1639 |
|
|
1640 |
// extract the returned Current network info from the package
|
|
1641 |
asyncCurrentNetworkISV=asyncCurrentNetworkISVPckg();
|
|
1642 |
ValidateCurrentNetworkISV(asyncCurrentNetworkISV, asyncLocArea);
|
|
1643 |
|
|
1644 |
// asynchronous & cancel
|
|
1645 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::GetCurrentNetwork Etel3rdParty async & cancel."), iTestCount++);
|
|
1646 |
aPhone.GetCurrentNetwork(aReqStatus, asyncCurrentNetworkISVPckg, asyncLocArea);
|
|
1647 |
aPhone.CancelAsyncRequest(EMobilePhoneGetCurrentNetwork);
|
|
1648 |
User::WaitForRequest(aReqStatus);
|
|
1649 |
TEST(aReqStatus.Int()==KErrNone || aReqStatus.Int()==KErrCancel);
|
|
1650 |
|
|
1651 |
if (aReqStatus.Int()==KErrNone)
|
|
1652 |
{
|
|
1653 |
asyncCurrentNetworkISV=asyncCurrentNetworkISVPckg();
|
|
1654 |
ValidateCurrentNetworkISV(asyncCurrentNetworkISV, asyncLocArea);
|
|
1655 |
}
|
|
1656 |
|
|
1657 |
// Notify Current Network Change 3rdParty
|
|
1658 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::NotifyCurrentNetworkChange Etel3rdParty async."), iTestCount++);
|
|
1659 |
aPhone.NotifyCurrentNetworkChange(aReqStatus, asyncCurrentNetworkISVPckg, asyncLocArea);
|
|
1660 |
User::WaitForRequest(aReqStatus);
|
|
1661 |
TEST(aReqStatus.Int()==KErrNone);
|
|
1662 |
|
|
1663 |
asyncCurrentNetworkISV=asyncCurrentNetworkISVPckg();
|
|
1664 |
ValidateNotifyCurrentNetworkISVChange(asyncCurrentNetworkISV,asyncLocArea);
|
|
1665 |
|
|
1666 |
// asynchronous & cancel
|
|
1667 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::NotifyCurrentNetworkChange Etel3rdParty async & cancel."), iTestCount++);
|
|
1668 |
aPhone.NotifyCurrentNetworkChange(aReqStatus, asyncCurrentNetworkISVPckg, asyncLocArea);
|
|
1669 |
aPhone.CancelAsyncRequest(EMobilePhoneNotifyCurrentNetworkChange);
|
|
1670 |
User::WaitForRequest(aReqStatus);
|
|
1671 |
TEST(aReqStatus.Int()==KErrNone || aReqStatus.Int()==KErrCancel);
|
|
1672 |
if (aReqStatus.Int()==KErrNone)
|
|
1673 |
{
|
|
1674 |
asyncCurrentNetworkISV=asyncCurrentNetworkISVPckg();
|
|
1675 |
ValidateNotifyCurrentNetworkISVChange(asyncCurrentNetworkISV,asyncLocArea);
|
|
1676 |
}
|
|
1677 |
|
|
1678 |
|
|
1679 |
// Get Current Network Info - No Location
|
|
1680 |
|
|
1681 |
// asynchronous
|
|
1682 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::GetCurrentNetwork (No Location) async."), iTestCount++);
|
|
1683 |
RMobilePhone::TMobilePhoneNetworkInfoV1 asyncCurrentNetworkNoLoc;
|
|
1684 |
RMobilePhone::TMobilePhoneNetworkInfoV1Pckg asyncCurrentNetworkPckgNoLoc(asyncCurrentNetworkNoLoc);
|
|
1685 |
|
|
1686 |
aPhone.GetCurrentNetwork(aReqStatus, asyncCurrentNetworkPckgNoLoc);
|
|
1687 |
User::WaitForRequest(aReqStatus);
|
|
1688 |
TEST(aReqStatus.Int()==KErrNone);
|
|
1689 |
|
|
1690 |
// extract the returned Current network info from the package
|
|
1691 |
asyncCurrentNetworkNoLoc=asyncCurrentNetworkPckgNoLoc();
|
|
1692 |
ValidateCurrentNetwork(asyncCurrentNetworkNoLoc, asyncLocArea, EFalse);
|
|
1693 |
|
|
1694 |
// asynchronous & cancel
|
|
1695 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::GetCurrentNetwork async & cancel."), iTestCount++);
|
|
1696 |
aPhone.GetCurrentNetwork(aReqStatus, asyncCurrentNetworkPckgNoLoc);
|
|
1697 |
aPhone.CancelAsyncRequest(EMobilePhoneGetCurrentNetworkNoLocation);
|
|
1698 |
User::WaitForRequest(aReqStatus);
|
|
1699 |
|
|
1700 |
TEST(aReqStatus.Int()==KErrCancel || aReqStatus.Int()==KErrNone);
|
|
1701 |
if (aReqStatus.Int()==KErrNone)
|
|
1702 |
{
|
|
1703 |
asyncCurrentNetworkNoLoc=asyncCurrentNetworkPckgNoLoc();
|
|
1704 |
ValidateCurrentNetwork(asyncCurrentNetworkNoLoc, asyncLocArea, EFalse);
|
|
1705 |
}
|
|
1706 |
|
|
1707 |
|
|
1708 |
RMobilePhone::TMobilePhoneNetworkInfoV1 asyncCurrentNetwork;
|
|
1709 |
RMobilePhone::TMobilePhoneNetworkInfoV1Pckg asyncCurrentNetworkPckg(asyncCurrentNetwork);
|
|
1710 |
|
|
1711 |
// Notify Current Network Change - No Location
|
|
1712 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::NotifyCurrentNetworkChange (No Location) async."), iTestCount++);
|
|
1713 |
aPhone.NotifyCurrentNetworkChange(aReqStatus, asyncCurrentNetworkPckg);
|
|
1714 |
User::WaitForRequest(aReqStatus);
|
|
1715 |
TEST(aReqStatus.Int()==KErrNone);
|
|
1716 |
|
|
1717 |
asyncCurrentNetwork=asyncCurrentNetworkPckg();
|
|
1718 |
ValidateNotifyCurrentNetworkChange(asyncCurrentNetwork,asyncLocArea, EFalse);
|
|
1719 |
|
|
1720 |
// asynchronous & cancel
|
|
1721 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::NotifyCurrentNetworkChange (No Location) async & cancel."), iTestCount++);
|
|
1722 |
aPhone.NotifyCurrentNetworkChange(aReqStatus, asyncCurrentNetworkPckg);
|
|
1723 |
aPhone.CancelAsyncRequest(EMobilePhoneNotifyCurrentNetworkNoLocationChange);
|
|
1724 |
User::WaitForRequest(aReqStatus);
|
|
1725 |
TEST(aReqStatus.Int()==KErrNone || aReqStatus.Int()==KErrCancel);
|
|
1726 |
if (aReqStatus.Int()==KErrNone)
|
|
1727 |
{
|
|
1728 |
asyncCurrentNetwork=asyncCurrentNetworkPckg();
|
|
1729 |
ValidateNotifyCurrentNetworkChange(asyncCurrentNetwork,asyncLocArea, EFalse);
|
|
1730 |
}
|
|
1731 |
}
|
|
1732 |
|
|
1733 |
void CTestPhone::TestMobilePrivacyL(RMobilePhone& aPhone, TRequestStatus &aReqStatus)
|
|
1734 |
{
|
|
1735 |
RMobilePhone::TMobilePhonePrivacy privacySetting;
|
|
1736 |
|
|
1737 |
TEST(aPhone.GetDefaultPrivacy(privacySetting)==KErrNone);
|
|
1738 |
TEST(privacySetting==DMMTSY_PHONE_PRIVACY_SETTING1);
|
|
1739 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::GetDefaultPrivacy (sync) passed"), iTestCount++);
|
|
1740 |
|
|
1741 |
aPhone.SetDefaultPrivacy(aReqStatus, privacySetting);
|
|
1742 |
User::WaitForRequest(aReqStatus);
|
|
1743 |
TEST(aReqStatus.Int()==KErrNone);
|
|
1744 |
|
|
1745 |
aPhone.SetDefaultPrivacy(aReqStatus, privacySetting);
|
|
1746 |
aPhone.CancelAsyncRequest(EMobilePhoneSetDefaultPrivacy);
|
|
1747 |
User::WaitForRequest(aReqStatus);
|
|
1748 |
TEST(aReqStatus.Int()==KErrNone || aReqStatus.Int()==KErrCancel);
|
|
1749 |
if (aReqStatus.Int()==KErrCancel)
|
|
1750 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::SetDefaultPrivacy (async & cancel (Cancelled Request)) passed"), iTestCount++);
|
|
1751 |
else
|
|
1752 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::SetDefaultPrivacy (async & cancel (Request Not Cancelled)) passed"), iTestCount++);
|
|
1753 |
|
|
1754 |
aPhone.NotifyDefaultPrivacyChange(aReqStatus, privacySetting);
|
|
1755 |
User::WaitForRequest(aReqStatus);
|
|
1756 |
TEST(aReqStatus.Int()==KErrNone);
|
|
1757 |
TEST(privacySetting==DMMTSY_PHONE_PRIVACY_SETTING2);
|
|
1758 |
|
|
1759 |
aPhone.NotifyDefaultPrivacyChange(aReqStatus, privacySetting);
|
|
1760 |
aPhone.CancelAsyncRequest(EMobilePhoneNotifyDefaultPrivacyChange);
|
|
1761 |
User::WaitForRequest(aReqStatus);
|
|
1762 |
TEST(aReqStatus.Int()==KErrNone || aReqStatus.Int()==KErrCancel);
|
|
1763 |
if (aReqStatus.Int()==KErrCancel)
|
|
1764 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::NotifyDefaultPrivacyChange (async & cancel (Cancelled Request)) passed"), iTestCount++);
|
|
1765 |
else
|
|
1766 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::NotifyDefaultPrivacyChange (async & cancel (Request Not Cancelled)) passed"), iTestCount++);
|
|
1767 |
|
|
1768 |
// test.Next(_L("OK: RMobilePhone's MobilePhonePrivacy"));
|
|
1769 |
}
|
|
1770 |
|
|
1771 |
void CTestPhone::TestMobileCallServiceCapsL(RMobilePhone& aPhone, TRequestStatus &aReqStatus)
|
|
1772 |
{
|
|
1773 |
TUint32 caps;
|
|
1774 |
|
|
1775 |
// Get Call Service caps
|
|
1776 |
|
|
1777 |
TEST(aPhone.GetCallServiceCaps(caps)==KErrNone);
|
|
1778 |
TEST(caps==DMMTSY_PHONE_CALL_SERVICE_CAPS1);
|
|
1779 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::GetCallServiceCaps (sync) passed"), iTestCount++);
|
|
1780 |
|
|
1781 |
// Notify Call Service Caps Change
|
|
1782 |
|
|
1783 |
// asynchronous
|
|
1784 |
|
|
1785 |
aPhone.NotifyCallServiceCapsChange(aReqStatus, caps);
|
|
1786 |
User::WaitForRequest(aReqStatus);
|
|
1787 |
TEST(aReqStatus.Int()==KErrNone);
|
|
1788 |
TEST(caps==DMMTSY_PHONE_CALL_SERVICE_CAPS2);
|
|
1789 |
|
|
1790 |
// asynchronous & cancel
|
|
1791 |
|
|
1792 |
aPhone.NotifyCallServiceCapsChange(aReqStatus, caps);
|
|
1793 |
aPhone.CancelAsyncRequest(EMobilePhoneNotifyCallServiceCapsChange);
|
|
1794 |
User::WaitForRequest(aReqStatus);
|
|
1795 |
TEST(aReqStatus.Int()==KErrNone || aReqStatus.Int()==KErrCancel);
|
|
1796 |
if (aReqStatus.Int()==KErrCancel)
|
|
1797 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::NotifyCallServiceCapsChange (async & cancel (Cancelled Request)) passed"), iTestCount++);
|
|
1798 |
else
|
|
1799 |
{
|
|
1800 |
TEST(caps==DMMTSY_PHONE_CALL_SERVICE_CAPS2);
|
|
1801 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::NotifyCallServiceCapsChange (async & cancel (Request Not Cancelled)) passed"), iTestCount++);
|
|
1802 |
}
|
|
1803 |
// test.Next(_L("OK: RMobilePhone's MobilePhoneCallServiceCaps"));
|
|
1804 |
}
|
|
1805 |
|
|
1806 |
void CTestPhone::TestMobileUserNetworkL(RMobilePhone& aPhone, TRequestStatus &aReqStatus)
|
|
1807 |
{
|
|
1808 |
// Program a feature code
|
|
1809 |
TBuf<8> featureCode(DMMTSY_PHONE_FEATURE_CODE);
|
|
1810 |
RMobilePhone::TMobilePhoneNetworkService service=DMMTSY_PHONE_NETWORK_SERVICE;
|
|
1811 |
RMobilePhone::TMobilePhoneServiceAction serviceAction=DMMTSY_PHONE_NETWORK_SERVICE_ACTION;
|
|
1812 |
|
|
1813 |
// asynchronous
|
|
1814 |
|
|
1815 |
aPhone.ProgramFeatureCode(aReqStatus, featureCode, service,serviceAction);
|
|
1816 |
User::WaitForRequest(aReqStatus);
|
|
1817 |
TEST(aReqStatus.Int()==KErrNone);
|
|
1818 |
|
|
1819 |
// asynchronous & cancel
|
|
1820 |
|
|
1821 |
aPhone.ProgramFeatureCode(aReqStatus, featureCode, service,serviceAction);
|
|
1822 |
aPhone.CancelAsyncRequest(EMobilePhoneProgramFeatureCode);
|
|
1823 |
User::WaitForRequest(aReqStatus);
|
|
1824 |
TEST(aReqStatus.Int()==KErrNone || aReqStatus.Int()==KErrCancel);
|
|
1825 |
if (aReqStatus.Int()==KErrCancel)
|
|
1826 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::ProgramFeatureCode (async & cancel (Cancelled Request)) passed"), iTestCount++);
|
|
1827 |
else
|
|
1828 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::ProgramFeatureCode (async & cancel (Request Not Cancelled)) passed"), iTestCount++);
|
|
1829 |
|
|
1830 |
// Get a pre-programmed feature code
|
|
1831 |
|
|
1832 |
service=DMMTSY_PHONE_NETWORK_SERVICE2;
|
|
1833 |
serviceAction=DMMTSY_PHONE_NETWORK_SERVICE_ACTION2;
|
|
1834 |
|
|
1835 |
// asynchronous
|
|
1836 |
|
|
1837 |
TBuf<8> asyncGetFC;
|
|
1838 |
aPhone.GetFeatureCode(aReqStatus,asyncGetFC,service,serviceAction);
|
|
1839 |
User::WaitForRequest(aReqStatus);
|
|
1840 |
TEST(aReqStatus.Int()==KErrNone);
|
|
1841 |
TEST(asyncGetFC.Compare(DMMTSY_PHONE_FEATURE_CODE2) == 0);
|
|
1842 |
|
|
1843 |
// asynchronous & cancel
|
|
1844 |
|
|
1845 |
aPhone.GetFeatureCode(aReqStatus,asyncGetFC,service,serviceAction);
|
|
1846 |
aPhone.CancelAsyncRequest(EMobilePhoneGetFeatureCode);
|
|
1847 |
User::WaitForRequest(aReqStatus);
|
|
1848 |
TEST(aReqStatus.Int()==KErrNone || aReqStatus.Int()==KErrCancel);
|
|
1849 |
|
|
1850 |
if (aReqStatus.Int()==KErrCancel)
|
|
1851 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::GetFeatureCode (async & cancel (Cancelled Request)) passed"), iTestCount++);
|
|
1852 |
else
|
|
1853 |
{
|
|
1854 |
TEST(asyncGetFC.Compare(DMMTSY_PHONE_FEATURE_CODE2) == 0);
|
|
1855 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::GetFeatureCode (async & cancel (Request Not Cancelled)) passed"), iTestCount++);
|
|
1856 |
}
|
|
1857 |
|
|
1858 |
// Send Network Service Request
|
|
1859 |
|
|
1860 |
TBuf<20> serviceRequest(DMMTSY_PHONE_NETWORK_SERVICE_REQUEST);
|
|
1861 |
|
|
1862 |
// asynchronous
|
|
1863 |
|
|
1864 |
aPhone.SendNetworkServiceRequest(aReqStatus, serviceRequest);
|
|
1865 |
User::WaitForRequest(aReqStatus);
|
|
1866 |
TEST(aReqStatus.Int()==KErrNone);
|
|
1867 |
|
|
1868 |
// asynchronous & cancel
|
|
1869 |
|
|
1870 |
aPhone.SendNetworkServiceRequest(aReqStatus, serviceRequest);
|
|
1871 |
aPhone.CancelAsyncRequest(EMobilePhoneSendNetworkServiceRequest);
|
|
1872 |
User::WaitForRequest(aReqStatus);
|
|
1873 |
TEST(aReqStatus.Int()==KErrNone || aReqStatus.Int()==KErrCancel);
|
|
1874 |
|
|
1875 |
if (aReqStatus.Int()==KErrCancel)
|
|
1876 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::SendNetworkServiceRequest (async & cancel (Cancelled Request)) passed"), iTestCount++);
|
|
1877 |
else
|
|
1878 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::SendNetworkServiceRequest (async & cancel (Request Not Cancelled)) passed"), iTestCount++);
|
|
1879 |
|
|
1880 |
// test.Next(_L("OK: RMobilePhone's MobilePhoneUserNetworkAccess"));
|
|
1881 |
|
|
1882 |
// Notify Send Network Service Request
|
|
1883 |
|
|
1884 |
//asynchronous
|
|
1885 |
|
|
1886 |
RMobilePhone::TMobilePhoneSendSSRequestV3 ssRequest;
|
|
1887 |
RMobilePhone::TMobilePhoneSendSSRequestV3Pckg ssRequestPckg(ssRequest);
|
|
1888 |
|
|
1889 |
aPhone.NotifySendNetworkServiceRequest(aReqStatus, DMMTSY_PHONE_NOTIFY_SERVICEREQUEST, ssRequestPckg);
|
|
1890 |
User::WaitForRequest(aReqStatus);
|
|
1891 |
TEST(aReqStatus.Int()==KErrNone);
|
|
1892 |
TEST(ssRequest.iOpCode == DMMTSY_PHONE_NOTIFY_OPCODE);
|
|
1893 |
TEST(ssRequest.iAdditionalInfo == DMMTSY_PHONE_NOTIFY_ADDINFO);
|
|
1894 |
|
|
1895 |
//asynchronous & cancel
|
|
1896 |
|
|
1897 |
aPhone.NotifySendNetworkServiceRequest(aReqStatus, DMMTSY_PHONE_NOTIFY_SERVICEREQUEST, ssRequestPckg);
|
|
1898 |
aPhone.CancelAsyncRequest(EMobilePhoneNotifySendNetworkServiceRequest);
|
|
1899 |
User::WaitForRequest(aReqStatus);
|
|
1900 |
|
|
1901 |
if (aReqStatus.Int()==KErrCancel)
|
|
1902 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::NotifySendNetworkServiceRequest (async & cancel (Cancelled Request)) passed"), iTestCount++);
|
|
1903 |
else
|
|
1904 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::NotifySendNetworkServiceRequest (async & cancel (Request Not Cancelled)) passed"), iTestCount++);
|
|
1905 |
//Test for NotifyAllSendNetworkServiceRequest, which returns type of SS operation notification
|
|
1906 |
RMobilePhone::TMobilePhoneNotifySendSSOperation ssOperation = RMobilePhone::ESendSSInvoke;
|
|
1907 |
aPhone.NotifyAllSendNetworkServiceRequest(aReqStatus, ssOperation, ssRequestPckg);
|
|
1908 |
User::WaitForRequest(aReqStatus);
|
|
1909 |
TEST(aReqStatus.Int()==KErrNone);
|
|
1910 |
TEST(ssOperation == DMMTSY_PHONE_NOTIFY_SERVICEREQUEST_ERROR);
|
|
1911 |
TEST(ssRequest.iOpCode == DMMTSY_PHONE_NOTIFY_RETURN_ERROR_PROBLEM_CODE);
|
|
1912 |
TEST(ssRequest.iAdditionalInfo == DMMTSY_PHONE_NOTIFY_ADDINFO);
|
|
1913 |
|
|
1914 |
//asynchronous & cancel
|
|
1915 |
aPhone.NotifyAllSendNetworkServiceRequest(aReqStatus, ssOperation, ssRequestPckg);
|
|
1916 |
aPhone.CancelAsyncRequest(EMobilePhoneNotifyAllSendNetworkServiceRequest);
|
|
1917 |
User::WaitForRequest(aReqStatus);
|
|
1918 |
|
|
1919 |
if (aReqStatus.Int()==KErrCancel)
|
|
1920 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::NotifyAllSendNetworkServiceRequest (async & cancel (Cancelled Request)) passed"), iTestCount++);
|
|
1921 |
else
|
|
1922 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::NotifyAllSendNetworkServiceRequest (async & cancel (Request Not Cancelled)) passed"), iTestCount++);
|
|
1923 |
|
|
1924 |
}
|
|
1925 |
|
|
1926 |
void CTestPhone::TestMobileCallForwardingL(RMobilePhone& aPhone, TRequestStatus &aReqStatus)
|
|
1927 |
{
|
|
1928 |
// Get Call Forwarding Status
|
|
1929 |
|
|
1930 |
RMobilePhone::TMobilePhoneCFCondition condition=DMMTSY_PHONE_CF_CONDITION_CFU;
|
|
1931 |
|
|
1932 |
//Test deletion of list object whilst async request in progress
|
|
1933 |
CRetrieveMobilePhoneCFList* retrieve=CRetrieveMobilePhoneCFList::NewL(aPhone);
|
|
1934 |
retrieve->Start(aReqStatus, DMMTSY_PHONE_CF_CONDITION_CFU, DMMTSY_PHONE_CF_LOCATION);
|
|
1935 |
delete retrieve;
|
|
1936 |
retrieve = NULL;
|
|
1937 |
User::WaitForRequest(aReqStatus);
|
|
1938 |
TEST(aReqStatus == KErrCancel);
|
|
1939 |
|
|
1940 |
// Get call forwarding status using asynchronous AO version
|
|
1941 |
CTestGetCFStatus* getCFStatus=CTestGetCFStatus::NewLC(aPhone, this);
|
|
1942 |
getCFStatus->Start();
|
|
1943 |
CActiveScheduler::Start();
|
|
1944 |
|
|
1945 |
// Ensure that AO can be used to retrieve more than one list.
|
|
1946 |
|
|
1947 |
getCFStatus->Start();
|
|
1948 |
CActiveScheduler::Start();
|
|
1949 |
//Test version of CRetrieveMobilePhoneCFList::Start() which passes a service group, passing the EFaxService service group
|
|
1950 |
getCFStatus->StartSingleServiceGroup();
|
|
1951 |
CActiveScheduler::Start();
|
|
1952 |
|
|
1953 |
// I only need to delete the search object because the destructor
|
|
1954 |
// of this will also delete the list object.
|
|
1955 |
CleanupStack::PopAndDestroy(); // getCFStatus
|
|
1956 |
|
|
1957 |
// Now test the cancelling
|
|
1958 |
|
|
1959 |
getCFStatus=CTestGetCFStatus::NewLC(aPhone, this);
|
|
1960 |
getCFStatus->Start();
|
|
1961 |
|
|
1962 |
CTestCanceller* cancelGetCFStatus = getCFStatus->RetrieveCancelPtr();
|
|
1963 |
cancelGetCFStatus->Call();
|
|
1964 |
|
|
1965 |
CActiveScheduler::Start();
|
|
1966 |
TBool cancelled = (getCFStatus->iStatus == KErrCancel);
|
|
1967 |
|
|
1968 |
// Ensure that AO can be used even after previous request was cancelled.
|
|
1969 |
|
|
1970 |
getCFStatus->Start();
|
|
1971 |
CActiveScheduler::Start();
|
|
1972 |
|
|
1973 |
if (cancelled)
|
|
1974 |
INFO_PRINTF2(_L("Test %d - CRetrieveMobilePhoneCFList (async & cancel (Cancelled Request)) passed"), iTestCount++);
|
|
1975 |
else
|
|
1976 |
INFO_PRINTF2(_L("Test %d - CRetrieveMobilePhoneCFList (async & cancel (Request Not Cancelled)) passed"), iTestCount++);
|
|
1977 |
|
|
1978 |
CleanupStack::PopAndDestroy(); // getCFStatus
|
|
1979 |
|
|
1980 |
// Notify Call Forwarding Status
|
|
1981 |
|
|
1982 |
// asynchronous
|
|
1983 |
|
|
1984 |
aPhone.NotifyCallForwardingStatusChange(aReqStatus, condition);
|
|
1985 |
User::WaitForRequest(aReqStatus);
|
|
1986 |
TEST(aReqStatus.Int()==KErrNone);
|
|
1987 |
TEST(condition==DMMTSY_PHONE_CF_CONDITION_ALL);
|
|
1988 |
|
|
1989 |
// asynchronous & cancel
|
|
1990 |
|
|
1991 |
aPhone.NotifyCallForwardingStatusChange(aReqStatus, condition);
|
|
1992 |
aPhone.CancelAsyncRequest(EMobilePhoneNotifyCallForwardingStatusChange);
|
|
1993 |
User::WaitForRequest(aReqStatus);
|
|
1994 |
TEST(aReqStatus.Int()==KErrNone || aReqStatus.Int()==KErrCancel);
|
|
1995 |
if (aReqStatus.Int()==KErrCancel)
|
|
1996 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::NotifyCallForwardingStatusChange (async & cancel (Cancelled Request)) passed"), iTestCount++);
|
|
1997 |
else
|
|
1998 |
{
|
|
1999 |
TEST(condition==DMMTSY_PHONE_CF_CONDITION_ALL);
|
|
2000 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::NotifyCallForwardingStatusChange (async & cancel (Request Not Cancelled)) passed"), iTestCount++);
|
|
2001 |
}
|
|
2002 |
|
|
2003 |
// Set Call Forwarding Status
|
|
2004 |
|
|
2005 |
condition=DMMTSY_PHONE_CF_CONDITION_CFNRy;
|
|
2006 |
|
|
2007 |
RMobilePhone::TMobilePhoneCFChangeV1 newSetting;
|
|
2008 |
newSetting.iServiceGroup=DMMTSY_PHONE_CF_SERVICE_GROUP_VOICE;
|
|
2009 |
newSetting.iAction=DMMTSY_PHONE_CF_SETTING;
|
|
2010 |
newSetting.iNumber.iTelNumber=DMMTSY_PHONE_TEL_NUMBER;
|
|
2011 |
newSetting.iTimeout=DMMTSY_PHONE_CF_TIMEOUT;
|
|
2012 |
|
|
2013 |
// asynchronous
|
|
2014 |
|
|
2015 |
aPhone.SetCallForwardingStatus(aReqStatus, condition, newSetting);
|
|
2016 |
User::WaitForRequest(aReqStatus);
|
|
2017 |
TEST(aReqStatus.Int()==KErrNone);
|
|
2018 |
|
|
2019 |
// asynchronous & cancel
|
|
2020 |
|
|
2021 |
aPhone.SetCallForwardingStatus(aReqStatus, condition, newSetting);
|
|
2022 |
aPhone.CancelAsyncRequest(EMobilePhoneSetCallForwardingStatus);
|
|
2023 |
User::WaitForRequest(aReqStatus);
|
|
2024 |
TEST(aReqStatus.Int()==KErrNone || aReqStatus.Int()==KErrCancel);
|
|
2025 |
if (aReqStatus.Int()==KErrCancel)
|
|
2026 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::SetCallForwardingStatus (async & cancel (Cancelled Request)) passed"), iTestCount++);
|
|
2027 |
else
|
|
2028 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::SetCallForwardingStatus (async & cancel (Request Not Cancelled))passed"), iTestCount++);
|
|
2029 |
|
|
2030 |
// Notify Call Forwarding Active
|
|
2031 |
RMobilePhone::TMobilePhoneCFActive active;
|
|
2032 |
RMobilePhone::TMobileService serviceGroup;
|
|
2033 |
|
|
2034 |
aPhone.NotifyCallForwardingActive(aReqStatus, serviceGroup, active);
|
|
2035 |
User::WaitForRequest(aReqStatus);
|
|
2036 |
TEST(aReqStatus.Int()==KErrNone);
|
|
2037 |
TEST(active==DMMTSY_PHONE_CF_ACTIVE_TYPE);
|
|
2038 |
TEST(serviceGroup==DMMTSY_PHONE_CF_SERVICE_GROUP_FAX);
|
|
2039 |
|
|
2040 |
// asynchronous & cancel
|
|
2041 |
|
|
2042 |
aPhone.NotifyCallForwardingActive(aReqStatus, serviceGroup, active);
|
|
2043 |
aPhone.CancelAsyncRequest(EMobilePhoneNotifyCallForwardingActive);
|
|
2044 |
User::WaitForRequest(aReqStatus);
|
|
2045 |
TEST(aReqStatus.Int()==KErrNone || aReqStatus.Int()==KErrCancel);
|
|
2046 |
if (aReqStatus.Int()==KErrCancel)
|
|
2047 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::NotifyCallForwardingActive (async & cancel (Cancelled Request)) passed"), iTestCount++);
|
|
2048 |
else
|
|
2049 |
{
|
|
2050 |
TEST(active==DMMTSY_PHONE_CF_ACTIVE_TYPE);
|
|
2051 |
TEST(serviceGroup==DMMTSY_PHONE_CF_SERVICE_GROUP_FAX);
|
|
2052 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::NotifyCallForwardingActive (async & cancel (Request Not Cancelled)) passed"), iTestCount++);
|
|
2053 |
}
|
|
2054 |
|
|
2055 |
//Testing GetCallForwardingIndicator
|
|
2056 |
RMobilePhone::TMobilePhoneCFUIndicatorV3 cfuIndicatorV3;
|
|
2057 |
RMobilePhone::TMobilePhoneCFUIndicatorV3Pckg cfuIndicatorV3Packg(cfuIndicatorV3);
|
|
2058 |
cfuIndicatorV3.iIndicator = DMMTSY_PHONE_CFU_INDICATOR;
|
|
2059 |
|
|
2060 |
// asynchronous
|
|
2061 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::GetCallForwardingIndicator async."), iTestCount++);
|
|
2062 |
aPhone.GetCallForwardingIndicator(aReqStatus, cfuIndicatorV3Packg);
|
|
2063 |
User::WaitForRequest(aReqStatus);
|
|
2064 |
TEST(aReqStatus.Int()==KErrNone);
|
|
2065 |
TEST(cfuIndicatorV3.iIndicator == DMMTSY_PHONE_CFU_INDICATOR);
|
|
2066 |
|
|
2067 |
// asynchronous & cancel
|
|
2068 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::GetCallForwardingIndicator async & cancel."), iTestCount++);
|
|
2069 |
aPhone.GetCallForwardingIndicator(aReqStatus, cfuIndicatorV3Packg);
|
|
2070 |
aPhone.CancelAsyncRequest(EMobilePhoneGetCallForwardingIndicator);
|
|
2071 |
User::WaitForRequest(aReqStatus);
|
|
2072 |
TEST(aReqStatus.Int()==KErrCancel);
|
|
2073 |
//Testing TMobilePhoneCFUIndicatorV6 data structures.
|
|
2074 |
//Testing GetCallForwardingIndicator
|
|
2075 |
RMobilePhone::TMobilePhoneCFUIndicatorV6 cfuIndicatorV6;
|
|
2076 |
RMobilePhone::TMobilePhoneCFUIndicatorV6Pckg cfuIndicatorV6Packg(cfuIndicatorV6);
|
|
2077 |
|
|
2078 |
// asynchronous
|
|
2079 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::GetCallForwardingIndicatorV6 async."), iTestCount++);
|
|
2080 |
aPhone.GetCallForwardingIndicator(aReqStatus, cfuIndicatorV6Packg);
|
|
2081 |
User::WaitForRequest(aReqStatus);
|
|
2082 |
TEST(aReqStatus.Int()==KErrNone);
|
|
2083 |
TEST(cfuIndicatorV6.iIndicator == DMMTSY_PHONE_CFU_INDICATOR1);
|
|
2084 |
TEST(cfuIndicatorV6.iCFNumber.iTypeOfNumber == DMMTSY_PHONE_CFU_TON);
|
|
2085 |
TEST(cfuIndicatorV6.iCFNumber.iNumberPlan == DMMTSY_PHONE_CFU_NPI);
|
|
2086 |
TEST(cfuIndicatorV6.iCFNumber.iTelNumber == DMMTSY_PHONE_CFU_TELNUMBER);
|
|
2087 |
TEST(cfuIndicatorV6.iMultipleSubscriberProfileID == DMMTSY_PHONE_CFU_MSP);
|
|
2088 |
// asynchronous & cancel
|
|
2089 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::GetCallForwardingIndicatorV6 async & cancel."), iTestCount++);
|
|
2090 |
aPhone.GetCallForwardingIndicator(aReqStatus, cfuIndicatorV6Packg);
|
|
2091 |
aPhone.CancelAsyncRequest(EMobilePhoneGetCallForwardingIndicator);
|
|
2092 |
User::WaitForRequest(aReqStatus);
|
|
2093 |
TEST(aReqStatus.Int()==KErrCancel);
|
|
2094 |
|
|
2095 |
// test.Next(_L("OK: RMobilePhone's MobilePhoneCallForwarding"));
|
|
2096 |
}
|
|
2097 |
|
|
2098 |
|
|
2099 |
void CTestPhone::TestMobileIdentityServiceL(RMobilePhone& aPhone, TRequestStatus &aReqStatus)
|
|
2100 |
{
|
|
2101 |
// Test Get Identity Service Status
|
|
2102 |
|
|
2103 |
// asynchronous
|
|
2104 |
|
|
2105 |
RMobilePhone::TMobilePhoneIdServiceStatus idServiceStatus;
|
|
2106 |
aPhone.GetIdentityServiceStatus(aReqStatus,DMMTSY_PHONE_ID_SERVICE,idServiceStatus,DMMTSY_PHONE_ID_LOCATION);
|
|
2107 |
User::WaitForRequest(aReqStatus);
|
|
2108 |
TEST(aReqStatus.Int() == KErrNone);
|
|
2109 |
TEST(idServiceStatus == DMMTSY_PHONE_ID_STATUS);
|
|
2110 |
|
|
2111 |
// asynchronous and cancel
|
|
2112 |
|
|
2113 |
aPhone.GetIdentityServiceStatus(aReqStatus,DMMTSY_PHONE_ID_SERVICE,idServiceStatus,DMMTSY_PHONE_ID_LOCATION);
|
|
2114 |
aPhone.CancelAsyncRequest(EMobilePhoneGetIdentityServiceStatus);
|
|
2115 |
User::WaitForRequest(aReqStatus);
|
|
2116 |
TEST(aReqStatus.Int() == KErrNone || aReqStatus.Int() == KErrCancel);
|
|
2117 |
if (aReqStatus.Int() == KErrCancel)
|
|
2118 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::GetIdentityServiceStatus (async & cancel (Cancelled Request)) passed"), iTestCount++);
|
|
2119 |
else
|
|
2120 |
{
|
|
2121 |
TEST(idServiceStatus == DMMTSY_PHONE_ID_STATUS);
|
|
2122 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::GetIdentityServiceStatus (async & cancel (Request Not Cancelled)) passed"), iTestCount++);
|
|
2123 |
}
|
|
2124 |
|
|
2125 |
//Test NotifyIdentityServiceStatus
|
|
2126 |
|
|
2127 |
// asynchronous
|
|
2128 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::NotifyIdentityServiceStatus async."), iTestCount++);
|
|
2129 |
RMobilePhone::TMobilePhoneIdServiceStatus idNotifyServiceStatus;
|
|
2130 |
aPhone.NotifyIdentityServiceStatus(aReqStatus,DMMTSY_PHONE_ID_SERVICE,idNotifyServiceStatus);
|
|
2131 |
User::WaitForRequest(aReqStatus);
|
|
2132 |
TEST(aReqStatus.Int() == KErrNone);
|
|
2133 |
TEST(idNotifyServiceStatus == DMMTSY_PHONE_ID_STATUS);
|
|
2134 |
|
|
2135 |
// asynchronous and cancel
|
|
2136 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::NotifyIdentityServiceStatus async & cancel."), iTestCount++);
|
|
2137 |
aPhone.NotifyIdentityServiceStatus(aReqStatus,DMMTSY_PHONE_ID_SERVICE,idNotifyServiceStatus);
|
|
2138 |
aPhone.CancelAsyncRequest(EMobilePhoneNotifyIdentityServiceStatus);
|
|
2139 |
User::WaitForRequest(aReqStatus);
|
|
2140 |
TEST(aReqStatus.Int() == KErrCancel);
|
|
2141 |
|
|
2142 |
//Test SetIdentityServiceStatus
|
|
2143 |
|
|
2144 |
// asynchronous
|
|
2145 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::GetIdentityServiceStatus async."), iTestCount++);
|
|
2146 |
aPhone.SetIdentityServiceStatus(aReqStatus,DMMTSY_PHONE_ID_SERVICE,DMMTSY_PHONE_ID_SETTING);
|
|
2147 |
User::WaitForRequest(aReqStatus);
|
|
2148 |
TEST(aReqStatus.Int() == KErrNone);
|
|
2149 |
|
|
2150 |
// asynchronous and cancel
|
|
2151 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::GetIdentityServiceStatus async & cancel."), iTestCount++);
|
|
2152 |
aPhone.SetIdentityServiceStatus(aReqStatus,DMMTSY_PHONE_ID_SERVICE,DMMTSY_PHONE_ID_SETTING);
|
|
2153 |
aPhone.CancelAsyncRequest(EMobilePhoneSetIdentityServiceStatus);
|
|
2154 |
User::WaitForRequest(aReqStatus);
|
|
2155 |
TEST(aReqStatus.Int() == KErrCancel);
|
|
2156 |
|
|
2157 |
//Test NotifyIdentitySuppressionRejected
|
|
2158 |
|
|
2159 |
// asynchronous
|
|
2160 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::NotifyIdentitySuppressionRejected async."), iTestCount++);
|
|
2161 |
aPhone.NotifyIdentitySuppressionRejected(aReqStatus);
|
|
2162 |
User::WaitForRequest(aReqStatus);
|
|
2163 |
TEST(aReqStatus.Int() == KErrNone);
|
|
2164 |
|
|
2165 |
// asynchronous and cancel
|
|
2166 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::NotifyIdentitySuppressionRejected async & cancel."), iTestCount++);
|
|
2167 |
aPhone.NotifyIdentitySuppressionRejected(aReqStatus);
|
|
2168 |
aPhone.CancelAsyncRequest(EMobilePhoneNotifyIdentitySuppressionRejected);
|
|
2169 |
User::WaitForRequest(aReqStatus);
|
|
2170 |
TEST(aReqStatus.Int() == KErrCancel);
|
|
2171 |
|
|
2172 |
}
|
|
2173 |
|
|
2174 |
void CTestPhone::TestMobileCallBarringL(RMobilePhone& aPhone, TRequestStatus &aReqStatus)
|
|
2175 |
{
|
|
2176 |
//
|
|
2177 |
// Mobile Phone Call Barring Functional Unit
|
|
2178 |
//
|
|
2179 |
|
|
2180 |
//Test deletion of list object whilst async request in progress
|
|
2181 |
CRetrieveMobilePhoneCBList* retrieve=CRetrieveMobilePhoneCBList::NewL(aPhone);
|
|
2182 |
retrieve->Start(aReqStatus, DMMTSY_PHONE_CB_CONDITION, DMMTSY_PHONE_CB_LOCATION);
|
|
2183 |
delete retrieve;
|
|
2184 |
retrieve = NULL;
|
|
2185 |
User::WaitForRequest(aReqStatus);
|
|
2186 |
TEST(aReqStatus == KErrCancel);
|
|
2187 |
|
|
2188 |
// Get call barring list using asynchronous AO version
|
|
2189 |
CTestGetCB* getCB=CTestGetCB::NewLC(aPhone, this);
|
|
2190 |
getCB->Start();
|
|
2191 |
CActiveScheduler::Start();
|
|
2192 |
|
|
2193 |
// Ensure that same AO can be used to retrieve more than one list
|
|
2194 |
|
|
2195 |
getCB->Start();
|
|
2196 |
CActiveScheduler::Start();
|
|
2197 |
|
|
2198 |
|
|
2199 |
CleanupStack::PopAndDestroy(); // getCB
|
|
2200 |
|
|
2201 |
// Now test the cancelling
|
|
2202 |
|
|
2203 |
getCB=CTestGetCB::NewLC(aPhone, this);
|
|
2204 |
getCB->Start();
|
|
2205 |
|
|
2206 |
CTestCanceller* cancelGetCB = getCB->RetrieveCancelPtr();
|
|
2207 |
cancelGetCB->Call();
|
|
2208 |
|
|
2209 |
CActiveScheduler::Start();
|
|
2210 |
TBool cancelled = (getCB->iStatus == KErrCancel);
|
|
2211 |
|
|
2212 |
getCB->Start();
|
|
2213 |
CActiveScheduler::Start();
|
|
2214 |
|
|
2215 |
if (cancelled)
|
|
2216 |
INFO_PRINTF2(_L("Test %d - CRetrieveMobilePhoneCBList (async & cancel (Cancelled Request)) passed"), iTestCount++);
|
|
2217 |
else
|
|
2218 |
INFO_PRINTF2(_L("Test %d - CRetrieveMobilePhoneCBList (async & cancel (Request Not Cancelled)) passed"), iTestCount++);
|
|
2219 |
|
|
2220 |
CleanupStack::PopAndDestroy(); // getCB
|
|
2221 |
|
|
2222 |
|
|
2223 |
// Test Set Call Barring Status
|
|
2224 |
|
|
2225 |
RMobilePhone::TMobilePhoneCBChangeV1 cbChange;
|
|
2226 |
|
|
2227 |
// asynchronous
|
|
2228 |
|
|
2229 |
cbChange.iAction = DMMTSY_PHONE_CB_ACTION;
|
|
2230 |
cbChange.iPassword = DMMTSY_PHONE_CB_PASSWORD;
|
|
2231 |
aPhone.SetCallBarringStatus(aReqStatus,DMMTSY_PHONE_CB_CONDITION,cbChange);
|
|
2232 |
User::WaitForRequest(aReqStatus);
|
|
2233 |
TEST(aReqStatus.Int() == KErrNone);
|
|
2234 |
|
|
2235 |
// asynchronous & cancel
|
|
2236 |
|
|
2237 |
aPhone.SetCallBarringStatus(aReqStatus,DMMTSY_PHONE_CB_CONDITION,cbChange);
|
|
2238 |
aPhone.CancelAsyncRequest(EMobilePhoneSetCallBarringStatus);
|
|
2239 |
User::WaitForRequest(aReqStatus);
|
|
2240 |
TEST(aReqStatus.Int() == KErrNone || aReqStatus.Int() == KErrCancel);
|
|
2241 |
if (aReqStatus.Int() == KErrCancel)
|
|
2242 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::SetCallBarringStatus (async & cancel (Cancelled Request)) passed"), iTestCount++);
|
|
2243 |
else
|
|
2244 |
INFO_PRINTF2(_L("Test %d - CRetrieveMobilePhoneCBList (async & cancel (Request Not Cancelled)) passed"), iTestCount++);
|
|
2245 |
|
|
2246 |
|
|
2247 |
// Test NotifyCallBarring Status Change
|
|
2248 |
|
|
2249 |
RMobilePhone::TMobilePhoneCBCondition cbCondition;
|
|
2250 |
|
|
2251 |
// asynchronous
|
|
2252 |
|
|
2253 |
aPhone.NotifyCallBarringStatusChange(aReqStatus,cbCondition);
|
|
2254 |
User::WaitForRequest(aReqStatus);
|
|
2255 |
TEST(aReqStatus.Int() == KErrNone);
|
|
2256 |
TEST(cbCondition == DMMTSY_PHONE_CB_CONDITION);
|
|
2257 |
|
|
2258 |
// asynchronous & cancel
|
|
2259 |
|
|
2260 |
aPhone.NotifyCallBarringStatusChange(aReqStatus,cbCondition);
|
|
2261 |
aPhone.CancelAsyncRequest(EMobilePhoneNotifyCallBarringStatusChange);
|
|
2262 |
User::WaitForRequest(aReqStatus);
|
|
2263 |
TEST(aReqStatus.Int() == KErrNone || aReqStatus.Int() == KErrCancel);
|
|
2264 |
if (aReqStatus.Int() == KErrCancel)
|
|
2265 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::NotifyCallBarringStatusChange (async & cancel (Cancelled Request)) passed"), iTestCount++);
|
|
2266 |
else
|
|
2267 |
{
|
|
2268 |
TEST(cbCondition == DMMTSY_PHONE_CB_CONDITION);
|
|
2269 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::NotifyCallBarringStatusChange (async & cancel (Request Not Cancelled)) passed"), iTestCount++);
|
|
2270 |
}
|
|
2271 |
|
|
2272 |
// Test Set Call Barring Password V1 & V2
|
|
2273 |
|
|
2274 |
RMobilePhone::TMobilePhonePasswordChangeV1 cbPasswordChange;
|
|
2275 |
|
|
2276 |
// asynchronous Version 1
|
|
2277 |
cbPasswordChange.iOldPassword = DMMTSY_PHONE_CB_PASSWORD;
|
|
2278 |
cbPasswordChange.iNewPassword = DMMTSY_PHONE_CB_NEW_PASSWORD;
|
|
2279 |
aPhone.SetCallBarringPassword(aReqStatus,cbPasswordChange);
|
|
2280 |
User::WaitForRequest(aReqStatus);
|
|
2281 |
TEST(aReqStatus.Int() == KErrNone);
|
|
2282 |
|
|
2283 |
// asynchronous & cancel
|
|
2284 |
aPhone.SetCallBarringPassword(aReqStatus,cbPasswordChange);
|
|
2285 |
aPhone.CancelAsyncRequest(EMobilePhoneSetCallBarringPassword);
|
|
2286 |
User::WaitForRequest(aReqStatus);
|
|
2287 |
TEST(aReqStatus.Int() == KErrNone || aReqStatus.Int() == KErrCancel);
|
|
2288 |
if (aReqStatus.Int() == KErrCancel)
|
|
2289 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::SetCallBarringPassword (async & cancel (Cancelled Request)) passed"), iTestCount++);
|
|
2290 |
else
|
|
2291 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::SetCallBarringPassword (async & cancel (Request Not Cancelled)) passed"), iTestCount++);
|
|
2292 |
|
|
2293 |
// asynchronous Version 2
|
|
2294 |
RMobilePhone::TMobilePhonePasswordChangeV2 passwordPackageV2;
|
|
2295 |
passwordPackageV2.iOldPassword = DMMTSY_PHONE_CB_PASSWORD;
|
|
2296 |
passwordPackageV2.iNewPassword = DMMTSY_PHONE_CB_NEW_PASSWORD;
|
|
2297 |
passwordPackageV2.iVerifiedPassword = DMMTSY_PHONE_CB_VERIFIED_PASSWORD;
|
|
2298 |
RMobilePhone::TMobilePhonePasswordChangeV2Pckg ppPckgV2(passwordPackageV2);
|
|
2299 |
|
|
2300 |
aPhone.SetSSPassword(aReqStatus, ppPckgV2, DMMTSY_PHONE_CB_ALL_SERVICES );
|
|
2301 |
User::WaitForRequest(aReqStatus);
|
|
2302 |
TEST(aReqStatus.Int() == KErrNone);
|
|
2303 |
|
|
2304 |
// asynchronous & cancel Version 2
|
|
2305 |
aPhone.SetSSPassword(aReqStatus, ppPckgV2, DMMTSY_PHONE_CB_ALL_SERVICES );
|
|
2306 |
aPhone.CancelAsyncRequest(EMobilePhoneSetSSPassword);
|
|
2307 |
User::WaitForRequest(aReqStatus);
|
|
2308 |
TEST(aReqStatus.Int() == KErrNone || aReqStatus.Int() == KErrCancel);
|
|
2309 |
|
|
2310 |
if (aReqStatus.Int() == KErrCancel)
|
|
2311 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::SetSSPassword (async & cancel (Cancelled Request)) passed"), iTestCount++);
|
|
2312 |
else
|
|
2313 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::SetSSPassword (async & cancel (Request Not Cancelled)) passed"), iTestCount++);
|
|
2314 |
|
|
2315 |
//Testing GetCompMethodName
|
|
2316 |
|
|
2317 |
//asynchronous
|
|
2318 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::GetCompMethodName async."), iTestCount++);
|
|
2319 |
TBuf<10> alphatag;
|
|
2320 |
aPhone.GetCompMethodName(aReqStatus, alphatag, DMMTSY_PHONE_CB_COMP_METHOD_ID);
|
|
2321 |
User::WaitForRequest(aReqStatus);
|
|
2322 |
TEST(aReqStatus.Int() == KErrNone);
|
|
2323 |
TEST(alphatag.Compare(DMMTSY_PHONE_CB_ALPHA_TAG)==0);
|
|
2324 |
|
|
2325 |
//asynchronous & cancel
|
|
2326 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::GetCompMethodName async & cancel."), iTestCount++);
|
|
2327 |
aPhone.GetCompMethodName(aReqStatus, alphatag, DMMTSY_PHONE_CB_COMP_METHOD_ID);
|
|
2328 |
aPhone.CancelAsyncRequest(EMobilePhoneGetCompMethodName);
|
|
2329 |
User::WaitForRequest(aReqStatus);
|
|
2330 |
TEST(aReqStatus.Int() == KErrCancel);
|
|
2331 |
|
|
2332 |
}
|
|
2333 |
|
|
2334 |
void CTestPhone::TestMobileCallWaitingL(RMobilePhone& aPhone, TRequestStatus &aReqStatus)
|
|
2335 |
{
|
|
2336 |
|
|
2337 |
//Test deletion of list object whilst async request in progress
|
|
2338 |
CRetrieveMobilePhoneCWList* retrieve=CRetrieveMobilePhoneCWList::NewL(aPhone);
|
|
2339 |
retrieve->Start(aReqStatus, DMMTSY_PHONE_CW_LOCATION);
|
|
2340 |
delete retrieve;
|
|
2341 |
retrieve = NULL;
|
|
2342 |
User::WaitForRequest(aReqStatus);
|
|
2343 |
TEST(aReqStatus == KErrCancel);
|
|
2344 |
|
|
2345 |
// Get call waiting list using asynchronous AO version
|
|
2346 |
|
|
2347 |
CTestGetCW* getCW=CTestGetCW::NewLC(aPhone, this);
|
|
2348 |
getCW->Start();
|
|
2349 |
CActiveScheduler::Start();
|
|
2350 |
|
|
2351 |
// Ensure that AO can be used to retrieve more than one list
|
|
2352 |
|
|
2353 |
getCW->Start();
|
|
2354 |
CActiveScheduler::Start();
|
|
2355 |
|
|
2356 |
CleanupStack::PopAndDestroy(); // getCW
|
|
2357 |
|
|
2358 |
// Now test the cancelling
|
|
2359 |
|
|
2360 |
getCW=CTestGetCW::NewLC(aPhone, this);
|
|
2361 |
getCW->Start();
|
|
2362 |
|
|
2363 |
CTestCanceller* cancelGetCW = getCW->RetrieveCancelPtr();
|
|
2364 |
cancelGetCW->Call();
|
|
2365 |
|
|
2366 |
CActiveScheduler::Start();
|
|
2367 |
TBool cancelled = (getCW->iStatus == KErrCancel);
|
|
2368 |
|
|
2369 |
getCW->Start();
|
|
2370 |
CActiveScheduler::Start();
|
|
2371 |
|
|
2372 |
if (cancelled)
|
|
2373 |
INFO_PRINTF2(_L("Test %d - CRetrieveMobilePhoneCWList (async & cancel (Cancelled Request)) passed"), iTestCount++);
|
|
2374 |
else
|
|
2375 |
INFO_PRINTF2(_L("Test %d - CRetrieveMobilePhoneCWList (async & cancel (Request Not Cancelled)) passed"), iTestCount++);
|
|
2376 |
|
|
2377 |
CleanupStack::PopAndDestroy(); // getCW
|
|
2378 |
|
|
2379 |
// Test Set Call Waiting Status
|
|
2380 |
|
|
2381 |
RMobilePhone::TMobilePhoneServiceAction cwAction = DMMTSY_PHONE_CW_SET_STATUS_ACTION;
|
|
2382 |
RMobilePhone::TMobileService cwServiceGroup = DMMTSY_PHONE_CW_SG0;
|
|
2383 |
|
|
2384 |
// asynchronous
|
|
2385 |
|
|
2386 |
aPhone.SetCallWaitingStatus(aReqStatus,cwServiceGroup,cwAction);
|
|
2387 |
User::WaitForRequest(aReqStatus);
|
|
2388 |
TEST(aReqStatus.Int() == KErrNone);
|
|
2389 |
|
|
2390 |
// asynchronous and cancel
|
|
2391 |
|
|
2392 |
aPhone.SetCallWaitingStatus(aReqStatus,cwServiceGroup,cwAction);
|
|
2393 |
aPhone.CancelAsyncRequest(EMobilePhoneSetCallWaitingStatus);
|
|
2394 |
User::WaitForRequest(aReqStatus);
|
|
2395 |
TEST(aReqStatus.Int() == KErrNone || aReqStatus.Int() == KErrCancel);
|
|
2396 |
if (aReqStatus.Int() == KErrCancel)
|
|
2397 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::SetCallWaitingStatus (async & cancel (Cancelled Request)) passed"), iTestCount++);
|
|
2398 |
else
|
|
2399 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::SetCallWaitingStatus (async & cancel (Request Not Cancelled)) passed"), iTestCount++);
|
|
2400 |
|
|
2401 |
|
|
2402 |
// Test NotifyCallWaitingStatusChange
|
|
2403 |
|
|
2404 |
RMobilePhone::TMobilePhoneCWInfoEntryV1 cwInfoEntry;
|
|
2405 |
RMobilePhone::TMobilePhoneCWInfoEntryV1Pckg cwInfoEntryPckg(cwInfoEntry);
|
|
2406 |
|
|
2407 |
// asychronous
|
|
2408 |
|
|
2409 |
aPhone.NotifyCallWaitingStatusChange(aReqStatus,cwInfoEntryPckg);
|
|
2410 |
User::WaitForRequest(aReqStatus);
|
|
2411 |
TEST(aReqStatus.Int() == KErrNone);
|
|
2412 |
TEST(cwInfoEntry.iServiceGroup == DMMTSY_PHONE_CW_SG0);
|
|
2413 |
TEST(cwInfoEntry.iStatus == DMMTSY_PHONE_CW_STATUS0);
|
|
2414 |
|
|
2415 |
// asychronous & cancel
|
|
2416 |
|
|
2417 |
aPhone.NotifyCallWaitingStatusChange(aReqStatus,cwInfoEntryPckg);
|
|
2418 |
aPhone.CancelAsyncRequest(EMobilePhoneNotifyCallWaitingStatusChange);
|
|
2419 |
User::WaitForRequest(aReqStatus);
|
|
2420 |
TEST(aReqStatus.Int() == KErrNone || aReqStatus.Int() == KErrCancel);
|
|
2421 |
if (aReqStatus.Int() == KErrCancel)
|
|
2422 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::NotifyCallWaitingStatusChange (async & cancel (Cancelled Request)) passed"), iTestCount++);
|
|
2423 |
else
|
|
2424 |
{
|
|
2425 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::NotifyCallWaitingStatusChange (async & cancel (Request Not Cancelled)) passed"), iTestCount++);
|
|
2426 |
TEST(cwInfoEntry.iServiceGroup == DMMTSY_PHONE_CW_SG0);
|
|
2427 |
TEST(cwInfoEntry.iStatus == DMMTSY_PHONE_CW_STATUS0);
|
|
2428 |
}
|
|
2429 |
|
|
2430 |
// test.Next(_L("OK: RMobilePhone's MobileCallWaiting"));
|
|
2431 |
}
|
|
2432 |
|
|
2433 |
void CTestPhone::TestMobileCallCompletionL(RMobilePhone& aPhone, TRequestStatus &aReqStatus)
|
|
2434 |
{
|
|
2435 |
//
|
|
2436 |
// Test Mobile Call Completion
|
|
2437 |
//
|
|
2438 |
// Test GetCCBSStatus
|
|
2439 |
|
|
2440 |
RMobilePhone::TMobilePhoneCCBSStatus ccbsStatus, ccbsStatusChange;
|
|
2441 |
|
|
2442 |
// asynchronous
|
|
2443 |
|
|
2444 |
aPhone.GetCCBSStatus(aReqStatus,ccbsStatus,DMMTSY_PHONE_CCC_LOCATION);
|
|
2445 |
User::WaitForRequest(aReqStatus);
|
|
2446 |
TEST(aReqStatus.Int() == KErrNone);
|
|
2447 |
TEST(ccbsStatus == DMMTSY_PHONE_CCC_STATUS);
|
|
2448 |
|
|
2449 |
// asynchronous & cancel
|
|
2450 |
|
|
2451 |
aPhone.GetCCBSStatus(aReqStatus,ccbsStatus,DMMTSY_PHONE_CCC_LOCATION);
|
|
2452 |
aPhone.CancelAsyncRequest(EMobilePhoneGetCCBSStatus);
|
|
2453 |
User::WaitForRequest(aReqStatus);
|
|
2454 |
TEST(aReqStatus.Int() == KErrNone || aReqStatus.Int() == KErrCancel);
|
|
2455 |
if (aReqStatus.Int() == KErrCancel)
|
|
2456 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::GetCCBSStatus (async & cancel (Cancelled Request)) passed"), iTestCount++);
|
|
2457 |
else
|
|
2458 |
{
|
|
2459 |
TEST(ccbsStatus == DMMTSY_PHONE_CCC_STATUS);
|
|
2460 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::GetCCBSStatus (async & cancel (Request Not Cancelled)) passed"), iTestCount++);
|
|
2461 |
}
|
|
2462 |
|
|
2463 |
// Test Notify CcbsStatusChange
|
|
2464 |
|
|
2465 |
// asynchronous
|
|
2466 |
|
|
2467 |
aPhone.NotifyCCBSStatusChange(aReqStatus,ccbsStatusChange);
|
|
2468 |
User::WaitForRequest(aReqStatus);
|
|
2469 |
TEST(aReqStatus.Int() == KErrNone);
|
|
2470 |
TEST(ccbsStatusChange == DMMTSY_PHONE_CCC_STATUS);
|
|
2471 |
|
|
2472 |
// asynchronous & cancel
|
|
2473 |
|
|
2474 |
aPhone.NotifyCCBSStatusChange(aReqStatus,ccbsStatusChange);
|
|
2475 |
aPhone.CancelAsyncRequest(EMobilePhoneNotifyCCBSStatusChange);
|
|
2476 |
User::WaitForRequest(aReqStatus);
|
|
2477 |
TEST(aReqStatus.Int() == KErrNone || aReqStatus.Int() == KErrCancel);
|
|
2478 |
if (aReqStatus.Int() == KErrCancel)
|
|
2479 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::NotifyCCBSStatusChange (async & cancel (Cancelled Request)) passed"), iTestCount++);
|
|
2480 |
else
|
|
2481 |
{
|
|
2482 |
TEST(ccbsStatusChange == DMMTSY_PHONE_CCC_STATUS);
|
|
2483 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::NotifyCCBSStatusChange (async & cancel (Request Not Cancelled)) passed"), iTestCount++);
|
|
2484 |
}
|
|
2485 |
|
|
2486 |
|
|
2487 |
//NotifyCCBS Recall V1
|
|
2488 |
|
|
2489 |
// asynchronous
|
|
2490 |
RMobilePhone::TMobilePhoneCCBSEntryV1 aCCBSEntry;
|
|
2491 |
RMobilePhone::TMobilePhoneCCBSEntryV1Pckg aCCBSEntryPckg(aCCBSEntry);
|
|
2492 |
|
|
2493 |
aPhone.NotifyCCBSRecall(aReqStatus,aCCBSEntryPckg);
|
|
2494 |
User::WaitForRequest(aReqStatus);
|
|
2495 |
TEST(aReqStatus.Int() == KErrNone);
|
|
2496 |
|
|
2497 |
TEST(aCCBSEntry.iCcbsIndex==DMMTSY_PHONE_CCC_INDEX1);
|
|
2498 |
TEST(aCCBSEntry.iServiceGroup==DMMTSY_PHONE_CCC_SERVICE_GROUP0);
|
|
2499 |
TEST(aCCBSEntry.iDestination.iNumberPlan==DMMTSY_PHONE_CCC_DESTINATION_NP0);
|
|
2500 |
TEST(aCCBSEntry.iDestination.iTelNumber== DMMTSY_PHONE_CCC_DESTINATION_NUM0);
|
|
2501 |
TEST(aCCBSEntry.iDestination.iTypeOfNumber == DMMTSY_PHONE_CCC_DESTINATION_TON0);
|
|
2502 |
|
|
2503 |
// asynchronous & cancel
|
|
2504 |
|
|
2505 |
aPhone.NotifyCCBSRecall(aReqStatus,aCCBSEntryPckg);
|
|
2506 |
aPhone.CancelAsyncRequest(EMobilePhoneNotifyCCBSRecall);
|
|
2507 |
User::WaitForRequest(aReqStatus);
|
|
2508 |
|
|
2509 |
TEST(aReqStatus.Int() == KErrNone || aReqStatus.Int() == KErrCancel);
|
|
2510 |
if (aReqStatus.Int() == KErrCancel)
|
|
2511 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::NotifyCCBSRecall V1 (async & cancel (Cancelled Request)) passed"), iTestCount++);
|
|
2512 |
else
|
|
2513 |
{
|
|
2514 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::NotifyCCBSRecall V1 (async & cancel (Request Not Cancelled)) passed"), iTestCount++);
|
|
2515 |
}
|
|
2516 |
|
|
2517 |
//NotifyCCBS Recall V2
|
|
2518 |
|
|
2519 |
// asynchronous
|
|
2520 |
RMobilePhone::TMobilePhoneCCBSEntryV2 aCCBSEntryV2;
|
|
2521 |
RMobilePhone::TMobilePhoneCCBSEntryV2Pckg aCCBSEntryPckgV2(aCCBSEntryV2);
|
|
2522 |
|
|
2523 |
aPhone.NotifyCCBSRecall(aReqStatus,aCCBSEntryPckgV2);
|
|
2524 |
User::WaitForRequest(aReqStatus);
|
|
2525 |
TEST(aReqStatus.Int() == KErrNone);
|
|
2526 |
|
|
2527 |
TEST(aCCBSEntryV2.iCcbsIndex==DMMTSY_PHONE_CCC_INDEX1);
|
|
2528 |
TEST(aCCBSEntryV2.iServiceGroup==DMMTSY_PHONE_CCC_SERVICE_GROUP0);
|
|
2529 |
TEST(aCCBSEntryV2.iDestination.iNumberPlan==DMMTSY_PHONE_CCC_DESTINATION_NP0);
|
|
2530 |
TEST(aCCBSEntryV2.iDestination.iTelNumber== DMMTSY_PHONE_CCC_DESTINATION_NUM0);
|
|
2531 |
TEST(aCCBSEntryV2.iDestination.iTypeOfNumber == DMMTSY_PHONE_CCC_DESTINATION_TON0);
|
|
2532 |
TEST(aCCBSEntryV2.iEvent == DMMTSY_PHONE_CCC_DESTINATION_CCBS_RECEIVED);
|
|
2533 |
|
|
2534 |
// asynchronous & cancel
|
|
2535 |
|
|
2536 |
aPhone.NotifyCCBSRecall(aReqStatus,aCCBSEntryPckgV2);
|
|
2537 |
aPhone.CancelAsyncRequest(EMobilePhoneNotifyCCBSRecall);
|
|
2538 |
User::WaitForRequest(aReqStatus);
|
|
2539 |
|
|
2540 |
TEST(aReqStatus.Int() == KErrNone || aReqStatus.Int() == KErrCancel);
|
|
2541 |
if (aReqStatus.Int() == KErrCancel)
|
|
2542 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::NotifyCCBSRecall V2(async & cancel (Cancelled Request)) passed"), iTestCount++);
|
|
2543 |
else
|
|
2544 |
{
|
|
2545 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::NotifyCCBSRecall V2(async & cancel (Request Not Cancelled)) passed"), iTestCount++);
|
|
2546 |
}
|
|
2547 |
|
|
2548 |
//Test multiple completion with different sized parameter packages
|
|
2549 |
//use a second phone client object
|
|
2550 |
RMobilePhone mmPhone2;
|
|
2551 |
TInt ret=mmPhone2.Open(iTelServer,DMMTSY_PHONE_NAME);
|
|
2552 |
TEST(ret==KErrNone);
|
|
2553 |
//set up a second parameter package
|
|
2554 |
TRequestStatus aReqStatus2;
|
|
2555 |
|
|
2556 |
//set up first notification request using V2 package format
|
|
2557 |
aPhone.NotifyCCBSRecall(aReqStatus2,aCCBSEntryPckgV2);
|
|
2558 |
//set up second notification request using V1 package format
|
|
2559 |
mmPhone2.NotifyCCBSRecall(aReqStatus,aCCBSEntryPckg);
|
|
2560 |
|
|
2561 |
User::WaitForRequest(aReqStatus);
|
|
2562 |
User::WaitForRequest(aReqStatus2);
|
|
2563 |
|
|
2564 |
TEST(aReqStatus.Int() == KErrNone);
|
|
2565 |
TEST(aReqStatus2.Int() == KErrNone);
|
|
2566 |
|
|
2567 |
//test parameters of V2 package
|
|
2568 |
TEST(aCCBSEntryV2.iCcbsIndex==DMMTSY_PHONE_CCC_INDEX1);
|
|
2569 |
TEST(aCCBSEntryV2.iServiceGroup==DMMTSY_PHONE_CCC_SERVICE_GROUP0);
|
|
2570 |
TEST(aCCBSEntryV2.iDestination.iNumberPlan==DMMTSY_PHONE_CCC_DESTINATION_NP0);
|
|
2571 |
TEST(aCCBSEntryV2.iDestination.iTelNumber== DMMTSY_PHONE_CCC_DESTINATION_NUM0);
|
|
2572 |
TEST(aCCBSEntryV2.iDestination.iTypeOfNumber == DMMTSY_PHONE_CCC_DESTINATION_TON0);
|
|
2573 |
TEST(aCCBSEntryV2.iEvent == DMMTSY_PHONE_CCC_DESTINATION_CCBS_RECEIVED);
|
|
2574 |
|
|
2575 |
mmPhone2.Close();
|
|
2576 |
|
|
2577 |
// Test AcceptCCBSRecall
|
|
2578 |
// asynchronous
|
|
2579 |
TInt index=1;
|
|
2580 |
TName aName;
|
|
2581 |
aPhone.AcceptCCBSRecall(aReqStatus,index, aName);
|
|
2582 |
User::WaitForRequest(aReqStatus);
|
|
2583 |
TEST(aReqStatus.Int()==KErrNone);
|
|
2584 |
TEST(aName==DMMTSY_PHONE_CCC_CALLNAME0);
|
|
2585 |
|
|
2586 |
// asynchronous & cancel
|
|
2587 |
|
|
2588 |
aPhone.AcceptCCBSRecall(aReqStatus,index, aName);
|
|
2589 |
aPhone.CancelAsyncRequest(EMobilePhoneAcceptCCBSRecall);
|
|
2590 |
User::WaitForRequest(aReqStatus);
|
|
2591 |
TEST(aReqStatus.Int()==KErrNone || aReqStatus.Int()==KErrCancel);
|
|
2592 |
if (aReqStatus.Int()==KErrCancel)
|
|
2593 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::AcceptCCBSRecall (async & cancel (Cancelled Request)) passed"), iTestCount++);
|
|
2594 |
else
|
|
2595 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::AcceptCCBSRecall (async & cancel (Request Not Cancelled)) passed"), iTestCount++);
|
|
2596 |
|
|
2597 |
// Test RefuseCCBSRecall
|
|
2598 |
|
|
2599 |
TEST(aPhone.RefuseCCBSRecall(index)==KErrNone);
|
|
2600 |
|
|
2601 |
// Test Decativate CCBS
|
|
2602 |
|
|
2603 |
// asynchronous
|
|
2604 |
|
|
2605 |
aPhone.DeactivateCCBS(aReqStatus, index);
|
|
2606 |
User::WaitForRequest(aReqStatus);
|
|
2607 |
TEST(aReqStatus.Int()==KErrNone);
|
|
2608 |
|
|
2609 |
// asynchronous & cancel
|
|
2610 |
|
|
2611 |
aPhone.DeactivateCCBS(aReqStatus, index);
|
|
2612 |
aPhone.CancelAsyncRequest(EMobilePhoneDeactivateCCBS);
|
|
2613 |
User::WaitForRequest(aReqStatus);
|
|
2614 |
TEST(aReqStatus.Int()==KErrNone || aReqStatus.Int()==KErrCancel);
|
|
2615 |
if (aReqStatus.Int()==KErrCancel)
|
|
2616 |
INFO_PRINTF2(_L("Test %d - RMobileCall::DeactivateCCBS (async & cancel (Cancelled Request)) passed"), iTestCount++);
|
|
2617 |
else
|
|
2618 |
INFO_PRINTF2(_L("Test %d - RMobileCall::DeactivateCCBS (async & cancel (Request Not Cancelled)) passed"), iTestCount++);
|
|
2619 |
|
|
2620 |
|
|
2621 |
|
|
2622 |
//Deactivate all, here the tsy pretends there is no active ccbs request
|
|
2623 |
index=-1;
|
|
2624 |
aPhone.DeactivateCCBS(aReqStatus, index);
|
|
2625 |
User::WaitForRequest(aReqStatus);
|
|
2626 |
TEST(aReqStatus.Int()==KErrEtelCallNotActive);
|
|
2627 |
|
|
2628 |
//Test deletion of list object whilst async request in progress
|
|
2629 |
CRetrieveMobilePhoneCcbsList* retrieve=CRetrieveMobilePhoneCcbsList::NewL(aPhone);
|
|
2630 |
retrieve->Start(aReqStatus);
|
|
2631 |
delete retrieve;
|
|
2632 |
retrieve = NULL;
|
|
2633 |
User::WaitForRequest(aReqStatus);
|
|
2634 |
TEST(aReqStatus == KErrCancel);
|
|
2635 |
|
|
2636 |
// Get call Completion list using asynchronous AO version
|
|
2637 |
|
|
2638 |
CTestGetCcbs* getCcbs=CTestGetCcbs::NewLC(aPhone, this);
|
|
2639 |
getCcbs->Start();
|
|
2640 |
CActiveScheduler::Start();
|
|
2641 |
|
|
2642 |
// Ensure that the same AO can be used to retrieve more than one list
|
|
2643 |
|
|
2644 |
getCcbs->Start();
|
|
2645 |
CActiveScheduler::Start();
|
|
2646 |
|
|
2647 |
|
|
2648 |
CleanupStack::PopAndDestroy(getCcbs); // getCcbs
|
|
2649 |
|
|
2650 |
// Now test the cancelling
|
|
2651 |
|
|
2652 |
getCcbs=CTestGetCcbs::NewLC(aPhone, this);
|
|
2653 |
getCcbs->Start();
|
|
2654 |
|
|
2655 |
CTestCanceller* cancelGetCcbs = getCcbs->RetrieveCancelPtr();
|
|
2656 |
cancelGetCcbs->Call();
|
|
2657 |
|
|
2658 |
CActiveScheduler::Start();
|
|
2659 |
TBool cancelled = (getCcbs->iStatus == KErrCancel);
|
|
2660 |
|
|
2661 |
// Ensure that an AO can be used to retrieve a list after the previous transaction had been cancelled
|
|
2662 |
|
|
2663 |
getCcbs->Start();
|
|
2664 |
CActiveScheduler::Start();
|
|
2665 |
|
|
2666 |
if (cancelled)
|
|
2667 |
INFO_PRINTF2(_L("Test %d - CRetrieveMobilePhoneCcbsList (async & cancel (Cancelled Request)) passed"), iTestCount++);
|
|
2668 |
else
|
|
2669 |
INFO_PRINTF2(_L("Test %d - CRetrieveMobilePhoneCcbsList (async & cancel (Request Not Cancelled)) passed"), iTestCount++);
|
|
2670 |
|
|
2671 |
CleanupStack::PopAndDestroy(getCcbs); // getCcbs
|
|
2672 |
}
|
|
2673 |
|
|
2674 |
|
|
2675 |
void CTestPhone::TestMobileAlternatingCallL(RMobilePhone& aPhone, TRequestStatus &aReqStatus)
|
|
2676 |
{
|
|
2677 |
//
|
|
2678 |
// Test Mobile Alternating Call
|
|
2679 |
//
|
|
2680 |
|
|
2681 |
// Test GetAlternatingCallCaps
|
|
2682 |
|
|
2683 |
TUint32 alternatingCallCaps, asyncAlternatingCallCaps;
|
|
2684 |
TEST(aPhone.GetAlternatingCallCaps(alternatingCallCaps) == KErrNone);
|
|
2685 |
TEST(alternatingCallCaps == DMMTSY_PHONE_ALTERNATING_CALL_CAPS);
|
|
2686 |
|
|
2687 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::GetAlternatingCallCaps (sync) passed"), iTestCount++);
|
|
2688 |
|
|
2689 |
// Test NotifyAlternatingCallCapsChange
|
|
2690 |
|
|
2691 |
// asynchronous
|
|
2692 |
|
|
2693 |
aPhone.NotifyAlternatingCallCapsChange(aReqStatus,asyncAlternatingCallCaps);
|
|
2694 |
User::WaitForRequest(aReqStatus);
|
|
2695 |
TEST(aReqStatus.Int() == KErrNone);
|
|
2696 |
TEST(asyncAlternatingCallCaps == DMMTSY_PHONE_ALTERNATING_CALL_CAPS);
|
|
2697 |
|
|
2698 |
// asynchronous & cancel
|
|
2699 |
|
|
2700 |
aPhone.NotifyAlternatingCallCapsChange(aReqStatus,asyncAlternatingCallCaps);
|
|
2701 |
aPhone.CancelAsyncRequest(EMobilePhoneNotifyAlternatingCallCapsChange);
|
|
2702 |
User::WaitForRequest(aReqStatus);
|
|
2703 |
TEST(aReqStatus.Int() == KErrNone || aReqStatus.Int() == KErrCancel);
|
|
2704 |
if (aReqStatus.Int() == KErrCancel)
|
|
2705 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::NotifyAlternatingCallCapsChange (async & cancel (Cancelled Request)) passed"), iTestCount++);
|
|
2706 |
else
|
|
2707 |
{
|
|
2708 |
TEST(asyncAlternatingCallCaps == DMMTSY_PHONE_ALTERNATING_CALL_CAPS);
|
|
2709 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::NotifyAlternatingCallCapsChange (async & cancel (Request Not Cancelled)) passed"), iTestCount++);
|
|
2710 |
}
|
|
2711 |
|
|
2712 |
// Test GetAlternatingCallMode
|
|
2713 |
|
|
2714 |
RMobilePhone::TMobilePhoneAlternatingCallMode acMode, asyncAcMode;
|
|
2715 |
RMobilePhone::TMobileService acService, asyncAcService;
|
|
2716 |
|
|
2717 |
TEST(aPhone.GetAlternatingCallMode(acMode,acService) == KErrNone);
|
|
2718 |
TEST(acMode == DMMTSY_PHONE_ALTERNATING_CALL_MODE);
|
|
2719 |
TEST(acService == DMMTSY_PHONE_ALTERNATING_CALL_SERVICE);
|
|
2720 |
|
|
2721 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::GetAlternatingCallMode (sync) passed"), iTestCount++);
|
|
2722 |
|
|
2723 |
// Test SetAlternatingCallMode
|
|
2724 |
|
|
2725 |
aPhone.SetAlternatingCallMode(aReqStatus,DMMTSY_PHONE_ALTERNATING_CALL_MODE,DMMTSY_PHONE_ALTERNATING_CALL_SERVICE);
|
|
2726 |
User::WaitForRequest(aReqStatus);
|
|
2727 |
TEST(aReqStatus.Int() == KErrNone);
|
|
2728 |
|
|
2729 |
aPhone.SetAlternatingCallMode(aReqStatus,DMMTSY_PHONE_ALTERNATING_CALL_MODE,DMMTSY_PHONE_ALTERNATING_CALL_SERVICE);
|
|
2730 |
aPhone.CancelAsyncRequest(EMobilePhoneSetAlternatingCallMode);
|
|
2731 |
User::WaitForRequest(aReqStatus);
|
|
2732 |
TEST(aReqStatus.Int() == KErrNone || aReqStatus.Int() == KErrCancel);
|
|
2733 |
if (aReqStatus.Int() == KErrCancel)
|
|
2734 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::SetAlternatingCallMode (async (Cancelled Request)) passed"), iTestCount++);
|
|
2735 |
else
|
|
2736 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::SetAlternatingCallMode (async (Request Not Cancelled)) passed"), iTestCount++);
|
|
2737 |
|
|
2738 |
// Test NotifyAlternatingCallModeChange
|
|
2739 |
|
|
2740 |
// asynchronous
|
|
2741 |
|
|
2742 |
aPhone.NotifyAlternatingCallModeChange(aReqStatus,asyncAcMode,asyncAcService);
|
|
2743 |
User::WaitForRequest(aReqStatus);
|
|
2744 |
TEST(aReqStatus.Int() == KErrNone);
|
|
2745 |
TEST(asyncAcMode == DMMTSY_PHONE_ALTERNATING_CALL_MODE);
|
|
2746 |
TEST(asyncAcService == DMMTSY_PHONE_ALTERNATING_CALL_SERVICE);
|
|
2747 |
|
|
2748 |
// asynchronous & cancel
|
|
2749 |
|
|
2750 |
aPhone.NotifyAlternatingCallModeChange(aReqStatus,asyncAcMode,asyncAcService);
|
|
2751 |
aPhone.CancelAsyncRequest(EMobilePhoneNotifyAlternatingCallModeChange);
|
|
2752 |
User::WaitForRequest(aReqStatus);
|
|
2753 |
TEST(aReqStatus.Int() == KErrNone || aReqStatus.Int() == KErrCancel);
|
|
2754 |
if (aReqStatus.Int() == KErrCancel)
|
|
2755 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::NotifyAlternatingCallModeChange (async & cancel (Cancelled Request)) passed"), iTestCount++);
|
|
2756 |
else
|
|
2757 |
{
|
|
2758 |
TEST(asyncAcMode == DMMTSY_PHONE_ALTERNATING_CALL_MODE);
|
|
2759 |
TEST(asyncAcService == DMMTSY_PHONE_ALTERNATING_CALL_SERVICE);
|
|
2760 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::NotifyAlternatingCallModeChange (async & cancel (Request Not Cancelled)) passed"), iTestCount++);
|
|
2761 |
}
|
|
2762 |
|
|
2763 |
}
|
|
2764 |
|
|
2765 |
|
|
2766 |
void CTestPhone::TestMobileAlternateLineServiceL(RMobilePhone& aPhone, TRequestStatus &aReqStatus)
|
|
2767 |
{
|
|
2768 |
//
|
|
2769 |
// Test Mobile Alternate Line Service
|
|
2770 |
//
|
|
2771 |
|
|
2772 |
RMobilePhone::TMobilePhoneALSLine alsLine;
|
|
2773 |
|
|
2774 |
// Test Get ALS Line
|
|
2775 |
|
|
2776 |
// synchronous
|
|
2777 |
|
|
2778 |
TEST(aPhone.GetALSLine(alsLine) == KErrNone);
|
|
2779 |
TEST(alsLine == DMMTSY_PHONE_ALS_LINE);
|
|
2780 |
|
|
2781 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::GetALSLine (sync) passed"), iTestCount++);
|
|
2782 |
|
|
2783 |
|
|
2784 |
// Test Set ALS Line
|
|
2785 |
|
|
2786 |
// asynchronous
|
|
2787 |
|
|
2788 |
aPhone.SetALSLine(aReqStatus,alsLine);
|
|
2789 |
User::WaitForRequest(aReqStatus);
|
|
2790 |
TEST(aReqStatus.Int() == KErrNone);
|
|
2791 |
|
|
2792 |
// asynchronous & cancel
|
|
2793 |
|
|
2794 |
aPhone.SetALSLine(aReqStatus,alsLine);
|
|
2795 |
aPhone.CancelAsyncRequest(EMobilePhoneSetALSLine);
|
|
2796 |
User::WaitForRequest(aReqStatus);
|
|
2797 |
TEST(aReqStatus.Int() == KErrNone || aReqStatus.Int() == KErrCancel);
|
|
2798 |
if (aReqStatus.Int() == KErrCancel)
|
|
2799 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::SetALSLine (async & cancel (Cancelled Request)) passed"), iTestCount++);
|
|
2800 |
else
|
|
2801 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::SetALSLine (async & cancel (Request Not Cancelled)) passed"), iTestCount++);
|
|
2802 |
|
|
2803 |
|
|
2804 |
// Test NotifyALSLineChange
|
|
2805 |
|
|
2806 |
// asynchronous
|
|
2807 |
|
|
2808 |
RMobilePhone::TMobilePhoneALSLine notifyAlsLine;
|
|
2809 |
|
|
2810 |
aPhone.NotifyALSLineChange(aReqStatus,notifyAlsLine);
|
|
2811 |
User::WaitForRequest(aReqStatus);
|
|
2812 |
TEST(aReqStatus.Int() == KErrNone);
|
|
2813 |
TEST(notifyAlsLine == DMMTSY_PHONE_ALS_LINE);
|
|
2814 |
|
|
2815 |
// asynchronous & cancel
|
|
2816 |
|
|
2817 |
aPhone.NotifyALSLineChange(aReqStatus,notifyAlsLine);
|
|
2818 |
aPhone.CancelAsyncRequest(EMobilePhoneNotifyALSLineChange);
|
|
2819 |
User::WaitForRequest(aReqStatus);
|
|
2820 |
TEST(aReqStatus.Int() == KErrNone || aReqStatus.Int() == KErrCancel);
|
|
2821 |
if (aReqStatus.Int() == KErrCancel)
|
|
2822 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::NotifyALSLineChange (async & cancel (Cancelled Request)) passed"), iTestCount++);
|
|
2823 |
else
|
|
2824 |
{
|
|
2825 |
TEST(notifyAlsLine == DMMTSY_PHONE_ALS_LINE);
|
|
2826 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::NotifyALSLineChange (async & cancel (Request Not Cancelled)) passed"), iTestCount++);
|
|
2827 |
}
|
|
2828 |
|
|
2829 |
// test.Next(_L("OK: RMobilePhone's Mobile Alternate Line Service"));
|
|
2830 |
}
|
|
2831 |
|
|
2832 |
|
|
2833 |
void CTestPhone::TestMobileCallCostL(RMobilePhone& aPhone, TRequestStatus &aReqStatus)
|
|
2834 |
{
|
|
2835 |
//
|
|
2836 |
// Test Mobile Cost Functional Unit
|
|
2837 |
//
|
|
2838 |
|
|
2839 |
TUint32 costCaps, asyncCostCaps;
|
|
2840 |
|
|
2841 |
// Test Get Cost Caps
|
|
2842 |
|
|
2843 |
TEST(aPhone.GetCostCaps(costCaps) == KErrNone);
|
|
2844 |
TEST(costCaps == DMMTSY_PHONE_COST_CAPS);
|
|
2845 |
|
|
2846 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::GetCostCaps (sync) passed"), iTestCount++);
|
|
2847 |
|
|
2848 |
// Test Notify Cost Caps Change
|
|
2849 |
|
|
2850 |
|
|
2851 |
// asynchronous
|
|
2852 |
|
|
2853 |
aPhone.NotifyCostCapsChange(aReqStatus,asyncCostCaps);
|
|
2854 |
User::WaitForRequest(aReqStatus);
|
|
2855 |
TEST(aReqStatus.Int() == KErrNone);
|
|
2856 |
TEST(asyncCostCaps == DMMTSY_PHONE_COST_CAPS);
|
|
2857 |
|
|
2858 |
// asynchronous & cancel
|
|
2859 |
|
|
2860 |
aPhone.NotifyCostCapsChange(aReqStatus,asyncCostCaps);
|
|
2861 |
aPhone.CancelAsyncRequest(EMobilePhoneNotifyCostCapsChange);
|
|
2862 |
User::WaitForRequest(aReqStatus);
|
|
2863 |
TEST(aReqStatus.Int() == KErrNone || aReqStatus.Int() == KErrCancel);
|
|
2864 |
if (aReqStatus.Int() == KErrCancel)
|
|
2865 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::NotifyCostCapsChange (async & cancel (Cancelled Request)) passed"), iTestCount++);
|
|
2866 |
else
|
|
2867 |
{
|
|
2868 |
TEST(asyncCostCaps == DMMTSY_PHONE_COST_CAPS);
|
|
2869 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::NotifyCostCapsChange (async & cancel (Request Not Cancelled)) passed"), iTestCount++);
|
|
2870 |
}
|
|
2871 |
|
|
2872 |
|
|
2873 |
// Test ClearCostMeter
|
|
2874 |
|
|
2875 |
// asynchronous
|
|
2876 |
RMobilePhone::TMobilePhoneCostMeters meter=DMMTSY_PHONE_COST_METER;
|
|
2877 |
|
|
2878 |
aPhone.ClearCostMeter(aReqStatus, meter);
|
|
2879 |
User::WaitForRequest(aReqStatus);
|
|
2880 |
TEST(aReqStatus.Int() == KErrNone);
|
|
2881 |
|
|
2882 |
// asynchronous & cancel
|
|
2883 |
|
|
2884 |
aPhone.ClearCostMeter(aReqStatus, meter);
|
|
2885 |
aPhone.CancelAsyncRequest(EMobilePhoneClearCostMeter);
|
|
2886 |
User::WaitForRequest(aReqStatus);
|
|
2887 |
TEST(aReqStatus.Int() == KErrNone || aReqStatus.Int() == KErrCancel);
|
|
2888 |
if (aReqStatus.Int() == KErrCancel)
|
|
2889 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::ClearCostMeter (async & cancel (Cancelled Request)) passed"), iTestCount++);
|
|
2890 |
else
|
|
2891 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::ClearCostMeter (async & cancel (Request Not Cancelled)) passed"), iTestCount++);
|
|
2892 |
|
|
2893 |
// Test SetMaxCostMeter
|
|
2894 |
|
|
2895 |
// asynchronous
|
|
2896 |
|
|
2897 |
aPhone.SetMaxCostMeter(aReqStatus,DMMTSY_PHONE_COST_UNITS);
|
|
2898 |
User::WaitForRequest(aReqStatus);
|
|
2899 |
TEST(aReqStatus.Int() == KErrNone);
|
|
2900 |
|
|
2901 |
// asynchronous & cancel
|
|
2902 |
|
|
2903 |
aPhone.SetMaxCostMeter(aReqStatus,DMMTSY_PHONE_COST_UNITS);
|
|
2904 |
aPhone.CancelAsyncRequest(EMobilePhoneSetMaxCostMeter);
|
|
2905 |
User::WaitForRequest(aReqStatus);
|
|
2906 |
TEST(aReqStatus.Int() == KErrNone || aReqStatus.Int() == KErrCancel);
|
|
2907 |
if (aReqStatus.Int() == KErrCancel)
|
|
2908 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::SetMaxCostMeter (async & cancel (Cancelled Request)) passed"), iTestCount++);
|
|
2909 |
else
|
|
2910 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::SetMaxCostMeter (async & cancel (Request Not Cancelled)) passed"), iTestCount++);
|
|
2911 |
|
|
2912 |
// Test SetPuct
|
|
2913 |
|
|
2914 |
// asynchronous
|
|
2915 |
|
|
2916 |
RMobilePhone::TMobilePhonePuctV1 puct;
|
|
2917 |
RMobilePhone::TMobilePhonePuctV1Pckg puctPckg(puct);
|
|
2918 |
|
|
2919 |
puct.iCurrencyName = DMMTSY_PHONE_COST_PUCT_CNAME;
|
|
2920 |
puct.iPricePerUnit = DMMTSY_PHONE_COST_PUCT_PPU;
|
|
2921 |
|
|
2922 |
|
|
2923 |
aPhone.SetPuct(aReqStatus,puctPckg);
|
|
2924 |
User::WaitForRequest(aReqStatus);
|
|
2925 |
TEST(aReqStatus.Int() == KErrNone);
|
|
2926 |
|
|
2927 |
// asynchronous & cancel
|
|
2928 |
|
|
2929 |
aPhone.SetPuct(aReqStatus,puctPckg);
|
|
2930 |
aPhone.CancelAsyncRequest(EMobilePhoneSetPuct);
|
|
2931 |
User::WaitForRequest(aReqStatus);
|
|
2932 |
TEST(aReqStatus.Int() == KErrNone || aReqStatus.Int() == KErrCancel);
|
|
2933 |
if (aReqStatus.Int() == KErrCancel)
|
|
2934 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::SetPuct (async & cancel (Cancelled Request)) passed"), iTestCount++);
|
|
2935 |
else
|
|
2936 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::SetPuct (async & cancel (Request Not Cancelled)) passed"), iTestCount++);
|
|
2937 |
|
|
2938 |
|
|
2939 |
// Test GetCostInfo
|
|
2940 |
|
|
2941 |
RMobilePhone::TMobilePhoneCostInfoV1 asyncCostInfo;
|
|
2942 |
RMobilePhone::TMobilePhoneCostInfoV1Pckg asyncCostInfoPckg(asyncCostInfo);
|
|
2943 |
|
|
2944 |
// asynchronous
|
|
2945 |
|
|
2946 |
aPhone.GetCostInfo(aReqStatus,asyncCostInfoPckg);
|
|
2947 |
User::WaitForRequest(aReqStatus);
|
|
2948 |
TEST(aReqStatus.Int() == KErrNone);
|
|
2949 |
ValidateCostInfo(asyncCostInfo);
|
|
2950 |
|
|
2951 |
// asynchronous & cancel
|
|
2952 |
|
|
2953 |
aPhone.GetCostInfo(aReqStatus,asyncCostInfoPckg);
|
|
2954 |
aPhone.CancelAsyncRequest(EMobilePhoneGetCostInfo);
|
|
2955 |
User::WaitForRequest(aReqStatus);
|
|
2956 |
TEST(aReqStatus.Int() == KErrNone || aReqStatus.Int() == KErrCancel);
|
|
2957 |
if (aReqStatus.Int() == KErrCancel)
|
|
2958 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::GetCostInfo (async & cancel (Cancelled Request)) passed"), iTestCount++);
|
|
2959 |
else
|
|
2960 |
{
|
|
2961 |
ValidateCostInfo(asyncCostInfo);
|
|
2962 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::GetCostInfo (async & cancel (Request Not Cancelled)) passed"), iTestCount++);
|
|
2963 |
}
|
|
2964 |
|
|
2965 |
// Test Notify CostInfoChange
|
|
2966 |
|
|
2967 |
// asynchronous
|
|
2968 |
|
|
2969 |
aPhone.NotifyCostInfoChange(aReqStatus,asyncCostInfoPckg);
|
|
2970 |
User::WaitForRequest(aReqStatus);
|
|
2971 |
TEST(aReqStatus.Int() == KErrNone);
|
|
2972 |
ValidateCostInfo(asyncCostInfo);
|
|
2973 |
|
|
2974 |
// asynchronous & cancel
|
|
2975 |
|
|
2976 |
aPhone.NotifyCostInfoChange(aReqStatus,asyncCostInfoPckg);
|
|
2977 |
aPhone.CancelAsyncRequest(EMobilePhoneNotifyCostInfoChange);
|
|
2978 |
User::WaitForRequest(aReqStatus);
|
|
2979 |
TEST(aReqStatus.Int() == KErrNone || aReqStatus.Int() == KErrCancel);
|
|
2980 |
if (aReqStatus.Int() == KErrCancel)
|
|
2981 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::NotifyCostInfoChange (async & cancel (Cancelled Request)) passed"), iTestCount++);
|
|
2982 |
else
|
|
2983 |
{
|
|
2984 |
ValidateCostInfo(asyncCostInfo);
|
|
2985 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::NotifyCostInfoChange (async & cancel (Request Not Cancelled)) passed"), iTestCount++);
|
|
2986 |
}
|
|
2987 |
|
|
2988 |
|
|
2989 |
// test.Next(_L("OK: RMobilePhone's Mobile Cost"));
|
|
2990 |
}
|
|
2991 |
|
|
2992 |
|
|
2993 |
void CTestPhone::TestMobileSecurityL(RMobilePhone& aPhone, TRequestStatus &aReqStatus)
|
|
2994 |
{
|
|
2995 |
//
|
|
2996 |
// Test Mobile Security Functional Unit
|
|
2997 |
//
|
|
2998 |
|
|
2999 |
TUint32 secCaps, asyncCaps;
|
|
3000 |
|
|
3001 |
// Test Security Caps
|
|
3002 |
|
|
3003 |
TEST(aPhone.GetSecurityCaps(secCaps) == KErrNone);
|
|
3004 |
TEST(secCaps == DMMTSY_PHONE_SECURITY_CAPS);
|
|
3005 |
|
|
3006 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::GetSecurityCaps (sync) passed"), iTestCount++);
|
|
3007 |
|
|
3008 |
// Test Notify Security Caps Change
|
|
3009 |
|
|
3010 |
// asynchronous
|
|
3011 |
|
|
3012 |
aPhone.NotifySecurityCapsChange(aReqStatus,asyncCaps);
|
|
3013 |
User::WaitForRequest(aReqStatus);
|
|
3014 |
TEST(aReqStatus.Int() == KErrNone);
|
|
3015 |
TEST(asyncCaps == DMMTSY_PHONE_SECURITY_CAPS);
|
|
3016 |
|
|
3017 |
// asynchronous & cancel
|
|
3018 |
|
|
3019 |
aPhone.NotifySecurityCapsChange(aReqStatus,asyncCaps);
|
|
3020 |
aPhone.CancelAsyncRequest(EMobilePhoneNotifySecurityCapsChange);
|
|
3021 |
User::WaitForRequest(aReqStatus);
|
|
3022 |
TEST(aReqStatus.Int() == KErrNone || aReqStatus.Int() == KErrCancel);
|
|
3023 |
if (aReqStatus.Int() == KErrCancel)
|
|
3024 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::NotifySecurityCapsChange (async & cancel (Cancelled Request)) passed"), iTestCount++);
|
|
3025 |
else
|
|
3026 |
{
|
|
3027 |
TEST(asyncCaps == DMMTSY_PHONE_SECURITY_CAPS);
|
|
3028 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::NotifySecurityCapsChange (async & cancel (Request Not Cancelled)) passed"), iTestCount++);
|
|
3029 |
}
|
|
3030 |
|
|
3031 |
// Test Get Lock Info
|
|
3032 |
|
|
3033 |
RMobilePhone::TMobilePhoneLockInfoV1 asyncLockInfo;
|
|
3034 |
RMobilePhone::TMobilePhoneLockInfoV1Pckg asyncLockInfoPckg(asyncLockInfo);
|
|
3035 |
|
|
3036 |
// asynchronous
|
|
3037 |
|
|
3038 |
aPhone.GetLockInfo(aReqStatus,DMMTSY_PHONE_SECURITY_LOCK,asyncLockInfoPckg);
|
|
3039 |
User::WaitForRequest(aReqStatus);
|
|
3040 |
TEST(aReqStatus.Int() == KErrNone);
|
|
3041 |
TEST(asyncLockInfo.iStatus == DMMTSY_PHONE_SECURITY_STATUS);
|
|
3042 |
TEST(asyncLockInfo.iSetting == DMMTSY_PHONE_SECURITY_SETTING);
|
|
3043 |
|
|
3044 |
// asynchronous & cancel
|
|
3045 |
|
|
3046 |
aPhone.GetLockInfo(aReqStatus,DMMTSY_PHONE_SECURITY_LOCK,asyncLockInfoPckg);
|
|
3047 |
aPhone.CancelAsyncRequest(EMobilePhoneGetLockInfo);
|
|
3048 |
User::WaitForRequest(aReqStatus);
|
|
3049 |
TEST(aReqStatus.Int() == KErrNone || aReqStatus.Int() == KErrCancel);
|
|
3050 |
if (aReqStatus.Int() == KErrCancel)
|
|
3051 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::GetLockInfo (async & cancel (Cancelled Request)) passed"), iTestCount++);
|
|
3052 |
else
|
|
3053 |
{
|
|
3054 |
TEST(asyncLockInfo.iStatus == DMMTSY_PHONE_SECURITY_STATUS);
|
|
3055 |
TEST(asyncLockInfo.iSetting == DMMTSY_PHONE_SECURITY_SETTING);
|
|
3056 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::GetLockInfo (async & cancel (Request Not Cancelled)) passed"), iTestCount++);
|
|
3057 |
}
|
|
3058 |
|
|
3059 |
// Test Notify Lock Info Change
|
|
3060 |
|
|
3061 |
RMobilePhone::TMobilePhoneLock phoneLock;
|
|
3062 |
|
|
3063 |
// asynchronous
|
|
3064 |
|
|
3065 |
aPhone.NotifyLockInfoChange(aReqStatus,phoneLock,asyncLockInfoPckg);
|
|
3066 |
User::WaitForRequest(aReqStatus);
|
|
3067 |
TEST(aReqStatus.Int() == KErrNone);
|
|
3068 |
TEST(phoneLock == DMMTSY_PHONE_SECURITY_LOCK);
|
|
3069 |
TEST(asyncLockInfo.iStatus == DMMTSY_PHONE_SECURITY_STATUS);
|
|
3070 |
TEST(asyncLockInfo.iSetting == DMMTSY_PHONE_SECURITY_SETTING);
|
|
3071 |
|
|
3072 |
|
|
3073 |
// asynchronous & cancel
|
|
3074 |
|
|
3075 |
aPhone.NotifyLockInfoChange(aReqStatus,phoneLock,asyncLockInfoPckg);
|
|
3076 |
aPhone.CancelAsyncRequest(EMobilePhoneNotifyLockInfoChange);
|
|
3077 |
User::WaitForRequest(aReqStatus);
|
|
3078 |
TEST(aReqStatus.Int() == KErrNone || aReqStatus.Int() == KErrCancel);
|
|
3079 |
if (aReqStatus.Int() == KErrCancel)
|
|
3080 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::NotifyLockInfoChange (async & cancel (Cancelled Request)) passed"), iTestCount++);
|
|
3081 |
else
|
|
3082 |
{
|
|
3083 |
TEST(phoneLock == DMMTSY_PHONE_SECURITY_LOCK);
|
|
3084 |
TEST(asyncLockInfo.iStatus == DMMTSY_PHONE_SECURITY_STATUS);
|
|
3085 |
TEST(asyncLockInfo.iSetting == DMMTSY_PHONE_SECURITY_SETTING);
|
|
3086 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::NotifyLockInfoChange (async & cancel (Request Not Cancelled)) passed"), iTestCount++);
|
|
3087 |
}
|
|
3088 |
|
|
3089 |
|
|
3090 |
// Test Set Lock Setting Change
|
|
3091 |
|
|
3092 |
// asynchronous
|
|
3093 |
|
|
3094 |
aPhone.SetLockSetting(aReqStatus,DMMTSY_PHONE_SECURITY_SC_LOCK,DMMTSY_PHONE_SECURITY_SC_SETTING);
|
|
3095 |
User::WaitForRequest(aReqStatus);
|
|
3096 |
TEST(aReqStatus.Int() == KErrNone);
|
|
3097 |
|
|
3098 |
|
|
3099 |
// asynchronous & cancel
|
|
3100 |
|
|
3101 |
aPhone.SetLockSetting(aReqStatus,DMMTSY_PHONE_SECURITY_SC_LOCK,DMMTSY_PHONE_SECURITY_SC_SETTING);
|
|
3102 |
aPhone.CancelAsyncRequest(EMobilePhoneSetLockSetting);
|
|
3103 |
User::WaitForRequest(aReqStatus);
|
|
3104 |
TEST(aReqStatus.Int() == KErrNone || aReqStatus.Int() == KErrCancel);
|
|
3105 |
if (aReqStatus.Int() == KErrCancel)
|
|
3106 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::SetLockSettingChange (async & cancel (Cancelled Request)) passed"), iTestCount++);
|
|
3107 |
else
|
|
3108 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::SetLockSettingChange (async & cancel (Request Not Cancelled)) passed"), iTestCount++);
|
|
3109 |
|
|
3110 |
|
|
3111 |
|
|
3112 |
// Test Change Security Code
|
|
3113 |
|
|
3114 |
// asynchronous
|
|
3115 |
|
|
3116 |
RMobilePhone::TMobilePhonePasswordChangeV1 passwordChange;
|
|
3117 |
|
|
3118 |
passwordChange.iOldPassword = DMMTSY_PHONE_SECURITY_OLD_PASS;
|
|
3119 |
passwordChange.iNewPassword = DMMTSY_PHONE_SECURITY_NEW_PASS;
|
|
3120 |
aPhone.ChangeSecurityCode(aReqStatus,DMMTSY_PHONE_SECURITY_CODE,passwordChange);
|
|
3121 |
User::WaitForRequest(aReqStatus);
|
|
3122 |
TEST(aReqStatus.Int() == KErrNone);
|
|
3123 |
|
|
3124 |
// asynchronous & cancel
|
|
3125 |
|
|
3126 |
aPhone.ChangeSecurityCode(aReqStatus,DMMTSY_PHONE_SECURITY_CODE,passwordChange);
|
|
3127 |
aPhone.CancelAsyncRequest(EMobilePhoneChangeSecurityCode);
|
|
3128 |
User::WaitForRequest(aReqStatus);
|
|
3129 |
TEST(aReqStatus.Int() == KErrNone || aReqStatus.Int() == KErrCancel);
|
|
3130 |
if (aReqStatus.Int() == KErrCancel)
|
|
3131 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::ChangeSecurityCode (async & cancel (Cancelled Request)) passed"), iTestCount++);
|
|
3132 |
else
|
|
3133 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::ChangeSecurityCode (async & cancel (Request Not Cancelled)) passed"), iTestCount++);
|
|
3134 |
|
|
3135 |
|
|
3136 |
// Test NotifySecurityEvent
|
|
3137 |
|
|
3138 |
RMobilePhone::TMobilePhoneSecurityEvent securityEvent;
|
|
3139 |
|
|
3140 |
aPhone.NotifySecurityEvent(aReqStatus,securityEvent);
|
|
3141 |
User::WaitForRequest(aReqStatus);
|
|
3142 |
TEST(aReqStatus.Int() == KErrNone);
|
|
3143 |
TEST(securityEvent == DMMTSY_PHONE_SECURITY_EVENT);
|
|
3144 |
|
|
3145 |
aPhone.NotifySecurityEvent(aReqStatus,securityEvent);
|
|
3146 |
aPhone.CancelAsyncRequest(EMobilePhoneNotifySecurityEvent);
|
|
3147 |
User::WaitForRequest(aReqStatus);
|
|
3148 |
TEST(aReqStatus.Int() == KErrNone || aReqStatus.Int() == KErrCancel);
|
|
3149 |
if (aReqStatus.Int() == KErrCancel)
|
|
3150 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::NotifySecurityEvent (async & cancel (Cancelled Request)) passed"), iTestCount++);
|
|
3151 |
else
|
|
3152 |
{
|
|
3153 |
TEST(securityEvent == DMMTSY_PHONE_SECURITY_EVENT);
|
|
3154 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::NotifySecurityEvent (async & cancel (Request Not Cancelled)) passed"), iTestCount++);
|
|
3155 |
}
|
|
3156 |
|
|
3157 |
// Test Verify Security Code
|
|
3158 |
|
|
3159 |
RMobilePhone::TMobilePassword code = DMMTSY_PHONE_SECURITY_OLD_PASS;
|
|
3160 |
RMobilePhone::TMobilePassword unblockCode = DMMTSY_PHONE_SECURITY_NEW_PASS;
|
|
3161 |
|
|
3162 |
aPhone.VerifySecurityCode(aReqStatus,DMMTSY_PHONE_SECURITY_CODE,code,unblockCode);
|
|
3163 |
User::WaitForRequest(aReqStatus);
|
|
3164 |
TEST(aReqStatus.Int() == KErrNone);
|
|
3165 |
|
|
3166 |
aPhone.VerifySecurityCode(aReqStatus,DMMTSY_PHONE_SECURITY_CODE,code,unblockCode);
|
|
3167 |
aPhone.CancelAsyncRequest(EMobilePhoneVerifySecurityCode);
|
|
3168 |
User::WaitForRequest(aReqStatus);
|
|
3169 |
TEST(aReqStatus.Int() == KErrNone || aReqStatus.Int() == KErrCancel);
|
|
3170 |
if (aReqStatus.Int() == KErrCancel)
|
|
3171 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::VerifySecurityCode (async & cancel (Cancelled Request)) passed"), iTestCount++);
|
|
3172 |
else
|
|
3173 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::VerifySecurityCode (async & cancel (Request Not Cancelled)) passed"), iTestCount++);
|
|
3174 |
|
|
3175 |
// Test Abort Security Code
|
|
3176 |
|
|
3177 |
TEST(aPhone.AbortSecurityCode(DMMTSY_PHONE_SECURITY_CODE) == KErrNone);
|
|
3178 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::AbortSecurityCode (sync) passed"), iTestCount++);
|
|
3179 |
|
|
3180 |
|
|
3181 |
// Test Get Security Code Info
|
|
3182 |
|
|
3183 |
RMobilePhone::TMobilePhoneSecurityCodeInfoV5 asyncSecurityCodeInfo;
|
|
3184 |
RMobilePhone::TMobilePhoneSecurityCodeInfoV5Pckg asyncSecurityCodePckg(asyncSecurityCodeInfo);
|
|
3185 |
|
|
3186 |
// asynchronous
|
|
3187 |
|
|
3188 |
aPhone.GetSecurityCodeInfo(aReqStatus,DMMTSY_PHONE_SECURITY_CODE,asyncSecurityCodePckg);
|
|
3189 |
User::WaitForRequest(aReqStatus);
|
|
3190 |
TEST(aReqStatus.Int() == KErrNone);
|
|
3191 |
TEST(asyncSecurityCodeInfo.iRemainingEntryAttempts == DMMTSY_PHONE_SECURITY_REMAINING_ATTEMPTS);
|
|
3192 |
|
|
3193 |
// asynchronous & cancel
|
|
3194 |
|
|
3195 |
aPhone.GetSecurityCodeInfo(aReqStatus,DMMTSY_PHONE_SECURITY_CODE,asyncSecurityCodePckg);
|
|
3196 |
aPhone.CancelAsyncRequest(EMobilePhoneGetSecurityCodeInfo);
|
|
3197 |
User::WaitForRequest(aReqStatus);
|
|
3198 |
TEST(aReqStatus.Int() == KErrNone || aReqStatus.Int() == KErrCancel);
|
|
3199 |
if (aReqStatus.Int() == KErrCancel)
|
|
3200 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::GetSecurityCodeInfo (async & cancel (Cancelled Request)) passed"), iTestCount++);
|
|
3201 |
else
|
|
3202 |
{
|
|
3203 |
TEST(asyncSecurityCodeInfo.iRemainingEntryAttempts == DMMTSY_PHONE_SECURITY_REMAINING_ATTEMPTS);
|
|
3204 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::GetSecurityCodeInfo (async & cancel (Request Not Cancelled)) passed"), iTestCount++);
|
|
3205 |
}
|
|
3206 |
|
|
3207 |
// Test Notify Security Code Info Change
|
|
3208 |
|
|
3209 |
RMobilePhone::TMobilePhoneSecurityCode securityCode;
|
|
3210 |
|
|
3211 |
// asynchronous
|
|
3212 |
|
|
3213 |
aPhone.NotifySecurityCodeInfoChange(aReqStatus,securityCode,asyncSecurityCodePckg);
|
|
3214 |
User::WaitForRequest(aReqStatus);
|
|
3215 |
TEST(aReqStatus.Int() == KErrNone);
|
|
3216 |
TEST(securityCode == DMMTSY_PHONE_SECURITY_CODE);
|
|
3217 |
TEST(asyncSecurityCodeInfo.iRemainingEntryAttempts == DMMTSY_PHONE_SECURITY_REMAINING_ATTEMPTS);
|
|
3218 |
|
|
3219 |
|
|
3220 |
// asynchronous & cancel
|
|
3221 |
|
|
3222 |
aPhone.NotifySecurityCodeInfoChange(aReqStatus,securityCode,asyncSecurityCodePckg);
|
|
3223 |
aPhone.CancelAsyncRequest(EMobilePhoneNotifySecurityCodeInfoChange);
|
|
3224 |
User::WaitForRequest(aReqStatus);
|
|
3225 |
TEST(aReqStatus.Int() == KErrNone || aReqStatus.Int() == KErrCancel);
|
|
3226 |
if (aReqStatus.Int() == KErrCancel)
|
|
3227 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::NotifySecurityCodeInfoChange (async & cancel (Cancelled Request)) passed"), iTestCount++);
|
|
3228 |
else
|
|
3229 |
{
|
|
3230 |
TEST(securityCode == DMMTSY_PHONE_SECURITY_CODE);
|
|
3231 |
TEST(asyncSecurityCodeInfo.iRemainingEntryAttempts == DMMTSY_PHONE_SECURITY_REMAINING_ATTEMPTS);
|
|
3232 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::NotifySecurityCodeInfoChange (async & cancel (Request Not Cancelled)) passed"), iTestCount++);
|
|
3233 |
}
|
|
3234 |
|
|
3235 |
// test.Next(_L("OK: RMobilePhone's Mobile Security"));
|
|
3236 |
}
|
|
3237 |
|
|
3238 |
void CTestPhone::TestMobileMessageWaitingL(RMobilePhone& aPhone, TRequestStatus &aReqStatus)
|
|
3239 |
{
|
|
3240 |
// Test NotifyMessageWaiting
|
|
3241 |
|
|
3242 |
TInt mwCount = 0;
|
|
3243 |
|
|
3244 |
// asynchronous
|
|
3245 |
|
|
3246 |
aPhone.NotifyMessageWaiting(aReqStatus,mwCount);
|
|
3247 |
User::WaitForRequest(aReqStatus);
|
|
3248 |
TEST(aReqStatus.Int() == KErrNone);
|
|
3249 |
TEST(mwCount == DMMTSY_PHONE_MW_COUNT);
|
|
3250 |
|
|
3251 |
// asynchronous & cancel
|
|
3252 |
|
|
3253 |
aPhone.NotifyMessageWaiting(aReqStatus,mwCount);
|
|
3254 |
aPhone.CancelAsyncRequest(EMobilePhoneNotifyMessageWaiting);
|
|
3255 |
User::WaitForRequest(aReqStatus);
|
|
3256 |
TEST(aReqStatus.Int() == KErrNone || aReqStatus.Int() == KErrCancel);
|
|
3257 |
if (aReqStatus.Int() == KErrCancel)
|
|
3258 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::Notify Message Waiting (async & cancel (Cancelled Request)) passed"), iTestCount++);
|
|
3259 |
else
|
|
3260 |
{
|
|
3261 |
TEST(mwCount == DMMTSY_PHONE_MW_COUNT);
|
|
3262 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::NotifyMessageWaiting (async & cancel (Request Not Cancelled)) passed"), iTestCount++);
|
|
3263 |
}
|
|
3264 |
|
|
3265 |
RMobilePhone::TMobilePhoneMessageWaitingV1 msgIndicators;
|
|
3266 |
RMobilePhone::TMobilePhoneMessageWaitingV1Pckg msgIndicatorsPckg(msgIndicators);
|
|
3267 |
|
|
3268 |
aPhone.GetIccMessageWaitingIndicators(aReqStatus, msgIndicatorsPckg);
|
|
3269 |
User::WaitForRequest(aReqStatus);
|
|
3270 |
TEST(aReqStatus.Int() == KErrNone);
|
|
3271 |
|
|
3272 |
TEST(msgIndicators.iDisplayStatus==DMMTSY_PHONE_DISPLAYSTATUS);
|
|
3273 |
TEST(msgIndicators.iVoiceMsgs == DMMTSY_PHONE_VOICEMSGS);
|
|
3274 |
TEST(msgIndicators.iAuxVoiceMsgs == DMMTSY_PHONE_AUXVOICEMSGS);
|
|
3275 |
TEST(msgIndicators.iDataMsgs == DMMTSY_PHONE_DATAMSGS);
|
|
3276 |
TEST(msgIndicators.iFaxMsgs == DMMTSY_PHONE_FAXMSGS);
|
|
3277 |
TEST(msgIndicators.iEmailMsgs == DMMTSY_PHONE_EMAILMSGS);
|
|
3278 |
TEST(msgIndicators.iOtherMsgs == DMMTSY_PHONE_OTHERMSGS);
|
|
3279 |
|
|
3280 |
aPhone.GetIccMessageWaitingIndicators(aReqStatus, msgIndicatorsPckg);
|
|
3281 |
aPhone.CancelAsyncRequest(EMobilePhoneGetIccMessageWaitingIndicators);
|
|
3282 |
User::WaitForRequest(aReqStatus);
|
|
3283 |
TEST(aReqStatus.Int() == KErrNone || aReqStatus.Int() == KErrCancel);
|
|
3284 |
if (aReqStatus.Int() == KErrCancel)
|
|
3285 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::GetIccMessageWaitingIndicators (async & cancel (Cancelled Request)) passed"), iTestCount++);
|
|
3286 |
else
|
|
3287 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::GetIccMessageWaitingIndicators (async & cancel (Request Not Cancelled)) passed"), iTestCount++);
|
|
3288 |
|
|
3289 |
msgIndicators.iDisplayStatus=DMMTSY_PHONE_DISPLAYSTATUS;
|
|
3290 |
msgIndicators.iVoiceMsgs = DMMTSY_PHONE_VOICEMSGS2;
|
|
3291 |
msgIndicators.iAuxVoiceMsgs = DMMTSY_PHONE_AUXVOICEMSGS2;
|
|
3292 |
msgIndicators.iDataMsgs = DMMTSY_PHONE_DATAMSGS2;
|
|
3293 |
msgIndicators.iFaxMsgs = DMMTSY_PHONE_FAXMSGS2;
|
|
3294 |
msgIndicators.iEmailMsgs = DMMTSY_PHONE_EMAILMSGS2;
|
|
3295 |
msgIndicators.iOtherMsgs = DMMTSY_PHONE_OTHERMSGS2;
|
|
3296 |
|
|
3297 |
aPhone.SetIccMessageWaitingIndicators(aReqStatus, msgIndicatorsPckg);
|
|
3298 |
User::WaitForRequest(aReqStatus);
|
|
3299 |
TEST(aReqStatus.Int() == KErrNone);
|
|
3300 |
|
|
3301 |
aPhone.SetIccMessageWaitingIndicators(aReqStatus, msgIndicatorsPckg);
|
|
3302 |
aPhone.CancelAsyncRequest(EMobilePhoneSetIccMessageWaitingIndicators);
|
|
3303 |
User::WaitForRequest(aReqStatus);
|
|
3304 |
TEST(aReqStatus.Int() == KErrNone || aReqStatus.Int() == KErrCancel);
|
|
3305 |
if (aReqStatus.Int() == KErrCancel)
|
|
3306 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::SetIccMessageWaitingIndicators (async & cancel (Cancelled Request)) passed"), iTestCount++);
|
|
3307 |
else
|
|
3308 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::SetIccMessageWaitingIndicators (async & cancel (Request Not Cancelled)) passed"), iTestCount++);
|
|
3309 |
|
|
3310 |
aPhone.NotifyIccMessageWaitingIndicatorsChange(aReqStatus, msgIndicatorsPckg);
|
|
3311 |
User::WaitForRequest(aReqStatus);
|
|
3312 |
TEST(aReqStatus.Int() == KErrNone);
|
|
3313 |
|
|
3314 |
TEST(msgIndicators.iDisplayStatus==DMMTSY_PHONE_DISPLAYSTATUS);
|
|
3315 |
TEST(msgIndicators.iVoiceMsgs == DMMTSY_PHONE_VOICEMSGS2);
|
|
3316 |
TEST(msgIndicators.iAuxVoiceMsgs == DMMTSY_PHONE_AUXVOICEMSGS2);
|
|
3317 |
TEST(msgIndicators.iDataMsgs == DMMTSY_PHONE_DATAMSGS2);
|
|
3318 |
TEST(msgIndicators.iFaxMsgs == DMMTSY_PHONE_FAXMSGS2);
|
|
3319 |
TEST(msgIndicators.iEmailMsgs == DMMTSY_PHONE_EMAILMSGS2);
|
|
3320 |
TEST(msgIndicators.iOtherMsgs == DMMTSY_PHONE_OTHERMSGS2);
|
|
3321 |
|
|
3322 |
aPhone.NotifyIccMessageWaitingIndicatorsChange(aReqStatus, msgIndicatorsPckg);
|
|
3323 |
aPhone.CancelAsyncRequest(EMobilePhoneNotifyIccMessageWaitingIndicatorsChange);
|
|
3324 |
User::WaitForRequest(aReqStatus);
|
|
3325 |
TEST(aReqStatus.Int() == KErrNone || aReqStatus.Int() == KErrCancel);
|
|
3326 |
if (aReqStatus.Int() == KErrCancel)
|
|
3327 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::NotifyIccMessageWaitingIndicatorsChange (async & cancel (Cancelled Request)) passed"), iTestCount++);
|
|
3328 |
else
|
|
3329 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::NotifyIccMessageWaitingIndicatorsChange (async & cancel (Request Not Cancelled)) passed"), iTestCount++);
|
|
3330 |
|
|
3331 |
//Test with TMobilePhoneMessageWaitingV8 class
|
|
3332 |
RMobilePhone::TMobilePhoneMessageWaitingV8 msgIndicatorsV8;
|
|
3333 |
RMobilePhone::TMobilePhoneMessageWaitingV8Pckg msgIndicatorsV8Pckg(msgIndicatorsV8);
|
|
3334 |
|
|
3335 |
aPhone.GetIccMessageWaitingIndicators(aReqStatus, msgIndicatorsV8Pckg);
|
|
3336 |
User::WaitForRequest(aReqStatus);
|
|
3337 |
TEST(aReqStatus.Int() == KErrNone);
|
|
3338 |
|
|
3339 |
TEST(msgIndicatorsV8.iVideoMsgs == DMMTSY_PHONE_VIDEOMSGS1);
|
|
3340 |
|
|
3341 |
aPhone.GetIccMessageWaitingIndicators(aReqStatus, msgIndicatorsV8Pckg);
|
|
3342 |
aPhone.CancelAsyncRequest(EMobilePhoneGetIccMessageWaitingIndicators);
|
|
3343 |
User::WaitForRequest(aReqStatus);
|
|
3344 |
TEST(aReqStatus.Int() == KErrNone || aReqStatus.Int() == KErrCancel);
|
|
3345 |
if (aReqStatus.Int() == KErrCancel)
|
|
3346 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::GetIccMessageWaitingIndicators (async & cancel (Cancelled Request)) passed"), iTestCount++);
|
|
3347 |
else
|
|
3348 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::GetIccMessageWaitingIndicators (async & cancel (Request Not Cancelled)) passed"), iTestCount++);
|
|
3349 |
|
|
3350 |
msgIndicatorsV8.iDisplayStatus=DMMTSY_PHONE_DISPLAYSTATUS;
|
|
3351 |
msgIndicatorsV8.iVoiceMsgs = DMMTSY_PHONE_VOICEMSGS2;
|
|
3352 |
msgIndicatorsV8.iAuxVoiceMsgs = DMMTSY_PHONE_AUXVOICEMSGS2;
|
|
3353 |
msgIndicatorsV8.iDataMsgs = DMMTSY_PHONE_DATAMSGS2;
|
|
3354 |
msgIndicatorsV8.iFaxMsgs = DMMTSY_PHONE_FAXMSGS2;
|
|
3355 |
msgIndicatorsV8.iEmailMsgs = DMMTSY_PHONE_EMAILMSGS2;
|
|
3356 |
msgIndicatorsV8.iOtherMsgs = DMMTSY_PHONE_OTHERMSGS2;
|
|
3357 |
msgIndicatorsV8.iVideoMsgs = DMMTSY_PHONE_VIDEOMSGS2;
|
|
3358 |
|
|
3359 |
aPhone.SetIccMessageWaitingIndicators(aReqStatus, msgIndicatorsV8Pckg);
|
|
3360 |
User::WaitForRequest(aReqStatus);
|
|
3361 |
TEST(aReqStatus.Int() == KErrNone);
|
|
3362 |
|
|
3363 |
aPhone.SetIccMessageWaitingIndicators(aReqStatus, msgIndicatorsV8Pckg);
|
|
3364 |
aPhone.CancelAsyncRequest(EMobilePhoneSetIccMessageWaitingIndicators);
|
|
3365 |
User::WaitForRequest(aReqStatus);
|
|
3366 |
TEST(aReqStatus.Int() == KErrNone || aReqStatus.Int() == KErrCancel);
|
|
3367 |
if (aReqStatus.Int() == KErrCancel)
|
|
3368 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::SetIccMessageWaitingIndicators (async & cancel (Cancelled Request)) passed"), iTestCount++);
|
|
3369 |
else
|
|
3370 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::SetIccMessageWaitingIndicators (async & cancel (Request Not Cancelled)) passed"), iTestCount++);
|
|
3371 |
|
|
3372 |
aPhone.NotifyIccMessageWaitingIndicatorsChange(aReqStatus, msgIndicatorsV8Pckg);
|
|
3373 |
User::WaitForRequest(aReqStatus);
|
|
3374 |
TEST(aReqStatus.Int() == KErrNone);
|
|
3375 |
|
|
3376 |
TEST(msgIndicatorsV8.iVideoMsgs == DMMTSY_PHONE_VIDEOMSGS2);
|
|
3377 |
|
|
3378 |
aPhone.NotifyIccMessageWaitingIndicatorsChange(aReqStatus, msgIndicatorsV8Pckg);
|
|
3379 |
aPhone.CancelAsyncRequest(EMobilePhoneNotifyIccMessageWaitingIndicatorsChange);
|
|
3380 |
User::WaitForRequest(aReqStatus);
|
|
3381 |
TEST(aReqStatus.Int() == KErrNone || aReqStatus.Int() == KErrCancel);
|
|
3382 |
if (aReqStatus.Int() == KErrCancel)
|
|
3383 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::NotifyIccMessageWaitingIndicatorsChange (async & cancel (Cancelled Request)) passed"), iTestCount++);
|
|
3384 |
else
|
|
3385 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::NotifyIccMessageWaitingIndicatorsChange (async & cancel (Request Not Cancelled)) passed"), iTestCount++);
|
|
3386 |
}
|
|
3387 |
|
|
3388 |
void CTestPhone::TestMobileFixedDiallingNumbersL(RMobilePhone& aPhone, TRequestStatus &aReqStatus)
|
|
3389 |
{
|
|
3390 |
// Test GetFdnStatus
|
|
3391 |
|
|
3392 |
RMobilePhone::TMobilePhoneFdnStatus fdnStatus,fdnStatus2;
|
|
3393 |
|
|
3394 |
// synchronous
|
|
3395 |
|
|
3396 |
TEST(aPhone.GetFdnStatus(fdnStatus) == KErrNone);
|
|
3397 |
TEST(fdnStatus == DMMTSY_PHONE_FDN_STATUS);
|
|
3398 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::GetFdnStatus (sync) passed"), iTestCount++);
|
|
3399 |
|
|
3400 |
// asynchronous
|
|
3401 |
|
|
3402 |
aPhone.GetFdnStatus(aReqStatus, fdnStatus);
|
|
3403 |
User::WaitForRequest(aReqStatus);
|
|
3404 |
TEST(aReqStatus.Int() == KErrNone);
|
|
3405 |
TEST(fdnStatus == DMMTSY_PHONE_FDN_STATUS);
|
|
3406 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::GetFdnStatus (async) passed"), iTestCount++);
|
|
3407 |
|
|
3408 |
// asynchronous & cancel
|
|
3409 |
|
|
3410 |
aPhone.GetFdnStatus(aReqStatus, fdnStatus);
|
|
3411 |
aPhone.CancelAsyncRequest(EMobilePhoneGetFdnStatus);
|
|
3412 |
User::WaitForRequest(aReqStatus);
|
|
3413 |
TEST(aReqStatus.Int() == KErrNone || aReqStatus.Int() == KErrCancel);
|
|
3414 |
|
|
3415 |
if(aReqStatus.Int() == KErrCancel)
|
|
3416 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::GetFdnStatus (async & cancel (Cancelled Request)) passed"), iTestCount++);
|
|
3417 |
else
|
|
3418 |
{
|
|
3419 |
TEST(fdnStatus == DMMTSY_PHONE_FDN_STATUS);
|
|
3420 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::GetFdnStatus (async & cancel (Request Not Cancelled)) passed"), iTestCount++);
|
|
3421 |
}
|
|
3422 |
|
|
3423 |
// Test SetFdnSetting
|
|
3424 |
|
|
3425 |
// asynchronous
|
|
3426 |
|
|
3427 |
aPhone.SetFdnSetting(aReqStatus,DMMTSY_PHONE_FDN_SETTING);
|
|
3428 |
User::WaitForRequest(aReqStatus);
|
|
3429 |
TEST(aReqStatus.Int() == KErrNone);
|
|
3430 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::SetFdnSetting (async) passed"), iTestCount++);
|
|
3431 |
|
|
3432 |
// asynchronous & cancel
|
|
3433 |
|
|
3434 |
aPhone.SetFdnSetting(aReqStatus,DMMTSY_PHONE_FDN_SETTING);
|
|
3435 |
aPhone.CancelAsyncRequest(EMobilePhoneSetFdnSetting);
|
|
3436 |
User::WaitForRequest(aReqStatus);
|
|
3437 |
TEST(aReqStatus.Int() == KErrNone || aReqStatus.Int() == KErrCancel);
|
|
3438 |
if (aReqStatus.Int() == KErrCancel)
|
|
3439 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::SetFdnSetting (async & cancel (Cancelled Request)) passed"), iTestCount++);
|
|
3440 |
else
|
|
3441 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::SetFdnSetting (async & cancel (Request Not Cancelled)) passed"), iTestCount++);
|
|
3442 |
|
|
3443 |
|
|
3444 |
// Test Notify Fdn Status Change
|
|
3445 |
|
|
3446 |
aPhone.NotifyFdnStatusChange(aReqStatus,fdnStatus2);
|
|
3447 |
User::WaitForRequest(aReqStatus);
|
|
3448 |
TEST(aReqStatus.Int() == KErrNone);
|
|
3449 |
TEST(fdnStatus2 == DMMTSY_PHONE_FDN_STATUS);
|
|
3450 |
|
|
3451 |
aPhone.NotifyFdnStatusChange(aReqStatus,fdnStatus2);
|
|
3452 |
aPhone.CancelAsyncRequest(EMobilePhoneNotifyFdnStatusChange);
|
|
3453 |
User::WaitForRequest(aReqStatus);
|
|
3454 |
TEST(aReqStatus.Int() == KErrNone || aReqStatus.Int() == KErrCancel);
|
|
3455 |
if (aReqStatus.Int() == KErrCancel)
|
|
3456 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::NotifyFdnStatusChange (async & cancel (Cancelled Request)) passed"), iTestCount++);
|
|
3457 |
else
|
|
3458 |
{
|
|
3459 |
TEST(fdnStatus2 == DMMTSY_PHONE_FDN_STATUS);
|
|
3460 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::NotifyFdnStatusChange (async & cancel (Request Not Cancelled)) passed"), iTestCount++);
|
|
3461 |
}
|
|
3462 |
|
|
3463 |
|
|
3464 |
// CleanupStack::PopAndDestroy(); // getCcbs
|
|
3465 |
}
|
|
3466 |
|
|
3467 |
void CTestPhone::TestMobileMulticallSettings(RMobilePhone& aPhone, TRequestStatus &aReqStatus)
|
|
3468 |
{
|
|
3469 |
// Test GetMulticallParams
|
|
3470 |
|
|
3471 |
RMobilePhone::TMobilePhoneMulticallSettingsV1 bearerSettings;
|
|
3472 |
RMobilePhone::TMobilePhoneMulticallSettingsV1Pckg bearerSettingsPckg(bearerSettings);
|
|
3473 |
|
|
3474 |
// asynchronous
|
|
3475 |
|
|
3476 |
aPhone.GetMulticallParams(aReqStatus, bearerSettingsPckg);
|
|
3477 |
User::WaitForRequest(aReqStatus);
|
|
3478 |
TEST(aReqStatus.Int() == KErrNone);
|
|
3479 |
|
|
3480 |
// extract the returned bearerSettings from the package
|
|
3481 |
|
|
3482 |
bearerSettings=bearerSettingsPckg();
|
|
3483 |
ValidateMulticallParams(bearerSettings, 0);
|
|
3484 |
|
|
3485 |
// asynchronous & cancel
|
|
3486 |
|
|
3487 |
aPhone.GetMulticallParams(aReqStatus, bearerSettingsPckg);
|
|
3488 |
aPhone.CancelAsyncRequest(EMobilePhoneGetMulticallParams);
|
|
3489 |
User::WaitForRequest(aReqStatus);
|
|
3490 |
TEST(aReqStatus.Int() == KErrNone || aReqStatus.Int() == KErrCancel);
|
|
3491 |
|
|
3492 |
if(aReqStatus.Int() == KErrCancel)
|
|
3493 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::GetMulticallParams (async & cancel (Cancelled Request)) passed"), iTestCount++);
|
|
3494 |
else
|
|
3495 |
{
|
|
3496 |
// extract the returned bearerSettings from the package
|
|
3497 |
bearerSettings = bearerSettingsPckg();
|
|
3498 |
ValidateMulticallParams(bearerSettings, 0);
|
|
3499 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::GetMulticallParams (async & cancel (Request Not Cancelled)) passed"), iTestCount++);
|
|
3500 |
}
|
|
3501 |
|
|
3502 |
// Test SetMulticallParams
|
|
3503 |
|
|
3504 |
// asynchronous
|
|
3505 |
|
|
3506 |
aPhone.SetMulticallParams(aReqStatus, DMMTSY_PHONE_USER_MAX_BEARERS1);
|
|
3507 |
User::WaitForRequest(aReqStatus);
|
|
3508 |
TEST(aReqStatus.Int() == KErrNone);
|
|
3509 |
|
|
3510 |
// asynchronous & cancel
|
|
3511 |
|
|
3512 |
aPhone.SetMulticallParams(aReqStatus, DMMTSY_PHONE_USER_MAX_BEARERS1);
|
|
3513 |
aPhone.CancelAsyncRequest(EMobilePhoneSetMulticallParams);
|
|
3514 |
User::WaitForRequest(aReqStatus);
|
|
3515 |
TEST(aReqStatus.Int() == KErrNone || aReqStatus.Int() == KErrCancel);
|
|
3516 |
|
|
3517 |
if(aReqStatus.Int() == KErrCancel)
|
|
3518 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::SetMulticallParams (async & cancel (Cancelled Request)) passed"), iTestCount++);
|
|
3519 |
else
|
|
3520 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::SetMulticallParams (async & cancel (Request Not Cancelled)) passed"), iTestCount++);
|
|
3521 |
|
|
3522 |
// Test NotifyMulticallParamsChange
|
|
3523 |
|
|
3524 |
// asynchronous
|
|
3525 |
|
|
3526 |
aPhone.NotifyMulticallParamsChange(aReqStatus, bearerSettingsPckg);
|
|
3527 |
User::WaitForRequest(aReqStatus);
|
|
3528 |
TEST(aReqStatus.Int() == KErrNone);
|
|
3529 |
|
|
3530 |
// extract the returned bearerSettings from the package
|
|
3531 |
|
|
3532 |
bearerSettings=bearerSettingsPckg();
|
|
3533 |
ValidateMulticallParams(bearerSettings, 1);
|
|
3534 |
|
|
3535 |
// asynchronous & cancel
|
|
3536 |
|
|
3537 |
aPhone.NotifyMulticallParamsChange(aReqStatus, bearerSettingsPckg);
|
|
3538 |
aPhone.CancelAsyncRequest(EMobilePhoneNotifyMulticallParamsChange);
|
|
3539 |
User::WaitForRequest(aReqStatus);
|
|
3540 |
TEST(aReqStatus.Int() == KErrNone || aReqStatus.Int() == KErrCancel);
|
|
3541 |
|
|
3542 |
if(aReqStatus.Int() == KErrCancel)
|
|
3543 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::NotifyMulticallParamsChange (async & cancel (Cancelled Request)) passed"), iTestCount++);
|
|
3544 |
else
|
|
3545 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::NotifyMulticallParamsChange (async & cancel (Request Not Cancelled)) passed"), iTestCount++);
|
|
3546 |
|
|
3547 |
//Test NotifyMulticallIndicatorChange
|
|
3548 |
RMobilePhone::TMobilePhoneMulticallIndicator indicator;
|
|
3549 |
|
|
3550 |
// asynchronous
|
|
3551 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::NotifyMulticallIndicatorChange async."), iTestCount++);
|
|
3552 |
aPhone.NotifyMulticallIndicatorChange(aReqStatus, indicator);
|
|
3553 |
User::WaitForRequest(aReqStatus);
|
|
3554 |
TEST(aReqStatus.Int() == KErrNone);
|
|
3555 |
TEST(indicator == DMMTSY_PHONE_MULTICALL_IND);
|
|
3556 |
|
|
3557 |
// asynchronous & cancel
|
|
3558 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::NotifyMulticallIndicatorChange async & cancel."), iTestCount++);
|
|
3559 |
aPhone.NotifyMulticallIndicatorChange(aReqStatus, indicator);
|
|
3560 |
aPhone.CancelAsyncRequest(EMobilePhoneNotifyMulticallIndicatorChange);
|
|
3561 |
User::WaitForRequest(aReqStatus);
|
|
3562 |
TEST(aReqStatus.Int() == KErrCancel);
|
|
3563 |
|
|
3564 |
|
|
3565 |
}
|
|
3566 |
|
|
3567 |
void CTestPhone::TestMobileIncomingCallTypes(RMobilePhone& aPhone, TRequestStatus &aReqStatus)
|
|
3568 |
{
|
|
3569 |
// Test GetIncomingCallType
|
|
3570 |
|
|
3571 |
RMobileCall::TMobileDataCallParamsV1 dataParams;
|
|
3572 |
RMobileCall::TMobileDataCallParamsV1Pckg dataParamsPckg(dataParams);
|
|
3573 |
|
|
3574 |
RMobilePhone::TMobilePhoneIncomingCallType callType;
|
|
3575 |
|
|
3576 |
// asynchronous
|
|
3577 |
|
|
3578 |
aPhone.GetIncomingCallType(aReqStatus, callType, dataParamsPckg);
|
|
3579 |
User::WaitForRequest(aReqStatus);
|
|
3580 |
TEST(aReqStatus.Int() == KErrNone);
|
|
3581 |
TEST(callType == DMMTSY_PHONE_INCOMING_CALL_TYPES);
|
|
3582 |
|
|
3583 |
// extract the returned dataParams from the package
|
|
3584 |
dataParams=dataParamsPckg();
|
|
3585 |
ValidateDataCallParams(dataParams, 0);
|
|
3586 |
|
|
3587 |
// asynchronous & cancel
|
|
3588 |
|
|
3589 |
aPhone.GetIncomingCallType(aReqStatus, callType, dataParamsPckg);
|
|
3590 |
aPhone.CancelAsyncRequest(EMobilePhoneGetIncomingCallType);
|
|
3591 |
User::WaitForRequest(aReqStatus);
|
|
3592 |
TEST(aReqStatus.Int() == KErrNone || aReqStatus.Int() == KErrCancel);
|
|
3593 |
|
|
3594 |
if(aReqStatus.Int() == KErrCancel)
|
|
3595 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::GetIncomingCallType (async & cancel (Cancelled Request)) passed"), iTestCount++);
|
|
3596 |
else
|
|
3597 |
{
|
|
3598 |
// extract the returned dataParams from the package
|
|
3599 |
dataParams = dataParamsPckg();
|
|
3600 |
ValidateDataCallParams(dataParams, 0);
|
|
3601 |
TEST(callType == DMMTSY_PHONE_INCOMING_CALL_TYPES);
|
|
3602 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::GetIncomingCallType (async & cancel (Request Not Cancelled)) passed"), iTestCount++);
|
|
3603 |
}
|
|
3604 |
|
|
3605 |
// Test SetIncomingCallType
|
|
3606 |
|
|
3607 |
dataParams.iService = DMMTSY_DATA_CALL_SERVICE;
|
|
3608 |
dataParams.iSpeed = DMMTSY_DATA_CALL_SPEED;
|
|
3609 |
dataParams.iProtocol = DMMTSY_DATA_CALL_PROTOCOL;
|
|
3610 |
dataParams.iQoS = DMMTSY_DATA_CALL_QOS;
|
|
3611 |
dataParams.iRLPVersion = DMMTSY_DATA_CALL_RLP;
|
|
3612 |
dataParams.iV42bisReq = DMMTSY_DATA_CALL_V42BIS;
|
|
3613 |
|
|
3614 |
// asynchronous
|
|
3615 |
|
|
3616 |
aPhone.SetIncomingCallType(aReqStatus, DMMTSY_PHONE_INCOMING_CALL_TYPES, dataParamsPckg);
|
|
3617 |
User::WaitForRequest(aReqStatus);
|
|
3618 |
TEST(aReqStatus.Int() == KErrNone);
|
|
3619 |
|
|
3620 |
// asynchronous & cancel
|
|
3621 |
|
|
3622 |
aPhone.SetIncomingCallType(aReqStatus, DMMTSY_PHONE_INCOMING_CALL_TYPES, dataParamsPckg);
|
|
3623 |
aPhone.CancelAsyncRequest(EMobilePhoneSetIncomingCallType);
|
|
3624 |
User::WaitForRequest(aReqStatus);
|
|
3625 |
TEST(aReqStatus.Int() == KErrNone || aReqStatus.Int() == KErrCancel);
|
|
3626 |
|
|
3627 |
if(aReqStatus.Int() == KErrCancel)
|
|
3628 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::SetIncomingCallType (async & cancel (Cancelled Request)) passed"), iTestCount++);
|
|
3629 |
else
|
|
3630 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::SetIncomingCallType (async & cancel (Request Not Cancelled)) passed"), iTestCount++);
|
|
3631 |
|
|
3632 |
// Test NotifyIncomingCallTypeChange
|
|
3633 |
|
|
3634 |
aPhone.NotifyIncomingCallTypeChange(aReqStatus, callType, dataParamsPckg);
|
|
3635 |
User::WaitForRequest(aReqStatus);
|
|
3636 |
TEST(aReqStatus.Int() == KErrNone);
|
|
3637 |
|
|
3638 |
// extract the returned dataParams from the package
|
|
3639 |
|
|
3640 |
dataParams = dataParamsPckg();
|
|
3641 |
ValidateDataCallParams(dataParams, 1);
|
|
3642 |
|
|
3643 |
// asynchronous & cancel
|
|
3644 |
|
|
3645 |
aPhone.NotifyIncomingCallTypeChange(aReqStatus, callType, dataParamsPckg);
|
|
3646 |
aPhone.CancelAsyncRequest(EMobilePhoneNotifyIncomingCallTypeChange);
|
|
3647 |
User::WaitForRequest(aReqStatus);
|
|
3648 |
TEST(aReqStatus.Int() == KErrNone || aReqStatus.Int() == KErrCancel);
|
|
3649 |
|
|
3650 |
if(aReqStatus.Int() == KErrCancel)
|
|
3651 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::NotifyIncomingCallTypeChange (async & cancel (Cancelled Request)) passed"), iTestCount++);
|
|
3652 |
else
|
|
3653 |
{
|
|
3654 |
// extract the returned dataParams from the package
|
|
3655 |
dataParams = dataParamsPckg();
|
|
3656 |
ValidateDataCallParams(dataParams, 1);
|
|
3657 |
TEST(callType == DMMTSY_PHONE_INCOMING_CALL_TYPES1);
|
|
3658 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::NotifyIncomingCallTypeChange (async & cancel (Request Not Cancelled)) passed"), iTestCount++);
|
|
3659 |
}
|
|
3660 |
|
|
3661 |
//test multiple completion with different parameter buffers
|
|
3662 |
|
|
3663 |
//use a second phone client object
|
|
3664 |
RMobilePhone mmPhone2;
|
|
3665 |
TInt ret=mmPhone2.Open(iTelServer,DMMTSY_PHONE_NAME);
|
|
3666 |
TEST(ret==KErrNone);
|
|
3667 |
//set up a second parameter package
|
|
3668 |
TRequestStatus aReqStatus2;
|
|
3669 |
RMobileCall::TMobileDataCallParamsV2 dataParams2;
|
|
3670 |
RMobileCall::TMobileDataCallParamsV2Pckg dataParamsPckg2(dataParams2);
|
|
3671 |
RMobilePhone::TMobilePhoneIncomingCallType callType2;
|
|
3672 |
|
|
3673 |
//set up first notification request using V2 package format
|
|
3674 |
mmPhone2.NotifyIncomingCallTypeChange(aReqStatus2, callType2, dataParamsPckg2);
|
|
3675 |
//set up second notification request using V1 package format
|
|
3676 |
aPhone.NotifyIncomingCallTypeChange(aReqStatus, callType, dataParamsPckg);
|
|
3677 |
|
|
3678 |
|
|
3679 |
User::WaitForRequest(aReqStatus);
|
|
3680 |
User::WaitForRequest(aReqStatus2);
|
|
3681 |
|
|
3682 |
//validate the version 2 package
|
|
3683 |
ValidateDataCallParams(dataParams2, 1);
|
|
3684 |
dataParams2.iBearerMode = DMMTSY_PHONE_MULTICALLBEARERMODE_NOTSUPPORTED;
|
|
3685 |
|
|
3686 |
mmPhone2.Close();
|
|
3687 |
|
|
3688 |
// test.Next(_L("OK: RMobilePhone's Incoming Call Types OK"));
|
|
3689 |
}
|
|
3690 |
|
|
3691 |
void CTestPhone::TestMobileUUSSetting(RMobilePhone& aPhone, TRequestStatus& aReqStatus)
|
|
3692 |
{
|
|
3693 |
// Test GetUUSSetting
|
|
3694 |
|
|
3695 |
RMobilePhone::TMobilePhoneUUSSetting uusSetting;
|
|
3696 |
|
|
3697 |
// asynchronous
|
|
3698 |
|
|
3699 |
aPhone.GetUUSSetting(aReqStatus, uusSetting);
|
|
3700 |
User::WaitForRequest(aReqStatus);
|
|
3701 |
TEST(aReqStatus.Int() == KErrNone);
|
|
3702 |
TEST(uusSetting == DMMTSY_PHONE_UUS_SETTING1);
|
|
3703 |
|
|
3704 |
// asynchronous & cancel
|
|
3705 |
|
|
3706 |
aPhone.GetUUSSetting(aReqStatus, uusSetting);
|
|
3707 |
aPhone.CancelAsyncRequest(EMobilePhoneGetUUSSetting);
|
|
3708 |
User::WaitForRequest(aReqStatus);
|
|
3709 |
TEST(aReqStatus.Int() == KErrNone || aReqStatus.Int() == KErrCancel);
|
|
3710 |
|
|
3711 |
if(aReqStatus.Int() == KErrCancel)
|
|
3712 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::GetUUSSetting (async & cancel (Cancelled Request)) passed"), iTestCount++);
|
|
3713 |
else
|
|
3714 |
{
|
|
3715 |
TEST(uusSetting == DMMTSY_PHONE_UUS_SETTING1);
|
|
3716 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::GetUUSSetting (async & cancel (Request Not Cancelled)) passed"), iTestCount++);
|
|
3717 |
}
|
|
3718 |
|
|
3719 |
// Test SetUUSSetting
|
|
3720 |
|
|
3721 |
// asynchronous
|
|
3722 |
|
|
3723 |
aPhone.SetUUSSetting(aReqStatus, DMMTSY_PHONE_UUS_SETTING2);
|
|
3724 |
User::WaitForRequest(aReqStatus);
|
|
3725 |
TEST(aReqStatus.Int() == KErrNone);
|
|
3726 |
|
|
3727 |
// asynchronous & cancel
|
|
3728 |
|
|
3729 |
aPhone.SetUUSSetting(aReqStatus, DMMTSY_PHONE_UUS_SETTING2);
|
|
3730 |
aPhone.CancelAsyncRequest(EMobilePhoneSetUUSSetting);
|
|
3731 |
User::WaitForRequest(aReqStatus);
|
|
3732 |
TEST(aReqStatus.Int() == KErrNone || aReqStatus.Int() == KErrCancel);
|
|
3733 |
|
|
3734 |
if(aReqStatus.Int() == KErrCancel)
|
|
3735 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::SetUUSSetting (async & cancel (Cancelled Request)) passed"), iTestCount++);
|
|
3736 |
else
|
|
3737 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::SetUUSSetting (async & cancel (Request Not Cancelled)) passed"), iTestCount++);
|
|
3738 |
|
|
3739 |
// Test NotifyUUSSettingChange
|
|
3740 |
|
|
3741 |
// asynchronous
|
|
3742 |
|
|
3743 |
aPhone.NotifyUUSSettingChange(aReqStatus, uusSetting);
|
|
3744 |
User::WaitForRequest(aReqStatus);
|
|
3745 |
TEST(aReqStatus.Int() == KErrNone);
|
|
3746 |
TEST(uusSetting == DMMTSY_PHONE_UUS_SETTING2);
|
|
3747 |
|
|
3748 |
// asynchronous & cancel
|
|
3749 |
|
|
3750 |
aPhone.NotifyUUSSettingChange(aReqStatus, uusSetting);
|
|
3751 |
aPhone.CancelAsyncRequest(EMobilePhoneNotifyUUSSettingChange);
|
|
3752 |
User::WaitForRequest(aReqStatus);
|
|
3753 |
TEST(aReqStatus.Int() == KErrNone || aReqStatus.Int() == KErrCancel);
|
|
3754 |
|
|
3755 |
if(aReqStatus.Int() == KErrCancel)
|
|
3756 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::NotifyUUSSettingChange (async & cancel (Cancelled Request)) passed"), iTestCount++);
|
|
3757 |
else
|
|
3758 |
{
|
|
3759 |
TEST(uusSetting == DMMTSY_PHONE_UUS_SETTING2);
|
|
3760 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::NotifyUUSSettingChange (async & cancel (Request Not Cancelled)) passed"), iTestCount++);
|
|
3761 |
}
|
|
3762 |
|
|
3763 |
}
|
|
3764 |
|
|
3765 |
void CTestPhone::TestMultimediaCallSettings(RMobilePhone& aPhone, TRequestStatus& aReqStatus)
|
|
3766 |
{
|
|
3767 |
|
|
3768 |
// Test GetMultimediaCallPreference
|
|
3769 |
|
|
3770 |
RMobilePhone:: TMobilePhoneMultimediaSettings mmSetting;
|
|
3771 |
|
|
3772 |
// synchronous
|
|
3773 |
aPhone.GetMultimediaCallPreference(mmSetting);
|
|
3774 |
TEST(mmSetting == DMMTSY_PHONE_MM_SETTING);
|
|
3775 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::GetMultimediaCallPreference (sync) passed"), iTestCount++);
|
|
3776 |
|
|
3777 |
// Test GetMultimediaCallPreference
|
|
3778 |
|
|
3779 |
// asynchronous
|
|
3780 |
|
|
3781 |
aPhone.SetMultimediaCallPreference(aReqStatus, DMMTSY_PHONE_MM_SETTING);
|
|
3782 |
User::WaitForRequest(aReqStatus);
|
|
3783 |
TEST(aReqStatus.Int() == KErrNone);
|
|
3784 |
|
|
3785 |
// asynchronous & cancel
|
|
3786 |
|
|
3787 |
aPhone.SetMultimediaCallPreference(aReqStatus, DMMTSY_PHONE_MM_SETTING);
|
|
3788 |
aPhone.CancelAsyncRequest(EMobilePhoneSetMultimediaCallPreference);
|
|
3789 |
User::WaitForRequest(aReqStatus);
|
|
3790 |
TEST(aReqStatus.Int() == KErrNone || aReqStatus.Int() == KErrCancel);
|
|
3791 |
|
|
3792 |
if(aReqStatus.Int() == KErrCancel)
|
|
3793 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::SetMultimediaCallPreference (async & cancel (Cancelled Request)) passed"), iTestCount++);
|
|
3794 |
else
|
|
3795 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::SetMultimediaCallPreference (async & cancel (Request Not Cancelled)) passed"), iTestCount++);
|
|
3796 |
|
|
3797 |
// Test NotifyMultimediaCallPreferenceChange
|
|
3798 |
|
|
3799 |
// asynchronous
|
|
3800 |
|
|
3801 |
aPhone.NotifyMultimediaCallPreferenceChange(aReqStatus, mmSetting);
|
|
3802 |
User::WaitForRequest(aReqStatus);
|
|
3803 |
TEST(aReqStatus.Int() == KErrNone);
|
|
3804 |
TEST(mmSetting == DMMTSY_PHONE_MM_SETTING_2);
|
|
3805 |
|
|
3806 |
// asynchronous & cancel
|
|
3807 |
|
|
3808 |
aPhone.NotifyMultimediaCallPreferenceChange(aReqStatus, mmSetting);
|
|
3809 |
aPhone.CancelAsyncRequest(EMobilePhoneNotifyMultimediaCallPreferenceChange);
|
|
3810 |
User::WaitForRequest(aReqStatus);
|
|
3811 |
TEST(aReqStatus.Int() == KErrNone || aReqStatus.Int() == KErrCancel);
|
|
3812 |
|
|
3813 |
if(aReqStatus.Int() == KErrCancel)
|
|
3814 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::NotifyMultimediaCallPreferenceChange (async & cancel (Cancelled Request)) passed"), iTestCount++);
|
|
3815 |
else
|
|
3816 |
{
|
|
3817 |
TEST(mmSetting == DMMTSY_PHONE_MM_SETTING_2);
|
|
3818 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::NotifyMultimediaCallPreferenceChange (async & cancel (Request Not Cancelled)) passed"), iTestCount++);
|
|
3819 |
}
|
|
3820 |
|
|
3821 |
}
|
|
3822 |
|
|
3823 |
void CTestPhone::TestNetworkSecurity(RMobilePhone& aPhone, TRequestStatus &aReqStatus)
|
|
3824 |
{
|
|
3825 |
|
|
3826 |
// Test GetNetworkSecurityLevel
|
|
3827 |
RMobilePhone::TMobilePhoneNetworkSecurity netSecurity;
|
|
3828 |
|
|
3829 |
// asynchronous
|
|
3830 |
|
|
3831 |
aPhone.GetNetworkSecurityLevel(aReqStatus, netSecurity);
|
|
3832 |
User::WaitForRequest(aReqStatus);
|
|
3833 |
TEST(aReqStatus.Int() == KErrNone);
|
|
3834 |
TEST(netSecurity == DMMTSY_PHONE_NET_SECURITY);
|
|
3835 |
|
|
3836 |
// asynchronous & cancel
|
|
3837 |
|
|
3838 |
aPhone.GetNetworkSecurityLevel(aReqStatus, netSecurity);
|
|
3839 |
aPhone.CancelAsyncRequest(EMobilePhoneGetNetworkSecurityLevel);
|
|
3840 |
User::WaitForRequest(aReqStatus);
|
|
3841 |
TEST(aReqStatus.Int() == KErrNone || aReqStatus.Int() == KErrCancel);
|
|
3842 |
|
|
3843 |
if(aReqStatus.Int() == KErrCancel)
|
|
3844 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::GetNetworkSecurityLevel (async & cancel (Cancelled Request)) passed"), iTestCount++);
|
|
3845 |
else
|
|
3846 |
{
|
|
3847 |
TEST(netSecurity == DMMTSY_PHONE_NET_SECURITY);
|
|
3848 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::GetNetworkSecurityLevel (async & cancel (Request Not Cancelled)) passed"), iTestCount++);
|
|
3849 |
}
|
|
3850 |
|
|
3851 |
// Test NotifyNetworkSecurityLevelChange
|
|
3852 |
|
|
3853 |
// asynchronous
|
|
3854 |
|
|
3855 |
aPhone.NotifyNetworkSecurityLevelChange(aReqStatus, netSecurity);
|
|
3856 |
User::WaitForRequest(aReqStatus);
|
|
3857 |
TEST(aReqStatus.Int() == KErrNone);
|
|
3858 |
TEST(netSecurity == DMMTSY_PHONE_NET_SECURITY);
|
|
3859 |
|
|
3860 |
// asynchronous & cancel
|
|
3861 |
|
|
3862 |
aPhone.NotifyNetworkSecurityLevelChange(aReqStatus, netSecurity);
|
|
3863 |
aPhone.CancelAsyncRequest(EMobilePhoneNotifyNetworkSecurityLevelChange);
|
|
3864 |
User::WaitForRequest(aReqStatus);
|
|
3865 |
TEST(aReqStatus.Int() == KErrNone || aReqStatus.Int() == KErrCancel);
|
|
3866 |
|
|
3867 |
if(aReqStatus.Int() == KErrCancel)
|
|
3868 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::NotifyNetworkSecurityLevelChange (async & cancel (Cancelled Request)) passed"), iTestCount++);
|
|
3869 |
else
|
|
3870 |
{
|
|
3871 |
TEST(netSecurity == DMMTSY_PHONE_NET_SECURITY);
|
|
3872 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::NotifyNetworkSecurityLevelChange (async & cancel (Request Not Cancelled)) passed"), iTestCount++);
|
|
3873 |
}
|
|
3874 |
|
|
3875 |
//Test GetCipheringIndicatorStatus
|
|
3876 |
RMobilePhone::TMobileCallCipheringIndicator indicator;
|
|
3877 |
|
|
3878 |
// asynchronous
|
|
3879 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::GetCipheringIndicatorStatus async."), iTestCount++);
|
|
3880 |
|
|
3881 |
aPhone.GetCipheringIndicatorStatus(aReqStatus, indicator);
|
|
3882 |
User::WaitForRequest(aReqStatus);
|
|
3883 |
TEST(aReqStatus.Int() == KErrNone);
|
|
3884 |
TEST(indicator == DMMTSY_PHONE_NET_CIPHER_IND);
|
|
3885 |
|
|
3886 |
// asynchronous & cancel
|
|
3887 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::GetCipheringIndicatorStatus async & cancel."), iTestCount++);
|
|
3888 |
|
|
3889 |
aPhone.GetCipheringIndicatorStatus(aReqStatus, indicator);
|
|
3890 |
aPhone.CancelAsyncRequest(EMobilePhoneGetCipheringIndicatorStatus);
|
|
3891 |
User::WaitForRequest(aReqStatus);
|
|
3892 |
TEST(aReqStatus.Int() == KErrCancel);
|
|
3893 |
|
|
3894 |
//Test NotifyCipheringIndicatorStatus
|
|
3895 |
indicator = RMobilePhone::ECipheringDisplayOff; //reset
|
|
3896 |
// asynchronous
|
|
3897 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::NotifyCipheringIndicatorStatus async."), iTestCount++);
|
|
3898 |
|
|
3899 |
aPhone.NotifyCipheringIndicatorStatus(aReqStatus, indicator);
|
|
3900 |
User::WaitForRequest(aReqStatus);
|
|
3901 |
TEST(aReqStatus.Int() == KErrNone);
|
|
3902 |
TEST(indicator == DMMTSY_PHONE_NET_CIPHER_IND);
|
|
3903 |
|
|
3904 |
// asynchronous & cancel
|
|
3905 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::NotifyCipheringIndicatorStatus async & cancel."), iTestCount++);
|
|
3906 |
|
|
3907 |
aPhone.NotifyCipheringIndicatorStatus(aReqStatus, indicator);
|
|
3908 |
aPhone.CancelAsyncRequest(EMobilePhoneNotifyCipheringIndicatorStatus);
|
|
3909 |
User::WaitForRequest(aReqStatus);
|
|
3910 |
TEST(aReqStatus.Int() == KErrCancel);
|
|
3911 |
}
|
|
3912 |
|
|
3913 |
void CTestPhone::TestUSimHandling(RMobilePhone& aPhone, TRequestStatus &aReqStatus)
|
|
3914 |
{
|
|
3915 |
|
|
3916 |
//Test EnumerateUSimApplications
|
|
3917 |
RMobilePhone::TAID activeAID;
|
|
3918 |
TInt count;
|
|
3919 |
|
|
3920 |
// asynchronous
|
|
3921 |
|
|
3922 |
aPhone.EnumerateUSimApplications(aReqStatus, count, activeAID);
|
|
3923 |
User::WaitForRequest(aReqStatus);
|
|
3924 |
TEST(aReqStatus.Int() == KErrNone);
|
|
3925 |
TEST(activeAID.Compare(DMMTSY_PHONE_USIM_AID) == 0);
|
|
3926 |
TEST(count == DMMTSY_PHONE_USIM_COUNT);
|
|
3927 |
|
|
3928 |
// asynchronous & cancel
|
|
3929 |
|
|
3930 |
aPhone.EnumerateUSimApplications(aReqStatus, count, activeAID);
|
|
3931 |
aPhone.CancelAsyncRequest(EMobilePhoneEnumerateUSimApplications);
|
|
3932 |
User::WaitForRequest(aReqStatus);
|
|
3933 |
TEST(aReqStatus.Int() == KErrNone || aReqStatus.Int() == KErrCancel);
|
|
3934 |
|
|
3935 |
if(aReqStatus.Int() == KErrCancel)
|
|
3936 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::EnumerateUSimApplications (async & cancel (Cancelled Request)) passed"), iTestCount++);
|
|
3937 |
else
|
|
3938 |
{
|
|
3939 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::EnumerateUSimApplications (async & cancel (Request Not Cancelled)) passed"), iTestCount++);
|
|
3940 |
}
|
|
3941 |
|
|
3942 |
//Test GetUSimApplicationInfo
|
|
3943 |
RMobilePhone::TUSimApplicationInfoV2 usimAppInfo;
|
|
3944 |
RMobilePhone::TUSimApplicationInfoV2Pckg usimAppInfoPckg(usimAppInfo);
|
|
3945 |
|
|
3946 |
// asynchronous
|
|
3947 |
|
|
3948 |
aPhone.GetUSimApplicationInfo(aReqStatus, DMMTSY_PHONE_USIM_APPINDEX, usimAppInfoPckg);
|
|
3949 |
User::WaitForRequest(aReqStatus);
|
|
3950 |
TEST(aReqStatus.Int() == KErrNone);
|
|
3951 |
TEST(usimAppInfo.iAID.Compare(DMMTSY_PHONE_USIM_AID) == 0);
|
|
3952 |
TEST(usimAppInfo.iLabel.Compare(DMMTSY_PHONE_USIM_APPLABEL) == 0);
|
|
3953 |
|
|
3954 |
// asynchronous & cancel
|
|
3955 |
|
|
3956 |
aPhone.GetUSimApplicationInfo(aReqStatus, DMMTSY_PHONE_USIM_APPINDEX, usimAppInfoPckg);
|
|
3957 |
aPhone.CancelAsyncRequest(EMobilePhoneGetUSimApplicationsInfo);
|
|
3958 |
User::WaitForRequest(aReqStatus);
|
|
3959 |
TEST(aReqStatus.Int() == KErrNone || aReqStatus.Int() == KErrCancel);
|
|
3960 |
|
|
3961 |
if(aReqStatus.Int() == KErrCancel)
|
|
3962 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::GetUSimApplicationInfo (async & cancel (Cancelled Request)) passed"), iTestCount++);
|
|
3963 |
else
|
|
3964 |
{
|
|
3965 |
//ValidateUSimAppinfo(usimAppInfo);
|
|
3966 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::GetUSimApplicationInfo (async & cancel (Request Not Cancelled)) passed"), iTestCount++);
|
|
3967 |
}
|
|
3968 |
|
|
3969 |
//Test NotifyUSimApplicationsInfoChange
|
|
3970 |
|
|
3971 |
// asynchronous
|
|
3972 |
|
|
3973 |
aPhone.NotifyUSimApplicationsInfoChange(aReqStatus, count, activeAID);
|
|
3974 |
User::WaitForRequest(aReqStatus);
|
|
3975 |
TEST(aReqStatus.Int() == KErrNone);
|
|
3976 |
TEST(activeAID.Compare(DMMTSY_PHONE_USIM_AID) == 0);
|
|
3977 |
TEST(count == DMMTSY_PHONE_USIM_COUNT);
|
|
3978 |
|
|
3979 |
// asynchronous & cancel
|
|
3980 |
|
|
3981 |
aPhone.NotifyUSimApplicationsInfoChange(aReqStatus, count, activeAID);
|
|
3982 |
aPhone.CancelAsyncRequest(EMobilePhoneNotifyUSimApplicationsInfoChange);
|
|
3983 |
User::WaitForRequest(aReqStatus);
|
|
3984 |
TEST(aReqStatus.Int() == KErrNone || aReqStatus.Int() == KErrCancel);
|
|
3985 |
|
|
3986 |
if(aReqStatus.Int() == KErrCancel)
|
|
3987 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::NotifyUSimApplicationsInfoChange (async & cancel (Cancelled Request)) passed"), iTestCount++);
|
|
3988 |
else
|
|
3989 |
{
|
|
3990 |
TEST(activeAID.Compare(DMMTSY_PHONE_USIM_AID) == 0);
|
|
3991 |
TEST(count == DMMTSY_PHONE_USIM_COUNT);
|
|
3992 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::NotifyUSimApplicationsInfoChange (async & cancel (Request Not Cancelled)) passed"), iTestCount++);
|
|
3993 |
}
|
|
3994 |
|
|
3995 |
//Test SetUSimApplicationStatus
|
|
3996 |
|
|
3997 |
// asynchronous
|
|
3998 |
|
|
3999 |
aPhone.SetUSimApplicationStatus(aReqStatus, DMMTSY_PHONE_USIM_AID, DMMTSY_PHONE_USIM_ACTIVATE);
|
|
4000 |
User::WaitForRequest(aReqStatus);
|
|
4001 |
TEST(aReqStatus.Int() == KErrNone);
|
|
4002 |
|
|
4003 |
// asynchronous & cancel
|
|
4004 |
|
|
4005 |
aPhone.SetUSimApplicationStatus(aReqStatus, DMMTSY_PHONE_USIM_AID, DMMTSY_PHONE_USIM_ACTIVATE);
|
|
4006 |
aPhone.CancelAsyncRequest(EMobilePhoneSetUSimApplicationStatus);
|
|
4007 |
User::WaitForRequest(aReqStatus);
|
|
4008 |
TEST(aReqStatus.Int() == KErrNone || aReqStatus.Int() == KErrCancel);
|
|
4009 |
|
|
4010 |
if(aReqStatus.Int() == KErrCancel)
|
|
4011 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::SetUSimApplicationStatus (async & cancel (Cancelled Request)) passed"), iTestCount++);
|
|
4012 |
else
|
|
4013 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::SetUSimApplicationStatus (async & cancel (Request Not Cancelled)) passed"), iTestCount++);
|
|
4014 |
|
|
4015 |
//Test GetUSimAppsSelectionMode
|
|
4016 |
RMobilePhone::TUSimSelectionMode selectionMode;
|
|
4017 |
|
|
4018 |
//synchronous
|
|
4019 |
aPhone.GetUSimAppsSelectionMode(selectionMode);
|
|
4020 |
TEST(selectionMode == DMMTSY_PHONE_USIM_SELMODE);
|
|
4021 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::GetUSimAppsSelectionMode (sync) passed"), iTestCount++);
|
|
4022 |
|
|
4023 |
//Test SetUSimAppsSelectionMode
|
|
4024 |
|
|
4025 |
//synchronous
|
|
4026 |
|
|
4027 |
aPhone.SetUSimAppsSelectionMode(DMMTSY_PHONE_USIM_SELMODE);
|
|
4028 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::SetUSimAppsSelectionMode (sync) passed"), iTestCount++);
|
|
4029 |
|
|
4030 |
//Test NotifyUSimAppsSelectionModeChange
|
|
4031 |
|
|
4032 |
// asynchronous
|
|
4033 |
|
|
4034 |
aPhone.NotifyUSimAppsSelectionModeChange(aReqStatus, selectionMode);
|
|
4035 |
User::WaitForRequest(aReqStatus);
|
|
4036 |
TEST(aReqStatus.Int() == KErrNone);
|
|
4037 |
TEST(selectionMode == DMMTSY_PHONE_USIM_SELMODE);
|
|
4038 |
|
|
4039 |
// asynchronous & cancel
|
|
4040 |
|
|
4041 |
aPhone.NotifyUSimAppsSelectionModeChange(aReqStatus, selectionMode);
|
|
4042 |
aPhone.CancelAsyncRequest(EMobilePhoneNotifyUSimAppsSelectionModeChange);
|
|
4043 |
User::WaitForRequest(aReqStatus);
|
|
4044 |
TEST(aReqStatus.Int() == KErrNone || aReqStatus.Int() == KErrCancel);
|
|
4045 |
|
|
4046 |
if(aReqStatus.Int() == KErrCancel)
|
|
4047 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::NotifyUSimAppsSelectionModeChange (async & cancel (Cancelled Request)) passed"), iTestCount++);
|
|
4048 |
else
|
|
4049 |
{
|
|
4050 |
TEST(selectionMode == DMMTSY_PHONE_USIM_SELMODE);
|
|
4051 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::NotifyUSimAppsSelectionModeChange (async & cancel (Request Not Cancelled)) passed"), iTestCount++);
|
|
4052 |
}
|
|
4053 |
|
|
4054 |
//Test GetCurrentActiveUSimApplication
|
|
4055 |
RMobilePhone::TAID aid;
|
|
4056 |
// asynchronous
|
|
4057 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::GetCurrentActiveUSimApplication"), iTestCount++);
|
|
4058 |
aPhone.GetCurrentActiveUSimApplication(aReqStatus, aid);
|
|
4059 |
User::WaitForRequest(aReqStatus);
|
|
4060 |
TEST(aReqStatus.Int() == KErrNone);
|
|
4061 |
TEST(aid == DMMTSY_PHONE_SC_AID);
|
|
4062 |
|
|
4063 |
// asynchronous & cancel
|
|
4064 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::GetCurrentActiveUSimApplication Cancel"), iTestCount++);
|
|
4065 |
aPhone.GetCurrentActiveUSimApplication(aReqStatus, aid);
|
|
4066 |
aPhone.CancelAsyncRequest(EMobilePhoneGetCurrentActiveUSimApplication);
|
|
4067 |
User::WaitForRequest(aReqStatus);
|
|
4068 |
TEST(aReqStatus.Int() == KErrCancel);
|
|
4069 |
|
|
4070 |
|
|
4071 |
}
|
|
4072 |
|
|
4073 |
void CTestPhone::TestSmartCardHandling(RMobilePhone& aPhone, TRequestStatus &aReqStatus)
|
|
4074 |
{
|
|
4075 |
//Test EnumerateSmartCardApplications
|
|
4076 |
TUint count;
|
|
4077 |
|
|
4078 |
// asynchronous
|
|
4079 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::EnumerateSmartCardApplications"), iTestCount++);
|
|
4080 |
aPhone.EnumerateSmartCardApplications(aReqStatus, count);
|
|
4081 |
User::WaitForRequest(aReqStatus);
|
|
4082 |
TEST(aReqStatus.Int() == KErrNone);
|
|
4083 |
TEST(count == DMMTSY_PHONE_SC_COUNT);
|
|
4084 |
|
|
4085 |
// asynchronous & cancel
|
|
4086 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::EnumerateSmartCardApplications Cancel"), iTestCount++);
|
|
4087 |
aPhone.EnumerateSmartCardApplications(aReqStatus, count);
|
|
4088 |
aPhone.CancelAsyncRequest(EMobilePhoneEnumerateSmartCardApplications);
|
|
4089 |
User::WaitForRequest(aReqStatus);
|
|
4090 |
TEST(aReqStatus.Int() == KErrCancel);
|
|
4091 |
|
|
4092 |
//Test GetSmartCardApplicationInfo
|
|
4093 |
RMobilePhone::TSmartCardApplicationInfoV5 scAppInfo;
|
|
4094 |
RMobilePhone::TSmartCardApplicationInfoV5Pckg scAppInfoPckg(scAppInfo);
|
|
4095 |
|
|
4096 |
//asynchronous
|
|
4097 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::GetSmartCardApplicationInfo"), iTestCount++);
|
|
4098 |
aPhone.GetSmartCardApplicationInfo(aReqStatus, DMMTSY_PHONE_SC_APP_INDEX1, scAppInfoPckg);
|
|
4099 |
User::WaitForRequest(aReqStatus);
|
|
4100 |
TEST(aReqStatus.Int() == KErrNone);
|
|
4101 |
TEST(scAppInfo.iAID == DMMTSY_PHONE_SC_AID);
|
|
4102 |
TEST(scAppInfo.iLabel == DMMTSY_PHONE_SC_LABEL);
|
|
4103 |
|
|
4104 |
aPhone.GetSmartCardApplicationInfo(aReqStatus, DMMTSY_PHONE_SC_APP_INDEX2, scAppInfoPckg);
|
|
4105 |
User::WaitForRequest(aReqStatus);
|
|
4106 |
TEST(aReqStatus.Int() == DMMTSY_PHONE_SC_OUTOFRANGE);
|
|
4107 |
|
|
4108 |
// asynchronous & cancel
|
|
4109 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::GetSmartCardApplicationInfo Cancel"), iTestCount++);
|
|
4110 |
aPhone.GetSmartCardApplicationInfo(aReqStatus, DMMTSY_PHONE_SC_APP_INDEX1, scAppInfoPckg);
|
|
4111 |
aPhone.CancelAsyncRequest(EMobilePhoneGetSmartCardApplicationInfo);
|
|
4112 |
User::WaitForRequest(aReqStatus);
|
|
4113 |
TEST(aReqStatus.Int() == KErrCancel);
|
|
4114 |
|
|
4115 |
//Test NotifySmartCardApplicationInfoChange
|
|
4116 |
RMobilePhone::TSmartCardApplicationEvent event;
|
|
4117 |
RMobilePhone::TAID aid;
|
|
4118 |
|
|
4119 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::NotifySmartCardApplicationInfoChange"), iTestCount++);
|
|
4120 |
aPhone.NotifySmartCardApplicationInfoChange(aReqStatus, aid, event);
|
|
4121 |
User::WaitForRequest(aReqStatus);
|
|
4122 |
TEST(aReqStatus.Int() == KErrNone);
|
|
4123 |
TEST(event == DMMTSY_PHONE_SC_EVENT_ACTIVATE);
|
|
4124 |
TEST(aid == DMMTSY_PHONE_SC_AID);
|
|
4125 |
|
|
4126 |
// asynchronous & cancel
|
|
4127 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::NotifySmartCardApplicationInfoChange Cancel"), iTestCount++);
|
|
4128 |
aPhone.NotifySmartCardApplicationInfoChange(aReqStatus, aid, event);
|
|
4129 |
aPhone.CancelAsyncRequest(EMobilePhoneNotifySmartCardApplicationInfoChange);
|
|
4130 |
User::WaitForRequest(aReqStatus);
|
|
4131 |
TEST(aReqStatus.Int() == KErrCancel);
|
|
4132 |
|
|
4133 |
//Test SetSmartCardApplicationStatus
|
|
4134 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::SetSmartCardApplicationStatus"), iTestCount++);
|
|
4135 |
aid = DMMTSY_PHONE_SC_AID2;
|
|
4136 |
RMobilePhone::TSmartCardApplicationAction action = DMMTSY_PHONE_SC_ACTION_TERMINATE;
|
|
4137 |
aPhone.SetSmartCardApplicationStatus(aReqStatus, aid, action);
|
|
4138 |
User::WaitForRequest(aReqStatus);
|
|
4139 |
TEST(aReqStatus.Int() == KErrNone);
|
|
4140 |
|
|
4141 |
// asynchronous & cancel
|
|
4142 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::SetSmartCardApplicationStatus Cancel"), iTestCount++);
|
|
4143 |
aPhone.SetSmartCardApplicationStatus(aReqStatus, aid, action);
|
|
4144 |
aPhone.CancelAsyncRequest(EMobilePhoneSetSmartCardApplicationStatus);
|
|
4145 |
User::WaitForRequest(aReqStatus);
|
|
4146 |
TEST(aReqStatus.Int() == KErrCancel);
|
|
4147 |
|
|
4148 |
//Test GetScFileInfo
|
|
4149 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::GetScFileInfo"), iTestCount++);
|
|
4150 |
RMobilePhone::TScFilePath filePath;
|
|
4151 |
RMobilePhone::TScFileInfoV5 scFileInfo;
|
|
4152 |
RMobilePhone::TScFileInfoV5Pckg scFileInfoPckg(scFileInfo);
|
|
4153 |
|
|
4154 |
filePath.iAID = DMMTSY_PHONE_SC_AID;
|
|
4155 |
filePath.iPath = DMMTSY_PHONE_SC_PATH_REF;
|
|
4156 |
aPhone.GetScFileInfo(aReqStatus, filePath, scFileInfoPckg);
|
|
4157 |
User::WaitForRequest(aReqStatus);
|
|
4158 |
TEST(aReqStatus.Int() == KErrNone);
|
|
4159 |
TEST(scFileInfo.iFileID == DMMTSY_PHONE_SC_FILEID);
|
|
4160 |
TEST(scFileInfo.iNumberRecords == DMMTSY_PHONE_SC_NORECORDS);
|
|
4161 |
TEST(scFileInfo.iRecordLength == DMMTSY_PHONE_SC_RECORD_SIZE);
|
|
4162 |
TEST(scFileInfo.iType == DMMTSY_PHONE_SC_TYPE);
|
|
4163 |
TEST(scFileInfo.iTotalLength == DMMTSY_PHONE_SC_FILESIZE);
|
|
4164 |
|
|
4165 |
// asynchronous & cancel
|
|
4166 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::GetScFileInfo Cancel"), iTestCount++);
|
|
4167 |
aPhone.GetScFileInfo(aReqStatus, filePath, scFileInfoPckg);
|
|
4168 |
aPhone.CancelAsyncRequest(EMobilePhoneGetScFileInfo);
|
|
4169 |
User::WaitForRequest(aReqStatus);
|
|
4170 |
TEST(aReqStatus.Int() == KErrCancel);
|
|
4171 |
|
|
4172 |
//Test ReadScFile
|
|
4173 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::ReadScFile"), iTestCount++);
|
|
4174 |
RMobilePhone::TScFilePathWithAccessOffsets offsets;
|
|
4175 |
TBuf8<DMMTSY_PHONE_SC_FILESIZE> buffer;
|
|
4176 |
|
|
4177 |
offsets.iAID = DMMTSY_PHONE_SC_AID;
|
|
4178 |
offsets.iPath = DMMTSY_PHONE_SC_PATH_REF;
|
|
4179 |
offsets.iType = DMMTSY_PHONE_SC_TYPE;
|
|
4180 |
offsets.iCount = DMMTSY_PHONE_SC_NORECORDS;
|
|
4181 |
offsets.iStartOffset = DMMTSY_PHONE_SC_START_OFFSET;
|
|
4182 |
aPhone.ReadScFile(aReqStatus, offsets, buffer);
|
|
4183 |
User::WaitForRequest(aReqStatus);
|
|
4184 |
TEST(aReqStatus.Int() == KErrNone);
|
|
4185 |
|
|
4186 |
//extract record info and test its OK.
|
|
4187 |
if(aReqStatus.Int() == KErrNone)
|
|
4188 |
{
|
|
4189 |
TInt startoffset = 0;
|
|
4190 |
TPtr8 record0(buffer.MidTPtr(startoffset,DMMTSY_PHONE_SC_RECORD_SIZE));
|
|
4191 |
startoffset += DMMTSY_PHONE_SC_RECORD_SIZE;
|
|
4192 |
TPtr8 record1(buffer.MidTPtr(startoffset,DMMTSY_PHONE_SC_RECORD_SIZE));
|
|
4193 |
startoffset += DMMTSY_PHONE_SC_RECORD_SIZE;
|
|
4194 |
TPtr8 record2(buffer.MidTPtr(startoffset,DMMTSY_PHONE_SC_RECORD_SIZE));
|
|
4195 |
|
|
4196 |
TEST(record0 == DMMTSY_PHONE_SC_RECORD0);
|
|
4197 |
TEST(record1 == DMMTSY_PHONE_SC_RECORD1);
|
|
4198 |
TEST(record2 == DMMTSY_PHONE_SC_RECORD2);
|
|
4199 |
}
|
|
4200 |
|
|
4201 |
buffer = DMMTSY_PHONE_SC_RECORD0;
|
|
4202 |
buffer.Append(DMMTSY_PHONE_SC_RECORD1);
|
|
4203 |
buffer.Append(DMMTSY_PHONE_SC_RECORD2);
|
|
4204 |
|
|
4205 |
|
|
4206 |
// asynchronous & cancel
|
|
4207 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::ReadScFile Cancel"), iTestCount++);
|
|
4208 |
aPhone.ReadScFile(aReqStatus, offsets, buffer);
|
|
4209 |
aPhone.CancelAsyncRequest(EMobilePhoneReadScFile);
|
|
4210 |
User::WaitForRequest(aReqStatus);
|
|
4211 |
TEST(aReqStatus.Int() == KErrCancel);
|
|
4212 |
|
|
4213 |
//Test UpdateScFile
|
|
4214 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::UpdateScFile"), iTestCount++);
|
|
4215 |
aPhone.UpdateScFile(aReqStatus, offsets, buffer);
|
|
4216 |
User::WaitForRequest(aReqStatus);
|
|
4217 |
TEST(aReqStatus.Int() == KErrNone);
|
|
4218 |
|
|
4219 |
// asynchronous & cancel
|
|
4220 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::UpdateScFile Cancel"), iTestCount++);
|
|
4221 |
aPhone.UpdateScFile(aReqStatus, offsets, buffer);
|
|
4222 |
aPhone.CancelAsyncRequest(EMobilePhoneUpdateScFile);
|
|
4223 |
User::WaitForRequest(aReqStatus);
|
|
4224 |
TEST(aReqStatus.Int() == KErrCancel);
|
|
4225 |
|
|
4226 |
}
|
|
4227 |
|
|
4228 |
void CTestPhone::TestMobileMailboxNumbersFunctionality(RMobilePhone& aPhone, TRequestStatus &aReqStatus)
|
|
4229 |
{
|
|
4230 |
//Test GetMailboxNumbers
|
|
4231 |
|
|
4232 |
RMobilePhone::TMobilePhoneVoicemailIdsV3 voicemailIdsV3;
|
|
4233 |
RMobilePhone::TMobilePhoneVoicemailIdsV3Pckg voicemailIdsV3Pckg(voicemailIdsV3);
|
|
4234 |
|
|
4235 |
//asynchronous
|
|
4236 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::GetMailboxNumbers async."), iTestCount++);
|
|
4237 |
|
|
4238 |
aPhone.GetMailboxNumbers(aReqStatus,voicemailIdsV3Pckg);
|
|
4239 |
User::WaitForRequest(aReqStatus);
|
|
4240 |
TEST(aReqStatus.Int() == KErrNone);
|
|
4241 |
TEST(voicemailIdsV3.iVoice == DMMTSY_PHONE_MAILBOXNUMBER_VOICE);
|
|
4242 |
TEST(voicemailIdsV3.iData == DMMTSY_PHONE_MAILBOXNUMBER_DATA);
|
|
4243 |
TEST(voicemailIdsV3.iFax == DMMTSY_PHONE_MAILBOXNUMBER_FAX);
|
|
4244 |
TEST(voicemailIdsV3.iOther == DMMTSY_PHONE_MAILBOXNUMBER_OTHER);
|
|
4245 |
|
|
4246 |
//asynchronous & cancel
|
|
4247 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::GetMailboxNumbers async & cancel."), iTestCount++);
|
|
4248 |
|
|
4249 |
aPhone.GetMailboxNumbers(aReqStatus,voicemailIdsV3Pckg);
|
|
4250 |
aPhone.CancelAsyncRequest(EMobilePhoneGetMailboxNumbers);
|
|
4251 |
User::WaitForRequest(aReqStatus);
|
|
4252 |
TEST(aReqStatus.Int() == KErrCancel);
|
|
4253 |
|
|
4254 |
//Test NotifyMailBoxNumbersChange
|
|
4255 |
|
|
4256 |
//asynchronous
|
|
4257 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::NotifyMailboxNumbersChange async."), iTestCount++);
|
|
4258 |
|
|
4259 |
aPhone.NotifyMailboxNumbersChange(aReqStatus,voicemailIdsV3Pckg);
|
|
4260 |
User::WaitForRequest(aReqStatus);
|
|
4261 |
TEST(aReqStatus.Int() == KErrNone);
|
|
4262 |
TEST(voicemailIdsV3.iVoice == DMMTSY_PHONE_MAILBOXNUMBER_VOICE);
|
|
4263 |
TEST(voicemailIdsV3.iData == DMMTSY_PHONE_MAILBOXNUMBER_DATA);
|
|
4264 |
TEST(voicemailIdsV3.iFax == DMMTSY_PHONE_MAILBOXNUMBER_FAX);
|
|
4265 |
TEST(voicemailIdsV3.iOther == DMMTSY_PHONE_MAILBOXNUMBER_OTHER);
|
|
4266 |
|
|
4267 |
//asynchronous & cancel
|
|
4268 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::NotifyMailboxNumbersChange async & cancel."), iTestCount++);
|
|
4269 |
|
|
4270 |
aPhone.NotifyMailboxNumbersChange(aReqStatus,voicemailIdsV3Pckg);
|
|
4271 |
aPhone.CancelAsyncRequest(EMobilePhoneNotifyMailboxNumbersChange);
|
|
4272 |
User::WaitForRequest(aReqStatus);
|
|
4273 |
TEST(aReqStatus.Int() == KErrCancel);
|
|
4274 |
|
|
4275 |
//Test with TMobilePhoneVoicemailIdsV8 class
|
|
4276 |
RMobilePhone::TMobilePhoneVoicemailIdsV8 voicemailIdsV8;
|
|
4277 |
RMobilePhone::TMobilePhoneVoicemailIdsV8Pckg voicemailIdsV8Pckg(voicemailIdsV8);
|
|
4278 |
|
|
4279 |
//asynchronous
|
|
4280 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::GetMailboxNumbers async."), iTestCount++);
|
|
4281 |
|
|
4282 |
aPhone.GetMailboxNumbers(aReqStatus,voicemailIdsV8Pckg);
|
|
4283 |
User::WaitForRequest(aReqStatus);
|
|
4284 |
TEST(aReqStatus.Int() == KErrNone);
|
|
4285 |
|
|
4286 |
TEST(voicemailIdsV8.iVideo == DMMTSY_PHONE_MAILBOXNUMBER_VIDEO);
|
|
4287 |
|
|
4288 |
//asynchronous & cancel
|
|
4289 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::GetMailboxNumbers async & cancel."), iTestCount++);
|
|
4290 |
|
|
4291 |
aPhone.GetMailboxNumbers(aReqStatus,voicemailIdsV8Pckg);
|
|
4292 |
aPhone.CancelAsyncRequest(EMobilePhoneGetMailboxNumbers);
|
|
4293 |
User::WaitForRequest(aReqStatus);
|
|
4294 |
TEST(aReqStatus.Int() == KErrCancel);
|
|
4295 |
|
|
4296 |
//Test NotifyMailBoxNumbersChange
|
|
4297 |
|
|
4298 |
//asynchronous
|
|
4299 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::NotifyMailboxNumbersChange async."), iTestCount++);
|
|
4300 |
|
|
4301 |
aPhone.NotifyMailboxNumbersChange(aReqStatus,voicemailIdsV8Pckg);
|
|
4302 |
User::WaitForRequest(aReqStatus);
|
|
4303 |
TEST(aReqStatus.Int() == KErrNone);
|
|
4304 |
|
|
4305 |
TEST(voicemailIdsV8.iVideo == DMMTSY_PHONE_MAILBOXNUMBER_VIDEO);
|
|
4306 |
|
|
4307 |
//asynchronous & cancel
|
|
4308 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::NotifyMailboxNumbersChange async & cancel."), iTestCount++);
|
|
4309 |
|
|
4310 |
aPhone.NotifyMailboxNumbersChange(aReqStatus,voicemailIdsV8Pckg);
|
|
4311 |
aPhone.CancelAsyncRequest(EMobilePhoneNotifyMailboxNumbersChange);
|
|
4312 |
User::WaitForRequest(aReqStatus);
|
|
4313 |
TEST(aReqStatus.Int() == KErrCancel);
|
|
4314 |
}
|
|
4315 |
|
|
4316 |
void CTestPhone::TestMobileMmsFunctionality(RMobilePhone& aPhone, TRequestStatus &aReqStatus)
|
|
4317 |
{
|
|
4318 |
//Testing RMobilePhone::NotifyMmsUpdate
|
|
4319 |
RMobilePhone::TMmsNotificationV3 mmsNotificationV3;
|
|
4320 |
RMobilePhone::TMmsNotificationV3Pckg mmsNotificationV3Pckg (mmsNotificationV3);
|
|
4321 |
|
|
4322 |
//asynchronous
|
|
4323 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::NotifyMmsUpdate async"), iTestCount++);
|
|
4324 |
aPhone.NotifyMmsUpdate(aReqStatus, mmsNotificationV3Pckg);
|
|
4325 |
User::WaitForRequest(aReqStatus);
|
|
4326 |
TEST(aReqStatus.Int() == KErrNone);
|
|
4327 |
TEST(mmsNotificationV3.iSpace == DMMTSY_PHONE_MMS_UPDATE_SPACE);
|
|
4328 |
TEST(mmsNotificationV3.iNotification == DMMTSY_PHONE_MMS_UPDATE_NOTIFICATION);
|
|
4329 |
TEST(mmsNotificationV3.iMmsStatus == DMMTSY_PHONE_MMS_UPDATE_STATUS);
|
|
4330 |
TEST(mmsNotificationV3.iImplementation == DMMTSY_PHONE_MMS_UPDATE_IMPLEMENTATION);
|
|
4331 |
TEST(mmsNotificationV3.iNotify.Compare(DMMTSY_PHONE_MMS_UPDATE_NOTIFY) == 0);
|
|
4332 |
|
|
4333 |
//asynchronous & cancel
|
|
4334 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::NotifyMmsUpdate async & cancel"), iTestCount++);
|
|
4335 |
aPhone.NotifyMmsUpdate(aReqStatus, mmsNotificationV3Pckg);
|
|
4336 |
aPhone.CancelAsyncRequest(EMobilePhoneNotifyMmsUpdate);
|
|
4337 |
User::WaitForRequest(aReqStatus);
|
|
4338 |
TEST(aReqStatus.Int() == KErrNone || aReqStatus.Int() == KErrCancel);
|
|
4339 |
|
|
4340 |
|
|
4341 |
//Testing RMobilePhone::SetMmsUserConnParams
|
|
4342 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::SetMmsUserConnParams async"), iTestCount++);
|
|
4343 |
TBuf8<30> connectivity(DMMTSY_PHONE_MMS_USER_CONN_PARAMS);
|
|
4344 |
aPhone.SetMmsUserConnParams(aReqStatus, connectivity);
|
|
4345 |
User::WaitForRequest(aReqStatus);
|
|
4346 |
TEST(aReqStatus.Int() == KErrNone);
|
|
4347 |
|
|
4348 |
//asynchronous & cancel
|
|
4349 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::SetMmsUserConnParams async & cancel"), iTestCount++);
|
|
4350 |
aPhone.SetMmsUserConnParams(aReqStatus, connectivity);
|
|
4351 |
aPhone.CancelAsyncRequest(EMobilePhoneSetMmsUserConnParams);
|
|
4352 |
User::WaitForRequest(aReqStatus);
|
|
4353 |
TEST(aReqStatus.Int() == KErrCancel);
|
|
4354 |
|
|
4355 |
//Testing RMobilePhone::SetMmsUserPreferences
|
|
4356 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::SetMmsUserPreferences async"), iTestCount++);
|
|
4357 |
TBuf8<30> preferences(DMMTSY_PHONE_MMS_USER_PREF_PARAMS);
|
|
4358 |
aPhone.SetMmsUserPreferences(aReqStatus, preferences);
|
|
4359 |
User::WaitForRequest(aReqStatus);
|
|
4360 |
TEST(aReqStatus.Int() == KErrNone);
|
|
4361 |
|
|
4362 |
//asynchronous & cancel
|
|
4363 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::SetMmsUserPreferences async & cancel"), iTestCount++);
|
|
4364 |
aPhone.SetMmsUserPreferences(aReqStatus, preferences);
|
|
4365 |
aPhone.CancelAsyncRequest(EMobilePhoneSetMmsUserPreferences);
|
|
4366 |
User::WaitForRequest(aReqStatus);
|
|
4367 |
TEST(aReqStatus.Int() == KErrCancel);
|
|
4368 |
|
|
4369 |
//Testing RMobilePhone::GetMmsConfig
|
|
4370 |
|
|
4371 |
//asynchronous
|
|
4372 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::GetMmsConfig async"), iTestCount++);
|
|
4373 |
RMobilePhone::TMmsConnParams connectionType = DMMTSY_PHONE_MMS_USER_CONN_PARAMS_TYPE;
|
|
4374 |
aPhone.GetMmsConfig(aReqStatus, connectionType, connectivity);
|
|
4375 |
User::WaitForRequest(aReqStatus);
|
|
4376 |
TEST(aReqStatus.Int() == KErrNone);
|
|
4377 |
TEST(connectivity.Compare(DMMTSY_PHONE_MMS_USER_CONN_PARAMS) == 0);
|
|
4378 |
|
|
4379 |
//asynchronous & cancel
|
|
4380 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::SetMmsUserPreferences async & cancel"), iTestCount++);
|
|
4381 |
aPhone.GetMmsConfig(aReqStatus, connectionType, connectivity);
|
|
4382 |
aPhone.CancelAsyncRequest(EMobilePhoneGetMmsConfig);
|
|
4383 |
User::WaitForRequest(aReqStatus);
|
|
4384 |
TEST(aReqStatus.Int() == KErrCancel);
|
|
4385 |
|
|
4386 |
//Testing RMobilePhone::NotifyMmsConfig
|
|
4387 |
|
|
4388 |
//asynchronous
|
|
4389 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::NotifyMmsConfig async"), iTestCount++);
|
|
4390 |
aPhone.NotifyMmsConfig(aReqStatus, connectionType, connectivity);
|
|
4391 |
User::WaitForRequest(aReqStatus);
|
|
4392 |
TEST(aReqStatus.Int() == KErrNone);
|
|
4393 |
TEST(connectivity.Compare(DMMTSY_PHONE_MMS_USER_CONN_PARAMS) == 0);
|
|
4394 |
|
|
4395 |
//asynchronous & cancel
|
|
4396 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::NotifyMmsConfig async & cancel"), iTestCount++);
|
|
4397 |
aPhone.NotifyMmsConfig(aReqStatus, connectionType, connectivity);
|
|
4398 |
aPhone.CancelAsyncRequest(EMobilePhoneNotifyMmsConfig);
|
|
4399 |
User::WaitForRequest(aReqStatus);
|
|
4400 |
TEST(aReqStatus.Int() == KErrCancel);
|
|
4401 |
}
|
|
4402 |
|
|
4403 |
void CTestPhone::TestMobileAirTime(RMobilePhone& aPhone, TRequestStatus &aReqStatus)
|
|
4404 |
{
|
|
4405 |
TTimeIntervalSeconds aTime;
|
|
4406 |
|
|
4407 |
//Test synchronous GetAirTimeDuration
|
|
4408 |
|
|
4409 |
TEST(KErrNone==aPhone.GetAirTimeDuration(aTime));
|
|
4410 |
TEST(aTime.Int()==DMMTSY_AIR_TIME_DURATION1);
|
|
4411 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::GetAirTimeDuration passed"), iTestCount++);
|
|
4412 |
|
|
4413 |
//Test asynchronous NotifyAirTimeDurationChange
|
|
4414 |
|
|
4415 |
aPhone.NotifyAirTimeDurationChange(aReqStatus,aTime);
|
|
4416 |
User::WaitForRequest(aReqStatus);
|
|
4417 |
TEST(aReqStatus.Int()==KErrNone);
|
|
4418 |
TEST(aTime.Int()==DMMTSY_AIR_TIME_DURATION2);
|
|
4419 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::NotifyAirTimeDurationChange passed"), iTestCount++);
|
|
4420 |
|
|
4421 |
//Test asynchronous & cancel
|
|
4422 |
|
|
4423 |
aPhone.NotifyAirTimeDurationChange(aReqStatus,aTime);
|
|
4424 |
aPhone.CancelAsyncRequest(EMobilePhoneNotifyAirTimeDurationChange);
|
|
4425 |
User::WaitForRequest(aReqStatus);
|
|
4426 |
TEST(aReqStatus.Int() == KErrNone || aReqStatus.Int() == KErrCancel);
|
|
4427 |
|
|
4428 |
if(aReqStatus.Int() == KErrCancel)
|
|
4429 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::NotifyAirTimeDurationChange (async & cancel (Cancelled Request)) passed"), iTestCount++);
|
|
4430 |
else
|
|
4431 |
{
|
|
4432 |
TEST(aTime.Int()==DMMTSY_AIR_TIME_DURATION2);
|
|
4433 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::NotifyAirTimeDurationChange (async & cancel (Request Not Cancelled)) passed"), iTestCount++);
|
|
4434 |
}
|
|
4435 |
|
|
4436 |
}
|
|
4437 |
|
|
4438 |
void CTestPhone::TestMobileAutoRedial(RMobilePhone& aPhone, TRequestStatus &aReqStatus)
|
|
4439 |
{
|
|
4440 |
//Test Blacklist clearing
|
|
4441 |
|
|
4442 |
//asynchronous
|
|
4443 |
|
|
4444 |
aPhone.ClearBlacklist(aReqStatus);
|
|
4445 |
User::WaitForRequest(aReqStatus);
|
|
4446 |
if(aReqStatus.Int()==KErrNone)
|
|
4447 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::ClearBlacklist passed"), iTestCount++);
|
|
4448 |
else
|
|
4449 |
TEST(aReqStatus.Int()==KErrNone);
|
|
4450 |
|
|
4451 |
//asynchronous & cancel
|
|
4452 |
|
|
4453 |
aPhone.ClearBlacklist(aReqStatus);
|
|
4454 |
aPhone.CancelAsyncRequest(EMobilePhoneClearBlacklist);
|
|
4455 |
User::WaitForRequest(aReqStatus);
|
|
4456 |
if(aReqStatus.Int() == KErrCancel)
|
|
4457 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::ClearBlacklist (async & cancel (Cancelled Request)) passed"), iTestCount++);
|
|
4458 |
else
|
|
4459 |
TEST(aReqStatus.Int()==KErrNone);
|
|
4460 |
}
|
|
4461 |
|
|
4462 |
void CTestPhone::TestMobilePersonalisation(RMobilePhone& aPhone, TRequestStatus &aReqStatus)
|
|
4463 |
{
|
|
4464 |
//Tests APIs from the MobilePersonalisation functional unit
|
|
4465 |
|
|
4466 |
|
|
4467 |
//Test GetPersonalisationCaps
|
|
4468 |
|
|
4469 |
//synchronous
|
|
4470 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::GetPersonalisationCaps async"), iTestCount++);
|
|
4471 |
TUint32 aScheme;
|
|
4472 |
TInt ret = aPhone.GetPersonalisationCaps(aScheme);
|
|
4473 |
TEST(ret==KErrNone);
|
|
4474 |
TEST(aScheme == (DMMTSY_PHONE_PERS_CAPS_SERV_PROV | DMMTSY_PHONE_PERS_CAPS_NETWORK));
|
|
4475 |
|
|
4476 |
//Test GetPersonalisationStatus
|
|
4477 |
|
|
4478 |
//asynchronous
|
|
4479 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::GetPersonalisationStatus async"), iTestCount++);
|
|
4480 |
aPhone.GetPersonalisationStatus(aReqStatus, aScheme);
|
|
4481 |
User::WaitForRequest(aReqStatus);
|
|
4482 |
TEST(aReqStatus == KErrNone);
|
|
4483 |
TEST(aScheme == (DMMTSY_PHONE_PERS_GET_NETWORK_SUB | DMMTSY_PHONE_PERS_GET_CORPORATE));
|
|
4484 |
|
|
4485 |
//asynchronous & cancel
|
|
4486 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::GetPersonalisationStatus async & cancel"), iTestCount++);
|
|
4487 |
aPhone.GetPersonalisationStatus(aReqStatus, aScheme);
|
|
4488 |
aPhone.CancelAsyncRequest(EMobilePhoneGetPersonalisationStatus);
|
|
4489 |
User::WaitForRequest(aReqStatus);
|
|
4490 |
TEST(aReqStatus.Int()==KErrCancel);
|
|
4491 |
|
|
4492 |
//Test SetPersonalisationStatus
|
|
4493 |
|
|
4494 |
//asynchronous
|
|
4495 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::SetPersonalisationStatus async"), iTestCount++);
|
|
4496 |
|
|
4497 |
TBuf<10> persCode = DMMTSY_PHONE_PERS_SET_CODE;
|
|
4498 |
aPhone.SetPersonalisationStatus(aReqStatus, DMMTSY_PHONE_PERS_SET_USIM, persCode);
|
|
4499 |
User::WaitForRequest(aReqStatus);
|
|
4500 |
TEST(aReqStatus == KErrNone);
|
|
4501 |
|
|
4502 |
//asynchronous & cancel
|
|
4503 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::SetPersonalisationStatus async & cancel"), iTestCount++);
|
|
4504 |
aPhone.SetPersonalisationStatus(aReqStatus, DMMTSY_PHONE_PERS_SET_USIM, persCode);
|
|
4505 |
aPhone.CancelAsyncRequest(EMobilePhoneSetPersonalisationStatus);
|
|
4506 |
User::WaitForRequest(aReqStatus);
|
|
4507 |
TEST(aReqStatus.Int()==KErrCancel);
|
|
4508 |
}
|
|
4509 |
|
|
4510 |
|
|
4511 |
void CTestPhone::TestMobileAPNControlList(RMobilePhone& aPhone, TRequestStatus &aReqStatus)
|
|
4512 |
/**
|
|
4513 |
Tests ETelmm API APN control list functions.
|
|
4514 |
|
|
4515 |
@param aPhone RMobilePhone object used to call the tested API functions.
|
|
4516 |
@param aReqStatus Stores the request status returned by asynchronous functions.
|
|
4517 |
*/
|
|
4518 |
{
|
|
4519 |
// Testing EnumerateAPNEntries
|
|
4520 |
// Asynchronous
|
|
4521 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::EnumerateAPNEntries async"), iTestCount++);
|
|
4522 |
TUint32 count;
|
|
4523 |
aPhone.EnumerateAPNEntries(aReqStatus, count);
|
|
4524 |
User::WaitForRequest(aReqStatus);
|
|
4525 |
TEST(aReqStatus.Int() == KErrNone);
|
|
4526 |
TEST(count == DMMTSY_PHONE_APN_ENUMERATE);
|
|
4527 |
|
|
4528 |
// Asynchronous & cancel
|
|
4529 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::EnumerateAPNEntries async & cancel"), iTestCount++);
|
|
4530 |
aPhone.EnumerateAPNEntries(aReqStatus, count);
|
|
4531 |
aPhone.CancelAsyncRequest(EMobilePhoneEnumerateAPNEntries);
|
|
4532 |
User::WaitForRequest(aReqStatus);
|
|
4533 |
TEST(aReqStatus.Int() == KErrCancel);
|
|
4534 |
|
|
4535 |
|
|
4536 |
// Testing GetAPNname
|
|
4537 |
RMobilePhone::TAPNEntryV3 entry;
|
|
4538 |
RMobilePhone::TAPNEntryV3Pckg entryPckg(entry);
|
|
4539 |
|
|
4540 |
// Asynchronous
|
|
4541 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::GetAPNname async"), iTestCount++);
|
|
4542 |
|
|
4543 |
aPhone.GetAPNname(aReqStatus, DMMTSY_PHONE_APN_ENUMERATE-1, entryPckg);
|
|
4544 |
User::WaitForRequest(aReqStatus);
|
|
4545 |
TEST(aReqStatus.Int() == KErrNone);
|
|
4546 |
TEST(entry.iApn.Compare(DMMTSY_PHONE_APN_ENTRY3) == 0);
|
|
4547 |
|
|
4548 |
// Asynchronous & cancel
|
|
4549 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::GetAPNname async & cancel"), iTestCount++);
|
|
4550 |
aPhone.GetAPNname(aReqStatus, DMMTSY_PHONE_APN_ENUMERATE-1, entryPckg);
|
|
4551 |
aPhone.CancelAsyncRequest(EMobilePhoneGetAPNname);
|
|
4552 |
User::WaitForRequest(aReqStatus);
|
|
4553 |
TEST(aReqStatus.Int() == KErrCancel);
|
|
4554 |
|
|
4555 |
|
|
4556 |
// Testing AppendAPNName
|
|
4557 |
RMobilePhone::TAPNEntryV3 entryToAppend;
|
|
4558 |
RMobilePhone::TAPNEntryV3Pckg entryToAppendPckg(entryToAppend);
|
|
4559 |
entryToAppend.iApn = DMMTSY_PHONE_APN_ENTRY_TO_APPEND;
|
|
4560 |
|
|
4561 |
// Asynchronous
|
|
4562 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::AppendAPNName async"), iTestCount++);
|
|
4563 |
aPhone.AppendAPNName(aReqStatus, entryToAppendPckg);
|
|
4564 |
User::WaitForRequest(aReqStatus);
|
|
4565 |
TEST(aReqStatus.Int() == KErrNone);
|
|
4566 |
|
|
4567 |
// Asynchronous and cancel
|
|
4568 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::AppendAPNName async and cancel"), iTestCount++);
|
|
4569 |
aPhone.AppendAPNName(aReqStatus, entryToAppendPckg);
|
|
4570 |
aPhone.CancelAsyncRequest(EMobilePhoneAppendAPNName);
|
|
4571 |
User::WaitForRequest(aReqStatus);
|
|
4572 |
TEST(aReqStatus.Int() == KErrCancel);
|
|
4573 |
|
|
4574 |
|
|
4575 |
// Testing DeleteAPNName
|
|
4576 |
// Asynchronous
|
|
4577 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::DeleteAPNName async"), iTestCount++);
|
|
4578 |
aPhone.DeleteAPNName(aReqStatus, DMMTSY_PHONE_APN_ENUMERATE-1);
|
|
4579 |
User::WaitForRequest(aReqStatus);
|
|
4580 |
TEST(aReqStatus.Int() == KErrNone);
|
|
4581 |
|
|
4582 |
// Asynchronous and cancel
|
|
4583 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::DeleteAPNName async and cancel"), iTestCount++);
|
|
4584 |
aPhone.DeleteAPNName(aReqStatus, DMMTSY_PHONE_APN_ENUMERATE-1);
|
|
4585 |
aPhone.CancelAsyncRequest(EMobilePhoneDeleteAPNName);
|
|
4586 |
User::WaitForRequest(aReqStatus);
|
|
4587 |
TEST(aReqStatus.Int() == KErrCancel);
|
|
4588 |
|
|
4589 |
// Testing NotifyAPNListChanged
|
|
4590 |
TRequestStatus notifyReqStatus;
|
|
4591 |
|
|
4592 |
// Asynchronous
|
|
4593 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::NotifyAPNListChanged async"), iTestCount++);
|
|
4594 |
aPhone.NotifyAPNListChanged(notifyReqStatus);
|
|
4595 |
aPhone.AppendAPNName(aReqStatus, entryToAppendPckg);
|
|
4596 |
User::WaitForRequest(aReqStatus);
|
|
4597 |
TEST(aReqStatus.Int() == KErrNone);
|
|
4598 |
User::WaitForRequest(notifyReqStatus);
|
|
4599 |
TEST(notifyReqStatus.Int() == KErrNone);
|
|
4600 |
|
|
4601 |
// Asynchronous and cancel
|
|
4602 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::NotifyAPNListChanged async and cancel"), iTestCount++);
|
|
4603 |
aPhone.NotifyAPNListChanged(aReqStatus);
|
|
4604 |
aPhone.CancelAsyncRequest(EMobilePhoneNotifyAPNListChanged);
|
|
4605 |
User::WaitForRequest(aReqStatus);
|
|
4606 |
TEST(aReqStatus.Int() == KErrCancel);
|
|
4607 |
}
|
|
4608 |
|
|
4609 |
void CTestPhone::TestMobileAPNControlListServiceStatus(RMobilePhone& aPhone, TRequestStatus &aReqStatus)
|
|
4610 |
/**
|
|
4611 |
Tests ETelmm API APN control list service status functions.
|
|
4612 |
Tests functionality added for INC086069.
|
|
4613 |
|
|
4614 |
@param aPhone RMobilePhone object used to call the tested API functions.
|
|
4615 |
@param aReqStatus Stores the request status returned by asynchronous functions.
|
|
4616 |
*/
|
|
4617 |
{
|
|
4618 |
// Testing SetAPNControlListServiceStatus
|
|
4619 |
RMobilePhone::TAPNControlListServiceStatus apnControlListServiceStatus;
|
|
4620 |
apnControlListServiceStatus = DMMTSY_PHONE_APN_CONTROL_LIST_SERVICE_ENABLED;
|
|
4621 |
|
|
4622 |
// Asynchronous
|
|
4623 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::SetAPNControlListServiceStatus async"), iTestCount++);
|
|
4624 |
aPhone.SetAPNControlListServiceStatus(aReqStatus, apnControlListServiceStatus);
|
|
4625 |
User::WaitForRequest(aReqStatus);
|
|
4626 |
TEST(aReqStatus.Int() == KErrNone);
|
|
4627 |
|
|
4628 |
// Asynchronous and cancel
|
|
4629 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::SetAPNControlListServiceStatus async and cancel"), iTestCount++);
|
|
4630 |
aPhone.SetAPNControlListServiceStatus(aReqStatus, apnControlListServiceStatus);
|
|
4631 |
aPhone.CancelAsyncRequest(EMobilePhoneSetAPNControlListServiceStatus);
|
|
4632 |
User::WaitForRequest(aReqStatus);
|
|
4633 |
TEST(aReqStatus.Int() == KErrCancel);
|
|
4634 |
|
|
4635 |
|
|
4636 |
// Testing GetAPNControlListServiceStatus
|
|
4637 |
RMobilePhone::TAPNControlListServiceStatus apnControlListServiceStatusToGet;
|
|
4638 |
|
|
4639 |
// Asynchronous
|
|
4640 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::GetAPNControlListServiceStatus async"), iTestCount++);
|
|
4641 |
aPhone.GetAPNControlListServiceStatus(aReqStatus, apnControlListServiceStatusToGet);
|
|
4642 |
User::WaitForRequest(aReqStatus);
|
|
4643 |
TEST(aReqStatus.Int() == KErrNone);
|
|
4644 |
TEST(apnControlListServiceStatusToGet == DMMTSY_PHONE_APN_CONTROL_LIST_SERVICE_DISABLED);
|
|
4645 |
|
|
4646 |
// Asynchronous and cancel
|
|
4647 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::GetAPNControlListServiceStatus async and cancel"), iTestCount++);
|
|
4648 |
aPhone.GetAPNControlListServiceStatus(aReqStatus, apnControlListServiceStatusToGet);
|
|
4649 |
aPhone.CancelAsyncRequest(EMobilePhoneGetAPNControlListServiceStatus);
|
|
4650 |
User::WaitForRequest(aReqStatus);
|
|
4651 |
TEST(aReqStatus.Int() == KErrCancel);
|
|
4652 |
|
|
4653 |
|
|
4654 |
// Testing NotifyAPNControlListServiceStatusChange
|
|
4655 |
RMobilePhone::TAPNControlListServiceStatus apnControlListServiceStatusNotify;
|
|
4656 |
TRequestStatus notifyReqStatus;
|
|
4657 |
|
|
4658 |
// Asynchronous
|
|
4659 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::NotifyAPNControlListServiceStatusChange async"), iTestCount++);
|
|
4660 |
aPhone.NotifyAPNControlListServiceStatusChange(notifyReqStatus, apnControlListServiceStatusNotify);
|
|
4661 |
aPhone.SetAPNControlListServiceStatus(aReqStatus, apnControlListServiceStatus);
|
|
4662 |
User::WaitForRequest(aReqStatus);
|
|
4663 |
TEST(aReqStatus.Int() == KErrNone);
|
|
4664 |
User::WaitForRequest(notifyReqStatus);
|
|
4665 |
TEST(notifyReqStatus.Int() == KErrNone);
|
|
4666 |
TEST(apnControlListServiceStatusNotify == DMMTSY_PHONE_APN_CONTROL_LIST_SERVICE_ENABLED);
|
|
4667 |
|
|
4668 |
// Asynchronous and cancel
|
|
4669 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::NotifyAPNControlListServiceStatusChange async and cancel"), iTestCount++);
|
|
4670 |
aPhone.NotifyAPNControlListServiceStatusChange(notifyReqStatus, apnControlListServiceStatusNotify);
|
|
4671 |
aPhone.CancelAsyncRequest(EMobilePhoneNotifyAPNControlListServiceStatusChange);
|
|
4672 |
User::WaitForRequest(notifyReqStatus);
|
|
4673 |
TEST(notifyReqStatus == KErrCancel);
|
|
4674 |
}
|
|
4675 |
|
|
4676 |
void CTestPhone::TestGBAAuthenticationL(RMobilePhone& aPhone, TRequestStatus &aReqStatus)
|
|
4677 |
{
|
|
4678 |
|
|
4679 |
INFO_PRINTF1(_L(""));
|
|
4680 |
INFO_PRINTF1(_L("Test GBA Functionality"));
|
|
4681 |
|
|
4682 |
// local variables used throughout the tests
|
|
4683 |
|
|
4684 |
//Verify the support of GBA in USIM Service Table
|
|
4685 |
RMobilePhone::TMobilePhoneServiceTableV8 asyncSstV8File;
|
|
4686 |
RMobilePhone::TMobilePhoneServiceTableV8Pckg asyncSstV8FilePckgd(asyncSstV8File);
|
|
4687 |
RMobilePhone::TMobilePhoneServiceTable serviceTableType=DMMTSY_PHONE_SERVICE_TABLE;
|
|
4688 |
|
|
4689 |
aPhone.GetServiceTable(aReqStatus, serviceTableType, asyncSstV8FilePckgd);
|
|
4690 |
User::WaitForRequest(aReqStatus);
|
|
4691 |
TEST(aReqStatus.Int()==KErrNone);
|
|
4692 |
if(aReqStatus.Int() == KErrNone)
|
|
4693 |
{
|
|
4694 |
INFO_PRINTF1(_L("Test - RMobilePhone::GetServiceTable V8table for GBA passed"));
|
|
4695 |
}
|
|
4696 |
else
|
|
4697 |
{
|
|
4698 |
INFO_PRINTF1(_L("Test - RMobilePhone::GetServiceTable V8table for GBA failed"));
|
|
4699 |
}
|
|
4700 |
|
|
4701 |
// extract the returned SST file from the package
|
|
4702 |
asyncSstV8File=asyncSstV8FilePckgd();
|
|
4703 |
|
|
4704 |
TEST(asyncSstV8File.ExtensionId()==KEtelExtMultimodeV8);
|
|
4705 |
TEST((asyncSstV8File.iServices57To64) == DMMTSY_PHONE_SST_BYTE8);
|
|
4706 |
TEST((asyncSstV8File.iServices65To72) == DMMTSY_PHONE_SST_BYTE9);
|
|
4707 |
|
|
4708 |
// asynchronous & cancel
|
|
4709 |
aPhone.GetServiceTable(aReqStatus, serviceTableType, asyncSstV8FilePckgd);
|
|
4710 |
aPhone.CancelAsyncRequest(EMobilePhoneGetServiceTable);
|
|
4711 |
User::WaitForRequest(aReqStatus);
|
|
4712 |
TEST(aReqStatus.Int()==KErrNone || aReqStatus.Int()==KErrCancel);
|
|
4713 |
|
|
4714 |
if (aReqStatus.Int()==KErrCancel)
|
|
4715 |
{
|
|
4716 |
INFO_PRINTF1(_L("Test - RMobilePhone::GetServiceTable V8table (async & cancel (Cancelled Request)) passed"));
|
|
4717 |
}
|
|
4718 |
else
|
|
4719 |
{
|
|
4720 |
INFO_PRINTF1(_L("Test - RMobilePhone::GetServiceTable V8table (async & cancel (Request Not Cancelled)) passed"));
|
|
4721 |
}
|
|
4722 |
|
|
4723 |
RMobilePhone::TGbaBootstrapAuthDataV8 tGbaBootstrapAuthDataV8;
|
|
4724 |
RMobilePhone::TGbaBootstrapAuthDataV8Pckg tGbaBootstrapAuthDataV8Pckgd(tGbaBootstrapAuthDataV8);
|
|
4725 |
TEST(tGbaBootstrapAuthDataV8.ExtensionId() == RMobilePhone::KETelMobileGbaBootstrapAuthDataV8);
|
|
4726 |
|
|
4727 |
tGbaBootstrapAuthDataV8.iRAND = DMMTSY_PHONE_GBA_RAND_IN; // valid input
|
|
4728 |
tGbaBootstrapAuthDataV8.iAUTN = DMMTSY_PHONE_GBA_AUTN_IN; // valid input
|
|
4729 |
|
|
4730 |
RMobilePhone::TAID appAID = DMMTSY_PHONE_GBA_AID();
|
|
4731 |
|
|
4732 |
INFO_PRINTF1(_L("Test - RMobilePhone::SmartCardAuthenticate async with AID."));
|
|
4733 |
|
|
4734 |
aPhone.SmartCardAuthenticate(aReqStatus, appAID, tGbaBootstrapAuthDataV8Pckgd);
|
|
4735 |
User::WaitForRequest(aReqStatus);
|
|
4736 |
TEST(aReqStatus.Int() == KErrNone);
|
|
4737 |
|
|
4738 |
TEST(tGbaBootstrapAuthDataV8.iRES == DMMTSY_PHONE_GBA_SUCC_RES_OUT);
|
|
4739 |
TEST(tGbaBootstrapAuthDataV8.iAUTS == DMMTSY_PHONE_GBA_SUCC_AUTS_OUT);
|
|
4740 |
|
|
4741 |
tGbaBootstrapAuthDataV8.iRAND = DMMTSY_PHONE_GBA_RAND_INV; // invalid input
|
|
4742 |
tGbaBootstrapAuthDataV8.iAUTN = DMMTSY_PHONE_GBA_AUTN_INV; // invalid input
|
|
4743 |
|
|
4744 |
aPhone.SmartCardAuthenticate(aReqStatus, appAID, tGbaBootstrapAuthDataV8Pckgd);
|
|
4745 |
User::WaitForRequest(aReqStatus);
|
|
4746 |
TEST(aReqStatus.Int() == KErrMMEtelAuthVerificationFailure);
|
|
4747 |
|
|
4748 |
TEST(tGbaBootstrapAuthDataV8.iRES == DMMTSY_PHONE_GBA_FAIL_RES_OUT);
|
|
4749 |
TEST(tGbaBootstrapAuthDataV8.iAUTS == DMMTSY_PHONE_GBA_FAIL_AUTS_OUT);
|
|
4750 |
|
|
4751 |
tGbaBootstrapAuthDataV8.iRAND = DMMTSY_PHONE_GBA_RAND_INV; // invalid input
|
|
4752 |
tGbaBootstrapAuthDataV8.iAUTN = DMMTSY_PHONE_GBA_AUTN_INV; // invalid input
|
|
4753 |
|
|
4754 |
aPhone.SmartCardAuthenticate(aReqStatus, appAID, tGbaBootstrapAuthDataV8Pckgd);
|
|
4755 |
User::WaitForRequest(aReqStatus);
|
|
4756 |
TEST(aReqStatus.Int() == KErrMMEtelAuthMacInvalid);
|
|
4757 |
|
|
4758 |
TEST(tGbaBootstrapAuthDataV8.iRES == DMMTSY_PHONE_GBA_FAIL_RES_OUT);
|
|
4759 |
TEST(tGbaBootstrapAuthDataV8.iAUTS == DMMTSY_PHONE_GBA_SUCC_AUTS_OUT );
|
|
4760 |
|
|
4761 |
RMobilePhone::TGbaBootstrapAuthDataV8 tGbaBootstrapAuthDataV8_1;
|
|
4762 |
RMobilePhone::TGbaBootstrapAuthDataV8Pckg tGbaBootstrapAuthDataV8Pckgd_1(tGbaBootstrapAuthDataV8_1);
|
|
4763 |
|
|
4764 |
tGbaBootstrapAuthDataV8_1.iRAND = DMMTSY_PHONE_GBA_RAND_INV; // invalid input
|
|
4765 |
tGbaBootstrapAuthDataV8_1.iAUTN = DMMTSY_PHONE_GBA_AUTN_INV; // invalid input
|
|
4766 |
|
|
4767 |
aPhone.SmartCardAuthenticate(aReqStatus, appAID, tGbaBootstrapAuthDataV8Pckgd_1);
|
|
4768 |
User::WaitForRequest(aReqStatus);
|
|
4769 |
TEST(aReqStatus.Int() == KErrInUse);
|
|
4770 |
|
|
4771 |
TEST(tGbaBootstrapAuthDataV8.iRES == DMMTSY_PHONE_GBA_FAIL_RES_OUT);
|
|
4772 |
TEST(tGbaBootstrapAuthDataV8.iAUTS == DMMTSY_PHONE_GBA_SUCC_AUTS_OUT );
|
|
4773 |
|
|
4774 |
RMobilePhone::TBsfDataV8 tBsfDataV8;
|
|
4775 |
RMobilePhone::TBsfDataV8Pckg tBsfDataV8Pckgd(tBsfDataV8);
|
|
4776 |
TEST(tBsfDataV8.ExtensionId() == RMobilePhone::KETelMobileGbaBootstrapAuthDataV8);
|
|
4777 |
|
|
4778 |
tBsfDataV8.iBtid = DMMTSY_PHONE_BSF_VALID_BTID;
|
|
4779 |
tBsfDataV8.iKeyLifetime = DMMTSY_PHONE_BSF_VALID_KEYLIFETIME;
|
|
4780 |
|
|
4781 |
aPhone.SetGbaBootstrapParams(aReqStatus,appAID,tBsfDataV8Pckgd);
|
|
4782 |
User::WaitForRequest(aReqStatus);
|
|
4783 |
TEST(aReqStatus.Int() == KErrNone);
|
|
4784 |
|
|
4785 |
INFO_PRINTF1(_L("Test - RMobilePhone::SetGbaBootstrapParams Completed."));
|
|
4786 |
|
|
4787 |
tBsfDataV8.iBtid = DMMTSY_PHONE_BSF_INVALID_BTID;
|
|
4788 |
tBsfDataV8.iKeyLifetime = DMMTSY_PHONE_BSF_INVALID_KEYLIFETIME;
|
|
4789 |
|
|
4790 |
aPhone.SetGbaBootstrapParams(aReqStatus,appAID,tBsfDataV8Pckgd);
|
|
4791 |
User::WaitForRequest(aReqStatus);
|
|
4792 |
TEST(aReqStatus.Int() == KErrCorrupt);
|
|
4793 |
|
|
4794 |
tBsfDataV8.iBtid = DMMTSY_PHONE_BSF_VALID_BTID;
|
|
4795 |
tBsfDataV8.iKeyLifetime = DMMTSY_PHONE_BSF_VALID_KEYLIFETIME;
|
|
4796 |
|
|
4797 |
aPhone.SetGbaBootstrapParams(aReqStatus,appAID,tBsfDataV8Pckgd);
|
|
4798 |
aPhone.CancelAsyncRequest(EMobilePhoneSetGbaBootstrapParams);
|
|
4799 |
User::WaitForRequest(aReqStatus);
|
|
4800 |
TEST((aReqStatus.Int() == KErrCancel) ||(aReqStatus.Int() == KErrNone));
|
|
4801 |
INFO_PRINTF1(_L("Test - Cancellation of RMobilePhone::SetGbaBootstrapParams Completed."));
|
|
4802 |
|
|
4803 |
RMobilePhone::TAuthInfoV8 tAuthInfoV8;
|
|
4804 |
RMobilePhone::TAuthInfoV8Pckg tAuthInfoV8Pckgd(tAuthInfoV8);
|
|
4805 |
aPhone.NotifyAuthenticateDataChange(aReqStatus,tAuthInfoV8Pckgd);
|
|
4806 |
User::WaitForRequest(aReqStatus);
|
|
4807 |
TEST(aReqStatus.Int() == KErrNone);
|
|
4808 |
INFO_PRINTF1(_L("Test - RMobilePhone::NotifyAuthenticateDataChange Completed."));
|
|
4809 |
|
|
4810 |
tAuthInfoV8 = tAuthInfoV8Pckgd();
|
|
4811 |
TEST(tAuthInfoV8.iAID == DMMTSY_PHONE_GBA_AID());
|
|
4812 |
TEST((tAuthInfoV8.iData == DMMTSY_PHONE_AUTH_DATA_GBA_PARAMS ) ||(tAuthInfoV8.iData == DMMTSY_PHONE_AUTH_DATA_NAF_LIST)
|
|
4813 |
|| (tAuthInfoV8.iData == DMMTSY_PHONE_AUTH_DATA_MBMS_MSK) ||(tAuthInfoV8.iData == DMMTSY_PHONE_AUTH_DATA_MBMS_MUK) );
|
|
4814 |
|
|
4815 |
aPhone.NotifyAuthenticateDataChange(aReqStatus,tAuthInfoV8Pckgd);
|
|
4816 |
aPhone.CancelAsyncRequest(EMobilePhoneNotifyAuthenticateDataChange);
|
|
4817 |
User::WaitForRequest(aReqStatus);
|
|
4818 |
TEST((aReqStatus.Int() == KErrNone) || (aReqStatus.Int() == KErrCancel));
|
|
4819 |
INFO_PRINTF1(_L("Test - Cancellation of RMobilePhone::NotifyAuthenticateDataChange Completed."));
|
|
4820 |
|
|
4821 |
RMobilePhone::TGbaBootstrapParamsV8 tGbaBootstrapParamsV8;
|
|
4822 |
RMobilePhone::TGbaBootstrapParamsV8Pckg tGbaBootstrapParamsV8Pckgd(tGbaBootstrapParamsV8);
|
|
4823 |
|
|
4824 |
TEST(tGbaBootstrapParamsV8.ExtensionId() == RMobilePhone::KETelMobileGbaBootstrapParamsV8);
|
|
4825 |
|
|
4826 |
tAuthInfoV8.iAID = DMMTSY_PHONE_GBA_AID();
|
|
4827 |
tAuthInfoV8.iData = DMMTSY_PHONE_AUTH_DATA_GBA_PARAMS;
|
|
4828 |
|
|
4829 |
aPhone.GetAuthenticationParams(aReqStatus,tAuthInfoV8Pckgd,tGbaBootstrapParamsV8Pckgd);
|
|
4830 |
User::WaitForRequest(aReqStatus);
|
|
4831 |
TEST(aReqStatus.Int() == KErrNone);
|
|
4832 |
INFO_PRINTF1(_L("Test - RMobilePhone::GetAuthenticationParams Completed."));
|
|
4833 |
|
|
4834 |
tGbaBootstrapParamsV8 = tGbaBootstrapParamsV8Pckgd();
|
|
4835 |
|
|
4836 |
TEST(tGbaBootstrapParamsV8.iRand == DMMTSY_PHONE_GBA_RAND_IN);
|
|
4837 |
TEST(tGbaBootstrapParamsV8.iBtid == DMMTSY_PHONE_BSF_VALID_BTID);
|
|
4838 |
TEST(tGbaBootstrapParamsV8.iKeyLifetime == DMMTSY_PHONE_BSF_VALID_KEYLIFETIME);
|
|
4839 |
|
|
4840 |
tAuthInfoV8.iAID = DMMTSY_PHONE_GBA_AID();
|
|
4841 |
tAuthInfoV8.iData = DMMTSY_PHONE_AUTH_DATA_NAF_LIST;
|
|
4842 |
|
|
4843 |
aPhone.GetAuthenticationParams(aReqStatus,tAuthInfoV8Pckgd,tGbaBootstrapParamsV8Pckgd);
|
|
4844 |
User::WaitForRequest(aReqStatus);
|
|
4845 |
TEST(aReqStatus.Int() == KErrCorrupt);
|
|
4846 |
|
|
4847 |
tAuthInfoV8.iAID = DMMTSY_PHONE_GBA_AID();
|
|
4848 |
tAuthInfoV8.iData = DMMTSY_PHONE_AUTH_DATA_GBA_PARAMS;
|
|
4849 |
|
|
4850 |
aPhone.GetAuthenticationParams(aReqStatus,tAuthInfoV8Pckgd,tGbaBootstrapParamsV8Pckgd);
|
|
4851 |
aPhone.CancelAsyncRequest(EMobilePhoneGetAuthenticationParams);
|
|
4852 |
User::WaitForRequest(aReqStatus);
|
|
4853 |
TEST((aReqStatus.Int() == KErrNone) || (aReqStatus.Int() == KErrCancel));
|
|
4854 |
INFO_PRINTF1(_L("Test - Cancellation of RMobilePhone::GetAuthenticationParams Completed."));
|
|
4855 |
|
|
4856 |
RMobilePhone::TGbaNafAuthDataV8 tGbaNafAuthDataV8;
|
|
4857 |
RMobilePhone::TGbaNafAuthDataV8Pckg tGbaNafAuthDataV8Pckgd(tGbaNafAuthDataV8);
|
|
4858 |
|
|
4859 |
TEST(tGbaNafAuthDataV8.ExtensionId() == RMobilePhone::KETelMobileGbaNafAuthDataV8);
|
|
4860 |
|
|
4861 |
tGbaNafAuthDataV8.iNafId = DMMTSY_PHONE_GBA_VALID_NAFID;
|
|
4862 |
tGbaNafAuthDataV8.iImpi = DMMTSY_PHONE_GBA_VALID_IMPI;
|
|
4863 |
|
|
4864 |
aPhone.SmartCardAuthenticate(aReqStatus,tGbaNafAuthDataV8Pckgd);
|
|
4865 |
User::WaitForRequest(aReqStatus);
|
|
4866 |
TEST(aReqStatus.Int() == KErrNone);
|
|
4867 |
|
|
4868 |
tGbaNafAuthDataV8 = tGbaNafAuthDataV8Pckgd();
|
|
4869 |
TEST(tGbaNafAuthDataV8.iKsExtNaf == DMMTSY_PHONE_GBA_KS_EXTNAF);
|
|
4870 |
|
|
4871 |
tGbaNafAuthDataV8.iNafId = DMMTSY_PHONE_GBA_INVALID_NAFID;
|
|
4872 |
tGbaNafAuthDataV8.iImpi = DMMTSY_PHONE_GBA_INVALID_IMPI;
|
|
4873 |
|
|
4874 |
aPhone.SmartCardAuthenticate(aReqStatus,tGbaNafAuthDataV8Pckgd);
|
|
4875 |
User::WaitForRequest(aReqStatus);
|
|
4876 |
TEST(aReqStatus.Int() == KErrCorrupt || (aReqStatus.Int() == KErrMMEtelAuthKeyNotFound));
|
|
4877 |
|
|
4878 |
/* Retrieve the list for the GBA NAF authentication parameters */
|
|
4879 |
|
|
4880 |
INFO_PRINTF1(_L("Test - Retrieval of CTestRetrieveMobilePhoneAuthenticationIds..."));
|
|
4881 |
|
|
4882 |
INFO_PRINTF1(_L("Test - Retrieval of CTestRetrieveMobilePhoneAuthenticationIds..."));
|
|
4883 |
|
|
4884 |
CTestRetrieveMobilePhoneAuthenticationIds *pRetrieve = CTestRetrieveMobilePhoneAuthenticationIds::NewLC(aPhone,this);
|
|
4885 |
TBool startReqd = ETrue;
|
|
4886 |
|
|
4887 |
pRetrieve->SetAuthType(CTestRetrieveMobilePhoneAuthenticationIds::EGba);
|
|
4888 |
pRetrieve->TestRetrieve(DMMTSY_PHONE_AUTH_DATA_NAF_LIST,startReqd);
|
|
4889 |
|
|
4890 |
//Delete test object and start afresh
|
|
4891 |
CleanupStack::PopAndDestroy(); //pRetrieve
|
|
4892 |
|
|
4893 |
/* Testing the cancellation of the APIs*/
|
|
4894 |
pRetrieve = CTestRetrieveMobilePhoneAuthenticationIds::NewLC(aPhone,this);
|
|
4895 |
startReqd = ETrue;
|
|
4896 |
|
|
4897 |
pRetrieve->SetAuthType(CTestRetrieveMobilePhoneAuthenticationIds::EGba);
|
|
4898 |
pRetrieve->TestCancel(DMMTSY_PHONE_AUTH_DATA_NAF_LIST);
|
|
4899 |
|
|
4900 |
//Delete test object and start afresh
|
|
4901 |
CleanupStack::PopAndDestroy(); //pRetrieve
|
|
4902 |
|
|
4903 |
INFO_PRINTF1(_L("Test - CTestRetrieveMobilePhoneAuthenticationIds Completed."));
|
|
4904 |
}
|
|
4905 |
|
|
4906 |
void CTestPhone::TestMBMSAuthenticationL(RMobilePhone& aPhone, TRequestStatus &aReqStatus)
|
|
4907 |
{
|
|
4908 |
|
|
4909 |
INFO_PRINTF1(_L(""));
|
|
4910 |
INFO_PRINTF1(_L("Test MBMS Functionality"));
|
|
4911 |
|
|
4912 |
//Verify the support of MBMS in USIM Service Table
|
|
4913 |
RMobilePhone::TMobilePhoneServiceTableV8 asyncSstV8File;
|
|
4914 |
RMobilePhone::TMobilePhoneServiceTableV8Pckg asyncSstV8FilePckgd(asyncSstV8File);
|
|
4915 |
RMobilePhone::TMobilePhoneServiceTable serviceTableType=DMMTSY_PHONE_SERVICE_TABLE;
|
|
4916 |
|
|
4917 |
aPhone.GetServiceTable(aReqStatus, serviceTableType, asyncSstV8FilePckgd);
|
|
4918 |
User::WaitForRequest(aReqStatus);
|
|
4919 |
TEST(aReqStatus.Int()==KErrNone);
|
|
4920 |
if(aReqStatus.Int() == KErrNone)
|
|
4921 |
{
|
|
4922 |
INFO_PRINTF1(_L("Test - RMobilePhone::GetServiceTable V8table for GBA passed"));
|
|
4923 |
}
|
|
4924 |
else
|
|
4925 |
{
|
|
4926 |
INFO_PRINTF1(_L("Test - RMobilePhone::GetServiceTable V8table for GBA failed"));
|
|
4927 |
}
|
|
4928 |
|
|
4929 |
// extract the returned SST file from the package
|
|
4930 |
asyncSstV8File=asyncSstV8FilePckgd();
|
|
4931 |
|
|
4932 |
TEST(asyncSstV8File.ExtensionId()==KEtelExtMultimodeV8);
|
|
4933 |
TEST((asyncSstV8File.iServices57To64) == DMMTSY_PHONE_SST_BYTE8);
|
|
4934 |
TEST((asyncSstV8File.iServices65To72) == DMMTSY_PHONE_SST_BYTE9);
|
|
4935 |
|
|
4936 |
// asynchronous & cancel
|
|
4937 |
|
|
4938 |
aPhone.GetServiceTable(aReqStatus, serviceTableType, asyncSstV8FilePckgd);
|
|
4939 |
aPhone.CancelAsyncRequest(EMobilePhoneGetServiceTable);
|
|
4940 |
User::WaitForRequest(aReqStatus);
|
|
4941 |
TEST(aReqStatus.Int()==KErrNone || aReqStatus.Int()==KErrCancel);
|
|
4942 |
|
|
4943 |
if (aReqStatus.Int()==KErrCancel)
|
|
4944 |
{
|
|
4945 |
INFO_PRINTF1(_L("Test - RMobilePhone::GetServiceTable V8table (async & cancel (Cancelled Request)) passed"));
|
|
4946 |
}
|
|
4947 |
else
|
|
4948 |
{
|
|
4949 |
INFO_PRINTF1(_L("Test - RMobilePhone::GetServiceTable V8table (async & cancel (Request Not Cancelled)) passed"));
|
|
4950 |
}
|
|
4951 |
|
|
4952 |
RMobilePhone::TMbmsMskUpdateDataV8 tMbmsMskUpdateDataV8;
|
|
4953 |
RMobilePhone::TMbmsMskUpdateDataV8Pckg tTMbmsMskUpdateDataV8Pckgd(tMbmsMskUpdateDataV8);
|
|
4954 |
RMobilePhone::TAID appAID = DMMTSY_PHONE_MBMS_AID();
|
|
4955 |
|
|
4956 |
TEST(tMbmsMskUpdateDataV8.ExtensionId() == RMobilePhone::KETelMobileMbmsMskUpdateDataV8);
|
|
4957 |
|
|
4958 |
tMbmsMskUpdateDataV8.iInputMikey = DMMTSY_PHONE_MBMS_VALID_IMIKEY_WO_VBIT;
|
|
4959 |
|
|
4960 |
aPhone.SmartCardAuthenticate(aReqStatus, appAID, tTMbmsMskUpdateDataV8Pckgd);
|
|
4961 |
User::WaitForRequest(aReqStatus);
|
|
4962 |
TEST(aReqStatus.Int() == KErrNone);
|
|
4963 |
|
|
4964 |
INFO_PRINTF1(_L("Test - RMobilePhone::SmartCardAuthenticate async with AID."));
|
|
4965 |
|
|
4966 |
tMbmsMskUpdateDataV8.iInputMikey = DMMTSY_PHONE_MBMS_VALID_IMIKEY_W_VBIT;
|
|
4967 |
|
|
4968 |
aPhone.SmartCardAuthenticate(aReqStatus, appAID, tTMbmsMskUpdateDataV8Pckgd);
|
|
4969 |
User::WaitForRequest(aReqStatus);
|
|
4970 |
TEST(aReqStatus.Int() == KErrNone);
|
|
4971 |
TEST(tMbmsMskUpdateDataV8.iOutputMikey == DMMTSY_PHONE_MBMS_OMIKEY_FOR_W_VBIT);
|
|
4972 |
|
|
4973 |
tMbmsMskUpdateDataV8.iInputMikey = DMMTSY_PHONE_MBMS_INVALID_IMIKEY;
|
|
4974 |
|
|
4975 |
aPhone.SmartCardAuthenticate(aReqStatus, appAID, tTMbmsMskUpdateDataV8Pckgd);
|
|
4976 |
User::WaitForRequest(aReqStatus);
|
|
4977 |
TEST(aReqStatus.Int() ==KErrMMEtelAuthKeyNotFound );
|
|
4978 |
|
|
4979 |
aPhone.SmartCardAuthenticate(aReqStatus, appAID, tTMbmsMskUpdateDataV8Pckgd);
|
|
4980 |
User::WaitForRequest(aReqStatus);
|
|
4981 |
TEST(aReqStatus.Int() ==KErrMMEtelAuthKeyInvalid );
|
|
4982 |
|
|
4983 |
aPhone.SmartCardAuthenticate(aReqStatus, appAID, tTMbmsMskUpdateDataV8Pckgd);
|
|
4984 |
User::WaitForRequest(aReqStatus);
|
|
4985 |
TEST(aReqStatus.Int() == KErrCorrupt );
|
|
4986 |
|
|
4987 |
aPhone.SmartCardAuthenticate(aReqStatus, appAID, tTMbmsMskUpdateDataV8Pckgd);
|
|
4988 |
User::WaitForRequest(aReqStatus);
|
|
4989 |
TEST(aReqStatus.Int() == KErrInUse );
|
|
4990 |
|
|
4991 |
RMobilePhone::TMbmsMtkGenerateDataV8 tMbmsMtkGenerateDataV8;
|
|
4992 |
RMobilePhone::TMbmsMtkGenerateDataV8Pckg tMbmsMtkGenerateDataV8Pckgd(tMbmsMtkGenerateDataV8);
|
|
4993 |
|
|
4994 |
TEST(tMbmsMtkGenerateDataV8.ExtensionId() == RMobilePhone::KETelMobileMbmsMtkGenerateDataV8);
|
|
4995 |
|
|
4996 |
tMbmsMtkGenerateDataV8.iMikey = DMMTSY_PHONE_MBMS_VALID_IMIKEY;
|
|
4997 |
|
|
4998 |
aPhone.SmartCardAuthenticate(aReqStatus, appAID, tMbmsMtkGenerateDataV8Pckgd);
|
|
4999 |
User::WaitForRequest(aReqStatus);
|
|
5000 |
TEST(aReqStatus.Int() == KErrNone);
|
|
5001 |
|
|
5002 |
TEST(tMbmsMtkGenerateDataV8.iMtk == DMMTSY_PHONE_MBMS_VALID_MTK);
|
|
5003 |
TEST(tMbmsMtkGenerateDataV8.iSaltKey == DMMTSY_PHONE_MBMS_VALID_SALTKEY);
|
|
5004 |
|
|
5005 |
RMobilePhone::TMbmsMskDeleteDataV8 tMbmsMskDeleteDataV8;
|
|
5006 |
RMobilePhone::TMbmsMskDeleteDataV8Pckg tMbmsMskDeleteDataV8Pckgd(tMbmsMskDeleteDataV8);
|
|
5007 |
|
|
5008 |
TEST(tMbmsMskDeleteDataV8.ExtensionId() == RMobilePhone::KETelMobileMbmsMskDeleteDataV8);
|
|
5009 |
|
|
5010 |
tMbmsMskDeleteDataV8.iKeyDomainId = DMMTSY_PHONE_MBMS_VALID_KEYDMN;
|
|
5011 |
tMbmsMskDeleteDataV8.iMskIdKeyGroup = DMMTSY_PHONE_MBMS_VALID_MSKIDGRP;
|
|
5012 |
|
|
5013 |
aPhone.SmartCardAuthenticate(aReqStatus, appAID, tMbmsMskDeleteDataV8Pckgd);
|
|
5014 |
User::WaitForRequest(aReqStatus);
|
|
5015 |
TEST(aReqStatus.Int() == KErrNone);
|
|
5016 |
|
|
5017 |
tMbmsMskDeleteDataV8.iKeyDomainId = DMMTSY_PHONE_MBMS_INVALID_KEYDMN;
|
|
5018 |
tMbmsMskDeleteDataV8.iMskIdKeyGroup = DMMTSY_PHONE_MBMS_INVALID_MSKIDGRP;
|
|
5019 |
|
|
5020 |
aPhone.SmartCardAuthenticate(aReqStatus, appAID, tMbmsMskDeleteDataV8Pckgd);
|
|
5021 |
User::WaitForRequest(aReqStatus);
|
|
5022 |
TEST(aReqStatus.Int() == KErrNotFound);
|
|
5023 |
|
|
5024 |
aPhone.SmartCardAuthenticate(aReqStatus, appAID, tMbmsMskDeleteDataV8Pckgd);
|
|
5025 |
User::WaitForRequest(aReqStatus);
|
|
5026 |
TEST(aReqStatus.Int() == KErrInUse);
|
|
5027 |
|
|
5028 |
RMobilePhone::TMbmsMukDeleteDataV8 tMbmsMukDeleteDataV8;
|
|
5029 |
RMobilePhone::TMbmsMukDeleteDataV8Pckg tMbmsMukDeleteDataV8Pckgd(tMbmsMukDeleteDataV8);
|
|
5030 |
|
|
5031 |
TEST(tMbmsMukDeleteDataV8.ExtensionId() == RMobilePhone::KETelMobileMbmsMukDeleteDataV8);
|
|
5032 |
|
|
5033 |
tMbmsMukDeleteDataV8.iMukIdTlv = DMMTSY_PHONE_MBMS_VALID_MUKID;
|
|
5034 |
|
|
5035 |
aPhone.SmartCardAuthenticate(aReqStatus, appAID, tMbmsMukDeleteDataV8Pckgd);
|
|
5036 |
User::WaitForRequest(aReqStatus);
|
|
5037 |
TEST(aReqStatus.Int() == KErrNone);
|
|
5038 |
|
|
5039 |
tMbmsMukDeleteDataV8.iMukIdTlv = DMMTSY_PHONE_MBMS_INVALID_MUKID;
|
|
5040 |
|
|
5041 |
aPhone.SmartCardAuthenticate(aReqStatus, appAID, tMbmsMukDeleteDataV8Pckgd);
|
|
5042 |
User::WaitForRequest(aReqStatus);
|
|
5043 |
TEST(aReqStatus.Int() == KErrNotFound);
|
|
5044 |
|
|
5045 |
aPhone.SmartCardAuthenticate(aReqStatus, appAID, tMbmsMukDeleteDataV8Pckgd);
|
|
5046 |
User::WaitForRequest(aReqStatus);
|
|
5047 |
TEST(aReqStatus.Int() == KErrInUse);
|
|
5048 |
|
|
5049 |
RMobilePhone::TMbmsUserKeyV8 tMbmsUserKeyV8;
|
|
5050 |
RMobilePhone::TMbmsUserKeyV8Pckg tMbmsUserKeyV8Pckgd(tMbmsUserKeyV8);
|
|
5051 |
|
|
5052 |
TEST(tMbmsUserKeyV8.ExtensionId() == RMobilePhone::KETelMobileMbmsUserKeyV8);
|
|
5053 |
|
|
5054 |
RMobilePhone::TAuthInfoV8 tAuthInfoV8;
|
|
5055 |
RMobilePhone::TAuthInfoV8Pckg tAuthInfoV8Pckgd(tAuthInfoV8);
|
|
5056 |
|
|
5057 |
tAuthInfoV8.iData = DMMTSY_PHONE_AUTH_DATA_MBMS_MUK;
|
|
5058 |
tAuthInfoV8.iAID = DMMTSY_PHONE_MBMS_AID;
|
|
5059 |
|
|
5060 |
aPhone.GetAuthenticationParams(aReqStatus,tAuthInfoV8Pckgd,tMbmsUserKeyV8Pckgd);
|
|
5061 |
User::WaitForRequest(aReqStatus);
|
|
5062 |
TEST(aReqStatus.Int() == KErrNone);
|
|
5063 |
|
|
5064 |
INFO_PRINTF1(_L("Test - RMobilePhone::GetAuthenticationParams Completed."));
|
|
5065 |
|
|
5066 |
TEST(tMbmsUserKeyV8.iMukIdi == DMMTSY_PHONE_MBMS_VALID_MUK_IDI);
|
|
5067 |
TEST(tMbmsUserKeyV8.iMukIdr == DMMTSY_PHONE_MBMS_VALID_MUK_IDR);
|
|
5068 |
TEST(tMbmsUserKeyV8.iTimeStampCounter == DMMTSY_PHONE_MBMS_VALID_MUK_ITIMESTM);
|
|
5069 |
|
|
5070 |
tAuthInfoV8.iData = DMMTSY_PHONE_AUTH_DATA_NAF_LIST;
|
|
5071 |
tAuthInfoV8.iAID = DMMTSY_PHONE_MBMS_AID;
|
|
5072 |
|
|
5073 |
aPhone.GetAuthenticationParams(aReqStatus,tAuthInfoV8Pckgd,tMbmsUserKeyV8Pckgd);
|
|
5074 |
User::WaitForRequest(aReqStatus);
|
|
5075 |
TEST(aReqStatus.Int() == KErrCorrupt);
|
|
5076 |
|
|
5077 |
tAuthInfoV8.iData = DMMTSY_PHONE_AUTH_DATA_MBMS_MUK;
|
|
5078 |
tAuthInfoV8.iAID = DMMTSY_PHONE_MBMS_AID;
|
|
5079 |
|
|
5080 |
aPhone.GetAuthenticationParams(aReqStatus,tAuthInfoV8Pckgd,tMbmsUserKeyV8Pckgd);
|
|
5081 |
aPhone.CancelAsyncRequest(EMobilePhoneGetAuthenticationParams);
|
|
5082 |
User::WaitForRequest(aReqStatus);
|
|
5083 |
TEST((aReqStatus.Int()==KErrNone) || (aReqStatus.Int()==KErrCancel));
|
|
5084 |
INFO_PRINTF1(_L("Test - Cancellation of RMobilePhone::GetAuthenticationParams Completed."));
|
|
5085 |
|
|
5086 |
/* Retrieve the list for the MBMS authentication parameters */
|
|
5087 |
|
|
5088 |
INFO_PRINTF1(_L("Test - Retrieval of CTestRetrieveMobilePhoneAuthenticationIds..."));
|
|
5089 |
|
|
5090 |
CTestRetrieveMobilePhoneAuthenticationIds *pRetrieve = CTestRetrieveMobilePhoneAuthenticationIds::NewLC(aPhone,this);
|
|
5091 |
TBool startReqd = ETrue;
|
|
5092 |
|
|
5093 |
pRetrieve->SetAuthType(CTestRetrieveMobilePhoneAuthenticationIds::EMbms);
|
|
5094 |
pRetrieve->TestRetrieve(DMMTSY_PHONE_AUTH_DATA_MBMS_MSK,startReqd);
|
|
5095 |
|
|
5096 |
//Delete test object and start afresh
|
|
5097 |
|
|
5098 |
CleanupStack::PopAndDestroy(); //pRetrieve
|
|
5099 |
|
|
5100 |
pRetrieve = CTestRetrieveMobilePhoneAuthenticationIds::NewLC(aPhone,this);
|
|
5101 |
startReqd = ETrue;
|
|
5102 |
|
|
5103 |
pRetrieve->SetAuthType(CTestRetrieveMobilePhoneAuthenticationIds::EMbms);
|
|
5104 |
pRetrieve->TestCancel(DMMTSY_PHONE_AUTH_DATA_MBMS_MSK);
|
|
5105 |
|
|
5106 |
//Delete test object and start afresh
|
|
5107 |
CleanupStack::PopAndDestroy(); //pRetrieve
|
|
5108 |
|
|
5109 |
INFO_PRINTF1(_L("Test - CTestRetrieveMobilePhoneAuthenticationIds Completed."));
|
|
5110 |
}
|
|
5111 |
|
|
5112 |
void CTestPhone::TestWlanParametersL(RMobilePhone& aPhone, TRequestStatus &aReqStatus)
|
|
5113 |
{
|
|
5114 |
INFO_PRINTF1(_L(""));
|
|
5115 |
INFO_PRINTF1(_L("WLAN FUNCTIONALITY"));
|
|
5116 |
|
|
5117 |
//Verify the support of WLAN in USIM Service Table
|
|
5118 |
RMobilePhone::TMobilePhoneServiceTableV8 asyncSstV8File;
|
|
5119 |
RMobilePhone::TMobilePhoneServiceTableV8Pckg asyncSstV8FilePckgd(asyncSstV8File);
|
|
5120 |
RMobilePhone::TMobilePhoneServiceTable serviceTableType=DMMTSY_PHONE_SERVICE_TABLE;
|
|
5121 |
|
|
5122 |
aPhone.GetServiceTable(aReqStatus, serviceTableType, asyncSstV8FilePckgd);
|
|
5123 |
User::WaitForRequest(aReqStatus);
|
|
5124 |
TEST(aReqStatus.Int()==KErrNone);
|
|
5125 |
if(aReqStatus.Int() == KErrNone)
|
|
5126 |
{
|
|
5127 |
INFO_PRINTF1(_L("Test - RMobilePhone::GetServiceTable V8table for WLAN passed"));
|
|
5128 |
}
|
|
5129 |
else
|
|
5130 |
{
|
|
5131 |
INFO_PRINTF1(_L("Test - RMobilePhone::GetServiceTable V8table for WLAN failed"));
|
|
5132 |
}
|
|
5133 |
|
|
5134 |
// extract the returned SST file from the package
|
|
5135 |
asyncSstV8File=asyncSstV8FilePckgd();
|
|
5136 |
TEST(asyncSstV8File.ExtensionId()==KEtelExtMultimodeV8);
|
|
5137 |
TEST((asyncSstV8File.iServices57To64) == DMMTSY_PHONE_SST_BYTE8);
|
|
5138 |
TEST((asyncSstV8File.iServices65To72) == DMMTSY_PHONE_SST_BYTE9);
|
|
5139 |
|
|
5140 |
// asynchronous & cancel
|
|
5141 |
aPhone.GetServiceTable(aReqStatus, serviceTableType, asyncSstV8FilePckgd);
|
|
5142 |
aPhone.CancelAsyncRequest(EMobilePhoneGetServiceTable);
|
|
5143 |
User::WaitForRequest(aReqStatus);
|
|
5144 |
TEST(aReqStatus.Int()==KErrNone || aReqStatus.Int()==KErrCancel);
|
|
5145 |
|
|
5146 |
if (aReqStatus.Int()==KErrCancel)
|
|
5147 |
{
|
|
5148 |
INFO_PRINTF1(_L("Test - RMobilePhone::GetServiceTable V8table (async & cancel (Cancelled Request)) passed"));
|
|
5149 |
}
|
|
5150 |
else
|
|
5151 |
{
|
|
5152 |
INFO_PRINTF1(_L("Test - RMobilePhone::GetServiceTable V8table (async & cancel (Request Not Cancelled)) passed"));
|
|
5153 |
}
|
|
5154 |
|
|
5155 |
RMobilePhone::TUsimWlanDataV8 tUsimWlanDataV8;
|
|
5156 |
RMobilePhone::TUsimWlanDataV8Pckg tUsimWlanDataV8Pckgd(tUsimWlanDataV8);
|
|
5157 |
|
|
5158 |
tUsimWlanDataV8.iFieldsUsed = DMMTSY_PHONE_WLAN_LIST_DATA_FLAGS;
|
|
5159 |
tUsimWlanDataV8.iPseudonym = DMMTSY_PHONE_WLAN_VALID_PSEUDONYM;
|
|
5160 |
tUsimWlanDataV8.iReauthenticationId = DMMTSY_PHONE_WLAN_VALID_REAUTHID;
|
|
5161 |
tUsimWlanDataV8.iMasterKey = DMMTSY_PHONE_WLAN_VALID_MASTERKEY;
|
|
5162 |
tUsimWlanDataV8.iCounter = DMMTSY_PHONE_WLAN_VALID_COUNTER;
|
|
5163 |
|
|
5164 |
INFO_PRINTF1(_L("Test - RMobilePhone::SetWlanData async"));
|
|
5165 |
|
|
5166 |
aPhone.SetWlanData(aReqStatus,tUsimWlanDataV8Pckgd);
|
|
5167 |
User::WaitForRequest(aReqStatus);
|
|
5168 |
TEST(aReqStatus.Int() == KErrNone);
|
|
5169 |
|
|
5170 |
tUsimWlanDataV8.iFieldsUsed = DMMTSY_PHONE_WLAN_LIST_DATA_FLAGS;
|
|
5171 |
tUsimWlanDataV8.iPseudonym = DMMTSY_PHONE_WLAN_INVALID_PSEUDONYM;
|
|
5172 |
tUsimWlanDataV8.iReauthenticationId = DMMTSY_PHONE_WLAN_INVALID_REAUTHID;
|
|
5173 |
tUsimWlanDataV8.iMasterKey = DMMTSY_PHONE_WLAN_INVALID_MASTERKEY;
|
|
5174 |
tUsimWlanDataV8.iCounter = DMMTSY_PHONE_WLAN_INVALID_COUNTER;
|
|
5175 |
|
|
5176 |
aPhone.SetWlanData(aReqStatus,tUsimWlanDataV8Pckgd);
|
|
5177 |
User::WaitForRequest(aReqStatus);
|
|
5178 |
TEST(aReqStatus.Int() == KErrCorrupt);
|
|
5179 |
|
|
5180 |
tUsimWlanDataV8.iFieldsUsed = DMMTSY_PHONE_WLAN_LIST_DATA_FLAGS;
|
|
5181 |
tUsimWlanDataV8.iPseudonym = DMMTSY_PHONE_WLAN_VALID_PSEUDONYM;
|
|
5182 |
tUsimWlanDataV8.iReauthenticationId = DMMTSY_PHONE_WLAN_VALID_REAUTHID;
|
|
5183 |
tUsimWlanDataV8.iMasterKey = DMMTSY_PHONE_WLAN_VALID_MASTERKEY;
|
|
5184 |
tUsimWlanDataV8.iCounter = DMMTSY_PHONE_WLAN_VALID_COUNTER;
|
|
5185 |
|
|
5186 |
aPhone.SetWlanData(aReqStatus,tUsimWlanDataV8Pckgd);
|
|
5187 |
aPhone.CancelAsyncRequest(EMobilePhoneSetWlanData);
|
|
5188 |
User::WaitForRequest(aReqStatus);
|
|
5189 |
TEST((aReqStatus.Int() == KErrNone) || (aReqStatus.Int() == KErrCancel));
|
|
5190 |
|
|
5191 |
if (aReqStatus.Int()==KErrCancel)
|
|
5192 |
{
|
|
5193 |
INFO_PRINTF1(_L("Test - RMobilePhone::SetWlanData (async & cancel (Cancelled Request)) passed"));
|
|
5194 |
}
|
|
5195 |
else
|
|
5196 |
{
|
|
5197 |
INFO_PRINTF1(_L("Test - RMobilePhone::SetWlanData (async & cancel (Request Not Cancelled)) passed"));
|
|
5198 |
}
|
|
5199 |
|
|
5200 |
INFO_PRINTF1(_L("Test - RMobilePhone::GetWlanData async"));
|
|
5201 |
|
|
5202 |
aPhone.GetWlanData(aReqStatus,tUsimWlanDataV8Pckgd);
|
|
5203 |
User::WaitForRequest(aReqStatus);
|
|
5204 |
TEST(aReqStatus.Int() == KErrNone);
|
|
5205 |
|
|
5206 |
TEST(tUsimWlanDataV8.iFieldsUsed == DMMTSY_PHONE_WLAN_LIST_DATA_FLAGS);
|
|
5207 |
TEST(tUsimWlanDataV8.iPseudonym == DMMTSY_PHONE_WLAN_VALID_PSEUDONYM);
|
|
5208 |
TEST(tUsimWlanDataV8.iReauthenticationId == DMMTSY_PHONE_WLAN_VALID_REAUTHID);
|
|
5209 |
TEST(tUsimWlanDataV8.iMasterKey == DMMTSY_PHONE_WLAN_VALID_MASTERKEY);
|
|
5210 |
TEST(tUsimWlanDataV8.iCounter == DMMTSY_PHONE_WLAN_VALID_COUNTER);
|
|
5211 |
|
|
5212 |
aPhone.GetWlanData(aReqStatus,tUsimWlanDataV8Pckgd);
|
|
5213 |
aPhone.CancelAsyncRequest(EMobilePhoneGetWlanData);
|
|
5214 |
User::WaitForRequest(aReqStatus);
|
|
5215 |
TEST((aReqStatus.Int() == KErrNone)|| (aReqStatus.Int() == KErrCancel));
|
|
5216 |
|
|
5217 |
if (aReqStatus.Int()==KErrCancel)
|
|
5218 |
{
|
|
5219 |
INFO_PRINTF1(_L("Test - RMobilePhone::GetWlanData (async & cancel (Cancelled Request)) passed"));
|
|
5220 |
}
|
|
5221 |
else
|
|
5222 |
{
|
|
5223 |
INFO_PRINTF1(_L("Test - RMobilePhone::GetWlanData (async & cancel (Request Not Cancelled)) passed"));
|
|
5224 |
}
|
|
5225 |
|
|
5226 |
INFO_PRINTF1(_L("Test - RMobilePhone::NotifyWlanDataChange async"));
|
|
5227 |
|
|
5228 |
aPhone.NotifyWlanDataChange(aReqStatus,tUsimWlanDataV8Pckgd);
|
|
5229 |
User::WaitForRequest(aReqStatus);
|
|
5230 |
TEST(aReqStatus.Int() == KErrNone);
|
|
5231 |
|
|
5232 |
TEST(tUsimWlanDataV8.iFieldsUsed == DMMTSY_PHONE_WLAN_LIST_DATA_FLAGS);
|
|
5233 |
TEST(tUsimWlanDataV8.iPseudonym == DMMTSY_PHONE_WLAN_VALID_PSEUDONYM);
|
|
5234 |
TEST(tUsimWlanDataV8.iReauthenticationId == DMMTSY_PHONE_WLAN_VALID_REAUTHID);
|
|
5235 |
TEST(tUsimWlanDataV8.iMasterKey == DMMTSY_PHONE_WLAN_VALID_MASTERKEY);
|
|
5236 |
TEST(tUsimWlanDataV8.iCounter == DMMTSY_PHONE_WLAN_VALID_COUNTER);
|
|
5237 |
|
|
5238 |
aPhone.NotifyWlanDataChange(aReqStatus,tUsimWlanDataV8Pckgd);
|
|
5239 |
aPhone.CancelAsyncRequest(EMobilePhoneNotifyWlanDataChange);
|
|
5240 |
User::WaitForRequest(aReqStatus);
|
|
5241 |
TEST((aReqStatus.Int() == KErrNone) || (aReqStatus.Int() == KErrCancel));
|
|
5242 |
|
|
5243 |
if (aReqStatus.Int()==KErrCancel)
|
|
5244 |
{
|
|
5245 |
INFO_PRINTF1(_L("Test - RMobilePhone::NotifyWlanDataChange (async & cancel (Cancelled Request)) passed"));
|
|
5246 |
}
|
|
5247 |
else
|
|
5248 |
{
|
|
5249 |
INFO_PRINTF1(_L("Test - RMobilePhone::NotifyWlanDataChange (async & cancel (Request Not Cancelled)) passed"));
|
|
5250 |
}
|
|
5251 |
|
|
5252 |
CTestRetrieveMobilePhonePreferredWlanSIDs *pRetrieve = CTestRetrieveMobilePhonePreferredWlanSIDs::NewLC(aPhone,this);
|
|
5253 |
TBool startReqd = ETrue;
|
|
5254 |
/* To test the 2 phase retrieval of CRetrieveMobilePhonePreferredWlanSIDs */
|
|
5255 |
pRetrieve->TestRetrieve(startReqd);
|
|
5256 |
//Delete test object and start afresh
|
|
5257 |
CleanupStack::PopAndDestroy(); //pRetrieve
|
|
5258 |
|
|
5259 |
/* To test the cancellation of 2 phase retrieval of CRetrieveMobilePhonePreferredWlanSIDs */
|
|
5260 |
pRetrieve = CTestRetrieveMobilePhonePreferredWlanSIDs::NewLC(aPhone,this);
|
|
5261 |
pRetrieve->TestRetrieve(startReqd);
|
|
5262 |
pRetrieve->TestCancel();
|
|
5263 |
//Delete test object and start afresh
|
|
5264 |
CleanupStack::PopAndDestroy(); //pRetrieve
|
|
5265 |
|
|
5266 |
RMobilePhone::TWlanSIDV8 tWlanSIDV8_1;
|
|
5267 |
RMobilePhone::TWlanSIDV8 tWlanSIDV8_2;
|
|
5268 |
RMobilePhone::TWlanSIDV8 tWlanSIDV8_3;
|
|
5269 |
|
|
5270 |
CMobilePhoneStoredWlanSIDList* wlanSIDlist;
|
|
5271 |
wlanSIDlist = CMobilePhoneStoredWlanSIDList::NewL();
|
|
5272 |
CleanupStack::PushL(wlanSIDlist);
|
|
5273 |
|
|
5274 |
tWlanSIDV8_1.iWSID = DMMTSY_PHONE_WLAN_WSID_ONE;
|
|
5275 |
tWlanSIDV8_2.iWSID = DMMTSY_PHONE_WLAN_WSID_TWO;
|
|
5276 |
tWlanSIDV8_3.iWSID = DMMTSY_PHONE_WLAN_WSID_THREE;
|
|
5277 |
|
|
5278 |
tWlanSIDV8_1.iUserDefined = DMMTSY_PHONE_WLAN_USERDEFD_ONE;
|
|
5279 |
tWlanSIDV8_2.iUserDefined = DMMTSY_PHONE_WLAN_USERDEFD_TWO;
|
|
5280 |
tWlanSIDV8_3.iUserDefined = DMMTSY_PHONE_WLAN_USERDEFD_THREE;
|
|
5281 |
|
|
5282 |
wlanSIDlist->AddEntryL(tWlanSIDV8_1);
|
|
5283 |
wlanSIDlist->AddEntryL(tWlanSIDV8_2);
|
|
5284 |
wlanSIDlist->AddEntryL(tWlanSIDV8_3);
|
|
5285 |
|
|
5286 |
aPhone.StorePreferredWlanSIDListL(aReqStatus,wlanSIDlist);
|
|
5287 |
User::WaitForRequest(aReqStatus);
|
|
5288 |
TEST(aReqStatus.Int() == KErrNone);
|
|
5289 |
CleanupStack::PopAndDestroy();
|
|
5290 |
|
|
5291 |
wlanSIDlist = CMobilePhoneStoredWlanSIDList::NewL();
|
|
5292 |
CleanupStack::PushL(wlanSIDlist);
|
|
5293 |
|
|
5294 |
tWlanSIDV8_1.iWSID = DMMTSY_PHONE_WLAN_INVALID_WSID_ONE;
|
|
5295 |
tWlanSIDV8_2.iWSID = DMMTSY_PHONE_WLAN_INVALID_WSID_TWO;
|
|
5296 |
tWlanSIDV8_3.iWSID = DMMTSY_PHONE_WLAN_INVALID_WSID_THREE;
|
|
5297 |
|
|
5298 |
tWlanSIDV8_1.iUserDefined = DMMTSY_PHONE_WLAN_USERDEFD_THREE;
|
|
5299 |
tWlanSIDV8_2.iUserDefined = DMMTSY_PHONE_WLAN_USERDEFD_TWO;
|
|
5300 |
tWlanSIDV8_3.iUserDefined = DMMTSY_PHONE_WLAN_USERDEFD_ONE;
|
|
5301 |
|
|
5302 |
wlanSIDlist->AddEntryL(tWlanSIDV8_1);
|
|
5303 |
wlanSIDlist->AddEntryL(tWlanSIDV8_2);
|
|
5304 |
wlanSIDlist->InsertEntryL(1,tWlanSIDV8_3); // Insert at position=1
|
|
5305 |
wlanSIDlist->DeleteEntryL(2); // delete the last userdefined entry.
|
|
5306 |
wlanSIDlist->AddEntryL(tWlanSIDV8_2); // add the deleted entry again
|
|
5307 |
|
|
5308 |
INFO_PRINTF1(_L("Test - RMobilePhone::StorePreferredWlanSIDListL async"));
|
|
5309 |
|
|
5310 |
aPhone.StorePreferredWlanSIDListL(aReqStatus,wlanSIDlist);
|
|
5311 |
User::WaitForRequest(aReqStatus);
|
|
5312 |
TEST(aReqStatus.Int() == KErrCorrupt);
|
|
5313 |
CleanupStack::PopAndDestroy();
|
|
5314 |
|
|
5315 |
wlanSIDlist = CMobilePhoneStoredWlanSIDList::NewL();
|
|
5316 |
CleanupStack::PushL(wlanSIDlist);
|
|
5317 |
|
|
5318 |
tWlanSIDV8_1.iWSID = DMMTSY_PHONE_WLAN_WSID_ONE;
|
|
5319 |
tWlanSIDV8_2.iWSID = DMMTSY_PHONE_WLAN_WSID_TWO;
|
|
5320 |
tWlanSIDV8_3.iWSID = DMMTSY_PHONE_WLAN_WSID_THREE;
|
|
5321 |
|
|
5322 |
tWlanSIDV8_1.iUserDefined = DMMTSY_PHONE_WLAN_USERDEFD_ONE;
|
|
5323 |
tWlanSIDV8_2.iUserDefined = DMMTSY_PHONE_WLAN_USERDEFD_TWO;
|
|
5324 |
tWlanSIDV8_3.iUserDefined = DMMTSY_PHONE_WLAN_USERDEFD_THREE;
|
|
5325 |
|
|
5326 |
wlanSIDlist->AddEntryL(tWlanSIDV8_1);
|
|
5327 |
wlanSIDlist->AddEntryL(tWlanSIDV8_2);
|
|
5328 |
wlanSIDlist->AddEntryL(tWlanSIDV8_3);
|
|
5329 |
|
|
5330 |
aPhone.StorePreferredWlanSIDListL(aReqStatus,wlanSIDlist);
|
|
5331 |
aPhone.CancelAsyncRequest(EMobilePhoneStorePreferredWlanSIDList );
|
|
5332 |
User::WaitForRequest(aReqStatus);
|
|
5333 |
TEST((aReqStatus.Int() == KErrNone) || (aReqStatus.Int() == KErrCancel));
|
|
5334 |
|
|
5335 |
CleanupStack::PopAndDestroy();
|
|
5336 |
|
|
5337 |
INFO_PRINTF1(_L("Test - RMobilePhone::NotifyPreferredWlanSIDListChange async"));
|
|
5338 |
|
|
5339 |
aPhone.NotifyPreferredWlanSIDListChange(aReqStatus);
|
|
5340 |
User::WaitForRequest(aReqStatus);
|
|
5341 |
TEST(aReqStatus.Int() == KErrNone);
|
|
5342 |
|
|
5343 |
aPhone.NotifyPreferredWlanSIDListChange(aReqStatus);
|
|
5344 |
aPhone.CancelAsyncRequest(EMobilePhoneNotifyPreferredWlanSIDListChange);
|
|
5345 |
User::WaitForRequest(aReqStatus);
|
|
5346 |
TEST((aReqStatus.Int() == KErrNone) || (aReqStatus.Int() == KErrCancel));
|
|
5347 |
if (aReqStatus.Int()==KErrCancel)
|
|
5348 |
{
|
|
5349 |
INFO_PRINTF1(_L("Test - RMobilePhone::NotifyPreferredWlanSIDListChange (async & cancel (Cancelled Request)) passed"));
|
|
5350 |
}
|
|
5351 |
else
|
|
5352 |
{
|
|
5353 |
INFO_PRINTF1(_L("Test - RMobilePhone::NotifyPreferredWlanSIDListChange (async & cancel (Request Not Cancelled)) passed"));
|
|
5354 |
}
|
|
5355 |
}
|
|
5356 |
|
|
5357 |
void CTestPhone::ValidatePhoneStoreInfo(const RMobilePhoneStore::TMobilePhoneStoreInfoV1 &aSyncStoreInfo, TInt aSlot)
|
|
5358 |
{
|
|
5359 |
TEST(aSlot == 0 || aSlot == 1);
|
|
5360 |
switch(aSlot)
|
|
5361 |
{
|
|
5362 |
case 0:
|
|
5363 |
{
|
|
5364 |
TEST(aSyncStoreInfo.iName==DMMTSY_PHONE_STORE_NAME1);
|
|
5365 |
TEST(aSyncStoreInfo.iType==DMMTSY_PHONE_STORE_TYPE1);
|
|
5366 |
TEST(aSyncStoreInfo.iTotalEntries==DMMTSY_PHONE_STORE_TOTAL_ENTRIES1);
|
|
5367 |
TEST(aSyncStoreInfo.iUsedEntries==DMMTSY_PHONE_STORE_USED_ENTRIES1);
|
|
5368 |
TEST(aSyncStoreInfo.iCaps==DMMTSY_PHONE_STORE_CAPS1);
|
|
5369 |
break;
|
|
5370 |
}
|
|
5371 |
case 1:
|
|
5372 |
{
|
|
5373 |
TEST(aSyncStoreInfo.iName==DMMTSY_PHONE_STORE_NAME2);
|
|
5374 |
TEST(aSyncStoreInfo.iType==DMMTSY_PHONE_STORE_TYPE2);
|
|
5375 |
TEST(aSyncStoreInfo.iTotalEntries==DMMTSY_PHONE_STORE_TOTAL_ENTRIES2);
|
|
5376 |
TEST(aSyncStoreInfo.iUsedEntries==DMMTSY_PHONE_STORE_USED_ENTRIES2);
|
|
5377 |
TEST(aSyncStoreInfo.iCaps==DMMTSY_PHONE_STORE_CAPS2);
|
|
5378 |
break;
|
|
5379 |
}
|
|
5380 |
default:
|
|
5381 |
// Incorrect number of phone stores - flag error
|
|
5382 |
break;
|
|
5383 |
}
|
|
5384 |
}
|
|
5385 |
|
|
5386 |
void CTestPhone::ValidateCustomerServiceProfile(const RMobilePhone::TMobilePhoneCspFileV1 &aSyncCspFile)
|
|
5387 |
{
|
|
5388 |
TEST(aSyncCspFile.iCallOfferingServices==DMMTSY_PHONE_CSP_BYTE1);
|
|
5389 |
TEST(aSyncCspFile.iCallRestrictionServices==DMMTSY_PHONE_CSP_BYTE2);
|
|
5390 |
TEST(aSyncCspFile.iOtherSuppServices==DMMTSY_PHONE_CSP_BYTE3);
|
|
5391 |
TEST(aSyncCspFile.iCallCompletionServices==DMMTSY_PHONE_CSP_BYTE4);
|
|
5392 |
TEST(aSyncCspFile.iTeleservices==DMMTSY_PHONE_CSP_BYTE5);
|
|
5393 |
TEST(aSyncCspFile.iCphsTeleservices==DMMTSY_PHONE_CSP_BYTE6);
|
|
5394 |
TEST(aSyncCspFile.iCphsFeatures==DMMTSY_PHONE_CSP_BYTE7);
|
|
5395 |
TEST(aSyncCspFile.iNumberIdentServices==DMMTSY_PHONE_CSP_BYTE8);
|
|
5396 |
TEST(aSyncCspFile.iPhase2PlusServices==DMMTSY_PHONE_CSP_BYTE9);
|
|
5397 |
TEST(aSyncCspFile.iValueAddedServices==DMMTSY_PHONE_CSP_BYTE10);
|
|
5398 |
}
|
|
5399 |
|
|
5400 |
void CTestPhone::ValidateServiceTable(const RMobilePhone::TMobilePhoneServiceTableV1 &aSyncServiceTable)
|
|
5401 |
{
|
|
5402 |
TEST(aSyncServiceTable.iServices1To8==DMMTSY_PHONE_SST_BYTE1);
|
|
5403 |
TEST(aSyncServiceTable.iServices9To16==DMMTSY_PHONE_SST_BYTE2);
|
|
5404 |
TEST(aSyncServiceTable.iServices17To24==DMMTSY_PHONE_SST_BYTE3);
|
|
5405 |
TEST(aSyncServiceTable.iServices25To32==DMMTSY_PHONE_SST_BYTE4);
|
|
5406 |
TEST(aSyncServiceTable.iServices33To40==DMMTSY_PHONE_SST_BYTE5);
|
|
5407 |
TEST(aSyncServiceTable.iServices41To48==DMMTSY_PHONE_SST_BYTE6);
|
|
5408 |
TEST(aSyncServiceTable.iServices49To56==DMMTSY_PHONE_SST_BYTE7);
|
|
5409 |
}
|
|
5410 |
|
|
5411 |
void CTestPhone::ValidateServiceTable(const RMobilePhone::TMobilePhoneServiceTableV2 &aSyncServiceTable)
|
|
5412 |
{
|
|
5413 |
TEST(aSyncServiceTable.iServices1To8==DMMTSY_PHONE_SST_BYTE1);
|
|
5414 |
TEST(aSyncServiceTable.iServices9To16==DMMTSY_PHONE_SST_BYTE2);
|
|
5415 |
TEST(aSyncServiceTable.iServices17To24==DMMTSY_PHONE_SST_BYTE3);
|
|
5416 |
TEST(aSyncServiceTable.iServices25To32==DMMTSY_PHONE_SST_BYTE4);
|
|
5417 |
TEST(aSyncServiceTable.iServices33To40==DMMTSY_PHONE_SST_BYTE5);
|
|
5418 |
TEST(aSyncServiceTable.iServices41To48==DMMTSY_PHONE_SST_BYTE6);
|
|
5419 |
TEST(aSyncServiceTable.iServices49To56==DMMTSY_PHONE_SST_BYTE7);
|
|
5420 |
TEST(aSyncServiceTable.iAID==DMMTSY_PHONE_USIM_AID);
|
|
5421 |
}
|
|
5422 |
|
|
5423 |
void CTestPhone::ValidatePhoneId(const RMobilePhone::TMobilePhoneIdentityV1 &aSyncPhoneId)
|
|
5424 |
{
|
|
5425 |
TEST(aSyncPhoneId.iManufacturer.Compare(DMMTSY_PHONE_MANUFACTURER)==0);
|
|
5426 |
TEST(aSyncPhoneId.iModel.Compare(DMMTSY_PHONE_MODEL)==0);
|
|
5427 |
TEST(aSyncPhoneId.iRevision.Compare(DMMTSY_PHONE_REVISION)==0);
|
|
5428 |
TEST(aSyncPhoneId.iSerialNumber.Compare(DMMTSY_PHONE_SERIAL_NUMBER)==0);
|
|
5429 |
}
|
|
5430 |
|
|
5431 |
|
|
5432 |
void CTestPhone::ValidateHomeNetwork(const RMobilePhone::TMobilePhoneNetworkInfoV1 &aSyncHomeNetwork)
|
|
5433 |
{
|
|
5434 |
TEST(aSyncHomeNetwork.iMode==DMMTSY_PHONE_HOME_NETWORK_MODE);
|
|
5435 |
TEST(aSyncHomeNetwork.iStatus==DMMTSY_PHONE_HOME_NETWORK_STATUS);
|
|
5436 |
TEST(aSyncHomeNetwork.iBandInfo==DMMTSY_PHONE_HOME_NETWORK_BAND);
|
|
5437 |
TEST(aSyncHomeNetwork.iCountryCode.Compare(DMMTSY_PHONE_HOME_NETWORK_MCC) == 0);
|
|
5438 |
TEST(aSyncHomeNetwork.iNetworkId.Compare(DMMTSY_PHONE_HOME_NETWORK_ID) == 0);
|
|
5439 |
TEST(aSyncHomeNetwork.iCdmaSID.Compare(DMMTSY_PHONE_HOME_NETWORK_SID) == 0);
|
|
5440 |
TEST(aSyncHomeNetwork.iAnalogSID.Compare(DMMTSY_PHONE_HOME_NETWORK_SID) == 0);
|
|
5441 |
TEST(aSyncHomeNetwork.iDisplayTag.Compare(DMMTSY_PHONE_HOME_NETWORK_TAG)==0);
|
|
5442 |
TEST(aSyncHomeNetwork.iShortName.Compare(DMMTSY_PHONE_HOME_NETWORK_SHORT_NAME)==0);
|
|
5443 |
TEST(aSyncHomeNetwork.iLongName.Compare(DMMTSY_PHONE_HOME_NETWORK_LONG_NAME)==0);
|
|
5444 |
}
|
|
5445 |
|
|
5446 |
void CTestPhone::ValidateCurrentNetwork(const RMobilePhone::TMobilePhoneNetworkInfoV1 &aSyncCurrentNetwork,
|
|
5447 |
const RMobilePhone::TMobilePhoneLocationAreaV1 &aSyncLocArea, TBool aValidateArea)
|
|
5448 |
{
|
|
5449 |
TEST(aSyncCurrentNetwork.iMode==DMMTSY_PHONE_CURRENT_NETWORK_MODE1);
|
|
5450 |
TEST(aSyncCurrentNetwork.iStatus==DMMTSY_PHONE_CURRENT_NETWORK_STATUS1);
|
|
5451 |
TEST(aSyncCurrentNetwork.iBandInfo==DMMTSY_PHONE_CURRENT_NETWORK_BAND1);
|
|
5452 |
TEST(aSyncCurrentNetwork.iCountryCode.Compare(DMMTSY_PHONE_CURRENT_NETWORK_MCC1) == 0);
|
|
5453 |
TEST(aSyncCurrentNetwork.iNetworkId.Compare(DMMTSY_PHONE_CURRENT_NETWORK_ID1)==0);
|
|
5454 |
TEST(aSyncCurrentNetwork.iCdmaSID.Compare(DMMTSY_PHONE_CURRENT_NETWORK_SID)==0);
|
|
5455 |
TEST(aSyncCurrentNetwork.iAnalogSID.Compare(DMMTSY_PHONE_CURRENT_NETWORK_SID)==0);
|
|
5456 |
TEST(aSyncCurrentNetwork.iDisplayTag.Compare(DMMTSY_PHONE_CURRENT_NETWORK_TAG1)==0);
|
|
5457 |
TEST(aSyncCurrentNetwork.iShortName.Compare(DMMTSY_PHONE_CURRENT_NETWORK_SHORT_NAME1)==0);
|
|
5458 |
TEST(aSyncCurrentNetwork.iLongName.Compare(DMMTSY_PHONE_CURRENT_NETWORK_LONG_NAME1)==0);
|
|
5459 |
|
|
5460 |
if(aValidateArea)
|
|
5461 |
{
|
|
5462 |
TEST(aSyncLocArea.iAreaKnown==DMMTSY_PHONE_CURRENT_NETWORK_AREAKNOWN);
|
|
5463 |
TEST(aSyncLocArea.iLocationAreaCode==DMMTSY_PHONE_CURRENT_NETWORK_LAC1);
|
|
5464 |
TEST(aSyncLocArea.iCellId==DMMTSY_PHONE_CURRENT_NETWORK_CELLID1);
|
|
5465 |
}
|
|
5466 |
|
|
5467 |
}
|
|
5468 |
|
|
5469 |
void CTestPhone::ValidateCurrentNetworkforHSUPA(const RMobilePhone::TMobilePhoneNetworkInfoV8 &aSyncCurrentNetwork,
|
|
5470 |
const RMobilePhone::TMobilePhoneLocationAreaV1 &aSyncLocArea)
|
|
5471 |
{
|
|
5472 |
TEST(aSyncCurrentNetwork.iMode==DMMTSY_PHONE_CURRENT_NETWORK_MODE1);
|
|
5473 |
TEST(aSyncCurrentNetwork.iStatus==DMMTSY_PHONE_CURRENT_NETWORK_STATUS1);
|
|
5474 |
TEST(aSyncCurrentNetwork.iBandInfo==DMMTSY_PHONE_CURRENT_NETWORK_BAND1);
|
|
5475 |
TEST(aSyncCurrentNetwork.iCountryCode.Compare(DMMTSY_PHONE_CURRENT_NETWORK_MCC1) == 0);
|
|
5476 |
TEST(aSyncCurrentNetwork.iNetworkId.Compare(DMMTSY_PHONE_CURRENT_NETWORK_ID1)==0);
|
|
5477 |
TEST(aSyncCurrentNetwork.iCdmaSID.Compare(DMMTSY_PHONE_CURRENT_NETWORK_SID)==0);
|
|
5478 |
TEST(aSyncCurrentNetwork.iAnalogSID.Compare(DMMTSY_PHONE_CURRENT_NETWORK_SID)==0);
|
|
5479 |
TEST(aSyncCurrentNetwork.iDisplayTag.Compare(DMMTSY_PHONE_CURRENT_NETWORK_TAG1)==0);
|
|
5480 |
TEST(aSyncCurrentNetwork.iShortName.Compare(DMMTSY_PHONE_CURRENT_NETWORK_SHORT_NAME1)==0);
|
|
5481 |
TEST(aSyncCurrentNetwork.iLongName.Compare(DMMTSY_PHONE_CURRENT_NETWORK_LONG_NAME1)==0);
|
|
5482 |
|
|
5483 |
TEST(aSyncCurrentNetwork.iAccess==DMMTSY_PHONE_CURRENT_NETWORK_ACCESS_TECH1);
|
|
5484 |
TEST(aSyncCurrentNetwork.iHsdpaAvailableIndicator==DMMTSY_PHONE_CURRENT_NETWORK_HSDPA_AVAILABILITY1);
|
|
5485 |
TEST(aSyncCurrentNetwork.iEgprsAvailableIndicator==DMMTSY_PHONE_CURRENT_NETWORK_EGPRS_AVAILABILITY1);
|
|
5486 |
TEST(aSyncCurrentNetwork.iHsupaAvailableIndicator==DMMTSY_PHONE_CURRENT_NETWORK_HSUPA_AVAILABILITY1);
|
|
5487 |
|
|
5488 |
(void)aSyncLocArea; // to avoid compilation warnings
|
|
5489 |
|
|
5490 |
}
|
|
5491 |
|
|
5492 |
void CTestPhone::ValidateHomeNetworkforHSUPA(const RMobilePhone::TMobilePhoneNetworkInfoV8 &aSyncHomeNetwork)
|
|
5493 |
{
|
|
5494 |
TEST(aSyncHomeNetwork.iMode==DMMTSY_PHONE_HOME_NETWORK_MODE);
|
|
5495 |
TEST(aSyncHomeNetwork.iStatus==DMMTSY_PHONE_HOME_NETWORK_STATUS);
|
|
5496 |
TEST(aSyncHomeNetwork.iBandInfo==DMMTSY_PHONE_HOME_NETWORK_BAND);
|
|
5497 |
TEST(aSyncHomeNetwork.iCountryCode.Compare(DMMTSY_PHONE_HOME_NETWORK_MCC) == 0);
|
|
5498 |
TEST(aSyncHomeNetwork.iNetworkId.Compare(DMMTSY_PHONE_HOME_NETWORK_ID) == 0);
|
|
5499 |
TEST(aSyncHomeNetwork.iCdmaSID.Compare(DMMTSY_PHONE_HOME_NETWORK_SID) == 0);
|
|
5500 |
TEST(aSyncHomeNetwork.iAnalogSID.Compare(DMMTSY_PHONE_HOME_NETWORK_SID) == 0);
|
|
5501 |
TEST(aSyncHomeNetwork.iDisplayTag.Compare(DMMTSY_PHONE_HOME_NETWORK_TAG)==0);
|
|
5502 |
TEST(aSyncHomeNetwork.iShortName.Compare(DMMTSY_PHONE_HOME_NETWORK_SHORT_NAME)==0);
|
|
5503 |
TEST(aSyncHomeNetwork.iLongName.Compare(DMMTSY_PHONE_HOME_NETWORK_LONG_NAME)==0);
|
|
5504 |
|
|
5505 |
TEST(aSyncHomeNetwork.iAccess==DMMTSY_PHONE_HOME_NETWORK_ACCESS_TECH);
|
|
5506 |
TEST(aSyncHomeNetwork.iHsdpaAvailableIndicator==DMMTSY_PHONE_HOME_NETWORK_HSDPA_AVAILABILITY);
|
|
5507 |
TEST(aSyncHomeNetwork.iEgprsAvailableIndicator==DMMTSY_PHONE_HOME_NETWORK_EGPRS_AVAILABILITY);
|
|
5508 |
TEST(aSyncHomeNetwork.iHsupaAvailableIndicator==DMMTSY_PHONE_HOME_NETWORK_HSUPA_AVAILABILITY);
|
|
5509 |
|
|
5510 |
}
|
|
5511 |
|
|
5512 |
void CTestPhone::ValidateNotifyCurrentNetworkChangeforHSUPA(const RMobilePhone::TMobilePhoneNetworkInfoV8 &aSyncCurrentNetwork,const RMobilePhone::TMobilePhoneLocationAreaV1 &aSyncLocArea)
|
|
5513 |
|
|
5514 |
{
|
|
5515 |
TEST(aSyncCurrentNetwork.iMode==DMMTSY_PHONE_CURRENT_NETWORK_MODE2);
|
|
5516 |
TEST(aSyncCurrentNetwork.iStatus==DMMTSY_PHONE_CURRENT_NETWORK_STATUS2);
|
|
5517 |
TEST(aSyncCurrentNetwork.iBandInfo==DMMTSY_PHONE_CURRENT_NETWORK_BAND2);
|
|
5518 |
TEST(aSyncCurrentNetwork.iCountryCode.Compare(DMMTSY_PHONE_CURRENT_NETWORK_MCC2) == 0);
|
|
5519 |
TEST(aSyncCurrentNetwork.iNetworkId.Compare(DMMTSY_PHONE_CURRENT_NETWORK_ID2) == 0);
|
|
5520 |
TEST(aSyncCurrentNetwork.iDisplayTag.Compare(DMMTSY_PHONE_CURRENT_NETWORK_TAG2)==0);
|
|
5521 |
TEST(aSyncCurrentNetwork.iShortName.Compare(DMMTSY_PHONE_CURRENT_NETWORK_SHORT_NAME2)==0);
|
|
5522 |
TEST(aSyncCurrentNetwork.iLongName.Compare(DMMTSY_PHONE_CURRENT_NETWORK_LONG_NAME2)==0);
|
|
5523 |
|
|
5524 |
|
|
5525 |
TEST(aSyncCurrentNetwork.iAccess==DMMTSY_PHONE_CURRENT_NETWORK_ACCESS_TECH2);
|
|
5526 |
TEST(aSyncCurrentNetwork.iHsdpaAvailableIndicator==DMMTSY_PHONE_CURRENT_NETWORK_HSDPA_AVAILABILITY2);
|
|
5527 |
TEST(aSyncCurrentNetwork.iEgprsAvailableIndicator==DMMTSY_PHONE_CURRENT_NETWORK_EGPRS_AVAILABILITY2);
|
|
5528 |
TEST(aSyncCurrentNetwork.iHsupaAvailableIndicator==DMMTSY_PHONE_CURRENT_NETWORK_HSUPA_AVAILABILITY2);
|
|
5529 |
|
|
5530 |
(void) aSyncLocArea; // to avoid compilation warnings
|
|
5531 |
|
|
5532 |
}
|
|
5533 |
|
|
5534 |
void CTestPhone::ValidateNotifyCurrentNetworkChange(const RMobilePhone::TMobilePhoneNetworkInfoV1 &aSyncCurrentNetwork,
|
|
5535 |
const RMobilePhone::TMobilePhoneLocationAreaV1 &aSyncLocArea, TBool aValidateArea)
|
|
5536 |
{
|
|
5537 |
TEST(aSyncCurrentNetwork.iMode==DMMTSY_PHONE_CURRENT_NETWORK_MODE2);
|
|
5538 |
TEST(aSyncCurrentNetwork.iStatus==DMMTSY_PHONE_CURRENT_NETWORK_STATUS2);
|
|
5539 |
TEST(aSyncCurrentNetwork.iBandInfo==DMMTSY_PHONE_CURRENT_NETWORK_BAND2);
|
|
5540 |
TEST(aSyncCurrentNetwork.iCountryCode.Compare(DMMTSY_PHONE_CURRENT_NETWORK_MCC2) == 0);
|
|
5541 |
TEST(aSyncCurrentNetwork.iNetworkId.Compare(DMMTSY_PHONE_CURRENT_NETWORK_ID2) == 0);
|
|
5542 |
TEST(aSyncCurrentNetwork.iDisplayTag.Compare(DMMTSY_PHONE_CURRENT_NETWORK_TAG2)==0);
|
|
5543 |
TEST(aSyncCurrentNetwork.iShortName.Compare(DMMTSY_PHONE_CURRENT_NETWORK_SHORT_NAME2)==0);
|
|
5544 |
TEST(aSyncCurrentNetwork.iLongName.Compare(DMMTSY_PHONE_CURRENT_NETWORK_LONG_NAME2)==0);
|
|
5545 |
|
|
5546 |
if(aValidateArea)
|
|
5547 |
{
|
|
5548 |
TEST(aSyncLocArea.iAreaKnown==DMMTSY_PHONE_CURRENT_NETWORK_AREAKNOWN);
|
|
5549 |
TEST(aSyncLocArea.iLocationAreaCode==DMMTSY_PHONE_CURRENT_NETWORK_LAC2);
|
|
5550 |
TEST(aSyncLocArea.iCellId==DMMTSY_PHONE_CURRENT_NETWORK_CELLID2);
|
|
5551 |
}
|
|
5552 |
}
|
|
5553 |
|
|
5554 |
void CTestPhone::ValidateCurrentNetworkISV(const RMobilePhone::TEtel3rdPartyMobileNetworkInfoV1 &aSyncCurrentNetworkISV,
|
|
5555 |
const RMobilePhone::TMobilePhoneLocationAreaV1 &aSyncLocArea)
|
|
5556 |
{
|
|
5557 |
TEST(aSyncCurrentNetworkISV.iMode==DMMTSY_PHONE_CURRENT_NETWORK_MODE_ISV);
|
|
5558 |
TEST(aSyncCurrentNetworkISV.iStatus==DMMTSY_PHONE_CURRENT_NETWORK_STATUS_ISV);
|
|
5559 |
TEST(aSyncCurrentNetworkISV.iBandInfo==DMMTSY_PHONE_CURRENT_NETWORK_BAND_ISV);
|
|
5560 |
TEST(aSyncCurrentNetworkISV.iCountryCode.Compare(DMMTSY_PHONE_CURRENT_NETWORK_MCC_ISV) == 0);
|
|
5561 |
TEST(aSyncCurrentNetworkISV.iNetworkId.Compare(DMMTSY_PHONE_CURRENT_NETWORK_ID_ISV)==0);
|
|
5562 |
TEST(aSyncCurrentNetworkISV.iDisplayTag.Compare(DMMTSY_PHONE_CURRENT_NETWORK_TAG_ISV)==0);
|
|
5563 |
TEST(aSyncCurrentNetworkISV.iShortName.Compare(DMMTSY_PHONE_CURRENT_NETWORK_SHORT_NAME_ISV)==0);
|
|
5564 |
TEST(aSyncCurrentNetworkISV.iLongName.Compare(DMMTSY_PHONE_CURRENT_NETWORK_LONG_NAME_ISV)==0);
|
|
5565 |
|
|
5566 |
TEST(aSyncLocArea.iAreaKnown==DMMTSY_PHONE_CURRENT_NETWORK_AREAKNOWN_ISV);
|
|
5567 |
TEST(aSyncLocArea.iLocationAreaCode==DMMTSY_PHONE_CURRENT_NETWORK_LAC_ISV);
|
|
5568 |
TEST(aSyncLocArea.iCellId==DMMTSY_PHONE_CURRENT_NETWORK_CELLID_ISV);
|
|
5569 |
}
|
|
5570 |
|
|
5571 |
void CTestPhone::ValidateNotifyCurrentNetworkISVChange(const RMobilePhone::TEtel3rdPartyMobileNetworkInfoV1 &aSyncCurrentNetworkISV,
|
|
5572 |
const RMobilePhone::TMobilePhoneLocationAreaV1 &aSyncLocArea)
|
|
5573 |
{
|
|
5574 |
TEST(aSyncCurrentNetworkISV.iMode==DMMTSY_PHONE_CURRENT_NETWORK_MODE_ISV2);
|
|
5575 |
TEST(aSyncCurrentNetworkISV.iStatus==DMMTSY_PHONE_CURRENT_NETWORK_STATUS_ISV2);
|
|
5576 |
TEST(aSyncCurrentNetworkISV.iBandInfo==DMMTSY_PHONE_CURRENT_NETWORK_BAND_ISV2);
|
|
5577 |
TEST(aSyncCurrentNetworkISV.iCountryCode.Compare(DMMTSY_PHONE_CURRENT_NETWORK_MCC_ISV2) == 0);
|
|
5578 |
TEST(aSyncCurrentNetworkISV.iNetworkId.Compare(DMMTSY_PHONE_CURRENT_NETWORK_ID_ISV2)==0);
|
|
5579 |
TEST(aSyncCurrentNetworkISV.iDisplayTag.Compare(DMMTSY_PHONE_CURRENT_NETWORK_TAG_ISV2)==0);
|
|
5580 |
TEST(aSyncCurrentNetworkISV.iShortName.Compare(DMMTSY_PHONE_CURRENT_NETWORK_SHORT_NAME_ISV2)==0);
|
|
5581 |
TEST(aSyncCurrentNetworkISV.iLongName.Compare(DMMTSY_PHONE_CURRENT_NETWORK_LONG_NAME_ISV2)==0);
|
|
5582 |
|
|
5583 |
TEST(aSyncLocArea.iAreaKnown==DMMTSY_PHONE_CURRENT_NETWORK_AREAKNOWN_ISV2);
|
|
5584 |
TEST(aSyncLocArea.iLocationAreaCode==DMMTSY_PHONE_CURRENT_NETWORK_LAC_ISV2);
|
|
5585 |
TEST(aSyncLocArea.iCellId==DMMTSY_PHONE_CURRENT_NETWORK_CELLID_ISV2);
|
|
5586 |
}
|
|
5587 |
|
|
5588 |
|
|
5589 |
void CTestPhone::ValidateNITZInfo(const RMobilePhone::TMobilePhoneNITZ &aDateTime)
|
|
5590 |
{
|
|
5591 |
TEST(aDateTime.iNitzFieldsUsed == DMMTSY_PHONE_NWTINFO_NITZ_USED);
|
|
5592 |
TEST(aDateTime.iTimeZone == DMMTSY_PHONE_NWTINFO_TIMEZONE);
|
|
5593 |
TEST(aDateTime.iLongNetworkId.Compare(DMMTSY_PHONE_NWTINFO_LONG_ID)==0);
|
|
5594 |
TEST(aDateTime.iShortNetworkId.Compare(DMMTSY_PHONE_NWTINFO_SHORT_ID)==0);
|
|
5595 |
TEST(aDateTime.iDST == DMMTSY_PHONE_NWTINFO_DST);
|
|
5596 |
TEST(aDateTime.Year() == DMMTSY_PHONE_NWTINFO_YEAR);
|
|
5597 |
TEST(aDateTime.Month() == DMMTSY_PHONE_NWTINFO_MONTH);
|
|
5598 |
TEST(aDateTime.Day() == DMMTSY_PHONE_NWTINFO_DAY);
|
|
5599 |
TEST(aDateTime.Hour() == DMMTSY_PHONE_NWTINFO_HOUR);
|
|
5600 |
TEST(aDateTime.Minute() == DMMTSY_PHONE_NWTINFO_MINUTE);
|
|
5601 |
TEST(aDateTime.Second() == DMMTSY_PHONE_NWTINFO_SECOND);
|
|
5602 |
TEST(aDateTime.MicroSecond() == DMMTSY_PHONE_NWTINFO_MICRO);
|
|
5603 |
}
|
|
5604 |
|
|
5605 |
void CTestPhone::ValidateSPName(const RMobilePhone::TMobilePhoneServiceProviderNameV2 &aName)
|
|
5606 |
{
|
|
5607 |
TEST(aName.iDisplayReq == DMMTSY_PHONE_DISPREQ);
|
|
5608 |
TEST(aName.iSPName.Compare(DMMTSY_PHONE_SPN_NAME) == 0);
|
|
5609 |
TEST(aName.iPLMNField.Compare(DMMTSY_PHONE_PLMN_FIELD) == 0);
|
|
5610 |
}
|
|
5611 |
|
|
5612 |
void CTestPhone::ValidateCostInfo(const RMobilePhone::TMobilePhoneCostInfoV1 &aInfo)
|
|
5613 |
{
|
|
5614 |
TEST(aInfo.iService == DMMTSY_PHONE_COST_SERVICE);
|
|
5615 |
TEST(aInfo.iCCM == DMMTSY_PHONE_COST_CCM);
|
|
5616 |
TEST(aInfo.iACM == DMMTSY_PHONE_COST_ACM);
|
|
5617 |
TEST(aInfo.iACMmax == DMMTSY_PHONE_COST_ACMMAX);
|
|
5618 |
TEST(aInfo.iPuct.iCurrencyName.Compare(DMMTSY_PHONE_COST_PUCT_CNAME) == 0);
|
|
5619 |
TEST(aInfo.iPuct.iPricePerUnit == DMMTSY_PHONE_COST_PUCT_PPU);
|
|
5620 |
}
|
|
5621 |
|
|
5622 |
void CTestPhone::ValidateMulticallParams(const RMobilePhone::TMobilePhoneMulticallSettingsV1 &aSettings, TInt aCount)
|
|
5623 |
{
|
|
5624 |
TEST(aCount == 0 || aCount == 1);
|
|
5625 |
|
|
5626 |
switch(aCount)
|
|
5627 |
{
|
|
5628 |
case 0:
|
|
5629 |
{
|
|
5630 |
TEST(aSettings.iUserMaxBearers == DMMTSY_PHONE_USER_MAX_BEARERS1);
|
|
5631 |
TEST(aSettings.iServiceProviderMaxBearers == DMMTSY_PHONE_PROVIDER_MAX_BEARERS1);
|
|
5632 |
TEST(aSettings.iNetworkSupportedMaxBearers == DMMTSY_PHONE_NETWORK_MAX_BEARERS1);
|
|
5633 |
TEST(aSettings.iUESupportedMaxBearers == DMMTSY_PHONE_UE_MAX_BEARERS1);
|
|
5634 |
break;
|
|
5635 |
}
|
|
5636 |
|
|
5637 |
case 1:
|
|
5638 |
{
|
|
5639 |
TEST(aSettings.iUserMaxBearers == DMMTSY_PHONE_USER_MAX_BEARERS2);
|
|
5640 |
TEST(aSettings.iServiceProviderMaxBearers == DMMTSY_PHONE_PROVIDER_MAX_BEARERS2);
|
|
5641 |
TEST(aSettings.iNetworkSupportedMaxBearers == DMMTSY_PHONE_NETWORK_MAX_BEARERS2);
|
|
5642 |
TEST(aSettings.iUESupportedMaxBearers == DMMTSY_PHONE_UE_MAX_BEARERS2);
|
|
5643 |
break;
|
|
5644 |
}
|
|
5645 |
}
|
|
5646 |
}
|
|
5647 |
|
|
5648 |
void CTestPhone::TestTerminateAllCalls(RMobilePhone& aPhone, TRequestStatus &aReqStatus)
|
|
5649 |
{
|
|
5650 |
//Test asynchronous TerminateAllCalls - just returns KErrNone
|
|
5651 |
|
|
5652 |
aPhone.TerminateAllCalls(aReqStatus);
|
|
5653 |
User::WaitForRequest(aReqStatus);
|
|
5654 |
TEST(aReqStatus.Int()==KErrNone);
|
|
5655 |
|
|
5656 |
//Test asynchronous TerminateAllCalls & Cancel
|
|
5657 |
|
|
5658 |
aPhone.TerminateAllCalls(aReqStatus);
|
|
5659 |
aPhone.CancelAsyncRequest(EMobilePhoneTerminateAllCalls);
|
|
5660 |
User::WaitForRequest(aReqStatus);
|
|
5661 |
TEST(aReqStatus.Int() == KErrCancel);
|
|
5662 |
}
|
|
5663 |
|
|
5664 |
void CTestPhone::TestTerminateActiveCalls(RMobilePhone& aPhone, TRequestStatus &aReqStatus)
|
|
5665 |
{
|
|
5666 |
//Test asynchronous TerminateActiveCalls - just returns KErrNone
|
|
5667 |
|
|
5668 |
aPhone.TerminateActiveCalls(aReqStatus);
|
|
5669 |
User::WaitForRequest(aReqStatus);
|
|
5670 |
TEST(aReqStatus.Int()==KErrNone);
|
|
5671 |
if (KErrNone == aReqStatus.Int())
|
|
5672 |
INFO_PRINTF2(_L("Test %d - RMobilePhone::TerminateActiveCalls (async) passed"), iTestCount++);
|
|
5673 |
else
|
|
5674 |
ERR_PRINTF2(_L("Test %d - RMobilePhone::TerminateActiveCalls (async) failed"), iTestCount++);
|
|
5675 |
//Test asynchronous TerminateActiveCalls & Cancel
|
|
5676 |
|
|
5677 |
aPhone.TerminateActiveCalls(aReqStatus);
|
|
5678 |
aPhone.CancelAsyncRequest(EMobilePhoneTerminateActiveCalls);
|
|
5679 |
User::WaitForRequest(aReqStatus);
|
|
5680 |
TEST(aReqStatus.Int() == KErrCancel);
|
|
5681 |
if (KErrCancel == aReqStatus.Int())
|
|
5682 |
INFO_PRINTF2(_L("Test %d - Cancelation of RMobilePhone::TerminateActiveCalls (async) passed"), iTestCount++);
|
|
5683 |
else
|
|
5684 |
ERR_PRINTF2(_L("Test %d - Cancelation of RMobilePhone::TerminateActiveCalls (async) failed"), iTestCount++);
|
|
5685 |
}
|
|
5686 |
|
|
5687 |
/**************************************************************/
|
|
5688 |
//
|
|
5689 |
// Testing asynchronous retrieve of detected network list
|
|
5690 |
//
|
|
5691 |
/**************************************************************/
|
|
5692 |
|
|
5693 |
CTestPhone::CTestGetDetectedNetworks* CTestPhone::CTestGetDetectedNetworks::NewLC(RMobilePhone& aPhone, CTestPhone* aTestPhone)
|
|
5694 |
{
|
|
5695 |
CTestGetDetectedNetworks* r=new(ELeave) CTestGetDetectedNetworks(aPhone, aTestPhone);
|
|
5696 |
CleanupStack::PushL(r);
|
|
5697 |
r->ConstructL();
|
|
5698 |
return r;
|
|
5699 |
}
|
|
5700 |
|
|
5701 |
CTestPhone::CTestGetDetectedNetworks::CTestGetDetectedNetworks(RMobilePhone& aPhone, CTestPhone* aTestPhone)
|
|
5702 |
: CActive(EPriorityNormal), iPhone(aPhone),iTestPhone(aTestPhone), iTestVersion(ETestV1)
|
|
5703 |
{}
|
|
5704 |
|
|
5705 |
|
|
5706 |
void CTestPhone::CTestGetDetectedNetworks::ConstructL()
|
|
5707 |
{
|
|
5708 |
CActiveScheduler::Add(this);
|
|
5709 |
iRetrieve=CRetrieveMobilePhoneDetectedNetworks::NewL(iPhone);
|
|
5710 |
iCanceller=new (ELeave) CTestCanceller(this);
|
|
5711 |
}
|
|
5712 |
|
|
5713 |
CTestPhone::CTestGetDetectedNetworks::~CTestGetDetectedNetworks()
|
|
5714 |
{
|
|
5715 |
delete iRetrieve;
|
|
5716 |
delete iCanceller;
|
|
5717 |
}
|
|
5718 |
|
|
5719 |
void CTestPhone::CTestGetDetectedNetworks::SetTestVersion(TTestVersion aTestVersion)
|
|
5720 |
{
|
|
5721 |
iTestVersion = aTestVersion;
|
|
5722 |
iTestPhone->INFO_PRINTF2(_L("Value of iTestVersion = %d"),iTestVersion);
|
|
5723 |
}
|
|
5724 |
|
|
5725 |
void CTestPhone::CTestGetDetectedNetworks::TestRetrieve()
|
|
5726 |
{
|
|
5727 |
Start();
|
|
5728 |
CActiveScheduler::Start();
|
|
5729 |
|
|
5730 |
// ensure that the same AO can be used to retrieve more than one list in succession
|
|
5731 |
|
|
5732 |
// Start();
|
|
5733 |
// CActiveScheduler::Start();
|
|
5734 |
}
|
|
5735 |
|
|
5736 |
void CTestPhone::CTestGetDetectedNetworks::Start()
|
|
5737 |
{
|
|
5738 |
//If iTestVersion is set to ETestV1, test calling the V1 list retrieval method
|
|
5739 |
if(iTestVersion==ETestV1)
|
|
5740 |
{
|
|
5741 |
iRetrieve->Start(iStatus);
|
|
5742 |
TRequestStatus tmpStatus;
|
|
5743 |
iRetrieve->Start(tmpStatus);
|
|
5744 |
User::WaitForRequest(tmpStatus);
|
|
5745 |
iTestPhone->TEST(tmpStatus.Int() == KErrInUse);
|
|
5746 |
SetActive();
|
|
5747 |
}
|
|
5748 |
//If iTestVersion is set to ETestV2, test calling the V2 list retrieval method
|
|
5749 |
else if(iTestVersion==ETestV2)
|
|
5750 |
{
|
|
5751 |
iRetrieve->StartV2(iStatus);
|
|
5752 |
TRequestStatus tmpStatus;
|
|
5753 |
iRetrieve->StartV2(tmpStatus);
|
|
5754 |
User::WaitForRequest(tmpStatus);
|
|
5755 |
iTestPhone->TEST(tmpStatus.Int() == KErrInUse);
|
|
5756 |
SetActive();
|
|
5757 |
}
|
|
5758 |
//If iTestVersion is set to ETestV5, test calling the V5 list retrieval method
|
|
5759 |
else if(iTestVersion==ETestV5)
|
|
5760 |
{
|
|
5761 |
iRetrieve->StartV5(iStatus);
|
|
5762 |
TRequestStatus tmpStatus;
|
|
5763 |
iRetrieve->StartV5(tmpStatus);
|
|
5764 |
User::WaitForRequest(tmpStatus);
|
|
5765 |
iTestPhone->TEST(tmpStatus.Int() == KErrInUse);
|
|
5766 |
SetActive();
|
|
5767 |
}
|
|
5768 |
else if (iTestVersion==ETestV8)
|
|
5769 |
{
|
|
5770 |
iRetrieve->StartV8(iStatus);
|
|
5771 |
TRequestStatus tmpStatus;
|
|
5772 |
iRetrieve->StartV8(tmpStatus);
|
|
5773 |
User::WaitForRequest(tmpStatus);
|
|
5774 |
iTestPhone->TEST(tmpStatus.Int() == KErrInUse);
|
|
5775 |
iTestPhone->INFO_PRINTF2(_L("In Start : Value of iTestVersion = %d"),iTestVersion);
|
|
5776 |
SetActive();
|
|
5777 |
}
|
|
5778 |
else
|
|
5779 |
{}
|
|
5780 |
}
|
|
5781 |
|
|
5782 |
void CTestPhone::CTestGetDetectedNetworks::TestCancel()
|
|
5783 |
{
|
|
5784 |
Start();
|
|
5785 |
|
|
5786 |
CTestCanceller* cancelGetNetworks = RetrieveCancelPtr();
|
|
5787 |
cancelGetNetworks->Call();
|
|
5788 |
|
|
5789 |
CActiveScheduler::Start();
|
|
5790 |
TBool cancelled = (iStatus == KErrCancel);
|
|
5791 |
|
|
5792 |
// Ensure that AO can be used after its previous transaction was cancelled
|
|
5793 |
Start();
|
|
5794 |
CActiveScheduler::Start();
|
|
5795 |
|
|
5796 |
if (cancelled)
|
|
5797 |
{
|
|
5798 |
iTestPhone->INFO_PRINTF2(_L("Cancelled version is %d"),iTestVersion);
|
|
5799 |
iTestPhone->INFO_PRINTF2(_L("Test %d - RMobilePhone::GetDetectedNetworks (async & cancel (Cancelled Request)) passed"), iTestPhone->iTestCount++);
|
|
5800 |
}
|
|
5801 |
else
|
|
5802 |
{
|
|
5803 |
iTestPhone->INFO_PRINTF2(_L("Test %d - RMobilePhone::GetDetectedNetworks (async & cancel (Request Not Cancelled)) passed"), iTestPhone->iTestCount++);
|
|
5804 |
}
|
|
5805 |
}
|
|
5806 |
|
|
5807 |
CTestCanceller* CTestPhone::CTestGetDetectedNetworks::RetrieveCancelPtr()
|
|
5808 |
{
|
|
5809 |
return iCanceller;
|
|
5810 |
}
|
|
5811 |
|
|
5812 |
void CTestPhone::CTestGetDetectedNetworks::RunL()
|
|
5813 |
{
|
|
5814 |
TInt ret=iStatus.Int();
|
|
5815 |
User::LeaveIfError(ret);
|
|
5816 |
|
|
5817 |
iTestPhone->INFO_PRINTF2(_L("In RunL with iTestVersion = %d"),iTestVersion);
|
|
5818 |
|
|
5819 |
if(iTestVersion == ETestV1)
|
|
5820 |
{
|
|
5821 |
iTestPhone->INFO_PRINTF1(_L("In RunL with iTestVersion =ETestV1"));
|
|
5822 |
ret=CheckResults();
|
|
5823 |
}
|
|
5824 |
else if(iTestVersion == ETestV2)
|
|
5825 |
{
|
|
5826 |
iTestPhone->INFO_PRINTF1(_L("In RunL with iTestVersion =ETestV2"));
|
|
5827 |
ret=CheckResultsV2();
|
|
5828 |
}
|
|
5829 |
else if(iTestVersion == ETestV5)
|
|
5830 |
{
|
|
5831 |
iTestPhone->INFO_PRINTF1(_L("In RunL with iTestVersion =ETestV5"));
|
|
5832 |
ret=CheckResultsV5();
|
|
5833 |
}
|
|
5834 |
else if(iTestVersion == ETestV8)
|
|
5835 |
{
|
|
5836 |
iTestPhone->INFO_PRINTF1(_L("In RunL with iTestVersion =ETestV8"));
|
|
5837 |
ret=CheckResultsV8();
|
|
5838 |
}
|
|
5839 |
else
|
|
5840 |
{
|
|
5841 |
iTestPhone->INFO_PRINTF1(_L("In RunL with iTestVersion =Error"));
|
|
5842 |
ret=KErrNotFound;
|
|
5843 |
}
|
|
5844 |
|
|
5845 |
User::LeaveIfError(ret);
|
|
5846 |
|
|
5847 |
CActiveScheduler::Stop();
|
|
5848 |
}
|
|
5849 |
|
|
5850 |
|
|
5851 |
void CTestPhone::CTestGetDetectedNetworks::DoCancel()
|
|
5852 |
{
|
|
5853 |
iRetrieve->Cancel();
|
|
5854 |
}
|
|
5855 |
|
|
5856 |
TInt CTestPhone::CTestGetDetectedNetworks::CheckResults()
|
|
5857 |
{
|
|
5858 |
TInt ret=KErrNone;
|
|
5859 |
|
|
5860 |
CMobilePhoneNetworkList* networkList=NULL;
|
|
5861 |
TInt leaveCode=KErrNone;
|
|
5862 |
TRAP(leaveCode, networkList=iRetrieve->RetrieveListL(););
|
|
5863 |
|
|
5864 |
//Check that a list is returned back to the test
|
|
5865 |
iTestPhone->TEST(networkList!=NULL);
|
|
5866 |
|
|
5867 |
if (networkList)
|
|
5868 |
{
|
|
5869 |
//Check that the number of entries in the list is as expected
|
|
5870 |
iTestPhone->TEST(networkList->Enumerate()==DMMTSY_NETWORK_COUNT);
|
|
5871 |
|
|
5872 |
// Get each detected network entry
|
|
5873 |
RMobilePhone::TMobilePhoneNetworkInfoV1 networkEntry;
|
|
5874 |
|
|
5875 |
for (TInt i=0; i<DMMTSY_NETWORK_COUNT; ++i)
|
|
5876 |
{
|
|
5877 |
TRAP(ret,networkEntry=networkList->GetEntryL(i));
|
|
5878 |
if (ret != KErrNone)
|
|
5879 |
{
|
|
5880 |
break;
|
|
5881 |
}
|
|
5882 |
switch(i)
|
|
5883 |
{
|
|
5884 |
case 0:
|
|
5885 |
{
|
|
5886 |
iTestPhone->TEST(networkEntry.iMode==DMMTSY_PHONE_CURRENT_NETWORK_MODE1);
|
|
5887 |
iTestPhone->TEST(networkEntry.iStatus==DMMTSY_PHONE_CURRENT_NETWORK_STATUS1);
|
|
5888 |
iTestPhone->TEST(networkEntry.iBandInfo==DMMTSY_PHONE_CURRENT_NETWORK_BAND1);
|
|
5889 |
iTestPhone->TEST(networkEntry.iCountryCode.Compare(DMMTSY_PHONE_CURRENT_NETWORK_MCC1)==0);
|
|
5890 |
iTestPhone->TEST(networkEntry.iNetworkId.Compare(DMMTSY_PHONE_CURRENT_NETWORK_ID1)==0);
|
|
5891 |
iTestPhone->TEST(networkEntry.iDisplayTag.Compare(DMMTSY_PHONE_CURRENT_NETWORK_TAG1)==0);
|
|
5892 |
iTestPhone->TEST(networkEntry.iShortName.Compare(DMMTSY_PHONE_CURRENT_NETWORK_SHORT_NAME1)==0);
|
|
5893 |
iTestPhone->TEST(networkEntry.iLongName.Compare(DMMTSY_PHONE_CURRENT_NETWORK_LONG_NAME1)==0);
|
|
5894 |
break;
|
|
5895 |
}
|
|
5896 |
|
|
5897 |
case 1:
|
|
5898 |
{
|
|
5899 |
iTestPhone->TEST(networkEntry.iMode==DMMTSY_PHONE_CURRENT_NETWORK_MODE2);
|
|
5900 |
iTestPhone->TEST(networkEntry.iStatus==DMMTSY_PHONE_CURRENT_NETWORK_STATUS2);
|
|
5901 |
iTestPhone->TEST(networkEntry.iBandInfo==DMMTSY_PHONE_CURRENT_NETWORK_BAND2);
|
|
5902 |
iTestPhone->TEST(networkEntry.iCountryCode.Compare(DMMTSY_PHONE_CURRENT_NETWORK_MCC2)==0);
|
|
5903 |
iTestPhone->TEST(networkEntry.iNetworkId.Compare(DMMTSY_PHONE_CURRENT_NETWORK_ID2)==0);
|
|
5904 |
iTestPhone->TEST(networkEntry.iDisplayTag.Compare(DMMTSY_PHONE_CURRENT_NETWORK_TAG2)==0);
|
|
5905 |
iTestPhone->TEST(networkEntry.iShortName.Compare(DMMTSY_PHONE_CURRENT_NETWORK_SHORT_NAME2)==0);
|
|
5906 |
iTestPhone->TEST(networkEntry.iLongName.Compare(DMMTSY_PHONE_CURRENT_NETWORK_LONG_NAME2)==0);
|
|
5907 |
break;
|
|
5908 |
}
|
|
5909 |
|
|
5910 |
case 2:
|
|
5911 |
{
|
|
5912 |
iTestPhone->TEST(networkEntry.iMode==DMMTSY_PHONE_HOME_NETWORK_MODE);
|
|
5913 |
iTestPhone->TEST(networkEntry.iStatus==DMMTSY_PHONE_HOME_NETWORK_STATUS);
|
|
5914 |
iTestPhone->TEST(networkEntry.iBandInfo==DMMTSY_PHONE_HOME_NETWORK_BAND);
|
|
5915 |
iTestPhone->TEST(networkEntry.iCountryCode.Compare(DMMTSY_PHONE_HOME_NETWORK_MCC)==0);
|
|
5916 |
iTestPhone->TEST(networkEntry.iNetworkId.Compare(DMMTSY_PHONE_HOME_NETWORK_ID)==0);
|
|
5917 |
iTestPhone->TEST(networkEntry.iDisplayTag.Compare(DMMTSY_PHONE_HOME_NETWORK_TAG)==0);
|
|
5918 |
iTestPhone->TEST(networkEntry.iShortName.Compare(DMMTSY_PHONE_HOME_NETWORK_SHORT_NAME)==0);
|
|
5919 |
iTestPhone->TEST(networkEntry.iLongName.Compare(DMMTSY_PHONE_HOME_NETWORK_LONG_NAME)==0);
|
|
5920 |
break;
|
|
5921 |
}
|
|
5922 |
|
|
5923 |
default:
|
|
5924 |
break;
|
|
5925 |
}
|
|
5926 |
}
|
|
5927 |
delete networkList;
|
|
5928 |
}
|
|
5929 |
return ret;
|
|
5930 |
}
|
|
5931 |
|
|
5932 |
TInt CTestPhone::CTestGetDetectedNetworks::CheckResultsV2()
|
|
5933 |
{
|
|
5934 |
TInt ret=KErrNone;
|
|
5935 |
|
|
5936 |
CMobilePhoneNetworkListV2* networkList=NULL;
|
|
5937 |
|
|
5938 |
TInt leaveCode=KErrNone;
|
|
5939 |
TRAP(leaveCode, networkList=iRetrieve->RetrieveListV2L(););
|
|
5940 |
|
|
5941 |
//Check that a list is returned back to the test
|
|
5942 |
iTestPhone->TEST(networkList!=NULL);
|
|
5943 |
|
|
5944 |
if (networkList)
|
|
5945 |
{
|
|
5946 |
//Check that the number of entries in the list is as expected
|
|
5947 |
iTestPhone->TEST(networkList->Enumerate()==DMMTSY_NETWORK_COUNT);
|
|
5948 |
|
|
5949 |
// Get each detected network entry
|
|
5950 |
RMobilePhone::TMobilePhoneNetworkInfoV2 networkEntry;
|
|
5951 |
|
|
5952 |
for (TInt i=0; i<DMMTSY_NETWORK_COUNT; ++i)
|
|
5953 |
{
|
|
5954 |
TRAP(ret,networkEntry=networkList->GetEntryL(i));
|
|
5955 |
if (ret != KErrNone)
|
|
5956 |
break;
|
|
5957 |
switch(i)
|
|
5958 |
{
|
|
5959 |
case 0:
|
|
5960 |
{
|
|
5961 |
iTestPhone->TEST(networkEntry.iMode==DMMTSY_PHONE_CURRENT_NETWORK_MODE1);
|
|
5962 |
iTestPhone->TEST(networkEntry.iStatus==DMMTSY_PHONE_CURRENT_NETWORK_STATUS1);
|
|
5963 |
iTestPhone->TEST(networkEntry.iBandInfo==DMMTSY_PHONE_CURRENT_NETWORK_BAND1);
|
|
5964 |
iTestPhone->TEST(networkEntry.iCountryCode.Compare(DMMTSY_PHONE_CURRENT_NETWORK_MCC1)==0);
|
|
5965 |
iTestPhone->TEST(networkEntry.iNetworkId.Compare(DMMTSY_PHONE_CURRENT_NETWORK_ID1)==0);
|
|
5966 |
iTestPhone->TEST(networkEntry.iDisplayTag.Compare(DMMTSY_PHONE_CURRENT_NETWORK_TAG1)==0);
|
|
5967 |
iTestPhone->TEST(networkEntry.iShortName.Compare(DMMTSY_PHONE_CURRENT_NETWORK_SHORT_NAME1)==0);
|
|
5968 |
iTestPhone->TEST(networkEntry.iLongName.Compare(DMMTSY_PHONE_CURRENT_NETWORK_LONG_NAME1)==0);
|
|
5969 |
iTestPhone->TEST(networkEntry.iAccess==DMMTSY_PHONE_CURRENT_NETWORK_ACCESS_TECH1);
|
|
5970 |
break;
|
|
5971 |
}
|
|
5972 |
|
|
5973 |
case 1:
|
|
5974 |
{
|
|
5975 |
iTestPhone->TEST(networkEntry.iMode==DMMTSY_PHONE_CURRENT_NETWORK_MODE2);
|
|
5976 |
iTestPhone->TEST(networkEntry.iStatus==DMMTSY_PHONE_CURRENT_NETWORK_STATUS2);
|
|
5977 |
iTestPhone->TEST(networkEntry.iBandInfo==DMMTSY_PHONE_CURRENT_NETWORK_BAND2);
|
|
5978 |
iTestPhone->TEST(networkEntry.iCountryCode.Compare(DMMTSY_PHONE_CURRENT_NETWORK_MCC2)==0);
|
|
5979 |
iTestPhone->TEST(networkEntry.iNetworkId==DMMTSY_PHONE_CURRENT_NETWORK_ID2);
|
|
5980 |
iTestPhone->TEST(networkEntry.iDisplayTag.Compare(DMMTSY_PHONE_CURRENT_NETWORK_TAG2)==0);
|
|
5981 |
iTestPhone->TEST(networkEntry.iShortName.Compare(DMMTSY_PHONE_CURRENT_NETWORK_SHORT_NAME2)==0);
|
|
5982 |
iTestPhone->TEST(networkEntry.iLongName.Compare(DMMTSY_PHONE_CURRENT_NETWORK_LONG_NAME2)==0);
|
|
5983 |
iTestPhone->TEST(networkEntry.iAccess==DMMTSY_PHONE_CURRENT_NETWORK_ACCESS_TECH2);
|
|
5984 |
break;
|
|
5985 |
}
|
|
5986 |
|
|
5987 |
case 2:
|
|
5988 |
{
|
|
5989 |
iTestPhone->TEST(networkEntry.iMode==DMMTSY_PHONE_HOME_NETWORK_MODE);
|
|
5990 |
iTestPhone->TEST(networkEntry.iStatus==DMMTSY_PHONE_HOME_NETWORK_STATUS);
|
|
5991 |
iTestPhone->TEST(networkEntry.iBandInfo==DMMTSY_PHONE_HOME_NETWORK_BAND);
|
|
5992 |
iTestPhone->TEST(networkEntry.iCountryCode.Compare(DMMTSY_PHONE_HOME_NETWORK_MCC)==0);
|
|
5993 |
iTestPhone->TEST(networkEntry.iNetworkId.Compare(DMMTSY_PHONE_HOME_NETWORK_ID)==0);
|
|
5994 |
iTestPhone->TEST(networkEntry.iDisplayTag.Compare(DMMTSY_PHONE_HOME_NETWORK_TAG)==0);
|
|
5995 |
iTestPhone->TEST(networkEntry.iShortName.Compare(DMMTSY_PHONE_HOME_NETWORK_SHORT_NAME)==0);
|
|
5996 |
iTestPhone->TEST(networkEntry.iLongName.Compare(DMMTSY_PHONE_HOME_NETWORK_LONG_NAME)==0);
|
|
5997 |
iTestPhone->TEST(networkEntry.iAccess==DMMTSY_PHONE_LAST_USED_ACCESS_TECH);
|
|
5998 |
break;
|
|
5999 |
}
|
|
6000 |
|
|
6001 |
case 3:
|
|
6002 |
{
|
|
6003 |
iTestPhone->TEST(networkEntry.iMode==DMMTSY_PHONE_HOME_NETWORK_MODE);
|
|
6004 |
iTestPhone->TEST(networkEntry.iStatus==DMMTSY_PHONE_HOME_NETWORK_STATUS);
|
|
6005 |
iTestPhone->TEST(networkEntry.iBandInfo==DMMTSY_PHONE_HOME_NETWORK_BAND);
|
|
6006 |
iTestPhone->TEST(networkEntry.iCountryCode.Compare(DMMTSY_PHONE_HOME_NETWORK_MCC)==0);
|
|
6007 |
iTestPhone->TEST(networkEntry.iNetworkId.Compare(DMMTSY_PHONE_HOME_NETWORK_ID)==0);
|
|
6008 |
iTestPhone->TEST(networkEntry.iDisplayTag.Compare(DMMTSY_PHONE_HOME_NETWORK_TAG)==0);
|
|
6009 |
iTestPhone->TEST(networkEntry.iShortName.Compare(DMMTSY_PHONE_HOME_NETWORK_SHORT_NAME)==0);
|
|
6010 |
iTestPhone->TEST(networkEntry.iLongName.Compare(DMMTSY_PHONE_HOME_NETWORK_LONG_NAME)==0);
|
|
6011 |
iTestPhone->TEST(networkEntry.iAccess==DMMTSY_PHONE_HOME_NETWORK_ACCESS_TECH3);
|
|
6012 |
break;
|
|
6013 |
}
|
|
6014 |
|
|
6015 |
default:
|
|
6016 |
break;
|
|
6017 |
}
|
|
6018 |
}
|
|
6019 |
delete networkList;
|
|
6020 |
}
|
|
6021 |
return ret;
|
|
6022 |
}
|
|
6023 |
|
|
6024 |
TInt CTestPhone::CTestGetDetectedNetworks::CheckResultsV5()
|
|
6025 |
{
|
|
6026 |
TInt ret=KErrNone;
|
|
6027 |
|
|
6028 |
CMobilePhoneNetworkListV5* networkList=NULL;
|
|
6029 |
|
|
6030 |
TInt leaveCode=KErrNone;
|
|
6031 |
TRAP(leaveCode, networkList=iRetrieve->RetrieveListV5L(););
|
|
6032 |
|
|
6033 |
//Check that a list is returned back to the test
|
|
6034 |
iTestPhone->TEST(networkList!=NULL);
|
|
6035 |
|
|
6036 |
if (networkList)
|
|
6037 |
{
|
|
6038 |
//Check that the number of entries in the list is as expected
|
|
6039 |
iTestPhone->TEST(networkList->Enumerate()==DMMTSY_NETWORK_COUNT);
|
|
6040 |
|
|
6041 |
// Get each detected network entry
|
|
6042 |
RMobilePhone::TMobilePhoneNetworkInfoV5 networkEntry;
|
|
6043 |
|
|
6044 |
for (TInt i=0; i<DMMTSY_NETWORK_COUNT; ++i)
|
|
6045 |
{
|
|
6046 |
TRAP(ret,networkEntry=networkList->GetEntryL(i));
|
|
6047 |
if (ret != KErrNone)
|
|
6048 |
break;
|
|
6049 |
switch(i)
|
|
6050 |
{
|
|
6051 |
case 0:
|
|
6052 |
{
|
|
6053 |
iTestPhone->TEST(networkEntry.iMode==DMMTSY_PHONE_CURRENT_NETWORK_MODE1);
|
|
6054 |
iTestPhone->TEST(networkEntry.iStatus==DMMTSY_PHONE_CURRENT_NETWORK_STATUS1);
|
|
6055 |
iTestPhone->TEST(networkEntry.iBandInfo==DMMTSY_PHONE_CURRENT_NETWORK_BAND1);
|
|
6056 |
iTestPhone->TEST(networkEntry.iCountryCode.Compare(DMMTSY_PHONE_CURRENT_NETWORK_MCC1)==0);
|
|
6057 |
iTestPhone->TEST(networkEntry.iNetworkId.Compare(DMMTSY_PHONE_CURRENT_NETWORK_ID1)==0);
|
|
6058 |
iTestPhone->TEST(networkEntry.iDisplayTag.Compare(DMMTSY_PHONE_CURRENT_NETWORK_TAG1)==0);
|
|
6059 |
iTestPhone->TEST(networkEntry.iShortName.Compare(DMMTSY_PHONE_CURRENT_NETWORK_SHORT_NAME1)==0);
|
|
6060 |
iTestPhone->TEST(networkEntry.iLongName.Compare(DMMTSY_PHONE_CURRENT_NETWORK_LONG_NAME1)==0);
|
|
6061 |
iTestPhone->TEST(networkEntry.iAccess==DMMTSY_PHONE_CURRENT_NETWORK_ACCESS_TECH1);
|
|
6062 |
iTestPhone->TEST(networkEntry.iHsdpaAvailableIndicator==DMMTSY_PHONE_CURRENT_NETWORK_HSDPA_AVAILABILITY1);
|
|
6063 |
iTestPhone->TEST(networkEntry.iEgprsAvailableIndicator==DMMTSY_PHONE_CURRENT_NETWORK_EGPRS_AVAILABILITY1);
|
|
6064 |
break;
|
|
6065 |
}
|
|
6066 |
|
|
6067 |
case 1:
|
|
6068 |
{
|
|
6069 |
iTestPhone->TEST(networkEntry.iMode==DMMTSY_PHONE_CURRENT_NETWORK_MODE2);
|
|
6070 |
iTestPhone->TEST(networkEntry.iStatus==DMMTSY_PHONE_CURRENT_NETWORK_STATUS2);
|
|
6071 |
iTestPhone->TEST(networkEntry.iBandInfo==DMMTSY_PHONE_CURRENT_NETWORK_BAND2);
|
|
6072 |
iTestPhone->TEST(networkEntry.iCountryCode.Compare(DMMTSY_PHONE_CURRENT_NETWORK_MCC2)==0);
|
|
6073 |
iTestPhone->TEST(networkEntry.iNetworkId==DMMTSY_PHONE_CURRENT_NETWORK_ID2);
|
|
6074 |
iTestPhone->TEST(networkEntry.iDisplayTag.Compare(DMMTSY_PHONE_CURRENT_NETWORK_TAG2)==0);
|
|
6075 |
iTestPhone->TEST(networkEntry.iShortName.Compare(DMMTSY_PHONE_CURRENT_NETWORK_SHORT_NAME2)==0);
|
|
6076 |
iTestPhone->TEST(networkEntry.iLongName.Compare(DMMTSY_PHONE_CURRENT_NETWORK_LONG_NAME2)==0);
|
|
6077 |
iTestPhone->TEST(networkEntry.iAccess==DMMTSY_PHONE_CURRENT_NETWORK_ACCESS_TECH2);
|
|
6078 |
iTestPhone->TEST(networkEntry.iHsdpaAvailableIndicator==DMMTSY_PHONE_CURRENT_NETWORK_HSDPA_AVAILABILITY2);
|
|
6079 |
iTestPhone->TEST(networkEntry.iEgprsAvailableIndicator==DMMTSY_PHONE_CURRENT_NETWORK_EGPRS_AVAILABILITY2);
|
|
6080 |
break;
|
|
6081 |
}
|
|
6082 |
|
|
6083 |
case 2:
|
|
6084 |
{
|
|
6085 |
iTestPhone->TEST(networkEntry.iMode==DMMTSY_PHONE_HOME_NETWORK_MODE);
|
|
6086 |
iTestPhone->TEST(networkEntry.iStatus==DMMTSY_PHONE_HOME_NETWORK_STATUS);
|
|
6087 |
iTestPhone->TEST(networkEntry.iBandInfo==DMMTSY_PHONE_HOME_NETWORK_BAND);
|
|
6088 |
iTestPhone->TEST(networkEntry.iCountryCode.Compare(DMMTSY_PHONE_HOME_NETWORK_MCC)==0);
|
|
6089 |
iTestPhone->TEST(networkEntry.iNetworkId.Compare(DMMTSY_PHONE_HOME_NETWORK_ID)==0);
|
|
6090 |
iTestPhone->TEST(networkEntry.iDisplayTag.Compare(DMMTSY_PHONE_HOME_NETWORK_TAG)==0);
|
|
6091 |
iTestPhone->TEST(networkEntry.iShortName.Compare(DMMTSY_PHONE_HOME_NETWORK_SHORT_NAME)==0);
|
|
6092 |
iTestPhone->TEST(networkEntry.iLongName.Compare(DMMTSY_PHONE_HOME_NETWORK_LONG_NAME)==0);
|
|
6093 |
iTestPhone->TEST(networkEntry.iAccess==DMMTSY_PHONE_LAST_USED_ACCESS_TECH);
|
|
6094 |
iTestPhone->TEST(networkEntry.iHsdpaAvailableIndicator==DMMTSY_PHONE_HOME_NETWORK_HSDPA_AVAILABILITY);
|
|
6095 |
iTestPhone->TEST(networkEntry.iEgprsAvailableIndicator==DMMTSY_PHONE_HOME_NETWORK_EGPRS_AVAILABILITY);
|
|
6096 |
break;
|
|
6097 |
}
|
|
6098 |
|
|
6099 |
case 3:
|
|
6100 |
{
|
|
6101 |
iTestPhone->TEST(networkEntry.iMode==DMMTSY_PHONE_HOME_NETWORK_MODE);
|
|
6102 |
iTestPhone->TEST(networkEntry.iStatus==DMMTSY_PHONE_HOME_NETWORK_STATUS);
|
|
6103 |
iTestPhone->TEST(networkEntry.iBandInfo==DMMTSY_PHONE_HOME_NETWORK_BAND);
|
|
6104 |
iTestPhone->TEST(networkEntry.iCountryCode.Compare(DMMTSY_PHONE_HOME_NETWORK_MCC)==0);
|
|
6105 |
iTestPhone->TEST(networkEntry.iNetworkId.Compare(DMMTSY_PHONE_HOME_NETWORK_ID)==0);
|
|
6106 |
iTestPhone->TEST(networkEntry.iDisplayTag.Compare(DMMTSY_PHONE_HOME_NETWORK_TAG)==0);
|
|
6107 |
iTestPhone->TEST(networkEntry.iShortName.Compare(DMMTSY_PHONE_HOME_NETWORK_SHORT_NAME)==0);
|
|
6108 |
iTestPhone->TEST(networkEntry.iLongName.Compare(DMMTSY_PHONE_HOME_NETWORK_LONG_NAME)==0);
|
|
6109 |
iTestPhone->TEST(networkEntry.iAccess==DMMTSY_PHONE_HOME_NETWORK_ACCESS_TECH3);
|
|
6110 |
iTestPhone->TEST(networkEntry.iHsdpaAvailableIndicator==DMMTSY_PHONE_HOME_NETWORK_HSDPA_AVAILABILITY);
|
|
6111 |
iTestPhone->TEST(networkEntry.iEgprsAvailableIndicator==DMMTSY_PHONE_HOME_NETWORK_EGPRS_AVAILABILITY);
|
|
6112 |
break;
|
|
6113 |
}
|
|
6114 |
|
|
6115 |
default:
|
|
6116 |
break;
|
|
6117 |
}
|
|
6118 |
}
|
|
6119 |
delete networkList;
|
|
6120 |
}
|
|
6121 |
return ret;
|
|
6122 |
}
|
|
6123 |
|
|
6124 |
TInt CTestPhone::CTestGetDetectedNetworks::CheckResultsV8()
|
|
6125 |
{
|
|
6126 |
TInt ret=KErrNone;
|
|
6127 |
|
|
6128 |
CMobilePhoneNetworkListV8* networkList=NULL;
|
|
6129 |
|
|
6130 |
TRAPD(leaveCode, networkList=iRetrieve->RetrieveListV8L());
|
|
6131 |
if(leaveCode != KErrNone)
|
|
6132 |
{
|
|
6133 |
return leaveCode;
|
|
6134 |
}
|
|
6135 |
|
|
6136 |
//Check that a list is returned back to the test
|
|
6137 |
iTestPhone->TEST(networkList!=NULL);
|
|
6138 |
|
|
6139 |
if (networkList)
|
|
6140 |
{
|
|
6141 |
//Check that the number of entries in the list is as expected
|
|
6142 |
iTestPhone->TEST(networkList->Enumerate()==DMMTSY_NETWORK_COUNT);
|
|
6143 |
|
|
6144 |
// Get each detected network entry
|
|
6145 |
RMobilePhone::TMobilePhoneNetworkInfoV8 networkEntry;
|
|
6146 |
|
|
6147 |
for (TInt i=0; i<DMMTSY_NETWORK_COUNT; ++i)
|
|
6148 |
{
|
|
6149 |
TRAP(ret,networkEntry=networkList->GetEntryL(i));
|
|
6150 |
if (ret != KErrNone)
|
|
6151 |
{
|
|
6152 |
break;
|
|
6153 |
}
|
|
6154 |
switch(i)
|
|
6155 |
{
|
|
6156 |
case 0:
|
|
6157 |
{
|
|
6158 |
iTestPhone->TEST(networkEntry.iMode==DMMTSY_PHONE_CURRENT_NETWORK_MODE1);
|
|
6159 |
iTestPhone->TEST(networkEntry.iStatus==DMMTSY_PHONE_CURRENT_NETWORK_STATUS1);
|
|
6160 |
iTestPhone->TEST(networkEntry.iBandInfo==DMMTSY_PHONE_CURRENT_NETWORK_BAND1);
|
|
6161 |
iTestPhone->TEST(networkEntry.iCountryCode.Compare(DMMTSY_PHONE_CURRENT_NETWORK_MCC1)==0);
|
|
6162 |
iTestPhone->TEST(networkEntry.iNetworkId.Compare(DMMTSY_PHONE_CURRENT_NETWORK_ID1)==0);
|
|
6163 |
iTestPhone->TEST(networkEntry.iDisplayTag.Compare(DMMTSY_PHONE_CURRENT_NETWORK_TAG1)==0);
|
|
6164 |
iTestPhone->TEST(networkEntry.iShortName.Compare(DMMTSY_PHONE_CURRENT_NETWORK_SHORT_NAME1)==0);
|
|
6165 |
iTestPhone->TEST(networkEntry.iLongName.Compare(DMMTSY_PHONE_CURRENT_NETWORK_LONG_NAME1)==0);
|
|
6166 |
iTestPhone->TEST(networkEntry.iAccess==DMMTSY_PHONE_CURRENT_NETWORK_ACCESS_TECH1);
|
|
6167 |
iTestPhone->TEST(networkEntry.iHsdpaAvailableIndicator==DMMTSY_PHONE_CURRENT_NETWORK_HSDPA_AVAILABILITY1);
|
|
6168 |
iTestPhone->TEST(networkEntry.iEgprsAvailableIndicator==DMMTSY_PHONE_CURRENT_NETWORK_EGPRS_AVAILABILITY1);
|
|
6169 |
iTestPhone->TEST(networkEntry.iHsupaAvailableIndicator==DMMTSY_PHONE_CURRENT_NETWORK_HSUPA_AVAILABILITY1);
|
|
6170 |
break;
|
|
6171 |
}
|
|
6172 |
|
|
6173 |
case 1:
|
|
6174 |
{
|
|
6175 |
iTestPhone->TEST(networkEntry.iMode==DMMTSY_PHONE_CURRENT_NETWORK_MODE2);
|
|
6176 |
iTestPhone->TEST(networkEntry.iStatus==DMMTSY_PHONE_CURRENT_NETWORK_STATUS2);
|
|
6177 |
iTestPhone->TEST(networkEntry.iBandInfo==DMMTSY_PHONE_CURRENT_NETWORK_BAND2);
|
|
6178 |
iTestPhone->TEST(networkEntry.iCountryCode.Compare(DMMTSY_PHONE_CURRENT_NETWORK_MCC2)==0);
|
|
6179 |
iTestPhone->TEST(networkEntry.iNetworkId==DMMTSY_PHONE_CURRENT_NETWORK_ID2);
|
|
6180 |
iTestPhone->TEST(networkEntry.iDisplayTag.Compare(DMMTSY_PHONE_CURRENT_NETWORK_TAG2)==0);
|
|
6181 |
iTestPhone->TEST(networkEntry.iShortName.Compare(DMMTSY_PHONE_CURRENT_NETWORK_SHORT_NAME2)==0);
|
|
6182 |
iTestPhone->TEST(networkEntry.iLongName.Compare(DMMTSY_PHONE_CURRENT_NETWORK_LONG_NAME2)==0);
|
|
6183 |
iTestPhone->TEST(networkEntry.iAccess==DMMTSY_PHONE_CURRENT_NETWORK_ACCESS_TECH2);
|
|
6184 |
iTestPhone->TEST(networkEntry.iHsdpaAvailableIndicator==DMMTSY_PHONE_CURRENT_NETWORK_HSDPA_AVAILABILITY2);
|
|
6185 |
iTestPhone->TEST(networkEntry.iEgprsAvailableIndicator==DMMTSY_PHONE_CURRENT_NETWORK_EGPRS_AVAILABILITY2);
|
|
6186 |
iTestPhone->TEST(networkEntry.iHsupaAvailableIndicator==DMMTSY_PHONE_CURRENT_NETWORK_HSUPA_AVAILABILITY2);
|
|
6187 |
break;
|
|
6188 |
}
|
|
6189 |
|
|
6190 |
case 2:
|
|
6191 |
{
|
|
6192 |
iTestPhone->TEST(networkEntry.iMode==DMMTSY_PHONE_HOME_NETWORK_MODE);
|
|
6193 |
iTestPhone->TEST(networkEntry.iStatus==DMMTSY_PHONE_HOME_NETWORK_STATUS);
|
|
6194 |
iTestPhone->TEST(networkEntry.iBandInfo==DMMTSY_PHONE_HOME_NETWORK_BAND);
|
|
6195 |
iTestPhone->TEST(networkEntry.iCountryCode.Compare(DMMTSY_PHONE_HOME_NETWORK_MCC)==0);
|
|
6196 |
iTestPhone->TEST(networkEntry.iNetworkId.Compare(DMMTSY_PHONE_HOME_NETWORK_ID)==0);
|
|
6197 |
iTestPhone->TEST(networkEntry.iDisplayTag.Compare(DMMTSY_PHONE_HOME_NETWORK_TAG)==0);
|
|
6198 |
iTestPhone->TEST(networkEntry.iShortName.Compare(DMMTSY_PHONE_HOME_NETWORK_SHORT_NAME)==0);
|
|
6199 |
iTestPhone->TEST(networkEntry.iLongName.Compare(DMMTSY_PHONE_HOME_NETWORK_LONG_NAME)==0);
|
|
6200 |
iTestPhone->TEST(networkEntry.iAccess==DMMTSY_PHONE_LAST_USED_ACCESS_TECH);
|
|
6201 |
iTestPhone->TEST(networkEntry.iHsdpaAvailableIndicator==DMMTSY_PHONE_HOME_NETWORK_HSDPA_AVAILABILITY);
|
|
6202 |
iTestPhone->TEST(networkEntry.iEgprsAvailableIndicator==DMMTSY_PHONE_HOME_NETWORK_EGPRS_AVAILABILITY);
|
|
6203 |
iTestPhone->TEST(networkEntry.iHsupaAvailableIndicator==DMMTSY_PHONE_HOME_NETWORK_HSUPA_AVAILABILITY);
|
|
6204 |
break;
|
|
6205 |
}
|
|
6206 |
|
|
6207 |
case 3:
|
|
6208 |
{
|
|
6209 |
iTestPhone->TEST(networkEntry.iMode==DMMTSY_PHONE_HOME_NETWORK_MODE);
|
|
6210 |
iTestPhone->TEST(networkEntry.iStatus==DMMTSY_PHONE_HOME_NETWORK_STATUS);
|
|
6211 |
iTestPhone->TEST(networkEntry.iBandInfo==DMMTSY_PHONE_HOME_NETWORK_BAND);
|
|
6212 |
iTestPhone->TEST(networkEntry.iCountryCode.Compare(DMMTSY_PHONE_HOME_NETWORK_MCC)==0);
|
|
6213 |
iTestPhone->TEST(networkEntry.iNetworkId.Compare(DMMTSY_PHONE_HOME_NETWORK_ID)==0);
|
|
6214 |
iTestPhone->TEST(networkEntry.iDisplayTag.Compare(DMMTSY_PHONE_HOME_NETWORK_TAG)==0);
|
|
6215 |
iTestPhone->TEST(networkEntry.iShortName.Compare(DMMTSY_PHONE_HOME_NETWORK_SHORT_NAME)==0);
|
|
6216 |
iTestPhone->TEST(networkEntry.iLongName.Compare(DMMTSY_PHONE_HOME_NETWORK_LONG_NAME)==0);
|
|
6217 |
iTestPhone->TEST(networkEntry.iAccess==DMMTSY_PHONE_HOME_NETWORK_ACCESS_TECH3);
|
|
6218 |
iTestPhone->TEST(networkEntry.iHsdpaAvailableIndicator==DMMTSY_PHONE_HOME_NETWORK_HSDPA_AVAILABILITY);
|
|
6219 |
iTestPhone->TEST(networkEntry.iEgprsAvailableIndicator==DMMTSY_PHONE_HOME_NETWORK_EGPRS_AVAILABILITY);
|
|
6220 |
iTestPhone->TEST(networkEntry.iHsupaAvailableIndicator==DMMTSY_PHONE_HOME_NETWORK_HSUPA_AVAILABILITY);
|
|
6221 |
break;
|
|
6222 |
}
|
|
6223 |
|
|
6224 |
default:
|
|
6225 |
break;
|
|
6226 |
}
|
|
6227 |
}
|
|
6228 |
delete networkList;
|
|
6229 |
}
|
|
6230 |
return ret;
|
|
6231 |
}
|
|
6232 |
|
|
6233 |
|
|
6234 |
/**************************************************************/
|
|
6235 |
//
|
|
6236 |
// Testing asynchronous retrieve of call forwarding status list
|
|
6237 |
//
|
|
6238 |
/**************************************************************/
|
|
6239 |
|
|
6240 |
CTestPhone::CTestGetCFStatus* CTestPhone::CTestGetCFStatus::NewLC(RMobilePhone& aPhone, CTestPhone* aTestPhone)
|
|
6241 |
{
|
|
6242 |
CTestGetCFStatus* r=new(ELeave) CTestGetCFStatus(aPhone, aTestPhone);
|
|
6243 |
CleanupStack::PushL(r);
|
|
6244 |
r->ConstructL();
|
|
6245 |
return r;
|
|
6246 |
}
|
|
6247 |
|
|
6248 |
CTestPhone::CTestGetCFStatus::CTestGetCFStatus(RMobilePhone& aPhone, CTestPhone* aTestPhone)
|
|
6249 |
: CActive(EPriorityNormal), iPhone(aPhone), iTestPhone(aTestPhone)
|
|
6250 |
{}
|
|
6251 |
|
|
6252 |
|
|
6253 |
void CTestPhone::CTestGetCFStatus::ConstructL()
|
|
6254 |
{
|
|
6255 |
CActiveScheduler::Add(this);
|
|
6256 |
iRetrieve=CRetrieveMobilePhoneCFList::NewL(iPhone);
|
|
6257 |
iCanceller=new (ELeave) CTestCanceller(this);
|
|
6258 |
}
|
|
6259 |
|
|
6260 |
CTestPhone::CTestGetCFStatus::~CTestGetCFStatus()
|
|
6261 |
{
|
|
6262 |
Cancel();
|
|
6263 |
delete iRetrieve;
|
|
6264 |
delete iCanceller;
|
|
6265 |
}
|
|
6266 |
void CTestPhone::CTestGetCFStatus::StartSingleServiceGroup()
|
|
6267 |
{
|
|
6268 |
iRetrieve->Start(iStatus, DMMTSY_PHONE_CF_CONDITION_CFU, DMMTSY_PHONE_CF_SERVICE_GROUP_FAX, DMMTSY_PHONE_CF_CACHELOCATION);
|
|
6269 |
SetActive();
|
|
6270 |
iSingleServiceGroupTest = ETrue;
|
|
6271 |
}
|
|
6272 |
|
|
6273 |
void CTestPhone::CTestGetCFStatus::Start()
|
|
6274 |
{
|
|
6275 |
iRetrieve->Start(iStatus, DMMTSY_PHONE_CF_CONDITION_CFU, DMMTSY_PHONE_CF_LOCATION);
|
|
6276 |
TRequestStatus tmpStatus;
|
|
6277 |
iRetrieve->Start(tmpStatus, DMMTSY_PHONE_CF_CONDITION_CFU, DMMTSY_PHONE_CF_LOCATION);
|
|
6278 |
User::WaitForRequest(tmpStatus);
|
|
6279 |
iTestPhone->TEST(tmpStatus.Int() == KErrInUse);
|
|
6280 |
SetActive();
|
|
6281 |
iSingleServiceGroupTest = EFalse;
|
|
6282 |
}
|
|
6283 |
|
|
6284 |
CTestCanceller* CTestPhone::CTestGetCFStatus::RetrieveCancelPtr()
|
|
6285 |
{
|
|
6286 |
return iCanceller;
|
|
6287 |
}
|
|
6288 |
|
|
6289 |
void CTestPhone::CTestGetCFStatus::RunL()
|
|
6290 |
{
|
|
6291 |
TInt ret=iStatus.Int();
|
|
6292 |
|
|
6293 |
User::LeaveIfError(ret);
|
|
6294 |
if(iSingleServiceGroupTest)
|
|
6295 |
ret=CheckSingleServiceGroupResults();
|
|
6296 |
else
|
|
6297 |
ret=CheckResults();
|
|
6298 |
User::LeaveIfError(ret);
|
|
6299 |
|
|
6300 |
CActiveScheduler::Stop();
|
|
6301 |
}
|
|
6302 |
|
|
6303 |
|
|
6304 |
void CTestPhone::CTestGetCFStatus::DoCancel()
|
|
6305 |
{
|
|
6306 |
iRetrieve->Cancel();
|
|
6307 |
}
|
|
6308 |
|
|
6309 |
|
|
6310 |
TInt CTestPhone::CTestGetCFStatus::CheckResults()
|
|
6311 |
{
|
|
6312 |
TInt ret=KErrNone;
|
|
6313 |
|
|
6314 |
CMobilePhoneCFList* callForwardingList=NULL;
|
|
6315 |
TInt leaveCode=KErrNone;
|
|
6316 |
TRAP(leaveCode, callForwardingList=iRetrieve->RetrieveListL(););
|
|
6317 |
|
|
6318 |
if (callForwardingList)
|
|
6319 |
{
|
|
6320 |
iTestPhone->TEST(callForwardingList->Enumerate()==DMMTSY_CF_ENTRY_COUNT);
|
|
6321 |
|
|
6322 |
// Get each detected network entry
|
|
6323 |
RMobilePhone::TMobilePhoneCFInfoEntryV1 entry;
|
|
6324 |
|
|
6325 |
for (TInt i=0; i<DMMTSY_CALL_BARRING_COUNT; ++i)
|
|
6326 |
{
|
|
6327 |
TRAP(ret,entry=callForwardingList->GetEntryL(i));
|
|
6328 |
if (ret != KErrNone)
|
|
6329 |
break;
|
|
6330 |
switch(i)
|
|
6331 |
{
|
|
6332 |
case 0:
|
|
6333 |
{
|
|
6334 |
iTestPhone->TEST(entry.iCondition==DMMTSY_PHONE_CF_CONDITION_CFU);
|
|
6335 |
iTestPhone->TEST(entry.iServiceGroup==DMMTSY_PHONE_CF_SERVICE_GROUP_VOICE);
|
|
6336 |
iTestPhone->TEST(entry.iStatus==DMMTSY_PHONE_CF_NOT_ACTIVE);
|
|
6337 |
iTestPhone->TEST(entry.iNumber.iTelNumber==DMMTSY_PHONE_TEL_NUMBER);
|
|
6338 |
iTestPhone->TEST(entry.iTimeout==DMMTSY_PHONE_CF_TIMEOUT);
|
|
6339 |
break;
|
|
6340 |
}
|
|
6341 |
case 1:
|
|
6342 |
{
|
|
6343 |
iTestPhone->TEST(entry.iCondition==DMMTSY_PHONE_CF_CONDITION_CFU);
|
|
6344 |
iTestPhone->TEST(entry.iServiceGroup==DMMTSY_PHONE_CF_SERVICE_GROUP_DATA);
|
|
6345 |
iTestPhone->TEST(entry.iStatus==DMMTSY_PHONE_CF_ACTIVE);
|
|
6346 |
iTestPhone->TEST(entry.iNumber.iTelNumber==DMMTSY_PHONE_TEL_NUMBER);
|
|
6347 |
iTestPhone->TEST(entry.iTimeout==DMMTSY_PHONE_CF_TIMEOUT);
|
|
6348 |
break;
|
|
6349 |
}
|
|
6350 |
case 2:
|
|
6351 |
{
|
|
6352 |
iTestPhone->TEST(entry.iCondition==DMMTSY_PHONE_CF_CONDITION_CFU);
|
|
6353 |
iTestPhone->TEST(entry.iServiceGroup==DMMTSY_PHONE_CF_SERVICE_GROUP_FAX);
|
|
6354 |
iTestPhone->TEST(entry.iStatus==DMMTSY_PHONE_CF_ACTIVE);
|
|
6355 |
iTestPhone->TEST(entry.iNumber.iTelNumber==DMMTSY_PHONE_TEL_NUMBER);
|
|
6356 |
iTestPhone->TEST(entry.iTimeout==DMMTSY_PHONE_CF_TIMEOUT);
|
|
6357 |
}
|
|
6358 |
break;
|
|
6359 |
case 3:
|
|
6360 |
{
|
|
6361 |
iTestPhone->TEST(entry.iCondition==DMMTSY_PHONE_CF_CONDITION_CFU);
|
|
6362 |
iTestPhone->TEST(entry.iServiceGroup==DMMTSY_PHONE_CF_SERVICE_GROUP_AUXVOICE);
|
|
6363 |
iTestPhone->TEST(entry.iStatus==DMMTSY_PHONE_CF_UNKNOWN);
|
|
6364 |
iTestPhone->TEST(entry.iTimeout==DMMTSY_NO_CF_TIMEOUT);
|
|
6365 |
}
|
|
6366 |
break;
|
|
6367 |
default:
|
|
6368 |
break;
|
|
6369 |
}
|
|
6370 |
}
|
|
6371 |
delete callForwardingList;
|
|
6372 |
}
|
|
6373 |
return ret;
|
|
6374 |
}
|
|
6375 |
TInt CTestPhone::CTestGetCFStatus::CheckSingleServiceGroupResults()
|
|
6376 |
{
|
|
6377 |
TInt ret=KErrNone;
|
|
6378 |
|
|
6379 |
CMobilePhoneCFList* callForwardingList=NULL;
|
|
6380 |
TInt leaveCode=KErrNone;
|
|
6381 |
TRAP(leaveCode, callForwardingList=iRetrieve->RetrieveListL(););
|
|
6382 |
|
|
6383 |
if (callForwardingList)
|
|
6384 |
{
|
|
6385 |
iTestPhone->TEST(callForwardingList->Enumerate()==DMMTSY_CF_SINGLE_SERVICE_ENTRY_COUNT);
|
|
6386 |
|
|
6387 |
// Get the detected network entry
|
|
6388 |
RMobilePhone::TMobilePhoneCFInfoEntryV1 entry;
|
|
6389 |
TRAP(ret,entry=callForwardingList->GetEntryL(0));
|
|
6390 |
|
|
6391 |
iTestPhone->TEST(entry.iCondition==DMMTSY_PHONE_CF_CONDITION_CFU);
|
|
6392 |
iTestPhone->TEST(entry.iServiceGroup==DMMTSY_PHONE_CF_SERVICE_GROUP_FAX);
|
|
6393 |
iTestPhone->TEST(entry.iStatus==DMMTSY_PHONE_CF_ACTIVE);
|
|
6394 |
iTestPhone->TEST(entry.iNumber.iTelNumber==DMMTSY_PHONE_TEL_NUMBER);
|
|
6395 |
iTestPhone->TEST(entry.iTimeout==DMMTSY_PHONE_CF_TIMEOUT);
|
|
6396 |
|
|
6397 |
delete callForwardingList;
|
|
6398 |
}
|
|
6399 |
return ret;
|
|
6400 |
}
|
|
6401 |
|
|
6402 |
/**************************************************************/
|
|
6403 |
//
|
|
6404 |
// Testing asynchronous retrieve of call barring list
|
|
6405 |
//
|
|
6406 |
/**************************************************************/
|
|
6407 |
|
|
6408 |
CTestPhone::CTestGetCB* CTestPhone::CTestGetCB::NewLC(RMobilePhone& aPhone, CTestPhone* aTestPhone)
|
|
6409 |
{
|
|
6410 |
CTestGetCB* r=new(ELeave) CTestGetCB(aPhone, aTestPhone);
|
|
6411 |
CleanupStack::PushL(r);
|
|
6412 |
r->ConstructL();
|
|
6413 |
return r;
|
|
6414 |
}
|
|
6415 |
|
|
6416 |
CTestPhone::CTestGetCB::CTestGetCB(RMobilePhone& aPhone, CTestPhone* aTestPhone)
|
|
6417 |
: CActive(EPriorityNormal), iPhone(aPhone), iTestPhone(aTestPhone)
|
|
6418 |
{}
|
|
6419 |
|
|
6420 |
|
|
6421 |
void CTestPhone::CTestGetCB::ConstructL()
|
|
6422 |
{
|
|
6423 |
CActiveScheduler::Add(this);
|
|
6424 |
iRetrieve=CRetrieveMobilePhoneCBList::NewL(iPhone);
|
|
6425 |
iCanceller=new (ELeave) CTestCanceller(this);
|
|
6426 |
}
|
|
6427 |
|
|
6428 |
CTestPhone::CTestGetCB::~CTestGetCB()
|
|
6429 |
{
|
|
6430 |
delete iRetrieve;
|
|
6431 |
delete iCanceller;
|
|
6432 |
}
|
|
6433 |
|
|
6434 |
void CTestPhone::CTestGetCB::Start()
|
|
6435 |
{
|
|
6436 |
iRetrieve->Start(iStatus, DMMTSY_PHONE_CB_CONDITION, DMMTSY_PHONE_CB_LOCATION);
|
|
6437 |
TRequestStatus tmpStatus;
|
|
6438 |
iRetrieve->Start(tmpStatus, DMMTSY_PHONE_CB_CONDITION, DMMTSY_PHONE_CB_LOCATION);
|
|
6439 |
User::WaitForRequest(tmpStatus);
|
|
6440 |
iTestPhone->TEST(tmpStatus.Int() == KErrInUse);
|
|
6441 |
SetActive();
|
|
6442 |
}
|
|
6443 |
|
|
6444 |
CTestCanceller* CTestPhone::CTestGetCB::RetrieveCancelPtr()
|
|
6445 |
{
|
|
6446 |
return iCanceller;
|
|
6447 |
}
|
|
6448 |
|
|
6449 |
void CTestPhone::CTestGetCB::RunL()
|
|
6450 |
{
|
|
6451 |
TInt ret=iStatus.Int();
|
|
6452 |
|
|
6453 |
User::LeaveIfError(ret);
|
|
6454 |
ret=CheckResults();
|
|
6455 |
User::LeaveIfError(ret);
|
|
6456 |
|
|
6457 |
CActiveScheduler::Stop();
|
|
6458 |
}
|
|
6459 |
|
|
6460 |
|
|
6461 |
void CTestPhone::CTestGetCB::DoCancel()
|
|
6462 |
{
|
|
6463 |
iRetrieve->Cancel();
|
|
6464 |
}
|
|
6465 |
|
|
6466 |
|
|
6467 |
TInt CTestPhone::CTestGetCB::CheckResults()
|
|
6468 |
{
|
|
6469 |
TInt ret=KErrNone;
|
|
6470 |
|
|
6471 |
CMobilePhoneCBList* callBarringList=NULL;
|
|
6472 |
TInt leaveCode=KErrNone;
|
|
6473 |
TRAP(leaveCode, callBarringList=iRetrieve->RetrieveListL(););
|
|
6474 |
|
|
6475 |
if (callBarringList)
|
|
6476 |
{
|
|
6477 |
iTestPhone->TEST(callBarringList->Enumerate()==DMMTSY_CALL_BARRING_COUNT);
|
|
6478 |
|
|
6479 |
// Get each detected network entry
|
|
6480 |
RMobilePhone::TMobilePhoneCBInfoEntryV1 entry;
|
|
6481 |
|
|
6482 |
for (TInt i=0; i<DMMTSY_CALL_BARRING_COUNT; ++i)
|
|
6483 |
{
|
|
6484 |
TRAP(ret,entry=callBarringList->GetEntryL(i));
|
|
6485 |
if (ret != KErrNone)
|
|
6486 |
break;
|
|
6487 |
switch(i)
|
|
6488 |
{
|
|
6489 |
case 0:
|
|
6490 |
{
|
|
6491 |
iTestPhone->TEST(entry.iCondition == DMMTSY_PHONE_CB_CONDITION0);
|
|
6492 |
iTestPhone->TEST(entry.iServiceGroup == DMMTSY_PHONE_CB_SG0);
|
|
6493 |
iTestPhone->TEST(entry.iStatus == DMMTSY_PHONE_CB_STATUS0);
|
|
6494 |
break;
|
|
6495 |
}
|
|
6496 |
case 1:
|
|
6497 |
{
|
|
6498 |
iTestPhone->TEST(entry.iCondition == DMMTSY_PHONE_CB_CONDITION1);
|
|
6499 |
iTestPhone->TEST(entry.iServiceGroup == DMMTSY_PHONE_CB_SG1);
|
|
6500 |
iTestPhone->TEST(entry.iStatus == DMMTSY_PHONE_CB_STATUS1);
|
|
6501 |
break;
|
|
6502 |
}
|
|
6503 |
case 2:
|
|
6504 |
{
|
|
6505 |
iTestPhone->TEST(entry.iCondition == DMMTSY_PHONE_CB_CONDITION2);
|
|
6506 |
iTestPhone->TEST(entry.iServiceGroup == DMMTSY_PHONE_CB_SG2);
|
|
6507 |
iTestPhone->TEST(entry.iStatus == DMMTSY_PHONE_CB_STATUS2);
|
|
6508 |
}
|
|
6509 |
break;
|
|
6510 |
case 3:
|
|
6511 |
{
|
|
6512 |
iTestPhone->TEST(entry.iCondition == DMMTSY_PHONE_CB_CONDITION3);
|
|
6513 |
iTestPhone->TEST(entry.iServiceGroup == DMMTSY_PHONE_CB_SG3);
|
|
6514 |
iTestPhone->TEST(entry.iStatus == DMMTSY_PHONE_CB_STATUS3);
|
|
6515 |
}
|
|
6516 |
break;
|
|
6517 |
default:
|
|
6518 |
break;
|
|
6519 |
}
|
|
6520 |
}
|
|
6521 |
delete callBarringList;
|
|
6522 |
}
|
|
6523 |
return ret;
|
|
6524 |
}
|
|
6525 |
|
|
6526 |
/**************************************************************/
|
|
6527 |
//
|
|
6528 |
// Testing asynchronous retrieve of call waiting list
|
|
6529 |
//
|
|
6530 |
/**************************************************************/
|
|
6531 |
|
|
6532 |
CTestPhone::CTestGetCW* CTestPhone::CTestGetCW::NewLC(RMobilePhone& aPhone, CTestPhone* aTestPhone)
|
|
6533 |
{
|
|
6534 |
CTestGetCW* r=new(ELeave) CTestGetCW(aPhone, aTestPhone);
|
|
6535 |
CleanupStack::PushL(r);
|
|
6536 |
r->ConstructL();
|
|
6537 |
return r;
|
|
6538 |
}
|
|
6539 |
|
|
6540 |
CTestPhone::CTestGetCW::CTestGetCW(RMobilePhone& aPhone, CTestPhone* aTestPhone)
|
|
6541 |
: CActive(EPriorityNormal), iPhone(aPhone), iTestPhone(aTestPhone)
|
|
6542 |
{}
|
|
6543 |
|
|
6544 |
|
|
6545 |
void CTestPhone::CTestGetCW::ConstructL()
|
|
6546 |
{
|
|
6547 |
CActiveScheduler::Add(this);
|
|
6548 |
iRetrieve=CRetrieveMobilePhoneCWList::NewL(iPhone);
|
|
6549 |
iCanceller=new (ELeave) CTestCanceller(this);
|
|
6550 |
}
|
|
6551 |
|
|
6552 |
CTestPhone::CTestGetCW::~CTestGetCW()
|
|
6553 |
{
|
|
6554 |
delete iRetrieve;
|
|
6555 |
delete iCanceller;
|
|
6556 |
}
|
|
6557 |
|
|
6558 |
void CTestPhone::CTestGetCW::Start()
|
|
6559 |
{
|
|
6560 |
iRetrieve->Start(iStatus, DMMTSY_PHONE_CW_LOCATION);
|
|
6561 |
TRequestStatus tmpStatus;
|
|
6562 |
iRetrieve->Start(tmpStatus, DMMTSY_PHONE_CW_LOCATION);
|
|
6563 |
User::WaitForRequest(tmpStatus);
|
|
6564 |
iTestPhone->TEST(tmpStatus.Int() == KErrInUse);
|
|
6565 |
SetActive();
|
|
6566 |
}
|
|
6567 |
|
|
6568 |
CTestCanceller* CTestPhone::CTestGetCW::RetrieveCancelPtr()
|
|
6569 |
{
|
|
6570 |
return iCanceller;
|
|
6571 |
}
|
|
6572 |
|
|
6573 |
void CTestPhone::CTestGetCW::RunL()
|
|
6574 |
{
|
|
6575 |
TInt ret=iStatus.Int();
|
|
6576 |
|
|
6577 |
User::LeaveIfError(ret);
|
|
6578 |
ret=CheckResults();
|
|
6579 |
User::LeaveIfError(ret);
|
|
6580 |
|
|
6581 |
CActiveScheduler::Stop();
|
|
6582 |
}
|
|
6583 |
|
|
6584 |
|
|
6585 |
void CTestPhone::CTestGetCW::DoCancel()
|
|
6586 |
{
|
|
6587 |
iRetrieve->Cancel();
|
|
6588 |
}
|
|
6589 |
|
|
6590 |
|
|
6591 |
TInt CTestPhone::CTestGetCW::CheckResults()
|
|
6592 |
{
|
|
6593 |
TInt ret=KErrNone;
|
|
6594 |
|
|
6595 |
CMobilePhoneCWList* callWaitingList=NULL;
|
|
6596 |
TInt leaveCode=KErrNone;
|
|
6597 |
TRAP(leaveCode, callWaitingList=iRetrieve->RetrieveListL(););
|
|
6598 |
|
|
6599 |
if (callWaitingList)
|
|
6600 |
{
|
|
6601 |
iTestPhone->TEST(callWaitingList->Enumerate()==DMMTSY_CW_ENTRY_COUNT);
|
|
6602 |
|
|
6603 |
// Get each detected network entry
|
|
6604 |
RMobilePhone::TMobilePhoneCWInfoEntryV1 entry;
|
|
6605 |
|
|
6606 |
for (TInt i=0; i<DMMTSY_CW_ENTRY_COUNT; ++i)
|
|
6607 |
{
|
|
6608 |
TRAP(ret,entry=callWaitingList->GetEntryL(i));
|
|
6609 |
if (ret != KErrNone)
|
|
6610 |
break;
|
|
6611 |
switch(i)
|
|
6612 |
{
|
|
6613 |
case 0:
|
|
6614 |
{
|
|
6615 |
iTestPhone->TEST(entry.iServiceGroup == DMMTSY_PHONE_CW_SG0);
|
|
6616 |
iTestPhone->TEST(entry.iStatus == DMMTSY_PHONE_CW_STATUS0);
|
|
6617 |
break;
|
|
6618 |
}
|
|
6619 |
case 1:
|
|
6620 |
{
|
|
6621 |
iTestPhone->TEST(entry.iServiceGroup == DMMTSY_PHONE_CW_SG1);
|
|
6622 |
iTestPhone->TEST(entry.iStatus == DMMTSY_PHONE_CW_STATUS1);
|
|
6623 |
break;
|
|
6624 |
}
|
|
6625 |
case 2:
|
|
6626 |
{
|
|
6627 |
iTestPhone->TEST(entry.iServiceGroup == DMMTSY_PHONE_CW_SG2);
|
|
6628 |
iTestPhone->TEST(entry.iStatus == DMMTSY_PHONE_CW_STATUS2);
|
|
6629 |
}
|
|
6630 |
break;
|
|
6631 |
case 3:
|
|
6632 |
{
|
|
6633 |
iTestPhone->TEST(entry.iServiceGroup == DMMTSY_PHONE_CW_SG3);
|
|
6634 |
iTestPhone->TEST(entry.iStatus == DMMTSY_PHONE_CW_STATUS3);
|
|
6635 |
}
|
|
6636 |
break;
|
|
6637 |
default:
|
|
6638 |
break;
|
|
6639 |
}
|
|
6640 |
}
|
|
6641 |
delete callWaitingList;
|
|
6642 |
}
|
|
6643 |
return ret;
|
|
6644 |
}
|
|
6645 |
|
|
6646 |
/**************************************************************/
|
|
6647 |
//
|
|
6648 |
// Testing asynchronous retrieve of call completion list
|
|
6649 |
//
|
|
6650 |
/**************************************************************/
|
|
6651 |
|
|
6652 |
CTestPhone::CTestGetCcbs* CTestPhone::CTestGetCcbs::NewLC(RMobilePhone& aPhone, CTestPhone* aTestPhone)
|
|
6653 |
{
|
|
6654 |
CTestGetCcbs* r=new(ELeave) CTestGetCcbs(aPhone, aTestPhone);
|
|
6655 |
CleanupStack::PushL(r);
|
|
6656 |
r->ConstructL();
|
|
6657 |
return r;
|
|
6658 |
}
|
|
6659 |
|
|
6660 |
CTestPhone::CTestGetCcbs::CTestGetCcbs(RMobilePhone& aPhone, CTestPhone* aTestPhone)
|
|
6661 |
: CActive(EPriorityNormal), iPhone(aPhone), iTestPhone(aTestPhone)
|
|
6662 |
{}
|
|
6663 |
|
|
6664 |
|
|
6665 |
void CTestPhone::CTestGetCcbs::ConstructL()
|
|
6666 |
{
|
|
6667 |
CActiveScheduler::Add(this);
|
|
6668 |
iRetrieve=CRetrieveMobilePhoneCcbsList::NewL(iPhone);
|
|
6669 |
iCanceller=new (ELeave) CTestCanceller(this);
|
|
6670 |
}
|
|
6671 |
|
|
6672 |
CTestPhone::CTestGetCcbs::~CTestGetCcbs()
|
|
6673 |
{
|
|
6674 |
delete iRetrieve;
|
|
6675 |
delete iCanceller;
|
|
6676 |
}
|
|
6677 |
|
|
6678 |
void CTestPhone::CTestGetCcbs::Start()
|
|
6679 |
{
|
|
6680 |
iRetrieve->Start(iStatus);
|
|
6681 |
TRequestStatus tmpStatus;
|
|
6682 |
iRetrieve->Start(tmpStatus);
|
|
6683 |
User::WaitForRequest(tmpStatus);
|
|
6684 |
iTestPhone->TEST(tmpStatus.Int() == KErrInUse);
|
|
6685 |
SetActive();
|
|
6686 |
}
|
|
6687 |
|
|
6688 |
CTestCanceller* CTestPhone::CTestGetCcbs::RetrieveCancelPtr()
|
|
6689 |
{
|
|
6690 |
return iCanceller;
|
|
6691 |
}
|
|
6692 |
|
|
6693 |
void CTestPhone::CTestGetCcbs::RunL()
|
|
6694 |
{
|
|
6695 |
TInt ret=iStatus.Int();
|
|
6696 |
|
|
6697 |
User::LeaveIfError(ret);
|
|
6698 |
ret=CheckResults();
|
|
6699 |
User::LeaveIfError(ret);
|
|
6700 |
|
|
6701 |
CActiveScheduler::Stop();
|
|
6702 |
}
|
|
6703 |
|
|
6704 |
|
|
6705 |
void CTestPhone::CTestGetCcbs::DoCancel()
|
|
6706 |
{
|
|
6707 |
iRetrieve->Cancel();
|
|
6708 |
}
|
|
6709 |
|
|
6710 |
|
|
6711 |
TInt CTestPhone::CTestGetCcbs::CheckResults()
|
|
6712 |
{
|
|
6713 |
TInt ret=KErrNone;
|
|
6714 |
|
|
6715 |
CMobilePhoneCcbsList* callCompletionList=NULL;
|
|
6716 |
TInt leaveCode=KErrNone;
|
|
6717 |
TRAP(leaveCode, callCompletionList=iRetrieve->RetrieveListL(););
|
|
6718 |
|
|
6719 |
if (callCompletionList)
|
|
6720 |
{
|
|
6721 |
iTestPhone->TEST(callCompletionList->Enumerate()==DMMTSY_PHONE_CCC_ENTRY_COUNT);
|
|
6722 |
|
|
6723 |
// Get each detected completion request
|
|
6724 |
RMobilePhone::TMobilePhoneCCBSEntryV1 entry;
|
|
6725 |
|
|
6726 |
for (TInt i=0; i<DMMTSY_PHONE_CCC_ENTRY_COUNT; ++i)
|
|
6727 |
{
|
|
6728 |
TRAP(ret,entry=callCompletionList->GetEntryL(i));
|
|
6729 |
if (ret != KErrNone)
|
|
6730 |
break;
|
|
6731 |
switch(i)
|
|
6732 |
{
|
|
6733 |
case 0:
|
|
6734 |
{
|
|
6735 |
iTestPhone->TEST(entry.iServiceGroup==DMMTSY_PHONE_CCC_SERVICE_GROUP0);
|
|
6736 |
iTestPhone->TEST(entry.iCcbsIndex == DMMTSY_PHONE_CCC_INDEX0);
|
|
6737 |
iTestPhone->TEST(entry.iDestination.iTypeOfNumber == DMMTSY_PHONE_CCC_DESTINATION_TON0);
|
|
6738 |
iTestPhone->TEST(entry.iDestination.iNumberPlan == DMMTSY_PHONE_CCC_DESTINATION_NP0);
|
|
6739 |
iTestPhone->TEST(entry.iDestination.iTelNumber.Compare(DMMTSY_PHONE_CCC_DESTINATION_NUM0) == 0);
|
|
6740 |
break;
|
|
6741 |
}
|
|
6742 |
case 1:
|
|
6743 |
{
|
|
6744 |
iTestPhone->TEST(entry.iServiceGroup==DMMTSY_PHONE_CCC_SERVICE_GROUP1);
|
|
6745 |
iTestPhone->TEST(entry.iCcbsIndex == DMMTSY_PHONE_CCC_INDEX1);
|
|
6746 |
iTestPhone->TEST(entry.iDestination.iTypeOfNumber == DMMTSY_PHONE_CCC_DESTINATION_TON1);
|
|
6747 |
iTestPhone->TEST(entry.iDestination.iNumberPlan == DMMTSY_PHONE_CCC_DESTINATION_NP1);
|
|
6748 |
iTestPhone->TEST(entry.iDestination.iTelNumber.Compare(DMMTSY_PHONE_CCC_DESTINATION_NUM1) == 0);
|
|
6749 |
break;
|
|
6750 |
}
|
|
6751 |
case 2:
|
|
6752 |
{
|
|
6753 |
iTestPhone->TEST(entry.iServiceGroup==DMMTSY_PHONE_CCC_SERVICE_GROUP2);
|
|
6754 |
iTestPhone->TEST(entry.iCcbsIndex == DMMTSY_PHONE_CCC_INDEX2);
|
|
6755 |
iTestPhone->TEST(entry.iDestination.iTypeOfNumber == DMMTSY_PHONE_CCC_DESTINATION_TON2);
|
|
6756 |
iTestPhone->TEST(entry.iDestination.iNumberPlan == DMMTSY_PHONE_CCC_DESTINATION_NP2);
|
|
6757 |
iTestPhone->TEST(entry.iDestination.iTelNumber.Compare(DMMTSY_PHONE_CCC_DESTINATION_NUM2) == 0);
|
|
6758 |
}
|
|
6759 |
break;
|
|
6760 |
case 3:
|
|
6761 |
{
|
|
6762 |
iTestPhone->TEST(entry.iServiceGroup==DMMTSY_PHONE_CCC_SERVICE_GROUP3);
|
|
6763 |
iTestPhone->TEST(entry.iCcbsIndex == DMMTSY_PHONE_CCC_INDEX3);
|
|
6764 |
iTestPhone->TEST(entry.iDestination.iTypeOfNumber == DMMTSY_PHONE_CCC_DESTINATION_TON3);
|
|
6765 |
iTestPhone->TEST(entry.iDestination.iNumberPlan == DMMTSY_PHONE_CCC_DESTINATION_NP3);
|
|
6766 |
iTestPhone->TEST(entry.iDestination.iTelNumber.Compare(DMMTSY_PHONE_CCC_DESTINATION_NUM3) == 0);
|
|
6767 |
}
|
|
6768 |
break;
|
|
6769 |
default:
|
|
6770 |
break;
|
|
6771 |
}
|
|
6772 |
}
|
|
6773 |
delete callCompletionList;
|
|
6774 |
}
|
|
6775 |
return ret;
|
|
6776 |
}
|
|
6777 |
|
|
6778 |
/**************************************************************/
|
|
6779 |
//
|
|
6780 |
// Testing asynchronous retrieve of preferred stored network list
|
|
6781 |
//
|
|
6782 |
/**************************************************************/
|
|
6783 |
|
|
6784 |
|
|
6785 |
CTestPhone::CTestGetPreferredNetworks* CTestPhone::CTestGetPreferredNetworks::NewLC(RMobilePhone& aPhone, CTestPhone* aTestPhone)
|
|
6786 |
{
|
|
6787 |
CTestGetPreferredNetworks* r=new(ELeave) CTestGetPreferredNetworks(aPhone, aTestPhone);
|
|
6788 |
CleanupStack::PushL(r);
|
|
6789 |
r->ConstructL();
|
|
6790 |
return r;
|
|
6791 |
}
|
|
6792 |
|
|
6793 |
CTestPhone::CTestGetPreferredNetworks::CTestGetPreferredNetworks(RMobilePhone& aPhone, CTestPhone* aTestPhone)
|
|
6794 |
: CActive(EPriorityNormal), iPhone(aPhone),iTestPhone(aTestPhone)
|
|
6795 |
{}
|
|
6796 |
|
|
6797 |
|
|
6798 |
void CTestPhone::CTestGetPreferredNetworks::ConstructL()
|
|
6799 |
{
|
|
6800 |
CActiveScheduler::Add(this);
|
|
6801 |
iRetrieve=CRetrieveMobilePhonePreferredNetworks::NewL(iPhone);
|
|
6802 |
iCanceller=new (ELeave) CTestCanceller(this);
|
|
6803 |
}
|
|
6804 |
|
|
6805 |
CTestPhone::CTestGetPreferredNetworks::~CTestGetPreferredNetworks()
|
|
6806 |
{
|
|
6807 |
delete iRetrieve;
|
|
6808 |
delete iCanceller;
|
|
6809 |
}
|
|
6810 |
|
|
6811 |
void CTestPhone::CTestGetPreferredNetworks::Start()
|
|
6812 |
{
|
|
6813 |
iRetrieve->Start(iStatus);
|
|
6814 |
TRequestStatus tmpStatus;
|
|
6815 |
iRetrieve->Start(tmpStatus);
|
|
6816 |
User::WaitForRequest(tmpStatus);
|
|
6817 |
iTestPhone->TEST(tmpStatus.Int() == KErrInUse);
|
|
6818 |
SetActive();
|
|
6819 |
}
|
|
6820 |
|
|
6821 |
CTestCanceller* CTestPhone::CTestGetPreferredNetworks::RetrieveCancelPtr()
|
|
6822 |
{
|
|
6823 |
return iCanceller;
|
|
6824 |
}
|
|
6825 |
|
|
6826 |
void CTestPhone::CTestGetPreferredNetworks::RunL()
|
|
6827 |
{
|
|
6828 |
TInt ret=iStatus.Int();
|
|
6829 |
|
|
6830 |
User::LeaveIfError(ret);
|
|
6831 |
ret=CheckResults();
|
|
6832 |
User::LeaveIfError(ret);
|
|
6833 |
ret=CheckPrefNetworksErrorResultsL();
|
|
6834 |
User::LeaveIfError(ret);
|
|
6835 |
CActiveScheduler::Stop();
|
|
6836 |
}
|
|
6837 |
|
|
6838 |
|
|
6839 |
void CTestPhone::CTestGetPreferredNetworks::DoCancel()
|
|
6840 |
{
|
|
6841 |
iRetrieve->Cancel();
|
|
6842 |
}
|
|
6843 |
|
|
6844 |
TInt CTestPhone::CTestGetPreferredNetworks::CheckResults()
|
|
6845 |
{
|
|
6846 |
TInt ret=KErrNone;
|
|
6847 |
|
|
6848 |
CMobilePhoneStoredNetworkList* networkList=NULL;
|
|
6849 |
TInt leaveCode=KErrNone;
|
|
6850 |
TRAP(leaveCode, networkList=iRetrieve->RetrieveListL(););
|
|
6851 |
|
|
6852 |
if (networkList)
|
|
6853 |
{
|
|
6854 |
iTestPhone->TEST(networkList->Enumerate()==DMMTSY_PHONE_NTWK_LIST_ENTRIES);
|
|
6855 |
|
|
6856 |
// Get each stored network entry
|
|
6857 |
RMobilePhone::TMobilePreferredNetworkEntryV3 entry;
|
|
6858 |
|
|
6859 |
for (TInt i=0; i<DMMTSY_PHONE_NTWK_LIST_ENTRIES; ++i)
|
|
6860 |
{
|
|
6861 |
TRAP(ret,entry=networkList->GetEntryL(i));
|
|
6862 |
if (ret != KErrNone)
|
|
6863 |
break;
|
|
6864 |
switch(i)
|
|
6865 |
{
|
|
6866 |
case 0:
|
|
6867 |
{
|
|
6868 |
iTestPhone->TEST(entry.iAccess == DMMTSY_PHONE_NTWK_LIST_ACCESS_CAPS_GSM);
|
|
6869 |
iTestPhone->TEST(entry.iUserDefined == DMMTSY_PHONE_NTWK_LIST_USER_DEFINED_FALSE);
|
|
6870 |
iTestPhone->TEST(entry.iCountryCode == DMMTSY_PHONE_NTWK_LIST_COUNTRY_ID1);
|
|
6871 |
iTestPhone->TEST(entry.iNetworkId == DMMTSY_PHONE_NTWK_LIST_NETWORK_ID1);
|
|
6872 |
}
|
|
6873 |
break;
|
|
6874 |
case 1:
|
|
6875 |
{
|
|
6876 |
iTestPhone->TEST(entry.iAccess == DMMTSY_PHONE_NTWK_LIST_ACCESS_CAPS_GSMC);
|
|
6877 |
iTestPhone->TEST(entry.iUserDefined == DMMTSY_PHONE_NTWK_LIST_USER_DEFINED_FALSE);
|
|
6878 |
iTestPhone->TEST(entry.iCountryCode == DMMTSY_PHONE_NTWK_LIST_COUNTRY_ID2);
|
|
6879 |
iTestPhone->TEST(entry.iNetworkId == DMMTSY_PHONE_NTWK_LIST_NETWORK_ID2);
|
|
6880 |
}
|
|
6881 |
break;
|
|
6882 |
case 2:
|
|
6883 |
default:
|
|
6884 |
{
|
|
6885 |
iTestPhone->TEST(entry.iAccess == DMMTSY_PHONE_NTWK_LIST_ACCESS_CAPS_UTRAN);
|
|
6886 |
iTestPhone->TEST(entry.iUserDefined == DMMTSY_PHONE_NTWK_LIST_USER_DEFINED_TRUE);
|
|
6887 |
iTestPhone->TEST(entry.iCountryCode == DMMTSY_PHONE_NTWK_LIST_COUNTRY_ID2);
|
|
6888 |
iTestPhone->TEST(entry.iNetworkId == DMMTSY_PHONE_NTWK_LIST_NETWORK_ID1);
|
|
6889 |
}
|
|
6890 |
break;
|
|
6891 |
case 3:
|
|
6892 |
{
|
|
6893 |
iTestPhone->TEST(entry.iAccess == DMMTSY_PHONE_NTWK_LIST_ACCESS_CAPS_WLAN);
|
|
6894 |
iTestPhone->TEST(entry.iUserDefined == DMMTSY_PHONE_NTWK_LIST_USER_DEFINED_TRUE);
|
|
6895 |
iTestPhone->TEST(entry.iCountryCode == DMMTSY_PHONE_NTWK_LIST_COUNTRY_ID2);
|
|
6896 |
iTestPhone->TEST(entry.iNetworkId == DMMTSY_PHONE_NTWK_LIST_NETWORK_ID1);
|
|
6897 |
break;
|
|
6898 |
}
|
|
6899 |
}
|
|
6900 |
}
|
|
6901 |
delete networkList;
|
|
6902 |
}
|
|
6903 |
return ret;
|
|
6904 |
}
|
|
6905 |
TInt CTestPhone::CTestGetPreferredNetworks::CheckPrefNetworksErrorResultsL()
|
|
6906 |
{
|
|
6907 |
|
|
6908 |
CMobilePhoneStoredNetworkList* networkList=NULL;
|
|
6909 |
TInt leaveCode=KErrNone;
|
|
6910 |
CRetrieveMobilePhonePreferredNetworks* preferredNetworksList = CRetrieveMobilePhonePreferredNetworks::NewL(iPhone);
|
|
6911 |
CleanupStack::PushL(preferredNetworksList);
|
|
6912 |
TRAP(leaveCode, networkList=iRetrieve->RetrieveListL(););
|
|
6913 |
if(networkList == NULL)
|
|
6914 |
{
|
|
6915 |
iTestPhone->INFO_PRINTF1(_L("preferredNetworksList->RetrieveListL() returned NULL."));
|
|
6916 |
}
|
|
6917 |
CleanupStack::PopAndDestroy();
|
|
6918 |
//Check that a list is returned back to the test
|
|
6919 |
if(leaveCode == KErrNotFound)
|
|
6920 |
{
|
|
6921 |
leaveCode = KErrNone;
|
|
6922 |
}
|
|
6923 |
return leaveCode;
|
|
6924 |
}
|
|
6925 |
|
|
6926 |
CTestPhone::CTestRetrieveMobilePhoneAuthenticationIds* CTestPhone::CTestRetrieveMobilePhoneAuthenticationIds::NewLC(RMobilePhone& aPhone,CTestPhone* aTestPhone)
|
|
6927 |
{
|
|
6928 |
CTestRetrieveMobilePhoneAuthenticationIds* r=new(ELeave) CTestRetrieveMobilePhoneAuthenticationIds(aPhone,aTestPhone);
|
|
6929 |
CleanupStack::PushL(r);
|
|
6930 |
r->ConstructL();
|
|
6931 |
return r;
|
|
6932 |
}
|
|
6933 |
|
|
6934 |
CTestPhone::CTestRetrieveMobilePhoneAuthenticationIds::CTestRetrieveMobilePhoneAuthenticationIds(RMobilePhone& aPhone,CTestPhone* aTestPhone)
|
|
6935 |
: CActive(EPriorityNormal), iPhone(aPhone), iTestPhone(aTestPhone)
|
|
6936 |
{}
|
|
6937 |
|
|
6938 |
void CTestPhone::CTestRetrieveMobilePhoneAuthenticationIds::ConstructL()
|
|
6939 |
{
|
|
6940 |
CActiveScheduler::Add(this);
|
|
6941 |
|
|
6942 |
iRetrieveAuthId=CRetrieveMobilePhoneAuthenticationIds::NewL(iPhone);
|
|
6943 |
iCanceller=new (ELeave) CTestCanceller(this);
|
|
6944 |
}
|
|
6945 |
|
|
6946 |
CTestPhone::CTestRetrieveMobilePhoneAuthenticationIds::~CTestRetrieveMobilePhoneAuthenticationIds()
|
|
6947 |
{
|
|
6948 |
delete iRetrieveAuthId;
|
|
6949 |
delete iCanceller;
|
|
6950 |
}
|
|
6951 |
|
|
6952 |
void CTestPhone::CTestRetrieveMobilePhoneAuthenticationIds::SetAuthType(TTypeOfAuth aAuthType)
|
|
6953 |
{
|
|
6954 |
iAuthType = aAuthType;
|
|
6955 |
if(iAuthType == 0)
|
|
6956 |
{
|
|
6957 |
iTestPhone->INFO_PRINTF1(_L("Authentication Type is GBA..."));
|
|
6958 |
}
|
|
6959 |
else if (iAuthType == 1)
|
|
6960 |
{
|
|
6961 |
iTestPhone->INFO_PRINTF1(_L("Authentication Type is MBMS..."));
|
|
6962 |
}
|
|
6963 |
else
|
|
6964 |
{}
|
|
6965 |
}
|
|
6966 |
|
|
6967 |
void CTestPhone::CTestRetrieveMobilePhoneAuthenticationIds::TestRetrieve(RMobilePhone::TAuthData aAuthData,TBool aStartReqd)
|
|
6968 |
{
|
|
6969 |
if(aStartReqd)
|
|
6970 |
{
|
|
6971 |
Start(aAuthData);
|
|
6972 |
}
|
|
6973 |
CActiveScheduler::Start();
|
|
6974 |
}
|
|
6975 |
|
|
6976 |
void CTestPhone::CTestRetrieveMobilePhoneAuthenticationIds::Start(RMobilePhone::TAuthData aAuthData)
|
|
6977 |
{
|
|
6978 |
//If iTestVersion is set to EGba, test calling the Gba retrieval method
|
|
6979 |
RMobilePhone::TAuthInfoV8 tAuthInfoV8;
|
|
6980 |
RMobilePhone::TAuthInfoV8Pckg tAuthInfoV8Pckgd(tAuthInfoV8);
|
|
6981 |
|
|
6982 |
tAuthInfoV8.iAID = DMMTSY_PHONE_GBA_AID();
|
|
6983 |
|
|
6984 |
if(iAuthType==CTestRetrieveMobilePhoneAuthenticationIds::EGba)
|
|
6985 |
{
|
|
6986 |
tAuthInfoV8.iData = aAuthData;
|
|
6987 |
iRetrieveAuthId->Start(iStatus,tAuthInfoV8Pckgd);
|
|
6988 |
TRequestStatus tmpStatus;
|
|
6989 |
iRetrieveAuthId->Start(tmpStatus,tAuthInfoV8Pckgd);
|
|
6990 |
User::WaitForRequest(tmpStatus);
|
|
6991 |
iTestPhone->TEST(tmpStatus.Int() == KErrInUse);
|
|
6992 |
SetActive();
|
|
6993 |
}
|
|
6994 |
//If iTestVersion is set to EMbms, test calling the Mbms retrieval method
|
|
6995 |
else if(iAuthType==CTestRetrieveMobilePhoneAuthenticationIds::EMbms)
|
|
6996 |
{
|
|
6997 |
tAuthInfoV8.iData = aAuthData;
|
|
6998 |
iRetrieveAuthId->Start(iStatus,tAuthInfoV8Pckgd);
|
|
6999 |
TRequestStatus tmpStatus;
|
|
7000 |
iRetrieveAuthId->Start(tmpStatus,tAuthInfoV8Pckgd);
|
|
7001 |
User::WaitForRequest(tmpStatus);
|
|
7002 |
iTestPhone->TEST(tmpStatus.Int() == KErrInUse);
|
|
7003 |
SetActive();
|
|
7004 |
}
|
|
7005 |
else
|
|
7006 |
{}
|
|
7007 |
}
|
|
7008 |
|
|
7009 |
void CTestPhone::CTestRetrieveMobilePhoneAuthenticationIds::RunL()
|
|
7010 |
{
|
|
7011 |
TInt ret=iStatus.Int();
|
|
7012 |
|
|
7013 |
User::LeaveIfError(ret);
|
|
7014 |
if (iAuthType==EGba)
|
|
7015 |
{
|
|
7016 |
ret=CheckGBAResults();
|
|
7017 |
User::LeaveIfError(ret);
|
|
7018 |
ret=CheckGBAErrorResults();
|
|
7019 |
}
|
|
7020 |
else if(iAuthType==EMbms)
|
|
7021 |
{
|
|
7022 |
ret=CheckMBMSResults();
|
|
7023 |
User::LeaveIfError(ret);
|
|
7024 |
ret=CheckMBMSErrorResults();
|
|
7025 |
}
|
|
7026 |
|
|
7027 |
User::LeaveIfError(ret);
|
|
7028 |
|
|
7029 |
CActiveScheduler::Stop();
|
|
7030 |
}
|
|
7031 |
|
|
7032 |
void CTestPhone::CTestRetrieveMobilePhoneAuthenticationIds::TestCancel(RMobilePhone::TAuthData aAuthData)
|
|
7033 |
{
|
|
7034 |
Start(aAuthData);
|
|
7035 |
|
|
7036 |
CTestCanceller* cancelGetNetworks = RetrieveCancelPtr();
|
|
7037 |
cancelGetNetworks->Call();
|
|
7038 |
|
|
7039 |
CActiveScheduler::Start();
|
|
7040 |
TBool cancelled = (iStatus == KErrCancel);
|
|
7041 |
|
|
7042 |
//Ensure that the same AO can be utilised further.
|
|
7043 |
Start(aAuthData);
|
|
7044 |
CActiveScheduler::Start();
|
|
7045 |
|
|
7046 |
if (cancelled)
|
|
7047 |
{
|
|
7048 |
iTestPhone->INFO_PRINTF2(_L("Cancelled Type of Authentication is %d"),iAuthType);
|
|
7049 |
iTestPhone->INFO_PRINTF1(_L("Test - CRetrieveMobilePhoneAuthenticationIds (async & cancel (Cancelled Request)) passed"));
|
|
7050 |
}
|
|
7051 |
else
|
|
7052 |
{
|
|
7053 |
iTestPhone->INFO_PRINTF1(_L("Test - CRetrieveMobilePhoneAuthenticationIds (async & cancel (Request Not Cancelled)) passed"));
|
|
7054 |
}
|
|
7055 |
}
|
|
7056 |
|
|
7057 |
CTestCanceller* CTestPhone::CTestRetrieveMobilePhoneAuthenticationIds::RetrieveCancelPtr()
|
|
7058 |
{
|
|
7059 |
return iCanceller;
|
|
7060 |
}
|
|
7061 |
|
|
7062 |
void CTestPhone::CTestRetrieveMobilePhoneAuthenticationIds::DoCancel()
|
|
7063 |
{
|
|
7064 |
iRetrieveAuthId->Cancel();
|
|
7065 |
}
|
|
7066 |
|
|
7067 |
TInt CTestPhone::CTestRetrieveMobilePhoneAuthenticationIds::CheckGBAResults()
|
|
7068 |
{
|
|
7069 |
TInt ret=KErrNone;
|
|
7070 |
|
|
7071 |
CMobilePhoneGbaNafIdList* nafList =NULL;
|
|
7072 |
TInt leaveCode=KErrNone;
|
|
7073 |
TRAP(leaveCode, nafList=iRetrieveAuthId->RetrieveGbaListL());
|
|
7074 |
|
|
7075 |
//Check that a list is returned back to the test
|
|
7076 |
iTestPhone->TEST(nafList!=NULL);
|
|
7077 |
|
|
7078 |
if (nafList)
|
|
7079 |
{
|
|
7080 |
//Check that the number of entries in the list is as expected
|
|
7081 |
iTestPhone->TEST(nafList->Enumerate()==DMMTSY_PHONE_GBA_NAFLIST_COUNT);
|
|
7082 |
|
|
7083 |
// Get each NafList entry
|
|
7084 |
RMobilePhone::TGbaNafEntryV8 nafEntry;
|
|
7085 |
|
|
7086 |
for (TInt i=0; i<DMMTSY_PHONE_GBA_NAFLIST_COUNT; ++i)
|
|
7087 |
{
|
|
7088 |
TRAP(ret,nafEntry=nafList->GetEntryL(i));
|
|
7089 |
if (ret != KErrNone)
|
|
7090 |
{
|
|
7091 |
break;
|
|
7092 |
}
|
|
7093 |
switch(i)
|
|
7094 |
{
|
|
7095 |
case 0:
|
|
7096 |
{
|
|
7097 |
iTestPhone->TEST(nafEntry.iBtid == DMMTSY_PHONE_GBA_NAFLIST_BTID_ONE);
|
|
7098 |
iTestPhone->TEST(nafEntry.iNafId == DMMTSY_PHONE_GBA_NAFLIST_NAFID_ONE);
|
|
7099 |
break;
|
|
7100 |
}
|
|
7101 |
case 1:
|
|
7102 |
{
|
|
7103 |
iTestPhone->TEST(nafEntry.iBtid == DMMTSY_PHONE_GBA_NAFLIST_BTID_TWO);
|
|
7104 |
iTestPhone->TEST(nafEntry.iNafId == DMMTSY_PHONE_GBA_NAFLIST_NAFID_TWO);
|
|
7105 |
break;
|
|
7106 |
}
|
|
7107 |
case 2:
|
|
7108 |
{
|
|
7109 |
iTestPhone->TEST(nafEntry.iBtid == DMMTSY_PHONE_GBA_NAFLIST_BTID_THREE);
|
|
7110 |
iTestPhone->TEST(nafEntry.iNafId == DMMTSY_PHONE_GBA_NAFLIST_NAFID_THREE);
|
|
7111 |
break;
|
|
7112 |
}
|
|
7113 |
default:
|
|
7114 |
break;
|
|
7115 |
}
|
|
7116 |
}
|
|
7117 |
delete nafList;
|
|
7118 |
}
|
|
7119 |
return ret;
|
|
7120 |
}
|
|
7121 |
|
|
7122 |
TInt CTestPhone::CTestRetrieveMobilePhoneAuthenticationIds::CheckGBAErrorResults()
|
|
7123 |
{
|
|
7124 |
|
|
7125 |
CMobilePhoneGbaNafIdList* nafList =NULL;
|
|
7126 |
TInt leaveCode=KErrNone;
|
|
7127 |
TRAP(leaveCode, nafList=iRetrieveAuthId->RetrieveGbaListL());
|
|
7128 |
if(nafList == NULL)
|
|
7129 |
{
|
|
7130 |
iTestPhone->INFO_PRINTF1(_L("iRetrieveAuthId->RetrieveGbaListL() returned NULL."));
|
|
7131 |
}
|
|
7132 |
|
|
7133 |
//Check that a list is returned back to the test
|
|
7134 |
if(leaveCode == KErrNotFound)
|
|
7135 |
{
|
|
7136 |
leaveCode = KErrNone;
|
|
7137 |
}
|
|
7138 |
return leaveCode;
|
|
7139 |
}
|
|
7140 |
|
|
7141 |
TInt CTestPhone::CTestRetrieveMobilePhoneAuthenticationIds::CheckMBMSResults()
|
|
7142 |
{
|
|
7143 |
TInt ret=KErrNone;
|
|
7144 |
|
|
7145 |
CMobilePhoneMbmsMskIdList* mbmsList =NULL;
|
|
7146 |
TInt leaveCode=KErrNone;
|
|
7147 |
TRAP(leaveCode, mbmsList=iRetrieveAuthId->RetrieveMbmsListL());
|
|
7148 |
|
|
7149 |
//Check that a list is returned back to the test
|
|
7150 |
iTestPhone->TEST(mbmsList!=NULL);
|
|
7151 |
|
|
7152 |
if (mbmsList)
|
|
7153 |
{
|
|
7154 |
//Check that the number of entries in the list is as expected
|
|
7155 |
iTestPhone->TEST(mbmsList->Enumerate()==DMMTSY_PHONE_MBMS_LIST_COUNT);
|
|
7156 |
|
|
7157 |
// Get each MbmsList entry
|
|
7158 |
RMobilePhone::TMskEntryV8 mbmsEntry;
|
|
7159 |
|
|
7160 |
for (TInt i=0; i<DMMTSY_PHONE_MBMS_LIST_COUNT; ++i)
|
|
7161 |
{
|
|
7162 |
TRAP(ret,mbmsEntry=mbmsList->GetEntryL(i));
|
|
7163 |
if (ret != KErrNone)
|
|
7164 |
{
|
|
7165 |
break;
|
|
7166 |
}
|
|
7167 |
switch(i)
|
|
7168 |
{
|
|
7169 |
case 0:
|
|
7170 |
{
|
|
7171 |
iTestPhone->TEST(mbmsEntry.iKeyDomainId == DMMTSY_PHONE_MBMSLIST_KEYDMN_ONE);
|
|
7172 |
iTestPhone->TEST(mbmsEntry.iMskId == DMMTSY_PHONE_MBMSLIST_MSKID_ONE);
|
|
7173 |
iTestPhone->TEST(mbmsEntry.iTimeStampCounter == DMMTSY_PHONE_MBMSLIST_TIMESTM_ONE );
|
|
7174 |
break;
|
|
7175 |
}
|
|
7176 |
case 1:
|
|
7177 |
{
|
|
7178 |
iTestPhone->TEST(mbmsEntry.iKeyDomainId == DMMTSY_PHONE_MBMSLIST_KEYDMN_TWO);
|
|
7179 |
iTestPhone->TEST(mbmsEntry.iMskId == DMMTSY_PHONE_MBMSLIST_MSKID_TWO);
|
|
7180 |
iTestPhone->TEST(mbmsEntry.iTimeStampCounter == DMMTSY_PHONE_MBMSLIST_TIMESTM_TWO);
|
|
7181 |
break;
|
|
7182 |
}
|
|
7183 |
case 2:
|
|
7184 |
{
|
|
7185 |
iTestPhone->TEST(mbmsEntry.iKeyDomainId == DMMTSY_PHONE_MBMSLIST_KEYDMN_THREE);
|
|
7186 |
iTestPhone->TEST(mbmsEntry.iMskId == DMMTSY_PHONE_MBMSLIST_MSKID_THREE);
|
|
7187 |
iTestPhone->TEST(mbmsEntry.iTimeStampCounter == DMMTSY_PHONE_MBMSLIST_TIMESTM_THREE);
|
|
7188 |
break;
|
|
7189 |
}
|
|
7190 |
default:
|
|
7191 |
break;
|
|
7192 |
}
|
|
7193 |
}
|
|
7194 |
delete mbmsList;
|
|
7195 |
}
|
|
7196 |
return ret;
|
|
7197 |
}
|
|
7198 |
|
|
7199 |
TInt CTestPhone::CTestRetrieveMobilePhoneAuthenticationIds::CheckMBMSErrorResults()
|
|
7200 |
{
|
|
7201 |
|
|
7202 |
CMobilePhoneMbmsMskIdList* mbmsList =NULL;
|
|
7203 |
TInt leaveCode=KErrNone;
|
|
7204 |
TRAP(leaveCode, mbmsList=iRetrieveAuthId->RetrieveMbmsListL());
|
|
7205 |
if(mbmsList == NULL)
|
|
7206 |
{
|
|
7207 |
iTestPhone->INFO_PRINTF1(_L("iRetrieveAuthId->RetrieveMbmsListL() returned NULL."));
|
|
7208 |
}
|
|
7209 |
|
|
7210 |
//Check that a list is returned back to the test
|
|
7211 |
if(leaveCode == KErrNotFound)
|
|
7212 |
{
|
|
7213 |
leaveCode = KErrNone;
|
|
7214 |
}
|
|
7215 |
return leaveCode;
|
|
7216 |
}
|
|
7217 |
|
|
7218 |
CTestPhone::CTestRetrieveMobilePhonePreferredWlanSIDs* CTestPhone::CTestRetrieveMobilePhonePreferredWlanSIDs::NewLC(RMobilePhone& aPhone,CTestPhone* aTestPhone)
|
|
7219 |
{
|
|
7220 |
CTestRetrieveMobilePhonePreferredWlanSIDs* r=new(ELeave) CTestRetrieveMobilePhonePreferredWlanSIDs(aPhone,aTestPhone);
|
|
7221 |
CleanupStack::PushL(r);
|
|
7222 |
r->ConstructL();
|
|
7223 |
return r;
|
|
7224 |
}
|
|
7225 |
|
|
7226 |
CTestPhone::CTestRetrieveMobilePhonePreferredWlanSIDs::CTestRetrieveMobilePhonePreferredWlanSIDs(RMobilePhone& aPhone,CTestPhone* aTestPhone)
|
|
7227 |
: CActive(EPriorityNormal), iPhone(aPhone),iTestPhone(aTestPhone)
|
|
7228 |
{}
|
|
7229 |
|
|
7230 |
void CTestPhone::CTestRetrieveMobilePhonePreferredWlanSIDs::ConstructL()
|
|
7231 |
{
|
|
7232 |
CActiveScheduler::Add(this);
|
|
7233 |
iRetrieve=CRetrieveMobilePhonePreferredWlanSIDs::NewL(iPhone);
|
|
7234 |
iCanceller=new (ELeave) CTestCanceller(this);
|
|
7235 |
}
|
|
7236 |
|
|
7237 |
CTestPhone::CTestRetrieveMobilePhonePreferredWlanSIDs::~CTestRetrieveMobilePhonePreferredWlanSIDs()
|
|
7238 |
{
|
|
7239 |
delete iRetrieve;
|
|
7240 |
delete iCanceller;
|
|
7241 |
}
|
|
7242 |
|
|
7243 |
void CTestPhone::CTestRetrieveMobilePhonePreferredWlanSIDs::TestRetrieve(TBool aStartReqd)
|
|
7244 |
{
|
|
7245 |
if(aStartReqd)
|
|
7246 |
{
|
|
7247 |
Start();
|
|
7248 |
}
|
|
7249 |
CActiveScheduler::Start();
|
|
7250 |
}
|
|
7251 |
|
|
7252 |
void CTestPhone::CTestRetrieveMobilePhonePreferredWlanSIDs::Start()
|
|
7253 |
{
|
|
7254 |
iRetrieve->Start(iStatus);
|
|
7255 |
TRequestStatus tmpStatus;
|
|
7256 |
iRetrieve->Start(tmpStatus);
|
|
7257 |
User::WaitForRequest(tmpStatus);
|
|
7258 |
iTestPhone->TEST(tmpStatus.Int() == KErrInUse);
|
|
7259 |
SetActive();
|
|
7260 |
}
|
|
7261 |
|
|
7262 |
void CTestPhone::CTestRetrieveMobilePhonePreferredWlanSIDs::RunL()
|
|
7263 |
{
|
|
7264 |
TInt ret=iStatus.Int();
|
|
7265 |
User::LeaveIfError(ret);
|
|
7266 |
ret=CheckWLANResults();
|
|
7267 |
User::LeaveIfError(ret);
|
|
7268 |
ret=CheckWLANErrorResultsL();
|
|
7269 |
User::LeaveIfError(ret);
|
|
7270 |
CActiveScheduler::Stop();
|
|
7271 |
}
|
|
7272 |
|
|
7273 |
void CTestPhone::CTestRetrieveMobilePhonePreferredWlanSIDs::TestCancel()
|
|
7274 |
{
|
|
7275 |
Start();
|
|
7276 |
CTestCanceller* cancelGetNetworks = RetrieveCancelPtr();
|
|
7277 |
cancelGetNetworks->Call();
|
|
7278 |
|
|
7279 |
CActiveScheduler::Start();
|
|
7280 |
TBool cancelled = (iStatus == KErrCancel);
|
|
7281 |
|
|
7282 |
// Ensure that AO can be used after its previous transaction was cancelled
|
|
7283 |
Start();
|
|
7284 |
CActiveScheduler::Start();
|
|
7285 |
|
|
7286 |
if (cancelled)
|
|
7287 |
{
|
|
7288 |
iTestPhone->INFO_PRINTF1(_L("Cancelled WLAN Preferred List"));
|
|
7289 |
iTestPhone->INFO_PRINTF1(_L("Test - CRetrieveMobilePhoneAuthenticationIds (async & cancel (Cancelled Request)) passed"));
|
|
7290 |
}
|
|
7291 |
else
|
|
7292 |
{
|
|
7293 |
iTestPhone->INFO_PRINTF1(_L("Test - CRetrieveMobilePhoneAuthenticationIds (async & cancel (Request Not Cancelled)) passed"));
|
|
7294 |
}
|
|
7295 |
}
|
|
7296 |
|
|
7297 |
CTestCanceller* CTestPhone::CTestRetrieveMobilePhonePreferredWlanSIDs::RetrieveCancelPtr()
|
|
7298 |
{
|
|
7299 |
return iCanceller;
|
|
7300 |
}
|
|
7301 |
|
|
7302 |
void CTestPhone::CTestRetrieveMobilePhonePreferredWlanSIDs::DoCancel()
|
|
7303 |
{
|
|
7304 |
iRetrieve->Cancel();
|
|
7305 |
}
|
|
7306 |
|
|
7307 |
TInt CTestPhone::CTestRetrieveMobilePhonePreferredWlanSIDs::CheckWLANResults()
|
|
7308 |
{
|
|
7309 |
TInt ret=KErrNone;
|
|
7310 |
|
|
7311 |
CMobilePhoneStoredWlanSIDList* wlanList =NULL;
|
|
7312 |
TInt leaveCode=KErrNone;
|
|
7313 |
TRAP(leaveCode, wlanList=iRetrieve->RetrieveListL(););
|
|
7314 |
|
|
7315 |
//Check that a list is returned back to the test
|
|
7316 |
iTestPhone->TEST(wlanList!=NULL);
|
|
7317 |
|
|
7318 |
if (wlanList)
|
|
7319 |
{
|
|
7320 |
//Check that the number of entries in the list is as expected
|
|
7321 |
iTestPhone->TEST(wlanList->Enumerate()==DMMTSY_PHONE_WLAN_SIDLIST_COUNT);
|
|
7322 |
// Get each entry
|
|
7323 |
RMobilePhone::TWlanSIDV8 tWlanSIDV8;
|
|
7324 |
for (TInt i=0; i<DMMTSY_PHONE_WLAN_SIDLIST_COUNT; ++i)
|
|
7325 |
{
|
|
7326 |
TRAP(ret,tWlanSIDV8=wlanList->GetEntryL(i));
|
|
7327 |
if (ret != KErrNone)
|
|
7328 |
{
|
|
7329 |
break;
|
|
7330 |
}
|
|
7331 |
switch(i)
|
|
7332 |
{
|
|
7333 |
case 0:
|
|
7334 |
{
|
|
7335 |
iTestPhone->TEST(tWlanSIDV8.iWSID == DMMTSY_PHONE_WLAN_WSID_ONE);
|
|
7336 |
iTestPhone->TEST(tWlanSIDV8.iUserDefined == DMMTSY_PHONE_WLAN_USERDEFD_ONE);
|
|
7337 |
break;
|
|
7338 |
}
|
|
7339 |
case 1:
|
|
7340 |
{
|
|
7341 |
iTestPhone->TEST(tWlanSIDV8.iWSID == DMMTSY_PHONE_WLAN_WSID_TWO);
|
|
7342 |
iTestPhone->TEST(tWlanSIDV8.iUserDefined == DMMTSY_PHONE_WLAN_USERDEFD_TWO);
|
|
7343 |
break;
|
|
7344 |
}
|
|
7345 |
case 2:
|
|
7346 |
{
|
|
7347 |
iTestPhone->TEST(tWlanSIDV8.iWSID == DMMTSY_PHONE_WLAN_WSID_THREE);
|
|
7348 |
iTestPhone->TEST(tWlanSIDV8.iUserDefined == DMMTSY_PHONE_WLAN_USERDEFD_THREE);
|
|
7349 |
break;
|
|
7350 |
}
|
|
7351 |
default:
|
|
7352 |
break;
|
|
7353 |
}
|
|
7354 |
}
|
|
7355 |
delete wlanList;
|
|
7356 |
}
|
|
7357 |
return ret;
|
|
7358 |
}
|
|
7359 |
TInt CTestPhone::CTestRetrieveMobilePhonePreferredWlanSIDs::CheckWLANErrorResultsL()
|
|
7360 |
{
|
|
7361 |
|
|
7362 |
CMobilePhoneStoredWlanSIDList* wlanList =NULL;
|
|
7363 |
TInt leaveCode=KErrNone;
|
|
7364 |
CRetrieveMobilePhonePreferredWlanSIDs* retrieveMbmsMonitorList = CRetrieveMobilePhonePreferredWlanSIDs::NewL(iPhone);
|
|
7365 |
CleanupStack::PushL(retrieveMbmsMonitorList);
|
|
7366 |
TRAP(leaveCode, wlanList=iRetrieve->RetrieveListL(););
|
|
7367 |
if(wlanList == NULL)
|
|
7368 |
{
|
|
7369 |
iTestPhone->INFO_PRINTF1(_L("iRetrieve->RetrieveListL() returned NULL."));
|
|
7370 |
}
|
|
7371 |
CleanupStack::PopAndDestroy();
|
|
7372 |
|
|
7373 |
//Check that a list is returned back to the test
|
|
7374 |
if(leaveCode == KErrNotFound)
|
|
7375 |
{
|
|
7376 |
leaveCode = KErrNone;
|
|
7377 |
}
|
|
7378 |
|
|
7379 |
return leaveCode;
|
|
7380 |
}
|