|
1 // Copyright (c) 2007-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 // Test step definitions for the FixedDialling functional unit. |
|
15 // |
|
16 // |
|
17 |
|
18 /** |
|
19 @internalTechnology |
|
20 */ |
|
21 #include <mpbutil.h> |
|
22 |
|
23 #include "cctsyintegrationtestfixeddialling.h" |
|
24 #include "cctsyinidata.h" |
|
25 |
|
26 |
|
27 |
|
28 |
|
29 |
|
30 CCTSYIntegrationTestFixedDiallingBase::CCTSYIntegrationTestFixedDiallingBase(CEtelSessionMgr& aEtelSessionMgr) |
|
31 : CCTSYIntegrationTestSuiteStepBase(aEtelSessionMgr), |
|
32 iPhoneTsyTestHelper(*this), |
|
33 iCallControlTsyTestHelper(*this), |
|
34 iNetworkTsyTestHelper(*this), |
|
35 iSimTsyTestHelper(*this) |
|
36 /** |
|
37 * Constructor |
|
38 */ |
|
39 { |
|
40 } |
|
41 |
|
42 CCTSYIntegrationTestFixedDiallingBase::~CCTSYIntegrationTestFixedDiallingBase() |
|
43 /* |
|
44 * Destructor |
|
45 */ |
|
46 { |
|
47 } |
|
48 |
|
49 |
|
50 |
|
51 /** |
|
52 * Obtain the PIN2 password from the INI file. |
|
53 * @param aPhone RMobilePhone session |
|
54 * @param aPassword On completion, the PIN2 password. The function leaves if this is not found. |
|
55 */ |
|
56 void CCTSYIntegrationTestFixedDiallingBase::GetPIN2PasswordL( RMobilePhone &aPhone, |
|
57 RMobilePhone::TMobilePassword& aPassword ) |
|
58 { |
|
59 // wait until we are on the network |
|
60 |
|
61 CHECK_EQUALS_L( iNetworkTsyTestHelper.WaitForRegisteredOnHomeNetworkL( aPhone ), KErrNone, |
|
62 _L("Network is unavailable") ); |
|
63 |
|
64 const TDesC* networkSection = NULL; |
|
65 iNetworkTsyTestHelper.GetNetworkPasswordsSectionL(aPhone,networkSection); |
|
66 |
|
67 // Get the password from the ini file |
|
68 TPtrC password; |
|
69 TBool gotPass = GetStringFromConfig(*networkSection, KIniPin2, password); |
|
70 |
|
71 CHECK_TRUE_L(gotPass, _L("Failed to read password from INI file")); |
|
72 |
|
73 aPassword = password; |
|
74 |
|
75 } |
|
76 |
|
77 |
|
78 //***************************************************************************** |
|
79 |
|
80 CCTSYIntegrationTestFixedDialling0001::CCTSYIntegrationTestFixedDialling0001(CEtelSessionMgr& aEtelSessionMgr) |
|
81 : CCTSYIntegrationTestFixedDiallingBase(aEtelSessionMgr) |
|
82 /** |
|
83 * Constructor. |
|
84 */ |
|
85 { |
|
86 SetTestStepName(CCTSYIntegrationTestFixedDialling0001::GetTestStepName()); |
|
87 } |
|
88 |
|
89 CCTSYIntegrationTestFixedDialling0001::~CCTSYIntegrationTestFixedDialling0001() |
|
90 /** |
|
91 * Destructor. |
|
92 */ |
|
93 { |
|
94 } |
|
95 |
|
96 TVerdict CCTSYIntegrationTestFixedDialling0001::doTestStepL() |
|
97 /** |
|
98 * @SYMTestCaseID BA-CTSY-INT-FXD-0001 |
|
99 * @SYMFssID BA/CTSY/FXD-0001 |
|
100 * @SYMTestCaseDesc Activate and deactivate the FDN. |
|
101 * @SYMTestPriority High |
|
102 * @SYMTestActions RMobilePhone::NotifySecurityEvent, RMobilePhone::VerifySecurityCode, RMobilePhone::GetFdnStatus, RMobilePhone::NotifyFdnStatusChange |
|
103 * @SYMTestExpectedResults Pass - FDN is set to on, then to off. |
|
104 * @SYMTestType CIT |
|
105 * @SYMTestCaseDependencies live/automatic |
|
106 * |
|
107 * Reason for test: Verify FDN status is set correctly. |
|
108 * |
|
109 * @return - TVerdict code |
|
110 */ |
|
111 { |
|
112 |
|
113 // |
|
114 // SET UP |
|
115 // |
|
116 RMobilePhone& phone = iEtelSessionMgr.GetPhoneL(KMainServer, KMainPhone); |
|
117 RMobilePhone::TMobilePassword pin2Password; |
|
118 GetPIN2PasswordL( phone, pin2Password ); |
|
119 |
|
120 // Ensure RMobilePhone::GetSecurityCaps returns caps in set of KCapsAccessPin2 |
|
121 TUint32 securityCaps; |
|
122 TInt err = phone.GetSecurityCaps( securityCaps ); |
|
123 CHECK_EQUALS_L(err, KErrNone, _L("RMobilePhone::GetSecurityCaps returned an error")); |
|
124 CHECK_BITS_SET_L( securityCaps, RMobilePhone::KCapsAccessPin2, KNoUnwantedBits, |
|
125 _L("RMobilePhone::GetSecurityCaps returned wrong caps")); |
|
126 |
|
127 // Ensure the FDN is deactivated (RMobilePhone::GetFdnStatus returns EFdnNotActive) |
|
128 RMobilePhone::TMobilePhoneFdnStatus fdnStatus; |
|
129 err = phone.GetFdnStatus(fdnStatus); |
|
130 CHECK_EQUALS_L(err, KErrNone, _L("RMobilePhone::GetFdnStatus returned an error")); |
|
131 if(fdnStatus!=RMobilePhone::EFdnNotActive) |
|
132 { |
|
133 err = iPhoneTsyTestHelper.SetPhoneFdnSettingL(phone,pin2Password,RMobilePhone::EFdnSetOff); |
|
134 CHECK_EQUALS_L(err,KErrNone,_L("RMobilePhone::SetFdnSetting failed")); |
|
135 err = phone.GetFdnStatus(fdnStatus); |
|
136 CHECK_EQUALS_L(err, KErrNone, _L("RMobilePhone::GetFdnStatus returned an error")); |
|
137 } |
|
138 CHECK_EQUALS_L(fdnStatus, RMobilePhone::EFdnNotActive, |
|
139 _L("RMobilePhone::GetFdnStatus returned an unexpected result") ); |
|
140 |
|
141 iNetworkTsyTestHelper.WaitForRegisteredOnHomeNetworkL(phone); |
|
142 |
|
143 |
|
144 // |
|
145 // SET UP END |
|
146 // |
|
147 |
|
148 StartTest(); |
|
149 |
|
150 // |
|
151 // TEST START |
|
152 // |
|
153 |
|
154 // Backup phone state |
|
155 TFdnCleanupDisable backup(iPhoneTsyTestHelper,phone,pin2Password); |
|
156 CleanupStack::PushL(backup); |
|
157 |
|
158 // === Set FDN to on === |
|
159 |
|
160 |
|
161 // Set the FDN change notification up |
|
162 TExtEtelRequestStatus reqNotifyFdnChange(phone, EMobilePhoneNotifyFdnStatusChange); |
|
163 CleanupStack::PushL(reqNotifyFdnChange); |
|
164 phone.NotifyFdnStatusChange(reqNotifyFdnChange,fdnStatus); |
|
165 |
|
166 |
|
167 // Check RMobilePhone::SetFdnSetting with aFdnSetting RMobilePhone::EFdnSetOn completes with KErrNone |
|
168 err = iPhoneTsyTestHelper.SetPhoneFdnSettingL(phone, pin2Password, RMobilePhone::EFdnSetOn); |
|
169 ASSERT_EQUALS( err, KErrNone, _L("RMobilePhone::SetFdnSetting returned an error")); |
|
170 |
|
171 // Check RMobilePhone::NotifyFdnStatusChange completes with FDN setting of RMobilePhone::EFdnActive |
|
172 iCallControlTsyTestHelper.WaitForMobilePhoneNotifyFdnStatusChange(phone, |
|
173 reqNotifyFdnChange, |
|
174 fdnStatus, |
|
175 RMobilePhone::EFdnActive, |
|
176 KErrNone); |
|
177 |
|
178 // Just for the log |
|
179 ASSERT_EQUALS(fdnStatus,RMobilePhone::EFdnActive, |
|
180 _L("RMobilePhone::NotifyFdnStatusChange returned an unexpected result") ) |
|
181 |
|
182 // Check RMobilePhone::GetFdnStatus (synchronous version) returns RMobilePhone::EFdnActive |
|
183 err = phone.GetFdnStatus(fdnStatus); |
|
184 ASSERT_EQUALS(err, KErrNone, _L("RMobilePhone::GetFdnStatus returned an error")); |
|
185 ASSERT_EQUALS(fdnStatus, RMobilePhone::EFdnActive, |
|
186 _L("RMobilePhone::GetFdnStatus returned an unexpected result") ); |
|
187 |
|
188 // Check RMobilePhone::GetFdnStatus (asynchronous version) completes with RMobilePhone::EFdnActive |
|
189 TExtEtelRequestStatus reqGetFdnStatus(phone, EMobilePhoneGetFdnStatus); |
|
190 CleanupStack::PushL(reqGetFdnStatus); |
|
191 |
|
192 phone.GetFdnStatus(reqGetFdnStatus, fdnStatus); |
|
193 err = WaitForRequestWithTimeOut(reqGetFdnStatus, ETimeMedium); |
|
194 ASSERT_EQUALS(err, KErrNone, _L("RMobilePhone::GetFdnStatus timed out")); |
|
195 ASSERT_EQUALS(fdnStatus, RMobilePhone::EFdnActive, |
|
196 _L("RMobilePhone::GetFdnStatus did returned an unexpected result") ); |
|
197 |
|
198 // === Set FDN to off === |
|
199 // Setup FDN change notification |
|
200 phone.NotifyFdnStatusChange(reqNotifyFdnChange,fdnStatus); |
|
201 |
|
202 // Call RMobilePhone::SetFdnSetting with RMobilePhone::EFdnSetOff |
|
203 err = iPhoneTsyTestHelper.SetPhoneFdnSettingL(phone, pin2Password, RMobilePhone::EFdnSetOff); |
|
204 |
|
205 // Check RMobilePhone::SetFdnSetting with aFdnSetting RMobilePhone::EFdnSetOff completes with KErrNone |
|
206 ASSERT_EQUALS(err, KErrNone, _L("RMobilePhone::SetFdnSetting returned an error")); |
|
207 |
|
208 |
|
209 // Check RMobilePhone::NotifyFdnStatusChange completes with FDN setting of RMobilePhone::EFdnSetOff |
|
210 iCallControlTsyTestHelper.WaitForMobilePhoneNotifyFdnStatusChange(phone, |
|
211 reqNotifyFdnChange, |
|
212 fdnStatus, |
|
213 RMobilePhone::EFdnNotActive, |
|
214 KErrNone); |
|
215 |
|
216 // Just for the log |
|
217 ASSERT_EQUALS(fdnStatus,RMobilePhone::EFdnNotActive, |
|
218 _L("RMobilePhone::NotifyFdnStatusChange returned an unexpected result") ) |
|
219 |
|
220 // Check RMobilePhone::GetFdnStatus (synchronous version) returns RMobilePhone::EFdnSetOff |
|
221 err = phone.GetFdnStatus( fdnStatus ); |
|
222 ASSERT_EQUALS(err, KErrNone, _L("RMobilePhone::GetFdnStatus returned an error")); |
|
223 ASSERT_EQUALS(fdnStatus, RMobilePhone::EFdnNotActive, |
|
224 _L("RMobilePhone::GetFdnStatus returned an unexpected result") ); |
|
225 |
|
226 // Check RMobilePhone::GetFdnStatus (asynchronous version) completes with RMobilePhone::EFdnSetOff |
|
227 phone.GetFdnStatus(reqGetFdnStatus, fdnStatus); |
|
228 err = WaitForRequestWithTimeOut(reqGetFdnStatus, ETimeMedium ); |
|
229 ASSERT_EQUALS(err, KErrNone, _L("RMobilePhone::GetFdnStatus timed out")); |
|
230 ASSERT_EQUALS(fdnStatus, RMobilePhone::EFdnNotActive, |
|
231 _L("RMobilePhone::GetFdnStatus returned an unexpected result") ); |
|
232 |
|
233 // |
|
234 // TEST END |
|
235 // |
|
236 |
|
237 StartCleanup(); |
|
238 |
|
239 // reqGetFdnStatus |
|
240 // reqNotifyFdnChange |
|
241 // backup |
|
242 CleanupStack::PopAndDestroy(3, &backup); |
|
243 |
|
244 return TestStepResult(); |
|
245 } |
|
246 |
|
247 TPtrC CCTSYIntegrationTestFixedDialling0001::GetTestStepName() |
|
248 /** |
|
249 * @return The test step name. |
|
250 */ |
|
251 { |
|
252 return _L("CCTSYIntegrationTestFixedDialling0001"); |
|
253 } |
|
254 |
|
255 |
|
256 |
|
257 CCTSYIntegrationTestFixedDialling0002::CCTSYIntegrationTestFixedDialling0002(CEtelSessionMgr& aEtelSessionMgr) |
|
258 : CCTSYIntegrationTestFixedDiallingBase(aEtelSessionMgr) |
|
259 /** |
|
260 * Constructor. |
|
261 */ |
|
262 { |
|
263 SetTestStepName(CCTSYIntegrationTestFixedDialling0002::GetTestStepName()); |
|
264 } |
|
265 |
|
266 CCTSYIntegrationTestFixedDialling0002::~CCTSYIntegrationTestFixedDialling0002() |
|
267 /** |
|
268 * Destructor. |
|
269 */ |
|
270 { |
|
271 } |
|
272 |
|
273 TVerdict CCTSYIntegrationTestFixedDialling0002::doTestStepL() |
|
274 /** |
|
275 * @SYMTestCaseID BA-CTSY-INT-FXD-0002 |
|
276 * @SYMFssID BA/CTSY/FXD-0002 |
|
277 * @SYMTestCaseDesc Write and delete entries from the FDN list. |
|
278 * @SYMTestPriority High |
|
279 * @SYMTestActions RMobilePhone::VerifySecurityCode, RMobilePhone::SetFdnSetting, RMobilePhone::NotifySecurityEvent, RMobileCall::GetMobileCallStatus, RCall::Dial, RMobilePhoneBookStore::Read, RMobilePhoneBookStore::Delete, RMobilePhoneBookStore::Write |
|
280 * @SYMTestExpectedResults Pass - Modification of FDN possible when PIN2 verified. |
|
281 * @SYMTestType CIT |
|
282 * @SYMTestCaseDependencies live/automatic |
|
283 * |
|
284 * Reason for test: Verify numbers can be written to the FDN list and those numbers can be called when it is enabled. |
|
285 Verify the numbers cannot be called when they are deleted from the list. |
|
286 * |
|
287 * @return - TVerdict code |
|
288 */ |
|
289 { |
|
290 |
|
291 // |
|
292 // SET UP |
|
293 // |
|
294 |
|
295 RMobilePhone& phone = iEtelSessionMgr.GetPhoneL(KMainServer, KMainPhone); |
|
296 RMobilePhone::TMobilePassword pin2Password; |
|
297 GetPIN2PasswordL( phone, pin2Password ); |
|
298 |
|
299 // Ensure RMobilePhone::GetSecurityCaps returns caps in set of KCapsAccessPin2 |
|
300 TUint32 securityCaps; |
|
301 TInt err = phone.GetSecurityCaps( securityCaps ); |
|
302 CHECK_EQUALS_L(err, KErrNone, _L("RMobilePhone::GetSecurityCaps returned an error")); |
|
303 CHECK_BITS_SET_L( securityCaps, RMobilePhone::KCapsAccessPin2, KNoUnwantedBits, |
|
304 _L("RMobilePhone::GetSecurityCaps returned wrong caps")); |
|
305 |
|
306 // Ensure RMobilePhoneStore::GetInfo returns iCaps in set of KCapsWriteAccess | KCapsReadAccess for FDN phone book |
|
307 RMobilePhoneBookStore& fdnStore = iEtelSessionMgr.GetPhoneBookStoreL(KMainServer,KMainPhone,KIccFdnPhoneBook); |
|
308 RMobilePhoneBookStore::TMobilePhoneBookInfoV1 bookInfo; |
|
309 RMobilePhoneBookStore::TMobilePhoneBookInfoV1Pckg bookInfoPckg(bookInfo); |
|
310 TExtEtelRequestStatus getInfoStatus(fdnStore, EMobilePhoneStoreGetInfo); |
|
311 CleanupStack::PushL (getInfoStatus); |
|
312 User::After(15*KOneSecond); // Wait for phone book caching to finish |
|
313 fdnStore.GetInfo (getInfoStatus, bookInfoPckg); |
|
314 CHECK_EQUALS_L(WaitForRequestWithTimeOut(getInfoStatus, ETimeMedium),KErrNone, _L("RMobilePhoneStore::GetInfo timed out")); |
|
315 CHECK_EQUALS_L(getInfoStatus.Int(), KErrNone, _L("RMobilePhoneStore::GetInfo returned an error")); |
|
316 TUint wantedBits = RMobilePhoneStore::KCapsWriteAccess| RMobilePhoneStore::KCapsReadAccess; |
|
317 CHECK_BITS_SET_L(bookInfo.iCaps,wantedBits,KNoUnwantedBits, _L("RMobilePhoneStore::GetInfo returned unexpected iCaps")); |
|
318 |
|
319 |
|
320 // Get Voice line 1. |
|
321 RMobileLine& voiceLine = iEtelSessionMgr.GetLineL(KMainServer, KMainPhone, KVoiceLine); |
|
322 |
|
323 // Get call 1. |
|
324 RMobileCall& call1 = iEtelSessionMgr.GetCallL(KMainServer, KMainPhone, KVoiceLine, KCall1); |
|
325 |
|
326 |
|
327 // |
|
328 // SET UP END |
|
329 // |
|
330 |
|
331 StartTest(); |
|
332 |
|
333 // |
|
334 // TEST START |
|
335 // |
|
336 |
|
337 // Backup phone state |
|
338 TFdnCleanupDisable backup(iPhoneTsyTestHelper,phone,pin2Password); |
|
339 CleanupStack::PushL(backup); |
|
340 |
|
341 // === Turn FDN on === |
|
342 |
|
343 // Post notification for RMobilePhone::NotifySecurityEvent |
|
344 |
|
345 // Call RMobilePhone::SetFdnSetting with RMobilePhone::EFdnSetOn |
|
346 // Don't wait for completion |
|
347 |
|
348 // Check RMobilePhone::NotifySecurityEvent completes with RMobilePhone::EPin2Required |
|
349 |
|
350 // Verify PIN2 security code with RMobilePhone::VerifySecurityCode with RMobilePhone::ESecurityCodePin2 |
|
351 |
|
352 // Check RMobilePhone::NotifySecurityEvent completes with RMobilePhone::EPin2Verified |
|
353 // Wait for the RMobilePhone::SetFdnSetting to complete |
|
354 ASSERT_EQUALS(iPhoneTsyTestHelper.SetPhoneFdnSettingL(phone,pin2Password,RMobilePhone::EFdnSetOn),KErrNone,_L("RMobilePhone::SetFdnSetting returned an error")); |
|
355 |
|
356 // === Write a number to the FDN phone book and dial it === |
|
357 |
|
358 // Write a valid number which will answer when dialled to the FDN phone book. |
|
359 TBuf8<500> pbData; |
|
360 CPhoneBookBuffer* pbBuffer = new(ELeave) CPhoneBookBuffer(); |
|
361 CleanupStack::PushL(pbBuffer); |
|
362 pbBuffer->Set(&pbData); |
|
363 pbData.FillZ(); |
|
364 pbData.Zero(); |
|
365 ASSERT_EQUALS(pbBuffer->AddNewEntryTag(),KErrNone,_L("CPhoneBookBuffer::AddNewEntryTag failed")); |
|
366 TPtrC number; |
|
367 ASSERT_TRUE(GetStringFromConfig(KIniVoiceNumSection, KIniVoiceNumber1, number) != EFalse, |
|
368 _L("CTestStep::GetStringFromConfig did not complete as expected")); |
|
369 ASSERT_EQUALS(pbBuffer->PutTagAndValue(RMobilePhoneBookStore::ETagPBNumber,number), |
|
370 KErrNone,_L("CPhoneBookBuffer::PutTagAndValue failed")); |
|
371 ASSERT_EQUALS(pbBuffer->PutTagAndValue(RMobilePhoneBookStore::ETagPBTonNpi,(TUint8)RMobilePhone::ENationalNumber), |
|
372 KErrNone,_L("CPhoneBookBuffer::PutTagAndValue failed")); |
|
373 ASSERT_EQUALS(pbBuffer->PutTagAndValue(RMobilePhoneBookStore::ETagPBText,_L("Name")), |
|
374 KErrNone,_L("CPhoneBookBuffer::PutTagAndValue failed")); |
|
375 TExtEtelRequestStatus phoneBookWriteStatus(fdnStore, EMobilePhoneBookStoreWrite); |
|
376 CleanupStack::PushL(phoneBookWriteStatus); |
|
377 TInt index=1; |
|
378 fdnStore.Write(phoneBookWriteStatus, pbData, index); |
|
379 ASSERT_EQUALS(WaitForRequestWithTimeOut(phoneBookWriteStatus, ETimeMedium), KErrNone, |
|
380 _L("RMobilePhoneBookStore::Write timed-out")); |
|
381 ASSERT_EQUALS(phoneBookWriteStatus.Int(), KErrNone, |
|
382 _L("RMobilePhoneBookStore::Write returned with an error")); |
|
383 |
|
384 // post notifier for RMobileCall::NotifyMobileCallStatusChange |
|
385 RMobileCall::TMobileCallStatus mobileCallStatus; |
|
386 TExtEtelRequestStatus notifyMobileCallStatusChangeStatus(call1, EMobileCallNotifyMobileCallStatusChange); |
|
387 CleanupStack::PushL(notifyMobileCallStatusChangeStatus); |
|
388 call1.NotifyMobileCallStatusChange(notifyMobileCallStatusChangeStatus, mobileCallStatus); |
|
389 |
|
390 |
|
391 // Dial the written number. |
|
392 TCoreEtelRequestStatus<RCall> dialStatus(call1, &RCall::DialCancel); |
|
393 CleanupStack::PushL(dialStatus); |
|
394 call1.Dial(dialStatus, number); |
|
395 ASSERT_EQUALS(WaitForRequestWithTimeOut(dialStatus, ETimeMedium), KErrNone, |
|
396 _L("RCall::Dial timed-out")); |
|
397 ASSERT_EQUALS(dialStatus.Int(), KErrNone, |
|
398 _L("RCall::Dial returned with an error")); |
|
399 |
|
400 // Check RMobileCall::NotifyMobileCallStatusChange completes with EStatusDialling -> EStatusConnecting -> EStatusConnected. |
|
401 RMobileCall::TMobileCallStatus expectedMobileCallStatus = RMobileCall::EStatusDialling; |
|
402 iCallControlTsyTestHelper.WaitForMobileCallNotifyMobileCallStatusChange(call1, |
|
403 notifyMobileCallStatusChangeStatus, |
|
404 mobileCallStatus, |
|
405 expectedMobileCallStatus, |
|
406 KErrNone); |
|
407 call1.NotifyMobileCallStatusChange(notifyMobileCallStatusChangeStatus, mobileCallStatus); |
|
408 expectedMobileCallStatus = RMobileCall::EStatusConnecting; |
|
409 iCallControlTsyTestHelper.WaitForMobileCallNotifyMobileCallStatusChange(call1, |
|
410 notifyMobileCallStatusChangeStatus, |
|
411 mobileCallStatus, |
|
412 expectedMobileCallStatus, |
|
413 KErrNone); |
|
414 call1.NotifyMobileCallStatusChange(notifyMobileCallStatusChangeStatus, mobileCallStatus); |
|
415 expectedMobileCallStatus = RMobileCall::EStatusConnected; |
|
416 iCallControlTsyTestHelper.WaitForMobileCallNotifyMobileCallStatusChange(call1, |
|
417 notifyMobileCallStatusChangeStatus, |
|
418 mobileCallStatus, |
|
419 expectedMobileCallStatus, |
|
420 KErrNone); |
|
421 |
|
422 // Check RMobileCall::GetMobileCallStatus returns status of EStatusConnected. |
|
423 ASSERT_EQUALS(call1.GetMobileCallStatus(mobileCallStatus), KErrNone, |
|
424 _L("RMobileCall::GetMobileCallStatus returned an Error")); |
|
425 ASSERT_EQUALS(mobileCallStatus, RMobileCall::EStatusConnected, |
|
426 _L("RMobileCall::GetMobileCallStatus did not set the status to EStatusConnected")); |
|
427 |
|
428 // Hang up. |
|
429 TCoreEtelRequestStatus<RCall> hangUpStatus (call1,&RCall::HangUpCancel); |
|
430 CleanupStack::PushL(hangUpStatus); |
|
431 call1.HangUp(hangUpStatus); |
|
432 ASSERT_EQUALS(WaitForRequestWithTimeOut(hangUpStatus, ETimeMedium), KErrNone, |
|
433 _L("RCall::HangUp timed-out")); |
|
434 ASSERT_EQUALS(hangUpStatus.Int(), KErrNone, |
|
435 _L("RCall::HangUp returned an error")); |
|
436 |
|
437 // === Delete the number and try to dial it === |
|
438 |
|
439 // Delete the number from the FDN phone book. |
|
440 TExtEtelRequestStatus deleteStoreStatus(fdnStore,EMobilePhoneStoreDelete); |
|
441 CleanupStack::PushL(deleteStoreStatus); |
|
442 fdnStore.Delete(deleteStoreStatus,index); |
|
443 ASSERT_EQUALS(WaitForRequestWithTimeOut(deleteStoreStatus, ETimeMedium),KErrNone, |
|
444 _L("RMobilePhoneBookStore::Delete timed-out")); |
|
445 ASSERT_EQUALS( deleteStoreStatus.Int(), KErrNone, |
|
446 _L("RMobilePhoneBookStore::Delete returned with an error.")); |
|
447 |
|
448 // Dial the number. |
|
449 call1.Dial(dialStatus, number); |
|
450 ASSERT_EQUALS(WaitForRequestWithTimeOut(dialStatus, ETimeMedium), KErrNone, |
|
451 _L("RCall::Dial timed-out")); |
|
452 |
|
453 // Check dialling fails. |
|
454 ASSERT_TRUE((dialStatus.Int()!= KErrNone), |
|
455 _L("RCall::Dial did not returned with an error")); |
|
456 |
|
457 |
|
458 // === Set FDN to off and dial the number again === |
|
459 |
|
460 // Call RMobilePhone::SetFdnSetting with RMobilePhone::EFdnSetOff |
|
461 ASSERT_EQUALS(iPhoneTsyTestHelper.SetPhoneFdnSettingL(phone,pin2Password,RMobilePhone::EFdnSetOff),KErrNone,_L("RMobilePhone::SetFdnSetting returned an error")); |
|
462 |
|
463 // Dial the number again. |
|
464 call1.Dial(dialStatus, number); |
|
465 ASSERT_EQUALS(WaitForRequestWithTimeOut(dialStatus, ETimeMedium), KErrNone, |
|
466 _L("RCall::Dial timed-out")); |
|
467 ASSERT_EQUALS(dialStatus.Int(), KErrNone, |
|
468 _L("RCall::Dial returned with an error")); |
|
469 |
|
470 // Check RMobileCall::NotifyMobileCallStatusChange completes with EStatusDialling -> EStatusConnecting -> EStatusConnected. |
|
471 call1.NotifyMobileCallStatusChange(notifyMobileCallStatusChangeStatus, mobileCallStatus); |
|
472 expectedMobileCallStatus = RMobileCall::EStatusDialling; |
|
473 iCallControlTsyTestHelper.WaitForMobileCallNotifyMobileCallStatusChange(call1, |
|
474 notifyMobileCallStatusChangeStatus, |
|
475 mobileCallStatus, |
|
476 expectedMobileCallStatus, |
|
477 KErrNone); |
|
478 call1.NotifyMobileCallStatusChange(notifyMobileCallStatusChangeStatus, mobileCallStatus); |
|
479 expectedMobileCallStatus = RMobileCall::EStatusConnecting; |
|
480 iCallControlTsyTestHelper.WaitForMobileCallNotifyMobileCallStatusChange(call1, |
|
481 notifyMobileCallStatusChangeStatus, |
|
482 mobileCallStatus, |
|
483 expectedMobileCallStatus, |
|
484 KErrNone); |
|
485 call1.NotifyMobileCallStatusChange(notifyMobileCallStatusChangeStatus, mobileCallStatus); |
|
486 expectedMobileCallStatus = RMobileCall::EStatusConnected; |
|
487 iCallControlTsyTestHelper.WaitForMobileCallNotifyMobileCallStatusChange(call1, |
|
488 notifyMobileCallStatusChangeStatus, |
|
489 mobileCallStatus, |
|
490 expectedMobileCallStatus, |
|
491 KErrNone); |
|
492 |
|
493 // Check RMobileCall::GetMobileCallStatus returns status of EStatusConnected. |
|
494 ASSERT_EQUALS(call1.GetMobileCallStatus(mobileCallStatus), KErrNone, |
|
495 _L("RMobileCall::GetMobileCallStatus returned an Error")); |
|
496 ASSERT_EQUALS(mobileCallStatus, RMobileCall::EStatusConnected, |
|
497 _L("RMobileCall::GetMobileCallStatus did not set the status to EStatusConnected")); |
|
498 |
|
499 // Hang up |
|
500 call1.HangUp(hangUpStatus); |
|
501 ASSERT_EQUALS(WaitForRequestWithTimeOut(hangUpStatus, ETimeMedium), KErrNone, |
|
502 _L("RCall::HangUp timed-out")); |
|
503 ASSERT_EQUALS(hangUpStatus.Int(), KErrNone, |
|
504 _L("RCall::HangUp returned an error")); |
|
505 |
|
506 // |
|
507 // TEST END |
|
508 // |
|
509 |
|
510 StartCleanup(); |
|
511 |
|
512 // Pop: |
|
513 // deleteStoreStatus |
|
514 // hangUpStatus |
|
515 // dialStatus |
|
516 // notifyMobileCallStatusChangeStatus |
|
517 // phoneBookWriteStatus |
|
518 // pbBuffer |
|
519 // backup |
|
520 // getInfoStatus |
|
521 CleanupStack::PopAndDestroy(8, &getInfoStatus); |
|
522 |
|
523 return TestStepResult(); |
|
524 } |
|
525 |
|
526 TPtrC CCTSYIntegrationTestFixedDialling0002::GetTestStepName() |
|
527 /** |
|
528 * @return The test step name. |
|
529 */ |
|
530 { |
|
531 return _L("CCTSYIntegrationTestFixedDialling0002"); |
|
532 } |
|
533 |
|
534 |
|
535 |
|
536 CCTSYIntegrationTestFixedDialling0003::CCTSYIntegrationTestFixedDialling0003(CEtelSessionMgr& aEtelSessionMgr) |
|
537 : CCTSYIntegrationTestFixedDiallingBase(aEtelSessionMgr) |
|
538 /** |
|
539 * Constructor. |
|
540 */ |
|
541 { |
|
542 SetTestStepName(CCTSYIntegrationTestFixedDialling0003::GetTestStepName()); |
|
543 } |
|
544 |
|
545 CCTSYIntegrationTestFixedDialling0003::~CCTSYIntegrationTestFixedDialling0003() |
|
546 /** |
|
547 * Destructor. |
|
548 */ |
|
549 { |
|
550 } |
|
551 |
|
552 TVerdict CCTSYIntegrationTestFixedDialling0003::doTestStepL() |
|
553 /** |
|
554 * @SYMTestCaseID BA-CTSY-INT-FXD-0003 |
|
555 * @SYMFssID BA/CTSY/FXD-0003 |
|
556 * @SYMTestCaseDesc Edit the FDN list when PIN2 not verified. |
|
557 * @SYMTestPriority High |
|
558 * @SYMTestActions RMobilePhoneBookStore::Read, RMobilePhoneStore::Delete, RMobilePhoneBookStore::Write |
|
559 * @SYMTestExpectedResults Pass - Modification of FDN not possible when PIN2 not verified. |
|
560 * @SYMTestType CIT |
|
561 * @SYMTestCaseDependencies live/manual |
|
562 * |
|
563 * Reason for test: Verify writing, deleting and reading of the FDN list is not possible. |
|
564 * |
|
565 * @return - TVerdict code |
|
566 */ |
|
567 { |
|
568 |
|
569 // |
|
570 // SET UP |
|
571 // |
|
572 |
|
573 RMobilePhone& phone = iEtelSessionMgr.GetPhoneL(KMainServer, KMainPhone); |
|
574 |
|
575 // Ensure RMobilePhone::GetSecurityCaps returns caps in set of KCapsAccessPin2 |
|
576 TUint32 securityCaps; |
|
577 TInt err = phone.GetSecurityCaps( securityCaps ); |
|
578 CHECK_EQUALS_L(err, KErrNone, _L("RMobilePhone::GetSecurityCaps returned an error")); |
|
579 CHECK_BITS_SET_L( securityCaps, RMobilePhone::KCapsAccessPin2, KNoUnwantedBits, |
|
580 _L("RMobilePhone::GetSecurityCaps returned wrong caps")); |
|
581 |
|
582 |
|
583 // Ensure RMobilePhoneStore::GetInfo returns iCaps in set of KCapsWriteAccess | KCapsReadAccess | | RMobilePhoneBookStore::KCapsRestrictedWriteAccess for FDN phone book |
|
584 RMobilePhoneBookStore& fdnStore = iEtelSessionMgr.GetPhoneBookStoreL(KMainServer,KMainPhone,KIccFdnPhoneBook); |
|
585 RMobilePhoneBookStore::TMobilePhoneBookInfoV1 bookInfo; |
|
586 RMobilePhoneBookStore::TMobilePhoneBookInfoV1Pckg bookInfoPckg(bookInfo); |
|
587 TExtEtelRequestStatus getInfoStatus(fdnStore, EMobilePhoneStoreGetInfo); |
|
588 CleanupStack::PushL (getInfoStatus); |
|
589 User::After(15*KOneSecond); |
|
590 fdnStore.GetInfo (getInfoStatus, bookInfoPckg); |
|
591 CHECK_EQUALS_L(WaitForRequestWithTimeOut(getInfoStatus, ETimeMedium),KErrNone, _L("RMobilePhoneStore::GetInfo timed out")); |
|
592 CHECK_EQUALS_L(getInfoStatus.Int(), KErrNone, _L("RMobilePhoneStore::GetInfo returned an error")); |
|
593 TUint wantedBits = RMobilePhoneStore::KCapsWriteAccess| RMobilePhoneStore::KCapsReadAccess | RMobilePhoneBookStore::KCapsRestrictedWriteAccess; |
|
594 CHECK_BITS_SET_L(bookInfo.iCaps,wantedBits,KNoUnwantedBits, _L("RMobilePhoneStore::GetInfo returned unexpected iCaps")); |
|
595 |
|
596 |
|
597 // |
|
598 // SET UP END |
|
599 // |
|
600 |
|
601 StartTest(); |
|
602 |
|
603 // |
|
604 // TEST START |
|
605 // |
|
606 |
|
607 |
|
608 // Open the FDN phone book. |
|
609 |
|
610 // Attempt to write a valid entry to the FDN list using RMobilePhoneBookStore::Write |
|
611 TBuf8<500> pbData; |
|
612 CPhoneBookBuffer* pbBuffer = new(ELeave) CPhoneBookBuffer(); |
|
613 CleanupStack::PushL(pbBuffer); |
|
614 pbBuffer->Set(&pbData); |
|
615 pbData.FillZ(); |
|
616 pbData.Zero(); |
|
617 ASSERT_EQUALS(pbBuffer->AddNewEntryTag(),KErrNone,_L("CPhoneBookBuffer::AddNewEntryTag failed")); |
|
618 TPtrC number=_L("012345678"); |
|
619 ASSERT_EQUALS(pbBuffer->PutTagAndValue(RMobilePhoneBookStore::ETagPBNumber,number), |
|
620 KErrNone,_L("CPhoneBookBuffer::PutTagAndValue failed")); |
|
621 ASSERT_EQUALS(pbBuffer->PutTagAndValue(RMobilePhoneBookStore::ETagPBTonNpi,(TUint8)RMobilePhone::ENationalNumber), |
|
622 KErrNone,_L("CPhoneBookBuffer::PutTagAndValue failed")); |
|
623 ASSERT_EQUALS(pbBuffer->PutTagAndValue(RMobilePhoneBookStore::ETagPBText,_L("Name")), |
|
624 KErrNone,_L("CPhoneBookBuffer::PutTagAndValue failed")); |
|
625 TExtEtelRequestStatus phoneBookWriteStatus(fdnStore, EMobilePhoneBookStoreWrite); |
|
626 CleanupStack::PushL(phoneBookWriteStatus); |
|
627 TInt index=1; |
|
628 fdnStore.Write(phoneBookWriteStatus, pbData, index); |
|
629 ASSERT_EQUALS(WaitForRequestWithTimeOut(phoneBookWriteStatus, ETimeMedium), KErrNone, |
|
630 _L("RMobilePhoneBookStore::Write timed-out")); |
|
631 |
|
632 // Check Error is returned. |
|
633 ASSERT_TRUE(phoneBookWriteStatus.Int()!= KErrNone, |
|
634 _L("RMobilePhoneBookStore::Write did not return with an error")); |
|
635 |
|
636 // Attempt to delete a valid entry to the FDN list using RMobilePhoneBookStore::Delete |
|
637 TExtEtelRequestStatus deleteStoreStatus(fdnStore,EMobilePhoneStoreDelete); |
|
638 CleanupStack::PushL(deleteStoreStatus); |
|
639 fdnStore.Delete(deleteStoreStatus,1); |
|
640 ASSERT_EQUALS(WaitForRequestWithTimeOut(deleteStoreStatus, ETimeMedium),KErrNone, |
|
641 _L("RMobilePhoneBookStore::Delete timed-out")); |
|
642 |
|
643 // $CTSYProblem We expect an error != KErrNone here but the LTSY is returning KErrNone which the CTSY correctly propagates back to the test |
|
644 ASSERT_TRUE( deleteStoreStatus.Int()== KErrNone, |
|
645 _L("RMobilePhoneBookStore::Delete did not return with an error.")); |
|
646 |
|
647 // Attempt to read a valid entry to the FDN list using RMobilePhoneBookStore::Read |
|
648 pbData.FillZ(); |
|
649 pbData.Zero(); |
|
650 TExtEtelRequestStatus phoneBookReadStatus(fdnStore, EMobilePhoneBookStoreRead); |
|
651 CleanupStack::PushL(phoneBookReadStatus); |
|
652 fdnStore.Read(phoneBookReadStatus, index, 1, pbData); |
|
653 ASSERT_EQUALS(WaitForRequestWithTimeOut(phoneBookReadStatus, ETimeMedium), KErrNone, |
|
654 _L("RMobilePhoneBookStore::Write timed-out")); |
|
655 |
|
656 // Check error is returned. |
|
657 ASSERT_TRUE( phoneBookReadStatus.Int()!= KErrNone, |
|
658 _L("RMobilePhoneBookStore::Read did not return with an error.")); |
|
659 |
|
660 |
|
661 // |
|
662 // TEST END |
|
663 // |
|
664 |
|
665 StartCleanup(); |
|
666 |
|
667 // Pop: |
|
668 // phoneBookReadStatus |
|
669 // deleteStoreStatus |
|
670 // phoneBookWriteStatus |
|
671 // pbBuffer |
|
672 // getInfoStatus |
|
673 CleanupStack::PopAndDestroy(5,&getInfoStatus); |
|
674 |
|
675 return TestStepResult(); |
|
676 } |
|
677 |
|
678 TPtrC CCTSYIntegrationTestFixedDialling0003::GetTestStepName() |
|
679 /** |
|
680 * @return The test step name. |
|
681 */ |
|
682 { |
|
683 return _L("CCTSYIntegrationTestFixedDialling0003"); |
|
684 } |
|
685 |
|
686 |
|
687 |
|
688 CCTSYIntegrationTestFixedDialling0004::CCTSYIntegrationTestFixedDialling0004(CEtelSessionMgr& aEtelSessionMgr) |
|
689 : CCTSYIntegrationTestFixedDiallingBase(aEtelSessionMgr) |
|
690 /** |
|
691 * Constructor. |
|
692 */ |
|
693 { |
|
694 SetTestStepName(CCTSYIntegrationTestFixedDialling0004::GetTestStepName()); |
|
695 } |
|
696 |
|
697 CCTSYIntegrationTestFixedDialling0004::~CCTSYIntegrationTestFixedDialling0004() |
|
698 /** |
|
699 * Destructor. |
|
700 */ |
|
701 { |
|
702 } |
|
703 |
|
704 TVerdict CCTSYIntegrationTestFixedDialling0004::doTestStepL() |
|
705 /** |
|
706 * @SYMTestCaseID BA-CTSY-INT-FXD-0004 |
|
707 * @SYMFssID BA/CTSY/FXD-0004 |
|
708 * @SYMTestCaseDesc Dial numbers without FDN check. |
|
709 * @SYMTestPriority High |
|
710 * @SYMTestActions RMobilePhone::VerifySecurityCode, RMobilePhone::SetFdnSetting, RMobilePhone::NotifySecurityEvent, RCall::HangUp, RMobileCall::GetMobileCallStatus, RMobileCall::DialNoFdnCheck |
|
711 * @SYMTestExpectedResults Pass - Numbers can be dialled with RMobileCall::DialNoFdnCheck when FDN enabled. |
|
712 * @SYMTestType CIT |
|
713 * @SYMTestCaseDependencies live/automatic |
|
714 * |
|
715 * Reason for test: Verify RMobileCall::DialNoFdnCheck can dial numbers not in the FDN list when the FDN is enabled. |
|
716 * |
|
717 * @return - TVerdict code |
|
718 */ |
|
719 { |
|
720 |
|
721 // |
|
722 // SET UP |
|
723 // |
|
724 |
|
725 |
|
726 // Ensure RMobilePhone::GetSecurityCaps returns caps in set of KCapsAccessPin2 |
|
727 RMobilePhone& phone = iEtelSessionMgr.GetPhoneL(KMainServer, KMainPhone); |
|
728 TUint32 securityCaps; |
|
729 TInt err = phone.GetSecurityCaps( securityCaps ); |
|
730 CHECK_EQUALS_L(err, KErrNone, _L("RMobilePhone::GetSecurityCaps returned an error")); |
|
731 CHECK_BITS_SET_L( securityCaps, RMobilePhone::KCapsAccessPin2, KNoUnwantedBits, |
|
732 _L("RMobilePhone::GetSecurityCaps returned wrong caps")); |
|
733 |
|
734 // Ensure RMobilePhoneStore::GetInfo returns iCaps in set of KCapsWriteAccess | KCapsReadAccess for FDN phone book |
|
735 RMobilePhoneBookStore& fdnStore = iEtelSessionMgr.GetPhoneBookStoreL(KMainServer,KMainPhone,KIccFdnPhoneBook); |
|
736 RMobilePhoneBookStore::TMobilePhoneBookInfoV1 bookInfo; |
|
737 RMobilePhoneBookStore::TMobilePhoneBookInfoV1Pckg bookInfoPckg(bookInfo); |
|
738 TExtEtelRequestStatus getInfoStatus(fdnStore, EMobilePhoneStoreGetInfo); |
|
739 CleanupStack::PushL (getInfoStatus); |
|
740 User::After(15*KOneSecond); |
|
741 fdnStore.GetInfo (getInfoStatus, bookInfoPckg); |
|
742 CHECK_EQUALS_L(WaitForRequestWithTimeOut(getInfoStatus, ETimeMedium),KErrNone, _L("RMobilePhoneStore::GetInfo timed out")); |
|
743 CHECK_EQUALS_L(getInfoStatus.Int(), KErrNone, _L("RMobilePhoneStore::GetInfo returned an error")); |
|
744 TUint wantedBits = RMobilePhoneStore::KCapsWriteAccess| RMobilePhoneStore::KCapsReadAccess; |
|
745 CHECK_BITS_SET_L(bookInfo.iCaps,wantedBits,KNoUnwantedBits, _L("RMobilePhoneStore::GetInfo returned unexpected iCaps")); |
|
746 |
|
747 // Ensure PIN2 is locked on the SIM |
|
748 RMobilePhone::TMobilePassword pin2Password; |
|
749 GetPIN2PasswordL( phone, pin2Password ); |
|
750 CHECK_EQUALS_L(iPhoneTsyTestHelper.SetPhoneFdnSettingL(phone,pin2Password,RMobilePhone::EFdnSetOn),KErrNone,_L("RMobilePhone::SetFdnSetting returned an error")); |
|
751 |
|
752 // Get Voice line 1. |
|
753 RMobileLine& voiceLine = iEtelSessionMgr.GetLineL(KMainServer, KMainPhone, KVoiceLine); |
|
754 |
|
755 // Get call 1. |
|
756 RMobileCall& call1 = iEtelSessionMgr.GetCallL(KMainServer, KMainPhone, KVoiceLine, KCall1); |
|
757 |
|
758 |
|
759 // |
|
760 // SET UP END |
|
761 // |
|
762 |
|
763 StartTest(); |
|
764 |
|
765 // Backup phone state |
|
766 TFdnCleanupDisable backup(iPhoneTsyTestHelper,phone,pin2Password); |
|
767 CleanupStack::PushL(backup); |
|
768 |
|
769 // |
|
770 // TEST START |
|
771 // |
|
772 |
|
773 |
|
774 // === Dial no FDN check with FDN enabled === |
|
775 |
|
776 // Open the FDN phone book. |
|
777 |
|
778 // Verify PIN2 security code with RMobilePhone::VerifySecurityCode with RMobilePhone::ESecurityCodePin2 |
|
779 |
|
780 // Check RMobilePhone::NotifySecurityEvent completes with RMobilePhone::EPin2Verified |
|
781 iSimTsyTestHelper.VerifyPin2L(phone,iNetworkTsyTestHelper); |
|
782 // Delete all entries from the FDN phone book. |
|
783 TExtEtelRequestStatus deletaAllStatus(fdnStore, EMobilePhoneStoreDeleteAll); |
|
784 CleanupStack::PushL(deletaAllStatus); |
|
785 fdnStore.DeleteAll(deletaAllStatus); |
|
786 ASSERT_EQUALS(WaitForRequestWithTimeOut(deletaAllStatus, ETimeMedium), KErrNone, |
|
787 _L("RMobilePhoneBookStore::DeleteAll timed-out")); |
|
788 ASSERT_EQUALS(deletaAllStatus.Int(), KErrNone, |
|
789 _L("RMobilePhoneBookStore::DeleteAll returned with an error")); |
|
790 |
|
791 // post notifier for RMobileCall::NotifyMobileCallStatusChange |
|
792 RMobileCall::TMobileCallStatus mobileCallStatus; |
|
793 TExtEtelRequestStatus notifyMobileCallStatusChangeStatus(call1, EMobileCallNotifyMobileCallStatusChange); |
|
794 CleanupStack::PushL(notifyMobileCallStatusChangeStatus); |
|
795 call1.NotifyMobileCallStatusChange(notifyMobileCallStatusChangeStatus, mobileCallStatus); |
|
796 |
|
797 // Dial a number that answers using RMobileCall::DialNoFdnCheck |
|
798 TPtrC number; |
|
799 ASSERT_TRUE(GetStringFromConfig(KIniVoiceNumSection, KIniVoiceNumber1, number) != EFalse, |
|
800 _L("CTestStep::GetStringFromConfig did not complete as expected")); |
|
801 TExtEtelRequestStatus dialStatus(call1, EMobileCallDialNoFdnCheck); |
|
802 CleanupStack::PushL(dialStatus); |
|
803 call1.DialNoFdnCheck(dialStatus, number); |
|
804 ASSERT_EQUALS(WaitForRequestWithTimeOut(dialStatus, ETimeLong), KErrNone, |
|
805 _L("RCall::DialNoFdnCheck timed-out")); |
|
806 // $CTSYProblem The CTSY does supports the RMobileCall::DialNoFdnCheck |
|
807 // but waiting for LTSY support for this IPC |
|
808 ASSERT_EQUALS(dialStatus.Int(), KErrTimedOut, |
|
809 _L("RCall::DialNoFdnCheck returned with an error")); |
|
810 /* |
|
811 ASSERT_EQUALS(dialStatus.Int(), KErrNone, _L("RCall::DialNoFdnCheck returned with an error")); |
|
812 |
|
813 // Check RMobileCall::NotifyMobileCallStatusChange completes with EStatusDialling -> EStatusConnecting -> EStatusConnected. |
|
814 RMobileCall::TMobileCallStatus expectedMobileCallStatus = RMobileCall::EStatusDialling; |
|
815 iCallControlTsyTestHelper.WaitForMobileCallNotifyMobileCallStatusChange(call1, |
|
816 notifyMobileCallStatusChangeStatus, |
|
817 mobileCallStatus, |
|
818 expectedMobileCallStatus, |
|
819 KErrNone); |
|
820 call1.NotifyMobileCallStatusChange(notifyMobileCallStatusChangeStatus, mobileCallStatus); |
|
821 expectedMobileCallStatus = RMobileCall::EStatusConnecting; |
|
822 iCallControlTsyTestHelper.WaitForMobileCallNotifyMobileCallStatusChange(call1, |
|
823 notifyMobileCallStatusChangeStatus, |
|
824 mobileCallStatus, |
|
825 expectedMobileCallStatus, |
|
826 KErrNone); |
|
827 call1.NotifyMobileCallStatusChange(notifyMobileCallStatusChangeStatus, mobileCallStatus); |
|
828 expectedMobileCallStatus = RMobileCall::EStatusConnected; |
|
829 iCallControlTsyTestHelper.WaitForMobileCallNotifyMobileCallStatusChange(call1, |
|
830 notifyMobileCallStatusChangeStatus, |
|
831 mobileCallStatus, |
|
832 expectedMobileCallStatus, |
|
833 KErrNone); |
|
834 |
|
835 // Check RMobileCall::GetMobileCallStatus returns status of EStatusConnected. |
|
836 ASSERT_EQUALS(call1.GetMobileCallStatus(mobileCallStatus), KErrNone, |
|
837 _L("RMobileCall::GetMobileCallStatus returned an Error")); |
|
838 ASSERT_EQUALS(mobileCallStatus, RMobileCall::EStatusConnected, |
|
839 _L("RMobileCall::GetMobileCallStatus did not set the status to EStatusConnected")); |
|
840 |
|
841 // Hang up with RCall::HangUp |
|
842 TCoreEtelRequestStatus<RCall> hangUpStatus (call1,&RCall::HangUpCancel); |
|
843 CleanupStack::PushL(hangUpStatus); |
|
844 call1.HangUp(hangUpStatus); |
|
845 ASSERT_EQUALS(WaitForRequestWithTimeOut(hangUpStatus, ETimeMedium), KErrNone, |
|
846 _L("RCall::HangUp timed-out")); |
|
847 ASSERT_EQUALS(hangUpStatus.Int(), KErrNone, |
|
848 _L("RCall::HangUp returned an error")); |
|
849 */ |
|
850 // === Dial no FDN check with FDN disabled === |
|
851 |
|
852 // Call RMobilePhone::SetFdnSetting with RMobilePhone::EFdnSetOff |
|
853 ASSERT_EQUALS(iPhoneTsyTestHelper.SetPhoneFdnSettingL(phone,pin2Password,RMobilePhone::EFdnSetOn),KErrNone,_L("RMobilePhone::SetFdnSetting returned an error")); |
|
854 |
|
855 // Dial the number again using RMobileCall::DialNoFdnCheck |
|
856 call1.DialNoFdnCheck(dialStatus, number); |
|
857 ASSERT_EQUALS(WaitForRequestWithTimeOut(dialStatus, ETimeMedium), KErrTimedOut, |
|
858 _L("RCall::DialNoFdnCheck timed-out")); |
|
859 // $CTSYProblem Does not return KErrNone, returns KErrTimedOut |
|
860 // CTSY supports this API but LTSY times out. |
|
861 ASSERT_EQUALS(dialStatus.Int(), KErrTimedOut, |
|
862 _L("RCall::DialNoFdnCheck returned with an error")); |
|
863 |
|
864 /* |
|
865 |
|
866 // Check RMobileCall::NotifyMobileCallStatusChange completes with EStatusDialling -> EStatusConnecting -> EStatusConnected. |
|
867 expectedMobileCallStatus = RMobileCall::EStatusDialling; |
|
868 iCallControlTsyTestHelper.WaitForMobileCallNotifyMobileCallStatusChange(call1, |
|
869 notifyMobileCallStatusChangeStatus, |
|
870 mobileCallStatus, |
|
871 expectedMobileCallStatus, |
|
872 KErrNone); |
|
873 call1.NotifyMobileCallStatusChange(notifyMobileCallStatusChangeStatus, mobileCallStatus); |
|
874 expectedMobileCallStatus = RMobileCall::EStatusConnecting; |
|
875 iCallControlTsyTestHelper.WaitForMobileCallNotifyMobileCallStatusChange(call1, |
|
876 notifyMobileCallStatusChangeStatus, |
|
877 mobileCallStatus, |
|
878 expectedMobileCallStatus, |
|
879 KErrNone); |
|
880 call1.NotifyMobileCallStatusChange(notifyMobileCallStatusChangeStatus, mobileCallStatus); |
|
881 expectedMobileCallStatus = RMobileCall::EStatusConnected; |
|
882 iCallControlTsyTestHelper.WaitForMobileCallNotifyMobileCallStatusChange(call1, |
|
883 notifyMobileCallStatusChangeStatus, |
|
884 mobileCallStatus, |
|
885 expectedMobileCallStatus, |
|
886 KErrNone); |
|
887 |
|
888 // Check RMobileCall::GetMobileCallStatus returns status of EStatusConnected. |
|
889 ASSERT_EQUALS(call1.GetMobileCallStatus(mobileCallStatus), KErrNone, |
|
890 _L("RMobileCall::GetMobileCallStatus returned an Error")); |
|
891 ASSERT_EQUALS(mobileCallStatus, RMobileCall::EStatusConnected, |
|
892 _L("RMobileCall::GetMobileCallStatus did not set the status to EStatusConnected")); |
|
893 */ |
|
894 |
|
895 // |
|
896 // TEST END |
|
897 // |
|
898 |
|
899 StartCleanup(); |
|
900 |
|
901 // Hang up with RCall::HangUp |
|
902 /* |
|
903 call1.HangUp(hangUpStatus); |
|
904 ASSERT_EQUALS(WaitForRequestWithTimeOut(hangUpStatus, ETimeMedium), KErrNone, |
|
905 _L("RCall::HangUp timed-out")); |
|
906 ASSERT_EQUALS(hangUpStatus.Int(), KErrNone, |
|
907 _L("RCall::HangUp returned an error")); |
|
908 */ |
|
909 // Pop: |
|
910 // /*hangUpStatus*/ |
|
911 // dialStatus |
|
912 // notifyMobileCallStatusChangeStatus |
|
913 // deletaAllStatus |
|
914 // backup |
|
915 // getInfoStatus |
|
916 CleanupStack::PopAndDestroy(5, &getInfoStatus); |
|
917 |
|
918 return TestStepResult(); |
|
919 } |
|
920 |
|
921 TPtrC CCTSYIntegrationTestFixedDialling0004::GetTestStepName() |
|
922 /** |
|
923 * @return The test step name. |
|
924 */ |
|
925 { |
|
926 return _L("CCTSYIntegrationTestFixedDialling0004"); |
|
927 } |
|
928 |
|
929 |