621 @SYMTestType CT |
619 @SYMTestType CT |
622 */ |
620 */ |
623 void CCTsyFixedDiallingFU::TestDialNoFdnCheck0002L() |
621 void CCTsyFixedDiallingFU::TestDialNoFdnCheck0002L() |
624 { |
622 { |
625 |
623 |
626 // This test should test cancellation of GetCallParams |
624 OpenEtelServerL(EUseExtendedError); |
627 // If this API does not have a cancel, the test step should be completely removed. |
625 CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
628 |
626 OpenPhoneL(); |
629 OpenEtelServerL(EUseExtendedError); |
627 |
630 CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
628 RBuf8 expectData; |
631 OpenPhoneL(); |
629 CleanupClosePushL(expectData); |
632 |
630 |
633 RBuf8 expectData; |
631 RBuf8 completeData; |
634 CleanupClosePushL(expectData); |
632 CleanupClosePushL(completeData); |
635 |
633 |
636 RBuf8 completeData; |
634 TInt errorCode = KErrNone; |
637 CleanupClosePushL(completeData); |
635 |
638 |
636 //-- For Voice1 ------------------------- |
639 //-- For Voice1 ------------------------- |
637 |
640 TBuf<256> lineName(KMmTsyVoice1LineName); |
638 TBuf<256> lineName(KMmTsyVoice1LineName); |
641 |
639 // Open new line |
642 // Open new line |
640 RLine line; |
643 RLine line; |
641 errorCode = line.Open(iPhone, lineName); |
644 TInt errorCode = line.Open(iPhone, lineName); |
642 ASSERT_EQUALS(KErrNone, errorCode); |
645 ASSERT_EQUALS(KErrNone, errorCode); |
643 CleanupClosePushL(line); |
646 CleanupClosePushL(line); |
644 // open call |
647 |
645 _LIT(KDoubleColon, "::"); |
648 // some data for opening call |
646 TBuf<256> name; |
649 _LIT(KDoubleColon, "::"); |
647 name = KMmTsyPhoneName; |
650 |
648 name.Append(KDoubleColon); |
651 TBuf<256> name; |
649 name.Append(lineName); |
652 name = KMmTsyPhoneName; |
650 name.Append(KDoubleColon); |
653 name.Append(KDoubleColon); |
651 |
654 name.Append(lineName); |
652 RMobileCall call; |
655 name.Append(KDoubleColon); |
653 errorCode = call.OpenNewCall(line, name); |
656 |
654 ASSERT_EQUALS(KErrNone, errorCode); |
657 TInt callId = 1; |
655 CleanupClosePushL(call); |
658 // create new incoming call |
656 |
659 TName incomingCallName; |
657 TRequestStatus requestStatus; |
660 RMobileCall::TMobileCallStatus mobileCallStatus = RMobileCall::EStatusIdle; |
658 _LIT(KSomeNumber, "123456789"); |
661 RMobilePhone::TMobileService mobileService = RMobilePhone::EVoiceService; |
659 |
662 |
660 RMobilePhone::TMobileService mobileService = RMobilePhone::EVoiceService; |
663 TRequestStatus requestStatus; |
661 |
664 errorCode = CreateIncomingCallL(line, callId, lineName, incomingCallName, |
662 TInt expectCallId = 0; |
665 mobileService, mobileCallStatus); |
|
666 ASSERT_EQUALS(KErrNone, errorCode); |
|
667 |
663 |
668 // -------- make for this call callId > 0 -------------------------------------- |
664 // -------- make for this call callId > 0 -------------------------------------- |
669 RMobileCall::TMobileCallInfoV1 callInfo; |
665 RMobileCall::TMobileCallInfoV8 callInfo; |
670 |
666 |
671 line.NotifyIncomingCall(requestStatus, incomingCallName); |
667 //------------------------------------------------------------------------- |
672 |
668 // Test cancelling of RMobileCall::DialNoFdnCheck |
673 callInfo.iService = mobileService; |
669 //------------------------------------------------------------------------- |
674 TMockLtsyCallData1<RMobileCall::TMobileCallInfoV1> idleCallData(callId, mobileService, callInfo); |
670 |
675 idleCallData.SerialiseL(completeData); |
671 // data for ExpextL |
676 |
|
677 TRequestStatus mockLtsyStatus; |
|
678 iMockLTSY.NotifyTerminated(mockLtsyStatus); |
|
679 iMockLTSY.CompleteL(EEtelLineNotifyIncomingCall, KErrNone, completeData); |
|
680 User::WaitForRequest(mockLtsyStatus); |
|
681 AssertMockLtsyStatusL(); |
|
682 ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int()); |
|
683 |
|
684 User::WaitForRequest(requestStatus); |
|
685 AssertMockLtsyStatusL(); |
|
686 ASSERT_EQUALS(KErrNone, requestStatus.Int()); |
|
687 |
|
688 RMobileCall call; |
|
689 errorCode = call.OpenExistingCall(line, incomingCallName); |
|
690 ASSERT_EQUALS(KErrNone, errorCode); |
|
691 CleanupClosePushL(call); |
|
692 //------------------------------------------------------------------------- |
|
693 |
|
694 //------------------------------------------------------------------------- |
|
695 // Test cancelling of RCall::GetCallParams |
|
696 //------------------------------------------------------------------------- |
|
697 _LIT(KSomeNumber, "123456789"); |
|
698 // data for ExpextL |
|
699 RMobileCall::TMobileCallParamsV1 callParams; |
672 RMobileCall::TMobileCallParamsV1 callParams; |
700 RMobileCall::TMobileCallParamsV1Pckg pckgCallParams(callParams); |
673 RMobileCall::TMobileCallParamsV1Pckg pckgCallParams(callParams); |
701 |
674 |
702 callInfo.iRemoteParty.iDirection = RMobileCall::EMobileTerminated; |
675 callInfo.iValid = RMobileCall::KCallDialledParty | RMobileCall::KCallAlternating; |
703 callInfo.iValid = RMobileCall::KCallDialledParty | RMobileCall::KCallAlternating; |
676 callInfo.iService = mobileService; |
704 callInfo.iService = mobileService; |
677 callInfo.iStatus = RMobileCall::EStatusUnknown; |
705 callInfo.iDialledParty.iTelNumber.Copy( KSomeNumber ); |
678 callInfo.iCallId = -1; |
706 |
679 callInfo.iExitCode =0; |
|
680 callInfo.iEmergency =0; |
|
681 callInfo.iForwarded =0; |
|
682 callInfo.iPrivacy = RMobilePhone::EPrivacyUnspecified; |
|
683 callInfo.iAlternatingCall = RMobilePhone::EAlternatingModeUnspecified; |
|
684 callInfo.iTch = RMobileCall::ETchUnknown; |
|
685 callInfo.iRemoteParty.iCallingName = KNullDesC; |
|
686 callInfo.iRemoteParty.iRemoteIdStatus = RMobileCall::ERemoteIdentityUnknown; |
|
687 callInfo.iRemoteParty.iRemoteNumber.iTelNumber = KNullDesC; |
|
688 callInfo.iRemoteParty.iRemoteNumber.iNumberPlan = RMobilePhone::EUnknownNumberingPlan; |
|
689 callInfo.iRemoteParty.iRemoteNumber.iTypeOfNumber = RMobilePhone::EUnknownNumber; |
|
690 callInfo.iDialledParty.iTelNumber.Copy( KSomeNumber ); |
|
691 callInfo.iDialledParty.iNumberPlan = |
|
692 RMobilePhone::EUnknownNumberingPlan; |
|
693 callInfo.iDialledParty.iTypeOfNumber = |
|
694 RMobilePhone::EUnknownNumber; |
|
695 |
707 TMockLtsyCallData2< RMobileCall::TMobileCallParamsV1, RMobileCall::TMobileCallInfoV1 > |
696 TMockLtsyCallData2< RMobileCall::TMobileCallParamsV1, RMobileCall::TMobileCallInfoV1 > |
708 mockCallData(callId, mobileService, callParams, callInfo); |
697 mockCallData(expectCallId, mobileService, callParams, callInfo); |
709 mockCallData.SerialiseL(expectData); |
698 mockCallData.SerialiseL(expectData); |
|
699 |
|
700 // Expect the dial |
710 |
701 |
711 iMockLTSY.ExpectL(EMobileCallDialNoFdnCheck, expectData, KErrNone); |
702 iMockLTSY.ExpectL(EMobileCallDialNoFdnCheck, expectData, KErrNone); |
712 |
703 |
|
704 // Dial and cancel |
713 call.DialNoFdnCheck(requestStatus, pckgCallParams, KSomeNumber); |
705 call.DialNoFdnCheck(requestStatus, pckgCallParams, KSomeNumber); |
714 call.CancelAsyncRequest(EMobileCallDialNoFdnCheck); |
706 call.CancelAsyncRequest(EMobileCallDialNoFdnCheck); |
|
707 |
|
708 // prepare and complete Mobile Call info |
|
709 |
|
710 TInt callId = 1; |
|
711 |
|
712 _LIT(KNullDesC , ""); |
715 |
713 |
|
714 RBuf8 data; |
|
715 CleanupClosePushL(data); |
|
716 |
|
717 RMobileCall::TMobileCallInfoV1 callInfo2; |
|
718 callInfo2.iDialledParty.iTelNumber.Copy(KSomeNumber); |
|
719 callInfo2.iService = mobileService; |
|
720 callInfo2.iEmergency = EFalse; |
|
721 callInfo2.iRemoteParty.iCallingName = KNullDesC; |
|
722 callInfo2.iRemoteParty.iRemoteIdStatus = RMobileCall::ERemoteIdentityUnknown; |
|
723 callInfo2.iRemoteParty.iRemoteNumber.iTelNumber = KNullDesC; |
|
724 callInfo2.iRemoteParty.iRemoteNumber.iNumberPlan = RMobilePhone::EUnknownNumberingPlan; |
|
725 callInfo2.iRemoteParty.iRemoteNumber.iTypeOfNumber = RMobilePhone::EUnknownNumber; |
|
726 callInfo2.iForwarded = EFalse; |
|
727 callInfo2.iValid = RMobileCall::KCallDialledParty | RMobileCall::KCallRemoteParty; |
|
728 |
|
729 TMockLtsyCallData1<RMobileCall::TMobileCallInfoV1> callInfoData(callId, mobileService, callInfo2); |
|
730 callInfoData.SerialiseL(data); |
|
731 |
|
732 iMockLTSY.CompleteL(EMobileCallGetMobileCallInfo, KErrNone, data); |
|
733 |
|
734 //Pause the MockLTSY so we can program the sequence of Expect - Completes involved |
|
735 //with cancelling |
|
736 iMockLTSY.PauseCompletion(); |
|
737 |
|
738 RMobileCall::TMobileCallStatus mobileCallStatus = RMobileCall::EStatusDialling; |
|
739 TMockLtsyCallData1<RMobileCall::TMobileCallStatus> mockCallDataStatus(callId, mobileService, mobileCallStatus); |
|
740 completeData.Close(); |
|
741 mockCallDataStatus.SerialiseL(completeData); |
|
742 |
|
743 //Change state to dialling, this set the call ID |
|
744 iMockLTSY.CompleteL(EMobileCallNotifyMobileCallStatusChange, KErrNone, completeData); |
|
745 |
|
746 |
|
747 TInt hangUpCause = KErrGsmReleaseByUser; |
|
748 TBool autoStChangeDisable = ETrue; |
|
749 TMockLtsyCallData2<TInt, TBool> mockCallData2(callId, mobileService, |
|
750 hangUpCause, |
|
751 autoStChangeDisable); |
|
752 expectData.Close(); |
|
753 mockCallData2.SerialiseL(expectData); |
|
754 // Since the call ID has been set, the CTSY will go ahead with the cancellation |
|
755 // by hanging up. |
|
756 iMockLTSY.ExpectL(EEtelCallHangUp, expectData); |
|
757 |
|
758 // Cancelled Dial request. After this CTSY hangs up the call and it goes to idle state. |
|
759 |
|
760 |
|
761 RMobileCall::TMobileCallStatus mobileCallStatus2 = RMobileCall::EStatusIdle; |
|
762 TMockLtsyCallData1<RMobileCall::TMobileCallStatus> mockCallDataStatus2(callId, mobileService, mobileCallStatus2); |
|
763 completeData.Close(); |
|
764 mockCallDataStatus2.SerialiseL(completeData); |
|
765 |
|
766 // Complete the hangup |
|
767 iMockLTSY.CompleteL(EMobileCallNotifyMobileCallStatusChange, KErrGsmReleaseByUser, completeData); |
|
768 |
|
769 // Release the MockLTSY so that the above sequence is triggered. |
|
770 iMockLTSY.ResumeCompletion(); |
|
771 |
|
772 |
|
773 // Check results. |
716 User::WaitForRequest(requestStatus); |
774 User::WaitForRequest(requestStatus); |
717 |
775 AssertMockLtsyStatusL(); |
718 ASSERT_EQUALS(KErrCancel, requestStatus.Int()); |
776 ASSERT_EQUALS(KErrCancel, requestStatus.Int()); |
719 AssertMockLtsyStatusL(); |
777 |
720 |
778 |
721 CleanupStack::PopAndDestroy(5, this); // expectData, this ... |
779 CleanupStack::PopAndDestroy(6, this); // expectData, this ... |
722 |
780 |
723 } |
|
724 |
|
725 |
|
726 /** |
|
727 @SYMTestCaseID BA-CTSY-FXD-CDNFC-0003 |
|
728 @SYMComponent telephony_ctsy |
|
729 @SYMTestCaseDesc Test support in CTSY for RMobileCall::DialNoFdnCheck with bad parameter data for voice calls |
|
730 @SYMTestPriority High |
|
731 @SYMTestActions Invokes RMobileCall::DialNoFdnCheck with bad parameter data for voice calls |
|
732 @SYMTestExpectedResults Pass |
|
733 @SYMTestType CT |
|
734 */ |
|
735 void CCTsyFixedDiallingFU::TestDialNoFdnCheck0003L() |
|
736 { |
|
737 |
|
738 OpenEtelServerL(EUseExtendedError); |
|
739 CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
|
740 OpenPhoneL(); |
|
741 |
|
742 RBuf8 expectData; |
|
743 CleanupClosePushL(expectData); |
|
744 |
|
745 RBuf8 completeData; |
|
746 CleanupClosePushL(completeData); |
|
747 |
|
748 //-- For Voice1 ------------------------- |
|
749 TBuf<256> lineName(KMmTsyVoice1LineName); |
|
750 |
|
751 // Open new line |
|
752 RLine line; |
|
753 TInt errorCode = line.Open(iPhone, lineName); |
|
754 ASSERT_EQUALS(KErrNone, errorCode); |
|
755 CleanupClosePushL(line); |
|
756 |
|
757 // some data for opening call |
|
758 _LIT(KDoubleColon, "::"); |
|
759 |
|
760 TBuf<256> name; |
|
761 name = KMmTsyPhoneName; |
|
762 name.Append(KDoubleColon); |
|
763 name.Append(lineName); |
|
764 name.Append(KDoubleColon); |
|
765 |
|
766 TInt callId = 1; |
|
767 // create new incoming call |
|
768 TName incomingCallName; |
|
769 RMobileCall::TMobileCallStatus mobileCallStatus = RMobileCall::EStatusIdle; |
|
770 RMobilePhone::TMobileService mobileService = RMobilePhone::EVoiceService; |
|
771 |
|
772 TRequestStatus requestStatus; |
|
773 errorCode = CreateIncomingCallL(line, callId, lineName, incomingCallName, |
|
774 mobileService, mobileCallStatus); |
|
775 ASSERT_EQUALS(KErrNone, errorCode); |
|
776 |
|
777 // -------- make for this call callId > 0 -------------------------------------- |
|
778 RMobileCall::TMobileCallInfoV1 callInfo; |
|
779 |
|
780 line.NotifyIncomingCall(requestStatus, incomingCallName); |
|
781 |
|
782 callInfo.iService = mobileService; |
|
783 TMockLtsyCallData1<RMobileCall::TMobileCallInfoV1> idleCallData(callId, mobileService, callInfo); |
|
784 idleCallData.SerialiseL(completeData); |
|
785 |
|
786 TRequestStatus mockLtsyStatus; |
|
787 iMockLTSY.NotifyTerminated(mockLtsyStatus); |
|
788 iMockLTSY.CompleteL(EEtelLineNotifyIncomingCall, KErrNone, completeData); |
|
789 User::WaitForRequest(mockLtsyStatus); |
|
790 AssertMockLtsyStatusL(); |
|
791 ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int()); |
|
792 |
|
793 User::WaitForRequest(requestStatus); |
|
794 AssertMockLtsyStatusL(); |
|
795 ASSERT_EQUALS(KErrNone, requestStatus.Int()); |
|
796 |
|
797 RMobileCall call; |
|
798 errorCode = call.OpenExistingCall(line, incomingCallName); |
|
799 ASSERT_EQUALS(KErrNone, errorCode); |
|
800 CleanupClosePushL(call); |
|
801 //------------------------------------------------------------------------- |
|
802 |
|
803 _LIT(KSomeNumber, "123456789"); |
|
804 |
|
805 |
|
806 //------------------------------------------------------------------------- |
|
807 // Test B: Test passing wrong descriptor size to parameter in |
|
808 // RCall::GetCallParams |
|
809 //------------------------------------------------------------------------- |
|
810 RMobileCall::TMobileCallParamsV1 callParams; |
|
811 RMobileCall::TMobileCallParamsV1Pckg pckgCallParams(callParams); |
|
812 |
|
813 // --- data for ExpectL --- |
|
814 // set up callParams for case of pckgCallParams zero length |
|
815 callParams.iSpeakerControl = |
|
816 RCall::EMonitorSpeakerControlOnUntilCarrier; |
|
817 callParams.iSpeakerVolume = RCall::EMonitorSpeakerVolumeLow; |
|
818 callParams.iInterval = 0; |
|
819 callParams.iWaitForDialTone = RCall::EDialToneWait; |
|
820 callParams.iIdRestrict = RMobileCall::EIdRestrictDefault; |
|
821 callParams.iCug.iExplicitInvoke = EFalse; |
|
822 callParams.iCug.iCugIndex = 0xFFFF; |
|
823 callParams.iCug.iSuppressPrefCug = EFalse; |
|
824 callParams.iCug.iSuppressOA = EFalse; |
|
825 callParams.iAutoRedial = EFalse; |
|
826 // set up callInfo# |
|
827 |
|
828 RMobileCall::TMobileCallInfoV8 callInformation; |
|
829 callInformation.iRemoteParty.iDirection = RMobileCall::EMobileTerminated; |
|
830 callInformation.iValid = RMobileCall::KCallDialledParty | RMobileCall::KCallAlternating; |
|
831 callInformation.iService = mobileService; |
|
832 callInformation.iDialledParty.iTelNumber.Copy( KSomeNumber ); |
|
833 TMockLtsyCallData2< RMobileCall::TMobileCallParamsV1, RMobileCall::TMobileCallInfoV8 > |
|
834 mockCallData2(callId, mobileService, callParams, callInformation); |
|
835 mockCallData2.SerialiseL(expectData); |
|
836 |
|
837 // --- data for CompleteL --- |
|
838 TMockLtsyCallData0 mockDataComplete(callId, mobileService); |
|
839 completeData.Close(); |
|
840 mockDataComplete.SerialiseL(completeData); |
|
841 |
|
842 iMockLTSY.ExpectL(EMobileCallDialNoFdnCheck, expectData); |
|
843 iMockLTSY.CompleteL(EMobileCallDialNoFdnCheck, KErrNone, completeData); |
|
844 |
|
845 // set Length of param to 0 |
|
846 pckgCallParams.SetLength(0); |
|
847 // call DialNoFdnCheck itself |
|
848 call.DialNoFdnCheck(requestStatus, pckgCallParams, KSomeNumber); |
|
849 |
|
850 User::WaitForRequest(requestStatus); |
|
851 ASSERT_EQUALS(KErrNone, requestStatus.Int()); |
|
852 AssertMockLtsyStatusL(); |
|
853 |
|
854 //------------------------------------------------------------------------- |
|
855 // Test A: Test passing wrong version of parameters to |
|
856 // RCall::GetCallParams use TMobileCallParamsV2 instead of TMobileCallParamsV1 |
|
857 //------------------------------------------------------------------------- |
|
858 RMobileCall::TMobileCallParamsV2 callParamsV2; |
|
859 RMobileCall::TMobileCallParamsV2Pckg pckgCallParamsV2(callParamsV2); |
|
860 |
|
861 // data for ExpextL |
|
862 callInfo.iRemoteParty.iDirection = RMobileCall::EMobileTerminated; |
|
863 callInfo.iValid = RMobileCall::KCallDialledParty | RMobileCall::KCallAlternating; |
|
864 callInfo.iService = mobileService; |
|
865 callInfo.iDialledParty.iTelNumber.Copy( KSomeNumber ); |
|
866 |
|
867 TMockLtsyCallData2< RMobileCall::TMobileCallParamsV1, RMobileCall::TMobileCallInfoV1 > |
|
868 mockCallData(callId, mobileService, callParams, callInfo); |
|
869 expectData.Close(); |
|
870 mockCallData.SerialiseL(expectData); |
|
871 |
|
872 iMockLTSY.ExpectL(EMobileCallDialNoFdnCheck, expectData, KErrGeneral); // use KErrGeneral just only to avoid waiting for timeout |
|
873 call.DialNoFdnCheck(requestStatus, pckgCallParamsV2, KSomeNumber); |
|
874 User::WaitForRequest(requestStatus); |
|
875 |
|
876 // Possible defect. There is no checking of iExtensionId of geting params in |
|
877 // TInt CMmVoiceCallTsy::DialNoFdnCheck(const TTsyReqHandle aTsyReqHandle, const TDesC8* aCallParams, TDesC* aTelNumber ) |
|
878 // and in |
|
879 // TInt CMmCallGsmWcdmaExt::DialL(RMobilePhone::TMobileService aCallMode, const TDesC8* aCallParams, const TDesC* aTelNumber, TInt aExtensionId ) |
|
880 ERR_PRINTF2(_L("<font color=Orange>$CTSYKnownFailure: defect id = %d</font>"), 120105); |
|
881 ASSERT_EQUALS(KErrArgument, requestStatus.Int()); |
|
882 AssertMockLtsyStatusL(); |
|
883 |
|
884 // Done ! |
|
885 CleanupStack::PopAndDestroy(5, this); // this... |
|
886 |
|
887 } |
781 } |
888 |
782 |
889 |
783 |
890 /** |
784 /** |
891 @SYMTestCaseID BA-CTSY-FXD-CDNFC-0004 |
785 @SYMTestCaseID BA-CTSY-FXD-CDNFC-0004 |