4639 @SYMTestActions Invokes RMmCustomAPI::ReadViagHomeZoneCache |
4642 @SYMTestActions Invokes RMmCustomAPI::ReadViagHomeZoneCache |
4640 @SYMTestExpectedResults Pass |
4643 @SYMTestExpectedResults Pass |
4641 @SYMTestType CT |
4644 @SYMTestType CT |
4642 */ |
4645 */ |
4643 void CCTsyCustomIPCFU::TestReadViagHomeZoneCache0001L() |
4646 void CCTsyCustomIPCFU::TestReadViagHomeZoneCache0001L() |
4644 { |
4647 { |
4645 OpenEtelServerL(EUseExtendedError); |
4648 OpenEtelServerL(EUseExtendedError); |
4646 CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
4649 CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
4647 |
4650 |
4648 RMmCustomAPI customAPI; |
4651 RMmCustomAPI customAPI; |
4649 |
4652 |
4650 //---------------------------------------------- |
4653 //---------------------------------------------- |
4651 // TEST D: CTSY will get results from the cache. |
4654 // TEST D: CTSY will get results from the cache. |
4652 //---------------------------------------------- |
4655 //---------------------------------------------- |
4653 |
4656 |
4654 //******************************************************************************** |
4657 //******************************************************************************** |
4655 //* To initialize the VIAG home zone cache properly RMmCustomAPI::OpenL should be |
4658 //* To initialize the VIAG home zone cache properly RMmCustomAPI::OpenL should be |
4656 //* invoked _before_ EMmTsyBootNotifySimStatusReadyIPC is triggered. |
4659 //* invoked _before_ EMmTsyBootNotifySimStatusReadyIPC is triggered. |
4657 //* That's why OpenPhoneAndCustomAPILC was implemented and is used here |
4660 //* That's why OpenPhoneAndCustomAPILC was implemented and is used here |
4658 //* instead of usual OpenPhoneL/OpenCustomAPILC sequence. |
4661 //* instead of usual OpenPhoneL/OpenCustomAPILC sequence. |
4659 //******************************************************************************** |
4662 //******************************************************************************** |
4660 |
4663 |
4661 OpenPhoneAndCustomAPILC(customAPI); |
4664 OpenPhoneAndCustomAPILC(customAPI); |
4662 |
4665 |
4663 for(TInt c = KViagHomeZoneCacheIdMin; c <= KViagHomeZoneCacheIdMin; c++) |
4666 for(TInt c = KViagHomeZoneCacheIdMin; c <= KViagHomeZoneCacheIdMin; c++) |
4664 { |
4667 { |
4665 for(TInt r = KViagHomeZoneCacheRecordIdMin; r <= KViagHomeZoneCacheRecordIdMax; r++) |
4668 for(TInt r = KViagHomeZoneCacheRecordIdMin; r <= KViagHomeZoneCacheRecordIdMax; r++) |
4666 { |
4669 { |
4667 RMmCustomAPI::TViagCacheRecordId recId; |
4670 RMmCustomAPI::TViagCacheRecordId recId; |
4668 recId.iCacheId = c; |
4671 recId.iCacheId = c; |
4669 recId.iRecordId = r; |
4672 recId.iRecordId = r; |
4670 |
4673 |
4671 RMmCustomAPI::TViagCacheRecordContent recContent; |
4674 RMmCustomAPI::TViagCacheRecordContent recContent; |
4672 |
4675 |
4673 TRequestStatus reqStatus; |
4676 TRequestStatus reqStatus; |
4674 customAPI.ReadViagHomeZoneCache(reqStatus,recId,recContent); |
4677 customAPI.ReadViagHomeZoneCache(reqStatus,recId,recContent); |
4675 User::WaitForRequest(reqStatus); |
4678 User::WaitForRequest(reqStatus); |
4676 |
4679 |
4677 ASSERT_EQUALS(KErrNone,reqStatus.Int()); |
4680 ASSERT_EQUALS(KErrNone,reqStatus.Int()); |
4678 |
4681 |
4679 const RMmCustomAPI::TViagCacheRecordContent& expectedContent = |
4682 const RMmCustomAPI::TViagCacheRecordContent& expectedContent = |
4680 iViagHomeZoneCache[c - KViagHomeZoneCacheIdMin][r - KViagHomeZoneCacheRecordIdMin]; |
4683 iViagHomeZoneCache[c - KViagHomeZoneCacheIdMin][r - KViagHomeZoneCacheRecordIdMin]; |
4681 ASSERT_EQUALS(expectedContent.iLac, recContent.iLac); |
4684 ASSERT_EQUALS(expectedContent.iLac, recContent.iLac); |
4682 ASSERT_EQUALS(expectedContent.iCellId, recContent.iCellId); |
4685 ASSERT_EQUALS(expectedContent.iCellId, recContent.iCellId); |
4683 } |
4686 } |
4684 } |
4687 } |
4685 |
4688 |
4686 AssertMockLtsyStatusL(); |
4689 AssertMockLtsyStatusL(); |
4687 |
4690 |
4688 //------------------------------------------------------------------------- |
4691 //------------------------------------------------------------------------- |
4689 // TEST E: Unsolicited completion of RMmCustomAPI::ReadViagHomeZoneCache |
4692 // TEST E: Unsolicited completion of RMmCustomAPI::ReadViagHomeZoneCache |
4690 // from LTSY. |
4693 // from LTSY. |
4691 //------------------------------------------------------------------------- |
4694 //------------------------------------------------------------------------- |
4692 |
4695 |
4693 // unsolicited EReadViagHomeZoneCacheIPC completion crashes CTSY |
4696 // unsolicited EReadViagHomeZoneCacheIPC completion crashes CTSY |
4694 |
4697 |
4695 RMmCustomAPI::TViagCacheRecordContent unsolicitedData; |
4698 RMmCustomAPI::TViagCacheRecordContent unsolicitedData; |
4696 TPckgC<RMmCustomAPI::TViagCacheRecordContent> unsolicitedDataPckg(unsolicitedData); |
4699 TPckgC<RMmCustomAPI::TViagCacheRecordContent> unsolicitedDataPckg(unsolicitedData); |
4697 unsolicitedData.iCellId = 111; |
4700 unsolicitedData.iCellId = 111; |
4698 unsolicitedData.iLac = 222; |
4701 unsolicitedData.iLac = 222; |
4699 |
4702 |
4700 TRequestStatus mockLtsyStatus; |
4703 TRequestStatus mockLtsyStatus; |
4701 iMockLTSY.NotifyTerminated(mockLtsyStatus); |
4704 iMockLTSY.NotifyTerminated(mockLtsyStatus); |
4702 iMockLTSY.CompleteL(EReadViagHomeZoneCacheIPC,KErrNone,unsolicitedDataPckg); |
4705 iMockLTSY.CompleteL(EReadViagHomeZoneCacheIPC,KErrNone,unsolicitedDataPckg); |
4703 |
4706 |
4704 User::WaitForRequest(mockLtsyStatus); |
4707 User::WaitForRequest(mockLtsyStatus); |
4705 ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int()); |
4708 ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int()); |
4706 AssertMockLtsyStatusL(); |
4709 AssertMockLtsyStatusL(); |
4707 |
4710 |
4708 CleanupStack::PopAndDestroy(2, this); // customAPI, this |
4711 CleanupStack::PopAndDestroy(2, this); // customAPI, this |
4709 } |
4712 } |
|
4713 |
|
4714 /** |
|
4715 @SYMTestCaseID BA-CTSY-CIPC-MCRVHZC-0001b |
|
4716 @SYMComponent telephony_ctsy |
|
4717 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::ReadViagHomeZoneCache when request failed by NTSY |
|
4718 @SYMTestPriority High |
|
4719 @SYMTestActions Invokes RMmCustomAPI::ReadViagHomeZoneCache |
|
4720 @SYMTestExpectedResults Pass |
|
4721 @SYMTestType CT |
|
4722 */ |
|
4723 void CCTsyCustomIPCFU::TestReadViagHomeZoneCache0001bL() |
|
4724 { |
|
4725 OpenEtelServerL(EUseExtendedError); |
|
4726 CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
|
4727 |
|
4728 RMmCustomAPI customAPI; |
|
4729 |
|
4730 //******************************************************************************** |
|
4731 //* To initialize the VIAG home zone cache properly RMmCustomAPI::OpenL should be |
|
4732 //* invoked _before_ EMmTsyBootNotifySimStatusReadyIPC is triggered. |
|
4733 //* That's why OpenPhoneAndCustomAPILC was implemented and is used here |
|
4734 //* instead of usual OpenPhoneL/OpenCustomAPILC sequence. |
|
4735 //******************************************************************************** |
|
4736 |
|
4737 OpenPhoneAndCustomAPILC(customAPI, KErrGeneral); |
|
4738 |
|
4739 // Complete with an error |
|
4740 MockPrimeEReadViagHomeZoneCacheIPCL(KViagHomeZoneCacheIdMin, KViagHomeZoneCacheRecordIdMin, ETrue, ETrue, KErrGeneral); |
|
4741 |
|
4742 RMmCustomAPI::TViagCacheRecordContent recContent; |
|
4743 TRequestStatus reqStatus; |
|
4744 RMmCustomAPI::TViagCacheRecordId recId; |
|
4745 recId.iCacheId = 2; |
|
4746 recId.iRecordId = 2; |
|
4747 customAPI.ReadViagHomeZoneCache(reqStatus, recId, recContent); |
|
4748 User::WaitForRequest(reqStatus); |
|
4749 |
|
4750 ASSERT_EQUALS(KErrGeneral,reqStatus.Int()); |
|
4751 |
|
4752 //complete without an error |
|
4753 for(TInt c = KViagHomeZoneCacheIdMin; c <= KViagHomeZoneCacheIdMax; c++) |
|
4754 { |
|
4755 for(TInt r = KViagHomeZoneCacheRecordIdMin; r <= KViagHomeZoneCacheRecordIdMax; r++) |
|
4756 { |
|
4757 MockPrimeEReadViagHomeZoneCacheIPCL(c,r, ETrue, ETrue, KErrNone); |
|
4758 } |
|
4759 } |
|
4760 |
|
4761 |
|
4762 for(TInt c = KViagHomeZoneCacheIdMin; c <= KViagHomeZoneCacheIdMin; c++) |
|
4763 { |
|
4764 for(TInt r = KViagHomeZoneCacheRecordIdMin; r <= KViagHomeZoneCacheRecordIdMax; r++) |
|
4765 { |
|
4766 recId.iCacheId = c; |
|
4767 recId.iRecordId = r; |
|
4768 customAPI.ReadViagHomeZoneCache(reqStatus,recId,recContent); |
|
4769 User::WaitForRequest(reqStatus); |
|
4770 |
|
4771 ASSERT_EQUALS(KErrNone,reqStatus.Int()); |
|
4772 |
|
4773 const RMmCustomAPI::TViagCacheRecordContent& expectedContent = |
|
4774 iViagHomeZoneCache[c - KViagHomeZoneCacheIdMin][r - KViagHomeZoneCacheRecordIdMin]; |
|
4775 ASSERT_EQUALS(expectedContent.iLac, recContent.iLac); |
|
4776 ASSERT_EQUALS(expectedContent.iCellId, recContent.iCellId); |
|
4777 } |
|
4778 } |
|
4779 |
|
4780 AssertMockLtsyStatusL(); |
|
4781 |
|
4782 |
|
4783 CleanupStack::PopAndDestroy(2, this); // customAPI, this |
|
4784 } |
|
4785 |
|
4786 /** |
|
4787 @SYMTestCaseID BA-CTSY-CIPC-MCRVHZC-0001c |
|
4788 @SYMComponent telephony_ctsy |
|
4789 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::ReadViagHomeZoneCache when request complete when customAPI is dead |
|
4790 @SYMTestPriority High |
|
4791 @SYMTestActions Invokes RMmCustomAPI::ReadViagHomeZoneCache |
|
4792 @SYMTestExpectedResults Pass |
|
4793 @SYMTestType CT |
|
4794 */ |
|
4795 void CCTsyCustomIPCFU::TestReadViagHomeZoneCache0001cL() |
|
4796 { |
|
4797 OpenEtelServerL(EUseExtendedError); |
|
4798 CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
|
4799 RBuf8 data; |
|
4800 data.CleanupClosePushL(); |
|
4801 |
|
4802 RMmCustomAPI customAPI; |
|
4803 CleanupClosePushL(customAPI); |
|
4804 TInt err = iPhone.Open(iTelServer,KMmTsyPhoneName); |
|
4805 ASSERT_EQUALS(KErrNone, err); |
|
4806 |
|
4807 err=iMockLTSY.Connect(); |
|
4808 ASSERT_EQUALS(KErrNone, err); |
|
4809 |
|
4810 RMmCustomAPI::TViagCacheRecordId currentlyRetrievedCache; |
|
4811 currentlyRetrievedCache.iCacheId = 1; |
|
4812 currentlyRetrievedCache.iRecordId = 0; |
|
4813 TMockLtsyData1 <RMmCustomAPI::TViagCacheRecordId> ltsyData(currentlyRetrievedCache); |
|
4814 |
|
4815 // Only Expect, no complete |
|
4816 MockPrimeEReadViagHomeZoneCacheIPCL(KViagHomeZoneCacheIdMin, KViagHomeZoneCacheRecordIdMin, EFalse, ETrue ); |
|
4817 |
|
4818 TRequestStatus mockLtsyStatus; |
|
4819 iMockLTSY.NotifyTerminated(mockLtsyStatus); |
|
4820 |
|
4821 //************************************************************ |
|
4822 //* Invoke RMmCustomAPI::Open prior to triggering any further |
|
4823 //* CTSY events including EMmTsyBootNotifySimStatusReadyIPC |
|
4824 //************************************************************ |
|
4825 err = customAPI.Open(iPhone); |
|
4826 ASSERT_EQUALS(KErrNone, err); |
|
4827 |
|
4828 // EMmTsyBootNotifyModemStatusReadyIPC |
|
4829 iMockLTSY.CompleteL(EMmTsyBootNotifyModemStatusReadyIPC,KErrNone); |
|
4830 |
|
4831 // EMobilePhoneGetNetworkRegistrationStatus |
|
4832 iMockLTSY.ExpectL(EMobilePhoneGetNetworkRegistrationStatus); |
|
4833 iMockLTSY.CompleteL(EMobilePhoneGetNetworkRegistrationStatus,KErrNone,0); |
|
4834 |
|
4835 // EMmTsyBootNotifySimStatusReadyIPC |
|
4836 iMockLTSY.ExpectL(EMmTsyBootNotifySimStatusReadyIPC); |
|
4837 iMockLTSY.CompleteL(EMmTsyBootNotifySimStatusReadyIPC,KErrNone,0); |
|
4838 |
|
4839 |
|
4840 // EMobilePhoneGetHomeNetwork |
|
4841 RMobilePhone::TMobilePhoneNetworkInfoV5 homeNetwork; |
|
4842 homeNetwork.iMode = RMobilePhone::ENetworkModeWcdma; |
|
4843 homeNetwork.iStatus = RMobilePhone::ENetworkStatusCurrent; |
|
4844 homeNetwork.iBandInfo = RMobilePhone::EBandUnknown; |
|
4845 homeNetwork.iCountryCode = _L("234"); |
|
4846 homeNetwork.iCdmaSID = _L(""); |
|
4847 homeNetwork.iAnalogSID = _L(""); |
|
4848 homeNetwork.iNetworkId = _L("23499"); |
|
4849 homeNetwork.iDisplayTag = _L("symbian"); |
|
4850 homeNetwork.iShortName = _L("symbian"); |
|
4851 homeNetwork.iLongName = _L("symbian mobile"); |
|
4852 homeNetwork.iAccess = RMobilePhone::ENetworkAccessUtran; |
|
4853 homeNetwork.iEgprsAvailableIndicator = ETrue; |
|
4854 homeNetwork.iHsdpaAvailableIndicator = ETrue; |
|
4855 TMockLtsyData1<RMobilePhone::TMobilePhoneNetworkInfoV5> homeNetworkData(homeNetwork); |
|
4856 homeNetworkData.SerialiseL(data); |
|
4857 iMockLTSY.ExpectL(EMobilePhoneGetHomeNetwork); |
|
4858 iMockLTSY.CompleteL(EMobilePhoneGetHomeNetwork,KErrNone,data,0); |
|
4859 |
|
4860 // EMmTsyPhoneGetPin1DisableSupportedIPC |
|
4861 TBool pin1DisableSupport = ETrue; |
|
4862 TMockLtsyData1<TBool> pin1DisableSupportData(pin1DisableSupport); |
|
4863 data.Close(); |
|
4864 pin1DisableSupportData.SerialiseL(data); |
|
4865 iMockLTSY.ExpectL(EMmTsyPhoneGetPin1DisableSupportedIPC); |
|
4866 iMockLTSY.CompleteL(EMmTsyPhoneGetPin1DisableSupportedIPC,KErrNone,data,0); |
|
4867 |
|
4868 // EMmTsySimRefreshRegisterIPC |
|
4869 iMockLTSY.ExpectL(EMmTsySimRefreshRegisterIPC); |
|
4870 iMockLTSY.CompleteL(EMmTsySimRefreshRegisterIPC, KErrGeneral, 0); |
|
4871 |
|
4872 // EMobilePhoneGetServiceTable |
|
4873 RMobilePhone::TMobilePhoneServiceTable serviceTable = RMobilePhone::ESIMServiceTable; |
|
4874 TMockLtsyData1<RMobilePhone::TMobilePhoneServiceTable> serviceTableData(serviceTable); |
|
4875 data.Close(); |
|
4876 serviceTableData.SerialiseL(data); |
|
4877 iMockLTSY.ExpectL(EMobilePhoneGetServiceTable, data); |
|
4878 RMobilePhone::TMobilePhoneServiceTableV1 serviceTableResult; |
|
4879 serviceTableResult.iServices1To8 = 0xFF; |
|
4880 serviceTableResult.iServices9To16 = 0xFF; |
|
4881 serviceTableResult.iServices17To24= 0xFF; |
|
4882 serviceTableResult.iServices25To32= 0xFF; |
|
4883 serviceTableResult.iServices33To40= 0xFF; |
|
4884 serviceTableResult.iServices41To48= 0xFF; |
|
4885 serviceTableResult.iServices49To56= 0xFF; |
|
4886 TMockLtsyData1<RMobilePhone::TMobilePhoneServiceTableV1> serviceTableResultData(serviceTableResult); |
|
4887 data.Close(); |
|
4888 serviceTableResultData.SerialiseL(data); |
|
4889 iMockLTSY.CompleteL(EMobilePhoneGetServiceTable,KErrNone,data,0); |
|
4890 |
|
4891 // EMobilePhoneGetALSLine |
|
4892 RMobilePhone::TMobilePhoneALSLine alsLine = RMobilePhone::EAlternateLinePrimary; |
|
4893 TMockLtsyData1<RMobilePhone::TMobilePhoneALSLine> alsLineData(alsLine); |
|
4894 data.Close(); |
|
4895 alsLineData.SerialiseL(data); |
|
4896 iMockLTSY.ExpectL(EMobilePhoneGetALSLine); |
|
4897 iMockLTSY.CompleteL(EMobilePhoneGetALSLine,KErrNone,data,0); |
|
4898 |
|
4899 // ECustomGetIccCallForwardingStatusIPC |
|
4900 iMockLTSY.ExpectL(ECustomGetIccCallForwardingStatusIPC); |
|
4901 |
|
4902 // EMobilePhoneGetIccMessageWaitingIndicators |
|
4903 RMobilePhone::TMobilePhoneMessageWaitingV1 expectedMessageIndicators; |
|
4904 TMockLtsyData1<RMobilePhone::TMobilePhoneMessageWaitingV1> |
|
4905 indicatorsData(expectedMessageIndicators); |
|
4906 data.Close(); |
|
4907 indicatorsData.SerialiseL(data); |
|
4908 iMockLTSY.ExpectL(EMobilePhoneGetIccMessageWaitingIndicators); |
|
4909 iMockLTSY.CompleteL(EMobilePhoneGetIccMessageWaitingIndicators, KErrNone, data); |
|
4910 |
|
4911 iMockLTSY.ExpectL(ECustomCheckAlsPpSupportIPC); |
|
4912 iMockLTSY.ExpectL(EMobilePhoneGetCustomerServiceProfile); |
|
4913 |
|
4914 |
|
4915 User::WaitForRequest(mockLtsyStatus); |
|
4916 ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int()); |
|
4917 |
|
4918 // Close the customAPI. |
|
4919 CleanupStack::PopAndDestroy(&customAPI); |
|
4920 // Wait for server to clear... |
|
4921 User::After(KOneSecond); |
|
4922 |
|
4923 // ECustomGetIccCallForwardingStatusIPC |
|
4924 iMockLTSY.ExpectL(ECustomGetIccCallForwardingStatusIPC); |
|
4925 |
|
4926 for(TInt c = KViagHomeZoneCacheIdMin; c <= KViagHomeZoneCacheIdMax; c++) |
|
4927 { |
|
4928 for(TInt r = KViagHomeZoneCacheRecordIdMin; r <= KViagHomeZoneCacheRecordIdMax; r++) |
|
4929 { |
|
4930 MockPrimeEReadViagHomeZoneCacheIPCL(c,r, ETrue, ETrue, KErrNone); |
|
4931 } |
|
4932 } |
|
4933 |
|
4934 // Open another client |
|
4935 RMmCustomAPI customAPI2; |
|
4936 CleanupClosePushL(customAPI2); |
|
4937 ASSERT_EQUALS(KErrNone,customAPI2.Open(iPhone)); |
|
4938 |
|
4939 |
|
4940 |
|
4941 for(TInt c = KViagHomeZoneCacheIdMin; c <= KViagHomeZoneCacheIdMin; c++) |
|
4942 { |
|
4943 for(TInt r = KViagHomeZoneCacheRecordIdMin; r <= KViagHomeZoneCacheRecordIdMax; r++) |
|
4944 { |
|
4945 TRequestStatus reqStatus; |
|
4946 RMmCustomAPI::TViagCacheRecordId recId; |
|
4947 recId.iCacheId = c; |
|
4948 recId.iRecordId = r; |
|
4949 RMmCustomAPI::TViagCacheRecordContent recContent; |
|
4950 customAPI2.ReadViagHomeZoneCache(reqStatus,recId,recContent); |
|
4951 User::WaitForRequest(reqStatus); |
|
4952 |
|
4953 ASSERT_EQUALS(KErrNone,reqStatus.Int()); |
|
4954 |
|
4955 const RMmCustomAPI::TViagCacheRecordContent& expectedContent = |
|
4956 iViagHomeZoneCache[c - KViagHomeZoneCacheIdMin][r - KViagHomeZoneCacheRecordIdMin]; |
|
4957 ASSERT_EQUALS(expectedContent.iLac, recContent.iLac); |
|
4958 ASSERT_EQUALS(expectedContent.iCellId, recContent.iCellId); |
|
4959 } |
|
4960 } |
|
4961 |
|
4962 AssertMockLtsyStatusL(); |
|
4963 |
|
4964 |
|
4965 CleanupStack::PopAndDestroy(3, this); // customAPI2, data, this |
|
4966 } |
4710 |
4967 |
4711 |
4968 |
4712 /** |
4969 /** |
4713 @SYMTestCaseID BA-CTSY-CIPC-MCRVHZC-0002 |
4970 @SYMTestCaseID BA-CTSY-CIPC-MCRVHZC-0002 |
4714 @SYMComponent telephony_ctsy |
4971 @SYMComponent telephony_ctsy |