30 |
30 |
31 |
31 |
32 CTestSuite* CCTsyUssdMessagingFU::CreateSuiteL(const TDesC& aName) |
32 CTestSuite* CCTsyUssdMessagingFU::CreateSuiteL(const TDesC& aName) |
33 { |
33 { |
34 SUB_SUITE; |
34 SUB_SUITE; |
35 |
|
36 ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestSendMessage0001L); |
35 ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestSendMessage0001L); |
37 ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestSendMessage0002L); |
36 ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestSendMessage0002L); |
38 ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestSendMessage0003L); |
37 ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestSendMessage0003L); |
39 ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestSendMessage0004L); |
38 ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestSendMessage0004L); |
40 ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestSendMessage0005L); |
39 ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestSendMessage0005L); |
|
40 ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestSendMessage0006L); |
41 ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestSendRelease0001L); |
41 ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestSendRelease0001L); |
42 ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestSendRelease0001bL); |
42 ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestSendRelease0001bL); |
|
43 ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestSendRelease0001cL); |
|
44 ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestSendRelease0001dL); |
43 ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestSendRelease0002L); |
45 ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestSendRelease0002L); |
|
46 ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestSendRelease0002bL); |
44 ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestSendRelease0003L); |
47 ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestSendRelease0003L); |
45 ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestSendRelease0004L); |
48 ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestSendRelease0004L); |
|
49 ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestSendRelease0004bL); |
46 ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestSendRelease0005L); |
50 ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestSendRelease0005L); |
47 ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestReceiveMessage0001L); |
51 ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestReceiveMessage0001L); |
48 ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestReceiveMessage0002L); |
52 ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestReceiveMessage0002L); |
49 ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestReceiveMessage0002bL); |
53 ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestReceiveMessage0002bL); |
50 ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestReceiveMessage0002cL); |
54 ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestReceiveMessage0002cL); |
51 ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestReceiveMessage0002dL); |
55 ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestReceiveMessage0002dL); |
52 ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestReceiveMessage0002eL); |
56 ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestReceiveMessage0002eL); |
53 ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestReceiveMessage0002fL); |
57 ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestReceiveMessage0002fL); |
54 ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestReceiveMessage0002gL); |
58 ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestReceiveMessage0002gL); |
55 ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestReceiveMessage0002hL); |
59 ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestReceiveMessage0002hL); |
|
60 ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestReceiveMessage0002iL); |
56 ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestReceiveMessage0003L); |
61 ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestReceiveMessage0003L); |
57 ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestReceiveMessage0004L); |
62 ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestReceiveMessage0004L); |
58 ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestReceiveMessage0004bL); |
63 ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestReceiveMessage0004bL); |
59 ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestReceiveMessage0004cL); |
64 ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestReceiveMessage0004cL); |
60 ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestReceiveMessage0004dL); |
65 ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestReceiveMessage0004dL); |
61 ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestReceiveMessage0004eL); |
66 ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestReceiveMessage0004eL); |
62 ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestReceiveMessage0004fL); |
67 ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestReceiveMessage0004fL); |
63 ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestNotifyNetworkRelease0001L); |
68 ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestNotifyNetworkRelease0001L); |
|
69 ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestNotifyNetworkRelease0001eL); |
|
70 ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestNotifyNetworkRelease0001bL); |
|
71 ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestNotifyNetworkRelease0001cL); |
|
72 ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestNotifyNetworkRelease0001dL); |
64 ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestNotifyNetworkRelease0002L); |
73 ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestNotifyNetworkRelease0002L); |
65 ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestNotifyNetworkRelease0003L); |
74 ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestNotifyNetworkRelease0003L); |
66 ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestNotifyNetworkRelease0004L); |
75 ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestNotifyNetworkRelease0004L); |
|
76 ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestNotifyNetworkRelease0004bL); |
67 ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestSendMessageNoFdnCheck0001L); |
77 ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestSendMessageNoFdnCheck0001L); |
68 ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestSendMessageNoFdnCheck0002L); |
78 ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestSendMessageNoFdnCheck0002L); |
69 ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestSendMessageNoFdnCheck0003L); |
79 ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestSendMessageNoFdnCheck0003L); |
70 ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestSendMessageNoFdnCheck0004L); |
80 ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestSendMessageNoFdnCheck0004L); |
71 ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestSendMessageNoFdnCheck0005L); |
81 ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestSendMessageNoFdnCheck0005L); |
559 RMobileUssdMessaging ussdMessaging; |
597 RMobileUssdMessaging ussdMessaging; |
560 TInt ret = ussdMessaging.Open(iPhone); |
598 TInt ret = ussdMessaging.Open(iPhone); |
561 ASSERT_EQUALS(KErrNone, ret); |
599 ASSERT_EQUALS(KErrNone, ret); |
562 CleanupClosePushL(ussdMessaging); |
600 CleanupClosePushL(ussdMessaging); |
563 |
601 |
|
602 TRequestStatus requestStatus; |
|
603 |
|
604 TUint32 flags = 100; |
|
605 RMobileUssdMessaging::TMobileUssdDataFormat format = RMobileUssdMessaging::EFormatUnspecified; |
|
606 RMobileUssdMessaging::TMobileUssdMessageType type = RMobileUssdMessaging::EUssdMORequest; |
|
607 TUint8 dcs = 200; |
|
608 |
|
609 //------------------------------------------------------------------------- |
|
610 // function parameters |
|
611 |
|
612 RMobileUssdMessaging::TMobileUssdAttributesV1 attributes; |
|
613 TPckg<RMobileUssdMessaging::TMobileUssdAttributesV1> msgAttributes(attributes); |
|
614 |
|
615 attributes.iFlags = flags; |
|
616 attributes.iFormat = format; |
|
617 attributes.iType = type; |
|
618 attributes.iDcs = dcs; |
|
619 |
|
620 TName name = _L("Name1"); |
|
621 TPckg<TName> msgData(name); |
|
622 |
|
623 //------------------------------------------------------------------------- |
|
624 |
|
625 TMockLtsyData2<TName, RMobileUssdMessaging::TMobileUssdAttributesV1> |
|
626 mockData2(name, attributes); |
|
627 mockData2.SerialiseL(data); |
|
628 |
|
629 //------------------------------------------------------------------------- |
|
630 // TEST A: failure to dispatch request to LTSY |
|
631 //------------------------------------------------------------------------- |
|
632 |
|
633 |
|
634 iMockLTSY.ExpectL(EMobileUssdMessagingSendMessageDefaultHandler, data, KErrNotSupported); |
|
635 |
|
636 ussdMessaging.SendMessage(requestStatus, msgData, msgAttributes, RMobileUssdMessaging::ETransferToDefaultHandler); |
|
637 |
|
638 User::WaitForRequest(requestStatus); |
|
639 AssertMockLtsyStatusL(); |
|
640 ASSERT_EQUALS(KErrNotSupported, requestStatus.Int()); |
|
641 |
|
642 //------------------------------------------------------------------------- |
|
643 // TEST B: failure on completion of pending request from LTSY->CTSY |
|
644 //------------------------------------------------------------------------- |
|
645 |
|
646 iMockLTSY.ExpectL(EMobileUssdMessagingSendMessageDefaultHandler, data); |
|
647 iMockLTSY.CompleteL(EMobileUssdMessagingSendMessageDefaultHandler, KErrGeneral); |
|
648 |
|
649 ussdMessaging.SendMessage(requestStatus, msgData, msgAttributes, RMobileUssdMessaging::ETransferToDefaultHandler); |
|
650 |
|
651 User::WaitForRequest(requestStatus); |
|
652 AssertMockLtsyStatusL(); |
|
653 ASSERT_EQUALS(KErrGeneral, requestStatus.Int()); |
|
654 |
|
655 //------------------------------------------------------------------------- |
|
656 // TEST C: Successful completion request of |
|
657 // RMobileUssdMessaging::SendMessage when result is not cached. |
|
658 //------------------------------------------------------------------------- |
|
659 |
|
660 iMockLTSY.ExpectL(EMobileUssdMessagingSendMessageDefaultHandler, data); |
|
661 iMockLTSY.CompleteL(EMobileUssdMessagingSendMessageDefaultHandler, KErrNone); |
|
662 |
|
663 ussdMessaging.SendMessage(requestStatus, msgData, msgAttributes, RMobileUssdMessaging::ETransferToDefaultHandler); |
|
664 |
|
665 User::WaitForRequest(requestStatus); |
|
666 AssertMockLtsyStatusL(); |
|
667 ASSERT_EQUALS(KErrNone, requestStatus.Int()); |
|
668 |
|
669 //------------------------------------------------------------------------- |
|
670 // TEST E: Unsolicited completion of RMobileUssdMessaging::SendMessage |
|
671 // from LTSY. |
|
672 //------------------------------------------------------------------------- |
|
673 |
564 TRequestStatus mockLtsyStatus; |
674 TRequestStatus mockLtsyStatus; |
565 TRequestStatus requestStatus; |
675 |
566 |
676 iMockLTSY.NotifyTerminated(mockLtsyStatus); |
|
677 iMockLTSY.CompleteL(EMobileUssdMessagingSendMessageDefaultHandler, KErrNone); |
|
678 User::WaitForRequest(mockLtsyStatus); |
|
679 AssertMockLtsyStatusL(); |
|
680 ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int()); |
|
681 |
|
682 //------------------------------------------------------------------------- |
|
683 // TEST : to increase CMmUssdTsy::ExtFunc coverage |
|
684 // covers "if ( ERfsStateInfoInactive == iMmPhone->GetRfStateInfo() && |
|
685 // ( !IsRequestPossibleInOffline( aIpc ) ) )" condition |
|
686 //------------------------------------------------------------------------- |
|
687 |
|
688 iMockLTSY.NotifyTerminated(mockLtsyStatus); |
|
689 TRfStateInfo rfInfo = ERfsStateInfoInactive; |
|
690 TMockLtsyData1<TRfStateInfo> mockData1(rfInfo); |
|
691 |
|
692 data.Close(); |
|
693 mockData1.SerialiseL(data); |
|
694 |
|
695 iMockLTSY.CompleteL(EMmTsyBootGetRFStatusIPC, KErrNone, data); |
|
696 User::WaitForRequest(mockLtsyStatus); |
|
697 AssertMockLtsyStatusL(); |
|
698 ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int()); |
|
699 |
|
700 ussdMessaging.SendMessage(requestStatus, msgData, msgAttributes); |
|
701 |
|
702 User::WaitForRequest(requestStatus); |
|
703 AssertMockLtsyStatusL(); |
|
704 ASSERT_EQUALS(KErrGsmOfflineOpNotAllowed, requestStatus.Int()); |
|
705 |
|
706 CleanupStack::PopAndDestroy(3, this); // data, this, ussdMessaging |
|
707 |
|
708 } |
|
709 |
|
710 /** |
|
711 @SYMTestCaseID BA-CTSY-USSDM-USR-0001 |
|
712 @SYMComponent telephony_ctsy |
|
713 @SYMTestCaseDesc Test support in CTSY for RMobileUssdMessaging::SendRelease |
|
714 @SYMTestPriority High |
|
715 @SYMTestActions Invokes RMobileUssdMessaging::SendRelease |
|
716 @SYMTestExpectedResults Pass |
|
717 @SYMTestType CT |
|
718 */ |
|
719 void CCTsyUssdMessagingFU::TestSendRelease0001L() |
|
720 { |
|
721 OpenEtelServerL(EUseExtendedError); |
|
722 CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
|
723 OpenPhoneL(); |
|
724 |
|
725 RBuf8 data; |
|
726 CleanupClosePushL(data); |
|
727 |
|
728 RMobileUssdMessaging ussdMessaging; |
|
729 TInt ret = ussdMessaging.Open(iPhone); |
|
730 ASSERT_EQUALS(KErrNone, ret); |
|
731 CleanupClosePushL(ussdMessaging); |
|
732 |
|
733 //------------------------------------------------------------------------- |
|
734 // Setup: This block is taken from TestReceiveMessage0001L. All we want to |
|
735 // do is to initiate a dialogue and then end it. Once the dialogue has ended |
|
736 // then we can call Accept and Reject. |
|
737 //------------------------------------------------------------------------- |
|
738 |
|
739 TRequestStatus requestStatus; |
|
740 |
|
741 TRequestStatus mockLtsyStatus; |
|
742 |
|
743 TUint32 flags = 100; |
|
744 RMobileUssdMessaging::TMobileUssdDataFormat format = RMobileUssdMessaging::EFormatUnspecified; |
|
745 RMobileUssdMessaging::TMobileUssdMessageType type = RMobileUssdMessaging::EUssdMORequest; |
|
746 TUint8 dcs = 200; |
|
747 |
|
748 //------------------------------------------------------------------------- |
|
749 // function parameters |
|
750 |
|
751 RMobileUssdMessaging::TMobileUssdAttributesV1 attributes; |
|
752 TPckg<RMobileUssdMessaging::TMobileUssdAttributesV1> msgAttributes(attributes); |
|
753 |
|
754 RMobileUssdMessaging::TGsmUssdMessageData name; |
|
755 |
|
756 //------------------------------------------------------------------------- |
|
757 |
|
758 RMobileUssdMessaging::TMobileUssdAttributesV1 completeAttributes; |
|
759 |
|
760 completeAttributes.iFlags = flags; |
|
761 completeAttributes.iFormat = format; |
|
762 completeAttributes.iType = type; |
|
763 completeAttributes.iDcs = dcs; |
|
764 |
|
765 TBuf8<KMaxName> completeName = _L8("Name1"); |
|
766 |
|
767 TMockLtsyData2<TBuf8<KMaxName>, RMobileUssdMessaging::TMobileUssdAttributesV1> |
|
768 mockData2(completeName, completeAttributes); |
|
769 mockData2.SerialiseL(data); |
|
770 |
|
771 iMockLTSY.CompleteL(EMobileUssdMessagingReceiveMessage, KErrNone, data); |
|
772 |
|
773 ussdMessaging.ReceiveMessage(requestStatus, name, msgAttributes); |
|
774 User::WaitForRequest(requestStatus); |
|
775 ret = requestStatus.Int(); |
|
776 ASSERT_EQUALS(KErrNone, ret); |
|
777 ussdMessaging.AcceptIncomingDialogue(); |
|
778 |
|
779 AssertMockLtsyStatusL(); |
|
780 ASSERT_EQUALS(KErrNone, requestStatus.Int()); |
|
781 |
|
782 //------------------------------------------------------------------------- |
|
783 // Release the dialogue |
|
784 //------------------------------------------------------------------------- |
|
785 |
567 //------------------------------------------------------------------------- |
786 //------------------------------------------------------------------------- |
568 // function parameters |
787 // function parameters |
569 |
788 |
570 RMobilePhone::TMobilePhoneSendSSRequestV3 sendV3; |
789 RMobilePhone::TMobilePhoneSendSSRequestV3 sendV3; |
571 TPckg<RMobilePhone::TMobilePhoneSendSSRequestV3> pckgSendV3(sendV3); |
790 TPckg<RMobilePhone::TMobilePhoneSendSSRequestV3> pckgSendV3(sendV3); |
572 |
791 |
573 //------------------------------------------------------------------------- |
792 //------------------------------------------------------------------------- |
574 |
793 |
575 RMobilePhone::TMobilePhoneSendSSRequestV3 completeSendV3; |
794 RMobilePhone::TMobilePhoneSendSSRequestV3 completeSendV3; |
576 |
795 |
577 TUint8 opCode = 100; |
796 TUint8 opCode = 100; |
578 _LIT(KAdditionalInfo1, "additionalInfo1"); |
797 _LIT(KAdditionalInfo1, "additionalInfo1"); |
579 |
798 |
580 completeSendV3.iOpCode = opCode; |
799 completeSendV3.iOpCode = opCode; |
581 completeSendV3.iAdditionalInfo = KAdditionalInfo1; |
800 completeSendV3.iAdditionalInfo = KAdditionalInfo1; |
582 |
801 |
583 TMockLtsyData1< RMobilePhone::TMobilePhoneSendSSRequestV3 > mockData1(completeSendV3); |
802 TMockLtsyData1< RMobilePhone::TMobilePhoneSendSSRequestV3 > mockData1(completeSendV3); |
584 |
|
585 mockData1.SerialiseL(data); |
803 mockData1.SerialiseL(data); |
586 |
804 |
587 //------------------------------------------------------------------------- |
|
588 // TEST B: failure on completion of pending request from LTSY->CTSY |
|
589 //------------------------------------------------------------------------- |
|
590 |
|
591 iMockLTSY.ExpectL(EMobileUssdMessagingSendRelease); |
|
592 iMockLTSY.CompleteL(EMobileUssdMessagingSendRelease, KErrGeneral, data); |
|
593 ussdMessaging.SendRelease(requestStatus, pckgSendV3); |
|
594 |
|
595 User::WaitForRequest(requestStatus); |
|
596 AssertMockLtsyStatusL(); |
|
597 ASSERT_EQUALS(KErrGeneral, requestStatus.Int()); |
|
598 |
|
599 //------------------------------------------------------------------------- |
805 //------------------------------------------------------------------------- |
600 // TEST C: Successful completion request of |
806 // TEST C: Successful completion request of |
601 // RMobileUssdMessaging::SendRelease when result is not cached. |
807 // RMobileUssdMessaging::SendRelease when result is not cached. |
602 //------------------------------------------------------------------------- |
808 //------------------------------------------------------------------------- |
603 |
809 |
604 iMockLTSY.ExpectL(EMobileUssdMessagingSendRelease); |
810 iMockLTSY.ExpectL(EMobileUssdMessagingSendRelease); |
605 iMockLTSY.CompleteL(EMobileUssdMessagingSendRelease, KErrNone, data); |
811 iMockLTSY.CompleteL(EMobileUssdMessagingSendRelease, KErrNone, data); |
606 ussdMessaging.SendRelease(requestStatus, pckgSendV3); |
812 ussdMessaging.SendRelease(requestStatus, pckgSendV3); |
607 |
813 |
608 User::WaitForRequest(requestStatus); |
814 User::WaitForRequest(requestStatus); |
609 AssertMockLtsyStatusL(); |
815 AssertMockLtsyStatusL(); |
610 ASSERT_EQUALS(KErrNone, requestStatus.Int()); |
816 ASSERT_EQUALS(KErrNone, requestStatus.Int()); |
|
817 |
611 ASSERT_EQUALS(opCode, sendV3.iOpCode); |
818 ASSERT_EQUALS(opCode, sendV3.iOpCode); |
612 ASSERT_EQUALS(0, completeSendV3.iAdditionalInfo.Compare(sendV3.iAdditionalInfo)); |
819 ASSERT_EQUALS(0, completeSendV3.iAdditionalInfo.Compare(sendV3.iAdditionalInfo)); |
613 |
820 |
614 //------------------------------------------------------------------------- |
821 //------------------------------------------------------------------------- |
615 // TEST E: Unsolicited completion of RMobileUssdMessaging::SendRelease |
822 // TEST E: Unsolicited completion of RMobileUssdMessaging::SendRelease |
616 // from LTSY. |
823 // from LTSY. |
617 //------------------------------------------------------------------------- |
824 //------------------------------------------------------------------------- |
618 |
825 |
619 iMockLTSY.NotifyTerminated(mockLtsyStatus); |
826 iMockLTSY.NotifyTerminated(mockLtsyStatus); |
620 iMockLTSY.CompleteL(EMobileUssdMessagingSendRelease, KErrNone, data); |
827 iMockLTSY.CompleteL(EMobileUssdMessagingSendRelease, KErrNone, data); |
621 User::WaitForRequest(mockLtsyStatus); |
828 User::WaitForRequest(mockLtsyStatus); |
622 AssertMockLtsyStatusL(); |
829 AssertMockLtsyStatusL(); |
623 ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int()); |
830 ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int()); |
624 |
831 |
625 CleanupStack::PopAndDestroy(3, this); // data, this, ussdMessaging |
832 CleanupStack::PopAndDestroy(3, this); // data, this, ussdMessaging, dataTest |
626 |
|
627 } |
833 } |
628 |
834 |
629 /** |
835 /** |
630 @SYMTestCaseID BA-CTSY-USSDM-USR-0001b |
836 @SYMTestCaseID BA-CTSY-USSDM-USR-0001b |
631 @SYMComponent telephony_ctsy |
837 @SYMComponent telephony_ctsy |
635 @SYMTestExpectedResults Pass |
841 @SYMTestExpectedResults Pass |
636 @SYMTestType CT |
842 @SYMTestType CT |
637 */ |
843 */ |
638 void CCTsyUssdMessagingFU::TestSendRelease0001bL() |
844 void CCTsyUssdMessagingFU::TestSendRelease0001bL() |
639 { |
845 { |
|
846 OpenEtelServerL(EUseExtendedError); |
|
847 CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
|
848 OpenPhoneL(); |
|
849 |
|
850 RBuf8 data; |
|
851 CleanupClosePushL(data); |
|
852 |
|
853 RMobileUssdMessaging ussdMessaging; |
|
854 TInt ret = ussdMessaging.Open(iPhone); |
|
855 ASSERT_EQUALS(KErrNone, ret); |
|
856 CleanupClosePushL(ussdMessaging); |
|
857 |
|
858 //------------------------------------------------------------------------- |
|
859 // Setup: This block is taken from TestReceiveMessage0001L. All we want to |
|
860 // do is to initiate a dialogue and then end it. Once the dialogue has ended |
|
861 // then we can call Accept and Reject. |
|
862 //------------------------------------------------------------------------- |
|
863 |
|
864 TRequestStatus requestStatus; |
|
865 TRequestStatus mockLtsyStatus; |
|
866 |
|
867 TUint32 flags = 100; |
|
868 RMobileUssdMessaging::TMobileUssdDataFormat format = RMobileUssdMessaging::EFormatUnspecified; |
|
869 RMobileUssdMessaging::TMobileUssdMessageType type = RMobileUssdMessaging::EUssdMORequest; |
|
870 TUint8 dcs = 200; |
|
871 |
|
872 //------------------------------------------------------------------------- |
|
873 // function parameters |
|
874 |
|
875 RMobileUssdMessaging::TMobileUssdAttributesV1 attributes; |
|
876 TPckg<RMobileUssdMessaging::TMobileUssdAttributesV1> msgAttributes(attributes); |
|
877 |
|
878 RMobileUssdMessaging::TGsmUssdMessageData name; |
|
879 |
|
880 //------------------------------------------------------------------------- |
|
881 |
|
882 RMobileUssdMessaging::TMobileUssdAttributesV1 completeAttributes; |
|
883 |
|
884 completeAttributes.iFlags = flags; |
|
885 completeAttributes.iFormat = format; |
|
886 completeAttributes.iType = type; |
|
887 completeAttributes.iDcs = dcs; |
|
888 |
|
889 TBuf8<KMaxName> completeName = _L8("Name1"); |
|
890 |
|
891 TMockLtsyData2<TBuf8<KMaxName>, RMobileUssdMessaging::TMobileUssdAttributesV1> |
|
892 mockData2(completeName, completeAttributes); |
|
893 mockData2.SerialiseL(data); |
|
894 |
|
895 iMockLTSY.CompleteL(EMobileUssdMessagingReceiveMessage, KErrNone, data); |
|
896 |
|
897 ussdMessaging.ReceiveMessage(requestStatus, name, msgAttributes); |
|
898 User::WaitForRequest(requestStatus); |
|
899 ret = requestStatus.Int(); |
|
900 ASSERT_EQUALS(KErrNone, ret); |
|
901 ussdMessaging.AcceptIncomingDialogue(); |
|
902 |
|
903 AssertMockLtsyStatusL(); |
|
904 ASSERT_EQUALS(KErrNone, requestStatus.Int()); |
|
905 |
|
906 //------------------------------------------------------------------------- |
|
907 // Release the dialogue |
|
908 //------------------------------------------------------------------------- |
|
909 |
|
910 //------------------------------------------------------------------------- |
|
911 // function parameters |
|
912 |
|
913 RMobilePhone::TMobilePhoneSendSSRequestV3 sendV3; |
|
914 TPckg<RMobilePhone::TMobilePhoneSendSSRequestV3> pckgSendV3(sendV3); |
|
915 |
|
916 //------------------------------------------------------------------------- |
|
917 |
|
918 RMobilePhone::TMobilePhoneSendSSRequestV3 completeSendV3; |
|
919 |
|
920 TUint8 opCode = 100; |
|
921 _LIT(KAdditionalInfo1, "additionalInfo1"); |
|
922 |
|
923 completeSendV3.iOpCode = opCode; |
|
924 completeSendV3.iAdditionalInfo = KAdditionalInfo1; |
|
925 |
|
926 TMockLtsyData1< RMobilePhone::TMobilePhoneSendSSRequestV3 > mockData1(completeSendV3); |
|
927 |
|
928 mockData1.SerialiseL(data); |
|
929 |
|
930 //------------------------------------------------------------------------- |
|
931 // TEST A: failure to dispatch request to LTSY |
|
932 //------------------------------------------------------------------------- |
|
933 |
|
934 iMockLTSY.ExpectL(EMobileUssdMessagingSendRelease, KErrNotSupported); |
|
935 ussdMessaging.SendRelease(requestStatus, pckgSendV3); |
|
936 |
|
937 User::WaitForRequest(requestStatus); |
|
938 AssertMockLtsyStatusL(); |
|
939 ASSERT_EQUALS(KErrNotSupported, requestStatus.Int()); |
|
940 |
|
941 //------------------------------------------------------------------------- |
|
942 |
|
943 iMockLTSY.ExpectL(EMobileUssdMessagingSendRelease); |
|
944 iMockLTSY.CompleteL(EMobileUssdMessagingSendRelease, KErrNone, data); |
|
945 ussdMessaging.SendRelease(requestStatus, pckgSendV3); |
|
946 |
|
947 User::WaitForRequest(requestStatus); |
|
948 |
|
949 ASSERT_EQUALS(KErrNone, requestStatus.Int()); |
|
950 |
|
951 AssertMockLtsyStatusL(); |
|
952 |
|
953 CleanupStack::PopAndDestroy(3); // data, this, ussdMessaging |
|
954 } |
|
955 |
|
956 /** |
|
957 @SYMTestCaseID BA-CTSY-USSDM-USR-0006 |
|
958 @SYMComponent telephony_ctsy |
|
959 @SYMTestCaseDesc Test support in CTSY for RMobileUssdMessaging::SendRelease without USSD session in progress |
|
960 @SYMTestPriority High |
|
961 @SYMTestActions Invokes RMobileUssdMessaging::SendRelease |
|
962 @SYMTestExpectedResults Pass |
|
963 @SYMTestType CT |
|
964 */ |
|
965 void CCTsyUssdMessagingFU::TestSendRelease0001cL() |
|
966 { |
|
967 |
640 OpenEtelServerL(EUseExtendedError); |
968 OpenEtelServerL(EUseExtendedError); |
641 CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
969 CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
642 OpenPhoneL(); |
970 OpenPhoneL(); |
643 |
971 |
644 RBuf8 data; |
972 RBuf8 data; |
645 CleanupClosePushL(data); |
973 CleanupClosePushL(data); |
646 |
|
647 TRequestStatus mockLtsyStatus; |
|
648 TRequestStatus requestStatus; |
|
649 |
974 |
650 RMobileUssdMessaging ussdMessaging; |
975 RMobileUssdMessaging ussdMessaging; |
651 TInt ret = ussdMessaging.Open(iPhone); |
976 TInt ret = ussdMessaging.Open(iPhone); |
652 ASSERT_EQUALS(KErrNone, ret); |
977 ASSERT_EQUALS(KErrNone, ret); |
653 CleanupClosePushL(ussdMessaging); |
978 CleanupClosePushL(ussdMessaging); |
654 |
979 |
|
980 TRequestStatus mockLtsyStatus; |
|
981 TRequestStatus requestStatus; |
|
982 |
655 //------------------------------------------------------------------------- |
983 //------------------------------------------------------------------------- |
656 // function parameters |
984 // function parameters |
657 |
985 |
658 RMobilePhone::TMobilePhoneSendSSRequestV3 sendV3; |
986 RMobilePhone::TMobilePhoneSendSSRequestV3 sendV3; |
659 TPckg<RMobilePhone::TMobilePhoneSendSSRequestV3> pckgSendV3(sendV3); |
987 TPckg<RMobilePhone::TMobilePhoneSendSSRequestV3> pckgSendV3(sendV3); |
660 |
988 |
661 //------------------------------------------------------------------------- |
989 //------------------------------------------------------------------------- |
662 |
990 |
663 RMobilePhone::TMobilePhoneSendSSRequestV3 completeSendV3; |
991 RMobilePhone::TMobilePhoneSendSSRequestV3 completeSendV3; |
664 |
992 |
665 TUint8 opCode = 100; |
993 TUint8 opCode = 100; |
666 _LIT(KAdditionalInfo1, "additionalInfo1"); |
994 _LIT(KAdditionalInfo1, "additionalInfo1"); |
667 |
995 |
668 completeSendV3.iOpCode = opCode; |
996 completeSendV3.iOpCode = opCode; |
669 completeSendV3.iAdditionalInfo = KAdditionalInfo1; |
997 completeSendV3.iAdditionalInfo = KAdditionalInfo1; |
670 |
998 |
671 TMockLtsyData1< RMobilePhone::TMobilePhoneSendSSRequestV3 > mockData1(completeSendV3); |
999 TMockLtsyData1< RMobilePhone::TMobilePhoneSendSSRequestV3 > mockData1(completeSendV3); |
672 |
|
673 mockData1.SerialiseL(data); |
1000 mockData1.SerialiseL(data); |
674 |
1001 |
675 //------------------------------------------------------------------------- |
1002 //------------------------------------------------------------------------- |
676 // TEST A: failure to dispatch request to LTSY |
1003 // TEST A: failure because there is no USSD session in progress |
677 //------------------------------------------------------------------------- |
1004 //------------------------------------------------------------------------- |
678 |
1005 |
679 iMockLTSY.ExpectL(EMobileUssdMessagingSendRelease, KErrNotSupported); |
|
680 ussdMessaging.SendRelease(requestStatus, pckgSendV3); |
1006 ussdMessaging.SendRelease(requestStatus, pckgSendV3); |
681 |
1007 |
|
1008 User::WaitForRequest(requestStatus); |
|
1009 AssertMockLtsyStatusL(); |
|
1010 ASSERT_EQUALS(KErrDisconnected, requestStatus.Int()); |
|
1011 |
|
1012 CleanupStack::PopAndDestroy(3, this); // data, this, ussdMessaging |
|
1013 |
|
1014 } |
|
1015 |
|
1016 /** |
|
1017 @SYMTestCaseID BA-CTSY-USSDM-USR-0001d |
|
1018 @SYMComponent telephony_ctsy |
|
1019 @SYMTestCaseDesc Test support in CTSY for failure on completion of pending comRMobileUssdMessaging::SendRelease request from LTSY->CTSY |
|
1020 @SYMTestPriority High |
|
1021 @SYMTestActions Invokes RMobileUssdMessaging::SendRelease |
|
1022 @SYMTestExpectedResults Pass |
|
1023 @SYMTestType CT |
|
1024 */ |
|
1025 void CCTsyUssdMessagingFU::TestSendRelease0001dL() |
|
1026 { |
|
1027 OpenEtelServerL(EUseExtendedError); |
|
1028 CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
|
1029 OpenPhoneL(); |
|
1030 |
|
1031 RBuf8 data; |
|
1032 CleanupClosePushL(data); |
|
1033 |
|
1034 RMobileUssdMessaging ussdMessaging; |
|
1035 TInt ret = ussdMessaging.Open(iPhone); |
|
1036 ASSERT_EQUALS(KErrNone, ret); |
|
1037 CleanupClosePushL(ussdMessaging); |
|
1038 |
|
1039 //------------------------------------------------------------------------- |
|
1040 // Setup: This block is taken from TestReceiveMessage0001L. All we want to |
|
1041 // do is to initiate a dialogue and then end it. Once the dialogue has ended |
|
1042 // then we can call Accept and Reject. |
|
1043 //------------------------------------------------------------------------- |
|
1044 |
|
1045 TRequestStatus requestStatus; |
|
1046 |
|
1047 TRequestStatus mockLtsyStatus; |
|
1048 |
|
1049 TUint32 flags = 100; |
|
1050 RMobileUssdMessaging::TMobileUssdDataFormat format = RMobileUssdMessaging::EFormatUnspecified; |
|
1051 RMobileUssdMessaging::TMobileUssdMessageType type = RMobileUssdMessaging::EUssdMORequest; |
|
1052 TUint8 dcs = 200; |
|
1053 |
|
1054 //------------------------------------------------------------------------- |
|
1055 // function parameters |
|
1056 |
|
1057 RMobileUssdMessaging::TMobileUssdAttributesV1 attributes; |
|
1058 TPckg<RMobileUssdMessaging::TMobileUssdAttributesV1> msgAttributes(attributes); |
|
1059 |
|
1060 RMobileUssdMessaging::TGsmUssdMessageData name; |
|
1061 |
|
1062 //------------------------------------------------------------------------- |
|
1063 |
|
1064 RMobileUssdMessaging::TMobileUssdAttributesV1 completeAttributes; |
|
1065 |
|
1066 completeAttributes.iFlags = flags; |
|
1067 completeAttributes.iFormat = format; |
|
1068 completeAttributes.iType = type; |
|
1069 completeAttributes.iDcs = dcs; |
|
1070 |
|
1071 TBuf8<KMaxName> completeName = _L8("Name1"); |
|
1072 |
|
1073 TMockLtsyData2<TBuf8<KMaxName>, RMobileUssdMessaging::TMobileUssdAttributesV1> |
|
1074 mockData2(completeName, completeAttributes); |
|
1075 mockData2.SerialiseL(data); |
|
1076 |
|
1077 iMockLTSY.CompleteL(EMobileUssdMessagingReceiveMessage, KErrNone, data); |
|
1078 |
|
1079 ussdMessaging.ReceiveMessage(requestStatus, name, msgAttributes); |
682 User::WaitForRequest(requestStatus); |
1080 User::WaitForRequest(requestStatus); |
|
1081 ret = requestStatus.Int(); |
|
1082 ASSERT_EQUALS(KErrNone, ret); |
|
1083 ussdMessaging.AcceptIncomingDialogue(); |
|
1084 |
|
1085 AssertMockLtsyStatusL(); |
|
1086 ASSERT_EQUALS(KErrNone, requestStatus.Int()); |
|
1087 |
|
1088 //------------------------------------------------------------------------- |
|
1089 // Release the dialogue |
|
1090 //------------------------------------------------------------------------- |
|
1091 |
|
1092 //------------------------------------------------------------------------- |
|
1093 // function parameters |
|
1094 |
|
1095 RMobilePhone::TMobilePhoneSendSSRequestV3 sendV3; |
|
1096 TPckg<RMobilePhone::TMobilePhoneSendSSRequestV3> pckgSendV3(sendV3); |
|
1097 |
|
1098 //------------------------------------------------------------------------- |
|
1099 |
|
1100 RMobilePhone::TMobilePhoneSendSSRequestV3 completeSendV3; |
|
1101 |
|
1102 TUint8 opCode = 100; |
|
1103 _LIT(KAdditionalInfo1, "additionalInfo1"); |
|
1104 |
|
1105 completeSendV3.iOpCode = opCode; |
|
1106 completeSendV3.iAdditionalInfo = KAdditionalInfo1; |
|
1107 |
|
1108 TMockLtsyData1< RMobilePhone::TMobilePhoneSendSSRequestV3 > mockData1(completeSendV3); |
|
1109 mockData1.SerialiseL(data); |
|
1110 |
|
1111 //------------------------------------------------------------------------- |
|
1112 // Failure on completion of pending request from LTSY->CTSY |
|
1113 //------------------------------------------------------------------------- |
|
1114 |
|
1115 iMockLTSY.ExpectL(EMobileUssdMessagingSendRelease); |
|
1116 iMockLTSY.CompleteL(EMobileUssdMessagingSendRelease, KErrGeneral, data); |
|
1117 ussdMessaging.SendRelease(requestStatus, pckgSendV3); |
|
1118 |
|
1119 User::WaitForRequest(requestStatus); |
683 AssertMockLtsyStatusL(); |
1120 AssertMockLtsyStatusL(); |
684 ASSERT_EQUALS(KErrNotSupported, requestStatus.Int()); |
1121 ASSERT_EQUALS(KErrGeneral, requestStatus.Int()); |
685 |
1122 |
686 //------------------------------------------------------------------------- |
1123 CleanupStack::PopAndDestroy(3, this); // data, this, ussdMessaging, dataTest |
687 |
|
688 iMockLTSY.ExpectL(EMobileUssdMessagingSendRelease); |
|
689 iMockLTSY.CompleteL(EMobileUssdMessagingSendRelease, KErrNone, data); |
|
690 ussdMessaging.SendRelease(requestStatus, pckgSendV3); |
|
691 |
|
692 User::WaitForRequest(requestStatus); |
|
693 |
|
694 ASSERT_EQUALS(KErrNone, requestStatus.Int()); |
|
695 |
|
696 AssertMockLtsyStatusL(); |
|
697 |
|
698 CleanupStack::PopAndDestroy(3); // data, this, ussdMessaging |
|
699 |
|
700 } |
1124 } |
701 |
1125 |
702 /** |
1126 /** |
703 @SYMTestCaseID BA-CTSY-USSDM-USR-0002 |
1127 @SYMTestCaseID BA-CTSY-USSDM-USR-0002 |
704 @SYMComponent telephony_ctsy |
1128 @SYMComponent telephony_ctsy |
769 |
1241 |
770 } |
1242 } |
771 |
1243 |
772 |
1244 |
773 /** |
1245 /** |
774 @SYMTestCaseID BA-CTSY-USSDM-USR-0003 |
1246 @SYMTestCaseID BA-CTSY-USSDM-USR-0002b |
775 @SYMComponent telephony_ctsy |
1247 @SYMComponent telephony_ctsy |
776 @SYMTestCaseDesc Test support in CTSY for RMobileUssdMessaging::SendRelease with bad parameter data |
1248 @SYMTestCaseDesc Test support in CTSY for cancelling of RMobileUssdMessaging::SendRelease |
777 @SYMTestPriority High |
1249 @SYMTestPriority High |
778 @SYMTestActions Invokes RMobileUssdMessaging::SendRelease with bad parameter data |
1250 @SYMTestActions Invokes cancelling of RMobileUssdMessaging::SendRelease |
779 @SYMTestExpectedResults Pass |
1251 @SYMTestExpectedResults Pass |
780 @SYMTestType CT |
1252 @SYMTestType CT |
781 */ |
1253 */ |
782 void CCTsyUssdMessagingFU::TestSendRelease0003L() |
1254 void CCTsyUssdMessagingFU::TestSendRelease0002bL() |
783 { |
1255 { |
784 |
|
785 OpenEtelServerL(EUseExtendedError); |
1256 OpenEtelServerL(EUseExtendedError); |
786 CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
1257 CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
787 OpenPhoneL(); |
1258 OpenPhoneL(); |
788 |
1259 |
789 RBuf8 data; |
1260 RBuf8 data; |
790 CleanupClosePushL(data); |
1261 CleanupClosePushL(data); |
791 |
|
792 TRequestStatus requestStatus; |
|
793 |
1262 |
794 RMobileUssdMessaging ussdMessaging; |
1263 RMobileUssdMessaging ussdMessaging; |
795 TInt ret = ussdMessaging.Open(iPhone); |
1264 TInt ret = ussdMessaging.Open(iPhone); |
796 ASSERT_EQUALS(KErrNone, ret); |
1265 ASSERT_EQUALS(KErrNone, ret); |
797 CleanupClosePushL(ussdMessaging); |
1266 CleanupClosePushL(ussdMessaging); |
798 |
1267 |
|
1268 //------------------------------------------------------------------------- |
|
1269 // Setup: This block is taken from TestReceiveMessage0001L. All we want to |
|
1270 // do is to initiate a dialogue and then end it. Once the dialogue has ended |
|
1271 // then we can call Accept and Reject. |
|
1272 //------------------------------------------------------------------------- |
|
1273 |
|
1274 TRequestStatus requestStatus; |
|
1275 TRequestStatus mockLtsyStatus; |
|
1276 |
|
1277 TUint32 flags = 100; |
|
1278 RMobileUssdMessaging::TMobileUssdDataFormat format = RMobileUssdMessaging::EFormatUnspecified; |
|
1279 RMobileUssdMessaging::TMobileUssdMessageType type = RMobileUssdMessaging::EUssdMTRequest; |
|
1280 TUint8 dcs = 200; |
|
1281 |
|
1282 //------------------------------------------------------------------------- |
|
1283 // function parameters |
|
1284 |
|
1285 RMobileUssdMessaging::TMobileUssdAttributesV1 attributes; |
|
1286 TPckg<RMobileUssdMessaging::TMobileUssdAttributesV1> msgAttributes(attributes); |
|
1287 |
|
1288 RMobileUssdMessaging::TGsmUssdMessageData name; |
|
1289 |
|
1290 //------------------------------------------------------------------------- |
|
1291 |
|
1292 RMobileUssdMessaging::TMobileUssdAttributesV1 completeAttributes; |
|
1293 |
|
1294 completeAttributes.iFlags = flags; |
|
1295 completeAttributes.iFormat = format; |
|
1296 completeAttributes.iType = type; |
|
1297 completeAttributes.iDcs = dcs; |
|
1298 |
|
1299 TBuf8<KMaxName> completeName = _L8("Name1"); |
|
1300 |
|
1301 TMockLtsyData2<TBuf8<KMaxName>, RMobileUssdMessaging::TMobileUssdAttributesV1> |
|
1302 mockData2(completeName, completeAttributes); |
|
1303 mockData2.SerialiseL(data); |
|
1304 |
|
1305 iMockLTSY.CompleteL(EMobileUssdMessagingReceiveMessage, KErrNone, data); |
|
1306 |
|
1307 ussdMessaging.ReceiveMessage(requestStatus, name, msgAttributes); |
|
1308 User::WaitForRequest(requestStatus); |
|
1309 ret = requestStatus.Int(); |
|
1310 ASSERT_EQUALS(KErrNone, ret); |
|
1311 |
|
1312 //------------------------------------------------------------------------- |
|
1313 // Release the dialogue |
|
1314 //------------------------------------------------------------------------- |
|
1315 |
|
1316 //------------------------------------------------------------------------- |
|
1317 // function parameters |
|
1318 |
|
1319 RMobilePhone::TMobilePhoneSendSSRequestV3 sendV3; |
|
1320 TPckg<RMobilePhone::TMobilePhoneSendSSRequestV3> pckgSendV3(sendV3); |
|
1321 |
|
1322 //------------------------------------------------------------------------- |
|
1323 |
|
1324 RMobilePhone::TMobilePhoneSendSSRequestV3 completeSendV3; |
|
1325 |
|
1326 TUint8 opCode = 100; |
|
1327 _LIT(KAdditionalInfo1, "additionalInfo1"); |
|
1328 |
|
1329 completeSendV3.iOpCode = opCode; |
|
1330 completeSendV3.iAdditionalInfo = KAdditionalInfo1; |
|
1331 |
|
1332 TMockLtsyData1< RMobilePhone::TMobilePhoneSendSSRequestV3 > mockData1(completeSendV3); |
|
1333 |
|
1334 mockData1.SerialiseL(data); |
|
1335 |
|
1336 //------------------------------------------------------------------------- |
|
1337 |
|
1338 ussdMessaging.SendRelease(requestStatus, pckgSendV3); |
|
1339 |
|
1340 ussdMessaging.AcceptIncomingDialogue(); |
|
1341 AssertMockLtsyStatusL(); |
|
1342 ASSERT_EQUALS(KErrDisconnected, requestStatus.Int()); |
|
1343 |
|
1344 CleanupStack::PopAndDestroy(3); // data, this, ussdMessaging |
|
1345 |
|
1346 } |
|
1347 |
|
1348 |
|
1349 |
|
1350 /** |
|
1351 @SYMTestCaseID BA-CTSY-USSDM-USR-0003 |
|
1352 @SYMComponent telephony_ctsy |
|
1353 @SYMTestCaseDesc Test support in CTSY for RMobileUssdMessaging::SendRelease with bad parameter data |
|
1354 @SYMTestPriority High |
|
1355 @SYMTestActions Invokes RMobileUssdMessaging::SendRelease with bad parameter data |
|
1356 @SYMTestExpectedResults Pass |
|
1357 @SYMTestType CT |
|
1358 */ |
|
1359 void CCTsyUssdMessagingFU::TestSendRelease0003L() |
|
1360 { |
|
1361 OpenEtelServerL(EUseExtendedError); |
|
1362 CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
|
1363 OpenPhoneL(); |
|
1364 |
|
1365 RBuf8 data; |
|
1366 CleanupClosePushL(data); |
|
1367 |
|
1368 RMobileUssdMessaging ussdMessaging; |
|
1369 TInt ret = ussdMessaging.Open(iPhone); |
|
1370 ASSERT_EQUALS(KErrNone, ret); |
|
1371 CleanupClosePushL(ussdMessaging); |
|
1372 |
|
1373 //------------------------------------------------------------------------- |
|
1374 // Setup: This block is taken from TestReceiveMessage0001L. All we want to |
|
1375 // do is to initiate a dialogue and then end it. Once the dialogue has ended |
|
1376 // then we can call Accept and Reject. |
|
1377 //------------------------------------------------------------------------- |
|
1378 |
|
1379 TRequestStatus requestStatus; |
|
1380 TRequestStatus mockLtsyStatus; |
|
1381 |
|
1382 TUint32 flags = 100; |
|
1383 RMobileUssdMessaging::TMobileUssdDataFormat format = RMobileUssdMessaging::EFormatUnspecified; |
|
1384 RMobileUssdMessaging::TMobileUssdMessageType type = RMobileUssdMessaging::EUssdMORequest; |
|
1385 TUint8 dcs = 200; |
|
1386 |
|
1387 //------------------------------------------------------------------------- |
|
1388 // function parameters |
|
1389 |
|
1390 RMobileUssdMessaging::TMobileUssdAttributesV1 attributes; |
|
1391 TPckg<RMobileUssdMessaging::TMobileUssdAttributesV1> msgAttributes(attributes); |
|
1392 |
|
1393 RMobileUssdMessaging::TGsmUssdMessageData name; |
|
1394 |
|
1395 //------------------------------------------------------------------------- |
|
1396 |
|
1397 RMobileUssdMessaging::TMobileUssdAttributesV1 completeAttributes; |
|
1398 |
|
1399 completeAttributes.iFlags = flags; |
|
1400 completeAttributes.iFormat = format; |
|
1401 completeAttributes.iType = type; |
|
1402 completeAttributes.iDcs = dcs; |
|
1403 |
|
1404 TBuf8<KMaxName> completeName = _L8("Name1"); |
|
1405 |
|
1406 TMockLtsyData2<TBuf8<KMaxName>, RMobileUssdMessaging::TMobileUssdAttributesV1> |
|
1407 mockData2(completeName, completeAttributes); |
|
1408 mockData2.SerialiseL(data); |
|
1409 |
|
1410 iMockLTSY.CompleteL(EMobileUssdMessagingReceiveMessage, KErrNone, data); |
|
1411 |
|
1412 ussdMessaging.ReceiveMessage(requestStatus, name, msgAttributes); |
|
1413 User::WaitForRequest(requestStatus); |
|
1414 ret = requestStatus.Int(); |
|
1415 ASSERT_EQUALS(KErrNone, ret); |
|
1416 ussdMessaging.AcceptIncomingDialogue(); |
|
1417 |
|
1418 AssertMockLtsyStatusL(); |
|
1419 ASSERT_EQUALS(KErrNone, requestStatus.Int()); |
|
1420 |
|
1421 //------------------------------------------------------------------------- |
|
1422 // Release the dialogue |
|
1423 //------------------------------------------------------------------------- |
|
1424 |
799 //------------------------------------------------------------------------- |
1425 //------------------------------------------------------------------------- |
800 |
1426 |
801 RMobilePhone::TMobilePhoneSendSSRequestV3 completeSendV3; |
1427 RMobilePhone::TMobilePhoneSendSSRequestV3 completeSendV3; |
802 |
1428 |
803 TUint8 opCode = 100; |
1429 TUint8 opCode = 100; |
835 @SYMTestExpectedResults Pass |
1461 @SYMTestExpectedResults Pass |
836 @SYMTestType CT |
1462 @SYMTestType CT |
837 */ |
1463 */ |
838 void CCTsyUssdMessagingFU::TestSendRelease0004L() |
1464 void CCTsyUssdMessagingFU::TestSendRelease0004L() |
839 { |
1465 { |
840 |
1466 OpenEtelServerL(EUseExtendedError); |
|
1467 CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
|
1468 OpenPhoneL(); |
|
1469 |
|
1470 RBuf8 data; |
|
1471 CleanupClosePushL(data); |
|
1472 |
|
1473 RMobileUssdMessaging ussdMessaging; |
|
1474 TInt ret = ussdMessaging.Open(iPhone); |
|
1475 ASSERT_EQUALS(KErrNone, ret); |
|
1476 CleanupClosePushL(ussdMessaging); |
|
1477 |
|
1478 //------------------------------------------------------------------------- |
|
1479 // Setup: This block is taken from TestReceiveMessage0001L. All we want to |
|
1480 // do is to initiate a dialogue and then end it. Once the dialogue has ended |
|
1481 // then we can call Accept and Reject. |
|
1482 //------------------------------------------------------------------------- |
|
1483 |
|
1484 TRequestStatus requestStatus; |
|
1485 TRequestStatus mockLtsyStatus; |
|
1486 |
|
1487 TUint32 flags = 100; |
|
1488 RMobileUssdMessaging::TMobileUssdDataFormat format = RMobileUssdMessaging::EFormatUnspecified; |
|
1489 RMobileUssdMessaging::TMobileUssdMessageType type = RMobileUssdMessaging::EUssdMORequest; |
|
1490 TUint8 dcs = 200; |
|
1491 |
|
1492 //------------------------------------------------------------------------- |
|
1493 // function parameters |
|
1494 |
|
1495 RMobileUssdMessaging::TMobileUssdAttributesV1 attributes; |
|
1496 TPckg<RMobileUssdMessaging::TMobileUssdAttributesV1> msgAttributes(attributes); |
|
1497 |
|
1498 RMobileUssdMessaging::TGsmUssdMessageData name; |
|
1499 |
|
1500 //------------------------------------------------------------------------- |
|
1501 |
|
1502 RMobileUssdMessaging::TMobileUssdAttributesV1 completeAttributes; |
|
1503 |
|
1504 completeAttributes.iFlags = flags; |
|
1505 completeAttributes.iFormat = format; |
|
1506 completeAttributes.iType = type; |
|
1507 completeAttributes.iDcs = dcs; |
|
1508 |
|
1509 TBuf8<KMaxName> completeName = _L8("Name1"); |
|
1510 |
|
1511 TMockLtsyData2<TBuf8<KMaxName>, RMobileUssdMessaging::TMobileUssdAttributesV1> |
|
1512 mockData2(completeName, completeAttributes); |
|
1513 mockData2.SerialiseL(data); |
|
1514 |
|
1515 iMockLTSY.CompleteL(EMobileUssdMessagingReceiveMessage, KErrNone, data); |
|
1516 |
|
1517 ussdMessaging.ReceiveMessage(requestStatus, name, msgAttributes); |
|
1518 User::WaitForRequest(requestStatus); |
|
1519 ret = requestStatus.Int(); |
|
1520 ASSERT_EQUALS(KErrNone, ret); |
|
1521 ussdMessaging.AcceptIncomingDialogue(); |
|
1522 |
|
1523 AssertMockLtsyStatusL(); |
|
1524 ASSERT_EQUALS(KErrNone, requestStatus.Int()); |
|
1525 |
|
1526 //------------------------------------------------------------------------- |
|
1527 // Release the dialogue |
|
1528 //------------------------------------------------------------------------- |
|
1529 |
|
1530 // Open second client |
|
1531 RTelServer telServer2; |
|
1532 ret = telServer2.Connect(); |
|
1533 ASSERT_EQUALS(KErrNone, ret); |
|
1534 CleanupClosePushL(telServer2); |
|
1535 |
|
1536 RMobilePhone phone2; |
|
1537 ret = phone2.Open(telServer2,KMmTsyPhoneName); |
|
1538 ASSERT_EQUALS(KErrNone, ret); |
|
1539 CleanupClosePushL(phone2); |
|
1540 |
|
1541 RMobileUssdMessaging ussdMessaging2; |
|
1542 ret = ussdMessaging2.Open(phone2); |
|
1543 ASSERT_EQUALS(KErrNone, ret); |
|
1544 CleanupClosePushL(ussdMessaging2); |
|
1545 |
|
1546 TRequestStatus requestStatus1; |
|
1547 TRequestStatus requestStatus2; |
|
1548 |
|
1549 //------------------------------------------------------------------------- |
|
1550 // parameters for first function |
|
1551 |
|
1552 RMobilePhone::TMobilePhoneSendSSRequestV3 sendV31; |
|
1553 TPckg<RMobilePhone::TMobilePhoneSendSSRequestV3> pckgSendV31(sendV31); |
|
1554 |
|
1555 //------------------------------------------------------------------------- |
|
1556 |
|
1557 RMobilePhone::TMobilePhoneSendSSRequestV3 completeSendV31; |
|
1558 |
|
1559 TUint8 opCode = 100; |
|
1560 _LIT(KAdditionalInfo1, "additionalInfo1"); |
|
1561 |
|
1562 completeSendV31.iOpCode = opCode; |
|
1563 completeSendV31.iAdditionalInfo = KAdditionalInfo1; |
|
1564 |
|
1565 TMockLtsyData1< RMobilePhone::TMobilePhoneSendSSRequestV3 > mockData11(completeSendV31); |
|
1566 |
|
1567 //------------------------------------------------------------------------- |
|
1568 // parameters for second function |
|
1569 |
|
1570 RMobilePhone::TMobilePhoneSendSSRequestV3 sendV32; |
|
1571 TPckg<RMobilePhone::TMobilePhoneSendSSRequestV3> pckgSendV32(sendV32); |
|
1572 |
|
1573 //------------------------------------------------------------------------- |
|
1574 // Test A: Test multiple clients requesting RMobileUssdMessaging::SendRelease |
|
1575 //------------------------------------------------------------------------- |
|
1576 |
|
1577 mockData11.SerialiseL(data); |
|
1578 iMockLTSY.ExpectL(EMobileUssdMessagingSendRelease); |
|
1579 iMockLTSY.CompleteL(EMobileUssdMessagingSendRelease, KErrNone, data, 10); |
|
1580 ussdMessaging.SendRelease(requestStatus, pckgSendV31); |
|
1581 |
|
1582 ussdMessaging2.SendRelease(requestStatus2, pckgSendV32); |
|
1583 |
|
1584 User::WaitForRequest(requestStatus); |
|
1585 ASSERT_EQUALS(KErrNone, requestStatus.Int()); |
|
1586 |
|
1587 User::WaitForRequest(requestStatus2); |
|
1588 ASSERT_EQUALS(KErrAccessDenied, requestStatus2.Int()); |
|
1589 ASSERT_EQUALS(opCode, sendV31.iOpCode); |
|
1590 ASSERT_EQUALS(0, sendV31.iAdditionalInfo.Compare(KAdditionalInfo1)); |
|
1591 |
|
1592 AssertMockLtsyStatusL(); |
|
1593 CleanupStack::PopAndDestroy(6, this); // data, ussdMessaging2, ussdMessaging, |
|
1594 // phone2, telServer2, this |
|
1595 } |
|
1596 |
|
1597 /** |
|
1598 @SYMTestCaseID BA-CTSY-USSDM-USR-0004a |
|
1599 @SYMComponent telephony_ctsy |
|
1600 @SYMTestCaseDesc Test support in CTSY for multiple client requests to RMobileUssdMessaging::SendRelease |
|
1601 @SYMTestPriority High |
|
1602 @SYMTestActions Invokes multiple client requests to RMobileUssdMessaging::SendRelease |
|
1603 @SYMTestExpectedResults Pass |
|
1604 @SYMTestType CT |
|
1605 */ |
|
1606 void CCTsyUssdMessagingFU::TestSendRelease0004bL() |
|
1607 { |
841 OpenEtelServerL(EUseExtendedError); |
1608 OpenEtelServerL(EUseExtendedError); |
842 CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
1609 CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
843 OpenPhoneL(); |
1610 OpenPhoneL(); |
844 |
1611 |
|
1612 RBuf8 data; |
|
1613 CleanupClosePushL(data); |
|
1614 |
|
1615 RMobileUssdMessaging ussdMessaging; |
|
1616 TInt ret = ussdMessaging.Open(iPhone); |
|
1617 ASSERT_EQUALS(KErrNone, ret); |
|
1618 CleanupClosePushL(ussdMessaging); |
|
1619 |
|
1620 //------------------------------------------------------------------------- |
|
1621 // Setup: This block is taken from TestReceiveMessage0001L. All we want to |
|
1622 // do is to initiate a dialogue and then end it. Once the dialogue has ended |
|
1623 // then we can call Accept and Reject. |
|
1624 //------------------------------------------------------------------------- |
|
1625 |
|
1626 TRequestStatus requestStatus; |
|
1627 TRequestStatus mockLtsyStatus; |
|
1628 |
|
1629 TUint32 flags = 100; |
|
1630 RMobileUssdMessaging::TMobileUssdDataFormat format = RMobileUssdMessaging::EFormatUnspecified; |
|
1631 RMobileUssdMessaging::TMobileUssdMessageType type = RMobileUssdMessaging::EUssdMTRequest; |
|
1632 TUint8 dcs = 200; |
|
1633 |
|
1634 //------------------------------------------------------------------------- |
|
1635 // function parameters |
|
1636 |
|
1637 RMobileUssdMessaging::TMobileUssdAttributesV1 attributes; |
|
1638 TPckg<RMobileUssdMessaging::TMobileUssdAttributesV1> msgAttributes(attributes); |
|
1639 |
|
1640 RMobileUssdMessaging::TGsmUssdMessageData name; |
|
1641 |
|
1642 //------------------------------------------------------------------------- |
|
1643 |
|
1644 RMobileUssdMessaging::TMobileUssdAttributesV1 completeAttributes; |
|
1645 |
|
1646 completeAttributes.iFlags = flags; |
|
1647 completeAttributes.iFormat = format; |
|
1648 completeAttributes.iType = type; |
|
1649 completeAttributes.iDcs = dcs; |
|
1650 |
|
1651 TBuf8<KMaxName> completeName = _L8("Name1"); |
|
1652 |
|
1653 TMockLtsyData2<TBuf8<KMaxName>, RMobileUssdMessaging::TMobileUssdAttributesV1> |
|
1654 mockData2(completeName, completeAttributes); |
|
1655 mockData2.SerialiseL(data); |
|
1656 |
|
1657 iMockLTSY.CompleteL(EMobileUssdMessagingReceiveMessage, KErrNone, data); |
|
1658 |
|
1659 ussdMessaging.ReceiveMessage(requestStatus, name, msgAttributes); |
|
1660 User::WaitForRequest(requestStatus); |
|
1661 ret = requestStatus.Int(); |
|
1662 ASSERT_EQUALS(KErrNone, ret); |
|
1663 ussdMessaging.AcceptIncomingDialogue(); |
|
1664 |
|
1665 AssertMockLtsyStatusL(); |
|
1666 |
|
1667 //------------------------------------------------------------------------- |
|
1668 // Try to release the dialogue |
|
1669 //------------------------------------------------------------------------- |
|
1670 |
845 // Open second client |
1671 // Open second client |
846 RTelServer telServer2; |
1672 RTelServer telServer2; |
847 TInt ret = telServer2.Connect(); |
1673 ret = telServer2.Connect(); |
848 ASSERT_EQUALS(KErrNone, ret); |
1674 ASSERT_EQUALS(KErrNone, ret); |
849 CleanupClosePushL(telServer2); |
1675 CleanupClosePushL(telServer2); |
850 |
1676 |
851 RMobilePhone phone2; |
1677 RMobilePhone phone2; |
852 ret = phone2.Open(telServer2,KMmTsyPhoneName); |
1678 ret = phone2.Open(telServer2,KMmTsyPhoneName); |
853 ASSERT_EQUALS(KErrNone, ret); |
1679 ASSERT_EQUALS(KErrNone, ret); |
854 CleanupClosePushL(phone2); |
1680 CleanupClosePushL(phone2); |
855 |
1681 |
856 RMobileUssdMessaging ussdMessaging1; |
|
857 ret = ussdMessaging1.Open(iPhone); |
|
858 ASSERT_EQUALS(KErrNone, ret); |
|
859 CleanupClosePushL(ussdMessaging1); |
|
860 |
|
861 RMobileUssdMessaging ussdMessaging2; |
1682 RMobileUssdMessaging ussdMessaging2; |
862 ret = ussdMessaging2.Open(phone2); |
1683 ret = ussdMessaging2.Open(phone2); |
863 ASSERT_EQUALS(KErrNone, ret); |
1684 ASSERT_EQUALS(KErrNone, ret); |
864 CleanupClosePushL(ussdMessaging2); |
1685 CleanupClosePushL(ussdMessaging2); |
865 |
1686 |
866 TRequestStatus requestStatus1; |
1687 //------------------------------------------------------------------------- |
867 TRequestStatus requestStatus2; |
1688 // function parameters |
868 |
1689 |
869 //------------------------------------------------------------------------- |
1690 RMobilePhone::TMobilePhoneSendSSRequestV3 sendV3; |
870 // parameters for first function |
1691 TPckg<RMobilePhone::TMobilePhoneSendSSRequestV3> pckgSendV3(sendV3); |
871 |
1692 |
872 RMobilePhone::TMobilePhoneSendSSRequestV3 sendV31; |
1693 //------------------------------------------------------------------------- |
873 TPckg<RMobilePhone::TMobilePhoneSendSSRequestV3> pckgSendV31(sendV31); |
1694 |
874 |
1695 RMobilePhone::TMobilePhoneSendSSRequestV3 completeSendV3; |
875 //------------------------------------------------------------------------- |
1696 |
876 |
|
877 RMobilePhone::TMobilePhoneSendSSRequestV3 completeSendV31; |
|
878 |
|
879 TUint8 opCode = 100; |
1697 TUint8 opCode = 100; |
880 _LIT(KAdditionalInfo1, "additionalInfo1"); |
1698 _LIT(KAdditionalInfo1, "additionalInfo1"); |
881 |
1699 |
882 completeSendV31.iOpCode = opCode; |
1700 completeSendV3.iOpCode = opCode; |
883 completeSendV31.iAdditionalInfo = KAdditionalInfo1; |
1701 completeSendV3.iAdditionalInfo = KAdditionalInfo1; |
884 |
1702 |
885 TMockLtsyData1< RMobilePhone::TMobilePhoneSendSSRequestV3 > mockData11(completeSendV31); |
1703 TMockLtsyData1< RMobilePhone::TMobilePhoneSendSSRequestV3 > mockData1(completeSendV3); |
886 |
1704 mockData1.SerialiseL(data); |
887 //------------------------------------------------------------------------- |
1705 |
888 // parameters for second function |
1706 //------------------------------------------------------------------------- |
889 |
1707 // Test: The second client requests RMobileUssdMessaging::SendRelease |
890 RMobilePhone::TMobilePhoneSendSSRequestV3 sendV32; |
1708 //------------------------------------------------------------------------- |
891 TPckg<RMobilePhone::TMobilePhoneSendSSRequestV3> pckgSendV32(sendV32); |
1709 |
892 |
|
893 //------------------------------------------------------------------------- |
|
894 // Test A: Test multiple clients requesting RMobileUssdMessaging::SendRelease |
|
895 //------------------------------------------------------------------------- |
|
896 |
|
897 RBuf8 data; |
|
898 CleanupClosePushL(data); // PUSH |
|
899 mockData11.SerialiseL(data); |
|
900 iMockLTSY.ExpectL(EMobileUssdMessagingSendRelease); |
1710 iMockLTSY.ExpectL(EMobileUssdMessagingSendRelease); |
901 iMockLTSY.CompleteL(EMobileUssdMessagingSendRelease, KErrNone, data, 10); |
1711 iMockLTSY.CompleteL(EMobileUssdMessagingSendRelease, KErrDisconnected, data, 10); |
902 ussdMessaging1.SendRelease(requestStatus1, pckgSendV31); |
1712 |
903 |
1713 TRequestStatus requestStatus2; |
904 ussdMessaging2.SendRelease(requestStatus2, pckgSendV32); |
1714 ussdMessaging2.SendRelease(requestStatus2, pckgSendV3); |
905 |
1715 |
906 User::WaitForRequest(requestStatus1); |
1716 User::WaitForRequest(requestStatus2); |
907 ASSERT_EQUALS(KErrNone, requestStatus1.Int()); |
|
908 |
|
909 User::WaitForRequest(requestStatus2); |
|
910 ASSERT_EQUALS(KErrServerBusy, requestStatus2.Int()); |
|
911 ASSERT_EQUALS(opCode, sendV31.iOpCode); |
|
912 ASSERT_EQUALS(0, sendV31.iAdditionalInfo.Compare(KAdditionalInfo1)); |
|
913 |
|
914 AssertMockLtsyStatusL(); |
1717 AssertMockLtsyStatusL(); |
915 CleanupStack::PopAndDestroy(6, this); // data, ussdMessaging2, ussdMessaging1, |
1718 ASSERT_EQUALS(KErrDisconnected, requestStatus2.Int()); |
916 // phone2, telServer2, this |
1719 |
|
1720 CleanupStack::PopAndDestroy(6, this); // data, ussdMessaging2, ussdMessaging, |
|
1721 // phone2, telServer2, this |
917 } |
1722 } |
918 |
|
919 |
1723 |
920 /** |
1724 /** |
921 @SYMTestCaseID BA-CTSY-USSDM-USR-0005 |
1725 @SYMTestCaseID BA-CTSY-USSDM-USR-0005 |
922 @SYMComponent telephony_ctsy |
1726 @SYMComponent telephony_ctsy |
923 @SYMTestCaseDesc Test support in CTSY for RMobileUssdMessaging::SendRelease with timeout |
1727 @SYMTestCaseDesc Test support in CTSY for RMobileUssdMessaging::SendRelease with timeout |
2258 completeAttrV1.iFormat = RMobileUssdMessaging::EFormatPackedString; |
3246 completeAttrV1.iFormat = RMobileUssdMessaging::EFormatPackedString; |
2259 completeAttrV1.iType = RMobileUssdMessaging::EUssdMOAcknowledgement; |
3247 completeAttrV1.iType = RMobileUssdMessaging::EUssdMOAcknowledgement; |
2260 |
3248 |
2261 TMockLtsyData2< RMobilePhone::TMobilePhoneSendSSRequestV3, |
3249 TMockLtsyData2< RMobilePhone::TMobilePhoneSendSSRequestV3, |
2262 RMobileUssdMessaging::TMobileUssdAttributesV1 > |
3250 RMobileUssdMessaging::TMobileUssdAttributesV1 > |
2263 mockData2(completeSendV3,completeAttrV1); |
3251 mockData2Release(completeSendV3,completeAttrV1); |
2264 |
3252 |
2265 RBuf8 data2; |
3253 RBuf8 data2; |
2266 CleanupClosePushL(data2); |
3254 CleanupClosePushL(data2); |
2267 mockData2.SerialiseL(data2); |
3255 mockData2Release.SerialiseL(data2); |
2268 |
3256 |
2269 //------------------------------------------------------------------------- |
3257 //------------------------------------------------------------------------- |
2270 // TEST B: failure on completion of pending request from LTSY->CTSY |
3258 // TEST C: Successful completion request of |
2271 //------------------------------------------------------------------------- |
3259 // RMobileUssdMessaging::NotifyNetworkRelease when result is not cached. |
2272 iMockLTSY.CompleteL(EMobileUssdMessagingNotifyNetworkRelease, KErrGeneral, data); |
3260 //------------------------------------------------------------------------- |
|
3261 iMockLTSY.CompleteL(EMobileUssdMessagingNotifyNetworkRelease, KErrNone, data); |
2273 ussdMessaging.NotifyNetworkRelease(requestStatus, pckgSendV3); |
3262 ussdMessaging.NotifyNetworkRelease(requestStatus, pckgSendV3); |
2274 |
3263 |
2275 User::WaitForRequest(requestStatus); |
3264 |
|
3265 User::WaitForRequest(requestStatus); |
2276 AssertMockLtsyStatusL(); |
3266 AssertMockLtsyStatusL(); |
2277 ASSERT_EQUALS(KErrGeneral, requestStatus.Int()); |
3267 ASSERT_EQUALS(KErrNone, requestStatus.Int()); |
2278 |
3268 |
2279 |
3269 ASSERT_EQUALS(opCode, sendV3.iOpCode); |
2280 // other version of API (with optional TMobileUssdAttributesV1 parameter) |
3270 ASSERT_EQUALS(0, sendV3.iAdditionalInfo.Compare(KAdditionalInfo1)); |
2281 |
3271 |
2282 iMockLTSY.CompleteL(EMobileUssdMessagingNotifyNetworkRelease, KErrNotReady, data2); |
3272 //------------------------------------------------------------------------- |
2283 ussdMessaging.NotifyNetworkRelease(requestStatus, pckgSendV3, pckgAttrV1); |
|
2284 |
|
2285 User::WaitForRequest(requestStatus); |
|
2286 AssertMockLtsyStatusL(); |
|
2287 ASSERT_EQUALS(KErrNotReady, requestStatus.Int()); |
|
2288 |
|
2289 //------------------------------------------------------------------------- |
|
2290 // TEST E: Unsolicited completion of RMobileUssdMessaging::NotifyNetworkRelease |
3273 // TEST E: Unsolicited completion of RMobileUssdMessaging::NotifyNetworkRelease |
2291 // from LTSY. |
3274 // from LTSY. |
2292 //------------------------------------------------------------------------- |
3275 //------------------------------------------------------------------------- |
2293 |
3276 |
2294 iMockLTSY.NotifyTerminated(mockLtsyStatus); |
3277 iMockLTSY.NotifyTerminated(mockLtsyStatus); |
2295 iMockLTSY.CompleteL(EMobileUssdMessagingNotifyNetworkRelease, KErrNone, data); |
3278 iMockLTSY.CompleteL(EMobileUssdMessagingNotifyNetworkRelease, KErrNone, data); |
2296 |
3279 |
2297 // other version of API (with optional TMobileUssdAttributesV1 parameter) |
3280 // other version of API (with optional TMobileUssdAttributesV1 parameter) |
2298 |
3281 |
2299 iMockLTSY.CompleteL(EMobileUssdMessagingNotifyNetworkRelease, KErrNone, data2); |
3282 iMockLTSY.CompleteL(EMobileUssdMessagingNotifyNetworkRelease, KErrNone, data2); |
2300 User::WaitForRequest(mockLtsyStatus); |
3283 User::WaitForRequest(mockLtsyStatus); |
2301 AssertMockLtsyStatusL(); |
3284 AssertMockLtsyStatusL(); |
2302 ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int()); |
3285 ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int()); |
2303 |
3286 |
|
3287 CleanupStack::PopAndDestroy(4, this); // data2, ussdMessaging, data, this, |
|
3288 |
|
3289 } |
|
3290 |
|
3291 /** |
|
3292 @SYMTestCaseID BA-CTSY-USSDM-UNNR-0001a |
|
3293 @SYMComponent telephony_ctsy |
|
3294 @SYMTestCaseDesc Test support in CTSY for failure on completion of pending comRMobileUssdMessaging::SendRelease request from LTSY->CTSY |
|
3295 @SYMTestPriority High |
|
3296 @SYMTestActions Invokes RMobileUssdMessaging::NotifyNetworkRelease |
|
3297 @SYMTestExpectedResults Pass |
|
3298 @SYMTestType CT |
|
3299 */ |
|
3300 void CCTsyUssdMessagingFU::TestNotifyNetworkRelease0001eL() |
|
3301 { |
|
3302 OpenEtelServerL(EUseExtendedError); |
|
3303 CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
|
3304 OpenPhoneL(); |
|
3305 |
|
3306 RBuf8 data; |
|
3307 CleanupClosePushL(data); |
|
3308 |
|
3309 RMobileUssdMessaging ussdMessaging; |
|
3310 TInt ret = ussdMessaging.Open(iPhone); |
|
3311 ASSERT_EQUALS(KErrNone, ret); |
|
3312 CleanupClosePushL(ussdMessaging); |
|
3313 |
|
3314 //------------------------------------------------------------------------- |
|
3315 // Setup: This block is taken from TestReceiveMessage0001L. All we want to |
|
3316 // do is to initiate a dialogue and then end it. Once the dialogue has ended |
|
3317 // then we can call Accept and Reject. |
|
3318 //------------------------------------------------------------------------- |
|
3319 |
|
3320 TRequestStatus requestStatus; |
|
3321 |
|
3322 TRequestStatus mockLtsyStatus; |
|
3323 |
|
3324 TUint32 flags = 100; |
|
3325 RMobileUssdMessaging::TMobileUssdDataFormat format = RMobileUssdMessaging::EFormatUnspecified; |
|
3326 RMobileUssdMessaging::TMobileUssdMessageType type = RMobileUssdMessaging::EUssdMORequest; |
|
3327 TUint8 dcs = 200; |
|
3328 |
|
3329 //------------------------------------------------------------------------- |
|
3330 // function parameters |
|
3331 |
|
3332 RMobileUssdMessaging::TMobileUssdAttributesV1 attributes; |
|
3333 TPckg<RMobileUssdMessaging::TMobileUssdAttributesV1> msgAttributes(attributes); |
|
3334 |
|
3335 RMobileUssdMessaging::TGsmUssdMessageData name; |
|
3336 |
|
3337 //------------------------------------------------------------------------- |
|
3338 |
|
3339 RMobileUssdMessaging::TMobileUssdAttributesV1 completeAttributes; |
|
3340 |
|
3341 completeAttributes.iFlags = flags; |
|
3342 completeAttributes.iFormat = format; |
|
3343 completeAttributes.iType = type; |
|
3344 completeAttributes.iDcs = dcs; |
|
3345 |
|
3346 TBuf8<KMaxName> completeName = _L8("Name1"); |
|
3347 |
|
3348 TMockLtsyData2<TBuf8<KMaxName>, RMobileUssdMessaging::TMobileUssdAttributesV1> |
|
3349 mockData2(completeName, completeAttributes); |
|
3350 mockData2.SerialiseL(data); |
|
3351 |
|
3352 iMockLTSY.CompleteL(EMobileUssdMessagingReceiveMessage, KErrNone, data); |
|
3353 |
|
3354 ussdMessaging.ReceiveMessage(requestStatus, name, msgAttributes); |
|
3355 User::WaitForRequest(requestStatus); |
|
3356 ret = requestStatus.Int(); |
|
3357 ASSERT_EQUALS(KErrNone, ret); |
|
3358 ussdMessaging.AcceptIncomingDialogue(); |
|
3359 |
|
3360 AssertMockLtsyStatusL(); |
|
3361 ASSERT_EQUALS(KErrNone, requestStatus.Int()); |
|
3362 |
|
3363 //------------------------------------------------------------------------- |
|
3364 // Terminate the dialogue |
|
3365 //------------------------------------------------------------------------- |
|
3366 |
|
3367 //------------------------------------------------------------------------- |
|
3368 // function parameters |
|
3369 |
|
3370 RMobilePhone::TMobilePhoneSendSSRequestV3 sendV3; |
|
3371 TPckg<RMobilePhone::TMobilePhoneSendSSRequestV3> pckgSendV3(sendV3); |
|
3372 |
|
3373 // optional parameter |
|
3374 RMobileUssdMessaging::TMobileUssdAttributesV1 attrV1; |
|
3375 RMobileUssdMessaging::TMobileUssdAttributesV1Pckg pckgAttrV1(attrV1); |
|
3376 //------------------------------------------------------------------------- |
|
3377 |
|
3378 RMobilePhone::TMobilePhoneSendSSRequestV3 completeSendV3; |
|
3379 |
|
3380 TUint8 opCode = 100; |
|
3381 _LIT(KAdditionalInfo1, "additionalInfo1"); |
|
3382 |
|
3383 completeSendV3.iOpCode = opCode; |
|
3384 completeSendV3.iAdditionalInfo = KAdditionalInfo1; |
|
3385 |
|
3386 TMockLtsyData1< RMobilePhone::TMobilePhoneSendSSRequestV3 > mockData1(completeSendV3); |
|
3387 mockData1.SerialiseL(data); |
|
3388 |
|
3389 // optional parameter |
|
3390 RMobileUssdMessaging::TMobileUssdAttributesV1 completeAttrV1; |
|
3391 completeAttrV1.iFlags = RMobileUssdMessaging::KUssdDataFormat | RMobileUssdMessaging::KUssdMessageType; |
|
3392 completeAttrV1.iFormat = RMobileUssdMessaging::EFormatPackedString; |
|
3393 completeAttrV1.iType = RMobileUssdMessaging::EUssdMOAcknowledgement; |
|
3394 |
|
3395 TMockLtsyData2< RMobilePhone::TMobilePhoneSendSSRequestV3, |
|
3396 RMobileUssdMessaging::TMobileUssdAttributesV1 > |
|
3397 mockData2Release(completeSendV3,completeAttrV1); |
|
3398 |
|
3399 RBuf8 data2; |
|
3400 CleanupClosePushL(data2); |
|
3401 mockData2Release.SerialiseL(data2); |
|
3402 |
|
3403 //------------------------------------------------------------------------- |
|
3404 // TEST B: failure on completion of pending request from LTSY->CTSY |
|
3405 //------------------------------------------------------------------------- |
|
3406 |
|
3407 iMockLTSY.CompleteL(EMobileUssdMessagingNotifyNetworkRelease, KErrGeneral, data); |
|
3408 ussdMessaging.NotifyNetworkRelease(requestStatus, pckgSendV3); |
|
3409 |
|
3410 User::WaitForRequest(requestStatus); |
|
3411 AssertMockLtsyStatusL(); |
|
3412 ASSERT_EQUALS(KErrGeneral, requestStatus.Int()); |
|
3413 |
|
3414 CleanupStack::PopAndDestroy(4, this); // data2, ussdMessaging, data, this |
|
3415 |
|
3416 } |
|
3417 |
|
3418 /** |
|
3419 @SYMTestCaseID BA-CTSY-USSDM-UNNR-0001b |
|
3420 @SYMComponent telephony_ctsy |
|
3421 @SYMTestCaseDesc Test support in CTSY for RMobileUssdMessaging::NotifyNetworkRelease with optional paramter |
|
3422 @SYMTestPriority High |
|
3423 @SYMTestActions Invokes RMobileUssdMessaging::NotifyNetworkRelease |
|
3424 @SYMTestExpectedResults Pass |
|
3425 @SYMTestType CT |
|
3426 */ |
|
3427 void CCTsyUssdMessagingFU::TestNotifyNetworkRelease0001bL() |
|
3428 { |
|
3429 OpenEtelServerL(EUseExtendedError); |
|
3430 CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
|
3431 OpenPhoneL(); |
|
3432 |
|
3433 RBuf8 data; |
|
3434 CleanupClosePushL(data); |
|
3435 |
|
3436 RMobileUssdMessaging ussdMessaging; |
|
3437 TInt ret = ussdMessaging.Open(iPhone); |
|
3438 ASSERT_EQUALS(KErrNone, ret); |
|
3439 CleanupClosePushL(ussdMessaging); |
|
3440 |
|
3441 //------------------------------------------------------------------------- |
|
3442 // Setup: This block is taken from TestReceiveMessage0001L. All we want to |
|
3443 // do is to initiate a dialogue and then end it. Once the dialogue has ended |
|
3444 // then we can call Accept and Reject. |
|
3445 //------------------------------------------------------------------------- |
|
3446 |
|
3447 TRequestStatus requestStatus; |
|
3448 |
|
3449 TRequestStatus mockLtsyStatus; |
|
3450 |
|
3451 TUint32 flags = 100; |
|
3452 RMobileUssdMessaging::TMobileUssdDataFormat format = RMobileUssdMessaging::EFormatUnspecified; |
|
3453 RMobileUssdMessaging::TMobileUssdMessageType type = RMobileUssdMessaging::EUssdMORequest; |
|
3454 TUint8 dcs = 200; |
|
3455 |
|
3456 //------------------------------------------------------------------------- |
|
3457 // function parameters |
|
3458 |
|
3459 RMobileUssdMessaging::TMobileUssdAttributesV1 attributes; |
|
3460 TPckg<RMobileUssdMessaging::TMobileUssdAttributesV1> msgAttributes(attributes); |
|
3461 |
|
3462 RMobileUssdMessaging::TGsmUssdMessageData name; |
|
3463 |
|
3464 //------------------------------------------------------------------------- |
|
3465 |
|
3466 RMobileUssdMessaging::TMobileUssdAttributesV1 completeAttributes; |
|
3467 |
|
3468 completeAttributes.iFlags = flags; |
|
3469 completeAttributes.iFormat = format; |
|
3470 completeAttributes.iType = type; |
|
3471 completeAttributes.iDcs = dcs; |
|
3472 |
|
3473 TBuf8<KMaxName> completeName = _L8("Name1"); |
|
3474 |
|
3475 TMockLtsyData2<TBuf8<KMaxName>, RMobileUssdMessaging::TMobileUssdAttributesV1> |
|
3476 mockData2(completeName, completeAttributes); |
|
3477 mockData2.SerialiseL(data); |
|
3478 |
|
3479 iMockLTSY.CompleteL(EMobileUssdMessagingReceiveMessage, KErrNone, data); |
|
3480 |
|
3481 ussdMessaging.ReceiveMessage(requestStatus, name, msgAttributes); |
|
3482 User::WaitForRequest(requestStatus); |
|
3483 ret = requestStatus.Int(); |
|
3484 ASSERT_EQUALS(KErrNone, ret); |
|
3485 ussdMessaging.AcceptIncomingDialogue(); |
|
3486 |
|
3487 AssertMockLtsyStatusL(); |
|
3488 ASSERT_EQUALS(KErrNone, requestStatus.Int()); |
|
3489 |
|
3490 //------------------------------------------------------------------------- |
|
3491 // Terminate the dialogue |
|
3492 //------------------------------------------------------------------------- |
|
3493 |
|
3494 //------------------------------------------------------------------------- |
|
3495 // function parameters |
|
3496 |
|
3497 RMobilePhone::TMobilePhoneSendSSRequestV3 sendV3; |
|
3498 TPckg<RMobilePhone::TMobilePhoneSendSSRequestV3> pckgSendV3(sendV3); |
|
3499 |
|
3500 // optional parameter |
|
3501 RMobileUssdMessaging::TMobileUssdAttributesV1 attrV1; |
|
3502 RMobileUssdMessaging::TMobileUssdAttributesV1Pckg pckgAttrV1(attrV1); |
|
3503 //------------------------------------------------------------------------- |
|
3504 |
|
3505 RMobilePhone::TMobilePhoneSendSSRequestV3 completeSendV3; |
|
3506 |
|
3507 TUint8 opCode = 100; |
|
3508 _LIT(KAdditionalInfo1, "additionalInfo1"); |
|
3509 |
|
3510 completeSendV3.iOpCode = opCode; |
|
3511 completeSendV3.iAdditionalInfo = KAdditionalInfo1; |
|
3512 |
|
3513 TMockLtsyData1< RMobilePhone::TMobilePhoneSendSSRequestV3 > mockData1(completeSendV3); |
|
3514 mockData1.SerialiseL(data); |
|
3515 |
|
3516 // optional parameter |
|
3517 RMobileUssdMessaging::TMobileUssdAttributesV1 completeAttrV1; |
|
3518 completeAttrV1.iFlags = RMobileUssdMessaging::KUssdDataFormat | RMobileUssdMessaging::KUssdMessageType; |
|
3519 completeAttrV1.iFormat = RMobileUssdMessaging::EFormatPackedString; |
|
3520 completeAttrV1.iType = RMobileUssdMessaging::EUssdMOAcknowledgement; |
|
3521 |
|
3522 TMockLtsyData2< RMobilePhone::TMobilePhoneSendSSRequestV3, |
|
3523 RMobileUssdMessaging::TMobileUssdAttributesV1 > |
|
3524 mockData2Release(completeSendV3,completeAttrV1); |
|
3525 |
|
3526 RBuf8 data2; |
|
3527 CleanupClosePushL(data2); |
|
3528 mockData2Release.SerialiseL(data2); |
|
3529 |
2304 //------------------------------------------------------------------------- |
3530 //------------------------------------------------------------------------- |
2305 // TEST C: Successful completion request of |
3531 // TEST C: Successful completion request of |
2306 // RMobileUssdMessaging::NotifyNetworkRelease when result is not cached. |
3532 // RMobileUssdMessaging::NotifyNetworkRelease when result is not cached. |
2307 //------------------------------------------------------------------------- |
|
2308 |
|
2309 iMockLTSY.CompleteL(EMobileUssdMessagingNotifyNetworkRelease, KErrNone, data); |
|
2310 ussdMessaging.NotifyNetworkRelease(requestStatus, pckgSendV3); |
|
2311 |
|
2312 User::WaitForRequest(requestStatus); |
|
2313 AssertMockLtsyStatusL(); |
|
2314 ASSERT_EQUALS(KErrNone, requestStatus.Int()); |
|
2315 |
|
2316 ASSERT_EQUALS(opCode, sendV3.iOpCode); |
|
2317 ASSERT_EQUALS(0, sendV3.iAdditionalInfo.Compare(KAdditionalInfo1)); |
|
2318 |
|
2319 |
|
2320 // other version of API (with optional TMobileUssdAttributesV1 parameter) |
3533 // other version of API (with optional TMobileUssdAttributesV1 parameter) |
2321 |
3534 //------------------------------------------------------------------------- |
2322 ussdMessaging.Close(); |
|
2323 ret = ussdMessaging.Open(iPhone); |
|
2324 ASSERT_EQUALS(KErrNone, ret); |
|
2325 |
3535 |
2326 iMockLTSY.CompleteL(EMobileUssdMessagingNotifyNetworkRelease, KErrNone, data2); |
3536 iMockLTSY.CompleteL(EMobileUssdMessagingNotifyNetworkRelease, KErrNone, data2); |
2327 ussdMessaging.NotifyNetworkRelease(requestStatus, pckgSendV3, pckgAttrV1); |
3537 ussdMessaging.NotifyNetworkRelease(requestStatus, pckgSendV3, pckgAttrV1); |
2328 |
3538 |
2329 User::WaitForRequest(requestStatus); |
3539 User::WaitForRequest(requestStatus); |
2330 AssertMockLtsyStatusL(); |
3540 AssertMockLtsyStatusL(); |
2331 ASSERT_EQUALS(KErrNone, requestStatus.Int()); |
3541 ASSERT_EQUALS(KErrNone, requestStatus.Int()); |
2332 |
3542 |
2333 ASSERT_EQUALS(opCode, sendV3.iOpCode); |
3543 ASSERT_EQUALS(opCode, sendV3.iOpCode); |
2334 ASSERT_EQUALS(0, sendV3.iAdditionalInfo.Compare(KAdditionalInfo1)); |
3544 ASSERT_EQUALS(0, sendV3.iAdditionalInfo.Compare(KAdditionalInfo1)); |
2335 |
3545 |
2336 ASSERT_EQUALS(completeAttrV1.iFlags ,attrV1.iFlags); |
3546 ASSERT_EQUALS(completeAttrV1.iFlags ,attrV1.iFlags); |
2337 ASSERT_EQUALS(completeAttrV1.iFormat ,attrV1.iFormat); |
3547 ASSERT_EQUALS(completeAttrV1.iFormat ,attrV1.iFormat); |
2338 ASSERT_EQUALS(completeAttrV1.iType ,attrV1.iType); |
3548 ASSERT_EQUALS(completeAttrV1.iType ,attrV1.iType); |
2339 |
3549 |
2340 CleanupStack::PopAndDestroy(4, this); // data2, ussdMessaging, data, this, |
3550 CleanupStack::PopAndDestroy(4, this); // data2, ussdMessaging, data, this, |
2341 |
3551 |
2342 } |
3552 } |
2343 |
3553 |
|
3554 /** |
|
3555 @SYMTestCaseID BA-CTSY-USSDM-UNNR-0001c |
|
3556 @SYMComponent telephony_ctsy |
|
3557 @SYMTestCaseDesc Test support in CTSY for RMobileUssdMessaging::NotifyNetworkRelease |
|
3558 @SYMTestPriority High |
|
3559 @SYMTestActions Invokes RMobileUssdMessaging::NotifyNetworkRelease |
|
3560 @SYMTestExpectedResults Pass |
|
3561 @SYMTestType CT |
|
3562 */ |
|
3563 void CCTsyUssdMessagingFU::TestNotifyNetworkRelease0001cL() |
|
3564 { |
|
3565 OpenEtelServerL(EUseExtendedError); |
|
3566 CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
|
3567 OpenPhoneL(); |
|
3568 |
|
3569 RBuf8 data; |
|
3570 CleanupClosePushL(data); |
|
3571 |
|
3572 RMobileUssdMessaging ussdMessaging; |
|
3573 TInt ret = ussdMessaging.Open(iPhone); |
|
3574 ASSERT_EQUALS(KErrNone, ret); |
|
3575 CleanupClosePushL(ussdMessaging); |
|
3576 |
|
3577 //------------------------------------------------------------------------- |
|
3578 // Setup: This block is taken from TestReceiveMessage0001L. All we want to |
|
3579 // do is to initiate a dialogue and then end it. Once the dialogue has ended |
|
3580 // then we can call Accept and Reject. |
|
3581 //------------------------------------------------------------------------- |
|
3582 |
|
3583 TRequestStatus requestStatus; |
|
3584 |
|
3585 TRequestStatus mockLtsyStatus; |
|
3586 |
|
3587 TUint32 flags = 100; |
|
3588 RMobileUssdMessaging::TMobileUssdDataFormat format = RMobileUssdMessaging::EFormatUnspecified; |
|
3589 RMobileUssdMessaging::TMobileUssdMessageType type = RMobileUssdMessaging::EUssdMORequest; |
|
3590 TUint8 dcs = 200; |
|
3591 |
|
3592 //------------------------------------------------------------------------- |
|
3593 // function parameters |
|
3594 |
|
3595 RMobileUssdMessaging::TMobileUssdAttributesV1 attributes; |
|
3596 TPckg<RMobileUssdMessaging::TMobileUssdAttributesV1> msgAttributes(attributes); |
|
3597 |
|
3598 RMobileUssdMessaging::TGsmUssdMessageData name; |
|
3599 |
|
3600 //------------------------------------------------------------------------- |
|
3601 |
|
3602 RMobileUssdMessaging::TMobileUssdAttributesV1 completeAttributes; |
|
3603 |
|
3604 completeAttributes.iFlags = flags; |
|
3605 completeAttributes.iFormat = format; |
|
3606 completeAttributes.iType = type; |
|
3607 completeAttributes.iDcs = dcs; |
|
3608 |
|
3609 TBuf8<KMaxName> completeName = _L8("Name1"); |
|
3610 |
|
3611 TMockLtsyData2<TBuf8<KMaxName>, RMobileUssdMessaging::TMobileUssdAttributesV1> |
|
3612 mockData2(completeName, completeAttributes); |
|
3613 mockData2.SerialiseL(data); |
|
3614 |
|
3615 iMockLTSY.CompleteL(EMobileUssdMessagingReceiveMessage, KErrNone, data); |
|
3616 |
|
3617 ussdMessaging.ReceiveMessage(requestStatus, name, msgAttributes); |
|
3618 User::WaitForRequest(requestStatus); |
|
3619 ret = requestStatus.Int(); |
|
3620 ASSERT_EQUALS(KErrNone, ret); |
|
3621 ussdMessaging.AcceptIncomingDialogue(); |
|
3622 |
|
3623 AssertMockLtsyStatusL(); |
|
3624 ASSERT_EQUALS(KErrNone, requestStatus.Int()); |
|
3625 |
|
3626 //------------------------------------------------------------------------- |
|
3627 // Terminate the dialogue |
|
3628 //------------------------------------------------------------------------- |
|
3629 |
|
3630 //------------------------------------------------------------------------- |
|
3631 // function parameters |
|
3632 |
|
3633 RMobilePhone::TMobilePhoneSendSSRequestV3 sendV3; |
|
3634 TPckg<RMobilePhone::TMobilePhoneSendSSRequestV3> pckgSendV3(sendV3); |
|
3635 |
|
3636 // optional parameter |
|
3637 RMobileUssdMessaging::TMobileUssdAttributesV1 attrV1; |
|
3638 RMobileUssdMessaging::TMobileUssdAttributesV1Pckg pckgAttrV1(attrV1); |
|
3639 //------------------------------------------------------------------------- |
|
3640 |
|
3641 RMobilePhone::TMobilePhoneSendSSRequestV3 completeSendV3; |
|
3642 |
|
3643 TUint8 opCode = 100; |
|
3644 _LIT(KAdditionalInfo1, "additionalInfo1"); |
|
3645 |
|
3646 completeSendV3.iOpCode = opCode; |
|
3647 completeSendV3.iAdditionalInfo = KAdditionalInfo1; |
|
3648 |
|
3649 TMockLtsyData1< RMobilePhone::TMobilePhoneSendSSRequestV3 > mockData1(completeSendV3); |
|
3650 mockData1.SerialiseL(data); |
|
3651 |
|
3652 // optional parameter |
|
3653 RMobileUssdMessaging::TMobileUssdAttributesV1 completeAttrV1; |
|
3654 completeAttrV1.iFlags = RMobileUssdMessaging::KUssdDataFormat | RMobileUssdMessaging::KUssdMessageType; |
|
3655 completeAttrV1.iFormat = RMobileUssdMessaging::EFormatPackedString; |
|
3656 completeAttrV1.iType = RMobileUssdMessaging::EUssdMOAcknowledgement; |
|
3657 |
|
3658 TMockLtsyData2< RMobilePhone::TMobilePhoneSendSSRequestV3, |
|
3659 RMobileUssdMessaging::TMobileUssdAttributesV1 > |
|
3660 mockData2Release(completeSendV3,completeAttrV1); |
|
3661 |
|
3662 RBuf8 data2; |
|
3663 CleanupClosePushL(data2); |
|
3664 mockData2Release.SerialiseL(data2); |
|
3665 |
|
3666 //------------------------------------------------------------------------- |
|
3667 // TEST B: failure on completion of pending request from LTSY->CTSY |
|
3668 //------------------------------------------------------------------------- |
|
3669 |
|
3670 // other version of API (with optional TMobileUssdAttributesV1 parameter) |
|
3671 iMockLTSY.CompleteL(EMobileUssdMessagingNotifyNetworkRelease, KErrNotReady, data2); |
|
3672 ussdMessaging.NotifyNetworkRelease(requestStatus, pckgSendV3, pckgAttrV1); |
|
3673 |
|
3674 User::WaitForRequest(requestStatus); |
|
3675 AssertMockLtsyStatusL(); |
|
3676 ASSERT_EQUALS(KErrNotReady, requestStatus.Int()); |
|
3677 |
|
3678 CleanupStack::PopAndDestroy(4, this); // data2, ussdMessaging, data, this, |
|
3679 |
|
3680 } |
|
3681 |
|
3682 /** |
|
3683 @SYMTestCaseID BA-CTSY-USSDM-UNNR-0001d |
|
3684 @SYMComponent telephony_ctsy |
|
3685 @SYMTestCaseDesc Test support in CTSY for RMobileUssdMessaging::NotifyNetworkRelease before accepting a dialogue |
|
3686 @SYMTestPriority High |
|
3687 @SYMTestActions Invokes RMobileUssdMessaging::NotifyNetworkRelease |
|
3688 @SYMTestExpectedResults Pass |
|
3689 @SYMTestType CT |
|
3690 */ |
|
3691 void CCTsyUssdMessagingFU::TestNotifyNetworkRelease0001dL() |
|
3692 { |
|
3693 OpenEtelServerL(EUseExtendedError); |
|
3694 CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
|
3695 OpenPhoneL(); |
|
3696 |
|
3697 RBuf8 data; |
|
3698 CleanupClosePushL(data); |
|
3699 |
|
3700 RMobileUssdMessaging ussdMessaging; |
|
3701 TInt ret = ussdMessaging.Open(iPhone); |
|
3702 ASSERT_EQUALS(KErrNone, ret); |
|
3703 CleanupClosePushL(ussdMessaging); |
|
3704 |
|
3705 //------------------------------------------------------------------------- |
|
3706 // Setup: This block is taken from TestReceiveMessage0001L. All we want to |
|
3707 // do is to initiate a dialogue and then end it. Once the dialogue has ended |
|
3708 // then we can call Accept and Reject. |
|
3709 //------------------------------------------------------------------------- |
|
3710 |
|
3711 TRequestStatus requestStatus; |
|
3712 |
|
3713 TRequestStatus mockLtsyStatus; |
|
3714 |
|
3715 TUint32 flags = 100; |
|
3716 RMobileUssdMessaging::TMobileUssdDataFormat format = RMobileUssdMessaging::EFormatUnspecified; |
|
3717 RMobileUssdMessaging::TMobileUssdMessageType type = RMobileUssdMessaging::EUssdMORequest; |
|
3718 TUint8 dcs = 200; |
|
3719 |
|
3720 //------------------------------------------------------------------------- |
|
3721 // function parameters |
|
3722 |
|
3723 RMobileUssdMessaging::TMobileUssdAttributesV1 attributes; |
|
3724 TPckg<RMobileUssdMessaging::TMobileUssdAttributesV1> msgAttributes(attributes); |
|
3725 |
|
3726 RMobileUssdMessaging::TGsmUssdMessageData name; |
|
3727 |
|
3728 //------------------------------------------------------------------------- |
|
3729 |
|
3730 RMobileUssdMessaging::TMobileUssdAttributesV1 completeAttributes; |
|
3731 |
|
3732 completeAttributes.iFlags = flags; |
|
3733 completeAttributes.iFormat = format; |
|
3734 completeAttributes.iType = type; |
|
3735 completeAttributes.iDcs = dcs; |
|
3736 |
|
3737 TBuf8<KMaxName> completeName = _L8("Name1"); |
|
3738 |
|
3739 TMockLtsyData2<TBuf8<KMaxName>, RMobileUssdMessaging::TMobileUssdAttributesV1> |
|
3740 mockData2(completeName, completeAttributes); |
|
3741 mockData2.SerialiseL(data); |
|
3742 |
|
3743 iMockLTSY.CompleteL(EMobileUssdMessagingReceiveMessage, KErrNone, data); |
|
3744 |
|
3745 ussdMessaging.ReceiveMessage(requestStatus, name, msgAttributes); |
|
3746 User::WaitForRequest(requestStatus); |
|
3747 ret = requestStatus.Int(); |
|
3748 ASSERT_EQUALS(KErrNone, ret); |
|
3749 |
|
3750 AssertMockLtsyStatusL(); |
|
3751 ASSERT_EQUALS(KErrNone, requestStatus.Int()); |
|
3752 |
|
3753 //------------------------------------------------------------------------- |
|
3754 // Terminate the dialogue |
|
3755 //------------------------------------------------------------------------- |
|
3756 |
|
3757 //------------------------------------------------------------------------- |
|
3758 // function parameters |
|
3759 |
|
3760 RMobilePhone::TMobilePhoneSendSSRequestV3 sendV3; |
|
3761 TPckg<RMobilePhone::TMobilePhoneSendSSRequestV3> pckgSendV3(sendV3); |
|
3762 |
|
3763 // optional parameter |
|
3764 RMobileUssdMessaging::TMobileUssdAttributesV1 attrV1; |
|
3765 RMobileUssdMessaging::TMobileUssdAttributesV1Pckg pckgAttrV1(attrV1); |
|
3766 //------------------------------------------------------------------------- |
|
3767 |
|
3768 RMobilePhone::TMobilePhoneSendSSRequestV3 completeSendV3; |
|
3769 |
|
3770 TUint8 opCode = 100; |
|
3771 _LIT(KAdditionalInfo1, "additionalInfo1"); |
|
3772 |
|
3773 completeSendV3.iOpCode = opCode; |
|
3774 completeSendV3.iAdditionalInfo = KAdditionalInfo1; |
|
3775 |
|
3776 TMockLtsyData1< RMobilePhone::TMobilePhoneSendSSRequestV3 > mockData1(completeSendV3); |
|
3777 mockData1.SerialiseL(data); |
|
3778 |
|
3779 // optional parameter |
|
3780 RMobileUssdMessaging::TMobileUssdAttributesV1 completeAttrV1; |
|
3781 completeAttrV1.iFlags = RMobileUssdMessaging::KUssdDataFormat | RMobileUssdMessaging::KUssdMessageType; |
|
3782 completeAttrV1.iFormat = RMobileUssdMessaging::EFormatPackedString; |
|
3783 completeAttrV1.iType = RMobileUssdMessaging::EUssdMOAcknowledgement; |
|
3784 |
|
3785 TMockLtsyData2< RMobilePhone::TMobilePhoneSendSSRequestV3, |
|
3786 RMobileUssdMessaging::TMobileUssdAttributesV1 > |
|
3787 mockData2Release(completeSendV3,completeAttrV1); |
|
3788 |
|
3789 RBuf8 data2; |
|
3790 CleanupClosePushL(data2); |
|
3791 mockData2Release.SerialiseL(data2); |
|
3792 |
|
3793 //Testing NotifyNetworkRelease() before accepting the dialogue, |
|
3794 //so that the requests are not always very sequential |
|
3795 ussdMessaging.NotifyNetworkRelease(requestStatus, pckgSendV3, pckgAttrV1); |
|
3796 ussdMessaging.AcceptIncomingDialogue(); |
|
3797 |
|
3798 User::WaitForRequest(requestStatus); |
|
3799 AssertMockLtsyStatusL(); |
|
3800 ASSERT_EQUALS(KErrDisconnected, requestStatus.Int()); |
|
3801 |
|
3802 CleanupStack::PopAndDestroy(4, this); // data2, ussdMessaging, data, this |
|
3803 |
|
3804 } |
2344 |
3805 |
2345 /** |
3806 /** |
2346 @SYMTestCaseID BA-CTSY-USSDM-UNNR-0002 |
3807 @SYMTestCaseID BA-CTSY-USSDM-UNNR-0002 |
2347 @SYMComponent telephony_ctsy |
3808 @SYMComponent telephony_ctsy |
2348 @SYMTestCaseDesc Test support in CTSY for cancelling of RMobileUssdMessaging::NotifyNetworkRelease |
3809 @SYMTestCaseDesc Test support in CTSY for cancelling of RMobileUssdMessaging::NotifyNetworkRelease |
2351 @SYMTestExpectedResults Pass |
3812 @SYMTestExpectedResults Pass |
2352 @SYMTestType CT |
3813 @SYMTestType CT |
2353 */ |
3814 */ |
2354 void CCTsyUssdMessagingFU::TestNotifyNetworkRelease0002L() |
3815 void CCTsyUssdMessagingFU::TestNotifyNetworkRelease0002L() |
2355 { |
3816 { |
2356 OpenEtelServerL(EUseExtendedError); |
3817 OpenEtelServerL(EUseExtendedError); |
2357 CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
3818 CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
2358 OpenPhoneL(); |
3819 OpenPhoneL(); |
2359 |
3820 |
2360 TRequestStatus requestStatus; |
3821 RBuf8 data; |
2361 |
3822 CleanupClosePushL(data); |
2362 RMobileUssdMessaging ussdMessaging; |
3823 |
2363 TInt ret = ussdMessaging.Open(iPhone); |
3824 RMobileUssdMessaging ussdMessaging; |
2364 ASSERT_EQUALS(KErrNone, ret); |
3825 TInt ret = ussdMessaging.Open(iPhone); |
2365 CleanupClosePushL(ussdMessaging); |
3826 ASSERT_EQUALS(KErrNone, ret); |
|
3827 CleanupClosePushL(ussdMessaging); |
|
3828 |
|
3829 //------------------------------------------------------------------------- |
|
3830 // Setup: This block is taken from TestReceiveMessage0001L. All we want to |
|
3831 // do is to initiate a dialogue and then end it. Once the dialogue has ended |
|
3832 // then we can call Accept and Reject. |
|
3833 //------------------------------------------------------------------------- |
|
3834 |
|
3835 TRequestStatus requestStatus; |
|
3836 |
|
3837 TRequestStatus mockLtsyStatus; |
|
3838 |
|
3839 TUint32 flags = 100; |
|
3840 RMobileUssdMessaging::TMobileUssdDataFormat format = RMobileUssdMessaging::EFormatUnspecified; |
|
3841 RMobileUssdMessaging::TMobileUssdMessageType type = RMobileUssdMessaging::EUssdMORequest; |
|
3842 TUint8 dcs = 200; |
|
3843 |
|
3844 //------------------------------------------------------------------------- |
|
3845 // function parameters |
|
3846 |
|
3847 RMobileUssdMessaging::TMobileUssdAttributesV1 attributes; |
|
3848 TPckg<RMobileUssdMessaging::TMobileUssdAttributesV1> msgAttributes(attributes); |
|
3849 |
|
3850 RMobileUssdMessaging::TGsmUssdMessageData name; |
|
3851 |
|
3852 //------------------------------------------------------------------------- |
|
3853 |
|
3854 RMobileUssdMessaging::TMobileUssdAttributesV1 completeAttributes; |
|
3855 |
|
3856 completeAttributes.iFlags = flags; |
|
3857 completeAttributes.iFormat = format; |
|
3858 completeAttributes.iType = type; |
|
3859 completeAttributes.iDcs = dcs; |
|
3860 |
|
3861 TBuf8<KMaxName> completeName = _L8("Name1"); |
|
3862 |
|
3863 TMockLtsyData2<TBuf8<KMaxName>, RMobileUssdMessaging::TMobileUssdAttributesV1> |
|
3864 mockData2(completeName, completeAttributes); |
|
3865 mockData2.SerialiseL(data); |
|
3866 |
|
3867 iMockLTSY.CompleteL(EMobileUssdMessagingReceiveMessage, KErrNone, data); |
|
3868 |
|
3869 ussdMessaging.ReceiveMessage(requestStatus, name, msgAttributes); |
|
3870 User::WaitForRequest(requestStatus); |
|
3871 ret = requestStatus.Int(); |
|
3872 ASSERT_EQUALS(KErrNone, ret); |
|
3873 ussdMessaging.AcceptIncomingDialogue(); |
|
3874 |
|
3875 AssertMockLtsyStatusL(); |
|
3876 ASSERT_EQUALS(KErrNone, requestStatus.Int()); |
|
3877 |
|
3878 //------------------------------------------------------------------------- |
|
3879 // Terminate the dialogue |
|
3880 //------------------------------------------------------------------------- |
2366 |
3881 |
2367 RMobilePhone::TMobilePhoneSendSSRequestV3 sendV3; |
3882 RMobilePhone::TMobilePhoneSendSSRequestV3 sendV3; |
2368 TPckg<RMobilePhone::TMobilePhoneSendSSRequestV3> pckgSendV3(sendV3); |
3883 TPckg<RMobilePhone::TMobilePhoneSendSSRequestV3> pckgSendV3(sendV3); |
2369 |
3884 |
2370 //------------------------------------------------------------------------- |
3885 //------------------------------------------------------------------------- |
2371 // Test cancelling of RMobileUssdMessaging::NotifyNetworkRelease |
3886 // Test cancelling of RMobileUssdMessaging::NotifyNetworkRelease |
2372 //------------------------------------------------------------------------- |
3887 //------------------------------------------------------------------------- |
2373 |
3888 |
2374 ussdMessaging.NotifyNetworkRelease(requestStatus, pckgSendV3); |
3889 ussdMessaging.NotifyNetworkRelease(requestStatus, pckgSendV3); |
2375 ussdMessaging.CancelAsyncRequest(EMobileUssdMessagingNotifyNetworkRelease); |
3890 ussdMessaging.CancelAsyncRequest(EMobileUssdMessagingNotifyNetworkRelease); |
2376 |
3891 |
2377 User::WaitForRequest(requestStatus); |
3892 User::WaitForRequest(requestStatus); |
2378 ASSERT_EQUALS(KErrCancel, requestStatus.Int()); |
3893 ASSERT_EQUALS(KErrCancel, requestStatus.Int()); |
2379 |
3894 |
2380 AssertMockLtsyStatusL(); |
3895 AssertMockLtsyStatusL(); |
2381 |
3896 |
2382 // again with the optional parameter |
3897 // again with the optional parameter |
|
3898 |
2383 RMobileUssdMessaging::TMobileUssdAttributesV1 attrV1; |
3899 RMobileUssdMessaging::TMobileUssdAttributesV1 attrV1; |
2384 RMobileUssdMessaging::TMobileUssdAttributesV1Pckg pckgAttrV1(attrV1); |
3900 RMobileUssdMessaging::TMobileUssdAttributesV1Pckg pckgAttrV1(attrV1); |
2385 |
3901 |
2386 ussdMessaging.NotifyNetworkRelease(requestStatus, pckgSendV3, pckgAttrV1); |
3902 ussdMessaging.NotifyNetworkRelease(requestStatus, pckgSendV3, pckgAttrV1); |
2387 ussdMessaging.CancelAsyncRequest(EMobileUssdMessagingNotifyNetworkRelease); |
3903 ussdMessaging.CancelAsyncRequest(EMobileUssdMessagingNotifyNetworkRelease); |
2388 |
3904 |
2389 User::WaitForRequest(requestStatus); |
3905 User::WaitForRequest(requestStatus); |
2390 ASSERT_EQUALS(KErrCancel, requestStatus.Int()); |
3906 ASSERT_EQUALS(KErrCancel, requestStatus.Int()); |
2391 |
3907 |
2392 AssertMockLtsyStatusL(); |
3908 AssertMockLtsyStatusL(); |
2393 CleanupStack::PopAndDestroy(2); // this, ussdMessaging |
3909 |
2394 |
3910 CleanupStack::PopAndDestroy(3); // this, ussdMessaging, data |
2395 } |
3911 } |
2396 |
3912 |
2397 /** |
3913 /** |
2398 @SYMTestCaseID BA-CTSY-USSDM-UNNR-0003 |
3914 @SYMTestCaseID BA-CTSY-USSDM-UNNR-0003 |
2399 @SYMComponent telephony_ctsy |
3915 @SYMComponent telephony_ctsy |
2574 ASSERT_EQUALS(opCode1, sendV31.iOpCode); |
4143 ASSERT_EQUALS(opCode1, sendV31.iOpCode); |
2575 ASSERT_EQUALS(0, sendV31.iAdditionalInfo.Compare(KAdditionalInfo1)); |
4144 ASSERT_EQUALS(0, sendV31.iAdditionalInfo.Compare(KAdditionalInfo1)); |
2576 |
4145 |
2577 ASSERT_EQUALS(opCode1, sendV32.iOpCode); |
4146 ASSERT_EQUALS(opCode1, sendV32.iOpCode); |
2578 ASSERT_EQUALS(0, sendV32.iAdditionalInfo.Compare(KAdditionalInfo1)); |
4147 ASSERT_EQUALS(0, sendV32.iAdditionalInfo.Compare(KAdditionalInfo1)); |
2579 |
|
2580 |
|
2581 |
4148 |
2582 AssertMockLtsyStatusL(); |
4149 AssertMockLtsyStatusL(); |
2583 |
4150 |
2584 // |
4151 CleanupStack::PopAndDestroy(7, this); // phone2, telServer2, data, this |
2585 // repeat tests with optional second parameter |
4152 // ussdMessaging1, ussdMessaging2, data2 (inv. order) |
2586 // |
4153 } |
|
4154 |
|
4155 //// |
|
4156 /** |
|
4157 @SYMTestCaseID BA-CTSY-USSDM-UNNR-0004b |
|
4158 @SYMComponent telephony_ctsy |
|
4159 @SYMTestCaseDesc Test support in CTSY for multiple client requests to RMobileUssdMessaging::NotifyNetworkRelease |
|
4160 @SYMTestPriority High |
|
4161 @SYMTestActions Invokes multiple client requests to RMobileUssdMessaging::NotifyNetworkRelease |
|
4162 @SYMTestExpectedResults Pass |
|
4163 @SYMTestType CT |
|
4164 */ |
|
4165 void CCTsyUssdMessagingFU::TestNotifyNetworkRelease0004bL() |
|
4166 { |
|
4167 OpenEtelServerL(EUseExtendedError); |
|
4168 CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
|
4169 OpenPhoneL(); |
|
4170 |
|
4171 TRequestStatus requestStatus1; |
|
4172 TRequestStatus requestStatus2; |
|
4173 |
|
4174 RBuf8 data; |
|
4175 CleanupClosePushL(data); |
|
4176 |
|
4177 // Open second client |
|
4178 RTelServer telServer2; |
|
4179 TInt ret = telServer2.Connect(); |
|
4180 ASSERT_EQUALS(KErrNone, ret); |
|
4181 CleanupClosePushL(telServer2); |
|
4182 |
|
4183 RMobilePhone phone2; |
|
4184 ret = phone2.Open(telServer2,KMmTsyPhoneName); |
|
4185 ASSERT_EQUALS(KErrNone, ret); |
|
4186 CleanupClosePushL(phone2); |
|
4187 |
|
4188 RMobileUssdMessaging ussdMessaging1; |
|
4189 ret = ussdMessaging1.Open(iPhone); |
|
4190 ASSERT_EQUALS(KErrNone, ret); |
|
4191 CleanupClosePushL(ussdMessaging1); |
|
4192 |
|
4193 RMobileUssdMessaging ussdMessaging2; |
|
4194 ret = ussdMessaging2.Open(iPhone); |
|
4195 ASSERT_EQUALS(KErrNone, ret); |
|
4196 CleanupClosePushL(ussdMessaging2); |
|
4197 |
|
4198 //------------------------------------------------------------------------- |
|
4199 // The first client needs to send a message. This will cause a session to be opened |
|
4200 // which will be owned by the first client. |
|
4201 TUint32 flags = 100; |
|
4202 RMobileUssdMessaging::TMobileUssdDataFormat format = RMobileUssdMessaging::EFormatUnspecified; |
|
4203 RMobileUssdMessaging::TMobileUssdMessageType type = RMobileUssdMessaging::EUssdMORequest; |
|
4204 TUint8 dcs = 200; |
|
4205 |
|
4206 RMobileUssdMessaging::TMobileUssdAttributesV1 attributes; |
|
4207 TPckg<RMobileUssdMessaging::TMobileUssdAttributesV1> msgAttributes(attributes); |
|
4208 |
|
4209 attributes.iFlags = flags; |
|
4210 attributes.iFormat = format; |
|
4211 attributes.iType = type; |
|
4212 attributes.iDcs = dcs; |
|
4213 |
|
4214 TName name = _L("Name1"); |
|
4215 TPckg<TName> msgData(name); |
|
4216 |
|
4217 TMockLtsyData2<TName, RMobileUssdMessaging::TMobileUssdAttributesV1> |
|
4218 mockSendData2(name, attributes); |
|
4219 mockSendData2.SerialiseL(data); |
|
4220 |
|
4221 iMockLTSY.ExpectL(EMobileUssdMessagingSendMessage, data); |
|
4222 iMockLTSY.CompleteL(EMobileUssdMessagingSendMessage, KErrNone); |
|
4223 |
|
4224 ussdMessaging1.SendMessage(requestStatus1, msgData, msgAttributes); |
|
4225 |
|
4226 User::WaitForRequest(requestStatus1); |
|
4227 AssertMockLtsyStatusL(); |
|
4228 ASSERT_EQUALS(KErrNone, requestStatus1.Int()); |
|
4229 |
|
4230 //------------------------------------------------------------------------- |
|
4231 // parameters for first function |
|
4232 |
|
4233 RMobilePhone::TMobilePhoneSendSSRequestV3 sendV31; |
|
4234 TPckg<RMobilePhone::TMobilePhoneSendSSRequestV3> pckgSendV31(sendV31); |
|
4235 |
|
4236 //------------------------------------------------------------------------- |
|
4237 |
|
4238 RMobilePhone::TMobilePhoneSendSSRequestV3 completeSendV31; |
|
4239 |
|
4240 TUint8 opCode1 = 100; |
|
4241 _LIT(KAdditionalInfo1, "additionalInfo1"); |
|
4242 |
|
4243 completeSendV31.iOpCode = opCode1; |
|
4244 completeSendV31.iAdditionalInfo = KAdditionalInfo1; |
|
4245 |
|
4246 TMockLtsyData1< RMobilePhone::TMobilePhoneSendSSRequestV3 > mockData11(completeSendV31); |
|
4247 |
|
4248 RMobileUssdMessaging::TMobileUssdAttributesV1 completeAttrV1; |
|
4249 completeAttrV1.iFlags = RMobileUssdMessaging::KUssdDataFormat | RMobileUssdMessaging::KUssdMessageType; |
|
4250 completeAttrV1.iFormat = RMobileUssdMessaging::EFormatPackedString; |
|
4251 completeAttrV1.iType = RMobileUssdMessaging::EUssdMTRequest; |
|
4252 |
|
4253 TMockLtsyData2< RMobilePhone::TMobilePhoneSendSSRequestV3, |
|
4254 RMobileUssdMessaging::TMobileUssdAttributesV1 > |
|
4255 mockData2(completeSendV31,completeAttrV1); |
|
4256 |
|
4257 |
|
4258 RBuf8 data2; |
|
4259 CleanupClosePushL(data2); |
|
4260 mockData2.SerialiseL(data2); |
|
4261 |
|
4262 //------------------------------------------------------------------------- |
|
4263 // parameters for second function |
|
4264 |
|
4265 RMobilePhone::TMobilePhoneSendSSRequestV3 sendV32; |
|
4266 TPckg<RMobilePhone::TMobilePhoneSendSSRequestV3> pckgSendV32(sendV32); |
|
4267 |
|
4268 //------------------------------------------------------------------------- |
|
4269 // Test B: Test multiple clients requesting RMobileUssdMessaging::NotifyNetworkRelease |
|
4270 // with optional second parameter |
|
4271 //------------------------------------------------------------------------- |
|
4272 |
2587 ussdMessaging1.Close(); |
4273 ussdMessaging1.Close(); |
2588 ret = ussdMessaging1.Open(iPhone); |
4274 ret = ussdMessaging1.Open(iPhone); |
2589 ASSERT_EQUALS(KErrNone, ret); |
4275 ASSERT_EQUALS(KErrNone, ret); |
2590 ussdMessaging2.Close(); |
4276 ussdMessaging2.Close(); |
2591 ret = ussdMessaging2.Open(iPhone); |
4277 ret = ussdMessaging2.Open(iPhone); |