10286 ASSERT_EQUALS(KErrTimedOut, requestStatus.Int()); |
10275 ASSERT_EQUALS(KErrTimedOut, requestStatus.Int()); |
10287 |
10276 |
10288 CleanupStack::PopAndDestroy(4, this); // call, line, expectData, this |
10277 CleanupStack::PopAndDestroy(4, this); // call, line, expectData, this |
10289 } |
10278 } |
10290 |
10279 |
10291 /** |
|
10292 @SYMTestCaseID BA-CTSY-CCON-MTACTC-0001 |
|
10293 @SYMComponent telephony_ctsy |
|
10294 @SYMTestCaseDesc Test support in CTSY for RMobilePhone::TerminateActiveCalls When the call status is EStatusHold |
|
10295 @SYMTestPriority High |
|
10296 @SYMTestActions Invokes RMobilePhone::TerminateActiveCalls |
|
10297 @SYMTestExpectedResults Pass |
|
10298 @SYMTestType CT |
|
10299 */ |
|
10300 void CCTsyCallControlFU::TestTerminateActiveCalls0001L() |
|
10301 { |
|
10302 OpenEtelServerL(EUseExtendedError); |
|
10303 CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
|
10304 OpenPhoneL(); |
|
10305 |
|
10306 RBuf8 expectData; |
|
10307 CleanupClosePushL(expectData); // PUSH |
|
10308 |
|
10309 TRequestStatus requestStatus; |
|
10310 |
|
10311 //----------------------------------------------------------------------- |
|
10312 // TEST 0: with no active calls |
|
10313 //---------------------------------------------------------------------- |
|
10314 iMockLTSY.ExpectL(ECtsyPhoneTerminateActiveCallsReq,KErrNone); |
|
10315 iMockLTSY.CompleteL(ECtsyPhoneTerminateActiveCallsComp, KErrNone); |
|
10316 iPhone.TerminateActiveCalls(requestStatus); |
|
10317 User::WaitForRequest(requestStatus); |
|
10318 ASSERT_EQUALS(KErrNone, requestStatus.Int()); |
|
10319 AssertMockLtsyStatusL(); |
|
10320 |
|
10321 //------------------------------------------------------------------------- |
|
10322 // TEST A: failure to dispatch request to LTSY |
|
10323 //------------------------------------------------------------------------- |
|
10324 |
|
10325 // open new line and call for KMmTsyVoice1LineName |
|
10326 RLine line; |
|
10327 RCall call; |
|
10328 TInt errorCode = OpenNewLineLC(iPhone, line, KMmTsyVoice1LineName); // PUSH |
|
10329 ASSERT_EQUALS(KErrNone, errorCode); |
|
10330 |
|
10331 // create new incoming call |
|
10332 TName incomingCallName; |
|
10333 TInt callId = 1; |
|
10334 errorCode = CreateIncomingCallL(line, callId, incomingCallName, |
|
10335 RMobilePhone::EVoiceService, RMobileCall::EStatusHold); |
|
10336 |
|
10337 ASSERT_EQUALS(KErrNone, errorCode); |
|
10338 |
|
10339 CleanupClosePushL(call); // PUSH |
|
10340 errorCode = call.OpenExistingCall(line, incomingCallName); |
|
10341 ASSERT_EQUALS(KErrNone, errorCode); |
|
10342 //------------------------------------------------------------------------- |
|
10343 |
|
10344 TMockLtsyData1<TInt> mockData(callId); |
|
10345 mockData.SerialiseL(expectData); |
|
10346 iMockLTSY.ExpectL(ECtsyPhoneTerminateActiveCallsReq, expectData, KErrNotSupported); |
|
10347 iPhone.TerminateActiveCalls(requestStatus); |
|
10348 |
|
10349 User::WaitForRequest(requestStatus); |
|
10350 ASSERT_EQUALS(KErrNotSupported, requestStatus.Int()); |
|
10351 AssertMockLtsyStatusL(); |
|
10352 |
|
10353 |
|
10354 |
|
10355 //------------------------------------------------------------------------- |
|
10356 // TEST B: failure on completion of pending request from LTSY->CTSY |
|
10357 //------------------------------------------------------------------------- |
|
10358 iMockLTSY.ExpectL(ECtsyPhoneTerminateActiveCallsReq, expectData); |
|
10359 iMockLTSY.CompleteL(ECtsyPhoneTerminateActiveCallsComp, KErrGeneral); |
|
10360 |
|
10361 iPhone.TerminateActiveCalls(requestStatus); |
|
10362 |
|
10363 User::WaitForRequest(requestStatus); |
|
10364 ASSERT_EQUALS(KErrGeneral, requestStatus.Int()); |
|
10365 AssertMockLtsyStatusL(); |
|
10366 |
|
10367 //------------------------------------------------------------------------- |
|
10368 // TEST C: Successful completion request of |
|
10369 // RMobilePhone::TerminateActiveCalls. |
|
10370 //------------------------------------------------------------------------- |
|
10371 |
|
10372 iMockLTSY.ExpectL(ECtsyPhoneTerminateActiveCallsReq, expectData); |
|
10373 iMockLTSY.CompleteL(ECtsyPhoneTerminateActiveCallsComp, KErrNone); |
|
10374 |
|
10375 iPhone.TerminateActiveCalls(requestStatus); |
|
10376 User::WaitForRequest(requestStatus); |
|
10377 ASSERT_EQUALS(KErrNone, requestStatus.Int()); |
|
10378 AssertMockLtsyStatusL(); |
|
10379 |
|
10380 //------------------------------------------------------------------------- |
|
10381 // TEST E: Unsolicited completion of RMobilePhone::TerminateActiveCalls |
|
10382 // from LTSY. |
|
10383 //------------------------------------------------------------------------- |
|
10384 |
|
10385 TRequestStatus mockLtsyStatus; |
|
10386 iMockLTSY.NotifyTerminated(mockLtsyStatus); |
|
10387 iMockLTSY.CompleteL(ECtsyPhoneTerminateActiveCallsComp, KErrNone); |
|
10388 User::WaitForRequest(mockLtsyStatus); |
|
10389 ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int()); |
|
10390 AssertMockLtsyStatusL(); |
|
10391 |
|
10392 CleanupStack::PopAndDestroy(4, this); // call, line, expectData, this |
|
10393 } |
|
10394 |
|
10395 |
|
10396 /** |
|
10397 @SYMTestCaseID BA-CTSY-CCON-MTACTC-000B1 |
|
10398 @SYMComponent telephony_ctsy |
|
10399 @SYMTestCaseDesc Test support in CTSY for RMobilePhone::TerminateActiveCalls When the call status is EStatusRinging |
|
10400 @SYMTestPriority High |
|
10401 @SYMTestActions Invokes RMobilePhone::TerminateActiveCalls |
|
10402 @SYMTestExpectedResults Pass |
|
10403 @SYMTestType CT |
|
10404 */ |
|
10405 void CCTsyCallControlFU::TestTerminateActiveCalls0001bL() |
|
10406 { |
|
10407 OpenEtelServerL(EUseExtendedError); |
|
10408 CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
|
10409 OpenPhoneL(); |
|
10410 |
|
10411 RBuf8 expectData; |
|
10412 CleanupClosePushL(expectData); // PUSH |
|
10413 |
|
10414 TRequestStatus requestStatus; |
|
10415 // open new line and call for KMmTsyVoice1LineName |
|
10416 RLine line; |
|
10417 RCall call; |
|
10418 TInt errorCode = OpenNewLineLC(iPhone, line, KMmTsyVoice1LineName); // PUSH |
|
10419 ASSERT_EQUALS(KErrNone, errorCode); |
|
10420 |
|
10421 // create new incoming call |
|
10422 TName incomingCallName; |
|
10423 TInt callId = 1; |
|
10424 errorCode = CreateIncomingCallL(line, callId, incomingCallName, |
|
10425 RMobilePhone::EVoiceService, RMobileCall::EStatusRinging); |
|
10426 |
|
10427 ASSERT_EQUALS(KErrNone, errorCode); |
|
10428 CleanupClosePushL(call); // PUSH |
|
10429 errorCode = call.OpenExistingCall(line, incomingCallName); |
|
10430 ASSERT_EQUALS(KErrNone, errorCode); |
|
10431 iMockLTSY.ExpectL(ECtsyPhoneTerminateActiveCallsReq,KErrNone); |
|
10432 iMockLTSY.CompleteL(ECtsyPhoneTerminateActiveCallsComp, KErrNone); |
|
10433 iPhone.TerminateActiveCalls(requestStatus); |
|
10434 User::WaitForRequest(requestStatus); |
|
10435 ASSERT_EQUALS(KErrNone, requestStatus.Int()); |
|
10436 AssertMockLtsyStatusL(); |
|
10437 |
|
10438 CleanupStack::PopAndDestroy(4, this); // call, line, expectData, this |
|
10439 } |
|
10440 |
|
10441 /** |
|
10442 @SYMTestCaseID BA-CTSY-CCON-MTACTC-000C1 |
|
10443 @SYMComponent telephony_ctsy |
|
10444 @SYMTestCaseDesc Test support in CTSY for RMobilePhone::TerminateActiveCalls When the call status is EStatusConnecting |
|
10445 @SYMTestPriority High |
|
10446 @SYMTestActions Invokes RMobilePhone::TerminateActiveCalls |
|
10447 @SYMTestExpectedResults Pass |
|
10448 @SYMTestType CT |
|
10449 */ |
|
10450 void CCTsyCallControlFU::TestTerminateActiveCalls0001cL() |
|
10451 { |
|
10452 OpenEtelServerL(EUseExtendedError); |
|
10453 CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
|
10454 OpenPhoneL(); |
|
10455 |
|
10456 RBuf8 expectData; |
|
10457 CleanupClosePushL(expectData); // PUSH |
|
10458 |
|
10459 TRequestStatus requestStatus; |
|
10460 // open new line and call for KMmTsyVoice1LineName |
|
10461 RLine line; |
|
10462 TInt errorCode = OpenNewLineLC(iPhone, line, KMmTsyVoice1LineName); // PUSH |
|
10463 ASSERT_EQUALS(KErrNone, errorCode); |
|
10464 |
|
10465 // create new incoming call |
|
10466 TName incomingCallName; |
|
10467 TInt callId = 1; |
|
10468 errorCode = CreateIncomingCallL(line, callId, incomingCallName, |
|
10469 RMobilePhone::EVoiceService, RMobileCall::EStatusConnecting); |
|
10470 |
|
10471 ASSERT_EQUALS(KErrNone, errorCode); |
|
10472 RCall call; |
|
10473 CleanupClosePushL(call); // PUSH |
|
10474 errorCode = call.OpenExistingCall(line, incomingCallName); |
|
10475 ASSERT_EQUALS(KErrNone, errorCode); |
|
10476 iMockLTSY.ExpectL(ECtsyPhoneTerminateActiveCallsReq,KErrNone); |
|
10477 iMockLTSY.CompleteL(ECtsyPhoneTerminateActiveCallsComp, KErrNone); |
|
10478 iPhone.TerminateActiveCalls(requestStatus); |
|
10479 User::WaitForRequest(requestStatus); |
|
10480 ASSERT_EQUALS(KErrNone, requestStatus.Int()); |
|
10481 AssertMockLtsyStatusL(); |
|
10482 |
|
10483 CleanupStack::PopAndDestroy(4, this); // call, line, expectData, this |
|
10484 } |
|
10485 |
|
10486 |
|
10487 |
|
10488 /** |
|
10489 @SYMTestCaseID BA-CTSY-CCON-MTACTC-0002 |
|
10490 @SYMComponent telephony_ctsy |
|
10491 @SYMTestCaseDesc Test support in CTSY for cancelling RMobilePhone::TerminateActiveCalls |
|
10492 @SYMTestPriority High |
|
10493 @SYMTestActions Invokes RMobilePhone::TerminateActiveCalls and cancels it |
|
10494 @SYMTestExpectedResults Pass |
|
10495 @SYMTestType CT |
|
10496 */ |
|
10497 void CCTsyCallControlFU::TestTerminateActiveCalls0002L() |
|
10498 { |
|
10499 OpenEtelServerL(EUseExtendedError); |
|
10500 CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
|
10501 OpenPhoneL(); |
|
10502 |
|
10503 RBuf8 expectData; |
|
10504 CleanupClosePushL(expectData); // PUSH |
|
10505 |
|
10506 //------------------------------------------------------------------------- |
|
10507 |
|
10508 // open new line and call for KMmTsyVoice1LineName |
|
10509 RLine line; |
|
10510 RCall call; |
|
10511 TInt errorCode = OpenNewLineLC(iPhone, line, KMmTsyVoice1LineName); // PUSH |
|
10512 ASSERT_EQUALS(KErrNone, errorCode); |
|
10513 |
|
10514 // create new incoming call |
|
10515 TName incomingCallName; |
|
10516 TInt callId = 1; |
|
10517 errorCode = CreateIncomingCallL(line, callId, incomingCallName, |
|
10518 RMobilePhone::EVoiceService, RMobileCall::EStatusHold); |
|
10519 |
|
10520 ASSERT_EQUALS(KErrNone, errorCode); |
|
10521 |
|
10522 CleanupClosePushL(call); // PUSH |
|
10523 errorCode = call.OpenExistingCall(line, incomingCallName); |
|
10524 ASSERT_EQUALS(KErrNone, errorCode); |
|
10525 //------------------------------------------------------------------------- |
|
10526 |
|
10527 //------------------------------------------------------------------------- |
|
10528 // Test A: cancelling of RMobilePhone::TerminateActiveCalls |
|
10529 //------------------------------------------------------------------------- |
|
10530 |
|
10531 TMockLtsyData1<TInt> mockData(callId); |
|
10532 mockData.SerialiseL(expectData); |
|
10533 |
|
10534 TRequestStatus mockLtsyStatus; |
|
10535 iMockLTSY.NotifyTerminated(mockLtsyStatus); |
|
10536 |
|
10537 // Expect call down to LTSY for this IPC |
|
10538 iMockLTSY.ExpectL(ECtsyPhoneTerminateActiveCallsReq, expectData); |
|
10539 |
|
10540 // Queue response to be delayed to give time for cancel to come through |
|
10541 // There is no interface for cancelling the simple TerminateActiveCalls request once passed to LTSY, |
|
10542 // however this test will still emulate the completion of the request which will finally return from LTSY regardless. |
|
10543 |
|
10544 iMockLTSY.CompleteL(ECtsyPhoneTerminateActiveCallsComp, KErrNone, 10); |
|
10545 |
|
10546 TRequestStatus requestStatus; |
|
10547 iPhone.TerminateActiveCalls(requestStatus); |
|
10548 iPhone.CancelAsyncRequest(EMobilePhoneTerminateActiveCalls); |
|
10549 User::WaitForRequest(requestStatus); |
|
10550 INFO_PRINTF2(_L("requestStatus.Int() %d"),(requestStatus.Int())); |
|
10551 ASSERT_EQUALS(KErrNone, requestStatus.Int()); |
|
10552 |
|
10553 AssertMockLtsyStatusL(); |
|
10554 |
|
10555 User::WaitForRequest(mockLtsyStatus); |
|
10556 INFO_PRINTF2(_L("mockLtsyStatus.Int() %d"),(mockLtsyStatus.Int())); |
|
10557 |
|
10558 AssertMockLtsyStatusL(); |
|
10559 |
|
10560 CleanupStack::PopAndDestroy(4, this); // call, line, expectData, this |
|
10561 } |
|
10562 |
|
10563 /** |
|
10564 @SYMTestCaseID BA-CTSY-CCON-MTACTC-0004 |
|
10565 @SYMComponent telephony_ctsy |
|
10566 @SYMTestCaseDesc Test support in CTSY for multiple client requests of RMobilePhone::TerminateActiveCalls |
|
10567 @SYMTestPriority High |
|
10568 @SYMTestActions Invokes RMobilePhone::TerminateActiveCalls on multiple clients |
|
10569 @SYMTestExpectedResults Pass |
|
10570 @SYMTestType CT |
|
10571 */ |
|
10572 void CCTsyCallControlFU::TestTerminateActiveCalls0004L() |
|
10573 { |
|
10574 |
|
10575 OpenEtelServerL(EUseExtendedError); |
|
10576 CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
|
10577 OpenPhoneL(); |
|
10578 |
|
10579 // Open second client |
|
10580 RTelServer telServer2; |
|
10581 TInt ret = telServer2.Connect(); |
|
10582 ASSERT_EQUALS(KErrNone, ret); |
|
10583 CleanupClosePushL(telServer2); |
|
10584 |
|
10585 RMobilePhone phone2; |
|
10586 ret = phone2.Open(iTelServer,KMmTsyPhoneName); |
|
10587 ASSERT_EQUALS(KErrNone, ret); |
|
10588 CleanupClosePushL(phone2); |
|
10589 |
|
10590 // |
|
10591 // set up line and call for first client |
|
10592 |
|
10593 RLine line; |
|
10594 RCall call; |
|
10595 TInt errorCode = OpenNewLineLC(iPhone, line, KMmTsyVoice1LineName); // PUSH |
|
10596 ASSERT_EQUALS(KErrNone, errorCode); |
|
10597 |
|
10598 // create new incoming call |
|
10599 TName incomingCallName; |
|
10600 TInt callId = 1; |
|
10601 errorCode = CreateIncomingCallL(line, callId, incomingCallName, |
|
10602 RMobilePhone::EVoiceService, RMobileCall::EStatusHold); |
|
10603 |
|
10604 ASSERT_EQUALS(KErrNone, errorCode); |
|
10605 |
|
10606 CleanupClosePushL(call); // PUSH |
|
10607 errorCode = call.OpenExistingCall(line, incomingCallName); |
|
10608 ASSERT_EQUALS(KErrNone, errorCode); |
|
10609 |
|
10610 // |
|
10611 // set up call for second client |
|
10612 |
|
10613 RLine line2; |
|
10614 RCall call2; |
|
10615 errorCode = OpenNewLineLC(phone2, line2, KMmTsyVoice1LineName); // PUSH |
|
10616 ASSERT_EQUALS(KErrNone, errorCode); |
|
10617 |
|
10618 // create new incoming call |
|
10619 TName incomingCallName2; |
|
10620 TInt callId2 = 2; |
|
10621 errorCode = CreateIncomingCallL(line2, callId2, incomingCallName2, |
|
10622 RMobilePhone::EVoiceService, RMobileCall::EStatusHold); |
|
10623 |
|
10624 ASSERT_EQUALS(KErrNone, errorCode); |
|
10625 |
|
10626 CleanupClosePushL(call2); // PUSH |
|
10627 errorCode = call2.OpenExistingCall(line2, incomingCallName2); |
|
10628 ASSERT_EQUALS(KErrNone, errorCode); |
|
10629 |
|
10630 // let's start testing... |
|
10631 |
|
10632 RBuf8 expectData; |
|
10633 CleanupClosePushL(expectData); // PUSH |
|
10634 TMockLtsyData1<TInt> mockData(callId); |
|
10635 mockData.SerialiseL(expectData); |
|
10636 |
|
10637 iMockLTSY.ExpectL(ECtsyPhoneTerminateActiveCallsReq, expectData); |
|
10638 iMockLTSY.CompleteL(ECtsyPhoneTerminateActiveCallsComp, KErrNone, 20); |
|
10639 TRequestStatus requestStatus; |
|
10640 TRequestStatus requestStatus2; |
|
10641 iPhone.TerminateActiveCalls(requestStatus); |
|
10642 phone2.TerminateActiveCalls(requestStatus2); |
|
10643 |
|
10644 User::WaitForRequest(requestStatus); |
|
10645 ASSERT_EQUALS(KErrNone, requestStatus.Int()); |
|
10646 |
|
10647 User::WaitForRequest(requestStatus2); |
|
10648 ASSERT_EQUALS(KErrServerBusy, requestStatus2.Int()); |
|
10649 |
|
10650 AssertMockLtsyStatusL(); |
|
10651 |
|
10652 CleanupStack::PopAndDestroy(8, this); // expectData, |
|
10653 // call2, line2, call, line, |
|
10654 // phone2, telServer2, this |
|
10655 } |
|
10656 |
|
10657 /** |
|
10658 @SYMTestCaseID BA-CTSY-CCON-MTACTC-0005 |
|
10659 @SYMComponent telephony_ctsy |
|
10660 @SYMTestCaseDesc Test support in CTSY for RMobilePhone::TerminateActiveCalls with timeout. |
|
10661 @SYMTestPriority High |
|
10662 @SYMTestActions Invokes RMobilePhone::TerminateActiveCalls and tests for timeout. |
|
10663 @SYMTestExpectedResults Pass |
|
10664 @SYMTestType CT |
|
10665 */ |
|
10666 void CCTsyCallControlFU::TestTerminateActiveCalls0005L() |
|
10667 { |
|
10668 OpenEtelServerL(EUseExtendedError); |
|
10669 CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
|
10670 OpenPhoneL(); |
|
10671 |
|
10672 RBuf8 expectData; |
|
10673 CleanupClosePushL(expectData); // PUSH |
|
10674 |
|
10675 |
|
10676 // open new line and call for KMmTsyVoice1LineName |
|
10677 RLine line; |
|
10678 RCall call; |
|
10679 TInt errorCode = OpenNewLineLC(iPhone, line, KMmTsyVoice1LineName); // PUSH |
|
10680 ASSERT_EQUALS(KErrNone, errorCode); |
|
10681 |
|
10682 |
|
10683 // create new incoming call |
|
10684 TName incomingCallName; |
|
10685 TInt callId = 1; |
|
10686 errorCode = CreateIncomingCallL(line, callId, incomingCallName, |
|
10687 RMobilePhone::EVoiceService, RMobileCall::EStatusHold); |
|
10688 |
|
10689 ASSERT_EQUALS(KErrNone, errorCode); |
|
10690 |
|
10691 CleanupClosePushL(call); // PUSH |
|
10692 errorCode = call.OpenExistingCall(line, incomingCallName); |
|
10693 ASSERT_EQUALS(KErrNone, errorCode); |
|
10694 //------------------------------------------------------------------------- |
|
10695 |
|
10696 TMockLtsyData1<TInt> mockData(callId); |
|
10697 mockData.SerialiseL(expectData); |
|
10698 //------------------------------------------------------------------------- |
|
10699 // Test A: Test timeout of RMobilePhone::TerminateActiveCalls |
|
10700 //------------------------------------------------------------------------- |
|
10701 |
|
10702 TRequestStatus requestStatus; |
|
10703 iMockLTSY.ExpectL(ECtsyPhoneTerminateActiveCallsReq, expectData); |
|
10704 iPhone.TerminateActiveCalls(requestStatus); |
|
10705 User::WaitForRequest(requestStatus); |
|
10706 AssertMockLtsyStatusL(); |
|
10707 ASSERT_EQUALS(KErrTimedOut, requestStatus.Int()); |
|
10708 |
|
10709 CleanupStack::PopAndDestroy(4, this); // call, line, expectData, this |
|
10710 } |
|
10711 |
10280 |
10712 /** |
10281 /** |
10713 @SYMTestCaseID BA-CTSY-CCON-MSICT-0001 |
10282 @SYMTestCaseID BA-CTSY-CCON-MSICT-0001 |
10714 @SYMComponent telephony_ctsy |
10283 @SYMComponent telephony_ctsy |
10715 @SYMTestCaseDesc Test support in CTSY for RMobilePhone::SetIncomingCallType |
10284 @SYMTestCaseDesc Test support in CTSY for RMobilePhone::SetIncomingCallType |