924 DriverHoldCallL(callId, KErrNone); |
924 DriverHoldCallL(callId, KErrNone); |
925 |
925 |
926 // Resume call |
926 // Resume call |
927 DriverResumeCallL(callId, KErrNone); |
927 DriverResumeCallL(callId, KErrNone); |
928 |
928 |
|
929 // Swap single call. |
|
930 DriverSwapCallL(callId, KErrNone, RMobileCall::EStatusHold); |
|
931 |
|
932 // Swap single call again. |
|
933 DriverSwapCallL(callId, KErrNone, RMobileCall::EStatusConnected); |
|
934 |
929 TInt hangUpCause = KErrGsmCCNormalCallClearing; |
935 TInt hangUpCause = KErrGsmCCNormalCallClearing; |
930 DriverHangUpCallL(callId, hangUpCause); |
936 DriverHangUpCallL(callId, hangUpCause); |
931 |
937 |
932 // Client Side Test |
938 // Client Side Test |
933 |
939 |
958 ASSERT_EQUALS(KErrNone, resumeStatus.Int()); |
964 ASSERT_EQUALS(KErrNone, resumeStatus.Int()); |
959 |
965 |
960 User::WaitForRequest(notifyStatus); |
966 User::WaitForRequest(notifyStatus); |
961 ASSERT_EQUALS(KErrNone, notifyStatus.Int()); |
967 ASSERT_EQUALS(KErrNone, notifyStatus.Int()); |
962 ASSERT_EQUALS(RMobileCall::EStatusConnected, callStatus); |
968 ASSERT_EQUALS(RMobileCall::EStatusConnected, callStatus); |
963 |
969 |
964 // Attempt to swap it when it is the sole call (not supported by CTSY) |
970 mobileCall.NotifyMobileCallStatusChange(notifyStatus, callStatus); |
|
971 |
|
972 // Attempt to swap it when it is the sole call. |
965 TRequestStatus swapStatus; |
973 TRequestStatus swapStatus; |
966 mobileCall.Swap(swapStatus); |
974 mobileCall.Swap(swapStatus); |
967 User::WaitForRequest(swapStatus); |
975 User::WaitForRequest(swapStatus); |
968 ASSERT_EQUALS(KErrNotSupported, swapStatus.Int()); |
976 ASSERT_EQUALS(KErrNone, swapStatus.Int()); |
969 |
977 |
|
978 User::WaitForRequest(notifyStatus); |
|
979 ASSERT_EQUALS(KErrNone, notifyStatus.Int()); |
|
980 ASSERT_EQUALS(RMobileCall::EStatusHold, callStatus); |
|
981 |
|
982 mobileCall.NotifyMobileCallStatusChange(notifyStatus, callStatus); |
|
983 |
|
984 // Swapping single call again, back to connected. |
|
985 swapStatus; |
|
986 mobileCall.Swap(swapStatus); |
|
987 User::WaitForRequest(swapStatus); |
|
988 ASSERT_EQUALS(KErrNone, swapStatus.Int()); |
|
989 |
|
990 User::WaitForRequest(notifyStatus); |
|
991 ASSERT_EQUALS(KErrNone, notifyStatus.Int()); |
|
992 ASSERT_EQUALS(RMobileCall::EStatusConnected, callStatus); |
|
993 |
|
994 |
970 TRequestStatus reqStatusTerminated; |
995 TRequestStatus reqStatusTerminated; |
971 iMockLTSY.NotifyTerminated(reqStatusTerminated); |
996 iMockLTSY.NotifyTerminated(reqStatusTerminated); |
972 |
997 |
973 ClientHangUpCallL(mobileCall); |
998 ClientHangUpCallL(mobileCall); |
974 |
999 |
975 mobileCall.Close(); |
1000 mobileCall.Close(); |
976 mobileLine.Close(); |
1001 mobileLine.Close(); |
977 data.Close(); |
1002 data.Close(); |
978 |
1003 |
979 User::WaitForRequest(reqStatusTerminated); |
1004 User::WaitForRequest(notifyStatus); |
980 ASSERT_EQUALS(KErrNone, reqStatusTerminated.Int()); |
1005 ASSERT_EQUALS(KErrNone, notifyStatus.Int()); |
981 |
1006 |
982 AssertMockLtsyStatusL(); |
1007 AssertMockLtsyStatusL(); |
983 CleanupStack::PopAndDestroy(4, this); // mobileCall, mobileLine, data, this |
1008 CleanupStack::PopAndDestroy(4, this); // mobileCall, mobileLine, data, this |
984 } // CCTsyCallControlFU::TestUseCase0012L |
1009 } // CCTsyCallControlFU::TestUseCase0012L |
985 |
1010 |
3532 } // CCTsyCallControlFU::DriverResumeCallL |
3557 } // CCTsyCallControlFU::DriverResumeCallL |
3533 |
3558 |
3534 /** |
3559 /** |
3535 * Swap the call. |
3560 * Swap the call. |
3536 * |
3561 * |
|
3562 * @param aCallId Call ID of held call to swap. |
|
3563 * @param aSwapError Error returned by LTSY in response to the swap request. |
|
3564 * @param aNewCallStatus New status of the call 1 if aSwapError = KErrNone |
|
3565 * |
|
3566 * In the case where aSwapError passed is not KErrNone, the new call statuses |
|
3567 * are irrelevant as the calls don't change state. |
|
3568 */ |
|
3569 void CCTsyCallControlFU::DriverSwapCallL(TInt aCallId, TInt aSwapError, |
|
3570 RMobileCall::TMobileCallStatus aNewCallStatus) |
|
3571 { |
|
3572 RBuf8 data; |
|
3573 CleanupClosePushL(data); |
|
3574 |
|
3575 TMockLtsyData1<TInt> mockData2(aCallId); |
|
3576 data.Close(); |
|
3577 mockData2.SerialiseL(data); |
|
3578 iMockLTSY.ExpectL(MLtsyDispatchCallControlSwap::KLtsyDispatchCallControlSingleSwapApiId, data); |
|
3579 |
|
3580 iMockLTSY.CompleteL(MLtsyDispatchCallControlSwap::KLtsyDispatchCallControlSingleSwapApiId, aSwapError); |
|
3581 |
|
3582 if (aSwapError == KErrNone) |
|
3583 { |
|
3584 TMockLtsyCallData1<RMobileCall::TMobileCallStatus> mockCallData2( |
|
3585 aCallId, RMobilePhone::EServiceUnspecified, aNewCallStatus); |
|
3586 data.Close(); |
|
3587 mockCallData2.SerialiseL(data); |
|
3588 iMockLTSY.CompleteL(KMockLtsyDispatchCallControlNotifyCallStatusChangeIndId, KErrNone, data); |
|
3589 } |
|
3590 |
|
3591 data.Close(); |
|
3592 CleanupStack::PopAndDestroy(1, &data); |
|
3593 } // CCTsyCallControlFU::DriverSwapCallL |
|
3594 |
|
3595 |
|
3596 /** |
|
3597 * Swap the call. |
|
3598 * |
3537 * @param aCallId1 Call ID of held call to swap. |
3599 * @param aCallId1 Call ID of held call to swap. |
3538 * @param aCallId2 Call ID of connected call to swap. |
3600 * @param aCallId2 Call ID of connected call to swap. |
3539 * @param aSwapError Error returned by LTSY in response to the swap request. |
3601 * @param aSwapError Error returned by LTSY in response to the swap request. |
3540 * @param aNewCall1Status New status of the call 1 if aSwapError = KErrNone |
3602 * @param aNewCall1Status New status of the call 1 if aSwapError = KErrNone |
3541 * @param aNewCall2Status New status of the call 2 if aSwapError = KErrNone |
3603 * @param aNewCall2Status New status of the call 2 if aSwapError = KErrNone |