telephonyserverplugins/common_tsy/test/component/src/cctsycustomipcfu.cpp
branchRCL_3
changeset 14 7ef16719d8cb
parent 0 3553901f7fa8
child 24 6638e7f4bd8f
child 69 b982c3e940f3
child 70 4814c5a49428
equal deleted inserted replaced
9:962e6306d9d2 14:7ef16719d8cb
    34 // constants used by ReadViagHomeZoneCache/WriteViagHomeZoneCache tests
    34 // constants used by ReadViagHomeZoneCache/WriteViagHomeZoneCache tests
    35 const TInt KViagHomeZoneCacheIdMin = 1;
    35 const TInt KViagHomeZoneCacheIdMin = 1;
    36 const TInt KViagHomeZoneCacheIdMax = KPhEngMaxViagHomeZones;
    36 const TInt KViagHomeZoneCacheIdMax = KPhEngMaxViagHomeZones;
    37 const TInt KViagHomeZoneCacheRecordIdMin = 0;
    37 const TInt KViagHomeZoneCacheRecordIdMin = 0;
    38 const TInt KViagHomeZoneCacheRecordIdMax = KPhEngMaxCacheId - 1;
    38 const TInt KViagHomeZoneCacheRecordIdMax = KPhEngMaxCacheId - 1;
       
    39 const TInt KOneSecond=1000000;  // Used in a time out function, 1 second (in microSeconds)
    39 
    40 
    40 CTestSuite* CCTsyCustomIPCFU::CreateSuiteL(const TDesC& aName)
    41 CTestSuite* CCTsyCustomIPCFU::CreateSuiteL(const TDesC& aName)
    41 	{
    42 	{
    42 	SUB_SUITE;
    43 	SUB_SUITE;
    43 
    44 
   100 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestReadViagHomeZoneParams0002L);
   101 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestReadViagHomeZoneParams0002L);
   101 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestReadViagHomeZoneParams0003L);
   102 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestReadViagHomeZoneParams0003L);
   102 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestReadViagHomeZoneParams0004L);
   103 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestReadViagHomeZoneParams0004L);
   103 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestReadViagHomeZoneParams0005L);
   104 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestReadViagHomeZoneParams0005L);
   104 	
   105 	
   105 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestReadViagHomeZoneCache0001L);
   106     ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestReadViagHomeZoneCache0001L);
       
   107     ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestReadViagHomeZoneCache0001bL);
       
   108     ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestReadViagHomeZoneCache0001cL);
   106 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestReadViagHomeZoneCache0002L);
   109 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestReadViagHomeZoneCache0002L);
   107 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestReadViagHomeZoneCache0003L);
   110 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestReadViagHomeZoneCache0003L);
   108 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestReadViagHomeZoneCache0004L);
   111 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestReadViagHomeZoneCache0004L);
   109 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestReadViagHomeZoneCache0005L);
   112 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestReadViagHomeZoneCache0005L);
   110 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestWriteViagHomeZoneCache0001L);
   113 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestWriteViagHomeZoneCache0001L);
  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
 18862 /**
 19119 /**
 18863  * The purpose of this function is to invoke RMmCustomAPI::Open
 19120  * The purpose of this function is to invoke RMmCustomAPI::Open
 18864  * _before_ EMmTsyBootNotifySimStatusReadyIPC CTSY event is triggered and thus
 19121  * _before_ EMmTsyBootNotifySimStatusReadyIPC CTSY event is triggered and thus
 18865  * let the Viag Home Zome Cache to be initialized. 
 19122  * let the Viag Home Zome Cache to be initialized. 
 18866  */
 19123  */
 18867 void CCTsyCustomIPCFU::OpenPhoneAndCustomAPILC(RMmCustomAPI& aCustomAPI)
 19124 void CCTsyCustomIPCFU::OpenPhoneAndCustomAPILC(RMmCustomAPI& aCustomAPI, TInt aNtsyError)
 18868 	{
 19125 	{
 18869     CleanupClosePushL(aCustomAPI);
 19126     CleanupClosePushL(aCustomAPI);
 18870 	TInt err = iPhone.Open(iTelServer,KMmTsyPhoneName);
 19127 	TInt err = iPhone.Open(iTelServer,KMmTsyPhoneName);
 18871 	ASSERT_EQUALS(KErrNone, err);
 19128 	ASSERT_EQUALS(KErrNone, err);
 18872 
 19129 
 18884     // 2-nd & all further EReadViagHomeZoneCacheIPC
 19141     // 2-nd & all further EReadViagHomeZoneCacheIPC
 18885      for(TInt c = KViagHomeZoneCacheIdMin; c <= KViagHomeZoneCacheIdMax; c++)
 19142      for(TInt c = KViagHomeZoneCacheIdMin; c <= KViagHomeZoneCacheIdMax; c++)
 18886          {
 19143          {
 18887          for(TInt r = KViagHomeZoneCacheRecordIdMin; r <= KViagHomeZoneCacheRecordIdMax; r++)
 19144          for(TInt r = KViagHomeZoneCacheRecordIdMin; r <= KViagHomeZoneCacheRecordIdMax; r++)
 18888              {
 19145              {
 18889              MockPrimeEReadViagHomeZoneCacheIPCL(c,r);
 19146              MockPrimeEReadViagHomeZoneCacheIPCL(c,r, ETrue, ETrue, aNtsyError);
       
 19147              if(aNtsyError != KErrNone)
       
 19148                  {
       
 19149                  // got error, send only once
       
 19150                  c = KViagHomeZoneCacheIdMax + 1;
       
 19151                  r = KViagHomeZoneCacheRecordIdMax + 1;
       
 19152                  }
 18890              }
 19153              }
 18891          }
 19154          }
 18892 
 19155 
 18893     TRequestStatus mockLtsyStatus;
 19156     TRequestStatus mockLtsyStatus;
 18894 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
 19157 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
 18988 	// 2-nd & all further EReadViagHomeZoneCacheIPC
 19251 	// 2-nd & all further EReadViagHomeZoneCacheIPC
 18989 	for(TInt c = KViagHomeZoneCacheIdMin; c <= KViagHomeZoneCacheIdMax; c++)
 19252 	for(TInt c = KViagHomeZoneCacheIdMin; c <= KViagHomeZoneCacheIdMax; c++)
 18990 		{
 19253 		{
 18991 		for(TInt r = KViagHomeZoneCacheRecordIdMin; r <= KViagHomeZoneCacheRecordIdMax; r++)
 19254 		for(TInt r = KViagHomeZoneCacheRecordIdMin; r <= KViagHomeZoneCacheRecordIdMax; r++)
 18992 			{
 19255 			{
 18993 			MockPrimeEReadViagHomeZoneCacheIPCL(c,r);
 19256 			MockPrimeEReadViagHomeZoneCacheIPCL(c,r, ETrue, ETrue, aNtsyError);
       
 19257             if(aNtsyError != KErrNone)
       
 19258                 {
       
 19259                 // got error, send only once
       
 19260                 c = KViagHomeZoneCacheIdMax + 1;
       
 19261                 r = KViagHomeZoneCacheRecordIdMax + 1;
       
 19262                 }
 18994 			}
 19263 			}
 18995 		}
 19264 		}
 18996 	
 19265 	
 18997 
 19266 
 18998 	User::WaitForRequest(mockLtsyStatus);
 19267 	User::WaitForRequest(mockLtsyStatus);
 18999 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
 19268 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
 19000 	
 19269 	
 19001 	CleanupStack::PopAndDestroy(1,&data);
 19270 	CleanupStack::PopAndDestroy(1,&data);
 19002 	}
 19271 	}
 19003 
 19272 
 19004 void CCTsyCustomIPCFU::MockPrimeEReadViagHomeZoneCacheIPCL(TInt aCacheId,TInt aRecordId,TBool aDoComplete, TBool aDoExpect)
 19273 void CCTsyCustomIPCFU::MockPrimeEReadViagHomeZoneCacheIPCL(TInt aCacheId,TInt aRecordId,TBool aDoComplete, TBool aDoExpect, TInt aNtsyError)
 19005 	{
 19274 	{
 19006 	RBuf8 data;
 19275 	RBuf8 data;
 19007 	data.CleanupClosePushL();
 19276 	data.CleanupClosePushL();
 19008 
 19277 
 19009 	RMmCustomAPI::TViagCacheRecordId id;
 19278 	RMmCustomAPI::TViagCacheRecordId id;
 19025 		content.iLac =2000 + aRecordId;
 19294 		content.iLac =2000 + aRecordId;
 19026 
 19295 
 19027 		TMockLtsyData1<RMmCustomAPI::TViagCacheRecordContent> contentData(content);
 19296 		TMockLtsyData1<RMmCustomAPI::TViagCacheRecordContent> contentData(content);
 19028 		data.Close();
 19297 		data.Close();
 19029 		contentData.SerialiseL(data);
 19298 		contentData.SerialiseL(data);
 19030 		iMockLTSY.CompleteL(EReadViagHomeZoneCacheIPC,KErrNone,data,0);
 19299 		iMockLTSY.CompleteL(EReadViagHomeZoneCacheIPC,aNtsyError,data,0);
 19031 		}
 19300 		}
 19032 
 19301 
 19033 	CleanupStack::PopAndDestroy(1,&data);
 19302 	CleanupStack::PopAndDestroy(1,&data);
 19034 	}
 19303 	}
 19035 
 19304