|
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 CallBarring functional unit. |
|
15 // |
|
16 // |
|
17 |
|
18 /** |
|
19 @internalTechnology |
|
20 */ |
|
21 |
|
22 #include "cctsyintegrationtestcallbarring.h" |
|
23 #include "cctsyinidata.h" |
|
24 |
|
25 _LIT(KAltPassword, "0000"); |
|
26 _LIT(KAltPassword2, "1234"); |
|
27 _LIT(KAltPassword4, "1235"); |
|
28 _LIT(KAltPassword5, "123"); |
|
29 _LIT(KAltPasswordVoda, "1919"); |
|
30 _LIT(KIncorrectPassword , "9999"); |
|
31 |
|
32 static const TInt KSsCallBarringAllServices=330; |
|
33 |
|
34 |
|
35 CCTSYIntegrationTestCallBarringBase::CCTSYIntegrationTestCallBarringBase(CEtelSessionMgr& aEtelSessionMgr) |
|
36 : CCTSYIntegrationTestSuiteStepBase(aEtelSessionMgr), |
|
37 iSupplementalTsyTestHelper(*this), |
|
38 iCallControlTsyTestHelper(*this), |
|
39 iNetworkTsyTestHelper(*this) |
|
40 |
|
41 /** |
|
42 * Constructor |
|
43 */ |
|
44 { |
|
45 } |
|
46 |
|
47 CCTSYIntegrationTestCallBarringBase::~CCTSYIntegrationTestCallBarringBase() |
|
48 /* |
|
49 * Destructor |
|
50 */ |
|
51 { |
|
52 } |
|
53 |
|
54 /** |
|
55 * Checks that the call barring password for this SIM is known and leaves if not |
|
56 @param aPhone RMobilePhone session |
|
57 @param aPassword On completion, the call barring password. The function leaves if this is not found. |
|
58 */ |
|
59 void CCTSYIntegrationTestCallBarringBase::CheckCBPasswordL( RMobilePhone &aPhone, RMobilePhone::TMobilePassword &aPassword ) |
|
60 { |
|
61 |
|
62 DEBUG_PRINTF1(_L("Attempting to check call barring password is known")); |
|
63 |
|
64 // wait until we are on the network |
|
65 |
|
66 CHECK_EQUALS_L( iNetworkTsyTestHelper.WaitForRegisteredOnHomeNetworkL( aPhone ), KErrNone, |
|
67 _L("Network is unavailable") ); |
|
68 |
|
69 const TDesC* networkSection = NULL; |
|
70 iNetworkTsyTestHelper.GetNetworkPasswordsSectionL(aPhone,networkSection); |
|
71 |
|
72 // Get the password from the ini file |
|
73 TPtrC password; |
|
74 TBool gotPass = GetStringFromConfig( *networkSection, KIniCallBarring1, password ); |
|
75 |
|
76 CHECK_TRUE_L( gotPass, _L("Failed to read password from INI file")); |
|
77 |
|
78 // Check the call barring password by attempting to reset call barring for all services |
|
79 DEBUG_PRINTF2(_L("Checking call barring password from INI file %S"), &password); |
|
80 |
|
81 aPassword = password; |
|
82 TInt err = DeactivateCallBarringL( aPhone, aPassword ); |
|
83 CHECK_EQUALS_L( err, KErrNone, _L("RMobilePhone::SetCallBarringStatus returned error")); |
|
84 |
|
85 } |
|
86 |
|
87 |
|
88 /** |
|
89 * Resest call barring for all services |
|
90 */ |
|
91 TInt CCTSYIntegrationTestCallBarringBase::DeactivateCallBarringL( RMobilePhone &aPhone, |
|
92 const RMobilePhone::TMobilePassword& aPassword ) |
|
93 { |
|
94 RMobilePhone::TMobilePhoneCBChangeV1 cbInfo; |
|
95 cbInfo.iAction = RMobilePhone::EServiceActionDeactivate; |
|
96 cbInfo.iPassword = aPassword; |
|
97 cbInfo.iServiceGroup = RMobilePhone::EAllServices; |
|
98 |
|
99 TExtEtelRequestStatus reqStatus(aPhone, EMobilePhoneSetCallBarringStatus); |
|
100 CleanupStack::PushL(reqStatus); |
|
101 |
|
102 aPhone.SetCallBarringStatus( reqStatus, RMobilePhone::EBarAllCases, cbInfo ); |
|
103 TInt err = WaitForRequestWithTimeOut( reqStatus, ETimeMedium); |
|
104 |
|
105 if( KErrNone == err ) |
|
106 { |
|
107 err = reqStatus.Int(); |
|
108 } |
|
109 |
|
110 CleanupStack::PopAndDestroy(1,&reqStatus); |
|
111 |
|
112 return err; |
|
113 } |
|
114 |
|
115 |
|
116 /** |
|
117 * Set the call barring status |
|
118 */ |
|
119 TInt CCTSYIntegrationTestCallBarringBase::SetCBStatusL( RMobilePhone& aPhone, |
|
120 RMobilePhone::TMobilePhoneCBChangeV1& aInfo, |
|
121 RMobilePhone::TMobilePhoneCBCondition aCondition ) |
|
122 { |
|
123 TExtEtelRequestStatus reqStatus(aPhone, EMobilePhoneSetCallBarringStatus); |
|
124 CleanupStack::PushL(reqStatus); |
|
125 |
|
126 aPhone.SetCallBarringStatus( reqStatus, aCondition, aInfo ); |
|
127 |
|
128 TInt err = WaitForRequestWithTimeOut( reqStatus, ETimeMedium); |
|
129 |
|
130 if( KErrNone == err ) |
|
131 { |
|
132 err = reqStatus.Int(); |
|
133 } |
|
134 |
|
135 CleanupStack::PopAndDestroy(1); |
|
136 |
|
137 return err; |
|
138 } |
|
139 |
|
140 |
|
141 /** |
|
142 * Search a status list for particular call barring entry |
|
143 */ |
|
144 TBool CCTSYIntegrationTestCallBarringBase::SearchCBStatusListL( CMobilePhoneCBList* aList, |
|
145 RMobilePhone::TMobilePhoneCBCondition aCondition, |
|
146 RMobilePhone::TMobileService aService, |
|
147 RMobilePhone::TMobilePhoneCBStatus aStatus ) |
|
148 { |
|
149 TInt count = aList->Enumerate(); |
|
150 |
|
151 for( TInt i=0; i < count; i++ ) |
|
152 { |
|
153 const RMobilePhone::TMobilePhoneCBInfoEntryV1 ele = aList->GetEntryL(i); |
|
154 |
|
155 if( ele.iCondition == aCondition && |
|
156 ele.iServiceGroup == aService && |
|
157 ele.iStatus == aStatus ) |
|
158 { |
|
159 return ETrue; |
|
160 } |
|
161 } |
|
162 |
|
163 DEBUG_PRINTF4( _L("Failed to find CMobilePhoneCBList entry condition=%d service=%d status=%d"), aCondition, aService, aStatus ); |
|
164 return EFalse; |
|
165 } |
|
166 |
|
167 /******************************************************************************/ |
|
168 |
|
169 |
|
170 CCTSYIntegrationTestCallBarring0001::CCTSYIntegrationTestCallBarring0001(CEtelSessionMgr& aEtelSessionMgr) |
|
171 : CCTSYIntegrationTestCallBarringBase(aEtelSessionMgr) |
|
172 /** |
|
173 * Constructor. |
|
174 */ |
|
175 { |
|
176 SetTestStepName(CCTSYIntegrationTestCallBarring0001::GetTestStepName()); |
|
177 } |
|
178 |
|
179 CCTSYIntegrationTestCallBarring0001::~CCTSYIntegrationTestCallBarring0001() |
|
180 /** |
|
181 * Destructor. |
|
182 */ |
|
183 { |
|
184 } |
|
185 |
|
186 TVerdict CCTSYIntegrationTestCallBarring0001::doTestStepL() |
|
187 /** |
|
188 * @SYMTestCaseID BA-CTSY-INT-CBAR-0001 |
|
189 * @SYMFssID BA/CTSY/CBAR-0001 |
|
190 * @SYMTestCaseDesc Activate and deactivate call barring for outgoing voice calls. |
|
191 * @SYMTestPriority High |
|
192 * @SYMTestActions RMobilePhone::NotifyCallBarringStatusChange, RMobilePhone::SetCallBarringStatus, RCall::Dial, RCall::HangUp |
|
193 * @SYMTestExpectedResults Pass - Call barring activated and barred numbers cannot be dialled. |
|
194 * @SYMTestType CIT |
|
195 * @SYMTestCaseDependencies live/automatic |
|
196 * |
|
197 * Reason for test: Verify call barring status and barred number cannot be dialled. |
|
198 * |
|
199 * @return - TVerdict code |
|
200 */ |
|
201 { |
|
202 |
|
203 // |
|
204 // SET UP |
|
205 // |
|
206 |
|
207 RMobilePhone& phone = iEtelSessionMgr.GetPhoneL(KMainServer, KMainPhone); |
|
208 RMobilePhone::TMobilePassword password; |
|
209 CheckCBPasswordL( phone, password ); |
|
210 |
|
211 // Ensure RMobilePhone::GetCallServiceCaps returns caps in set of: KCapsNotifyCBStatus | KCapsSetCBStatus | KCapsBarAllOutgoing | KCapsBarOutgoingInternational | KCapsBarOutgoingInternationalExHC |
|
212 TUint32 callBarCaps; |
|
213 TInt err = phone.GetCallServiceCaps( callBarCaps ); |
|
214 CHECK_EQUALS_L(err, KErrNone, _L("RMobilePhone::GetCallServiceCaps returned error")); |
|
215 CHECK_BITS_SET_L( callBarCaps, (RMobilePhone::KCapsNotifyCBStatus | |
|
216 RMobilePhone::KCapsSetCBStatus | |
|
217 RMobilePhone::KCapsBarAllOutgoing | |
|
218 RMobilePhone::KCapsBarOutgoingInternational | |
|
219 RMobilePhone::KCapsBarOutgoingInternationalExHC) , |
|
220 KNoUnwantedBits, |
|
221 _L("GetCallServiceCaps returned unexpected bitmap")); |
|
222 |
|
223 // Set the call barring password to a known password using RMobilePhone::SetSSPassword |
|
224 RMobilePhone::TMobilePhonePasswordChangeV2 passwordV2; |
|
225 RMobilePhone::TMobilePhonePasswordChangeV2Pckg passwordPkg(passwordV2); |
|
226 |
|
227 // NOTE - we don't actually change the password for safety |
|
228 passwordV2.iOldPassword = password; |
|
229 passwordV2.iNewPassword = password; |
|
230 passwordV2.iVerifiedPassword = password; |
|
231 |
|
232 TExtEtelRequestStatus reqSetSSPasswordStatus(phone, EMobilePhoneSetSSPassword); |
|
233 CleanupStack::PushL(reqSetSSPasswordStatus); |
|
234 phone.SetSSPassword(reqSetSSPasswordStatus, passwordPkg, KSsCallBarringAllServices ); |
|
235 CHECK_EQUALS_L( WaitForRequestWithTimeOut( reqSetSSPasswordStatus, ETimeMedium), KErrNone, |
|
236 _L("RMobilePhone::SetSSPassword timed out") ); |
|
237 CHECK_EQUALS_L( reqSetSSPasswordStatus.Int(), KErrNone, _L("RMobilePhone::SetSSPassword returned error")); |
|
238 |
|
239 // Get voice line 1. |
|
240 RMobileLine& voiceLine = iEtelSessionMgr.GetLineL(KMainServer,KMainPhone, KVoiceLine); |
|
241 |
|
242 // Get call 1. |
|
243 RMobileCall& call1 = iEtelSessionMgr.GetCallL(KMainServer,KMainPhone, KVoiceLine,KCall1 ); |
|
244 |
|
245 // Obtain our test call numbers |
|
246 TPtrC intNumber; |
|
247 TBool numOK = GetStringFromConfig(KIniVoiceNumSection, KIniVoiceNumberInternational, intNumber); |
|
248 CHECK_TRUE_L( numOK, _L("Failed to obtain international number for test") ); |
|
249 |
|
250 TPtrC natNumberWithPrefix; |
|
251 numOK = GetStringFromConfig(KIniVoiceNumSection, KIniVoiceNumberIntExHC, natNumberWithPrefix); |
|
252 CHECK_TRUE_L( numOK, _L("Failed to obtain prefixed national number for test") ); |
|
253 |
|
254 |
|
255 TPtrC natNumber; |
|
256 numOK = GetStringFromConfig(KIniVoiceNumSection, KIniVoiceNumber1, natNumber); |
|
257 CHECK_TRUE_L( numOK, _L("Failed to obtain national number for test") ); |
|
258 |
|
259 |
|
260 // |
|
261 // SET UP END |
|
262 // |
|
263 |
|
264 StartTest(); |
|
265 |
|
266 // |
|
267 // TEST START |
|
268 // |
|
269 |
|
270 |
|
271 // === Activate call barring on voice calls to outgoing international numbers and check |
|
272 // international number cannot be dialled === |
|
273 |
|
274 // Set up the notification request |
|
275 TExtEtelRequestStatus cbStatusNotify( phone, EMobilePhoneNotifyCallBarringStatusChange ); |
|
276 CleanupStack::PushL(cbStatusNotify); |
|
277 RMobilePhone::TMobilePhoneCBCondition notifiedCBCondition; |
|
278 phone.NotifyCallBarringStatusChange( cbStatusNotify, notifiedCBCondition); |
|
279 |
|
280 // Activate call barring using RMobilePhone::SetCallBarringStatus with |
|
281 // aInfo.iAction=EServiceActionActivate, |
|
282 // aInfo.iPassword=correct call barring password, |
|
283 // aInfo.iServiceGroup=EVoiceService and |
|
284 // aCondition=EBarOutgoingInternational |
|
285 RMobilePhone::TMobilePhoneCBChangeV1 cbInfo; |
|
286 cbInfo.iAction = RMobilePhone::EServiceActionActivate; |
|
287 cbInfo.iPassword = password; |
|
288 cbInfo.iServiceGroup = RMobilePhone::EVoiceService; |
|
289 |
|
290 RMobilePhone::TMobilePhoneCBCondition wantedCBCondition = RMobilePhone::EBarOutgoingInternational; |
|
291 err = SetCBStatusL( phone, cbInfo, wantedCBCondition); |
|
292 ASSERT_EQUALS( err, KErrNone, _L("RMobilePhone::SetCallBarringStatus returned error")); |
|
293 |
|
294 // Check RMobilePhone::NotifyCallBarringStatusChange completes with aCondition=EBarOutgoingInternational |
|
295 iSupplementalTsyTestHelper.WaitForMobilePhoneNotifyCallBarringStatusChange(phone, |
|
296 cbStatusNotify, |
|
297 notifiedCBCondition, |
|
298 wantedCBCondition, |
|
299 KErrNone ); |
|
300 |
|
301 ASSERT_EQUALS( notifiedCBCondition, wantedCBCondition, |
|
302 _L("RMobilePhone::NotifyCallBarringStatusChange did not return matching condition") ); |
|
303 |
|
304 // Dial an international number. |
|
305 // Check this fails. |
|
306 DEBUG_PRINTF2(_L("Barred international - Calling international %S should not be allowed"), &intNumber ); |
|
307 |
|
308 TExtEtelRequestStatus notifyMobileCallStatusChangeStatus(call1, EMobileCallNotifyMobileCallStatusChange); |
|
309 CleanupStack::PushL(notifyMobileCallStatusChangeStatus); |
|
310 RMobileCall::TMobileCallStatus mobileCallStatus; |
|
311 call1.NotifyMobileCallStatusChange(notifyMobileCallStatusChangeStatus, mobileCallStatus); |
|
312 |
|
313 // Check RMobileCall::NotifyMobileCallStatusChange completes with EStatusIdle. |
|
314 TCoreEtelRequestStatus<RCall> dialStatus(call1, &RCall::DialCancel); |
|
315 CleanupStack::PushL(dialStatus); |
|
316 call1.Dial(dialStatus, intNumber); |
|
317 |
|
318 // Check RMobileLine::NotifyMobileLineStatusChange completes with with EStatusDialling -> |
|
319 DEBUG_PRINTF1(_L("Checking EStatusDialling") ); |
|
320 RMobileCall::TMobileCallStatus expectedMobileCallStatus = RMobileCall::EStatusDialling; |
|
321 iCallControlTsyTestHelper.WaitForMobileCallNotifyMobileCallStatusChange(call1, |
|
322 notifyMobileCallStatusChangeStatus, |
|
323 mobileCallStatus, |
|
324 expectedMobileCallStatus, |
|
325 KErrNone); |
|
326 |
|
327 // Check RMobileLine::NotifyMobileLineStatusChange completes with with EStatusDisconnecting. |
|
328 DEBUG_PRINTF1(_L("Checking EStatusDisconnecting") ); |
|
329 expectedMobileCallStatus = RMobileCall::EStatusDisconnecting; |
|
330 call1.NotifyMobileCallStatusChange(notifyMobileCallStatusChangeStatus, mobileCallStatus); |
|
331 iCallControlTsyTestHelper.WaitForMobileCallNotifyMobileCallStatusChange(call1, |
|
332 notifyMobileCallStatusChangeStatus, |
|
333 mobileCallStatus, |
|
334 expectedMobileCallStatus, |
|
335 KErrNone); |
|
336 |
|
337 // Check RMobileLine::NotifyMobileLineStatusChange completes with with EStatusIdle. |
|
338 DEBUG_PRINTF1(_L("Checking EStatusIdle") ); |
|
339 expectedMobileCallStatus = RMobileCall::EStatusIdle; |
|
340 call1.NotifyMobileCallStatusChange(notifyMobileCallStatusChangeStatus, mobileCallStatus); |
|
341 iCallControlTsyTestHelper.WaitForMobileCallNotifyMobileCallStatusChange(call1, |
|
342 notifyMobileCallStatusChangeStatus, |
|
343 mobileCallStatus, |
|
344 expectedMobileCallStatus, |
|
345 KErrNone); |
|
346 DEBUG_PRINTF1(_L("Dial status request") ); |
|
347 ASSERT_EQUALS(WaitForRequestWithTimeOut(dialStatus, ETimeMedium), KErrNone, |
|
348 _L("RMobileCall::Dial timed-out")); |
|
349 ASSERT_EQUALS(dialStatus.Int(), KErrGsmCCNormalUnspecified, |
|
350 _L("RMobileCall::Dial returned error") ); |
|
351 |
|
352 // Precaution when expected no connection |
|
353 DEBUG_PRINTF1(_L("Hanging up...") ); |
|
354 call1.HangUp(); |
|
355 |
|
356 // === Deactivate call barring on voice calls to outgoing international numbers and check |
|
357 // international number can be dialled |
|
358 // === |
|
359 |
|
360 // Deactivate call barring using RMobilePhone::SetCallBarringStatus with |
|
361 // aInfo.iAction=EServiceActionDeactivate, |
|
362 // aInfo.iPassword=correct call barring password, |
|
363 // aInfo.iServiceGroup=EVoiceService |
|
364 // and aCondition=EBarOutgoingInternational |
|
365 |
|
366 cbInfo.iAction = RMobilePhone::EServiceActionDeactivate; |
|
367 wantedCBCondition = RMobilePhone::EBarOutgoingInternational; |
|
368 |
|
369 phone.NotifyCallBarringStatusChange( cbStatusNotify, notifiedCBCondition); |
|
370 |
|
371 err = SetCBStatusL( phone, cbInfo, wantedCBCondition); |
|
372 ASSERT_EQUALS( err, KErrNone, _L("RMobilePhone::SetCallBarringStatus returned error")); |
|
373 |
|
374 // Check RMobilePhone::NotifyCallBarringStatusChange completes with aCondition=EBarOutgoingInternational |
|
375 iSupplementalTsyTestHelper.WaitForMobilePhoneNotifyCallBarringStatusChange(phone, |
|
376 cbStatusNotify, |
|
377 notifiedCBCondition, |
|
378 wantedCBCondition, |
|
379 KErrNone ); |
|
380 |
|
381 ASSERT_EQUALS( notifiedCBCondition, wantedCBCondition, |
|
382 _L("RMobilePhone::NotifyCallBarringStatusChange did not return matching condition") ); |
|
383 |
|
384 |
|
385 // Dial an international number that answers. |
|
386 DEBUG_PRINTF2(_L("Calling international %S should be allowed"), &intNumber ); |
|
387 |
|
388 call1.NotifyMobileCallStatusChange(notifyMobileCallStatusChangeStatus, mobileCallStatus); |
|
389 call1.Dial(dialStatus, intNumber ); |
|
390 |
|
391 // Check RMobileCall::NotifyMobileCallStatusChange completes with EStatusConnected. |
|
392 expectedMobileCallStatus = RMobileCall::EStatusConnected; |
|
393 iCallControlTsyTestHelper.WaitForMobileCallNotifyMobileCallStatusChange( call1, |
|
394 notifyMobileCallStatusChangeStatus, |
|
395 mobileCallStatus, |
|
396 RMobileCall::EStatusConnected, |
|
397 KErrNone ); |
|
398 |
|
399 ASSERT_EQUALS(WaitForRequestWithTimeOut(dialStatus, ETimeMedium), KErrNone, |
|
400 _L("RMobileCall::Dial timed-out")); |
|
401 ASSERT_EQUALS(dialStatus.Int(), KErrNone, |
|
402 _L("RMobileCall::Dial returned an error") ); |
|
403 |
|
404 // Hang up |
|
405 call1.NotifyMobileCallStatusChange( notifyMobileCallStatusChangeStatus, mobileCallStatus ); |
|
406 call1.HangUp(); |
|
407 |
|
408 // Check RMobileCall::NotifyMobileCallStatusChange completes with EStatusIdle. |
|
409 expectedMobileCallStatus = RMobileCall::EStatusIdle; |
|
410 iCallControlTsyTestHelper.WaitForMobileCallNotifyMobileCallStatusChange( call1, |
|
411 notifyMobileCallStatusChangeStatus, |
|
412 mobileCallStatus, |
|
413 RMobileCall::EStatusIdle, |
|
414 KErrNone ); |
|
415 |
|
416 ASSERT_EQUALS( mobileCallStatus, RMobileCall::EStatusIdle, _L("Call status is not EStatusIdle") ); |
|
417 |
|
418 // === Activate call barring on voice calls to outgoing international numbers |
|
419 // excluding home country and check national number with + prefix can be dialled |
|
420 // but international number in another country cannot be dialled |
|
421 // === |
|
422 |
|
423 // Activate call barring using RMobilePhone::SetCallBarringStatus with |
|
424 // aInfo.iAction=EServiceActionActivate, |
|
425 // aInfo.iPassword=correct call barring password, |
|
426 // aInfo.iServiceGroup=EVoiceService and |
|
427 // aCondition=EBarOutgoingInternationalExHC |
|
428 |
|
429 cbInfo.iAction = RMobilePhone::EServiceActionActivate; |
|
430 wantedCBCondition = RMobilePhone::EBarOutgoingInternationalExHC; |
|
431 |
|
432 phone.NotifyCallBarringStatusChange( cbStatusNotify, notifiedCBCondition); |
|
433 err = SetCBStatusL( phone, cbInfo, wantedCBCondition); |
|
434 ASSERT_EQUALS( err, KErrNone, _L("RMobilePhone::SetCallBarringStatus returned error")); |
|
435 |
|
436 // Check RMobilePhone::NotifyCallBarringStatusChange completes with aCondition=EBarOutgoingInternationalExHC |
|
437 iSupplementalTsyTestHelper.WaitForMobilePhoneNotifyCallBarringStatusChange(phone, |
|
438 cbStatusNotify, |
|
439 notifiedCBCondition, |
|
440 RMobilePhone::EBarOutgoingInternationalExHC, |
|
441 KErrNone ); |
|
442 |
|
443 // Dial a national number that answers specifying the number using + prefix. |
|
444 DEBUG_PRINTF1(_L("Barred international ExHC - Calling national with + prefix")); |
|
445 |
|
446 call1.NotifyMobileCallStatusChange( notifyMobileCallStatusChangeStatus, mobileCallStatus ); |
|
447 call1.Dial(dialStatus, natNumberWithPrefix ); |
|
448 |
|
449 // Check RMobileCall::NotifyMobileCallStatusChange completes with EStatusConnected. |
|
450 iCallControlTsyTestHelper.WaitForMobileCallNotifyMobileCallStatusChange( call1, |
|
451 notifyMobileCallStatusChangeStatus, |
|
452 mobileCallStatus, |
|
453 RMobileCall::EStatusConnected, KErrNone ); |
|
454 |
|
455 ASSERT_EQUALS(WaitForRequestWithTimeOut(dialStatus, ETimeMedium), KErrNone, |
|
456 _L("RMobileCall::Dial timed-out")); |
|
457 ASSERT_EQUALS(dialStatus.Int(), KErrNone, |
|
458 _L("RMobileCall::Dial returned an error") ); |
|
459 |
|
460 // Hang up. |
|
461 // Check RMobileCall::NotifyMobileCallStatusChange completes with EStatusIdle. |
|
462 call1.NotifyMobileCallStatusChange( notifyMobileCallStatusChangeStatus, mobileCallStatus ); |
|
463 call1.HangUp(); |
|
464 |
|
465 // Check RMobileCall::NotifyMobileCallStatusChange completes with EStatusIdle. |
|
466 iCallControlTsyTestHelper.WaitForMobileCallNotifyMobileCallStatusChange( call1, |
|
467 notifyMobileCallStatusChangeStatus, |
|
468 mobileCallStatus, |
|
469 RMobileCall::EStatusIdle, |
|
470 KErrNone ); |
|
471 |
|
472 ASSERT_EQUALS( mobileCallStatus, RMobileCall::EStatusIdle, _L("RMobileCall::NotifyMobileCallStatusChange did not complete with EStatusIdle") ); |
|
473 |
|
474 // Dial an international number in another country. |
|
475 // Check this fails. |
|
476 DEBUG_PRINTF1(_L("Barred international ExHC- Calling international")); |
|
477 |
|
478 call1.NotifyMobileCallStatusChange(notifyMobileCallStatusChangeStatus, mobileCallStatus); |
|
479 call1.Dial(dialStatus, intNumber); |
|
480 |
|
481 // Check RMobileLine::NotifyMobileLineStatusChange completes with with EStatusDialling -> |
|
482 DEBUG_PRINTF1(_L("Checking EStatusDialling") ); |
|
483 expectedMobileCallStatus = RMobileCall::EStatusDialling; |
|
484 iCallControlTsyTestHelper.WaitForMobileCallNotifyMobileCallStatusChange(call1, |
|
485 notifyMobileCallStatusChangeStatus, |
|
486 mobileCallStatus, |
|
487 expectedMobileCallStatus, |
|
488 KErrNone); |
|
489 |
|
490 // Check RMobileLine::NotifyMobileLineStatusChange completes with with EStatusConnecting -> |
|
491 DEBUG_PRINTF1(_L("Checking EStatusConnecting") ); |
|
492 expectedMobileCallStatus = RMobileCall::EStatusConnecting; |
|
493 call1.NotifyMobileCallStatusChange(notifyMobileCallStatusChangeStatus, mobileCallStatus); |
|
494 iCallControlTsyTestHelper.WaitForMobileCallNotifyMobileCallStatusChange(call1, |
|
495 notifyMobileCallStatusChangeStatus, |
|
496 mobileCallStatus, |
|
497 expectedMobileCallStatus, |
|
498 KErrNone); |
|
499 |
|
500 // Check RMobileLine::NotifyMobileLineStatusChange completes with with EStatusDisconnecting. |
|
501 DEBUG_PRINTF1(_L("Checking EStatusDisconnecting") ); |
|
502 expectedMobileCallStatus = RMobileCall::EStatusDisconnecting; |
|
503 call1.NotifyMobileCallStatusChange(notifyMobileCallStatusChangeStatus, mobileCallStatus); |
|
504 iCallControlTsyTestHelper.WaitForMobileCallNotifyMobileCallStatusChange(call1, |
|
505 notifyMobileCallStatusChangeStatus, |
|
506 mobileCallStatus, |
|
507 expectedMobileCallStatus, |
|
508 KErrNone); |
|
509 |
|
510 // Check RMobileLine::NotifyMobileLineStatusChange completes with with EStatusIdle. |
|
511 DEBUG_PRINTF1(_L("Checking EStatusIdle") ); |
|
512 expectedMobileCallStatus = RMobileCall::EStatusIdle; |
|
513 call1.NotifyMobileCallStatusChange(notifyMobileCallStatusChangeStatus, mobileCallStatus); |
|
514 iCallControlTsyTestHelper.WaitForMobileCallNotifyMobileCallStatusChange(call1, |
|
515 notifyMobileCallStatusChangeStatus, |
|
516 mobileCallStatus, |
|
517 expectedMobileCallStatus, |
|
518 KErrNone); |
|
519 |
|
520 ASSERT_EQUALS(WaitForRequestWithTimeOut(dialStatus, ETimeMedium), KErrNone, |
|
521 _L("RMobileCall::Dial timed-out")); |
|
522 ASSERT_EQUALS(dialStatus.Int(), KErrGsmCCNormalUnspecified, |
|
523 _L("RMobileCall::Dial returned error") ); |
|
524 |
|
525 // Precaution when expected no connection |
|
526 call1.HangUp(); |
|
527 |
|
528 // === Deactivate call barring on voice calls to outgoing international numbers excluding home country |
|
529 // and check national and international numbers in international format can be dialled |
|
530 // === |
|
531 |
|
532 // Deactivate call barring using RMobilePhone::SetCallBarringStatus with |
|
533 // aInfo.iAction=EServiceActionDeactivate, |
|
534 // aInfo.iPassword=correct call barring password, |
|
535 // aInfo.iServiceGroup=EVoiceService and |
|
536 // aCondition=EBarOutgoingInternationalExHC |
|
537 cbInfo.iAction = RMobilePhone::EServiceActionDeactivate; |
|
538 wantedCBCondition = RMobilePhone::EBarOutgoingInternationalExHC; |
|
539 phone.NotifyCallBarringStatusChange( cbStatusNotify, notifiedCBCondition); |
|
540 |
|
541 err = SetCBStatusL( phone, cbInfo, wantedCBCondition); |
|
542 ASSERT_EQUALS( err, KErrNone, _L("RMobilePhone::SetCallBarringStatus returned error")); |
|
543 |
|
544 // Check RMobilePhone::NotifyCallBarringStatusChange completes with aCondition=EBarOutgoingInternationalExHC |
|
545 iSupplementalTsyTestHelper.WaitForMobilePhoneNotifyCallBarringStatusChange(phone, |
|
546 cbStatusNotify, |
|
547 notifiedCBCondition, |
|
548 wantedCBCondition, |
|
549 KErrNone ); |
|
550 |
|
551 ASSERT_EQUALS( notifiedCBCondition, wantedCBCondition, |
|
552 _L("RMobilePhone::NotifyCallBarringStatusChange did not return matching condition") ); |
|
553 |
|
554 // Dial a national number using + prefix. |
|
555 DEBUG_PRINTF1(_L("No barring - Calling national with + prefix")); |
|
556 |
|
557 call1.NotifyMobileCallStatusChange(notifyMobileCallStatusChangeStatus, mobileCallStatus); |
|
558 call1.Dial(dialStatus, natNumberWithPrefix ); |
|
559 |
|
560 // Check RMobileCall::NotifyMobileCallStatusChange completes with EStatusConnected. |
|
561 iCallControlTsyTestHelper.WaitForMobileCallNotifyMobileCallStatusChange( call1, |
|
562 notifyMobileCallStatusChangeStatus, |
|
563 mobileCallStatus, |
|
564 RMobileCall::EStatusConnected, |
|
565 KErrNone ); |
|
566 |
|
567 ASSERT_EQUALS(WaitForRequestWithTimeOut(dialStatus, ETimeMedium), KErrNone, |
|
568 _L("RCall::Dial timed-out")); |
|
569 ASSERT_EQUALS(dialStatus.Int(), KErrNone, |
|
570 _L("RCall::Dial returned error") ); |
|
571 |
|
572 // Hang up. |
|
573 call1.NotifyMobileCallStatusChange(notifyMobileCallStatusChangeStatus, mobileCallStatus); |
|
574 call1.HangUp(); |
|
575 |
|
576 // Check RMobileCall::NotifyMobileCallStatusChange completes with EStatusIdle. |
|
577 iCallControlTsyTestHelper.WaitForMobileCallNotifyMobileCallStatusChange( call1, |
|
578 notifyMobileCallStatusChangeStatus, |
|
579 mobileCallStatus, |
|
580 RMobileCall::EStatusIdle, |
|
581 KErrNone ); |
|
582 |
|
583 ASSERT_EQUALS( mobileCallStatus, RMobileCall::EStatusIdle, _L("Call status is not EStatusIdle") ); |
|
584 |
|
585 // Dial an international number in another country. |
|
586 DEBUG_PRINTF1(_L("No barring - Calling international")); |
|
587 |
|
588 call1.NotifyMobileCallStatusChange(notifyMobileCallStatusChangeStatus, mobileCallStatus); |
|
589 call1.Dial(dialStatus, intNumber ); |
|
590 |
|
591 // Check RMobileCall::NotifyMobileCallStatusChange completes with EStatusConnected. |
|
592 iCallControlTsyTestHelper.WaitForMobileCallNotifyMobileCallStatusChange( call1, |
|
593 notifyMobileCallStatusChangeStatus, |
|
594 mobileCallStatus, |
|
595 RMobileCall::EStatusConnected, |
|
596 KErrNone ); |
|
597 |
|
598 ASSERT_EQUALS(WaitForRequestWithTimeOut(dialStatus, ETimeMedium), KErrNone, |
|
599 _L("RMobileCall::Dial timed-out")); |
|
600 ASSERT_EQUALS(dialStatus.Int(), KErrNone, |
|
601 _L("RMobileCall::Dial returned an error") ); |
|
602 |
|
603 // Hang up. |
|
604 // Check RMobileCall::NotifyMobileCallStatusChange completes with EStatusIdle. |
|
605 call1.NotifyMobileCallStatusChange( notifyMobileCallStatusChangeStatus, mobileCallStatus ); |
|
606 call1.HangUp(); |
|
607 |
|
608 // Check RMobileCall::NotifyMobileCallStatusChange completes with EStatusIdle. |
|
609 iCallControlTsyTestHelper.WaitForMobileCallNotifyMobileCallStatusChange( call1, |
|
610 notifyMobileCallStatusChangeStatus, |
|
611 mobileCallStatus, |
|
612 RMobileCall::EStatusIdle, |
|
613 KErrNone ); |
|
614 |
|
615 ASSERT_EQUALS( mobileCallStatus, RMobileCall::EStatusIdle, _L("Call status is not EStatusIdle") ); |
|
616 |
|
617 // === Activate call barring on voice calls to all outgoing numbers and check they cannot be dialled === |
|
618 // Activate call barring using RMobilePhone::SetCallBarringStatus with |
|
619 // aInfo.iAction=EServiceActionActivate, |
|
620 // aInfo.iPassword=correct call barring password, |
|
621 // aInfo.iServiceGroup=EVoiceService and |
|
622 // aCondition=EBarAllOutgoing |
|
623 cbInfo.iAction = RMobilePhone::EServiceActionActivate; |
|
624 wantedCBCondition = RMobilePhone::EBarAllOutgoing; |
|
625 phone.NotifyCallBarringStatusChange( cbStatusNotify, notifiedCBCondition); |
|
626 |
|
627 err = SetCBStatusL( phone, cbInfo, wantedCBCondition); |
|
628 ASSERT_EQUALS( err, KErrNone, _L("RMobilePhone::SetCallBarringStatus returned error")); |
|
629 |
|
630 // Check RMobilePhone::NotifyCallBarringStatusChange completes with aCondition=EBarAllOutgoing |
|
631 iSupplementalTsyTestHelper.WaitForMobilePhoneNotifyCallBarringStatusChange(phone, |
|
632 cbStatusNotify, |
|
633 notifiedCBCondition, |
|
634 wantedCBCondition, |
|
635 KErrNone ); |
|
636 |
|
637 ASSERT_EQUALS( notifiedCBCondition, wantedCBCondition, |
|
638 _L("RMobilePhone::NotifyCallBarringStatusChange did not return matching condition") ); |
|
639 |
|
640 // Dial a national number. |
|
641 // Check this fails. |
|
642 DEBUG_PRINTF1(_L("All calls barred - Calling national")); |
|
643 |
|
644 call1.NotifyMobileCallStatusChange(notifyMobileCallStatusChangeStatus, mobileCallStatus); |
|
645 call1.Dial(dialStatus, natNumber); |
|
646 |
|
647 // Check RMobileLine::NotifyMobileLineStatusChange completes with with EStatusDialling -> |
|
648 DEBUG_PRINTF1(_L("Checking EStatusDialling") ); |
|
649 expectedMobileCallStatus = RMobileCall::EStatusDialling; |
|
650 iCallControlTsyTestHelper.WaitForMobileCallNotifyMobileCallStatusChange(call1, |
|
651 notifyMobileCallStatusChangeStatus, |
|
652 mobileCallStatus, |
|
653 expectedMobileCallStatus, |
|
654 KErrNone); |
|
655 |
|
656 // Check RMobileLine::NotifyMobileLineStatusChange completes with with EStatusConnecting -> |
|
657 DEBUG_PRINTF1(_L("Checking EStatusConnecting") ); |
|
658 expectedMobileCallStatus = RMobileCall::EStatusConnecting; |
|
659 call1.NotifyMobileCallStatusChange(notifyMobileCallStatusChangeStatus, mobileCallStatus); |
|
660 iCallControlTsyTestHelper.WaitForMobileCallNotifyMobileCallStatusChange(call1, |
|
661 notifyMobileCallStatusChangeStatus, |
|
662 mobileCallStatus, |
|
663 expectedMobileCallStatus, |
|
664 KErrNone); |
|
665 |
|
666 // Check RMobileLine::NotifyMobileLineStatusChange completes with with EStatusDisconnecting. |
|
667 DEBUG_PRINTF1(_L("Checking EStatusDisconnecting") ); |
|
668 expectedMobileCallStatus = RMobileCall::EStatusDisconnecting; |
|
669 call1.NotifyMobileCallStatusChange(notifyMobileCallStatusChangeStatus, mobileCallStatus); |
|
670 iCallControlTsyTestHelper.WaitForMobileCallNotifyMobileCallStatusChange(call1, |
|
671 notifyMobileCallStatusChangeStatus, |
|
672 mobileCallStatus, |
|
673 expectedMobileCallStatus, |
|
674 KErrNone); |
|
675 |
|
676 // Check RMobileLine::NotifyMobileLineStatusChange completes with with EStatusIdle. |
|
677 DEBUG_PRINTF1(_L("Checking EStatusIdle") ); |
|
678 expectedMobileCallStatus = RMobileCall::EStatusIdle; |
|
679 call1.NotifyMobileCallStatusChange(notifyMobileCallStatusChangeStatus, mobileCallStatus); |
|
680 iCallControlTsyTestHelper.WaitForMobileCallNotifyMobileCallStatusChange(call1, |
|
681 notifyMobileCallStatusChangeStatus, |
|
682 mobileCallStatus, |
|
683 expectedMobileCallStatus, |
|
684 KErrNone); |
|
685 |
|
686 ASSERT_EQUALS(WaitForRequestWithTimeOut(dialStatus, ETimeMedium), KErrNone, |
|
687 _L("RMobileCall::Dial timed-out")); |
|
688 ASSERT_EQUALS(dialStatus.Int(), KErrGsmCCNormalUnspecified, |
|
689 _L("RMobileCall::Dial returned error") ); |
|
690 |
|
691 // Precaution when expected no connection |
|
692 call1.HangUp(); |
|
693 |
|
694 // Dial an international number. |
|
695 // Check this fails. |
|
696 DEBUG_PRINTF1(_L("All calls barred - Calling international")); |
|
697 call1.NotifyMobileCallStatusChange(notifyMobileCallStatusChangeStatus, mobileCallStatus); |
|
698 call1.Dial(dialStatus, intNumber); |
|
699 |
|
700 // Check RMobileLine::NotifyMobileLineStatusChange completes with with EStatusDialling -> |
|
701 DEBUG_PRINTF1(_L("Checking EStatusDialling") ); |
|
702 expectedMobileCallStatus = RMobileCall::EStatusDialling; |
|
703 iCallControlTsyTestHelper.WaitForMobileCallNotifyMobileCallStatusChange(call1, |
|
704 notifyMobileCallStatusChangeStatus, |
|
705 mobileCallStatus, |
|
706 expectedMobileCallStatus, |
|
707 KErrNone); |
|
708 |
|
709 // Check RMobileLine::NotifyMobileLineStatusChange completes with with EStatusConnecting -> |
|
710 DEBUG_PRINTF1(_L("Checking EStatusConnecting") ); |
|
711 expectedMobileCallStatus = RMobileCall::EStatusConnecting; |
|
712 call1.NotifyMobileCallStatusChange(notifyMobileCallStatusChangeStatus, mobileCallStatus); |
|
713 iCallControlTsyTestHelper.WaitForMobileCallNotifyMobileCallStatusChange(call1, |
|
714 notifyMobileCallStatusChangeStatus, |
|
715 mobileCallStatus, |
|
716 expectedMobileCallStatus, |
|
717 KErrNone); |
|
718 |
|
719 // Check RMobileLine::NotifyMobileLineStatusChange completes with with EStatusDisconnecting. |
|
720 DEBUG_PRINTF1(_L("Checking EStatusDisconnecting") ); |
|
721 expectedMobileCallStatus = RMobileCall::EStatusDisconnecting; |
|
722 call1.NotifyMobileCallStatusChange(notifyMobileCallStatusChangeStatus, mobileCallStatus); |
|
723 iCallControlTsyTestHelper.WaitForMobileCallNotifyMobileCallStatusChange(call1, |
|
724 notifyMobileCallStatusChangeStatus, |
|
725 mobileCallStatus, |
|
726 expectedMobileCallStatus, |
|
727 KErrNone); |
|
728 |
|
729 // Check RMobileLine::NotifyMobileLineStatusChange completes with with EStatusIdle. |
|
730 DEBUG_PRINTF1(_L("Checking EStatusIdle") ); |
|
731 expectedMobileCallStatus = RMobileCall::EStatusIdle; |
|
732 call1.NotifyMobileCallStatusChange(notifyMobileCallStatusChangeStatus, mobileCallStatus); |
|
733 iCallControlTsyTestHelper.WaitForMobileCallNotifyMobileCallStatusChange(call1, |
|
734 notifyMobileCallStatusChangeStatus, |
|
735 mobileCallStatus, |
|
736 expectedMobileCallStatus, |
|
737 KErrNone); |
|
738 |
|
739 ASSERT_EQUALS(WaitForRequestWithTimeOut(dialStatus, ETimeMedium), KErrNone, |
|
740 _L("RMobileCall::Dial timed-out")); |
|
741 ASSERT_EQUALS(dialStatus.Int(), KErrGsmCCNormalUnspecified, |
|
742 _L("RMobileCall::Dial returned error") ); |
|
743 |
|
744 // Precaution when expected no connection |
|
745 call1.HangUp(); |
|
746 |
|
747 // === Deactivate call barring on voice calls to all outgoing numbers and check national and |
|
748 // international numbers can be dialled === |
|
749 |
|
750 // Deactivate call barring using RMobilePhone::SetCallBarringStatus with |
|
751 // aInfo.iAction=EServiceActionDeactivate, |
|
752 // aInfo.iPassword=correct call barring password, |
|
753 // aInfo.iServiceGroup=EVoiceService and |
|
754 // aCondition=EBarAllOutgoing |
|
755 cbInfo.iAction = RMobilePhone::EServiceActionDeactivate; |
|
756 wantedCBCondition = RMobilePhone::EBarAllOutgoing; |
|
757 |
|
758 phone.NotifyCallBarringStatusChange( cbStatusNotify, notifiedCBCondition); |
|
759 |
|
760 err = SetCBStatusL( phone, cbInfo, wantedCBCondition); |
|
761 ASSERT_EQUALS( err, KErrNone, _L("RMobilePhone::SetCallBarringStatus returned error")); |
|
762 |
|
763 // Check RMobilePhone::NotifyCallBarringStatusChange completes with aCondition=EBarAllOutgoing |
|
764 iSupplementalTsyTestHelper.WaitForMobilePhoneNotifyCallBarringStatusChange(phone, |
|
765 cbStatusNotify, |
|
766 notifiedCBCondition, |
|
767 wantedCBCondition, |
|
768 KErrNone ); |
|
769 |
|
770 ASSERT_EQUALS( notifiedCBCondition, wantedCBCondition, |
|
771 _L("RMobilePhone::NotifyCallBarringStatusChange did not return matching condition") ); |
|
772 |
|
773 // Dial a national number that answers. |
|
774 DEBUG_PRINTF1(_L("No call barring - Calling national")); |
|
775 |
|
776 call1.NotifyMobileCallStatusChange(notifyMobileCallStatusChangeStatus, mobileCallStatus); |
|
777 call1.Dial(dialStatus, natNumber ); |
|
778 |
|
779 // Check RMobileCall::NotifyMobileCallStatusChange completes with EStatusConnected. |
|
780 iCallControlTsyTestHelper.WaitForMobileCallNotifyMobileCallStatusChange( call1, |
|
781 notifyMobileCallStatusChangeStatus, |
|
782 mobileCallStatus, |
|
783 RMobileCall::EStatusConnected, |
|
784 KErrNone ); |
|
785 // Hang up. |
|
786 // Check RMobileCall::NotifyMobileCallStatusChange completes with EStatusIdle. |
|
787 call1.NotifyMobileCallStatusChange(notifyMobileCallStatusChangeStatus, mobileCallStatus); |
|
788 call1.HangUp(); |
|
789 |
|
790 // Check RMobileCall::NotifyMobileCallStatusChange completes with EStatusIdle. |
|
791 iCallControlTsyTestHelper.WaitForMobileCallNotifyMobileCallStatusChange( call1, |
|
792 notifyMobileCallStatusChangeStatus, |
|
793 mobileCallStatus, |
|
794 RMobileCall::EStatusIdle, |
|
795 KErrNone ); |
|
796 |
|
797 ASSERT_EQUALS( mobileCallStatus, RMobileCall::EStatusIdle, _L("RMobileCall::NotifyMobileCallStatusChange did not complete with EStatusIdle") ); |
|
798 |
|
799 // Dial an international number that answers. |
|
800 DEBUG_PRINTF1(_L("No call barring - Calling international")); |
|
801 |
|
802 call1.NotifyMobileCallStatusChange(notifyMobileCallStatusChangeStatus, mobileCallStatus); |
|
803 call1.Dial(dialStatus, intNumber ); |
|
804 |
|
805 // Check RMobileCall::NotifyMobileCallStatusChange completes with EStatusConnected. |
|
806 iCallControlTsyTestHelper.WaitForMobileCallNotifyMobileCallStatusChange( call1, |
|
807 notifyMobileCallStatusChangeStatus, |
|
808 mobileCallStatus, |
|
809 RMobileCall::EStatusConnected, |
|
810 KErrNone ); |
|
811 |
|
812 // Hang up. |
|
813 // Check RMobileCall::NotifyMobileCallStatusChange completes with EStatusIdle. |
|
814 DEBUG_PRINTF1(_L("Hanging up")); |
|
815 call1.NotifyMobileCallStatusChange(notifyMobileCallStatusChangeStatus, mobileCallStatus); |
|
816 call1.HangUp(); |
|
817 |
|
818 // Check RMobileCall::NotifyMobileCallStatusChange completes with EStatusIdle. |
|
819 iCallControlTsyTestHelper.WaitForMobileCallNotifyMobileCallStatusChange( call1, |
|
820 notifyMobileCallStatusChangeStatus, |
|
821 mobileCallStatus, |
|
822 RMobileCall::EStatusIdle, |
|
823 KErrNone ); |
|
824 |
|
825 ASSERT_EQUALS( mobileCallStatus, RMobileCall::EStatusIdle, _L("Call status is not EStatusIdle") ); |
|
826 |
|
827 // |
|
828 // TEST END |
|
829 // |
|
830 |
|
831 StartCleanup(); |
|
832 // reqSetCBStatus |
|
833 // dialStatus |
|
834 // cbStatusNotify |
|
835 // reqSetSSPasswordStatus |
|
836 CleanupStack::PopAndDestroy(4, &reqSetSSPasswordStatus); |
|
837 |
|
838 return TestStepResult(); |
|
839 } |
|
840 |
|
841 TPtrC CCTSYIntegrationTestCallBarring0001::GetTestStepName() |
|
842 /** |
|
843 * @return The test step name. |
|
844 */ |
|
845 { |
|
846 return _L("CCTSYIntegrationTestCallBarring0001"); |
|
847 } |
|
848 |
|
849 |
|
850 |
|
851 CCTSYIntegrationTestCallBarring0002::CCTSYIntegrationTestCallBarring0002(CEtelSessionMgr& aEtelSessionMgr) |
|
852 : CCTSYIntegrationTestCallBarringBase(aEtelSessionMgr) |
|
853 /** |
|
854 * Constructor. |
|
855 */ |
|
856 { |
|
857 SetTestStepName(CCTSYIntegrationTestCallBarring0002::GetTestStepName()); |
|
858 } |
|
859 |
|
860 CCTSYIntegrationTestCallBarring0002::~CCTSYIntegrationTestCallBarring0002() |
|
861 /** |
|
862 * Destructor. |
|
863 */ |
|
864 { |
|
865 } |
|
866 |
|
867 TVerdict CCTSYIntegrationTestCallBarring0002::doTestStepL() |
|
868 /** |
|
869 * @SYMTestCaseID BA-CTSY-INT-CBAR-0002 |
|
870 * @SYMFssID BA/CTSY/CBAR-0002 |
|
871 * @SYMTestCaseDesc Activate and deactivate call barring for incoming voice calls. |
|
872 * @SYMTestPriority High |
|
873 * @SYMTestActions RCall::AnswerIncomingCall, RMobilePhone::NotifyCallBarringStatusChange, RMobilePhone::SetCallBarringStatus, RLine::NotifyIncomingCall, RCall::HangUp |
|
874 * @SYMTestExpectedResults Pass - Incoming call barring is activated. |
|
875 * @SYMTestType CIT |
|
876 * @SYMTestCaseDependencies live/manual |
|
877 * |
|
878 * Reason for test: Verify call barring status and barred incoming call are not received. |
|
879 * |
|
880 * @return - TVerdict code |
|
881 */ |
|
882 { |
|
883 |
|
884 // |
|
885 // SET UP |
|
886 // |
|
887 RMobilePhone &phone = iEtelSessionMgr.GetPhoneL(KMainServer, KMainPhone); |
|
888 |
|
889 //Check just to ensure the passwords are OK from the INI file |
|
890 RMobilePhone::TMobilePassword password; |
|
891 CheckCBPasswordL( phone, password ); |
|
892 |
|
893 // Ensure RMobilePhone::GetCallServiceCaps returns caps in set of: |
|
894 // KCapsNotifyCBStatus | KCapsSetCBStatus | KCapsBarAllIncoming |
|
895 TUint32 callServiceCaps; |
|
896 TInt err=phone.GetCallServiceCaps(callServiceCaps); |
|
897 CHECK_EQUALS_L(err, KErrNone, _L("RMobilePhone::GetCallServiceCaps returned error")); |
|
898 CHECK_BITS_SET_L(callServiceCaps, (RMobilePhone::KCapsNotifyCBStatus | |
|
899 RMobilePhone::KCapsSetCBStatus | |
|
900 RMobilePhone::KCapsBarAllIncoming), |
|
901 KNoUnwantedBits, |
|
902 _L("RMobilePhone::GetCallServiceCaps returned with incorrect bitmask")); |
|
903 |
|
904 // Set the call barring password to a known password using RMobilePhone::SetSSPassword |
|
905 RMobilePhone::TMobilePhonePasswordChangeV2 passwordV2; |
|
906 RMobilePhone::TMobilePhonePasswordChangeV2Pckg passwordPkg(passwordV2); |
|
907 passwordV2.iOldPassword = password; |
|
908 passwordV2.iNewPassword = password; |
|
909 passwordV2.iVerifiedPassword = password; |
|
910 |
|
911 TExtEtelRequestStatus setPasswordStatus(phone, EMobilePhoneSetSSPassword); |
|
912 CleanupStack::PushL(setPasswordStatus); |
|
913 phone.SetSSPassword(setPasswordStatus, passwordPkg, KSsCallBarringAllServices); |
|
914 CHECK_EQUALS_L( WaitForRequestWithTimeOut( setPasswordStatus, ETimeMedium), KErrNone, |
|
915 _L("RMobilePhone::SetSSPassword timed out") ); |
|
916 CHECK_EQUALS_L( setPasswordStatus.Int(), KErrNone, _L("RMobilePhone::SetSSPassword returned error")); |
|
917 |
|
918 // Get voice line 1. |
|
919 RMobileLine &mobileLine = iEtelSessionMgr.GetLineL(KMainServer, KMainPhone, KVoiceLine ); |
|
920 |
|
921 // Get call 1. |
|
922 RMobileCall &mobileCall1 = iEtelSessionMgr.GetCallL(KMainServer, KMainPhone, KVoiceLine, KCall1); |
|
923 |
|
924 // |
|
925 // SET UP END |
|
926 // |
|
927 |
|
928 StartTest(); |
|
929 |
|
930 // |
|
931 // TEST START |
|
932 // |
|
933 |
|
934 |
|
935 // === Activate call barring on incoming voice calls and check incoming call is not received === |
|
936 TExtEtelRequestStatus cbStatusNotify( phone, EMobilePhoneNotifyCallBarringStatusChange ); |
|
937 CleanupStack::PushL(cbStatusNotify); |
|
938 RMobilePhone::TMobilePhoneCBCondition notifiedCBCondition; |
|
939 phone.NotifyCallBarringStatusChange( cbStatusNotify, notifiedCBCondition); |
|
940 |
|
941 /* Activate call barring using RMobilePhone::SetCallBarringStatus with |
|
942 aInfo.iAction=EServiceActionActivate, |
|
943 aInfo.iPassword=correct call barring password, |
|
944 aInfo.iServiceGroup=EVoiceService and |
|
945 aCondition=EBarAllIncoming */ |
|
946 RMobilePhone::TMobilePhoneCBChangeV1 cbInfo; |
|
947 cbInfo.iAction = RMobilePhone::EServiceActionActivate; |
|
948 cbInfo.iPassword = password; |
|
949 cbInfo.iServiceGroup = RMobilePhone::EVoiceService; |
|
950 RMobilePhone::TMobilePhoneCBCondition wantedCBCondition = RMobilePhone::EBarAllIncoming; |
|
951 err = SetCBStatusL( phone, cbInfo, wantedCBCondition); |
|
952 ASSERT_EQUALS( err, KErrNone, _L("RMobilePhone::SetCallBarringStatus returned error")); |
|
953 |
|
954 // Check RMobilePhone::NotifyCallBarringStatusChange completes with aCondition=EBarAllIncoming |
|
955 iSupplementalTsyTestHelper.WaitForMobilePhoneNotifyCallBarringStatusChange(phone, |
|
956 cbStatusNotify, |
|
957 notifiedCBCondition, |
|
958 wantedCBCondition, |
|
959 KErrNone ); |
|
960 |
|
961 ASSERT_EQUALS( notifiedCBCondition, wantedCBCondition, |
|
962 _L("RMobilePhone::NotifyCallBarringStatusChange did not return matching condition") ); |
|
963 |
|
964 // Request incoming call from RPS. |
|
965 TCoreEtelRequestStatus<RLine> notifyIncomingCallStatus( mobileLine, &RLine::NotifyIncomingCallCancel ); |
|
966 CleanupStack::PushL( notifyIncomingCallStatus ); |
|
967 TName mobileCallName; |
|
968 mobileLine.NotifyIncomingCall( notifyIncomingCallStatus, mobileCallName); |
|
969 ASSERT_EQUALS(RPSRequestIncomingCallL(EVoiceLine), KErrNone, _L("RPSRequestIncomingCallL return code is not KErrNone")); |
|
970 |
|
971 // Check RPS dialling fails. |
|
972 ASSERT_EQUALS(WaitForRequestWithTimeOut(notifyIncomingCallStatus,ETimeMedium),KErrTimedOut, |
|
973 _L("RLine::NotifyIncomingCall did not time out")); |
|
974 |
|
975 // === Deactivate call barring on incoming voice calls and check incoming call is received === |
|
976 DEBUG_PRINTF1(_L("Deactivating call barring on incoming voice calls")); |
|
977 phone.NotifyCallBarringStatusChange( cbStatusNotify, notifiedCBCondition); |
|
978 |
|
979 cbInfo.iAction = RMobilePhone::EServiceActionDeactivate; |
|
980 wantedCBCondition = RMobilePhone::EBarAllIncoming; |
|
981 err = SetCBStatusL( phone, cbInfo, wantedCBCondition); |
|
982 ASSERT_EQUALS( err, KErrNone, _L("RMobilePhone::SetCallBarringStatus returned error")); |
|
983 |
|
984 // Check RMobilePhone::NotifyCallBarringStatusChange completes with aCondition=EBarAllIncoming |
|
985 iSupplementalTsyTestHelper.WaitForMobilePhoneNotifyCallBarringStatusChange(phone, |
|
986 cbStatusNotify, |
|
987 notifiedCBCondition, |
|
988 wantedCBCondition, |
|
989 KErrNone ); |
|
990 |
|
991 ASSERT_EQUALS( notifiedCBCondition, wantedCBCondition, |
|
992 _L("RMobilePhone::NotifyCallBarringStatusChange did not return matching condition") ); |
|
993 |
|
994 // Request an incoming call from RPS. |
|
995 mobileLine.NotifyIncomingCall( notifyIncomingCallStatus, mobileCallName ); |
|
996 |
|
997 TExtEtelRequestStatus notifyMobileCallStatusChangeStatus(mobileCall1, EMobileCallNotifyMobileCallStatusChange); |
|
998 CleanupStack::PushL(notifyMobileCallStatusChangeStatus); |
|
999 RMobileCall::TMobileCallStatus mobileCallStatus; |
|
1000 |
|
1001 ASSERT_EQUALS(RPSRequestIncomingCallL(EVoiceLine), KErrNone, _L("RPSRequestIncomingCallL return code is not KErrNone")); |
|
1002 |
|
1003 // Check RLine::NotifyIncomingCall completes. |
|
1004 DEBUG_PRINTF1(_L("Waiting for incoming call notification.")); |
|
1005 TName expectedMobileName = _L("Voice11"); |
|
1006 iCallControlTsyTestHelper.WaitForLineNotifyIncomingCall(mobileLine, |
|
1007 notifyIncomingCallStatus, |
|
1008 mobileCallName, |
|
1009 expectedMobileName, |
|
1010 KErrNone); |
|
1011 |
|
1012 // Answer the incoming call |
|
1013 DEBUG_PRINTF1(_L("About to answer the incoming call.")); |
|
1014 TCallId incomingCallId; |
|
1015 RMobileCall& incomingMobileCall = iEtelSessionMgr.GetIncomingCallL(KMainServer, KMainPhone, KVoiceLine, mobileCallName, incomingCallId); |
|
1016 |
|
1017 TCoreEtelRequestStatus<RCall> incomingCallStatus( incomingMobileCall, &RCall::AnswerIncomingCallCancel ); |
|
1018 CleanupStack::PushL( incomingCallStatus ); |
|
1019 incomingMobileCall.AnswerIncomingCall( incomingCallStatus ); |
|
1020 ASSERT_EQUALS(WaitForRequestWithTimeOut(incomingCallStatus, ETimeMedium), KErrNone, |
|
1021 _L("RMobileCall::AnswerIncomingCall timed-out")); |
|
1022 ASSERT_EQUALS(incomingCallStatus.Int(), KErrNone, |
|
1023 _L("RMobileCall::AnswerIncomingCall returned an error") ); |
|
1024 |
|
1025 // Hang up. |
|
1026 DEBUG_PRINTF1(_L("Hanging up call.")); |
|
1027 incomingMobileCall.NotifyMobileCallStatusChange( notifyMobileCallStatusChangeStatus, mobileCallStatus ); |
|
1028 incomingMobileCall.HangUp(); |
|
1029 |
|
1030 // Check RMobileCall::NotifyMobileCallStatusChange completes with EStatusIdle. |
|
1031 iCallControlTsyTestHelper.WaitForMobileCallNotifyMobileCallStatusChange( incomingMobileCall, |
|
1032 notifyMobileCallStatusChangeStatus, |
|
1033 mobileCallStatus, |
|
1034 RMobileCall::EStatusIdle, |
|
1035 KErrNone ); |
|
1036 |
|
1037 ASSERT_EQUALS( mobileCallStatus, RMobileCall::EStatusIdle, _L("Call status is not EStatusIdle") ); |
|
1038 |
|
1039 // |
|
1040 // TEST END |
|
1041 // |
|
1042 |
|
1043 StartCleanup(); |
|
1044 |
|
1045 /* setPasswordStatus |
|
1046 * cbStatusNotify |
|
1047 * notifyIncomingCallStatus |
|
1048 * notifyMobileCallStatusChangeStatus |
|
1049 * incomingCallStatus*/ |
|
1050 CleanupStack::PopAndDestroy(5, &setPasswordStatus); |
|
1051 |
|
1052 return TestStepResult(); |
|
1053 } |
|
1054 |
|
1055 TPtrC CCTSYIntegrationTestCallBarring0002::GetTestStepName() |
|
1056 /** |
|
1057 * @return The test step name. |
|
1058 */ |
|
1059 { |
|
1060 return _L("CCTSYIntegrationTestCallBarring0002"); |
|
1061 } |
|
1062 |
|
1063 |
|
1064 |
|
1065 CCTSYIntegrationTestCallBarring0003::CCTSYIntegrationTestCallBarring0003(CEtelSessionMgr& aEtelSessionMgr) |
|
1066 : CCTSYIntegrationTestCallBarringBase(aEtelSessionMgr) |
|
1067 /** |
|
1068 * Constructor. |
|
1069 */ |
|
1070 { |
|
1071 SetTestStepName(CCTSYIntegrationTestCallBarring0003::GetTestStepName()); |
|
1072 } |
|
1073 |
|
1074 CCTSYIntegrationTestCallBarring0003::~CCTSYIntegrationTestCallBarring0003() |
|
1075 /** |
|
1076 * Destructor. |
|
1077 */ |
|
1078 { |
|
1079 } |
|
1080 |
|
1081 TVerdict CCTSYIntegrationTestCallBarring0003::doTestStepL() |
|
1082 /** |
|
1083 * @SYMTestCaseID BA-CTSY-INT-CBAR-0003 |
|
1084 * @SYMFssID BA/CTSY/CBAR-0003 |
|
1085 * @SYMTestCaseDesc Activate and deactivate, and register and erase call barring for incoming voice calls when roaming. |
|
1086 * @SYMTestPriority High |
|
1087 * @SYMTestActions RCall::AnswerIncomingCall, RMobilePhone::NotifyCallBarringStatusChange, RMobilePhone::SetCallBarringStatus, RLine::NotifyIncomingCall, RCall::HangUp |
|
1088 * @SYMTestExpectedResults Pass - Incoming call barring whilst roaming is activated. |
|
1089 * @SYMTestType CIT |
|
1090 * @SYMTestCaseDependencies live/manual |
|
1091 * |
|
1092 * Reason for test: Verify call barring status and barred numbers cannot be dialled. |
|
1093 * |
|
1094 * @return - TVerdict code |
|
1095 */ |
|
1096 { |
|
1097 |
|
1098 // |
|
1099 // SET UP |
|
1100 // |
|
1101 |
|
1102 RMobilePhone& phone = iEtelSessionMgr.GetPhoneL(KMainServer, KMainPhone); |
|
1103 RMobilePhone::TMobilePassword password; |
|
1104 CheckCBPasswordL(phone, password); |
|
1105 |
|
1106 // Ensure RMobilePhone::GetCallServiceCaps returns caps in set of: |
|
1107 // KCapsNotifyCBStatus | KCapsSetCBStatus | KCapsBarIncomingRoaming |
|
1108 TUint32 callServiceCaps; |
|
1109 TUint32 expectedCallServiceCaps = RMobilePhone::KCapsNotifyCBStatus | RMobilePhone::KCapsSetCBStatus | RMobilePhone::KCapsBarIncomingRoaming; |
|
1110 CHECK_EQUALS_L(phone.GetCallServiceCaps(callServiceCaps), KErrNone, _L("RMobilePhone::GetCallServiceCaps returned error")); |
|
1111 CHECK_BITS_SET_L(callServiceCaps, expectedCallServiceCaps, KNoUnwantedBits, _L("RMobilePhone::GetCallServiceCaps returned wrong caps")); |
|
1112 |
|
1113 // Set the call barring password to a known password using RMobilePhone::SetSSPassword |
|
1114 RMobilePhone::TMobilePhonePasswordChangeV2 passwordV2; |
|
1115 RMobilePhone::TMobilePhonePasswordChangeV2Pckg passwordPkg(passwordV2); |
|
1116 |
|
1117 // For safety we are going to change the password and then immediately change it back |
|
1118 passwordV2.iOldPassword = password; |
|
1119 passwordV2.iNewPassword = KAltPassword; |
|
1120 passwordV2.iVerifiedPassword = KAltPassword; |
|
1121 |
|
1122 TExtEtelRequestStatus reqSetSSPasswordStatus(phone, EMobilePhoneSetSSPassword); |
|
1123 CleanupStack::PushL(reqSetSSPasswordStatus); |
|
1124 |
|
1125 phone.SetSSPassword(reqSetSSPasswordStatus, passwordPkg, KSsCallBarringAllServices); |
|
1126 CHECK_EQUALS_L( WaitForRequestWithTimeOut(reqSetSSPasswordStatus, ETimeMedium), KErrNone, _L("RMobilePhone::SetSSPassword timed out")); |
|
1127 CHECK_EQUALS_L( reqSetSSPasswordStatus.Int(), KErrNone, _L("RMobilePhone::SetSSPassword returned error")); |
|
1128 |
|
1129 // Succeeded in changing the password, reset |
|
1130 passwordV2.iOldPassword = KAltPassword; |
|
1131 passwordV2.iNewPassword = password; |
|
1132 passwordV2.iVerifiedPassword = password; |
|
1133 |
|
1134 phone.SetSSPassword(reqSetSSPasswordStatus, passwordPkg, KSsCallBarringAllServices); |
|
1135 CHECK_EQUALS_L(WaitForRequestWithTimeOut(reqSetSSPasswordStatus, ETimeMedium), KErrNone, _L("RMobilePhone::SetSSPassword timed out")); |
|
1136 CHECK_EQUALS_L(reqSetSSPasswordStatus.Int(), KErrNone, _L("RMobilePhone::SetSSPassword returned error")); |
|
1137 |
|
1138 // Get voice line 1. |
|
1139 RMobileLine& voiceLine = iEtelSessionMgr.GetLineL(KMainServer, KMainPhone, KVoiceLine); |
|
1140 |
|
1141 // Get call 1. |
|
1142 RMobileCall& call1 = iEtelSessionMgr.GetCallL(KMainServer, KMainPhone, KVoiceLine, KCall1); |
|
1143 RMobileCall& call2 = iEtelSessionMgr.GetCallL(KMainServer, KMainPhone, KVoiceLine, KCall2); |
|
1144 |
|
1145 // |
|
1146 // SET UP END |
|
1147 // |
|
1148 |
|
1149 StartTest(); |
|
1150 |
|
1151 // |
|
1152 // TEST START |
|
1153 // |
|
1154 |
|
1155 // Insert roaming SIM. |
|
1156 |
|
1157 // === Activate call barring on incoming voice calls and check incoming call is not received === |
|
1158 RMobilePhone::TMobilePhoneCBChangeV1 cbInfo; |
|
1159 RMobilePhone::TMobilePhoneCBCondition cbCondition; |
|
1160 |
|
1161 // Post RMobilePhone::NotifyCallBarringStatusChange |
|
1162 TExtEtelRequestStatus cbStatusNotify(phone, EMobilePhoneNotifyCallBarringStatusChange); |
|
1163 CleanupStack::PushL(cbStatusNotify); |
|
1164 RMobilePhone::TMobilePhoneCBCondition notifiedCBCondition; |
|
1165 phone.NotifyCallBarringStatusChange(cbStatusNotify, notifiedCBCondition); |
|
1166 |
|
1167 // Activate call barring using RMobilePhone::SetCallBarringStatus with |
|
1168 // aInfo.iAction=EServiceActionActivate, |
|
1169 // aInfo.iPassword=correct call barring password, |
|
1170 // aInfo.iServiceGroup=EVoiceService and |
|
1171 // aCondition=EBarIncomingRoaming |
|
1172 cbInfo.iAction = RMobilePhone::EServiceActionActivate; |
|
1173 cbInfo.iPassword = password; |
|
1174 cbInfo.iServiceGroup = RMobilePhone::EVoiceService; |
|
1175 cbCondition = RMobilePhone::EBarIncomingRoaming; |
|
1176 TInt err = SetCBStatusL(phone, cbInfo, cbCondition); |
|
1177 ASSERT_EQUALS(err, KErrNone, _L("RMobilePhone::SetCallBarringStatus returned error")); |
|
1178 |
|
1179 // Check RMobilePhone::NotifyCallBarringStatusChange completes with aCondition=EBarIncomingRoaming |
|
1180 RMobilePhone::TMobilePhoneCBCondition wantedCBCondition = RMobilePhone::EBarIncomingRoaming; |
|
1181 iSupplementalTsyTestHelper.WaitForMobilePhoneNotifyCallBarringStatusChange(phone, |
|
1182 cbStatusNotify, |
|
1183 notifiedCBCondition, |
|
1184 wantedCBCondition, |
|
1185 KErrNone); |
|
1186 |
|
1187 // Request incoming call from RPS. |
|
1188 TInt errorRPS = RPSRequestIncomingCallL(EVoiceLine); |
|
1189 |
|
1190 // Check RPS dialling fails. |
|
1191 ASSERT_TRUE(errorRPS != KErrNone, _L("RPSRequestIncomingCallL() returned KErrNone even though call barring was set")); |
|
1192 |
|
1193 // === Deactivate call barring on incoming voice calls and check incoming call is received === |
|
1194 |
|
1195 // Deactivate call barring using RMobilePhone::SetCallBarringStatus with |
|
1196 // aInfo.iAction=EServiceActionDeactivate, |
|
1197 // aInfo.iPassword=correct call barring password, |
|
1198 // aInfo.iServiceGroup=EVoiceService and |
|
1199 // aCondition=EBarIncomingRoaming |
|
1200 cbInfo.iAction = RMobilePhone::EServiceActionDeactivate; |
|
1201 cbInfo.iPassword = password; |
|
1202 cbInfo.iServiceGroup = RMobilePhone::EVoiceService; |
|
1203 cbCondition = RMobilePhone::EBarIncomingRoaming; |
|
1204 |
|
1205 // Post RMobilephone::NotifyCallBarringStatusChange |
|
1206 phone.NotifyCallBarringStatusChange(cbStatusNotify, notifiedCBCondition); |
|
1207 |
|
1208 err = SetCBStatusL(phone, cbInfo, cbCondition); |
|
1209 ASSERT_EQUALS(err, KErrNone, _L("RMobilePhone::SetCallBarringStatus returned error")); |
|
1210 |
|
1211 // Check RMobilePhone::NotifyCallBarringStatusChange completes with aCondition=EBarIncomingRoaming |
|
1212 wantedCBCondition = RMobilePhone::EBarIncomingRoaming; |
|
1213 iSupplementalTsyTestHelper.WaitForMobilePhoneNotifyCallBarringStatusChange(phone, |
|
1214 cbStatusNotify, |
|
1215 notifiedCBCondition, |
|
1216 wantedCBCondition, |
|
1217 KErrNone); |
|
1218 |
|
1219 // post notification RLine::NotifyIncomingCall |
|
1220 TCoreEtelRequestStatus<RLine> notifyIncomingCallStatus(voiceLine, &RLine::NotifyIncomingCallCancel); |
|
1221 CleanupStack::PushL(notifyIncomingCallStatus); |
|
1222 TName incomingCallName; |
|
1223 incomingCallName.Zero(); |
|
1224 voiceLine.NotifyIncomingCall(notifyIncomingCallStatus, incomingCallName); |
|
1225 |
|
1226 // Request an incoming call from RPS. |
|
1227 ASSERT_EQUALS(RPSRequestIncomingCallL(EVoiceLine), KErrNone, |
|
1228 _L("CCTSYIntegrationTestSuiteStepBase::RPSRequestIncomingCallL returned an error")); |
|
1229 |
|
1230 // Check RLine::NotifyIncomingCall completes. |
|
1231 ASSERT_EQUALS(WaitForRequestWithTimeOut(notifyIncomingCallStatus, ETimeMedium), |
|
1232 KErrNone, _L("RLine::NotifyIncomingCall did not complete without error")); |
|
1233 ASSERT_EQUALS(notifyIncomingCallStatus.Int(), KErrNone, _L( "RLine::NotifyIncomingCall returned with an error")); |
|
1234 ASSERT_TRUE(incomingCallName.Length() > 0, _L("RLine::NotifyIncomingCall completed with invalid call name")); |
|
1235 |
|
1236 // Get the incoming call |
|
1237 TCallId incomingCallId; |
|
1238 call1 = iEtelSessionMgr.GetIncomingCallL(KMainServer, KMainPhone, KVoiceLine, incomingCallName, incomingCallId); |
|
1239 |
|
1240 // post notifier for RMobileCall::NotifyMobileCallStatusChange |
|
1241 TExtEtelRequestStatus notifyMobileCallChangeStatus(call1, EMobileCallNotifyMobileCallStatusChange); |
|
1242 CleanupStack::PushL(notifyMobileCallChangeStatus); |
|
1243 RMobileCall::TMobileCallStatus mobileCallStatus; |
|
1244 call1.NotifyMobileCallStatusChange(notifyMobileCallChangeStatus, mobileCallStatus); |
|
1245 |
|
1246 // Answer the incoming call with RCall::AnswerIncomingCall |
|
1247 TCoreEtelRequestStatus<RCall> answerIncomingStatus(call1, &RCall::AnswerIncomingCallCancel); |
|
1248 CleanupStack::PushL(answerIncomingStatus); |
|
1249 call1.AnswerIncomingCall(answerIncomingStatus); |
|
1250 ASSERT_EQUALS(WaitForRequestWithTimeOut(answerIncomingStatus, ETimeMedium), KErrNone, _L("RMobileCall::AnswerIncomingCall timed-out")); |
|
1251 ASSERT_EQUALS(answerIncomingStatus.Int(), KErrNone, _L("RMobileCall::AnswerIncomingCall returned with an error")); |
|
1252 |
|
1253 // RMobileCall::NotifyMobileCallStatusChange completes with EStatusConnected. |
|
1254 RMobileCall::TMobileCallStatus expectedMobileCallStatus = RMobileCall::EStatusConnected; |
|
1255 TInt expectedStatus = KErrNone; |
|
1256 iCallControlTsyTestHelper.WaitForMobileCallNotifyMobileCallStatusChange(call1, |
|
1257 notifyMobileCallChangeStatus, |
|
1258 mobileCallStatus, |
|
1259 expectedMobileCallStatus, |
|
1260 expectedStatus); |
|
1261 |
|
1262 call1.NotifyMobileCallStatusChange(notifyMobileCallChangeStatus, mobileCallStatus); |
|
1263 |
|
1264 // Hang up. |
|
1265 TCoreEtelRequestStatus<RCall> hangUpStatus (call1, &RCall::HangUpCancel); |
|
1266 CleanupStack::PushL(hangUpStatus); |
|
1267 call1.HangUp(hangUpStatus); |
|
1268 ASSERT_EQUALS(WaitForRequestWithTimeOut(hangUpStatus, ETimeMedium), KErrNone, _L("RCall::HangUp timed-out")); |
|
1269 ASSERT_EQUALS(hangUpStatus.Int(), KErrNone, _L("RCall::CallHangUp returned an error")); |
|
1270 |
|
1271 // Check RMobileCall::NotifyMobileCallStatusChange completes with EStatusIdle. |
|
1272 expectedMobileCallStatus = RMobileCall::EStatusIdle; |
|
1273 iCallControlTsyTestHelper.WaitForMobileCallNotifyMobileCallStatusChange(call1, |
|
1274 notifyMobileCallChangeStatus, |
|
1275 mobileCallStatus, |
|
1276 expectedMobileCallStatus, |
|
1277 expectedStatus); |
|
1278 |
|
1279 phone.NotifyCallBarringStatusChange(cbStatusNotify, notifiedCBCondition); |
|
1280 |
|
1281 // === Register call barring on incoming voice calls and check incoming call is not received === |
|
1282 |
|
1283 // Register call barring using RMobilePhone::SetCallBarringStatus with |
|
1284 // aInfo.iAction=EServiceActionRegister, |
|
1285 // aInfo.iPassword=correct call barring password, |
|
1286 // aInfo.iServiceGroup=EVoiceService and |
|
1287 // aCondition=EBarAllIncoming |
|
1288 // $CTSYKnownFailure Adaptation returns -4419(KErrGsmSSDataMissing). Also notify fails due that. |
|
1289 // Works with EServiceActionRegister->EServiceActionActivate in needed places |
|
1290 cbInfo.iAction = RMobilePhone::EServiceActionRegister; |
|
1291 cbInfo.iPassword = password; |
|
1292 cbInfo.iServiceGroup = RMobilePhone::EVoiceService; |
|
1293 cbCondition = RMobilePhone::EBarAllIncoming; |
|
1294 err = SetCBStatusL(phone, cbInfo, cbCondition); |
|
1295 ASSERT_EQUALS(err, KErrNone, _L("RMobilePhone::SetCallBarringStatus returned error")); |
|
1296 |
|
1297 // Check RMobilePhone::NotifyCallBarringStatusChange completes with aCondition=EBarIncomingRoaming |
|
1298 wantedCBCondition = RMobilePhone::EBarIncomingRoaming; |
|
1299 iSupplementalTsyTestHelper.WaitForMobilePhoneNotifyCallBarringStatusChange(phone, |
|
1300 cbStatusNotify, |
|
1301 notifiedCBCondition, |
|
1302 wantedCBCondition, |
|
1303 KErrNone); |
|
1304 ASSERT_EQUALS(notifiedCBCondition, wantedCBCondition, |
|
1305 _L("RMobilePhone::NotifyCallBarringStatusChange did not return matching condition")); |
|
1306 |
|
1307 // Request incoming call from RPS. |
|
1308 errorRPS = RPSRequestIncomingCallL(EVoiceLine); |
|
1309 |
|
1310 // Check RPS dialling fails. |
|
1311 ASSERT_TRUE(errorRPS != KErrNone, _L("RPSRequestIncomingCallL() returned KErrNone even though call barring was set")); |
|
1312 |
|
1313 // === Erase call barring on incoming voice calls and check incoming call is received === |
|
1314 |
|
1315 // Erase call barring using RMobilePhone::SetCallBarringStatus with |
|
1316 // aInfo.iAction=EServiceActionErase, |
|
1317 // aInfo.iPassword=correct call barring password, |
|
1318 // aInfo.iServiceGroup=EVoiceService and |
|
1319 // aCondition=EBarAllIncoming |
|
1320 // $CTSYKnownFailure Adaptation returns -4400(KErrGsmSSIllegalOperation) and due that notification times out. |
|
1321 // Note. Test works with EServiceActionErase->EServiceActionDeactivate in needed places |
|
1322 cbInfo.iAction = RMobilePhone::EServiceActionErase; |
|
1323 cbInfo.iPassword = password; |
|
1324 cbInfo.iServiceGroup = RMobilePhone::EVoiceService; |
|
1325 cbCondition = RMobilePhone::EBarAllIncoming; |
|
1326 |
|
1327 // post notifier |
|
1328 phone.NotifyCallBarringStatusChange(cbStatusNotify, notifiedCBCondition); |
|
1329 |
|
1330 err = SetCBStatusL(phone, cbInfo, cbCondition); |
|
1331 ASSERT_EQUALS(err, KErrNone, _L("RMobilePhone::SetCallBarringStatus returned error")); |
|
1332 |
|
1333 // Check RMobilePhone::NotifyCallBarringStatusChange completes with aCondition=EBarIncomingRoaming |
|
1334 wantedCBCondition = RMobilePhone::EBarIncomingRoaming; |
|
1335 iSupplementalTsyTestHelper.WaitForMobilePhoneNotifyCallBarringStatusChange(phone, |
|
1336 cbStatusNotify, |
|
1337 notifiedCBCondition, |
|
1338 wantedCBCondition, |
|
1339 KErrNone); |
|
1340 // Post notify for second incoming call |
|
1341 TCoreEtelRequestStatus<RLine> notifyIncomingCallStatus2(voiceLine, &RLine::NotifyIncomingCallCancel); |
|
1342 CleanupStack::PushL(notifyIncomingCallStatus2); |
|
1343 TName incomingCallName2; |
|
1344 incomingCallName2.Zero(); |
|
1345 voiceLine.NotifyIncomingCall(notifyIncomingCallStatus2, incomingCallName2); |
|
1346 |
|
1347 // Request an incoming call from RPS. |
|
1348 ASSERT_EQUALS(RPSRequestIncomingCallL(EVoiceLine), KErrNone, _L("CCTSYIntegrationTestSuiteStepBase::RPSRequestIncomingCallL returned an error")); |
|
1349 |
|
1350 // Check RLine::NotifyIncomingCall completes. |
|
1351 ASSERT_EQUALS(WaitForRequestWithTimeOut(notifyIncomingCallStatus2, ETimeMedium), |
|
1352 KErrNone, _L("RLine::NotifyIncomingCall did not complete without error")); |
|
1353 ASSERT_EQUALS(notifyIncomingCallStatus2.Int(), KErrNone, _L( "RLine::NotifyIncomingCall returned with an error")); |
|
1354 ASSERT_TRUE(incomingCallName2.Length() > 0, _L("RLine::NotifyIncomingCall completed with invalid call name")); |
|
1355 |
|
1356 // Get the incoming call |
|
1357 TCallId incomingCallId2; |
|
1358 call2 = iEtelSessionMgr.GetIncomingCallL(KMainServer, KMainPhone, KVoiceLine, incomingCallName2, incomingCallId2); |
|
1359 |
|
1360 // Post nofity RMobileCall::NotifyMobileCallStatusChange for call 2 |
|
1361 call2.NotifyMobileCallStatusChange(notifyMobileCallChangeStatus, mobileCallStatus); |
|
1362 |
|
1363 // Answer the incoming call with RCall::AnswerIncomingCall |
|
1364 TCoreEtelRequestStatus<RCall> answerIncomingStatus2(call2, &RCall::AnswerIncomingCallCancel); |
|
1365 CleanupStack::PushL(answerIncomingStatus2); |
|
1366 call2.AnswerIncomingCall(answerIncomingStatus2); |
|
1367 ASSERT_EQUALS(WaitForRequestWithTimeOut(answerIncomingStatus2, ETimeMedium), KErrNone, _L("RMobileCall::AnswerIncomingCall timed-out")); |
|
1368 ASSERT_EQUALS(answerIncomingStatus2.Int(), KErrNone, _L("RMobileCall::AnswerIncomingCall returned with an error")); |
|
1369 |
|
1370 // RMobileCall::NotifyMobileCallStatusChange completes with EStatusConnected. |
|
1371 expectedMobileCallStatus = RMobileCall::EStatusConnected; |
|
1372 expectedStatus = KErrNone; |
|
1373 iCallControlTsyTestHelper.WaitForMobileCallNotifyMobileCallStatusChange(call2, |
|
1374 notifyMobileCallChangeStatus, |
|
1375 mobileCallStatus, |
|
1376 expectedMobileCallStatus, |
|
1377 expectedStatus); |
|
1378 |
|
1379 // Post nofity RMobileCall::NotifyMobileCallStatusChange for call 2 |
|
1380 call2.NotifyMobileCallStatusChange(notifyMobileCallChangeStatus, mobileCallStatus); |
|
1381 |
|
1382 // Hang up. |
|
1383 TCoreEtelRequestStatus<RCall> hangUpStatus2 (call2, &RCall::HangUpCancel); |
|
1384 CleanupStack::PushL(hangUpStatus2); |
|
1385 call2.HangUp(hangUpStatus2); |
|
1386 ASSERT_EQUALS(WaitForRequestWithTimeOut(hangUpStatus2, ETimeMedium), KErrNone, _L("RCall::HangUp timed-out")); |
|
1387 ASSERT_EQUALS(hangUpStatus.Int(), KErrNone, _L("RCall::CallHangUp returned an error")); |
|
1388 |
|
1389 // Check RMobileCall::NotifyMobileCallStatusChange completes with EStatusIdle. |
|
1390 expectedMobileCallStatus = RMobileCall::EStatusIdle; |
|
1391 iCallControlTsyTestHelper.WaitForMobileCallNotifyMobileCallStatusChange(call2, |
|
1392 notifyMobileCallChangeStatus, |
|
1393 mobileCallStatus, |
|
1394 expectedMobileCallStatus, |
|
1395 expectedStatus); |
|
1396 |
|
1397 // |
|
1398 // TEST END |
|
1399 // |
|
1400 |
|
1401 StartCleanup(); |
|
1402 |
|
1403 DeactivateCallBarringL(phone, password); |
|
1404 |
|
1405 // Pop |
|
1406 // reqSetSSPasswordStatus |
|
1407 // cbStatusNotify |
|
1408 // notifyIncomingCallStatus |
|
1409 // notifyMobileCallChangeStatus |
|
1410 // answerIncomingStatus |
|
1411 // hangUpStatus |
|
1412 // notifyIncomingCallStatus2 |
|
1413 // answerIncomingStatus2 |
|
1414 // hangUpStatus2 |
|
1415 CleanupStack::PopAndDestroy(9, &reqSetSSPasswordStatus); |
|
1416 |
|
1417 return TestStepResult(); |
|
1418 } |
|
1419 |
|
1420 TPtrC CCTSYIntegrationTestCallBarring0003::GetTestStepName() |
|
1421 /** |
|
1422 * @return The test step name. |
|
1423 */ |
|
1424 { |
|
1425 return _L("CCTSYIntegrationTestCallBarring0003"); |
|
1426 } |
|
1427 |
|
1428 |
|
1429 |
|
1430 CCTSYIntegrationTestCallBarring0004::CCTSYIntegrationTestCallBarring0004(CEtelSessionMgr& aEtelSessionMgr) |
|
1431 : CCTSYIntegrationTestCallBarringBase(aEtelSessionMgr) |
|
1432 /** |
|
1433 * Constructor. |
|
1434 */ |
|
1435 { |
|
1436 SetTestStepName(CCTSYIntegrationTestCallBarring0004::GetTestStepName()); |
|
1437 } |
|
1438 |
|
1439 CCTSYIntegrationTestCallBarring0004::~CCTSYIntegrationTestCallBarring0004() |
|
1440 /** |
|
1441 * Destructor. |
|
1442 */ |
|
1443 { |
|
1444 } |
|
1445 |
|
1446 TVerdict CCTSYIntegrationTestCallBarring0004::doTestStepL() |
|
1447 /** |
|
1448 * @SYMTestCaseID BA-CTSY-INT-CBAR-0004 |
|
1449 * @SYMFssID BA/CTSY/CBAR-0004 |
|
1450 * @SYMTestCaseDesc Activate and deactivate call barring on voice calls with incorrect password. |
|
1451 * @SYMTestPriority High |
|
1452 * @SYMTestActions RCall::Dial |
|
1453 * @SYMTestExpectedResults Pass - Call barring not be activated with wrong password. |
|
1454 * @SYMTestType CIT |
|
1455 * @SYMTestCaseDependencies live/automatic |
|
1456 * |
|
1457 * Reason for test: Verify error is returned on attempt to activate call barring. |
|
1458 * |
|
1459 * @return - TVerdict code |
|
1460 */ |
|
1461 { |
|
1462 |
|
1463 // |
|
1464 // SET UP |
|
1465 // |
|
1466 |
|
1467 RMobilePhone& phone = iEtelSessionMgr.GetPhoneL(KMainServer, KMainPhone); |
|
1468 |
|
1469 // Check call barring password |
|
1470 RMobilePhone::TMobilePassword password; |
|
1471 CheckCBPasswordL(phone, password); |
|
1472 |
|
1473 // Ensure RMobilePhone::GetCallServiceCaps returns caps in set of: KCapsNotifyCBStatus | KCapsSetCBStatus | KCapsBarAllOutgoing |
|
1474 TUint32 callServiceCaps; |
|
1475 TUint32 expectedCallServiceCaps = RMobilePhone::KCapsNotifyCBStatus | |
|
1476 RMobilePhone::KCapsSetCBStatus | |
|
1477 RMobilePhone::KCapsBarAllOutgoing; |
|
1478 CHECK_EQUALS_L(phone.GetCallServiceCaps(callServiceCaps), KErrNone, _L("RMobilePhone::GetCallServiceCaps returned error")); |
|
1479 CHECK_BITS_SET_L(callServiceCaps, expectedCallServiceCaps, KNoUnwantedBits, _L("RMobilePhone::GetCallServiceCaps returned wrong caps")); |
|
1480 |
|
1481 // Set the call barring password to a known password using RMobilePhone::SetSSPassword |
|
1482 RMobilePhone::TMobilePhonePasswordChangeV2 passwordV2; |
|
1483 RMobilePhone::TMobilePhonePasswordChangeV2Pckg passwordPkg(passwordV2); |
|
1484 |
|
1485 // For safety we are going to change the password and then immediately change it back |
|
1486 passwordV2.iOldPassword = password; |
|
1487 passwordV2.iNewPassword = KAltPassword; |
|
1488 passwordV2.iVerifiedPassword = KAltPassword; |
|
1489 |
|
1490 TExtEtelRequestStatus reqSetSSPasswordStatus(phone, EMobilePhoneSetSSPassword); |
|
1491 CleanupStack::PushL(reqSetSSPasswordStatus); |
|
1492 |
|
1493 phone.SetSSPassword(reqSetSSPasswordStatus, passwordPkg, KSsCallBarringAllServices); |
|
1494 CHECK_EQUALS_L(WaitForRequestWithTimeOut(reqSetSSPasswordStatus, ETimeMedium), KErrNone, _L("RMobilePhone::SetSSPassword timed out")); |
|
1495 CHECK_EQUALS_L(reqSetSSPasswordStatus.Int(), KErrNone, _L("RMobilePhone::SetSSPassword returned error")); |
|
1496 |
|
1497 // Succeeded in changing the password, reset |
|
1498 passwordV2.iOldPassword = KAltPassword; |
|
1499 passwordV2.iNewPassword = password; |
|
1500 passwordV2.iVerifiedPassword = password; |
|
1501 |
|
1502 phone.SetSSPassword(reqSetSSPasswordStatus, passwordPkg, KSsCallBarringAllServices); |
|
1503 CHECK_EQUALS_L(WaitForRequestWithTimeOut(reqSetSSPasswordStatus, ETimeMedium), KErrNone, _L("RMobilePhone::SetSSPassword timed out")); |
|
1504 CHECK_EQUALS_L(reqSetSSPasswordStatus.Int(), KErrNone, _L("RMobilePhone::SetSSPassword returned error")); |
|
1505 |
|
1506 // Get Voice line 1. |
|
1507 RMobileLine& voiceLine = iEtelSessionMgr.GetLineL(KMainServer, KMainPhone, KVoiceLine); |
|
1508 |
|
1509 // Get call 1. |
|
1510 RMobileCall& call1 = iEtelSessionMgr.GetCallL(KMainServer,KMainPhone, KVoiceLine, KCall1); |
|
1511 |
|
1512 // |
|
1513 // SET UP END |
|
1514 // |
|
1515 |
|
1516 StartTest(); |
|
1517 |
|
1518 // |
|
1519 // TEST START |
|
1520 // |
|
1521 |
|
1522 // === Activate call barring with incorrect password === |
|
1523 |
|
1524 // Activate call barring using RMobilePhone::SetCallBarringStatus with |
|
1525 // aInfo.iAction=EServiceActionActivate, |
|
1526 // aInfo.iPassword=incorrect 4 digit call barring password, |
|
1527 // aInfo.iServiceGroup=EVoiceService and |
|
1528 // aCondition=EBarAllOutgoing |
|
1529 RMobilePhone::TMobilePhoneCBChangeV1 cbInfo; |
|
1530 RMobilePhone::TMobilePhoneCBCondition cbCondition; |
|
1531 cbInfo.iAction = RMobilePhone::EServiceActionActivate; |
|
1532 cbInfo.iPassword = KIncorrectPassword; |
|
1533 cbInfo.iServiceGroup = RMobilePhone::EVoiceService; |
|
1534 cbCondition = RMobilePhone::EBarAllOutgoing; |
|
1535 TInt err = SetCBStatusL(phone, cbInfo, cbCondition); |
|
1536 |
|
1537 // Check an error is returned. |
|
1538 ASSERT_EQUALS(err, KErrGsmSSNegativePasswordCheck , _L("RMobilePhone::SetCallBarringStatus did not returned KErrGsmSSNegativePasswordCheck even though password was incorrect")); |
|
1539 |
|
1540 // Post a notifier for RMobileCall::NotifyMobileCallStatusChange |
|
1541 TExtEtelRequestStatus notifyMobileCallChangeStatus(call1, EMobileCallNotifyMobileCallStatusChange); |
|
1542 CleanupStack::PushL(notifyMobileCallChangeStatus); |
|
1543 RMobileCall::TMobileCallStatus mobileCallStatus; |
|
1544 call1.NotifyMobileCallStatusChange(notifyMobileCallChangeStatus, mobileCallStatus); |
|
1545 |
|
1546 // Dial a number that answers. |
|
1547 TPtrC number; |
|
1548 ASSERT_TRUE(GetStringFromConfig(KIniVoiceNumSection, KIniVoiceNumber1, number) != EFalse, |
|
1549 _L("GetStringFromConfig did not complete as expected")); |
|
1550 TCoreEtelRequestStatus<RMobileCall> dialStatus(call1, &RMobileCall::DialCancel); |
|
1551 CleanupStack::PushL(dialStatus); |
|
1552 DEBUG_PRINTF1(_L("RMobileCall::Dial() ...first call")); |
|
1553 call1.Dial(dialStatus, number); |
|
1554 |
|
1555 ASSERT_EQUALS(WaitForRequestWithTimeOut(dialStatus, ETimeMedium), KErrNone, _L("RMobileCall::Dial timed-out")); |
|
1556 ASSERT_EQUALS(dialStatus.Int(), KErrNone, _L("RMobileCall::Dial returned error.")); |
|
1557 |
|
1558 // RMobileCall::NotifyMobileCallStatusChange completes with EStatusConnected. |
|
1559 RMobileCall::TMobileCallStatus expectedMobileCallStatus = RMobileCall::EStatusConnected; |
|
1560 TInt expectedStatus = KErrNone; |
|
1561 iCallControlTsyTestHelper.WaitForMobileCallNotifyMobileCallStatusChange(call1, |
|
1562 notifyMobileCallChangeStatus, |
|
1563 mobileCallStatus, |
|
1564 expectedMobileCallStatus, |
|
1565 expectedStatus); |
|
1566 |
|
1567 // Post a notifier for RMobileCall::NotifyMobileCallStatusChange |
|
1568 call1.NotifyMobileCallStatusChange(notifyMobileCallChangeStatus, mobileCallStatus); |
|
1569 |
|
1570 // Hang up. |
|
1571 TCoreEtelRequestStatus<RCall> hangUpStatus (call1,&RCall::HangUpCancel); |
|
1572 CleanupStack::PushL(hangUpStatus); |
|
1573 call1.HangUp(hangUpStatus); |
|
1574 ASSERT_EQUALS(WaitForRequestWithTimeOut(hangUpStatus, ETimeMedium), KErrNone, _L("RCall::HangUp timed-out")); |
|
1575 ASSERT_EQUALS(hangUpStatus.Int(), KErrNone, _L("RCall::CallHangUp returned an error")); |
|
1576 |
|
1577 // Check RMobileCall::NotifyMobileCallStatusChange completes with EStatusIdle. |
|
1578 expectedMobileCallStatus = RMobileCall::EStatusIdle; |
|
1579 iCallControlTsyTestHelper.WaitForMobileCallNotifyMobileCallStatusChange(call1, |
|
1580 notifyMobileCallChangeStatus, |
|
1581 mobileCallStatus, |
|
1582 expectedMobileCallStatus, |
|
1583 expectedStatus); |
|
1584 |
|
1585 // === Attempt to deactivate call barring with incorrect password === |
|
1586 |
|
1587 // === Activate call barring first === |
|
1588 // Activate call barring using RMobilePhone::SetCallBarringStatus with |
|
1589 // aInfo.iAction=EServiceActionActivate, |
|
1590 // aInfo.iPassword=correct call barring password, |
|
1591 // aInfo.iServiceGroup=EVoiceService and |
|
1592 // aCondition=EBarAllOutgoing |
|
1593 cbInfo.iAction = RMobilePhone::EServiceActionActivate; |
|
1594 cbInfo.iPassword = password; |
|
1595 cbInfo.iServiceGroup = RMobilePhone::EVoiceService; |
|
1596 cbCondition = RMobilePhone::EBarAllOutgoing; |
|
1597 |
|
1598 err = SetCBStatusL(phone, cbInfo, cbCondition); |
|
1599 ASSERT_EQUALS(err, KErrNone, _L("RMobilePhone::SetCallBarringStatus returned error")); |
|
1600 |
|
1601 // === Now try to deactivate with incorrect password === |
|
1602 |
|
1603 // Deactivate call barring using RMobilePhone::SetCallBarringStatus with |
|
1604 // aInfo.iAction=EServiceActionDeactivate, |
|
1605 // aInfo.iPassword=incorrect 4 digit call barring password, |
|
1606 // aInfo.iServiceGroup=EVoiceService and |
|
1607 // aCondition=EBarAllOutgoing |
|
1608 cbInfo.iAction = RMobilePhone::EServiceActionDeactivate; |
|
1609 cbInfo.iPassword = KIncorrectPassword; |
|
1610 cbInfo.iServiceGroup = RMobilePhone::EVoiceService; |
|
1611 cbCondition = RMobilePhone::EBarAllOutgoing; |
|
1612 err = SetCBStatusL(phone, cbInfo, cbCondition); |
|
1613 |
|
1614 // Check an error is returned. |
|
1615 ASSERT_EQUALS(err, KErrGsmSSNegativePasswordCheck , _L("RMobilePhone::SetCallBarringStatus did not returned KErrGsmSSNegativePasswordCheck even though password was incorrect")); |
|
1616 |
|
1617 // Dial a number with RCall::Dial. |
|
1618 ASSERT_TRUE(GetStringFromConfig(KIniVoiceNumSection, KIniVoiceNumber1, number) != EFalse, |
|
1619 _L("GetStringFromConfig did not complete as expected")); |
|
1620 DEBUG_PRINTF1(_L("RMobileCall::Dial() ...second call")); |
|
1621 call1.Dial(dialStatus, number); |
|
1622 |
|
1623 // Check an error is returned. |
|
1624 ASSERT_EQUALS(WaitForRequestWithTimeOut(dialStatus, ETimeLong), KErrNone, _L("RMobileCall::Dial timed-out")); |
|
1625 ASSERT_TRUE(dialStatus.Int() != KErrNone, _L("RMobileCall::Dial returned error.")); |
|
1626 |
|
1627 // |
|
1628 // TEST END |
|
1629 // |
|
1630 |
|
1631 StartCleanup(); |
|
1632 |
|
1633 // Hang up. |
|
1634 call1.HangUp(hangUpStatus); |
|
1635 ASSERT_EQUALS(WaitForRequestWithTimeOut(hangUpStatus, ETimeMedium), KErrNone, _L("RCall::HangUp timed-out")); |
|
1636 ASSERT_EQUALS(hangUpStatus.Int(), KErrNone, _L("RCall::CallHangUp returned an error")); |
|
1637 |
|
1638 DeactivateCallBarringL(phone, password); |
|
1639 |
|
1640 // Pop |
|
1641 // reqSetSSPasswordStatus |
|
1642 // notifyMobileCallChangeStatus |
|
1643 // dialStatus |
|
1644 // hangUpStatus |
|
1645 CleanupStack::PopAndDestroy(4,&reqSetSSPasswordStatus); |
|
1646 |
|
1647 return TestStepResult(); |
|
1648 } |
|
1649 |
|
1650 TPtrC CCTSYIntegrationTestCallBarring0004::GetTestStepName() |
|
1651 /** |
|
1652 * @return The test step name. |
|
1653 */ |
|
1654 { |
|
1655 return _L("CCTSYIntegrationTestCallBarring0004"); |
|
1656 } |
|
1657 |
|
1658 |
|
1659 |
|
1660 CCTSYIntegrationTestCallBarring0005::CCTSYIntegrationTestCallBarring0005(CEtelSessionMgr& aEtelSessionMgr) |
|
1661 : CCTSYIntegrationTestCallBarringBase(aEtelSessionMgr) |
|
1662 /** |
|
1663 * Constructor. |
|
1664 */ |
|
1665 { |
|
1666 SetTestStepName(CCTSYIntegrationTestCallBarring0005::GetTestStepName()); |
|
1667 } |
|
1668 |
|
1669 CCTSYIntegrationTestCallBarring0005::~CCTSYIntegrationTestCallBarring0005() |
|
1670 /** |
|
1671 * Destructor. |
|
1672 */ |
|
1673 { |
|
1674 } |
|
1675 |
|
1676 TVerdict CCTSYIntegrationTestCallBarring0005::doTestStepL() |
|
1677 /** |
|
1678 * @SYMTestCaseID BA-CTSY-INT-CBAR-0005 |
|
1679 * @SYMFssID BA/CTSY/CBAR-0005 |
|
1680 * @SYMTestCaseDesc Activate call barring using a SIM without call barring. |
|
1681 * @SYMTestPriority High |
|
1682 * @SYMTestActions |
|
1683 * @SYMTestExpectedResults Pass - Call barring cannot be activated. |
|
1684 * @SYMTestType CIT |
|
1685 * @SYMTestCaseDependencies live/manual |
|
1686 * |
|
1687 * Reason for test: Verify error is returned. |
|
1688 * |
|
1689 * @return - TVerdict code |
|
1690 */ |
|
1691 { |
|
1692 |
|
1693 // |
|
1694 // SET UP |
|
1695 // |
|
1696 |
|
1697 RMobilePhone& phone = iEtelSessionMgr.GetPhoneL(KMainServer, KMainPhone); |
|
1698 |
|
1699 // Get voice line 1. |
|
1700 RMobileLine& voiceLine = iEtelSessionMgr.GetLineL(KMainServer, KMainPhone, KVoiceLine); |
|
1701 |
|
1702 // wait until we are on the network |
|
1703 CHECK_EQUALS_L( iNetworkTsyTestHelper.WaitForRegisteredOnHomeNetworkL( phone ), KErrNone, |
|
1704 _L("Network is unavailable") ); |
|
1705 // |
|
1706 // SET UP END |
|
1707 // |
|
1708 |
|
1709 StartTest(); |
|
1710 |
|
1711 // |
|
1712 // TEST START |
|
1713 // |
|
1714 |
|
1715 // Insert SIM without call barring. |
|
1716 DisplayUserInteractionPromptL(_L("Insert SIM which does NOT SUPPORT call barring service"), ETimeLong); |
|
1717 |
|
1718 // === Activate call barring on voice calls to all outgoing numbers === |
|
1719 |
|
1720 // Activate call barring using RMobilePhone::SetCallBarringStatus with aInfo.iAction=EServiceActionActivate, aInfo.iPassword=correct call barring password, aInfo.iServiceGroup=EVoiceService and aCondition=EBarAllOutgoing |
|
1721 RMobilePhone::TMobilePhoneCBChangeV1 callBarringInfo; |
|
1722 RMobilePhone::TMobilePhoneCBCondition callBarringCondition; |
|
1723 callBarringCondition = RMobilePhone::EBarAllOutgoing; |
|
1724 callBarringInfo.iAction = RMobilePhone::EServiceActionActivate; |
|
1725 callBarringInfo.iPassword = KAltPasswordVoda; |
|
1726 callBarringInfo.iServiceGroup = RMobilePhone::EVoiceService; |
|
1727 TInt err = SetCBStatusL(phone, callBarringInfo, callBarringCondition); |
|
1728 |
|
1729 // Check error is returned. |
|
1730 ASSERT_TRUE(err != KErrNone, _L("RMobilePhone::SetCallBarringStatus did not return error as expected")); |
|
1731 |
|
1732 // |
|
1733 // TEST END |
|
1734 // |
|
1735 |
|
1736 StartCleanup(); |
|
1737 |
|
1738 return TestStepResult(); |
|
1739 } |
|
1740 |
|
1741 TPtrC CCTSYIntegrationTestCallBarring0005::GetTestStepName() |
|
1742 /** |
|
1743 * @return The test step name. |
|
1744 */ |
|
1745 { |
|
1746 return _L("CCTSYIntegrationTestCallBarring0005"); |
|
1747 } |
|
1748 |
|
1749 |
|
1750 |
|
1751 CCTSYIntegrationTestCallBarring0006::CCTSYIntegrationTestCallBarring0006(CEtelSessionMgr& aEtelSessionMgr) |
|
1752 : CCTSYIntegrationTestCallBarringBase(aEtelSessionMgr) |
|
1753 /** |
|
1754 * Constructor. |
|
1755 */ |
|
1756 { |
|
1757 SetTestStepName(CCTSYIntegrationTestCallBarring0006::GetTestStepName()); |
|
1758 } |
|
1759 |
|
1760 CCTSYIntegrationTestCallBarring0006::~CCTSYIntegrationTestCallBarring0006() |
|
1761 /** |
|
1762 * Destructor. |
|
1763 */ |
|
1764 { |
|
1765 } |
|
1766 |
|
1767 TVerdict CCTSYIntegrationTestCallBarring0006::doTestStepL() |
|
1768 /** |
|
1769 * @SYMTestCaseID BA-CTSY-INT-CBAR-0006 |
|
1770 * @SYMFssID BA/CTSY/CBAR-0006 |
|
1771 * @SYMTestCaseDesc Register and erase call barring for outgoing voice calls. |
|
1772 * @SYMTestPriority High |
|
1773 * @SYMTestActions RMobilePhone::NotifyCallBarringStatusChange, RMobilePhone::SetCallBarringStatus, RCall::Dial, RCall::HangUp |
|
1774 * @SYMTestExpectedResults Pass - Call barring registered and erased. |
|
1775 * @SYMTestType CIT |
|
1776 * @SYMTestCaseDependencies live/automatic |
|
1777 * |
|
1778 * Reason for test: Verify call barring notifications and barred numbers cannot be dialled. |
|
1779 * |
|
1780 * @return - TVerdict code |
|
1781 */ |
|
1782 { |
|
1783 |
|
1784 // |
|
1785 // SET UP |
|
1786 // |
|
1787 RMobilePhone &phone = iEtelSessionMgr.GetPhoneL(KMainServer, KMainPhone); |
|
1788 |
|
1789 // Ensure RMobilePhone::GetCallServiceCaps returns caps in set of: KCapsNotifyCBStatus | KCapsSetCBStatus | KCapsBarAllOutgoing | KCapsBarOutgoingInternational | KCapsBarOutgoingInternationalExHC |
|
1790 TUint32 callBarCaps; |
|
1791 TInt err; |
|
1792 err = phone.GetCallServiceCaps( callBarCaps ); |
|
1793 CHECK_EQUALS_L(err, KErrNone, _L("RMobilePhone::GetCallServiceCaps returned error")); |
|
1794 CHECK_BITS_SET_L(callBarCaps, (RMobilePhone::KCapsNotifyCBStatus | RMobilePhone::KCapsSetCBStatus | |
|
1795 RMobilePhone::KCapsBarAllOutgoing | RMobilePhone::KCapsBarOutgoingInternational | |
|
1796 RMobilePhone::KCapsBarOutgoingInternationalExHC), |
|
1797 KNoUnwantedBits, _L("RMobilePhone::GetCallServiceCaps returned unexpected bitmap")); |
|
1798 |
|
1799 // Set the call barring password to a known password using RMobilePhone::SetSSPassword |
|
1800 // For safety we are going to change the password and then immediately change it back |
|
1801 RMobilePhone::TMobilePassword password; |
|
1802 RMobilePhone::TMobilePhonePasswordChangeV2 passwordV2; |
|
1803 RMobilePhone::TMobilePhonePasswordChangeV2Pckg passwordPkg(passwordV2); |
|
1804 CheckCBPasswordL(phone, password); |
|
1805 passwordV2.iOldPassword = password; |
|
1806 passwordV2.iNewPassword = KAltPassword2; |
|
1807 passwordV2.iVerifiedPassword = KAltPassword2; |
|
1808 TExtEtelRequestStatus setSSPasswordStatus(phone, EMobilePhoneSetSSPassword); |
|
1809 CleanupStack::PushL(setSSPasswordStatus); |
|
1810 phone.SetSSPassword(setSSPasswordStatus, passwordPkg, KSsCallBarringAllServices); |
|
1811 CHECK_EQUALS_L(WaitForRequestWithTimeOut( setSSPasswordStatus, ETimeMedium), KErrNone, _L("RMobilePhone::SetSSPassword timed out")); |
|
1812 CHECK_EQUALS_L(setSSPasswordStatus.Int(), KErrNone, _L("RMobilePhone::SetSSPassword returned error")); |
|
1813 |
|
1814 // Succeeded in changing the password, restoring original password |
|
1815 passwordV2.iOldPassword = KAltPassword2; |
|
1816 passwordV2.iNewPassword = password; |
|
1817 passwordV2.iVerifiedPassword = password; |
|
1818 phone.SetSSPassword(setSSPasswordStatus, passwordPkg, KSsCallBarringAllServices); |
|
1819 CHECK_EQUALS_L(WaitForRequestWithTimeOut( setSSPasswordStatus, ETimeMedium), KErrNone, _L("RMobilePhone::SetSSPassword timed out")); |
|
1820 CHECK_EQUALS_L(setSSPasswordStatus.Int(), KErrNone, _L("RMobilePhone::SetSSPassword returned error")); |
|
1821 |
|
1822 // Get voice line 1. |
|
1823 RMobileLine& line = iEtelSessionMgr.GetLineL(KMainServer, KMainPhone, KVoiceLine); |
|
1824 |
|
1825 // Get call 1. |
|
1826 RMobileCall& call = iEtelSessionMgr.GetCallL(KMainServer, KMainPhone, KVoiceLine, KCall1); |
|
1827 |
|
1828 // |
|
1829 // SET UP END |
|
1830 // |
|
1831 |
|
1832 StartTest(); |
|
1833 |
|
1834 // |
|
1835 // TEST START |
|
1836 // |
|
1837 |
|
1838 // Post notifiers |
|
1839 TExtEtelRequestStatus callBarringStatusNotify(phone, EMobilePhoneNotifyCallBarringStatusChange); |
|
1840 CleanupStack::PushL(callBarringStatusNotify); |
|
1841 RMobilePhone::TMobilePhoneCBCondition callBarringStatus; |
|
1842 phone.NotifyCallBarringStatusChange(callBarringStatusNotify, callBarringStatus); |
|
1843 |
|
1844 // === Register call barring on voice calls to outgoing international numbers and check international number cannot be dialled === |
|
1845 |
|
1846 // Register call barring using RMobilePhone::SetCallBarringStatus with aInfo.iAction=EServiceActionRegister, aInfo.iPassword=correct call barring password, aInfo.iServiceGroup=EVoiceService and aCondition=EBarOutgoingInternational |
|
1847 RMobilePhone::TMobilePhoneCBChangeV1 callBarringInfo; |
|
1848 RMobilePhone::TMobilePhoneCBCondition callBarringCondition; |
|
1849 callBarringCondition = RMobilePhone::EBarOutgoingInternational; |
|
1850 callBarringInfo.iAction = RMobilePhone::EServiceActionRegister; |
|
1851 callBarringInfo.iPassword = password; |
|
1852 callBarringInfo.iServiceGroup = RMobilePhone::EVoiceService; |
|
1853 err = SetCBStatusL(phone, callBarringInfo, callBarringCondition); |
|
1854 // $CTSYProblem. Adaptation returns -4419(KErrGsmSSDataMissing). Due failure also notify fails and Dialing |
|
1855 // to an international number succeeds |
|
1856 ASSERT_EQUALS(err, KErrNone, _L("RMobilePhone::SetCallBarringStatus returned error")); |
|
1857 |
|
1858 // Check RMobilePhone::NotifyCallBarringStatusChange completes with aCondition=EBarOutgoingInternational |
|
1859 ASSERT_EQUALS(WaitForRequestWithTimeOut(callBarringStatusNotify, ETimeMedium), KErrNone, _L("RMobilePhone::NotifyCallBarringStatusChange timed out")); |
|
1860 ASSERT_EQUALS(callBarringStatusNotify.Int(), KErrNone, _L("RMobilePhone::NotifyCallBarringStatusChange returned an error")); |
|
1861 ASSERT_EQUALS(callBarringStatus, RMobilePhone::EBarOutgoingInternational, _L("RMobilePhone::NotifyCallBarringStatusChange condition was not EBarOutgoingInternational as expected")); |
|
1862 |
|
1863 // Dial an international number. |
|
1864 TPtrC internationalNumber; |
|
1865 ASSERT_TRUE(GetStringFromConfig(KIniVoiceNumSection, KIniVoiceNumberInternational, internationalNumber), _L("Failed to read KIniVoiceNumberInternational from INI file")); |
|
1866 TCoreEtelRequestStatus<RMobileCall> dialStatus(call, &RMobileCall::DialCancel); |
|
1867 CleanupStack::PushL(dialStatus); |
|
1868 DEBUG_PRINTF1(_L("Dial an international number.")); |
|
1869 call.Dial(dialStatus, internationalNumber); |
|
1870 |
|
1871 // Check this fails. |
|
1872 ASSERT_EQUALS(WaitForRequestWithTimeOut(dialStatus, ETimeLong), KErrNone, _L("RMobileCall::Dial timed-out")); |
|
1873 ASSERT_TRUE(dialStatus.Int() != KErrNone, _L("RMobileCall::Dial did not fail as it was expected.")); |
|
1874 |
|
1875 // === Erase call barring on voice calls to outgoing international numbers and check international number can be dialled === |
|
1876 |
|
1877 // Post notifiers |
|
1878 TExtEtelRequestStatus notifyCallStatusChangeStatus(call, EMobileCallNotifyMobileCallStatusChange); |
|
1879 CleanupStack::PushL(notifyCallStatusChangeStatus); |
|
1880 RMobileCall::TMobileCallStatus mobileCallStatus; |
|
1881 call.NotifyMobileCallStatusChange(notifyCallStatusChangeStatus, mobileCallStatus); |
|
1882 phone.NotifyCallBarringStatusChange(callBarringStatusNotify, callBarringStatus); |
|
1883 |
|
1884 // Erase call barring using RMobilePhone::SetCallBarringStatus with aInfo.iAction=EServiceActionErase, aInfo.iPassword=correct call barring password, aInfo.iServiceGroup=EVoiceService and aCondition=EBarOutgoingInternational |
|
1885 callBarringCondition = RMobilePhone::EBarOutgoingInternational; |
|
1886 callBarringInfo.iAction = RMobilePhone::EServiceActionErase; |
|
1887 callBarringInfo.iPassword = password; |
|
1888 callBarringInfo.iServiceGroup = RMobilePhone::EVoiceService; |
|
1889 // $CTSYProblem adaptation returns -4400(KErrGsmSSIllegalOperation) and due that notification times out. |
|
1890 err = SetCBStatusL(phone, callBarringInfo, callBarringCondition); |
|
1891 ASSERT_EQUALS(err, KErrNone, _L("RMobilePhone::SetCallBarringStatus returned error")); |
|
1892 |
|
1893 // Check RMobilePhone::NotifyCallBarringStatusChange completes with aCondition=EBarOutgoingInternational |
|
1894 ASSERT_EQUALS(WaitForRequestWithTimeOut(callBarringStatusNotify, ETimeMedium), KErrNone, _L("RMobilePhone::NotifyCallBarringStatusChange timed out")); |
|
1895 ASSERT_EQUALS(callBarringStatusNotify.Int(), KErrNone, _L("RMobilePhone::NotifyCallBarringStatusChange returned an error")); |
|
1896 ASSERT_EQUALS(callBarringStatus, RMobilePhone::EBarOutgoingInternational, _L("RMobilePhone::NotifyCallBarringStatusChange condition was not EBarOutgoingInternational as expected")); |
|
1897 |
|
1898 // Dial an international number that answers. |
|
1899 DEBUG_PRINTF1(_L("Dial an international number that answers.")); |
|
1900 call.Dial(dialStatus, internationalNumber); |
|
1901 ASSERT_EQUALS(WaitForRequestWithTimeOut(dialStatus, ETimeLong), KErrNone, _L("RMobileCall::Dial timed-out")); |
|
1902 ASSERT_EQUALS(dialStatus.Int(), KErrNone, _L("RMobileCall::Dial returned error.")); |
|
1903 |
|
1904 // Check RMobileCall::NotifyMobileCallStatusChange completes with EStatusConnected. |
|
1905 RMobileCall::TMobileCallStatus expectedMobileCallStatus = RMobileCall::EStatusConnected; |
|
1906 const TInt expectedStatus = KErrNone; |
|
1907 iCallControlTsyTestHelper.WaitForMobileCallNotifyMobileCallStatusChange(call, notifyCallStatusChangeStatus, mobileCallStatus, expectedMobileCallStatus, expectedStatus); |
|
1908 |
|
1909 // Post notifiers |
|
1910 call.NotifyMobileCallStatusChange(notifyCallStatusChangeStatus, mobileCallStatus); |
|
1911 |
|
1912 // Hang up. |
|
1913 TCoreEtelRequestStatus<RMobileCall> hangUpStatus (call,&RMobileCall::HangUpCancel); |
|
1914 CleanupStack::PushL(hangUpStatus); |
|
1915 call.HangUp(hangUpStatus); |
|
1916 ASSERT_EQUALS(WaitForRequestWithTimeOut(hangUpStatus, ETimeMedium), KErrNone, _L("RMobileCall::HangUp timed-out")); |
|
1917 ASSERT_EQUALS(hangUpStatus.Int(), KErrNone, _L("RMobileCall::CallHangUp returned an error")); |
|
1918 |
|
1919 // Check RMobileCall::NotifyMobileCallStatusChange completes with EStatusIdle. |
|
1920 expectedMobileCallStatus = RMobileCall::EStatusIdle; |
|
1921 iCallControlTsyTestHelper.WaitForMobileCallNotifyMobileCallStatusChange(call, notifyCallStatusChangeStatus, mobileCallStatus, expectedMobileCallStatus, expectedStatus); |
|
1922 |
|
1923 // === Register call barring on voice calls to outgoing international numbers excluding home country and check national number with + prefix can be dialled but international number in another country cannot be dialled === |
|
1924 |
|
1925 // Post notifiers |
|
1926 call.NotifyMobileCallStatusChange(notifyCallStatusChangeStatus, mobileCallStatus); |
|
1927 phone.NotifyCallBarringStatusChange(callBarringStatusNotify, callBarringStatus); |
|
1928 |
|
1929 // Register call barring using RMobilePhone::SetCallBarringStatus with aInfo.iAction=EServiceActionRegister, aInfo.iPassword=correct call barring password, aInfo.iServiceGroup=EVoiceService and aCondition=EBarOutgoingInternationalExHC |
|
1930 callBarringCondition = RMobilePhone::EBarOutgoingInternationalExHC; |
|
1931 callBarringInfo.iAction = RMobilePhone::EServiceActionRegister; |
|
1932 callBarringInfo.iPassword = password; |
|
1933 callBarringInfo.iServiceGroup = RMobilePhone::EVoiceService; |
|
1934 err = SetCBStatusL(phone, callBarringInfo, callBarringCondition); |
|
1935 // $CTSYProblem adaptation returns -4419(KErrGsmSSDataMissing) and due that notification fails |
|
1936 ASSERT_EQUALS(err, KErrNone, _L("RMobilePhone::SetCallBarringStatus returned error")); |
|
1937 |
|
1938 // Dial a national number that answers specifying the number using + prefix. |
|
1939 DEBUG_PRINTF1(_L("Dial a national number specifying the number using + prefix.")); |
|
1940 TPtrC nationalNumberWithPrefix; |
|
1941 ASSERT_TRUE(GetStringFromConfig(KIniVoiceNumSection, KIniVoiceNumber2, nationalNumberWithPrefix), _L("Failed to read KIniVoiceNumber2 from INI file")); |
|
1942 call.Dial(dialStatus, nationalNumberWithPrefix); |
|
1943 ASSERT_EQUALS(WaitForRequestWithTimeOut(dialStatus, ETimeLong), KErrNone, _L("RMobileCall::Dial timed-out")); |
|
1944 ASSERT_EQUALS(dialStatus.Int(), KErrNone, _L("RMobileCall::Dial returned error.")); |
|
1945 |
|
1946 // Check RMobilePhone::NotifyCallBarringStatusChange completes with aCondition=EBarOutgoingInternationalExHC |
|
1947 ASSERT_EQUALS(WaitForRequestWithTimeOut(callBarringStatusNotify, ETimeMedium), KErrNone, _L("RMobilePhone::NotifyCallBarringStatusChange timed out")); |
|
1948 ASSERT_EQUALS(callBarringStatusNotify.Int(), KErrNone, _L("RMobilePhone::NotifyCallBarringStatusChange returned an error")); |
|
1949 ASSERT_EQUALS(callBarringStatus, RMobilePhone::EBarOutgoingInternationalExHC, _L("RMobilePhone::NotifyCallBarringStatusChange condition was not EBarOutgoingInternationalExHC as expected")); |
|
1950 |
|
1951 // Check RMobileCall::NotifyMobileCallStatusChange completes with EStatusConnected. |
|
1952 expectedMobileCallStatus = RMobileCall::EStatusConnected; |
|
1953 iCallControlTsyTestHelper.WaitForMobileCallNotifyMobileCallStatusChange(call, notifyCallStatusChangeStatus, mobileCallStatus, expectedMobileCallStatus, expectedStatus); |
|
1954 |
|
1955 // Post notifiers |
|
1956 call.NotifyMobileCallStatusChange(notifyCallStatusChangeStatus, mobileCallStatus); |
|
1957 |
|
1958 // Hang up. |
|
1959 call.HangUp(hangUpStatus); |
|
1960 ASSERT_EQUALS(WaitForRequestWithTimeOut(hangUpStatus, ETimeMedium), KErrNone, _L("RMobileCall::HangUp timed-out")); |
|
1961 ASSERT_EQUALS(hangUpStatus.Int(), KErrNone, _L("RMobileCall::CallHangUp returned an error")); |
|
1962 |
|
1963 // Check RMobileCall::NotifyMobileCallStatusChange completes with EStatusIdle. |
|
1964 expectedMobileCallStatus = RMobileCall::EStatusIdle; |
|
1965 iCallControlTsyTestHelper.WaitForMobileCallNotifyMobileCallStatusChange(call, notifyCallStatusChangeStatus, mobileCallStatus, expectedMobileCallStatus, expectedStatus); |
|
1966 |
|
1967 // Dial an international number in another country. |
|
1968 DEBUG_PRINTF1(_L("Dial an international number in another country. ")); |
|
1969 call.Dial(dialStatus, internationalNumber); |
|
1970 |
|
1971 // Check this fails. |
|
1972 ASSERT_EQUALS(WaitForRequestWithTimeOut(dialStatus, ETimeLong), KErrNone, _L("RMobileCall::Dial timed-out")); |
|
1973 ASSERT_TRUE(dialStatus.Int() != KErrNone, _L("RMobileCall::Dial did not fail as it was expected.")); |
|
1974 |
|
1975 // === Erase call barring on voice calls to outgoing international numbers excluding home country and check national and international numbers in international format can be dialled === |
|
1976 |
|
1977 // Post notifiers |
|
1978 call.NotifyMobileCallStatusChange(notifyCallStatusChangeStatus, mobileCallStatus); |
|
1979 phone.NotifyCallBarringStatusChange(callBarringStatusNotify, callBarringStatus); |
|
1980 |
|
1981 // Erase call barring using RMobilePhone::SetCallBarringStatus with aInfo.iAction=EServiceActionErase, aInfo.iPassword=correct call barring password, aInfo.iServiceGroup=EVoiceService and aCondition=EBarOutgoingInternationalExHC |
|
1982 callBarringCondition = RMobilePhone::EBarOutgoingInternational; |
|
1983 callBarringInfo.iAction = RMobilePhone::EServiceActionErase; |
|
1984 callBarringInfo.iPassword = password; |
|
1985 callBarringInfo.iServiceGroup = RMobilePhone::EVoiceService; |
|
1986 err = SetCBStatusL(phone, callBarringInfo, callBarringCondition); |
|
1987 // $CTSYProblem adaptation returns -4400(KErrGsmSSIllegalOperation) and notification does not complete on failure |
|
1988 ASSERT_EQUALS(err, KErrNone, _L("RMobilePhone::SetCallBarringStatus returned error")); |
|
1989 |
|
1990 // Check RMobilePhone::NotifyCallBarringStatusChange completes with aCondition=EBarOutgoingInternationalExHC |
|
1991 ASSERT_EQUALS(WaitForRequestWithTimeOut(callBarringStatusNotify, ETimeMedium), KErrNone, _L("RMobilePhone::NotifyCallBarringStatusChange timed out")); |
|
1992 ASSERT_EQUALS(callBarringStatusNotify.Int(), KErrNone, _L("RMobilePhone::NotifyCallBarringStatusChange returned an error")); |
|
1993 ASSERT_EQUALS(callBarringStatus, RMobilePhone::EBarOutgoingInternationalExHC, _L("RMobilePhone::NotifyCallBarringStatusChange condition was not EBarOutgoingInternationalExHC as expected")); |
|
1994 |
|
1995 // Dial a national number using + prefix. |
|
1996 DEBUG_PRINTF1(_L("Dial a national number using + prefix. ")); |
|
1997 call.Dial(dialStatus, nationalNumberWithPrefix); |
|
1998 ASSERT_EQUALS(WaitForRequestWithTimeOut(dialStatus, ETimeLong), KErrNone, _L("RMobileCall::Dial timed-out")); |
|
1999 ASSERT_EQUALS(dialStatus.Int(), KErrNone, _L("RMobileCall::Dial returned error.")); |
|
2000 |
|
2001 // Check RMobileCall::NotifyMobileCallStatusChange completes with EStatusConnected. |
|
2002 expectedMobileCallStatus = RMobileCall::EStatusConnected; |
|
2003 iCallControlTsyTestHelper.WaitForMobileCallNotifyMobileCallStatusChange(call, notifyCallStatusChangeStatus, mobileCallStatus, expectedMobileCallStatus, expectedStatus); |
|
2004 |
|
2005 // Post notifiers |
|
2006 call.NotifyMobileCallStatusChange(notifyCallStatusChangeStatus, mobileCallStatus); |
|
2007 |
|
2008 // Hang up. |
|
2009 call.HangUp(hangUpStatus); |
|
2010 ASSERT_EQUALS(WaitForRequestWithTimeOut(hangUpStatus, ETimeMedium), KErrNone, _L("RMobileCall::HangUp timed-out")); |
|
2011 ASSERT_EQUALS(hangUpStatus.Int(), KErrNone, _L("RMobileCall::CallHangUp returned an error")); |
|
2012 |
|
2013 // Check RMobileCall::NotifyMobileCallStatusChange completes with EStatusIdle. |
|
2014 expectedMobileCallStatus = RMobileCall::EStatusIdle; |
|
2015 iCallControlTsyTestHelper.WaitForMobileCallNotifyMobileCallStatusChange(call, notifyCallStatusChangeStatus, mobileCallStatus, expectedMobileCallStatus, expectedStatus); |
|
2016 |
|
2017 // Post notifiers |
|
2018 call.NotifyMobileCallStatusChange(notifyCallStatusChangeStatus, mobileCallStatus); |
|
2019 |
|
2020 // Dial an international number in another country. |
|
2021 DEBUG_PRINTF1(_L("Dial an international number in another country.")); |
|
2022 call.Dial(dialStatus, internationalNumber); |
|
2023 ASSERT_EQUALS(WaitForRequestWithTimeOut(dialStatus, ETimeLong), KErrNone, _L("RMobileCall::Dial timed-out")); |
|
2024 ASSERT_EQUALS(dialStatus.Int(), KErrNone, _L("RMobileCall::Dial returned error.")); |
|
2025 |
|
2026 // Check RMobileCall::NotifyMobileCallStatusChange completes with EStatusConnected. |
|
2027 expectedMobileCallStatus = RMobileCall::EStatusConnected; |
|
2028 iCallControlTsyTestHelper.WaitForMobileCallNotifyMobileCallStatusChange(call, notifyCallStatusChangeStatus, mobileCallStatus, expectedMobileCallStatus, expectedStatus); |
|
2029 |
|
2030 // Post notifiers |
|
2031 call.NotifyMobileCallStatusChange(notifyCallStatusChangeStatus, mobileCallStatus); |
|
2032 |
|
2033 // Hang up. |
|
2034 call.HangUp(hangUpStatus); |
|
2035 ASSERT_EQUALS(WaitForRequestWithTimeOut(hangUpStatus, ETimeMedium), KErrNone, _L("RMobileCall::HangUp timed-out")); |
|
2036 ASSERT_EQUALS(hangUpStatus.Int(), KErrNone, _L("RMobileCall::CallHangUp returned an error")); |
|
2037 |
|
2038 // Check RMobileCall::NotifyMobileCallStatusChange completes with EStatusIdle. |
|
2039 expectedMobileCallStatus = RMobileCall::EStatusIdle; |
|
2040 iCallControlTsyTestHelper.WaitForMobileCallNotifyMobileCallStatusChange(call, notifyCallStatusChangeStatus, mobileCallStatus, expectedMobileCallStatus, expectedStatus); |
|
2041 |
|
2042 // === Register call barring on voice calls to all outgoing numbers and check they cannot be dialled === |
|
2043 |
|
2044 // Post notifiers |
|
2045 call.NotifyMobileCallStatusChange(notifyCallStatusChangeStatus, mobileCallStatus); |
|
2046 phone.NotifyCallBarringStatusChange(callBarringStatusNotify, callBarringStatus); |
|
2047 |
|
2048 // Register call barring using RMobilePhone::SetCallBarringStatus with aInfo.iAction=EServiceActionRegister, aInfo.iPassword=correct call barring password, aInfo.iServiceGroup=EVoiceService and aCondition=EBarAllOutgoing |
|
2049 callBarringCondition = RMobilePhone::EBarAllOutgoing; |
|
2050 callBarringInfo.iAction = RMobilePhone::EServiceActionRegister; |
|
2051 callBarringInfo.iPassword = password; |
|
2052 callBarringInfo.iServiceGroup = RMobilePhone::EVoiceService; |
|
2053 // $CTSYProblem adaptation returns -4419(KErrGsmSSDataMissing) and due that notification fails |
|
2054 err = SetCBStatusL(phone, callBarringInfo, callBarringCondition); |
|
2055 ASSERT_EQUALS(err, KErrNone, _L("RMobilePhone::SetCallBarringStatus returned error")); |
|
2056 |
|
2057 // Check RMobilePhone::NotifyCallBarringStatusChange completes with aCondition=EBarAllOutgoing |
|
2058 ASSERT_EQUALS(WaitForRequestWithTimeOut(callBarringStatusNotify, ETimeMedium), KErrNone, _L("RMobilePhone::NotifyCallBarringStatusChange timed out")); |
|
2059 ASSERT_EQUALS(callBarringStatusNotify.Int(), KErrNone, _L("RMobilePhone::NotifyCallBarringStatusChange returned an error")); |
|
2060 ASSERT_EQUALS(callBarringStatus, RMobilePhone::EBarAllOutgoing, _L("RMobilePhone::NotifyCallBarringStatusChange condition was not EBarAllOutgoing as expected")); |
|
2061 |
|
2062 // Dial a national number. |
|
2063 DEBUG_PRINTF1(_L("Dial a national number.")); |
|
2064 TPtrC nationalNumber; |
|
2065 ASSERT_TRUE(GetStringFromConfig(KIniVoiceNumSection, KIniVoiceNumber1, nationalNumber), _L("Failed to read KIniVoiceNumber1 from INI file")); |
|
2066 call.Dial(dialStatus, nationalNumber); |
|
2067 |
|
2068 // Check this fails. |
|
2069 ASSERT_EQUALS(WaitForRequestWithTimeOut(dialStatus, ETimeLong), KErrNone, _L("RMobileCall::Dial timed-out")); |
|
2070 ASSERT_TRUE(dialStatus.Int() != KErrNone, _L("RMobileCall::Dial did not fail as it was expected.")); |
|
2071 |
|
2072 // Dial an international number. |
|
2073 call.Dial(dialStatus, internationalNumber); |
|
2074 |
|
2075 // Check this fails. |
|
2076 ASSERT_EQUALS(WaitForRequestWithTimeOut(dialStatus, ETimeLong), KErrNone, _L("RMobileCall::Dial timed-out")); |
|
2077 ASSERT_TRUE(dialStatus.Int() != KErrNone, _L("RMobileCall::Dial did not fail as it was expected.")); |
|
2078 |
|
2079 // === Erase call barring on voice calls to all outgoing numbers and check national and international numbers can be dialled === |
|
2080 |
|
2081 // Post notifiers |
|
2082 call.NotifyMobileCallStatusChange(notifyCallStatusChangeStatus, mobileCallStatus); |
|
2083 phone.NotifyCallBarringStatusChange(callBarringStatusNotify, callBarringStatus); |
|
2084 |
|
2085 // Erase call barring using RMobilePhone::SetCallBarringStatus with aInfo.iAction=EServiceActionErase, aInfo.iPassword=correct call barring password, aInfo.iServiceGroup=EVoiceService and aCondition=EBarAllOutgoing |
|
2086 callBarringCondition = RMobilePhone::EBarAllOutgoing; |
|
2087 callBarringInfo.iAction = RMobilePhone::EServiceActionErase; |
|
2088 callBarringInfo.iPassword = password; |
|
2089 callBarringInfo.iServiceGroup = RMobilePhone::EVoiceService; |
|
2090 // $CTSYProblem adaptation returns -4400(KErrGsmSSIllegalOperation) and notification does not complete on failure |
|
2091 err = SetCBStatusL(phone, callBarringInfo, callBarringCondition); |
|
2092 ASSERT_EQUALS(err, KErrNone, _L("RMobilePhone::SetCallBarringStatus returned error")); |
|
2093 |
|
2094 // Check RMobilePhone::NotifyCallBarringStatusChange completes with aCondition=EBarAllOutgoing |
|
2095 ASSERT_EQUALS(WaitForRequestWithTimeOut(callBarringStatusNotify, ETimeMedium), KErrNone, _L("RMobilePhone::NotifyCallBarringStatusChange timed out")); |
|
2096 ASSERT_EQUALS(callBarringStatusNotify.Int(), KErrNone, _L("RMobilePhone::NotifyCallBarringStatusChange returned an error")); |
|
2097 ASSERT_EQUALS(callBarringStatus, RMobilePhone::EBarAllOutgoing, _L("RMobilePhone::NotifyCallBarringStatusChange condition was not EBarAllOutgoing as expected")); |
|
2098 |
|
2099 // Dial a national number that answers. |
|
2100 DEBUG_PRINTF1(_L("Dial a national number that answers.")); |
|
2101 call.Dial(dialStatus, nationalNumber); |
|
2102 ASSERT_EQUALS(WaitForRequestWithTimeOut(dialStatus, ETimeLong), KErrNone, _L("RMobileCall::Dial timed-out")); |
|
2103 ASSERT_EQUALS(dialStatus.Int(), KErrNone, _L("RMobileCall::Dial returned error.")); |
|
2104 |
|
2105 // Check RMobileCall::NotifyMobileCallStatusChange completes with EStatusConnected. |
|
2106 expectedMobileCallStatus = RMobileCall::EStatusConnected; |
|
2107 iCallControlTsyTestHelper.WaitForMobileCallNotifyMobileCallStatusChange(call, notifyCallStatusChangeStatus, mobileCallStatus, expectedMobileCallStatus, expectedStatus); |
|
2108 |
|
2109 // Post notifiers |
|
2110 call.NotifyMobileCallStatusChange(notifyCallStatusChangeStatus, mobileCallStatus); |
|
2111 |
|
2112 // Hang up. |
|
2113 call.HangUp(hangUpStatus); |
|
2114 ASSERT_EQUALS(WaitForRequestWithTimeOut(hangUpStatus, ETimeMedium), KErrNone, _L("RMobileCall::HangUp timed-out")); |
|
2115 ASSERT_EQUALS(hangUpStatus.Int(), KErrNone, _L("RMobileCall::CallHangUp returned an error")); |
|
2116 |
|
2117 // Check RMobileCall::NotifyMobileCallStatusChange completes with EStatusIdle. |
|
2118 expectedMobileCallStatus = RMobileCall::EStatusIdle; |
|
2119 iCallControlTsyTestHelper.WaitForMobileCallNotifyMobileCallStatusChange(call, notifyCallStatusChangeStatus, mobileCallStatus, expectedMobileCallStatus, expectedStatus); |
|
2120 |
|
2121 // Post notifiers |
|
2122 call.NotifyMobileCallStatusChange(notifyCallStatusChangeStatus, mobileCallStatus); |
|
2123 |
|
2124 // Dial an international number that answers |
|
2125 DEBUG_PRINTF1(_L("Dial a national number that answers.")); |
|
2126 call.Dial(dialStatus, internationalNumber); |
|
2127 ASSERT_EQUALS(WaitForRequestWithTimeOut(dialStatus, ETimeLong), KErrNone, _L("RMobileCall::Dial timed-out")); |
|
2128 ASSERT_EQUALS(dialStatus.Int(), KErrNone, _L("RMobileCall::Dial returned error.")); |
|
2129 |
|
2130 // Check RMobileCall::NotifyMobileCallStatusChange completes with EStatusConnected. |
|
2131 expectedMobileCallStatus = RMobileCall::EStatusConnected; |
|
2132 iCallControlTsyTestHelper.WaitForMobileCallNotifyMobileCallStatusChange(call, notifyCallStatusChangeStatus, mobileCallStatus, expectedMobileCallStatus, expectedStatus); |
|
2133 |
|
2134 // Post notifiers |
|
2135 call.NotifyMobileCallStatusChange(notifyCallStatusChangeStatus, mobileCallStatus); |
|
2136 |
|
2137 // Hang up. |
|
2138 call.HangUp(hangUpStatus); |
|
2139 ASSERT_EQUALS(WaitForRequestWithTimeOut(hangUpStatus, ETimeMedium), KErrNone, _L("RMobileCall::HangUp timed-out")); |
|
2140 ASSERT_EQUALS(hangUpStatus.Int(), KErrNone, _L("RMobileCall::CallHangUp returned an error")); |
|
2141 |
|
2142 // Check RMobileCall::NotifyMobileCallStatusChange completes with EStatusIdle. |
|
2143 expectedMobileCallStatus = RMobileCall::EStatusIdle; |
|
2144 iCallControlTsyTestHelper.WaitForMobileCallNotifyMobileCallStatusChange(call, notifyCallStatusChangeStatus, mobileCallStatus, expectedMobileCallStatus, expectedStatus); |
|
2145 |
|
2146 |
|
2147 // |
|
2148 // TEST END |
|
2149 // |
|
2150 |
|
2151 StartCleanup(); |
|
2152 |
|
2153 DeactivateCallBarringL(phone, password); |
|
2154 |
|
2155 // Pop |
|
2156 // setSSPasswordStatus |
|
2157 // callBarringStatusNotify |
|
2158 // notifyCallStatusChangeStatus |
|
2159 // hangUpStatus |
|
2160 CleanupStack::PopAndDestroy(4, &setSSPasswordStatus); |
|
2161 |
|
2162 return TestStepResult(); |
|
2163 } |
|
2164 |
|
2165 TPtrC CCTSYIntegrationTestCallBarring0006::GetTestStepName() |
|
2166 /** |
|
2167 * @return The test step name. |
|
2168 */ |
|
2169 { |
|
2170 return _L("CCTSYIntegrationTestCallBarring0006"); |
|
2171 } |
|
2172 |
|
2173 |
|
2174 |
|
2175 CCTSYIntegrationTestCallBarring0007::CCTSYIntegrationTestCallBarring0007(CEtelSessionMgr& aEtelSessionMgr) |
|
2176 : CCTSYIntegrationTestCallBarringBase(aEtelSessionMgr) |
|
2177 /** |
|
2178 * Constructor. |
|
2179 */ |
|
2180 { |
|
2181 SetTestStepName(CCTSYIntegrationTestCallBarring0007::GetTestStepName()); |
|
2182 } |
|
2183 |
|
2184 CCTSYIntegrationTestCallBarring0007::~CCTSYIntegrationTestCallBarring0007() |
|
2185 /** |
|
2186 * Destructor. |
|
2187 */ |
|
2188 { |
|
2189 } |
|
2190 |
|
2191 TVerdict CCTSYIntegrationTestCallBarring0007::doTestStepL() |
|
2192 /** |
|
2193 * @SYMTestCaseID BA-CTSY-INT-CBAR-0007 |
|
2194 * @SYMFssID BA/CTSY/CBAR-0007 |
|
2195 * @SYMTestCaseDesc Register and erase call barring for incoming voice calls. |
|
2196 * @SYMTestPriority High |
|
2197 * @SYMTestActions RCall::AnswerIncomingCall, RMobilePhone::NotifyCallBarringStatusChange, RMobilePhone::SetCallBarringStatus, RLine::NotifyIncomingCall, RCall::HangUp |
|
2198 * @SYMTestExpectedResults Pass - Call barring is deactivated for basic service. |
|
2199 * @SYMTestType CIT |
|
2200 * @SYMTestCaseDependencies live/automatic |
|
2201 * |
|
2202 * Reason for test: Verify call barring notifications and incoming calls not received when barring is registered and active. |
|
2203 * |
|
2204 * @return - TVerdict code |
|
2205 */ |
|
2206 { |
|
2207 |
|
2208 // |
|
2209 // SET UP |
|
2210 // |
|
2211 RMobilePhone &phone = iEtelSessionMgr.GetPhoneL(KMainServer, KMainPhone); |
|
2212 |
|
2213 // Ensure RMobilePhone::GetCallServiceCaps returns caps in set of: |
|
2214 // KCapsNotifyCBStatus | KCapsSetCBStatus | KCapsBarAllIncoming |
|
2215 TUint32 callBarCaps; |
|
2216 TInt err; |
|
2217 err = phone.GetCallServiceCaps( callBarCaps ); |
|
2218 CHECK_EQUALS_L(err, KErrNone, _L("RMobilePhone::GetCallServiceCaps returned error")); |
|
2219 CHECK_BITS_SET_L(callBarCaps, (RMobilePhone::KCapsNotifyCBStatus | RMobilePhone::KCapsSetCBStatus | RMobilePhone::KCapsBarAllIncoming), KNoUnwantedBits, _L("RMobilePhone::GetCallServiceCaps returned unexpected bitmap")); |
|
2220 |
|
2221 // Set the call barring password to a known password using RMobilePhone::SetSSPassword |
|
2222 RMobilePhone::TMobilePassword password; |
|
2223 RMobilePhone::TMobilePhonePasswordChangeV2 passwordV2; |
|
2224 RMobilePhone::TMobilePhonePasswordChangeV2Pckg passwordPkg(passwordV2); |
|
2225 CheckCBPasswordL(phone, password); |
|
2226 passwordV2.iOldPassword = password; |
|
2227 passwordV2.iNewPassword = KAltPassword2; |
|
2228 passwordV2.iVerifiedPassword = KAltPassword2; |
|
2229 TExtEtelRequestStatus setSSPasswordStatus(phone, EMobilePhoneSetSSPassword); |
|
2230 CleanupStack::PushL(setSSPasswordStatus); |
|
2231 phone.SetSSPassword(setSSPasswordStatus, passwordPkg, KSsCallBarringAllServices); |
|
2232 CHECK_EQUALS_L(WaitForRequestWithTimeOut( setSSPasswordStatus, ETimeMedium), KErrNone, _L("RMobilePhone::SetSSPassword timed out")); |
|
2233 CHECK_EQUALS_L(setSSPasswordStatus.Int(), KErrNone, _L("RMobilePhone::SetSSPassword returned error")); |
|
2234 |
|
2235 // Succeeded in changing the password, restoring original password |
|
2236 passwordV2.iOldPassword = KAltPassword2; |
|
2237 passwordV2.iNewPassword = password; |
|
2238 passwordV2.iVerifiedPassword = password; |
|
2239 phone.SetSSPassword(setSSPasswordStatus, passwordPkg, KSsCallBarringAllServices); |
|
2240 CHECK_EQUALS_L(WaitForRequestWithTimeOut( setSSPasswordStatus, ETimeMedium), KErrNone, _L("RMobilePhone::SetSSPassword timed out")); |
|
2241 CHECK_EQUALS_L(setSSPasswordStatus.Int(), KErrNone, _L("RMobilePhone::SetSSPassword returned error")); |
|
2242 |
|
2243 // Get voice line 1. |
|
2244 RMobileLine& line = iEtelSessionMgr.GetLineL(KMainServer, KMainPhone, KVoiceLine); |
|
2245 |
|
2246 // Get call 1. |
|
2247 RMobileCall& call = iEtelSessionMgr.GetCallL(KMainServer, KMainPhone, KVoiceLine, KCall1); |
|
2248 |
|
2249 // |
|
2250 // SET UP END |
|
2251 // |
|
2252 |
|
2253 StartTest(); |
|
2254 |
|
2255 // |
|
2256 // TEST START |
|
2257 // |
|
2258 |
|
2259 |
|
2260 // === Register call barring on incoming voice calls and check incoming call is not received === |
|
2261 |
|
2262 // Post notifier |
|
2263 TExtEtelRequestStatus callBarringStatusNotify(phone, EMobilePhoneNotifyCallBarringStatusChange); |
|
2264 CleanupStack::PushL(callBarringStatusNotify); |
|
2265 RMobilePhone::TMobilePhoneCBCondition callBarringStatus; |
|
2266 phone.NotifyCallBarringStatusChange(callBarringStatusNotify, callBarringStatus); |
|
2267 |
|
2268 // Register call barring using RMobilePhone::SetCallBarringStatus with aInfo.iAction=EServiceActionRegister, aInfo.iPassword=correct call barring password, aInfo.iServiceGroup=EVoiceService and aCondition=EBarAllIncoming |
|
2269 RMobilePhone::TMobilePhoneCBChangeV1 callBarringInfo; |
|
2270 RMobilePhone::TMobilePhoneCBCondition callBarringCondition; |
|
2271 callBarringCondition = RMobilePhone::EBarAllIncoming; |
|
2272 callBarringInfo.iAction = RMobilePhone::EServiceActionRegister; |
|
2273 callBarringInfo.iPassword = password; |
|
2274 callBarringInfo.iServiceGroup = RMobilePhone::EVoiceService; |
|
2275 err = SetCBStatusL(phone, callBarringInfo, callBarringCondition); |
|
2276 ASSERT_EQUALS(err, KErrNone, _L("RMobilePhone::SetCallBarringStatus returned error")); |
|
2277 |
|
2278 //$CTSYProblem: SetCallBarringStatus returned error -4419 KErrGsmSSDataMissing |
|
2279 TEST_CHECK_POINT_L(_L("Couldn't set call barring status, no point continuing.")); |
|
2280 |
|
2281 // Check RMobilePhone::NotifyCallBarringStatusChange completes with aCondition=EBarAllIncoming |
|
2282 //$CTSYProblem: SetCallBarringStatus because support for EBarAllIncoming is only legal for deactivation and erasure |
|
2283 ASSERT_EQUALS(WaitForRequestWithTimeOut(callBarringStatusNotify, ETimeMedium), KErrNone, _L("RMobilePhone::NotifyCallBarringStatusChange timed out")); |
|
2284 ASSERT_EQUALS(callBarringStatusNotify.Int(), KErrNone, _L("RMobilePhone::NotifyCallBarringStatusChange returned an error")); |
|
2285 ASSERT_EQUALS(callBarringStatus, RMobilePhone::EBarAllIncoming, _L("RMobilePhone::NotifyCallBarringStatusChange condition was not EBarAllIncoming as expected")); |
|
2286 |
|
2287 // Request incoming call from RPS. |
|
2288 err = RPSRequestIncomingCallL(EVoiceLine); |
|
2289 |
|
2290 // Check RPS dialling fails. |
|
2291 ASSERT_TRUE(err != KErrNone, _L("RPSRequestIncomingCallL() returned KErrNone even though call barring was set")); |
|
2292 |
|
2293 // === Erase call barring on incoming voice calls and check incoming call is received === |
|
2294 |
|
2295 // Post notifier |
|
2296 phone.NotifyCallBarringStatusChange(callBarringStatusNotify, callBarringStatus); |
|
2297 |
|
2298 // Erase call barring using RMobilePhone::SetCallBarringStatus with aInfo.iAction=EServiceActionErase, aInfo.iPassword=correct call barring password, aInfo.iServiceGroup=EVoiceService and aCondition=EBarAllIncoming |
|
2299 callBarringCondition = RMobilePhone::EBarAllIncoming; |
|
2300 callBarringInfo.iAction = RMobilePhone::EServiceActionErase; |
|
2301 callBarringInfo.iPassword = password; |
|
2302 callBarringInfo.iServiceGroup = RMobilePhone::EVoiceService; |
|
2303 err = SetCBStatusL(phone, callBarringInfo, callBarringCondition); |
|
2304 //$CTSYProblem: SetCallBarringStatus returned error -4400 KErrGsmSSIllegalOperation |
|
2305 ASSERT_EQUALS(err, KErrNone, _L("RMobilePhone::SetCallBarringStatus returned error")); |
|
2306 |
|
2307 // Check RMobilePhone::NotifyCallBarringStatusChange completes with aCondition=EBarAllIncoming |
|
2308 ASSERT_EQUALS(WaitForRequestWithTimeOut(callBarringStatusNotify, ETimeMedium), KErrNone, _L("RMobilePhone::NotifyCallBarringStatusChange timed out")); |
|
2309 ASSERT_EQUALS(callBarringStatusNotify.Int(), KErrNone, _L("RMobilePhone::NotifyCallBarringStatusChange returned an error")); |
|
2310 ASSERT_EQUALS(callBarringStatus, RMobilePhone::EBarAllIncoming, _L("RMobilePhone::NotifyCallBarringStatusChange condition was not EBarAllIncoming as expected")); |
|
2311 |
|
2312 // Post notification RLine::NotifyIncomingCall (for RPS) |
|
2313 TCoreEtelRequestStatus<RLine> notifyIncomingCallStatus(line, &RLine::NotifyIncomingCallCancel); |
|
2314 CleanupStack::PushL(notifyIncomingCallStatus); |
|
2315 TName incomingCallName; |
|
2316 incomingCallName.Zero(); |
|
2317 line.NotifyIncomingCall(notifyIncomingCallStatus, incomingCallName); |
|
2318 |
|
2319 // Post notification |
|
2320 TExtEtelRequestStatus notifyMobileCallStatusChangeStatus(call, EMobileCallNotifyMobileCallStatusChange); |
|
2321 CleanupStack::PushL(notifyMobileCallStatusChangeStatus); |
|
2322 RMobileCall::TMobileCallStatus mobileCallStatus; |
|
2323 call.NotifyMobileCallStatusChange(notifyMobileCallStatusChangeStatus, mobileCallStatus); |
|
2324 |
|
2325 // Request an incoming call from RPS. |
|
2326 ASSERT_EQUALS(RPSRequestIncomingCallL(EVoiceLine), KErrNone, _L("CCTSYIntegrationTestSuiteStepBase::RPSRequestIncomingCallL returned an error")); |
|
2327 |
|
2328 // Check RLine::NotifyIncomingCall completes. |
|
2329 ASSERT_EQUALS(WaitForRequestWithTimeOut(notifyIncomingCallStatus, ETimeMedium), KErrNone, _L("RLine::NotifyIncomingCall did not complete without error")); |
|
2330 ASSERT_EQUALS(notifyIncomingCallStatus.Int(), KErrNone, _L( "RLine::NotifyIncomingCall returned with an error")); |
|
2331 ASSERT_TRUE(incomingCallName.Length() > 0, _L("RLine::NotifyIncomingCall completed with invalid call name")); |
|
2332 |
|
2333 // Get the incoming call |
|
2334 TCallId incomingCallId; |
|
2335 call = iEtelSessionMgr.GetIncomingCallL(KMainServer, KMainPhone, KVoiceLine, incomingCallName, incomingCallId); |
|
2336 |
|
2337 // Answer the incoming call with RCall::AnswerIncomingCall |
|
2338 TCoreEtelRequestStatus<RCall> answerIncomingStatus(call, &RCall::AnswerIncomingCallCancel); |
|
2339 CleanupStack::PushL(answerIncomingStatus); |
|
2340 call.AnswerIncomingCall(answerIncomingStatus); |
|
2341 ASSERT_EQUALS(WaitForRequestWithTimeOut(answerIncomingStatus, ETimeMedium), KErrNone, _L("RMobileCall::AnswerIncomingCall timed-out")); |
|
2342 ASSERT_EQUALS(answerIncomingStatus.Int(), KErrNone, _L("RMobileCall::AnswerIncomingCall returned with an error")); |
|
2343 |
|
2344 // RMobileCall::NotifyMobileCallStatusChange completes with EStatusConnected. |
|
2345 RMobileCall::TMobileCallStatus expectedMobileCallStatus = RMobileCall::EStatusConnected; |
|
2346 const TInt expectedStatus = KErrNone; |
|
2347 iCallControlTsyTestHelper.WaitForMobileCallNotifyMobileCallStatusChange(call, notifyMobileCallStatusChangeStatus, mobileCallStatus, expectedMobileCallStatus, expectedStatus); |
|
2348 |
|
2349 // Post notification |
|
2350 call.NotifyMobileCallStatusChange(notifyMobileCallStatusChangeStatus, mobileCallStatus); |
|
2351 |
|
2352 // Hang up. |
|
2353 TCoreEtelRequestStatus<RMobileCall> hangUpStatus (call,&RMobileCall::HangUpCancel); |
|
2354 CleanupStack::PushL(hangUpStatus); |
|
2355 call.HangUp(hangUpStatus); |
|
2356 ASSERT_EQUALS(WaitForRequestWithTimeOut(hangUpStatus, ETimeMedium), KErrNone, _L("RMobileCall::HangUp timed-out")); |
|
2357 ASSERT_EQUALS(hangUpStatus.Int(), KErrNone, _L("RMobileCall::CallHangUp returned an error")); |
|
2358 |
|
2359 // Check RMobileCall::NotifyMobileCallStatusChange completes with EStatusIdle. |
|
2360 expectedMobileCallStatus = RMobileCall::EStatusIdle; |
|
2361 iCallControlTsyTestHelper.WaitForMobileCallNotifyMobileCallStatusChange(call, notifyMobileCallStatusChangeStatus, mobileCallStatus, expectedMobileCallStatus, expectedStatus); |
|
2362 |
|
2363 // |
|
2364 // TEST END |
|
2365 // |
|
2366 |
|
2367 StartCleanup(); |
|
2368 |
|
2369 DeactivateCallBarringL(phone, password); |
|
2370 |
|
2371 // pop |
|
2372 // setSSPasswordStatus |
|
2373 // callBarringStatusNotify |
|
2374 // notifyIncomingCallStatus |
|
2375 // notifyMobileCallStatusChangeStatus |
|
2376 // hangUpStatus |
|
2377 CleanupStack::PopAndDestroy(5, &setSSPasswordStatus); |
|
2378 |
|
2379 return TestStepResult(); |
|
2380 } |
|
2381 |
|
2382 TPtrC CCTSYIntegrationTestCallBarring0007::GetTestStepName() |
|
2383 /** |
|
2384 * @return The test step name. |
|
2385 */ |
|
2386 { |
|
2387 return _L("CCTSYIntegrationTestCallBarring0007"); |
|
2388 } |
|
2389 |
|
2390 |
|
2391 |
|
2392 CCTSYIntegrationTestCallBarring0008::CCTSYIntegrationTestCallBarring0008(CEtelSessionMgr& aEtelSessionMgr) |
|
2393 : CCTSYIntegrationTestCallBarringBase(aEtelSessionMgr) |
|
2394 /** |
|
2395 * Constructor. |
|
2396 */ |
|
2397 { |
|
2398 SetTestStepName(CCTSYIntegrationTestCallBarring0008::GetTestStepName()); |
|
2399 } |
|
2400 |
|
2401 CCTSYIntegrationTestCallBarring0008::~CCTSYIntegrationTestCallBarring0008() |
|
2402 /** |
|
2403 * Destructor. |
|
2404 */ |
|
2405 { |
|
2406 } |
|
2407 |
|
2408 TVerdict CCTSYIntegrationTestCallBarring0008::doTestStepL() |
|
2409 /** |
|
2410 * @SYMTestCaseID BA-CTSY-INT-CBAR-0008 |
|
2411 * @SYMFssID BA/CTSY/CBAR-0008 |
|
2412 * @SYMTestCaseDesc Set call barring status to unsupported actions. |
|
2413 * @SYMTestPriority High |
|
2414 * @SYMTestActions |
|
2415 * @SYMTestExpectedResults Pass - Retrieve KErrArgument for unsupported actions. |
|
2416 * @SYMTestType CIT |
|
2417 * @SYMTestCaseDependencies live/automatic |
|
2418 * |
|
2419 * Reason for test: Verify KErrArgument is returned. |
|
2420 * |
|
2421 * @return - TVerdict code |
|
2422 */ |
|
2423 { |
|
2424 |
|
2425 // |
|
2426 // SET UP |
|
2427 // |
|
2428 RMobilePhone &phone = iEtelSessionMgr.GetPhoneL(KMainServer, KMainPhone); |
|
2429 |
|
2430 // Ensure RMobilePhone::GetCallServiceCaps returns caps in set of KCapsSetCBStatus |
|
2431 TUint32 callBarCaps; |
|
2432 TInt err = phone.GetCallServiceCaps( callBarCaps ); |
|
2433 CHECK_EQUALS_L(err, KErrNone, _L("RMobilePhone::GetCallServiceCaps returned error")); |
|
2434 CHECK_BITS_SET_L(callBarCaps, RMobilePhone::KCapsSetCBStatus, KNoUnwantedBits, _L("RMobilePhone::GetCallServiceCaps returned wrong caps")); |
|
2435 |
|
2436 // Set the call barring password to a known password using RMobilePhone::SetSSPassword |
|
2437 RMobilePhone::TMobilePassword password; |
|
2438 RMobilePhone::TMobilePhonePasswordChangeV2 passwordV2; |
|
2439 RMobilePhone::TMobilePhonePasswordChangeV2Pckg passwordPkg(passwordV2); |
|
2440 CheckCBPasswordL(phone, password); |
|
2441 passwordV2.iOldPassword = password; |
|
2442 passwordV2.iNewPassword = KAltPassword2; |
|
2443 passwordV2.iVerifiedPassword = KAltPassword2; |
|
2444 TExtEtelRequestStatus setSSPasswordStatus(phone, EMobilePhoneSetSSPassword); |
|
2445 CleanupStack::PushL(setSSPasswordStatus); |
|
2446 phone.SetSSPassword(setSSPasswordStatus, passwordPkg, KSsCallBarringAllServices); |
|
2447 CHECK_EQUALS_L(WaitForRequestWithTimeOut( setSSPasswordStatus, ETimeMedium), KErrNone, _L("RMobilePhone::SetSSPassword timed out")); |
|
2448 CHECK_EQUALS_L(setSSPasswordStatus.Int(), KErrNone, _L("RMobilePhone::SetSSPassword returned error")); |
|
2449 |
|
2450 // Succeeded in changing the password, restoring original password |
|
2451 passwordV2.iOldPassword = KAltPassword2; |
|
2452 passwordV2.iNewPassword = password; |
|
2453 passwordV2.iVerifiedPassword = password; |
|
2454 phone.SetSSPassword(setSSPasswordStatus, passwordPkg, KSsCallBarringAllServices); |
|
2455 CHECK_EQUALS_L(WaitForRequestWithTimeOut( setSSPasswordStatus, ETimeMedium), KErrNone, _L("RMobilePhone::SetSSPassword timed out")); |
|
2456 CHECK_EQUALS_L(setSSPasswordStatus.Int(), KErrNone, _L("RMobilePhone::SetSSPassword returned error")); |
|
2457 |
|
2458 // |
|
2459 // SET UP END |
|
2460 // |
|
2461 |
|
2462 StartTest(); |
|
2463 |
|
2464 // |
|
2465 // TEST START |
|
2466 // |
|
2467 |
|
2468 // === Set call barring status with EServiceActionUnspecified === |
|
2469 |
|
2470 // Set call barring status using RMobilePhone::SetCallBarringStatus with aInfo.iAction=EServiceActionUnspecified, aInfo.iPassword=correct call barring password, aInfo.iServiceGroup=EVoiceService and aCondition=EBarAllOutgoing |
|
2471 RMobilePhone::TMobilePhoneCBChangeV1 callBarringInfo; |
|
2472 RMobilePhone::TMobilePhoneCBCondition callBarringCondition; |
|
2473 callBarringCondition = RMobilePhone::EBarAllOutgoing; |
|
2474 callBarringInfo.iAction = RMobilePhone::EServiceActionUnspecified; |
|
2475 callBarringInfo.iPassword = password; |
|
2476 callBarringInfo.iServiceGroup = RMobilePhone::EVoiceService; |
|
2477 err = SetCBStatusL(phone, callBarringInfo, callBarringCondition); |
|
2478 |
|
2479 // Check KErrArgument is returned |
|
2480 ASSERT_EQUALS(err, KErrArgument, _L("RMobilePhone::SetCallBarringStatus did not return KErrArgument")); |
|
2481 |
|
2482 // === Set call barring status with EServiceActionInvoke === |
|
2483 |
|
2484 // Set call barring status using RMobilePhone::SetCallBarringStatus with aInfo.iAction=EServiceActionInvoke, aInfo.iPassword=incorrect call barring password, aInfo.iServiceGroup=EVoiceService and aCondition=EBarAllOutgoing |
|
2485 callBarringCondition = RMobilePhone::EBarAllOutgoing; |
|
2486 callBarringInfo.iAction = RMobilePhone::EServiceActionInvoke; |
|
2487 callBarringInfo.iPassword = password; |
|
2488 callBarringInfo.iServiceGroup = RMobilePhone::EVoiceService; |
|
2489 err = SetCBStatusL(phone, callBarringInfo, callBarringCondition); |
|
2490 |
|
2491 // Check KErrArgument is returned |
|
2492 ASSERT_EQUALS(err, KErrArgument, _L("RMobilePhone::SetCallBarringStatus did not return KErrArgument")); |
|
2493 |
|
2494 // |
|
2495 // TEST END |
|
2496 // |
|
2497 |
|
2498 StartCleanup(); |
|
2499 |
|
2500 DeactivateCallBarringL(phone, password); |
|
2501 |
|
2502 // pop |
|
2503 // setSSPasswordStatus |
|
2504 CleanupStack::PopAndDestroy(1, &setSSPasswordStatus); |
|
2505 |
|
2506 return TestStepResult(); |
|
2507 } |
|
2508 |
|
2509 TPtrC CCTSYIntegrationTestCallBarring0008::GetTestStepName() |
|
2510 /** |
|
2511 * @return The test step name. |
|
2512 */ |
|
2513 { |
|
2514 return _L("CCTSYIntegrationTestCallBarring0008"); |
|
2515 } |
|
2516 |
|
2517 |
|
2518 |
|
2519 CCTSYIntegrationTestCallBarring0009::CCTSYIntegrationTestCallBarring0009(CEtelSessionMgr& aEtelSessionMgr) |
|
2520 : CCTSYIntegrationTestCallBarringBase(aEtelSessionMgr) |
|
2521 /** |
|
2522 * Constructor. |
|
2523 */ |
|
2524 { |
|
2525 SetTestStepName(CCTSYIntegrationTestCallBarring0009::GetTestStepName()); |
|
2526 } |
|
2527 |
|
2528 CCTSYIntegrationTestCallBarring0009::~CCTSYIntegrationTestCallBarring0009() |
|
2529 /** |
|
2530 * Destructor. |
|
2531 */ |
|
2532 { |
|
2533 } |
|
2534 |
|
2535 TVerdict CCTSYIntegrationTestCallBarring0009::doTestStepL() |
|
2536 /** |
|
2537 * @SYMTestCaseID BA-CTSY-INT-CBAR-0009 |
|
2538 * @SYMFssID BA/CTSY/CBAR-0009 |
|
2539 * @SYMTestCaseDesc Retrieve call barring status. |
|
2540 * @SYMTestPriority High |
|
2541 * @SYMTestActions RMobilePhone::SetCallBarringStatus, CRetrieveMobilePhoneCBList::RetrieveListL |
|
2542 * @SYMTestExpectedResults Pass - Correct status of call barring returned. |
|
2543 * @SYMTestType CIT |
|
2544 * @SYMTestCaseDependencies live/automatic |
|
2545 * |
|
2546 * Reason for test: Verify call barring status can be retrieved and is correct. |
|
2547 * |
|
2548 * @return - TVerdict code |
|
2549 */ |
|
2550 { |
|
2551 |
|
2552 // |
|
2553 // SET UP |
|
2554 // |
|
2555 RMobilePhone& phone = iEtelSessionMgr.GetPhoneL(KMainServer, KMainPhone); |
|
2556 RMobilePhone::TMobilePassword password; |
|
2557 CheckCBPasswordL(phone, password); |
|
2558 |
|
2559 // Ensure RMobilePhone::GetCallServiceCaps returns caps in set of: KCapsBarAllIncoming | KCapsBarIncomingRoaming | KCapsBarAllOutgoing | KCapsBarOutgoingInternational | KCapsBarOutgoingInternationalExHC | KCapsBarAllCases | KCapsSetCBStatus | KCapsGetCBStatusNetwork |
|
2560 TUint32 callBarCaps; |
|
2561 TInt err = phone.GetCallServiceCaps( callBarCaps ); |
|
2562 CHECK_EQUALS_L(err, KErrNone, _L("RMobilePhone::GetCallServiceCaps returned error")); |
|
2563 CHECK_BITS_SET_L( callBarCaps, |
|
2564 (RMobilePhone::KCapsBarAllIncoming | |
|
2565 RMobilePhone::KCapsBarIncomingRoaming | |
|
2566 RMobilePhone::KCapsBarAllOutgoing | |
|
2567 RMobilePhone::KCapsBarOutgoingInternational | |
|
2568 RMobilePhone::KCapsBarOutgoingInternationalExHC | |
|
2569 RMobilePhone::KCapsBarAllCases | |
|
2570 RMobilePhone::KCapsSetCBStatus | |
|
2571 RMobilePhone::KCapsGetCBStatusNetwork), |
|
2572 KNoUnwantedBits, |
|
2573 _L("RMobilePhone::GetCallServiceCaps returned unexpected caps")); |
|
2574 |
|
2575 |
|
2576 // Set the call barring password to a known password using RMobilePhone::SetSSPassword |
|
2577 RMobilePhone::TMobilePhonePasswordChangeV2 passwordV2; |
|
2578 RMobilePhone::TMobilePhonePasswordChangeV2Pckg passwordPkg(passwordV2); |
|
2579 |
|
2580 // For safety we are going to change the password and then immediately change it back |
|
2581 passwordV2.iOldPassword = password; |
|
2582 passwordV2.iNewPassword = KAltPassword; |
|
2583 passwordV2.iVerifiedPassword = KAltPassword; |
|
2584 |
|
2585 TExtEtelRequestStatus reqSetSSPasswordStatus(phone, EMobilePhoneSetSSPassword); |
|
2586 CleanupStack::PushL(reqSetSSPasswordStatus); |
|
2587 phone.SetSSPassword(reqSetSSPasswordStatus, passwordPkg, KSsCallBarringAllServices ); |
|
2588 CHECK_EQUALS_L( WaitForRequestWithTimeOut( reqSetSSPasswordStatus, ETimeMedium), KErrNone, |
|
2589 _L("RMobilePhone::SetSSPassword timed out") ); |
|
2590 CHECK_EQUALS_L( reqSetSSPasswordStatus.Int(), KErrNone, _L("RMobilePhone::SetSSPassword returned error")); |
|
2591 |
|
2592 // Succeeded in changing the password, reset |
|
2593 passwordV2.iOldPassword = KAltPassword; |
|
2594 passwordV2.iNewPassword = password; |
|
2595 passwordV2.iVerifiedPassword = password; |
|
2596 |
|
2597 phone.SetSSPassword(reqSetSSPasswordStatus, passwordPkg, KSsCallBarringAllServices ); |
|
2598 CHECK_EQUALS_L( WaitForRequestWithTimeOut( reqSetSSPasswordStatus, ETimeMedium), KErrNone, |
|
2599 _L("RMobilePhone::SetSSPassword timed out") ); |
|
2600 CHECK_EQUALS_L( reqSetSSPasswordStatus.Int(), KErrNone, _L("RMobilePhone::SetSSPassword returned error")); |
|
2601 |
|
2602 // |
|
2603 // SET UP END |
|
2604 // |
|
2605 |
|
2606 StartTest(); |
|
2607 |
|
2608 // |
|
2609 // TEST START |
|
2610 // |
|
2611 |
|
2612 // Repeat whole test replacing the EBarAllOutgoing condition in |
|
2613 // aCondition and in TMobilePhoneCBInfoEntryV1::iCondition with |
|
2614 // EBarAllIncoming, EBarIncomingRoaming, EBarAllOutgoing, EBarOutgoingInternational, |
|
2615 // EBarOutgoingInternationalExHC |
|
2616 |
|
2617 TestActivateAndDeactivateCallBarringL( phone, password, RMobilePhone::EBarAllOutgoing ); |
|
2618 TestActivateAndDeactivateCallBarringL( phone, password, RMobilePhone::EBarAllIncoming ); |
|
2619 TestActivateAndDeactivateCallBarringL( phone, password, RMobilePhone::EBarIncomingRoaming ); |
|
2620 TestActivateAndDeactivateCallBarringL( phone, password, RMobilePhone::EBarOutgoingInternational ); |
|
2621 TestActivateAndDeactivateCallBarringL( phone, password, RMobilePhone::EBarOutgoingInternationalExHC ); |
|
2622 |
|
2623 |
|
2624 // |
|
2625 // TEST END |
|
2626 // |
|
2627 |
|
2628 StartCleanup(); |
|
2629 |
|
2630 // turn off any CB we may have left active |
|
2631 err = DeactivateCallBarringL( phone, password ); |
|
2632 ASSERT_EQUALS( err, KErrNone, _L("RMobilePhone::SetCallBarringStatus returned error")); |
|
2633 |
|
2634 CleanupStack::PopAndDestroy(1, &reqSetSSPasswordStatus ); |
|
2635 |
|
2636 return TestStepResult(); |
|
2637 } |
|
2638 |
|
2639 |
|
2640 /** |
|
2641 * This wraps the repeating part of the test |
|
2642 */ |
|
2643 void CCTSYIntegrationTestCallBarring0009::TestActivateAndDeactivateCallBarringL( RMobilePhone &aPhone, |
|
2644 const RMobilePhone::TMobilePassword& aPassword, |
|
2645 RMobilePhone::TMobilePhoneCBCondition aCondition ) |
|
2646 { |
|
2647 DEBUG_PRINTF2( _L("Executing test CallBarring0009 with condition %d"), aCondition ); |
|
2648 |
|
2649 // === Activate call barring for telephony service === |
|
2650 RMobilePhone::TMobilePhoneCBChangeV1 cbInfo; |
|
2651 cbInfo.iPassword = aPassword; |
|
2652 |
|
2653 // Activate call barring using RMobilePhone::SetCallBarringStatus with |
|
2654 // aInfo.iAction=EServiceActionActivate, |
|
2655 // aInfo.iPassword=correct call barring password, |
|
2656 // aInfo.iServiceGroup=ETelephony |
|
2657 cbInfo.iAction = RMobilePhone::EServiceActionActivate; |
|
2658 cbInfo.iServiceGroup = RMobilePhone::ETelephony; |
|
2659 |
|
2660 TInt err = SetCBStatusL( aPhone, cbInfo, aCondition); |
|
2661 ASSERT_EQUALS( err, KErrNone, _L("RMobilePhone::SetCallBarringStatus returned error")); |
|
2662 |
|
2663 // === Activate call barring for short message service === |
|
2664 |
|
2665 // Activate call barring using RMobilePhone::SetCallBarringStatus with |
|
2666 // aInfo.iAction=EServiceActionActivate, |
|
2667 // aInfo.iPassword=correct call barring password, |
|
2668 // aInfo.iServiceGroup=EShortMessageService |
|
2669 |
|
2670 cbInfo.iAction = RMobilePhone::EServiceActionActivate; |
|
2671 cbInfo.iServiceGroup = RMobilePhone::EShortMessageService; |
|
2672 |
|
2673 err = SetCBStatusL( aPhone, cbInfo, aCondition); |
|
2674 ASSERT_EQUALS( err, KErrNone, _L("SetCallBarringStatus returned error")); |
|
2675 |
|
2676 // === Activate call barring for fax service === |
|
2677 |
|
2678 // Register call barring using RMobilePhone::SetCallBarringStatus with |
|
2679 // aInfo.iAction=EServiceActionActivate, |
|
2680 // aInfo.iPassword=correct call barring password, |
|
2681 // aInfo.iServiceGroup=EFaxService |
|
2682 |
|
2683 cbInfo.iAction = RMobilePhone::EServiceActionActivate; |
|
2684 cbInfo.iServiceGroup = RMobilePhone::EFaxService ; |
|
2685 err = SetCBStatusL( aPhone, cbInfo, aCondition); |
|
2686 ASSERT_EQUALS( err, KErrNone, _L("RMobilePhone::SetCallBarringStatus returned error")); |
|
2687 |
|
2688 // === Deactivate call barring for async data === |
|
2689 |
|
2690 // Deactivate call barring using RMobilePhone::SetCallBarringStatus with |
|
2691 // aInfo.iAction=EServiceActionDeactivate, |
|
2692 // aInfo.iPassword=correct call barring password, |
|
2693 // aInfo.iServiceGroup=EAsyncData |
|
2694 cbInfo.iAction = RMobilePhone::EServiceActionDeactivate; |
|
2695 cbInfo.iServiceGroup = RMobilePhone::EAsyncData; |
|
2696 |
|
2697 err = SetCBStatusL( aPhone, cbInfo, aCondition); |
|
2698 ASSERT_EQUALS( err, KErrNone, _L("RMobilePhone::SetCallBarringStatus returned error")); |
|
2699 |
|
2700 // === Deactivate call barring for circuit data service === |
|
2701 |
|
2702 // Deactivate call barring using RMobilePhone::SetCallBarringStatus with |
|
2703 // aInfo.iAction=EServiceActionDeactivate, |
|
2704 // aInfo.iPassword=correct call barring password, |
|
2705 // aInfo.iServiceGroup=ECircuitDataService |
|
2706 cbInfo.iAction = RMobilePhone::EServiceActionDeactivate; |
|
2707 cbInfo.iServiceGroup = RMobilePhone::ECircuitDataService; |
|
2708 |
|
2709 err = SetCBStatusL( aPhone, cbInfo, aCondition); |
|
2710 ASSERT_EQUALS( err, KErrNone, _L("RMobilePhone::SetCallBarringStatus returned error")); |
|
2711 |
|
2712 // === Deactivate call barring AllPlmnBearer service === |
|
2713 |
|
2714 // Deactivate call barring using RMobilePhone::SetCallBarringStatus with |
|
2715 // aInfo.iAction=EServiceActionDeactivate, |
|
2716 // aInfo.iPassword=correct call barring password, |
|
2717 // aInfo.iServiceGroup=EAllPlmnBearer |
|
2718 |
|
2719 cbInfo.iAction = RMobilePhone::EServiceActionDeactivate; |
|
2720 cbInfo.iServiceGroup = RMobilePhone::EAllPlmnBearer; |
|
2721 |
|
2722 err = SetCBStatusL( aPhone, cbInfo, aCondition); |
|
2723 ASSERT_EQUALS( err, KErrNone, _L("RMobilePhone::SetCallBarringStatus returned error")); |
|
2724 |
|
2725 // === Retrieve call barring === |
|
2726 |
|
2727 // Use the helper class for CRetrieveMobilePhoneCBList to retrieve the call barring status list |
|
2728 // with aCondition=EBarAllOutgoing and aLocation=RMobilePhone::EInfoLocationCachePreferred |
|
2729 |
|
2730 CRetrieveMobilePhoneCBListExec *cbStatusListHelper |
|
2731 = CRetrieveMobilePhoneCBListHelper::NewL(aPhone, aCondition, RMobilePhone::EInfoLocationCachePreferred ); |
|
2732 CleanupStack::PushL( cbStatusListHelper ); |
|
2733 |
|
2734 CMobilePhoneCBList* cbStatusList = cbStatusListHelper->DoGetList(err); |
|
2735 ASSERT_EQUALS(err, KErrNone, _L("CRetrieveMobilePhoneCBList::Start failed to get the list")); |
|
2736 |
|
2737 // Check that CMobilePhoneCBList list returned contains the following entries (not necessarily in this order): |
|
2738 |
|
2739 // TMobilePhoneCBInfoEntryV1::iServiceGroup = ETelephony |
|
2740 // TMobilePhoneCBInfoEntryV1::iStatus = ECallBarringStatusActive |
|
2741 |
|
2742 ASSERT_TRUE( SearchCBStatusListL( cbStatusList, aCondition, |
|
2743 RMobilePhone::ETelephony, |
|
2744 RMobilePhone::ECallBarringStatusActive ), |
|
2745 _L("Failed to find entry in Call Barring status list") ); |
|
2746 |
|
2747 // TMobilePhoneCBInfoEntryV1::iServiceGroup = EShortMessageService |
|
2748 // TMobilePhoneCBInfoEntryV1::iStatus = ECallBarringStatusActive |
|
2749 |
|
2750 ASSERT_TRUE( SearchCBStatusListL( cbStatusList, aCondition, |
|
2751 RMobilePhone::EShortMessageService, |
|
2752 RMobilePhone::ECallBarringStatusActive ), |
|
2753 _L("Failed to find entry in Call Barring status list") ); |
|
2754 |
|
2755 //TMobilePhoneCBInfoEntryV1::iServiceGroup = EFaxService |
|
2756 //TMobilePhoneCBInfoEntryV1::iStatus = RMobilePhone::ECallBarringStatusActive |
|
2757 |
|
2758 ASSERT_TRUE( SearchCBStatusListL( cbStatusList, aCondition, |
|
2759 RMobilePhone::EFaxService, |
|
2760 RMobilePhone::ECallBarringStatusActive ), |
|
2761 _L("Failed to find entry in Call Barring status list") ); |
|
2762 |
|
2763 // cbStatusListHelper |
|
2764 CleanupStack::PopAndDestroy(1,cbStatusListHelper); |
|
2765 } |
|
2766 |
|
2767 |
|
2768 TPtrC CCTSYIntegrationTestCallBarring0009::GetTestStepName() |
|
2769 /** |
|
2770 * @return The test step name. |
|
2771 */ |
|
2772 { |
|
2773 return _L("CCTSYIntegrationTestCallBarring0009"); |
|
2774 } |
|
2775 |
|
2776 |
|
2777 |
|
2778 CCTSYIntegrationTestCallBarring0010::CCTSYIntegrationTestCallBarring0010(CEtelSessionMgr& aEtelSessionMgr) |
|
2779 : CCTSYIntegrationTestCallBarringBase(aEtelSessionMgr) |
|
2780 /** |
|
2781 * Constructor. |
|
2782 */ |
|
2783 { |
|
2784 SetTestStepName(CCTSYIntegrationTestCallBarring0010::GetTestStepName()); |
|
2785 } |
|
2786 |
|
2787 CCTSYIntegrationTestCallBarring0010::~CCTSYIntegrationTestCallBarring0010() |
|
2788 /** |
|
2789 * Destructor. |
|
2790 */ |
|
2791 { |
|
2792 } |
|
2793 |
|
2794 TVerdict CCTSYIntegrationTestCallBarring0010::doTestStepL() |
|
2795 /** |
|
2796 * @SYMTestCaseID BA-CTSY-INT-CBAR-0010 |
|
2797 * @SYMFssID BA/CTSY/CBAR-0010 |
|
2798 * @SYMTestCaseDesc Deactivate and erase call barring for all cases. |
|
2799 * @SYMTestPriority High |
|
2800 * @SYMTestActions RCall::Dial, RLine::NotifyStatusChange, CRetrieveMobilePhoneCBList::RetrieveListL, RMobilePhone::NotifyCallBarringStatusChange |
|
2801 * @SYMTestExpectedResults Pass - Call barring is deactivated for all services. |
|
2802 * @SYMTestType CIT |
|
2803 * @SYMTestCaseDependencies live/automatic |
|
2804 * |
|
2805 * Reason for test: Verify call barring notification and retrieve call barring status. |
|
2806 * |
|
2807 * @return - TVerdict code |
|
2808 */ |
|
2809 { |
|
2810 |
|
2811 // |
|
2812 // SET UP |
|
2813 // |
|
2814 |
|
2815 RMobilePhone& phone = iEtelSessionMgr.GetPhoneL(KMainServer, KMainPhone); |
|
2816 RMobilePhone::TMobilePassword password; |
|
2817 CheckCBPasswordL( phone, password ); |
|
2818 |
|
2819 // Ensure RMobilePhone::GetCallServiceCaps returns caps in set of KCapsBarAllCases | KCapsNotifyCBStatus | KCapsSetCBStatus | KCapsGetCBStatusNetwork | KCapsGetCBStatusCache |
|
2820 TUint32 callServiceCaps; |
|
2821 CHECK_EQUALS_L(phone.GetCallServiceCaps( callServiceCaps ), KErrNone, _L("RMobilePhone::GetCallServiceCaps returned other than KErrNone")); |
|
2822 |
|
2823 // $CTSYProblem Capabilities are hardcoded in CTSY KMultimodeTsyGsmCallServiceCaps. KCapsGetCBStatusCache removed for test to proceed. |
|
2824 TUint32 wantedServiceCaps = RMobilePhone::KCapsBarAllCases | |
|
2825 RMobilePhone::KCapsNotifyCBStatus | |
|
2826 RMobilePhone::KCapsSetCBStatus | |
|
2827 RMobilePhone::KCapsGetCBStatusNetwork; |
|
2828 CHECK_BITS_SET_L(callServiceCaps, wantedServiceCaps, KNoUnwantedBits , _L("RMobilePhone::GetCallServiceCaps returned error")); |
|
2829 |
|
2830 // Set the call barring password to a known password using RMobilePhone::SetSSPassword |
|
2831 TExtEtelRequestStatus passwordInfoStatus(phone, EMobilePhoneSetSSPassword); |
|
2832 CleanupStack::PushL(passwordInfoStatus); |
|
2833 RMobilePhone::TMobilePhonePasswordChangeV2 passwordInfo; |
|
2834 passwordInfo.iOldPassword = password; |
|
2835 passwordInfo.iNewPassword = password; |
|
2836 passwordInfo.iVerifiedPassword = password; |
|
2837 RMobilePhone::TMobilePhonePasswordChangeV2Pckg passwordPkg(passwordInfo); |
|
2838 phone.SetSSPassword(passwordInfoStatus, passwordPkg, KSsCallBarringAllServices ); |
|
2839 CHECK_EQUALS_L( WaitForRequestWithTimeOut( passwordInfoStatus, ETimeMedium), KErrNone, _L("RMobilePhone::SetSSPassword timed out") ); |
|
2840 CHECK_EQUALS_L( passwordInfoStatus.Int(), KErrNone, _L("RMobilePhone::SetSSPassword returned an error")); |
|
2841 |
|
2842 // |
|
2843 // SET UP END |
|
2844 // |
|
2845 |
|
2846 StartTest(); |
|
2847 |
|
2848 // |
|
2849 // TEST START |
|
2850 // |
|
2851 |
|
2852 // === Activate some call barring services === |
|
2853 |
|
2854 // Activate call barring using RMobilePhone::SetCallBarringStatus with aInfo.iAction=EServiceActionActivate, aInfo.iPassword=correct call barring password, aInfo.iServiceGroup=EVoiceService and aCondition=EBarAllOutgoing |
|
2855 RMobilePhone::TMobilePhoneCBChangeV1 cbInfo; |
|
2856 cbInfo.iAction = RMobilePhone::EServiceActionActivate; |
|
2857 cbInfo.iPassword = password; |
|
2858 cbInfo.iServiceGroup = RMobilePhone::EVoiceService; |
|
2859 RMobilePhone::TMobilePhoneCBCondition wantedCBCondition = RMobilePhone::EBarAllOutgoing; |
|
2860 ASSERT_EQUALS( SetCBStatusL( phone, cbInfo, wantedCBCondition) , KErrNone, _L("RMobilePhone::SetCallBarringStatus returned error")); |
|
2861 |
|
2862 // Activate call barring using RMobilePhone::SetCallBarringStatus with aInfo.iAction=EServiceActionActivate, aInfo.iPassword=correct call barring password, aInfo.iServiceGroup=EShortMessageService and aCondition=EBarAllOutgoing |
|
2863 cbInfo.iServiceGroup = RMobilePhone::EShortMessageService; |
|
2864 ASSERT_EQUALS( SetCBStatusL( phone, cbInfo, wantedCBCondition) , KErrNone, _L("RMobilePhone::SetCallBarringStatus returned error")); |
|
2865 |
|
2866 // Activate notify RMobilePhone::NotifyCallBarringStatusChange |
|
2867 TExtEtelRequestStatus cbStatusNotifyStatus( phone, EMobilePhoneNotifyCallBarringStatusChange ); |
|
2868 CleanupStack::PushL(cbStatusNotifyStatus); |
|
2869 RMobilePhone::TMobilePhoneCBCondition notifiedCBCondition; |
|
2870 phone.NotifyCallBarringStatusChange( cbStatusNotifyStatus, notifiedCBCondition ); |
|
2871 |
|
2872 // === Deactivate all call barring for all service groups and all cases === |
|
2873 |
|
2874 // Deactivate call barring using RMobilePhone::SetCallBarringStatus with aInfo.iAction=EServiceActionDeactivate, aInfo.iPassword=correct call barring password, aInfo.iServiceGroup=EAllServices and aCondition=EBarAllCases |
|
2875 ASSERT_EQUALS(DeactivateCallBarringL( phone, password ), KErrNone, _L("RMobilePhone::SetCallBarringStatus returned error")); |
|
2876 |
|
2877 // Check RMobilePhone::NotifyCallBarringStatusChange completes with aCondition=EBarAllCases |
|
2878 wantedCBCondition = RMobilePhone::EBarAllCases; |
|
2879 iSupplementalTsyTestHelper.WaitForMobilePhoneNotifyCallBarringStatusChange(phone, |
|
2880 cbStatusNotifyStatus, |
|
2881 notifiedCBCondition, |
|
2882 wantedCBCondition, |
|
2883 KErrNone ); |
|
2884 |
|
2885 // === Retrieve call barring status === |
|
2886 |
|
2887 // Use the helper class to retrieve the call barring status list with aCondition=EBarAllOutgoing and aLocation=RMobilePhone::EInfoLocationCachePreferred |
|
2888 CRetrieveMobilePhoneCBListExec* cbStatusListHelper = CRetrieveMobilePhoneCBListHelper::NewL(phone, |
|
2889 RMobilePhone::EBarAllOutgoing, RMobilePhone::EInfoLocationCachePreferred ); |
|
2890 CleanupStack::PushL( cbStatusListHelper ); |
|
2891 TInt err; |
|
2892 CMobilePhoneCBList* cbStatusList = cbStatusListHelper->DoGetList(err); |
|
2893 ASSERT_EQUALS(err, KErrNone, _L("CRetrieveMobilePhoneCBList::Start failed to get the list")); |
|
2894 ASSERT_TRUE(cbStatusList != NULL, _L("CRetrieveMobilePhoneCBList::DoGetList callBarringList is NULL")); |
|
2895 |
|
2896 // Check CMobilePhoneCBList::Enumerate on the list returned returns 0. |
|
2897 // $CTSYProblem CMobilePhoneCBList::Enumerate is returning 1 entry in the list whereas we expected 0 entry in the list. |
|
2898 // It is beacuse that Deactivating statement is changing the status of entry parametes accordingly and there will always remain one entry in the list |
|
2899 ASSERT_EQUALS(cbStatusList->Enumerate() , 1, _L("CMobilePhoneCBList::Enumerate returned other than 0")); |
|
2900 CleanupStack::PopAndDestroy(cbStatusListHelper); |
|
2901 |
|
2902 // Repeat status list retrieval and checking with aCondition=EBarAllIncoming, EBarIncomingRoaming, EBarOutgoingInternational, EBarOutgoingInternationalExHC |
|
2903 cbStatusListHelper = CRetrieveMobilePhoneCBListHelper::NewL(phone, RMobilePhone::EBarAllIncoming, |
|
2904 RMobilePhone::EInfoLocationCachePreferred ); |
|
2905 CleanupStack::PushL( cbStatusListHelper ); |
|
2906 cbStatusList = cbStatusListHelper->DoGetList(err); |
|
2907 ASSERT_EQUALS(err, KErrNone, _L("CRetrieveMobilePhoneCBList::Start failed to get the list")); |
|
2908 ASSERT_TRUE(cbStatusList != NULL, _L("CRetrieveMobilePhoneCBList::DoGetList callBarringList is NULL")); |
|
2909 |
|
2910 // Check CMobilePhoneCBList::Enumerate on the list returned returns 0. |
|
2911 ASSERT_EQUALS(cbStatusList->Enumerate() , 1, _L("CMobilePhoneCBList::Enumerate returned other than 0")); |
|
2912 CleanupStack::PopAndDestroy(cbStatusListHelper); |
|
2913 |
|
2914 cbStatusListHelper = CRetrieveMobilePhoneCBListHelper::NewL(phone, RMobilePhone::EBarIncomingRoaming, |
|
2915 RMobilePhone::EInfoLocationCachePreferred ); |
|
2916 CleanupStack::PushL( cbStatusListHelper ); |
|
2917 cbStatusList = cbStatusListHelper->DoGetList(err); |
|
2918 ASSERT_EQUALS(err, KErrNone, _L("CRetrieveMobilePhoneCBList::Start failed to get the list")); |
|
2919 ASSERT_TRUE(cbStatusList != NULL, _L("CRetrieveMobilePhoneCBList::DoGetList callBarringList is NULL")); |
|
2920 |
|
2921 // Check CMobilePhoneCBList::Enumerate on the list returned returns 0. |
|
2922 ASSERT_EQUALS(cbStatusList->Enumerate() , 1, _L("CMobilePhoneCBList::Enumerate returned other than 0")); |
|
2923 CleanupStack::PopAndDestroy(cbStatusListHelper); |
|
2924 |
|
2925 cbStatusListHelper = CRetrieveMobilePhoneCBListHelper::NewL(phone, RMobilePhone::EBarOutgoingInternational, |
|
2926 RMobilePhone::EInfoLocationCachePreferred ); |
|
2927 CleanupStack::PushL( cbStatusListHelper ); |
|
2928 cbStatusList = cbStatusListHelper->DoGetList(err); |
|
2929 ASSERT_EQUALS(err, KErrNone, _L("CRetrieveMobilePhoneCBList::Start failed to get the list")); |
|
2930 ASSERT_TRUE(cbStatusList != NULL, _L("CRetrieveMobilePhoneCBList::DoGetList callBarringList is NULL")); |
|
2931 |
|
2932 // Check CMobilePhoneCBList::Enumerate on the list returned returns 0. |
|
2933 ASSERT_EQUALS(cbStatusList->Enumerate() , 1, _L("CMobilePhoneCBList::Enumerate returned other than 0")); |
|
2934 CleanupStack::PopAndDestroy(cbStatusListHelper); |
|
2935 |
|
2936 cbStatusListHelper = CRetrieveMobilePhoneCBListHelper::NewL(phone, RMobilePhone::EBarOutgoingInternationalExHC, |
|
2937 RMobilePhone::EInfoLocationCachePreferred ); |
|
2938 CleanupStack::PushL( cbStatusListHelper ); |
|
2939 cbStatusList = cbStatusListHelper->DoGetList(err); |
|
2940 ASSERT_EQUALS(err, KErrNone, _L("CRetrieveMobilePhoneCBList::Start failed to get the list")); |
|
2941 ASSERT_TRUE(cbStatusList != NULL, _L("CRetrieveMobilePhoneCBList::DoGetList callBarringList is NULL")); |
|
2942 |
|
2943 // Check CMobilePhoneCBList::Enumerate on the list returned returns 0. |
|
2944 ASSERT_EQUALS(cbStatusList->Enumerate() , 1, _L("CMobilePhoneCBList::Enumerate returned other than 0")); |
|
2945 CleanupStack::PopAndDestroy(cbStatusListHelper); |
|
2946 |
|
2947 // === Activate some call barring services === |
|
2948 |
|
2949 // Activate call barring using RMobilePhone::SetCallBarringStatus with aInfo.iAction=EServiceActionActivate, aInfo.iPassword=correct call barring password, aInfo.iServiceGroup=EVoiceService and aCondition=EBarOutgoingInternational |
|
2950 cbInfo.iAction = RMobilePhone::EServiceActionActivate; |
|
2951 cbInfo.iPassword = password; |
|
2952 cbInfo.iServiceGroup = RMobilePhone::EVoiceService; |
|
2953 wantedCBCondition = RMobilePhone::EBarOutgoingInternational; |
|
2954 ASSERT_EQUALS( SetCBStatusL( phone, cbInfo, wantedCBCondition), KErrNone, _L("RMobilePhone::SetCallBarringStatus returned an error ")); |
|
2955 |
|
2956 // Activate call barring using RMobilePhone::SetCallBarringStatus with aInfo.iAction=EServiceActionActivate, aInfo.iPassword=correct call barring password, aInfo.iServiceGroup=EShortMessageService and aCondition=EBarOutgoingInternational |
|
2957 cbInfo.iAction = RMobilePhone::EServiceActionActivate; |
|
2958 cbInfo.iPassword = password; |
|
2959 cbInfo.iServiceGroup = RMobilePhone::EShortMessageService; |
|
2960 wantedCBCondition = RMobilePhone::EBarOutgoingInternational; |
|
2961 ASSERT_EQUALS(SetCBStatusL(phone, cbInfo, wantedCBCondition), KErrNone, _L("RMobilePhone::SetCallBarringStatus returned an error")); |
|
2962 |
|
2963 // === Erase all call barring for all service groups === |
|
2964 |
|
2965 // Erase call barring using RMobilePhone::SetCallBarringStatus with aInfo.iAction=EServiceActionDeactivate, aInfo.iPassword=correct call barring password, aInfo.iServiceGroup=EAllServices and aCondition=EBarAllCases |
|
2966 // $CTSYProblem RMobilePhone::SetCallBarringStatus is returning KErrGsmIllegalOperation instead of KErrNone, when it is attempted to erase all callbarring with aInfo.iAction=EServiceActionErase |
|
2967 cbInfo.iAction = RMobilePhone::EServiceActionErase; |
|
2968 cbInfo.iPassword = password; |
|
2969 cbInfo.iServiceGroup = RMobilePhone::EAllServices; |
|
2970 wantedCBCondition = RMobilePhone::EBarAllCases; |
|
2971 ASSERT_EQUALS( SetCBStatusL( phone, cbInfo, wantedCBCondition) , KErrGsmSSIllegalOperation , _L("RMobilePhone::SetCallBarringStatus did not return KErrGsmSSIllegalOperation")); |
|
2972 |
|
2973 // === Retrieve outgoing call barring status === |
|
2974 |
|
2975 // Use the helper class to retrieve the call barring status list using CRetrieveMobilePhoneCBList::Start with aCondition=EBarOutgoingInternational and aLocation=RMobilePhone::EInfoLocationCachePreferred |
|
2976 cbStatusListHelper = CRetrieveMobilePhoneCBListHelper::NewL(phone, RMobilePhone::EBarOutgoingInternational, |
|
2977 RMobilePhone::EInfoLocationCachePreferred ); |
|
2978 CleanupStack::PushL( cbStatusListHelper ); |
|
2979 cbStatusList = cbStatusListHelper->DoGetList(err); |
|
2980 ASSERT_EQUALS(err, KErrNone, _L("CRetrieveMobilePhoneCBList::Start failed to get the list")); |
|
2981 ASSERT_TRUE(cbStatusList != NULL, _L("CRetrieveMobilePhoneCBList::DoGetList callBarringList is NULL")); |
|
2982 |
|
2983 // Check CMobilePhoneCBList::Enumerate on the list returned returns 0. |
|
2984 // $CTSYProblem RMobilePhone::SetCallBarringStatus was unsuccessful with RMobilePhone::EServiceActionErase and RMobilePhone::EBarOutgoingInternational was activated twice with different |
|
2985 // service group so number of entries in the list will be 2 instead of 0. |
|
2986 ASSERT_EQUALS(cbStatusList->Enumerate() , 2, _L("CMobilePhoneCBList::Enumerate returned other than 0")); |
|
2987 CleanupStack::PopAndDestroy(cbStatusListHelper); |
|
2988 |
|
2989 // Repeat status list retrieval and checking with aCondition=EBarAllIncoming, |
|
2990 cbStatusListHelper = CRetrieveMobilePhoneCBListHelper::NewL(phone, RMobilePhone::EBarAllIncoming, |
|
2991 RMobilePhone::EInfoLocationCachePreferred ); |
|
2992 CleanupStack::PushL( cbStatusListHelper ); |
|
2993 cbStatusList = cbStatusListHelper->DoGetList(err); |
|
2994 ASSERT_EQUALS(err, KErrNone, _L("CRetrieveMobilePhoneCBList::Start failed to get the list")); |
|
2995 ASSERT_TRUE(cbStatusList != NULL, _L("CRetrieveMobilePhoneCBList::DoGetList callBarringList is NULL")); |
|
2996 |
|
2997 // Check CMobilePhoneCBList::Enumerate on the list returned returns 0. |
|
2998 // $CTSYProblem CMobilePhoneCBList::Enumerate is returning 1 entry in the list against RMobilePhone::EBarAllIncoming whereas we expected 0 entry in the list. |
|
2999 // It is beacuse that RMobilePhone::EServiceActionErase was unsuccessful and therre is always one entry in the list corresponding to each service group. |
|
3000 ASSERT_EQUALS(cbStatusList->Enumerate() , 1, _L("CMobilePhoneCBList::Enumerate returned other than 0")); |
|
3001 CleanupStack::PopAndDestroy(cbStatusListHelper); |
|
3002 |
|
3003 // EBarIncomingRoaming, |
|
3004 cbStatusListHelper = CRetrieveMobilePhoneCBListHelper::NewL(phone, RMobilePhone::EBarIncomingRoaming, |
|
3005 RMobilePhone::EInfoLocationCachePreferred ); |
|
3006 CleanupStack::PushL( cbStatusListHelper ); |
|
3007 cbStatusList = cbStatusListHelper->DoGetList(err); |
|
3008 ASSERT_EQUALS(err, KErrNone, _L("CRetrieveMobilePhoneCBList::Start failed to get the list")); |
|
3009 ASSERT_TRUE(cbStatusList != NULL, _L("CRetrieveMobilePhoneCBList::DoGetList callBarringList is NULL")); |
|
3010 |
|
3011 // Check CMobilePhoneCBList::Enumerate on the list returned returns 0. |
|
3012 ASSERT_EQUALS(cbStatusList->Enumerate() , 1, _L("CMobilePhoneCBList::Enumerate returned other than 0")); |
|
3013 CleanupStack::PopAndDestroy(cbStatusListHelper); |
|
3014 |
|
3015 // EBarOutgoingInternationalExHC |
|
3016 cbStatusListHelper = CRetrieveMobilePhoneCBListHelper::NewL(phone, RMobilePhone::EBarOutgoingInternationalExHC, |
|
3017 RMobilePhone::EInfoLocationCachePreferred ); |
|
3018 CleanupStack::PushL( cbStatusListHelper ); |
|
3019 cbStatusList = cbStatusListHelper->DoGetList(err); |
|
3020 ASSERT_EQUALS(err, KErrNone, _L("CRetrieveMobilePhoneCBList::Start failed to get the list")); |
|
3021 ASSERT_TRUE(cbStatusList != NULL, _L("CRetrieveMobilePhoneCBList::DoGetList callBarringList is NULL")); |
|
3022 |
|
3023 // Check CMobilePhoneCBList::Enumerate on the list returned returns 0. |
|
3024 ASSERT_EQUALS(cbStatusList->Enumerate() , 1, _L("CMobilePhoneCBList::Enumerate returned other than 0")); |
|
3025 CleanupStack::PopAndDestroy(cbStatusListHelper); |
|
3026 |
|
3027 // |
|
3028 // TEST END |
|
3029 // |
|
3030 |
|
3031 StartCleanup(); |
|
3032 |
|
3033 // Ensure password is same as before test and lock counter is reseted to zero |
|
3034 passwordInfo.iOldPassword = password; |
|
3035 passwordInfo.iNewPassword = password; |
|
3036 passwordInfo.iVerifiedPassword = password; |
|
3037 phone.SetSSPassword(passwordInfoStatus, passwordPkg, KSsCallBarringAllServices ); |
|
3038 ASSERT_EQUALS( WaitForRequestWithTimeOut( passwordInfoStatus, ETimeMedium), KErrNone, _L("RMobilePhone::SetSSPassword timed out") ); |
|
3039 ASSERT_EQUALS( passwordInfoStatus.Int(), KErrNone, _L("RMobilePhone::SetSSPassword did not return KErrNone")); |
|
3040 |
|
3041 // Pop |
|
3042 // passwordInfoStatus |
|
3043 // cbStatusNotifyStatus |
|
3044 CleanupStack::PopAndDestroy(2,&passwordInfoStatus); |
|
3045 |
|
3046 return TestStepResult(); |
|
3047 } |
|
3048 |
|
3049 TPtrC CCTSYIntegrationTestCallBarring0010::GetTestStepName() |
|
3050 /** |
|
3051 * @return The test step name. |
|
3052 */ |
|
3053 { |
|
3054 return _L("CCTSYIntegrationTestCallBarring0010"); |
|
3055 } |
|
3056 |
|
3057 |
|
3058 |
|
3059 CCTSYIntegrationTestCallBarring0011::CCTSYIntegrationTestCallBarring0011(CEtelSessionMgr& aEtelSessionMgr) |
|
3060 : CCTSYIntegrationTestCallBarringBase(aEtelSessionMgr) |
|
3061 /** |
|
3062 * Constructor. |
|
3063 */ |
|
3064 { |
|
3065 SetTestStepName(CCTSYIntegrationTestCallBarring0011::GetTestStepName()); |
|
3066 } |
|
3067 |
|
3068 CCTSYIntegrationTestCallBarring0011::~CCTSYIntegrationTestCallBarring0011() |
|
3069 /** |
|
3070 * Destructor. |
|
3071 */ |
|
3072 { |
|
3073 } |
|
3074 |
|
3075 TVerdict CCTSYIntegrationTestCallBarring0011::doTestStepL() |
|
3076 /** |
|
3077 * @SYMTestCaseID BA-CTSY-INT-CBAR-0011 |
|
3078 * @SYMFssID BA/CTSY/CBAR-0011 |
|
3079 * @SYMTestCaseDesc Deactivate and erase call barring for all outgoing and all incoming services. |
|
3080 * @SYMTestPriority High |
|
3081 * @SYMTestActions RMobilePhone::NotifyCallBarringStatusChange, RMobilePhone::SetCallBarringStatus, CRetrieveMobilePhoneCBList::RetrieveListL |
|
3082 * @SYMTestExpectedResults Pass - Call barring deactivated and erased. |
|
3083 * @SYMTestType CIT |
|
3084 * @SYMTestCaseDependencies live/automatic |
|
3085 * |
|
3086 * Reason for test: Verify call barring notification and retrieve call barring status. |
|
3087 * |
|
3088 * @return - TVerdict code |
|
3089 */ |
|
3090 { |
|
3091 |
|
3092 // |
|
3093 // SET UP |
|
3094 // |
|
3095 |
|
3096 RMobilePhone& phone = iEtelSessionMgr.GetPhoneL(KMainServer, KMainPhone); |
|
3097 RMobilePhone::TMobilePassword password; |
|
3098 CheckCBPasswordL( phone, password ); |
|
3099 |
|
3100 // Ensure RMobilePhone::GetCallServiceCaps returns caps in set of KCapsBarAllIncoming | KCapsBarAllOutgoing | KCapsNotifyCBStatus | KCapsSetCBStatus | KCapsGetCBStatusNetwork | KCapsGetCBStatusCache |
|
3101 TUint32 callServiceCaps; |
|
3102 CHECK_EQUALS_L(phone.GetCallServiceCaps( callServiceCaps ), KErrNone, _L("RMobilePhone::GetCallServiceCaps returned other than KErrNone")); |
|
3103 |
|
3104 // $CTSYProblem Capabilities are hardcoded in CTSY KMultimodeTsyGsmCallServiceCaps. KCapsGetCBStatusCache commented due test to proceed. |
|
3105 TUint32 wantedServiceCaps = RMobilePhone::KCapsBarAllIncoming | |
|
3106 RMobilePhone::KCapsBarAllOutgoing | |
|
3107 RMobilePhone::KCapsNotifyCBStatus | |
|
3108 RMobilePhone::KCapsSetCBStatus | |
|
3109 RMobilePhone::KCapsGetCBStatusNetwork; |
|
3110 CHECK_BITS_SET_L(callServiceCaps, wantedServiceCaps, KNoUnwantedBits , _L("RMobilePhone::GetCallServiceCaps returned error")); |
|
3111 |
|
3112 // Set the call barring password to a known password using RMobilePhone::SetSSPassword |
|
3113 TExtEtelRequestStatus passwordInfoStatus(phone, EMobilePhoneSetSSPassword); |
|
3114 CleanupStack::PushL(passwordInfoStatus); |
|
3115 RMobilePhone::TMobilePhonePasswordChangeV2 passwordInfo; |
|
3116 passwordInfo.iOldPassword = password; |
|
3117 passwordInfo.iNewPassword = password; |
|
3118 passwordInfo.iVerifiedPassword = password; |
|
3119 RMobilePhone::TMobilePhonePasswordChangeV2Pckg passwordPkg(passwordInfo); |
|
3120 phone.SetSSPassword(passwordInfoStatus, passwordPkg, KSsCallBarringAllServices ); |
|
3121 CHECK_EQUALS_L( WaitForRequestWithTimeOut( passwordInfoStatus, ETimeMedium), KErrNone, _L("RMobilePhone::SetSSPassword timed out") ); |
|
3122 CHECK_EQUALS_L( passwordInfoStatus.Int(), KErrNone, _L("RMobilePhone::SetSSPassword did not return KErrNone")); |
|
3123 |
|
3124 // |
|
3125 // SET UP END |
|
3126 // |
|
3127 |
|
3128 StartTest(); |
|
3129 |
|
3130 // |
|
3131 // TEST START |
|
3132 // |
|
3133 |
|
3134 // === Activate some outgoing call barring services === |
|
3135 |
|
3136 // Activate call barring using RMobilePhone::SetCallBarringStatus with aInfo.iAction=EServiceActionActivate, aInfo.iPassword=correct call barring password, aInfo.iServiceGroup=EVoiceService and aCondition=EBarAllOutgoing |
|
3137 RMobilePhone::TMobilePhoneCBChangeV1 cbInfo; |
|
3138 cbInfo.iAction = RMobilePhone::EServiceActionActivate; |
|
3139 cbInfo.iPassword =password; |
|
3140 cbInfo.iServiceGroup = RMobilePhone::EVoiceService; |
|
3141 RMobilePhone::TMobilePhoneCBCondition wantedCBCondition = RMobilePhone::EBarAllOutgoing; |
|
3142 ASSERT_EQUALS( SetCBStatusL( phone, cbInfo, wantedCBCondition) , KErrNone, _L("RMobilePhone::SetCallBarringStatus returned an error")); |
|
3143 |
|
3144 // Activate call barring using RMobilePhone::SetCallBarringStatus with aInfo.iAction=EServiceActionActivate, aInfo.iPassword=correct call barring password, aInfo.iServiceGroup=EShortMessageService and aCondition=EBarAllOutgoing |
|
3145 cbInfo.iServiceGroup = RMobilePhone::EShortMessageService; |
|
3146 ASSERT_EQUALS( SetCBStatusL( phone, cbInfo, wantedCBCondition) , KErrNone, _L("RMobilePhone::SetCallBarringStatus returned an error")); |
|
3147 |
|
3148 // Activate notify RMobilePhone::NotifyCallBarringStatusChange |
|
3149 TExtEtelRequestStatus cbStatusNotifyStatus( phone, EMobilePhoneNotifyCallBarringStatusChange ); |
|
3150 CleanupStack::PushL(cbStatusNotifyStatus); |
|
3151 RMobilePhone::TMobilePhoneCBCondition notifiedCBCondition; |
|
3152 phone.NotifyCallBarringStatusChange( cbStatusNotifyStatus, notifiedCBCondition ); |
|
3153 |
|
3154 // === Deactivate all outgoing services === |
|
3155 |
|
3156 // Deactivate call barring using RMobilePhone::SetCallBarringStatus with aInfo.iAction=EServiceActionDeactivate, aInfo.iPassword=correct call barring password, aInfo.iServiceGroup=EAllServices and aCondition=EBarAllOutgoingServices |
|
3157 cbInfo.iAction = RMobilePhone::EServiceActionDeactivate; |
|
3158 cbInfo.iPassword = password; |
|
3159 cbInfo.iServiceGroup = RMobilePhone::EAllServices; |
|
3160 wantedCBCondition = RMobilePhone::EBarAllOutgoingServices; |
|
3161 ASSERT_EQUALS( SetCBStatusL( phone, cbInfo, wantedCBCondition), KErrNone, _L("RMobilePhone::SetCallBarringStatus returned an error")); |
|
3162 |
|
3163 // Check RMobilePhone::NotifyCallBarringStatusChange completes with aCondition=EBarAllOutgoingServices |
|
3164 wantedCBCondition = RMobilePhone::EBarAllOutgoingServices; |
|
3165 iSupplementalTsyTestHelper.WaitForMobilePhoneNotifyCallBarringStatusChange(phone, |
|
3166 cbStatusNotifyStatus, |
|
3167 notifiedCBCondition, |
|
3168 wantedCBCondition, |
|
3169 KErrNone ); |
|
3170 |
|
3171 // === Retrieve call barring status === |
|
3172 |
|
3173 // Use the helper class for CRetrieveMobilePhoneCBList to retrieve the call barring list with aCondition=EBarAllOutgoing and aLocation=RMobilePhone::EInfoLocationCachePreferred |
|
3174 CRetrieveMobilePhoneCBListExec* cbStatusListHelper = CRetrieveMobilePhoneCBListHelper::NewL(phone, RMobilePhone::EBarAllOutgoing, RMobilePhone::EInfoLocationCachePreferred ); |
|
3175 CleanupStack::PushL( cbStatusListHelper ); |
|
3176 TInt err; |
|
3177 CMobilePhoneCBList* cbStatusList = cbStatusListHelper->DoGetList(err); |
|
3178 ASSERT_EQUALS(err, KErrNone, _L("CRetrieveMobilePhoneCBList::Start failed to get the list")); |
|
3179 ASSERT_TRUE(cbStatusList != NULL, _L("CRetrieveMobilePhoneCBListHelper::DoGetList callBarringList is NULL")); |
|
3180 |
|
3181 // Check CMobilePhoneCBList::Enumerate on the list returned returns 0. |
|
3182 // $CTSYProblem CMobilePhoneCBList::Enumerate is returning 1 entry in the list whereas we expected 0 entry in the list. Similar error applies all lists |
|
3183 // It is beacuse that Deactivating statement is changing the status of entry parametes accordingly and there will always remain one entry in the list |
|
3184 ASSERT_EQUALS(cbStatusList->Enumerate() , 1, _L("CMobilePhoneCBList::Enumerate returned other than 1")); |
|
3185 CleanupStack::PopAndDestroy(cbStatusListHelper); |
|
3186 |
|
3187 // Repeat status list retrieval and checking with aCondition=EBarOutgoingInternational |
|
3188 cbStatusListHelper = CRetrieveMobilePhoneCBListHelper::NewL(phone, RMobilePhone::EBarOutgoingInternational, |
|
3189 RMobilePhone::EInfoLocationCachePreferred ); |
|
3190 CleanupStack::PushL( cbStatusListHelper ); |
|
3191 cbStatusList = cbStatusListHelper->DoGetList(err); |
|
3192 ASSERT_EQUALS(err, KErrNone, _L("CRetrieveMobilePhoneCBList::Start failed to get the list")); |
|
3193 ASSERT_TRUE(cbStatusList != NULL, _L("CRetrieveMobilePhoneCBListHelper::DoGetList callBarringList is NULL")); |
|
3194 |
|
3195 // Check CMobilePhoneCBList::Enumerate on the list returned returns 0. |
|
3196 ASSERT_EQUALS(cbStatusList->Enumerate() , 1, _L("CMobilePhoneCBList::Enumerate returned other than 1")); |
|
3197 CleanupStack::PopAndDestroy(cbStatusListHelper); |
|
3198 |
|
3199 // Repeat status list retrieval and checking with aCondition=EBarOutgoingInternationalExHC |
|
3200 cbStatusListHelper = CRetrieveMobilePhoneCBListHelper::NewL(phone, RMobilePhone::EBarOutgoingInternationalExHC, |
|
3201 RMobilePhone::EInfoLocationCachePreferred ); |
|
3202 CleanupStack::PushL( cbStatusListHelper ); |
|
3203 cbStatusList = cbStatusListHelper->DoGetList(err); |
|
3204 ASSERT_EQUALS(err, KErrNone, _L("CRetrieveMobilePhoneCBList::Start failed to get the list")); |
|
3205 ASSERT_TRUE(cbStatusList != NULL, _L("CRetrieveMobilePhoneCBListHelper::DoGetList callBarringList is NULL")); |
|
3206 |
|
3207 // Check CMobilePhoneCBList::Enumerate on the list returned returns 0. |
|
3208 ASSERT_EQUALS(cbStatusList->Enumerate() , 1, _L("CMobilePhoneCBList::Enumerate returned other than 1")); |
|
3209 CleanupStack::PopAndDestroy(cbStatusListHelper); |
|
3210 |
|
3211 // === Register some outgoing call barring services === |
|
3212 // Register call barring using RMobilePhone::SetCallBarringStatus with aInfo.iAction=EServiceActionRegister, aInfo.iPassword=correct call barring password, aInfo.iServiceGroup=EVoiceService and aCondition=EBarOutgoingInternational |
|
3213 // $CTSYProblem RMobilePhone::SetCallBarringStatus is returning KErrGsmSSIllegalOperation instead of KErrNone, when it is attempted to register callbarring service with aInfo.iAction=EServiceActionRegister |
|
3214 cbInfo.iAction = RMobilePhone::EServiceActionRegister; |
|
3215 cbInfo.iPassword = password; |
|
3216 cbInfo.iServiceGroup = RMobilePhone::EVoiceService; |
|
3217 wantedCBCondition = RMobilePhone::EBarOutgoingInternational; |
|
3218 ASSERT_EQUALS( SetCBStatusL( phone, cbInfo, wantedCBCondition), KErrGsmSSIllegalOperation, _L("RMobilePhone::SetCallBarringStatus did not return KErrGsmIllegalOperation")); |
|
3219 |
|
3220 // Register call barring using RMobilePhone::SetCallBarringStatus with aInfo.iAction=EServiceActionRegister, aInfo.iPassword=correct call barring password, aInfo.iServiceGroup=EShortMessageService and aCondition=EBarOutgoingInternationalExHC |
|
3221 // $CTSYProblem RMobilePhone::SetCallBarringStatus is returning KErrGsmIllegalOperation instead of KErrNone, when it is attempted to register callbarring service with aInfo.iAction=EServiceActionRegister |
|
3222 cbInfo.iServiceGroup = RMobilePhone::EShortMessageService; |
|
3223 wantedCBCondition = RMobilePhone::EBarOutgoingInternationalExHC; |
|
3224 ASSERT_EQUALS( SetCBStatusL( phone, cbInfo, wantedCBCondition), KErrGsmSSIllegalOperation , _L("RMobilePhone::SetCallBarringStatus did not return KErrGsmIllegalOperation")); |
|
3225 |
|
3226 // === Erase all call barring for all service groups === |
|
3227 |
|
3228 // Erase call barring using RMobilePhone::SetCallBarringStatus with aInfo.iAction=EServiceActionErase, aInfo.iPassword=correct call barring password, aInfo.iServiceGroup=EAllServices and aCondition=EBarAllOutgoingServices |
|
3229 // $CTSYProblem RMobilePhone::SetCallBarringStatus is returning KErrGsmSSIllegalOperation instead of KErrNone, when it is attempted to erase callbarring service with aInfo.iAction=EServiceActionErase |
|
3230 cbInfo.iAction = RMobilePhone::EServiceActionErase; |
|
3231 cbInfo.iServiceGroup = RMobilePhone::EAllServices; |
|
3232 wantedCBCondition = RMobilePhone::EBarAllOutgoingServices; |
|
3233 ASSERT_EQUALS( SetCBStatusL( phone, cbInfo, wantedCBCondition), KErrGsmSSIllegalOperation, _L("RMobilePhone::SetCallBarringStatus returned KErrNone")); |
|
3234 |
|
3235 // === Retrieve call barring status === |
|
3236 |
|
3237 // Use the helper class for CRetrieveMobilePhoneCBList to retrieve the call barring status list with aCondition=EBarAllOutgoing and aLocation=RMobilePhone::EInfoLocationCachePreferred |
|
3238 cbStatusListHelper = CRetrieveMobilePhoneCBListHelper::NewL(phone, RMobilePhone::EBarAllOutgoing, |
|
3239 RMobilePhone::EInfoLocationCachePreferred ); |
|
3240 CleanupStack::PushL( cbStatusListHelper ); |
|
3241 cbStatusList = cbStatusListHelper->DoGetList(err); |
|
3242 ASSERT_EQUALS(err, KErrNone, _L("CRetrieveMobilePhoneCBList::Start failed to get the list")); |
|
3243 ASSERT_TRUE(cbStatusList != NULL, _L("CRetrieveMobilePhoneCBListHelper::DoGetList callBarringList is NULL")); |
|
3244 |
|
3245 // Check CMobilePhoneCBList::Enumerate on the list returned returns 0. |
|
3246 // $CTSYProblem CMobilePhoneCBList::Enumerate is returning 1 entry in the list whereas we expected 0 entry in the list. Similar error applies all lists |
|
3247 ASSERT_EQUALS(cbStatusList->Enumerate() , 1, _L("CMobilePhoneCBList::Enumerate returned other than 1 for condition RMobilePhone::EBarAllOutgoing")); |
|
3248 CleanupStack::PopAndDestroy(cbStatusListHelper); |
|
3249 |
|
3250 // Repeat status list retrieval and checking with aCondition=EBarOutgoingInternational, EBarOutgoingInternationalExHC |
|
3251 cbStatusListHelper = CRetrieveMobilePhoneCBListHelper::NewL(phone, RMobilePhone::EBarOutgoingInternational, |
|
3252 RMobilePhone::EInfoLocationCachePreferred ); |
|
3253 CleanupStack::PushL( cbStatusListHelper ); |
|
3254 cbStatusList = cbStatusListHelper->DoGetList(err); |
|
3255 ASSERT_EQUALS(err, KErrNone, _L("CRetrieveMobilePhoneCBList::Start failed to get the list")) |
|
3256 ASSERT_TRUE(cbStatusList != NULL, _L("CRetrieveMobilePhoneCBListHelper::DoGetList callBarringList is NULL")); |
|
3257 |
|
3258 // Check CMobilePhoneCBList::Enumerate on the list returned returns 0. |
|
3259 ASSERT_EQUALS(cbStatusList->Enumerate() , 1, _L("CMobilePhoneCBList::Enumerate returned other than 1 for condition RMobilePhone::EBarOutgoingInternational")); |
|
3260 CleanupStack::PopAndDestroy(cbStatusListHelper); |
|
3261 |
|
3262 // Repeat status list retrieval and checking with aCondition=EBarOutgoingInternationalExHC |
|
3263 cbStatusListHelper = CRetrieveMobilePhoneCBListHelper::NewL(phone, RMobilePhone::EBarOutgoingInternationalExHC, |
|
3264 RMobilePhone::EInfoLocationCachePreferred ); |
|
3265 CleanupStack::PushL( cbStatusListHelper ); |
|
3266 cbStatusList = cbStatusListHelper->DoGetList(err); |
|
3267 ASSERT_EQUALS(err, KErrNone, _L("CRetrieveMobilePhoneCBList::Start failed to get the list")); |
|
3268 ASSERT_TRUE(cbStatusList != NULL, _L("CRetrieveMobilePhoneCFListExec::DoGetList callForwardingList is NULL")); |
|
3269 |
|
3270 // Check CMobilePhoneCBList::Enumerate on the list returned returns 0. |
|
3271 ASSERT_EQUALS(cbStatusList->Enumerate() , 1, _L("CMobilePhoneCBList::Enumerate returned other than 1 for condition RMobilePhone::EBarOutgoingInternationalExHC")); |
|
3272 CleanupStack::PopAndDestroy(cbStatusListHelper); |
|
3273 |
|
3274 // === Activate some incoming call barring services === |
|
3275 |
|
3276 // Activate call barring using RMobilePhone::SetCallBarringStatus with aInfo.iAction=EServiceActionActivate, aInfo.iPassword=correct call barring password, aInfo.iServiceGroup=EVoiceService and aCondition=EBarAllIncoming |
|
3277 cbInfo.iAction = RMobilePhone::EServiceActionActivate; |
|
3278 cbInfo.iServiceGroup = RMobilePhone::EVoiceService; |
|
3279 cbInfo.iPassword =password; |
|
3280 wantedCBCondition = RMobilePhone::EBarAllIncoming; |
|
3281 ASSERT_EQUALS( SetCBStatusL( phone, cbInfo, wantedCBCondition) , KErrNone, _L("RMobilePhone::SetCallBarringStatus returned an error")); |
|
3282 |
|
3283 // Activate call barring using RMobilePhone::SetCallBarringStatus with aInfo.iAction=EServiceActionActivate, aInfo.iPassword=incorrect call barring password, aInfo.iServiceGroup=EShortMessageService and aCondition=EBarIncomingRoaming |
|
3284 cbInfo.iServiceGroup = RMobilePhone::EShortMessageService; |
|
3285 wantedCBCondition = RMobilePhone::EBarIncomingRoaming; |
|
3286 ASSERT_EQUALS( SetCBStatusL( phone, cbInfo, wantedCBCondition) , KErrNone, _L("RMobilePhone::SetCallBarringStatus returned an error")); |
|
3287 |
|
3288 // Activate notify RMobilePhone::NotifyCallBarringStatusChange |
|
3289 phone.NotifyCallBarringStatusChange( cbStatusNotifyStatus, notifiedCBCondition); |
|
3290 |
|
3291 // === Deactivate all incoming services === |
|
3292 |
|
3293 // Deactivate call barring using RMobilePhone::SetCallBarringStatus with aInfo.iAction=EServiceActionDeactivate, aInfo.iPassword=correct call barring password, aInfo.iServiceGroup=EAllServices and aCondition=EBarAllIncomingServices |
|
3294 cbInfo.iAction = RMobilePhone::EServiceActionDeactivate; |
|
3295 cbInfo.iServiceGroup = RMobilePhone::EAllServices; |
|
3296 cbInfo.iPassword = password; |
|
3297 wantedCBCondition = RMobilePhone::EBarAllIncomingServices; |
|
3298 |
|
3299 ASSERT_EQUALS( SetCBStatusL( phone, cbInfo, wantedCBCondition), KErrNone, _L("RMobilePhone::SetCallBarringStatus returned KErrNone")); |
|
3300 |
|
3301 // Check RMobilePhone::NotifyCallBarringStatusChange completes with aCondition=EBarAllIncomingServices |
|
3302 wantedCBCondition = RMobilePhone::EBarAllIncomingServices; |
|
3303 iSupplementalTsyTestHelper.WaitForMobilePhoneNotifyCallBarringStatusChange(phone, |
|
3304 cbStatusNotifyStatus, |
|
3305 notifiedCBCondition, |
|
3306 wantedCBCondition, |
|
3307 KErrNone ); |
|
3308 |
|
3309 // === Retrieve call barring status === |
|
3310 |
|
3311 // Use the helper class to retrieve the call barring status list with aCondition=EBarAllIncoming and aLocation=RMobilePhone::EInfoLocationCachePreferred |
|
3312 cbStatusListHelper = CRetrieveMobilePhoneCBListHelper::NewL(phone, RMobilePhone::EBarAllIncoming, |
|
3313 RMobilePhone::EInfoLocationCachePreferred ); |
|
3314 CleanupStack::PushL( cbStatusListHelper ); |
|
3315 cbStatusList = cbStatusListHelper->DoGetList(err); |
|
3316 ASSERT_EQUALS(err, KErrNone, _L("CRetrieveMobilePhoneCBList::Start failed to get the list")); |
|
3317 ASSERT_TRUE(cbStatusList != NULL, _L("CRetrieveMobilePhoneCBListHelper::DoGetList callBarringList is NULL")); |
|
3318 |
|
3319 // Check CMobilePhoneCBList::Enumerate on the list returned returns 0. |
|
3320 // $CTSYProblem CMobilePhoneCBList::Enumerate is returning 1 entry in the list whereas we expected 1 entry in the list. Similar error applies all lists |
|
3321 ASSERT_EQUALS(cbStatusList->Enumerate() ,1, _L("CMobilePhoneCBList::Enumerate returned other than 1 for condition RMobilePhone::EBarAllIncoming")); |
|
3322 CleanupStack::PopAndDestroy(cbStatusListHelper); |
|
3323 |
|
3324 // Repeat status list retrieval and checking with aCondition= EBarIncomingRoaming |
|
3325 cbStatusListHelper = CRetrieveMobilePhoneCBListHelper::NewL(phone, RMobilePhone::EBarIncomingRoaming, |
|
3326 RMobilePhone::EInfoLocationCachePreferred ); |
|
3327 CleanupStack::PushL( cbStatusListHelper ); |
|
3328 cbStatusList = cbStatusListHelper->DoGetList(err); |
|
3329 ASSERT_EQUALS(err, KErrNone, _L("CRetrieveMobilePhoneCBList::Start failed to get the list")); |
|
3330 ASSERT_TRUE(cbStatusList != NULL, _L("CRetrieveMobilePhoneCBListHelper::DoGetList callBarringList is NULL")); |
|
3331 |
|
3332 // Check CMobilePhoneCBList::Enumerate on the list returned returns 0. |
|
3333 ASSERT_EQUALS(cbStatusList->Enumerate(), 1, _L("CMobilePhoneCBList::Enumerate returned other than 1 for condition RMobilePhone::EBarIncomingRoaming")); |
|
3334 CleanupStack::PopAndDestroy(cbStatusListHelper); |
|
3335 |
|
3336 // === Register some incoming call barring services === |
|
3337 |
|
3338 // Register call barring using RMobilePhone::SetCallBarringStatus with aInfo.iAction=EServiceActionRegister, aInfo.iPassword=incorrect call barring password, aInfo.iServiceGroup=EVoiceService and aCondition=EBarAllIncoming |
|
3339 // $CTSYProblem RMobilePhone::SetCallBarringStatus is returning KErrGsmIllegalOperation instead of KErrNone, when it is attempted to register callbarring service with aInfo.iAction=EServiceActionRegister |
|
3340 cbInfo.iAction = RMobilePhone::EServiceActionRegister; |
|
3341 cbInfo.iServiceGroup = RMobilePhone::EVoiceService; |
|
3342 cbInfo.iPassword =password; |
|
3343 wantedCBCondition = RMobilePhone::EBarAllIncoming; |
|
3344 ASSERT_EQUALS( SetCBStatusL( phone, cbInfo, wantedCBCondition), KErrGsmSSIllegalOperation, _L("RMobilePhone::SetCallBarringStatus did notreturn KErrGsmSSIllegalOperation")); |
|
3345 |
|
3346 // Register call barring using RMobilePhone::SetCallBarringStatus with aInfo.iAction=EServiceActionRegister, aInfo.iPassword=incorrect call barring password, aInfo.iServiceGroup=EShortMessageService and aCondition=EBarIncomingRoaming |
|
3347 // $CTSYProblem RMobilePhone::SetCallBarringStatus is returning KErrGsmIllegalOperation instead of KErrNone, when it is attempted to register callbarring service with aInfo.iAction=EServiceActionRegister |
|
3348 cbInfo.iServiceGroup = RMobilePhone::EShortMessageService; |
|
3349 wantedCBCondition = RMobilePhone::EBarIncomingRoaming; |
|
3350 ASSERT_EQUALS( SetCBStatusL( phone, cbInfo, wantedCBCondition), KErrGsmSSIllegalOperation, _L("RMobilePhone::SetCallBarringStatus did notreturn KErrGsmSSIllegalOperation")); |
|
3351 |
|
3352 // === Erase all incoming services === |
|
3353 |
|
3354 // Erase call barring using RMobilePhone::SetCallBarringStatus with aInfo.iAction=EServiceActionErase, aInfo.iPassword=correct call barring password, aInfo.iServiceGroup=EAllServices and aCondition=EBarAllIncomingServices |
|
3355 // $CTSYProblem RMobilePhone::SetCallBarringStatus is returning KErrGsmSSIllegalOperation instead of KErrNone, when it is attempted to erase callbarring service with aInfo.iAction=EServiceActionErase |
|
3356 cbInfo.iAction = RMobilePhone::EServiceActionErase; |
|
3357 cbInfo.iServiceGroup = RMobilePhone::EAllServices; |
|
3358 cbInfo.iPassword = password; |
|
3359 wantedCBCondition = RMobilePhone::EBarAllIncomingServices; |
|
3360 ASSERT_EQUALS( SetCBStatusL( phone, cbInfo, wantedCBCondition), KErrGsmSSIllegalOperation, _L("RMobilePhone::SetCallBarringStatus did notreturn KErrGsmSSIllegalOperation")); |
|
3361 |
|
3362 // === Retrieve call barring status === |
|
3363 |
|
3364 // Use the helper class to retrieve the call barring status list using CRetrieveMobilePhoneCBList::Start with aCondition=EBarAllIncoming and aLocation=RMobilePhone::EInfoLocationCachePreferred |
|
3365 cbStatusListHelper = CRetrieveMobilePhoneCBListHelper::NewL(phone, RMobilePhone::EBarAllIncoming, |
|
3366 RMobilePhone::EInfoLocationCachePreferred ); |
|
3367 CleanupStack::PushL( cbStatusListHelper ); |
|
3368 cbStatusList = cbStatusListHelper->DoGetList(err); |
|
3369 ASSERT_EQUALS(err, KErrNone, _L("CRetrieveMobilePhoneCBList::Start failed to get the list")); |
|
3370 ASSERT_TRUE(cbStatusList != NULL, _L("CRetrieveMobilePhoneCBListHelper::DoGetList callBarringList is NULL")); |
|
3371 |
|
3372 // Check CMobilePhoneCBList::Enumerate on the list returned returns 0. |
|
3373 // $CTSYProblem CMobilePhoneCBList::Enumerate is returning 1 entry in the list whereas we expected 0 entry in the list. Similar error applies all lists |
|
3374 ASSERT_EQUALS(cbStatusList->Enumerate() , 1, _L("CMobilePhoneCBList::Enumerate returned other than 1 for condition RMobilePhone::EBarAllIncoming")); |
|
3375 CleanupStack::PopAndDestroy(cbStatusListHelper); |
|
3376 |
|
3377 // Repeat status list retrieval and checking with aCondition= EBarIncomingRoaming |
|
3378 cbStatusListHelper = CRetrieveMobilePhoneCBListHelper::NewL(phone, RMobilePhone::EBarIncomingRoaming, |
|
3379 RMobilePhone::EInfoLocationCachePreferred ); |
|
3380 CleanupStack::PushL( cbStatusListHelper ); |
|
3381 cbStatusList = cbStatusListHelper->DoGetList(err); |
|
3382 ASSERT_EQUALS(err, KErrNone, _L("CRetrieveMobilePhoneCBList::Start failed to get the list")); |
|
3383 ASSERT_TRUE(cbStatusList != NULL, _L("CRetrieveMobilePhoneCBListHelper::DoGetList callBarringList is NULL")); |
|
3384 |
|
3385 // Check CMobilePhoneCBList::Enumerate on the list returned returns 0. |
|
3386 ASSERT_EQUALS(cbStatusList->Enumerate() ,1, _L("CMobilePhoneCBList::Enumerate returned other than 1 for condition RMobilePhone::EBarIncomingRoaming")); |
|
3387 CleanupStack::PopAndDestroy(cbStatusListHelper); |
|
3388 |
|
3389 // |
|
3390 // TEST END |
|
3391 // |
|
3392 |
|
3393 StartCleanup(); |
|
3394 |
|
3395 |
|
3396 |
|
3397 // Ensure password is same as before test and lock counter is reseted to zero |
|
3398 passwordInfo.iOldPassword = password; |
|
3399 passwordInfo.iNewPassword = password; |
|
3400 passwordInfo.iVerifiedPassword = password; |
|
3401 phone.SetSSPassword(passwordInfoStatus, passwordPkg, KSsCallBarringAllServices ); |
|
3402 ASSERT_EQUALS( WaitForRequestWithTimeOut( passwordInfoStatus, ETimeMedium), KErrNone, _L("RMobilePhone::SetSSPassword timed out") ); |
|
3403 ASSERT_EQUALS( passwordInfoStatus.Int(), KErrNone, _L("RMobilePhone::SetSSPassword did not return KErrNone")); |
|
3404 |
|
3405 // Pop |
|
3406 // passwordInfoStatus |
|
3407 // cbStatusNotifyStatus |
|
3408 CleanupStack::PopAndDestroy(2,&passwordInfoStatus); |
|
3409 |
|
3410 return TestStepResult(); |
|
3411 } |
|
3412 |
|
3413 TPtrC CCTSYIntegrationTestCallBarring0011::GetTestStepName() |
|
3414 /** |
|
3415 * @return The test step name. |
|
3416 */ |
|
3417 { |
|
3418 return _L("CCTSYIntegrationTestCallBarring0011"); |
|
3419 } |
|
3420 |
|
3421 |
|
3422 |
|
3423 CCTSYIntegrationTestCallBarring0012::CCTSYIntegrationTestCallBarring0012(CEtelSessionMgr& aEtelSessionMgr) |
|
3424 : CCTSYIntegrationTestCallBarringBase(aEtelSessionMgr) |
|
3425 /** |
|
3426 * Constructor. |
|
3427 */ |
|
3428 { |
|
3429 SetTestStepName(CCTSYIntegrationTestCallBarring0012::GetTestStepName()); |
|
3430 } |
|
3431 |
|
3432 CCTSYIntegrationTestCallBarring0012::~CCTSYIntegrationTestCallBarring0012() |
|
3433 /** |
|
3434 * Destructor. |
|
3435 */ |
|
3436 { |
|
3437 } |
|
3438 |
|
3439 TVerdict CCTSYIntegrationTestCallBarring0012::doTestStepL() |
|
3440 /** |
|
3441 * @SYMTestCaseID BA-CTSY-INT-CBAR-0012 |
|
3442 * @SYMFssID BA/CTSY/CBAR-0012 |
|
3443 * @SYMTestCaseDesc Change the call barring password. |
|
3444 * @SYMTestPriority High |
|
3445 * @SYMTestActions RMobilePhone::SetCallBarringStatus |
|
3446 * @SYMTestExpectedResults Pass - Password change successful. |
|
3447 * @SYMTestType CIT |
|
3448 * @SYMTestCaseDependencies live/automatic |
|
3449 * |
|
3450 * Reason for test: Verify password is changed. |
|
3451 * |
|
3452 * @return - TVerdict code |
|
3453 */ |
|
3454 { |
|
3455 |
|
3456 // |
|
3457 // SET UP |
|
3458 // |
|
3459 RMobilePhone &phone = iEtelSessionMgr.GetPhoneL(KMainServer, KMainPhone); |
|
3460 |
|
3461 // Check call barring password |
|
3462 RMobilePhone::TMobilePassword password; |
|
3463 CheckCBPasswordL(phone, password); |
|
3464 |
|
3465 // Ensure RMobilePhone::GetCallServiceCaps returns caps in set of KCapsChangeCBPassword | KCapsBarAllCases. |
|
3466 TUint32 callBarCaps; |
|
3467 TInt err = phone.GetCallServiceCaps( callBarCaps ); |
|
3468 CHECK_EQUALS_L(err, KErrNone, _L("RMobilePhone::GetCallServiceCaps returned error")); |
|
3469 CHECK_BITS_SET_L(callBarCaps, (RMobilePhone::KCapsChangeCBPassword | RMobilePhone::KCapsBarAllCases), KNoUnwantedBits, _L("RMobilePhone::GetCallServiceCaps returned unexpected bitmap")); |
|
3470 |
|
3471 // |
|
3472 // SET UP END |
|
3473 // |
|
3474 |
|
3475 StartTest(); |
|
3476 |
|
3477 // |
|
3478 // TEST START |
|
3479 // |
|
3480 |
|
3481 // Change the call barring password using RMobilePhone::SetSSPassword with |
|
3482 // aService=330 and aPassword=packaged RMobilePhone::TMobilePhonePasswordChangeV2 with |
|
3483 // iOldPassword=correct old password, iNewPassword=iVerifiedPassword=a four digit new password |
|
3484 TInt service = KSsCallBarringAllServices; |
|
3485 RMobilePhone::TMobilePhonePasswordChangeV2 passwordV2; |
|
3486 RMobilePhone::TMobilePhonePasswordChangeV2Pckg passwordPkg(passwordV2); |
|
3487 passwordV2.iOldPassword = password; |
|
3488 passwordV2.iNewPassword = KAltPassword2; |
|
3489 passwordV2.iVerifiedPassword = KAltPassword2; |
|
3490 TExtEtelRequestStatus setSSPasswordStatus(phone, EMobilePhoneSetSSPassword); |
|
3491 CleanupStack::PushL(setSSPasswordStatus); |
|
3492 phone.SetSSPassword(setSSPasswordStatus, passwordPkg, service); |
|
3493 ASSERT_EQUALS(WaitForRequestWithTimeOut(setSSPasswordStatus, ETimeMedium), KErrNone, _L("RMobilePhone::SetSSPassword timed out") ); |
|
3494 ASSERT_EQUALS(setSSPasswordStatus.Int(), KErrNone, _L("RMobilePhone::SetSSPassword returned with an error")); |
|
3495 |
|
3496 // === Deactivate call barring with new password === |
|
3497 |
|
3498 // Deactivate call barring using RMobilePhone::SetCallBarringStatus with aInfo.iAction=EServiceActionDeactivate, aInfo.iPassword=new password, aInfo.iServiceGroup=EVoiceService and aCondition=EBarAllCases |
|
3499 RMobilePhone::TMobilePhoneCBChangeV1 callBarringInfo; |
|
3500 RMobilePhone::TMobilePhoneCBCondition callBarringCondition; |
|
3501 callBarringCondition = RMobilePhone::EBarAllCases; |
|
3502 callBarringInfo.iAction =RMobilePhone::EServiceActionDeactivate; |
|
3503 callBarringInfo.iPassword = KAltPassword2; |
|
3504 callBarringInfo.iServiceGroup = RMobilePhone::EVoiceService; |
|
3505 err = SetCBStatusL(phone, callBarringInfo, callBarringCondition); |
|
3506 ASSERT_EQUALS(err, KErrNone, _L("RMobilePhone::SetCallBarringStatus returned error")); |
|
3507 |
|
3508 // === Deactivate call barring with old password and check it fails === |
|
3509 |
|
3510 // Deactivate call barring using RMobilePhone::SetCallBarringStatus with aInfo.iAction=EServiceActionActivate, aInfo.iPassword=old password, aInfo.iServiceGroup=EVoiceService and aCondition=EBarAllCases |
|
3511 callBarringInfo.iPassword = password; |
|
3512 err = SetCBStatusL(phone, callBarringInfo, callBarringCondition), KErrNone, _L("RMobilePhone::SetCallBarringStatus returned error"); |
|
3513 |
|
3514 // Check error is returned. |
|
3515 ASSERT_TRUE(err != KErrNone, _L("RMobilePhone::SetCallBarringStatus returned KErrNone instead of error")); |
|
3516 |
|
3517 // |
|
3518 // TEST END |
|
3519 // |
|
3520 |
|
3521 StartCleanup(); |
|
3522 |
|
3523 // Restore oginal password |
|
3524 passwordV2.iOldPassword = KAltPassword2; |
|
3525 passwordV2.iNewPassword = password; |
|
3526 passwordV2.iVerifiedPassword = password; |
|
3527 phone.SetSSPassword(setSSPasswordStatus, passwordPkg, service ); |
|
3528 ASSERT_EQUALS(WaitForRequestWithTimeOut(setSSPasswordStatus, ETimeMedium), KErrNone, _L("RMobilePhone::SetSSPassword timed out when restoring original password") ); |
|
3529 ASSERT_EQUALS(setSSPasswordStatus.Int(), KErrNone, _L("RMobilePhone::SetSSPassword returned with an error when restoring original password")); |
|
3530 |
|
3531 // Pop |
|
3532 // setSSPasswordStatus |
|
3533 CleanupStack::PopAndDestroy(1, &setSSPasswordStatus); |
|
3534 |
|
3535 return TestStepResult(); |
|
3536 } |
|
3537 |
|
3538 TPtrC CCTSYIntegrationTestCallBarring0012::GetTestStepName() |
|
3539 /** |
|
3540 * @return The test step name. |
|
3541 */ |
|
3542 { |
|
3543 return _L("CCTSYIntegrationTestCallBarring0012"); |
|
3544 } |
|
3545 |
|
3546 |
|
3547 |
|
3548 CCTSYIntegrationTestCallBarring0013::CCTSYIntegrationTestCallBarring0013(CEtelSessionMgr& aEtelSessionMgr) |
|
3549 : CCTSYIntegrationTestCallBarringBase(aEtelSessionMgr) |
|
3550 /** |
|
3551 * Constructor. |
|
3552 */ |
|
3553 { |
|
3554 SetTestStepName(CCTSYIntegrationTestCallBarring0013::GetTestStepName()); |
|
3555 } |
|
3556 |
|
3557 CCTSYIntegrationTestCallBarring0013::~CCTSYIntegrationTestCallBarring0013() |
|
3558 /** |
|
3559 * Destructor. |
|
3560 */ |
|
3561 { |
|
3562 } |
|
3563 |
|
3564 TVerdict CCTSYIntegrationTestCallBarring0013::doTestStepL() |
|
3565 /** |
|
3566 * @SYMTestCaseID BA-CTSY-INT-CBAR-0013 |
|
3567 * @SYMFssID BA/CTSY/CBAR-0013 |
|
3568 * @SYMTestCaseDesc Change the call barring password specifying incorrect old password. |
|
3569 * @SYMTestPriority High |
|
3570 * @SYMTestActions |
|
3571 * @SYMTestExpectedResults Pass - Error is returned on attempt to change password. |
|
3572 * @SYMTestType CIT |
|
3573 * @SYMTestCaseDependencies live/automatic |
|
3574 * |
|
3575 * Reason for test: Verify password is not changed. |
|
3576 * |
|
3577 * @return - TVerdict code |
|
3578 */ |
|
3579 { |
|
3580 |
|
3581 // |
|
3582 // SET UP |
|
3583 // |
|
3584 |
|
3585 RMobilePhone& phone = iEtelSessionMgr.GetPhoneL(KMainServer, KMainPhone); |
|
3586 RMobilePhone::TMobilePassword password; |
|
3587 CheckCBPasswordL( phone, password ); |
|
3588 |
|
3589 // Ensure RMobilePhone::GetCallServiceCaps returns caps in set of KCapsChangeCBPassword |
|
3590 TUint32 callServiceCaps; |
|
3591 TUint32 expectedservicecaps = RMobilePhone::KCapsChangeCBPassword; |
|
3592 TInt err = phone.GetCallServiceCaps( callServiceCaps ); |
|
3593 CHECK_EQUALS_L(err, KErrNone, _L("RMobilePhone::GetCallServiceCaps returned error")); |
|
3594 CHECK_BITS_SET_L(callServiceCaps, expectedservicecaps, KNoUnwantedBits, _L("RMobilePhone::GetCallServiceCaps returned wrong caps")); |
|
3595 |
|
3596 // Set the call barring password to a known password using RMobilePhone::SetSSPassword |
|
3597 TExtEtelRequestStatus passwordInfoStatus(phone, EMobilePhoneSetSSPassword); |
|
3598 CleanupStack::PushL(passwordInfoStatus); |
|
3599 RMobilePhone::TMobilePhonePasswordChangeV2 passwordInfo; |
|
3600 passwordInfo.iOldPassword = password; |
|
3601 passwordInfo.iNewPassword = password; |
|
3602 passwordInfo.iVerifiedPassword = password; |
|
3603 RMobilePhone::TMobilePhonePasswordChangeV2Pckg passwordPkg(passwordInfo); |
|
3604 phone.SetSSPassword(passwordInfoStatus, passwordPkg, KSsCallBarringAllServices ); |
|
3605 CHECK_EQUALS_L( WaitForRequestWithTimeOut( passwordInfoStatus, ETimeMedium), KErrNone, _L("RMobilePhone::SetSSPassword timed out") ); |
|
3606 CHECK_EQUALS_L( passwordInfoStatus.Int(), KErrNone, _L("RMobilePhone::SetSSPassword did not return KErrNone")); |
|
3607 |
|
3608 // |
|
3609 // SET UP END |
|
3610 // |
|
3611 |
|
3612 StartTest(); |
|
3613 |
|
3614 // |
|
3615 // TEST START |
|
3616 // |
|
3617 |
|
3618 |
|
3619 // === Set the call barring password but supply wrong old password. === |
|
3620 |
|
3621 // Change the call barring password using RMobilePhone::SetSSPassword with |
|
3622 // aService=330 and |
|
3623 // aPassword=packaged RMobilePhone::TMobilePhonePasswordChangeV2 with |
|
3624 // iOldPassword=incorrect old password, |
|
3625 // iNewPassword=iVerifiedPassword=a four digit new password |
|
3626 // Check error returned. |
|
3627 passwordInfo.iOldPassword = KIncorrectPassword; |
|
3628 passwordInfo.iNewPassword = password; |
|
3629 passwordInfo.iVerifiedPassword = password; |
|
3630 RMobilePhone::TMobilePhonePasswordChangeV2Pckg passwordPkg2(passwordInfo); |
|
3631 phone.SetSSPassword(passwordInfoStatus, passwordPkg2, KSsCallBarringAllServices ); |
|
3632 ASSERT_EQUALS( WaitForRequestWithTimeOut( passwordInfoStatus, ETimeMedium), KErrNone, _L("RMobilePhone::SetSSPassword timed out") ); |
|
3633 ASSERT_TRUE( passwordInfoStatus.Int()!= KErrNone, _L("RMobilePhone::SetSSPassword did return KErrNone")); |
|
3634 |
|
3635 |
|
3636 // |
|
3637 // TEST END |
|
3638 // |
|
3639 |
|
3640 StartCleanup(); |
|
3641 |
|
3642 // Verify correct password values |
|
3643 passwordInfo.iOldPassword = password; |
|
3644 passwordInfo.iNewPassword = password; |
|
3645 passwordInfo.iVerifiedPassword = password; |
|
3646 phone.SetSSPassword(passwordInfoStatus, passwordPkg, KSsCallBarringAllServices ); |
|
3647 ASSERT_EQUALS( WaitForRequestWithTimeOut( passwordInfoStatus, ETimeMedium), KErrNone, _L("RMobilePhone::SetSSPassword timed out") ); |
|
3648 ASSERT_EQUALS( passwordInfoStatus.Int(),KErrNone, _L("RMobilePhone::SetSSPassword returned an error")); |
|
3649 |
|
3650 // passwordInfoStatus |
|
3651 CleanupStack::PopAndDestroy(1, &passwordInfoStatus); |
|
3652 return TestStepResult(); |
|
3653 } |
|
3654 |
|
3655 TPtrC CCTSYIntegrationTestCallBarring0013::GetTestStepName() |
|
3656 /** |
|
3657 * @return The test step name. |
|
3658 */ |
|
3659 { |
|
3660 return _L("CCTSYIntegrationTestCallBarring0013"); |
|
3661 } |
|
3662 |
|
3663 |
|
3664 CCTSYIntegrationTestCallBarring0014::CCTSYIntegrationTestCallBarring0014(CEtelSessionMgr& aEtelSessionMgr) |
|
3665 : CCTSYIntegrationTestCallBarringBase(aEtelSessionMgr) |
|
3666 /** |
|
3667 * Constructor. |
|
3668 */ |
|
3669 { |
|
3670 SetTestStepName(CCTSYIntegrationTestCallBarring0014::GetTestStepName()); |
|
3671 } |
|
3672 |
|
3673 CCTSYIntegrationTestCallBarring0014::~CCTSYIntegrationTestCallBarring0014() |
|
3674 /** |
|
3675 * Destructor. |
|
3676 */ |
|
3677 { |
|
3678 } |
|
3679 |
|
3680 TVerdict CCTSYIntegrationTestCallBarring0014::doTestStepL() |
|
3681 /** |
|
3682 * @SYMTestCaseID BA-CTSY-INT-CBAR-0014 |
|
3683 * @SYMFssID BA/CTSY/CBAR-0014 |
|
3684 * @SYMTestCaseDesc Change call barring password specifying wrong repeat of the new password. |
|
3685 * @SYMTestPriority High |
|
3686 * @SYMTestActions |
|
3687 * @SYMTestExpectedResults Pass - Error is returned on attempt to change password. |
|
3688 * @SYMTestType CIT |
|
3689 * @SYMTestCaseDependencies live/automatic |
|
3690 * |
|
3691 * Reason for test: Verify password is not changed. |
|
3692 * |
|
3693 * @return - TVerdict code |
|
3694 */ |
|
3695 { |
|
3696 |
|
3697 // |
|
3698 // SET UP |
|
3699 // |
|
3700 |
|
3701 RMobilePhone& phone = iEtelSessionMgr.GetPhoneL(KMainServer, KMainPhone); |
|
3702 RMobilePhone::TMobilePassword password; |
|
3703 CheckCBPasswordL( phone, password ); |
|
3704 |
|
3705 // Ensure RMobilePhone::GetCallServiceCaps returns caps in set of KCapsChangeCBPassword |
|
3706 TUint32 callServiceCaps; |
|
3707 TUint32 expectedservicecaps = RMobilePhone::KCapsChangeCBPassword; |
|
3708 TInt err = phone.GetCallServiceCaps( callServiceCaps ); |
|
3709 CHECK_EQUALS_L(err, KErrNone, _L("RMobilePhone::GetCallServiceCaps returned error")); |
|
3710 CHECK_BITS_SET_L(callServiceCaps, expectedservicecaps, KNoUnwantedBits, _L("RMobilePhone::GetCallServiceCaps returned wrong caps")); |
|
3711 |
|
3712 // Set the call barring password to a known password using RMobilePhone::SetSSPassword |
|
3713 TExtEtelRequestStatus passwordInfoStatus(phone, EMobilePhoneSetSSPassword); |
|
3714 CleanupStack::PushL(passwordInfoStatus); |
|
3715 RMobilePhone::TMobilePhonePasswordChangeV2 passwordInfo; |
|
3716 passwordInfo.iOldPassword = password; |
|
3717 passwordInfo.iNewPassword = password; |
|
3718 passwordInfo.iVerifiedPassword = password; |
|
3719 RMobilePhone::TMobilePhonePasswordChangeV2Pckg passwordPkg(passwordInfo); |
|
3720 phone.SetSSPassword(passwordInfoStatus, passwordPkg, KSsCallBarringAllServices ); |
|
3721 CHECK_EQUALS_L( WaitForRequestWithTimeOut( passwordInfoStatus, ETimeMedium), KErrNone, _L("RMobilePhone::SetSSPassword timed out") ); |
|
3722 CHECK_EQUALS_L( passwordInfoStatus.Int(), KErrNone, _L("RMobilePhone::SetSSPassword did not return KErrNone")); |
|
3723 |
|
3724 // |
|
3725 // SET UP END |
|
3726 // |
|
3727 |
|
3728 StartTest(); |
|
3729 |
|
3730 // |
|
3731 // TEST START |
|
3732 // |
|
3733 |
|
3734 |
|
3735 // === Set the call barring password but supply wrong repeat password. === |
|
3736 |
|
3737 // Change the call barring password using RMobilePhone::SetSSPassword with |
|
3738 // aService=330 and |
|
3739 // aPassword=packaged RMobilePhone::TMobilePhonePasswordChangeV2 |
|
3740 // with iOldPassword=incorrect old password, |
|
3741 // iNewPassword=new four digit password and iVerifiedPassword != iNewPassword |
|
3742 // Check error returned. |
|
3743 passwordInfo.iOldPassword = KIncorrectPassword; |
|
3744 passwordInfo.iNewPassword = password; |
|
3745 passwordInfo.iVerifiedPassword = KAltPassword4; |
|
3746 RMobilePhone::TMobilePhonePasswordChangeV2Pckg passwordPkg2(passwordInfo); |
|
3747 phone.SetSSPassword(passwordInfoStatus, passwordPkg2, KSsCallBarringAllServices ); |
|
3748 ASSERT_EQUALS( WaitForRequestWithTimeOut( passwordInfoStatus, ETimeMedium), KErrNone, _L("RMobilePhone::SetSSPassword timed out") ); |
|
3749 ASSERT_TRUE( passwordInfoStatus.Int()!= KErrNone, _L("RMobilePhone::SetSSPassword did return KErrNone")); |
|
3750 |
|
3751 |
|
3752 // |
|
3753 // TEST END |
|
3754 // |
|
3755 |
|
3756 StartCleanup(); |
|
3757 |
|
3758 // Verify correct password values |
|
3759 passwordInfo.iOldPassword = password; |
|
3760 passwordInfo.iNewPassword = password; |
|
3761 passwordInfo.iVerifiedPassword = password; |
|
3762 phone.SetSSPassword(passwordInfoStatus, passwordPkg, KSsCallBarringAllServices ); |
|
3763 ASSERT_EQUALS( WaitForRequestWithTimeOut( passwordInfoStatus, ETimeMedium), KErrNone, _L("RMobilePhone::SetSSPassword timed out") ); |
|
3764 ASSERT_EQUALS( passwordInfoStatus.Int(),KErrNone, _L("RMobilePhone::SetSSPassword returned an error")); |
|
3765 |
|
3766 // passwordInfoStatus |
|
3767 CleanupStack::PopAndDestroy(1, &passwordInfoStatus); |
|
3768 |
|
3769 return TestStepResult(); |
|
3770 } |
|
3771 |
|
3772 TPtrC CCTSYIntegrationTestCallBarring0014::GetTestStepName() |
|
3773 /** |
|
3774 * @return The test step name. |
|
3775 */ |
|
3776 { |
|
3777 return _L("CCTSYIntegrationTestCallBarring0014"); |
|
3778 } |
|
3779 |
|
3780 |
|
3781 |
|
3782 CCTSYIntegrationTestCallBarring0015::CCTSYIntegrationTestCallBarring0015(CEtelSessionMgr& aEtelSessionMgr) |
|
3783 : CCTSYIntegrationTestCallBarringBase(aEtelSessionMgr) |
|
3784 /** |
|
3785 * Constructor. |
|
3786 */ |
|
3787 { |
|
3788 SetTestStepName(CCTSYIntegrationTestCallBarring0015::GetTestStepName()); |
|
3789 } |
|
3790 |
|
3791 CCTSYIntegrationTestCallBarring0015::~CCTSYIntegrationTestCallBarring0015() |
|
3792 /** |
|
3793 * Destructor. |
|
3794 */ |
|
3795 { |
|
3796 } |
|
3797 |
|
3798 TVerdict CCTSYIntegrationTestCallBarring0015::doTestStepL() |
|
3799 /** |
|
3800 * @SYMTestCaseID BA-CTSY-INT-CBAR-0015 |
|
3801 * @SYMFssID BA/CTSY/CBAR-0015 |
|
3802 * @SYMTestCaseDesc Change the call barring password to a new one only 3 digits long. |
|
3803 * @SYMTestPriority High |
|
3804 * @SYMTestActions RMobilePhone::SetCallBarringPassword |
|
3805 * @SYMTestExpectedResults Pass - Error is returned on attempt to change password. |
|
3806 * @SYMTestType CIT |
|
3807 * @SYMTestCaseDependencies live/automatic |
|
3808 * |
|
3809 * Reason for test: Verify password is not changed. |
|
3810 * |
|
3811 * @return - TVerdict code |
|
3812 */ |
|
3813 { |
|
3814 |
|
3815 // |
|
3816 // SET UP |
|
3817 // |
|
3818 |
|
3819 RMobilePhone& phone = iEtelSessionMgr.GetPhoneL(KMainServer, KMainPhone); |
|
3820 RMobilePhone::TMobilePassword password; |
|
3821 CheckCBPasswordL( phone, password ); |
|
3822 |
|
3823 DEBUG_PRINTF2(_L("Checking call barring password from CheckCBPasswordL: %S"), &password); |
|
3824 |
|
3825 // Ensure RMobilePhone::GetCallServiceCaps returns caps in set of KCapsChangeCBPassword |
|
3826 TUint32 callServiceCaps; |
|
3827 TUint32 expectedservicecaps = RMobilePhone::KCapsChangeCBPassword; |
|
3828 TInt err = phone.GetCallServiceCaps( callServiceCaps ); |
|
3829 CHECK_EQUALS_L(err, KErrNone, _L("RMobilePhone::GetCallServiceCaps returned error")); |
|
3830 CHECK_BITS_SET_L(callServiceCaps, expectedservicecaps, KNoUnwantedBits, _L("RMobilePhone::GetCallServiceCaps returned wrong caps")); |
|
3831 |
|
3832 // Set the call barring password to a known password using RMobilePhone::SetSSPassword |
|
3833 TExtEtelRequestStatus passwordInfoStatus(phone, EMobilePhoneSetSSPassword); |
|
3834 CleanupStack::PushL(passwordInfoStatus); |
|
3835 RMobilePhone::TMobilePhonePasswordChangeV2 passwordInfo; |
|
3836 passwordInfo.iOldPassword = password; |
|
3837 passwordInfo.iNewPassword = password; |
|
3838 passwordInfo.iVerifiedPassword = password; |
|
3839 RMobilePhone::TMobilePhonePasswordChangeV2Pckg passwordPkg(passwordInfo); |
|
3840 phone.SetSSPassword(passwordInfoStatus, passwordPkg, KSsCallBarringAllServices ); |
|
3841 CHECK_EQUALS_L( WaitForRequestWithTimeOut( passwordInfoStatus, ETimeMedium), KErrNone, _L("RMobilePhone::SetSSPassword timed out") ); |
|
3842 CHECK_EQUALS_L( passwordInfoStatus.Int(), KErrNone, _L("RMobilePhone::SetSSPassword did not return KErrNone")); |
|
3843 |
|
3844 // |
|
3845 // SET UP END |
|
3846 // |
|
3847 |
|
3848 StartTest(); |
|
3849 |
|
3850 // |
|
3851 // TEST START |
|
3852 // |
|
3853 |
|
3854 |
|
3855 // === Set the call barring password to new one that is too short using RMobilePhone::SetSSPassword === |
|
3856 |
|
3857 // Change the call barring password using RMobilePhone::SetSSPassword with aService=330 with aPassword=packaged RMobilePhone::TMobilePhonePasswordChangeV2 with iOldPassword=incorrect old password, iNewPassword=iVerifiedPassword=new three digit password |
|
3858 passwordInfo.iOldPassword = KIncorrectPassword; |
|
3859 passwordInfo.iNewPassword = KAltPassword5; // three digit password |
|
3860 passwordInfo.iVerifiedPassword = KAltPassword5; |
|
3861 |
|
3862 RMobilePhone::TMobilePhonePasswordChangeV2Pckg passwordPkg2(passwordInfo); |
|
3863 phone.SetSSPassword(passwordInfoStatus, passwordPkg2, KSsCallBarringAllServices ); |
|
3864 ASSERT_EQUALS( WaitForRequestWithTimeOut( passwordInfoStatus, ETimeMedium), KErrNone, _L("RMobilePhone::SetSSPassword timed out") ); |
|
3865 ASSERT_TRUE( passwordInfoStatus.Int()!= KErrNone, _L("RMobilePhone::SetSSPassword did return KErrNone")); |
|
3866 |
|
3867 // Check error returned. |
|
3868 |
|
3869 // === Set the call barring password to new one that is too short using RMobilePhone::SetCallBarringPassword === |
|
3870 |
|
3871 // Change the call barring password using RMobilePhone::SetCallBarringPassword with aPassword.iOldPassword=correct old password, aPassword.iNewPassword=three digit password |
|
3872 // Check error returned. |
|
3873 passwordInfo.iOldPassword = password; |
|
3874 passwordInfo.iNewPassword = KAltPassword5;// three digit password |
|
3875 passwordInfo.iVerifiedPassword = KAltPassword5; |
|
3876 phone.SetSSPassword(passwordInfoStatus, passwordPkg2, KSsCallBarringAllServices ); |
|
3877 ASSERT_EQUALS( WaitForRequestWithTimeOut( passwordInfoStatus, ETimeMedium), KErrNone, _L("RMobilePhone::SetSSPassword timed out") ); |
|
3878 ASSERT_TRUE( passwordInfoStatus.Int()!= KErrNone, _L("RMobilePhone::SetSSPassword did return KErrNone")); |
|
3879 |
|
3880 |
|
3881 // |
|
3882 // TEST END |
|
3883 // |
|
3884 |
|
3885 StartCleanup(); |
|
3886 |
|
3887 // Verify correct password values |
|
3888 passwordInfo.iOldPassword = password; |
|
3889 passwordInfo.iNewPassword = password; |
|
3890 passwordInfo.iVerifiedPassword = password; |
|
3891 phone.SetSSPassword(passwordInfoStatus, passwordPkg, KSsCallBarringAllServices ); |
|
3892 ASSERT_EQUALS( WaitForRequestWithTimeOut( passwordInfoStatus, ETimeMedium), KErrNone, _L("RMobilePhone::SetSSPassword timed out") ); |
|
3893 ASSERT_EQUALS( passwordInfoStatus.Int(),KErrNone, _L("RMobilePhone::SetSSPassword returned an error")); |
|
3894 |
|
3895 // passwordInfoStatus |
|
3896 CleanupStack::PopAndDestroy(1, &passwordInfoStatus); |
|
3897 |
|
3898 return TestStepResult(); |
|
3899 } |
|
3900 |
|
3901 TPtrC CCTSYIntegrationTestCallBarring0015::GetTestStepName() |
|
3902 /** |
|
3903 * @return The test step name. |
|
3904 */ |
|
3905 { |
|
3906 return _L("CCTSYIntegrationTestCallBarring0015"); |
|
3907 } |
|
3908 |
|
3909 CCTSYIntegrationTestCallBarring0016::CCTSYIntegrationTestCallBarring0016(CEtelSessionMgr& aEtelSessionMgr) |
|
3910 : CCTSYIntegrationTestCallBarringBase(aEtelSessionMgr) |
|
3911 /** |
|
3912 * Constructor. |
|
3913 */ |
|
3914 { |
|
3915 SetTestStepName(CCTSYIntegrationTestCallBarring0016::GetTestStepName()); |
|
3916 } |
|
3917 |
|
3918 CCTSYIntegrationTestCallBarring0016::~CCTSYIntegrationTestCallBarring0016() |
|
3919 /** |
|
3920 * Destructor. |
|
3921 */ |
|
3922 { |
|
3923 } |
|
3924 |
|
3925 TVerdict CCTSYIntegrationTestCallBarring0016::doTestStepL() |
|
3926 /** |
|
3927 * @SYMTestCaseID BA-CTSY-INT-CBAR-0016 |
|
3928 * @SYMFssID BA/CTSY/CBAR-0016 |
|
3929 * @SYMTestCaseDesc Set supplementary service password with invalid service code. |
|
3930 * @SYMTestPriority High |
|
3931 * @SYMTestActions |
|
3932 * @SYMTestExpectedResults Pass - KErrArgument is returned. |
|
3933 * @SYMTestType CIT |
|
3934 * @SYMTestCaseDependencies live/manual |
|
3935 * |
|
3936 * Reason for test: Verify KErrArgument is returned. |
|
3937 * |
|
3938 * @return - TVerdict code |
|
3939 */ |
|
3940 { |
|
3941 |
|
3942 // |
|
3943 // SET UP |
|
3944 // |
|
3945 |
|
3946 // |
|
3947 // SET UP END |
|
3948 // |
|
3949 RMobilePhone& phone = iEtelSessionMgr.GetPhoneL(KMainServer, KMainPhone); |
|
3950 RMobilePhone::TMobilePassword password; |
|
3951 CheckCBPasswordL(phone, password); |
|
3952 |
|
3953 StartTest(); |
|
3954 |
|
3955 // |
|
3956 // TEST START |
|
3957 // |
|
3958 |
|
3959 // Set the supplementary service password using RMobilePhone::SetSSPassword with aService = 1234 (an invalid service). |
|
3960 // Check KErrArgument is returned. |
|
3961 |
|
3962 RMobilePhone::TMobilePhonePasswordChangeV2 passwordV2; |
|
3963 RMobilePhone::TMobilePhonePasswordChangeV2Pckg passwordPkg(passwordV2); |
|
3964 |
|
3965 passwordV2.iOldPassword = password; |
|
3966 passwordV2.iNewPassword = password; |
|
3967 passwordV2.iVerifiedPassword = password; |
|
3968 |
|
3969 TExtEtelRequestStatus reqStatus(phone, EMobilePhoneSetSSPassword); |
|
3970 CleanupStack::PushL(reqStatus); |
|
3971 |
|
3972 phone.SetSSPassword(reqStatus, passwordPkg, 1234 ); |
|
3973 ASSERT_EQUALS( WaitForRequestWithTimeOut( reqStatus, ETimeMedium), KErrNone, |
|
3974 _L("RMobilePhone::SetSSPassword timed out") ); |
|
3975 |
|
3976 ASSERT_EQUALS( reqStatus.Int(), KErrArgument, _L("RMobilePhone::SetSSPassword did not return KErrArgument")); |
|
3977 |
|
3978 // |
|
3979 // TEST END |
|
3980 // |
|
3981 |
|
3982 StartCleanup(); |
|
3983 CleanupStack::PopAndDestroy(1, &reqStatus ); |
|
3984 |
|
3985 return TestStepResult(); |
|
3986 } |
|
3987 |
|
3988 TPtrC CCTSYIntegrationTestCallBarring0016::GetTestStepName() |
|
3989 /** |
|
3990 * @return The test step name. |
|
3991 */ |
|
3992 { |
|
3993 return _L("CCTSYIntegrationTestCallBarring0016"); |
|
3994 } |
|
3995 |
|
3996 |
|
3997 |