telephonyserverplugins/common_tsy/test/component/src/cctsycallcontrolfu.cpp
branchRCL_3
changeset 65 630d2f34d719
parent 17 3f227a47ad75
child 66 07a122eea281
equal deleted inserted replaced
61:17af172ffa5f 65:630d2f34d719
   112 	ADD_TEST_STEP_ISO_CPP(CCTsyCallControlFU, TestTransfer00011L);
   112 	ADD_TEST_STEP_ISO_CPP(CCTsyCallControlFU, TestTransfer00011L);
   113 	ADD_TEST_STEP_ISO_CPP(CCTsyCallControlFU, TestTerminateAllCalls0001L);
   113 	ADD_TEST_STEP_ISO_CPP(CCTsyCallControlFU, TestTerminateAllCalls0001L);
   114 	ADD_TEST_STEP_ISO_CPP(CCTsyCallControlFU, TestTerminateAllCalls0002L);
   114 	ADD_TEST_STEP_ISO_CPP(CCTsyCallControlFU, TestTerminateAllCalls0002L);
   115 	ADD_TEST_STEP_ISO_CPP(CCTsyCallControlFU, TestTerminateAllCalls0004L);
   115 	ADD_TEST_STEP_ISO_CPP(CCTsyCallControlFU, TestTerminateAllCalls0004L);
   116 	ADD_TEST_STEP_ISO_CPP(CCTsyCallControlFU, TestTerminateAllCalls0005L);	
   116 	ADD_TEST_STEP_ISO_CPP(CCTsyCallControlFU, TestTerminateAllCalls0005L);	
       
   117     ADD_TEST_STEP_ISO_CPP(CCTsyCallControlFU, TestTerminateActiveCalls0001L);
       
   118     ADD_TEST_STEP_ISO_CPP(CCTsyCallControlFU, TestTerminateActiveCalls0001bL);
       
   119     ADD_TEST_STEP_ISO_CPP(CCTsyCallControlFU, TestTerminateActiveCalls0001cL);
       
   120     ADD_TEST_STEP_ISO_CPP(CCTsyCallControlFU, TestTerminateActiveCalls0002L);
       
   121     ADD_TEST_STEP_ISO_CPP(CCTsyCallControlFU, TestTerminateActiveCalls0004L);
       
   122     ADD_TEST_STEP_ISO_CPP(CCTsyCallControlFU, TestTerminateActiveCalls0005L);  
   117 	ADD_TEST_STEP_ISO_CPP(CCTsyCallControlFU, TestSetIncomingCallType0001L);
   123 	ADD_TEST_STEP_ISO_CPP(CCTsyCallControlFU, TestSetIncomingCallType0001L);
   118 	ADD_TEST_STEP_ISO_CPP(CCTsyCallControlFU, TestAnswerIncomingCallISV0001L);
   124 	ADD_TEST_STEP_ISO_CPP(CCTsyCallControlFU, TestAnswerIncomingCallISV0001L);
   119 	ADD_TEST_STEP_ISO_CPP(CCTsyCallControlFU, TestAnswerIncomingCallISV0002L);
   125 	ADD_TEST_STEP_ISO_CPP(CCTsyCallControlFU, TestAnswerIncomingCallISV0002L);
   120 	ADD_TEST_STEP_ISO_CPP(CCTsyCallControlFU, TestAnswerIncomingCallISV0004L);
   126 	ADD_TEST_STEP_ISO_CPP(CCTsyCallControlFU, TestAnswerIncomingCallISV0004L);
   121 	ADD_TEST_STEP_ISO_CPP(CCTsyCallControlFU, TestAnswerIncomingCallISV0005L);
   127 	ADD_TEST_STEP_ISO_CPP(CCTsyCallControlFU, TestAnswerIncomingCallISV0005L);
  2063     callParams0.iSpeakerControl = callParams.iSpeakerControl; 
  2069     callParams0.iSpeakerControl = callParams.iSpeakerControl; 
  2064     callParams0.iSpeakerVolume = callParams.iSpeakerVolume;
  2070     callParams0.iSpeakerVolume = callParams.iSpeakerVolume;
  2065     callParams0.iInterval = callParams.iInterval;
  2071     callParams0.iInterval = callParams.iInterval;
  2066     callParams0.iWaitForDialTone = callParams.iWaitForDialTone; 
  2072     callParams0.iWaitForDialTone = callParams.iWaitForDialTone; 
  2067     RCall::TCallParamsPckg   pckgCallParams0(callParams0);
  2073     RCall::TCallParamsPckg   pckgCallParams0(callParams0);
       
  2074     // We should expect the appropriate Alpha ID and Icon ID
       
  2075     callInfo.iValid |= (RMobileCall::KCallAlphaId | RMobileCall::KCallIconId);    
       
  2076     callInfo.iAlphaId.Copy(_L("Alpha Id"));
       
  2077     callInfo.iIconId.iQualifier = RMobileCall::ESelfExplanatory;
       
  2078     callInfo.iIconId.iIdentifier = 0x0A;
  2068 
  2079 
  2069     expectData.Close();
  2080     expectData.Close();
  2070     TMockLtsyCallData2< RMobileCall::TMobileCallParamsV7, RMobileCall::TMobileCallInfoV8 >
  2081     TMockLtsyCallData2< RMobileCall::TMobileCallParamsV7, RMobileCall::TMobileCallInfoV8 >
  2071         mockCallData2(1, mobileService, callParams, callInfo);
  2082         mockCallData2(1, mobileService, callParams, callInfo);
  2072     mockCallData2.SerialiseL(expectData);
  2083     mockCallData2.SerialiseL(expectData);
  9971     CleanupClosePushL(expectData); // PUSH
  9982     CleanupClosePushL(expectData); // PUSH
  9972     
  9983     
  9973 	TRequestStatus requestStatus;
  9984 	TRequestStatus requestStatus;
  9974     
  9985     
  9975 	//-----------------------------------------------------------------------
  9986 	//-----------------------------------------------------------------------
  9976 	// TEST 0: with no active calls (request should not reach the LTSY)
  9987 	// TEST 0: with no active calls 
  9977 	//----------------------------------------------------------------------
  9988 	//----------------------------------------------------------------------
  9978 	
  9989 	
  9979 	iPhone.TerminateAllCalls(requestStatus);
  9990 	iPhone.TerminateAllCalls(requestStatus);
  9980 	User::WaitForRequest(requestStatus);
  9991 	User::WaitForRequest(requestStatus);
  9981 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
  9992 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
 10275     ASSERT_EQUALS(KErrTimedOut, requestStatus.Int());
 10286     ASSERT_EQUALS(KErrTimedOut, requestStatus.Int());
 10276 
 10287 
 10277 	CleanupStack::PopAndDestroy(4, this); // call, line, expectData, this
 10288 	CleanupStack::PopAndDestroy(4, this); // call, line, expectData, this
 10278 	}
 10289 	}
 10279 
 10290 
       
 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     }
 10280 
 10711 
 10281 /**
 10712 /**
 10282 @SYMTestCaseID BA-CTSY-CCON-MSICT-0001
 10713 @SYMTestCaseID BA-CTSY-CCON-MSICT-0001
 10283 @SYMComponent  telephony_ctsy
 10714 @SYMComponent  telephony_ctsy
 10284 @SYMTestCaseDesc Test support in CTSY for RMobilePhone::SetIncomingCallType
 10715 @SYMTestCaseDesc Test support in CTSY for RMobilePhone::SetIncomingCallType