telephonyserverplugins/common_tsy/test/component/src/cctsycustomipcfu.cpp
changeset 0 3553901f7fa8
child 14 7ef16719d8cb
equal deleted inserted replaced
-1:000000000000 0:3553901f7fa8
       
     1 /*
       
     2 * Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 /**
       
    21 @file 
       
    22 The TEFUnit test suite for CustomIPC in the Common TSY.
       
    23 */
       
    24 
       
    25 #include "cctsycustomipcfu.h"
       
    26 #include <ctsy/mmtsy_names.h>
       
    27 #include <etel.h>
       
    28 #include <etelmm.h>
       
    29 #include "tmockltsydata.h"
       
    30 #include <ctsy/serviceapi/gsmerror.h>
       
    31 #include <ctsy/serviceapi/mmtsy_ipcdefs.h>
       
    32 #include "CMmCustomSecurityTsy.h"
       
    33 
       
    34 // constants used by ReadViagHomeZoneCache/WriteViagHomeZoneCache tests
       
    35 const TInt KViagHomeZoneCacheIdMin = 1;
       
    36 const TInt KViagHomeZoneCacheIdMax = KPhEngMaxViagHomeZones;
       
    37 const TInt KViagHomeZoneCacheRecordIdMin = 0;
       
    38 const TInt KViagHomeZoneCacheRecordIdMax = KPhEngMaxCacheId - 1;
       
    39 
       
    40 CTestSuite* CCTsyCustomIPCFU::CreateSuiteL(const TDesC& aName)
       
    41 	{
       
    42 	SUB_SUITE;
       
    43 
       
    44 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestSetDriveMode0001L);
       
    45 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestSetDriveMode0002L);
       
    46 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestSetDriveMode0004L);
       
    47 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestSetDriveMode0005L);		
       
    48 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestActivateSimLock0001L);	
       
    49 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestActivateSimLock0002L);
       
    50 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestActivateSimLock0003L);
       
    51 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestActivateSimLock0004L);
       
    52 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestActivateSimLock0005L);	
       
    53 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestDeActivateSimLock0001L);
       
    54 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestDeActivateSimLock0002L);
       
    55 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestDeActivateSimLock0003L);
       
    56 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestDeActivateSimLock0004L);
       
    57 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestDeActivateSimLock0005L);	
       
    58 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestNotifyDtmfEvent0001L);
       
    59 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestNotifyDtmfEvent0002L);
       
    60 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestNotifyDtmfEvent0004L);	
       
    61 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestGetDiagnosticInfo0001L);	
       
    62 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestSetAlsBlocked0001L);
       
    63 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestSetAlsBlocked0002L);
       
    64 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestSetAlsBlocked0004L);	
       
    65 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestSetAlsBlocked0005L);
       
    66 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestGetAlsBlocked0001L);
       
    67 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestGetAlsBlocked0002L);	
       
    68 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestGetAlsBlocked0004L);
       
    69 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestGetAlsBlocked0005L);	
       
    70 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestCheckAlsPpSupport0001L);
       
    71 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestCheckAlsPpSupport0002L);
       
    72 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestCheckAlsPpSupport0004L);
       
    73 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestCheckAlsPpSupport0005L);	
       
    74 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestGetRemoteAlertingToneStatus0001L);	
       
    75 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestCallOrigin0001L);
       
    76 	
       
    77 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestTerminateCall0001L);
       
    78 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestTerminateCall0002L);
       
    79 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestTerminateCall0003L);
       
    80 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestTerminateCall0004L);
       
    81 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestTerminateCall0005L);
       
    82 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestNotifyAlsBlockedChanged0001L);
       
    83 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestNotifyAlsBlockedChanged0002L);
       
    84 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestNotifyAlsBlockedChanged0004L);
       
    85 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestGetCipheringInfo0001L);
       
    86 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestGetCipheringInfo0002L);
       
    87 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestGetCipheringInfo0004L);
       
    88 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestGetCipheringInfo0005L);
       
    89 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestNotifyCipheringInfoChange0001L);
       
    90 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestNotifyCipheringInfoChange0002L);
       
    91 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestNotifyCipheringInfoChange0004L);
       
    92 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestNotifyNSPSStatus0001L);
       
    93 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestNotifyNSPSStatus0002L);
       
    94 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestNotifyNSPSStatus0004L);
       
    95 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestNetWakeup0001L);
       
    96 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestNetWakeup0002L);
       
    97 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestNetWakeup0004L);
       
    98 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestNetWakeup0005L);
       
    99 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestReadViagHomeZoneParams0001L);
       
   100 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestReadViagHomeZoneParams0002L);
       
   101 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestReadViagHomeZoneParams0003L);
       
   102 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestReadViagHomeZoneParams0004L);
       
   103 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestReadViagHomeZoneParams0005L);
       
   104 	
       
   105 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestReadViagHomeZoneCache0001L);
       
   106 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestReadViagHomeZoneCache0002L);
       
   107 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestReadViagHomeZoneCache0003L);
       
   108 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestReadViagHomeZoneCache0004L);
       
   109 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestReadViagHomeZoneCache0005L);
       
   110 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestWriteViagHomeZoneCache0001L);
       
   111 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestWriteViagHomeZoneCache0002L);
       
   112 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestWriteViagHomeZoneCache0003L);
       
   113 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestWriteViagHomeZoneCache0004L);
       
   114 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestWriteViagHomeZoneCache0005L);
       
   115 	
       
   116 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestClearCallBlackList0001L);
       
   117 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestClearCallBlackList0002L);
       
   118 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestClearCallBlackList0004L);
       
   119 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestClearCallBlackList0005L);
       
   120 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestSsAdditionalInfoNotification0001L);
       
   121 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestSsAdditionalInfoNotification0002L);
       
   122 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestSsAdditionalInfoNotification0004L);
       
   123 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestSsRequestCompleteNotification0001L);
       
   124 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestSsRequestCompleteNotification0002L);
       
   125 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestSsRequestCompleteNotification0004L);	
       
   126 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestIsBlocked0001L);
       
   127 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestIsBlocked0005L);
       
   128 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestCheckSecurityCode0001L);
       
   129 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestCheckSecurityCode0002L);
       
   130 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestCheckSecurityCode0004L);
       
   131 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestCheckSecurityCode0005L);
       
   132 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestGetActivePin0001L);
       
   133 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestGetAirTimeDuration0001L);
       
   134 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestGetNetworkProviderName0001L);
       
   135 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestGetNetworkProviderName0002L);
       
   136 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestGetNetworkProviderName0003L);
       
   137 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestGetNetworkProviderName0004L);
       
   138 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestGetNetworkProviderName0005L);	
       
   139 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestCheckEmergencyNumber0001L);
       
   140 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestCheckEmergencyNumber0002L);
       
   141 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestCheckEmergencyNumber0004L);
       
   142 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestCheckEmergencyNumber0005L);
       
   143 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestNotifyPndCacheReady0001L);
       
   144 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestNotifyPndCacheReady0001bL);
       
   145 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestNotifyPndCacheReady0002L);
       
   146 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestNotifyPndCacheReady0003L);
       
   147 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestNotifyPndCacheReady0004L);
       
   148 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestGetPndCacheStatus0001L);
       
   149 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestGetPndCacheStatus0003L);
       
   150 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestGetOperatorName0001L);
       
   151 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestGetOperatorName0002L);
       
   152 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestGetOperatorName0004L);
       
   153 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestGetOperatorName0005L);	
       
   154 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestGetProgrammableOperatorLogo0001L);
       
   155 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestGetProgrammableOperatorLogo0002L);
       
   156 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestGetProgrammableOperatorLogo0003L);
       
   157 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestGetProgrammableOperatorLogo0004L);
       
   158 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestGetProgrammableOperatorLogo0005L);	
       
   159 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestNotifyProgrammableOperatorLogoChange0001L);
       
   160 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestNotifySsNetworkEvent0001L);
       
   161 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestNotifySsNetworkEvent0002L);
       
   162 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestNotifySsNetworkEvent0004L);	
       
   163 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestCancelUssdSession0001L);	
       
   164 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestSatRefreshCompleteNotification0001L);
       
   165 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestSatRefreshCompleteNotification0002L);
       
   166 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestSatRefreshCompleteNotification0004L);	
       
   167 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestCheckTwoDigitDialSupport0001L);
       
   168 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestCheckTwoDigitDialSupport0002L);
       
   169 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestCheckTwoDigitDialSupport0004L);
       
   170 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestCheckTwoDigitDialSupport0005L);
       
   171 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestResetNetServer0001L);
       
   172 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestResetNetServer0002L);
       
   173 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestResetNetServer0004L);
       
   174 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestResetNetServer0005L);
       
   175 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestReleaseFile0001L);
       
   176 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestRestartFile0001L);
       
   177 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestStartSimCbTopicBrowsing0001L);
       
   178 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestStartSimCbTopicBrowsing0003L);
       
   179 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestStartSimCbTopicBrowsing0005L);	
       
   180 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestGetNextSimCbTopic0001L);
       
   181 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestDeleteSimCbTopic0001L);
       
   182 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestDeleteSimCbTopic0002L);
       
   183 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestDeleteSimCbTopic0003L);
       
   184 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestDeleteSimCbTopic0004L);
       
   185 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestDeleteSimCbTopic0005L);
       
   186 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestNotifyNetworkConnectionFailure0001L);
       
   187 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestNotifyNetworkConnectionFailure0002L);
       
   188 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestNotifyNetworkConnectionFailure0004L);
       
   189 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestSendAPDUReq0001L);
       
   190 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestSendAPDUReq0002L);
       
   191 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestSendAPDUReq0003L);
       
   192 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestSendAPDUReq0004L);
       
   193 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestSendAPDUReq0005L);	
       
   194 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestDisablePhoneLock0001L);
       
   195 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestDisablePhoneLock0002L);
       
   196 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestDisablePhoneLock0004L);
       
   197 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestDisablePhoneLock0005L);	
       
   198 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestNotifyEGprsInfoChange0001L);
       
   199 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestNotifyEGprsInfoChange0002L);
       
   200 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestNotifyEGprsInfoChange0003L);
       
   201 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestNotifyEGprsInfoChange0004L);
       
   202 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestGetEGprsInfo0001L);
       
   203 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestGetEGprsInfo0003L);	
       
   204 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestReadSimFile0001L);
       
   205 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestReadSimFile0002L);
       
   206 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestReadSimFile0003L);
       
   207 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestReadSimFile0004L);
       
   208 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestReadSimFile0005L);	
       
   209 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestGetLifeTime0001L);
       
   210 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestGetLifeTime0002L);
       
   211 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestGetLifeTime0003L);
       
   212 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestGetLifeTime0004L);
       
   213 
       
   214 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestGet3GPBInfo0001L);	
       
   215 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestGetSystemNetworkModes0001L);
       
   216 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestGetSystemNetworkModes0002L);
       
   217 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestGetSystemNetworkModes0004L);
       
   218 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestGetSystemNetworkModes0005L);
       
   219 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestSetSystemNetworkMode0001L);
       
   220 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestSetSystemNetworkMode0002L);
       
   221 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestSetSystemNetworkMode0004L);
       
   222 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestSetSystemNetworkMode0005L);	
       
   223 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestGetCurrentSystemNetworkModes0001L);
       
   224 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestGetCurrentSystemNetworkModes0002L);
       
   225 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestGetCurrentSystemNetworkModes0004L);
       
   226 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestGetCurrentSystemNetworkModes0005L);	
       
   227 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestPowerSimOn0001L);
       
   228 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestPowerSimOn0002L);
       
   229 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestPowerSimOn0004L);
       
   230 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestPowerSimOn0005L);	
       
   231 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestPowerSimOff0001L);
       
   232 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestPowerSimOff0002L);
       
   233 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestPowerSimOff0004L);
       
   234 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestPowerSimOff0005L);	
       
   235 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestSimWarmReset0001L);
       
   236 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestSimWarmReset0002L);
       
   237 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestSimWarmReset0004L);
       
   238 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestSimWarmReset0005L);	
       
   239 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestGetATR0001L);	
       
   240 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestGetATR0002L);
       
   241 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestGetATR0003L);
       
   242 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestGetATR0004L);
       
   243 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestGetATR0005L);
       
   244 	
       
   245 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestGetSimCardReaderStatus0001L);
       
   246 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestGetSimCardReaderStatus0002L);
       
   247 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestGetSimCardReaderStatus0004L);
       
   248 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestGetSimCardReaderStatus0005L);	
       
   249 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestNotifySimCardStatus0001L);
       
   250 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestNotifySimCardStatus0002L);
       
   251 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestNotifySimCardStatus0004L);	
       
   252 	
       
   253 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestGetWlanSimAuthenticationData0001L); //!!!
       
   254 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestGetWlanSimAuthenticationData0002L); 
       
   255 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestGetWlanSimAuthenticationData0003L); 
       
   256 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestGetWlanSimAuthenticationData0004L); 
       
   257 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestGetWlanSimAuthenticationData0005L); 
       
   258 	
       
   259 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestSetSimMessageStatusRead0001L);
       
   260 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestWriteViagHomeZoneUHZIUESettings0001L);
       
   261 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestWriteViagHomeZoneUHZIUESettings0002L);
       
   262 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestWriteViagHomeZoneUHZIUESettings0004L);
       
   263 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestWriteViagHomeZoneUHZIUESettings0005L);	
       
   264 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestSetAlwaysOn0001L);
       
   265 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestSetAlwaysOn0002L);
       
   266 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestSetAlwaysOn0003L);
       
   267 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestSetAlwaysOn0004L);
       
   268 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestNotifyRauEvent0001L);
       
   269 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestNotifyRauEvent0002L);
       
   270 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestNotifyRauEvent0004L);
       
   271 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestReadHSxPAStatus0001L);
       
   272 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestReadHSxPAStatus0002L);
       
   273 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestReadHSxPAStatus0004L);
       
   274 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestReadHSxPAStatus0005L);
       
   275 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestWriteHSxPAStatus0001L);
       
   276 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestWriteHSxPAStatus0002L);
       
   277 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestWriteHSxPAStatus0004L);
       
   278 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestWriteHSxPAStatus0005L);
       
   279 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestNotifyHSxPAStatus0001L);
       
   280 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestNotifyHSxPAStatus0002L);
       
   281 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestNotifyHSxPAStatus0004L);
       
   282 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestGetIccCallForwardingIndicatorStatus0001L);
       
   283 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestGetIccCallForwardingIndicatorStatus0002L);
       
   284 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestGetIccCallForwardingIndicatorStatus0003L);
       
   285 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestGetIccCallForwardingIndicatorStatus0004L);
       
   286 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestGetIccCallForwardingIndicatorStatus0005L);
       
   287 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestNotifyIccCallForwardingStatusChange0001L);
       
   288 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestNotifyIccCallForwardingStatusChange0002L);
       
   289 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestNotifyIccCallForwardingStatusChange0003L);
       
   290 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestNotifyIccCallForwardingStatusChange0004L);
       
   291 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestGetCellInfo0001L);
       
   292 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestGetCellInfo0002L);
       
   293 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestGetCellInfo0003L);
       
   294 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestGetCellInfo0004L);
       
   295 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestGetCellInfo0005L);
       
   296 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestNotifyCellInfoChange0001L);
       
   297 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestNotifyCellInfoChange0002L);
       
   298 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestNotifyCellInfoChange0003L);
       
   299 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestNotifyCellInfoChange0004L);
       
   300 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestGetSystemNetworkBand0001L);
       
   301 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestGetSystemNetworkBand0002L);
       
   302 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestGetSystemNetworkBand0004L);
       
   303 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestGetSystemNetworkBand0005L);
       
   304 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestSetSystemNetworkBand0001L);
       
   305 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestSetSystemNetworkBand0002L);
       
   306 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestSetSystemNetworkBand0004L);
       
   307 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestSetSystemNetworkBand0005L);
       
   308 
       
   309 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestGetUSIMServiceSupport0001L);
       
   310 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestGetUSIMServiceSupport0002L);		
       
   311 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestGetUSIMServiceSupport0003L);		
       
   312 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestGetUSIMServiceSupport0004L);
       
   313 	ADD_TEST_STEP_ISO_CPP(CCTsyCustomIPCFU, TestGetUSIMServiceSupport0005L);
       
   314 	
       
   315 	END_SUITE;
       
   316 	}
       
   317 
       
   318 
       
   319 //////////////////////////////////////////////////////////////////
       
   320 // Actual test cases
       
   321 /////////////////////////////////////////////////////////////////
       
   322 
       
   323 
       
   324 /**
       
   325 @SYMTestCaseID BA-CTSY-CIPC-MCSDM-0001
       
   326 @SYMComponent  telephony_ctsy
       
   327 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::SetDriveMode
       
   328 @SYMTestPriority High
       
   329 @SYMTestActions Invokes RMmCustomAPI::SetDriveMode
       
   330 @SYMTestExpectedResults Pass
       
   331 @SYMTestType CT
       
   332 */
       
   333 void CCTsyCustomIPCFU::TestSetDriveMode0001L()
       
   334 	{
       
   335 
       
   336 	OpenEtelServerL(EUseExtendedError);
       
   337 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
   338 	OpenPhoneL();
       
   339 
       
   340 	RBuf8 expectData;
       
   341 	CleanupClosePushL(expectData);
       
   342 	
       
   343 	RMmCustomAPI customAPI;
       
   344 	OpenCustomAPILC(customAPI, iPhone);
       
   345 	   
       
   346 		
       
   347 	TRequestStatus requestStatus;	
       
   348 	RMmCustomAPI::TSetDriveMode modeStatus(RMmCustomAPI::EActivateDriveMode);    
       
   349 	
       
   350  	//-------------------------------------------------------------------------
       
   351 	// TEST A: failure to dispatch request to LTSY
       
   352  	//-------------------------------------------------------------------------
       
   353 	// data for ExpectL
       
   354 	TMockLtsyData1< RMmCustomAPI::TSetDriveMode > ltsyData(modeStatus);	
       
   355     ltsyData.SerialiseL(expectData);	    
       
   356     iMockLTSY.ExpectL(ECustomSetDriveModeIPC, expectData, KErrNotSupported);        	
       
   357     
       
   358 	customAPI.SetDriveMode(requestStatus, modeStatus);	
       
   359 	
       
   360 	User::WaitForRequest(requestStatus);	
       
   361 	AssertMockLtsyStatusL();
       
   362 	ASSERT_EQUALS(KErrNotSupported, requestStatus.Int());
       
   363 
       
   364 	//-------------------------------------------------------------------------
       
   365 	// TEST B: failure on completion of pending request from LTSY->CTSY
       
   366  	//-------------------------------------------------------------------------	    
       
   367     iMockLTSY.ExpectL(ECustomSetDriveModeIPC, expectData);   
       
   368     iMockLTSY.CompleteL(ECustomSetDriveModeIPC, KErrGeneral);	
       
   369 	
       
   370 	customAPI.SetDriveMode(requestStatus, modeStatus);	
       
   371 	
       
   372 	User::WaitForRequest(requestStatus);	
       
   373 	AssertMockLtsyStatusL();
       
   374 	ASSERT_EQUALS(KErrGeneral, requestStatus.Int());
       
   375 
       
   376  	//-------------------------------------------------------------------------
       
   377 	// TEST C: Successful completion request of
       
   378 	// RMmCustomAPI::SetDriveMode when result is not cached.
       
   379  	//-------------------------------------------------------------------------
       
   380 	iMockLTSY.ExpectL(ECustomSetDriveModeIPC, expectData);   
       
   381     iMockLTSY.CompleteL(ECustomSetDriveModeIPC, KErrNone);	
       
   382 	
       
   383 	customAPI.SetDriveMode(requestStatus, modeStatus);	
       
   384 	
       
   385 	User::WaitForRequest(requestStatus);	
       
   386 	AssertMockLtsyStatusL();
       
   387 	ASSERT_EQUALS(KErrNone, requestStatus.Int());	
       
   388 	
       
   389  	//-------------------------------------------------------------------------
       
   390 	// TEST E: Unsolicited completion of RMmCustomAPI::SetDriveMode
       
   391 	// from LTSY.
       
   392  	//-------------------------------------------------------------------------
       
   393 	TRequestStatus mockLtsyStatus;
       
   394 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
   395 	iMockLTSY.CompleteL(ECustomSetDriveModeIPC, KErrNone);
       
   396 	User::WaitForRequest(mockLtsyStatus);
       
   397 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
   398 	
       
   399 	AssertMockLtsyStatusL();
       
   400 	
       
   401 	CleanupStack::PopAndDestroy(3, this); 
       
   402 	}
       
   403 
       
   404 
       
   405 /**
       
   406 @SYMTestCaseID BA-CTSY-CIPC-MCSDM-0002
       
   407 @SYMComponent  telephony_ctsy
       
   408 @SYMTestCaseDesc Test support in CTSY for cancelling of RMmCustomAPI::SetDriveMode
       
   409 @SYMTestPriority High
       
   410 @SYMTestActions Invokes cancelling of RMmCustomAPI::SetDriveMode
       
   411 @SYMTestExpectedResults Pass
       
   412 @SYMTestType CT
       
   413 */
       
   414 void CCTsyCustomIPCFU::TestSetDriveMode0002L()
       
   415 	{
       
   416 
       
   417 	OpenEtelServerL(EUseExtendedError);
       
   418 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
   419 	OpenPhoneL();
       
   420 
       
   421 	RBuf8 expectData;
       
   422 	CleanupClosePushL(expectData);
       
   423 	
       
   424 	RMmCustomAPI customAPI;
       
   425 	OpenCustomAPILC(customAPI, iPhone);
       
   426 		
       
   427 	TRequestStatus requestStatus;	
       
   428 	RMmCustomAPI::TSetDriveMode modeStatus(RMmCustomAPI::EActivateDriveMode); 
       
   429 
       
   430  	//-------------------------------------------------------------------------
       
   431 	// Test cancelling of RMmCustomAPI::SetDriveMode
       
   432  	//------------------------------------------------------------------------- 	
       
   433 
       
   434 	// data for ExpectL
       
   435 	TMockLtsyData1< RMmCustomAPI::TSetDriveMode > ltsyData(modeStatus);	
       
   436     ltsyData.SerialiseL(expectData);	    
       
   437     iMockLTSY.ExpectL(ECustomSetDriveModeIPC, expectData); 
       
   438     
       
   439     customAPI.SetDriveMode(requestStatus, modeStatus);
       
   440 	
       
   441 	iMockLTSY.CompleteL(ECustomSetDriveModeIPC, KErrNone, 20);
       
   442 	
       
   443 	customAPI.CancelAsyncRequest(ECustomSetDriveModeIPC);
       
   444 		
       
   445 	User::WaitForRequest(requestStatus);		
       
   446 	// TSY has started a request and it is not possible to then
       
   447     // cancel it. The best thing for the TSY to do in
       
   448     // this case is to proceed as though the Cancel never happened.
       
   449     // The server's call to the TSY cancel function will return
       
   450     // synchronously. The TSY then continues to wait for the methods
       
   451     // acknowledgement and when it receives it, the TSY will complete
       
   452     // the original request.
       
   453 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
   454 
       
   455 	AssertMockLtsyStatusL();
       
   456 	
       
   457 		
       
   458 	CleanupStack::PopAndDestroy(3); 
       
   459 	
       
   460 	}
       
   461 
       
   462 
       
   463 /**
       
   464 @SYMTestCaseID BA-CTSY-CIPC-MCSDM-0004
       
   465 @SYMComponent  telephony_ctsy
       
   466 @SYMTestCaseDesc Test support in CTSY for multiple client requests to RMmCustomAPI::SetDriveMode
       
   467 @SYMTestPriority High
       
   468 @SYMTestActions Invokes multiple client requests to RMmCustomAPI::SetDriveMode
       
   469 @SYMTestExpectedResults Pass
       
   470 @SYMTestType CT
       
   471 */
       
   472 void CCTsyCustomIPCFU::TestSetDriveMode0004L()
       
   473 	{
       
   474 					
       
   475 	OpenEtelServerL(EUseExtendedError);
       
   476 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
   477 	OpenPhoneL();
       
   478 
       
   479 	RBuf8 data;
       
   480 	CleanupClosePushL(data);
       
   481 
       
   482 	// Open second client
       
   483 	RTelServer telServer2;
       
   484 	TInt ret = telServer2.Connect();
       
   485 	ASSERT_EQUALS(KErrNone, ret);
       
   486 	CleanupClosePushL(telServer2);
       
   487 
       
   488 	RMobilePhone phone2;
       
   489 	ret = phone2.Open(telServer2,KMmTsyPhoneName);
       
   490 	ASSERT_EQUALS(KErrNone, ret);
       
   491 	CleanupClosePushL(phone2);
       
   492 	
       
   493 	RMmCustomAPI customAPI;
       
   494 	OpenCustomAPILC(customAPI, iPhone);
       
   495 	
       
   496 	RMmCustomAPI customAPI2;
       
   497 	OpenCustomAPILC(customAPI2, phone2, EFalse);
       
   498 			
       
   499 	RBuf8 expectData;
       
   500 	CleanupClosePushL(expectData);
       
   501 	
       
   502 	RBuf8 expectData2;
       
   503 	CleanupClosePushL(expectData2);	
       
   504 	
       
   505 	TRequestStatus requestStatus;	
       
   506 	RMmCustomAPI::TSetDriveMode modeStatus(RMmCustomAPI::EActivateDriveMode); 
       
   507 	
       
   508 	TRequestStatus requestStatus2;	
       
   509 	RMmCustomAPI::TSetDriveMode modeStatus2(RMmCustomAPI::EDeactivateDriveMode); 
       
   510 	
       
   511 
       
   512 	//-------------------------------------------------------------------------
       
   513 	// Test A: Test multiple clients requesting RMmCustomAPI::SetDriveMode
       
   514  	//-------------------------------------------------------------------------
       
   515  	
       
   516  	// data for the first ExpectL
       
   517 	TMockLtsyData1< RMmCustomAPI::TSetDriveMode > ltsyData(modeStatus);	
       
   518     ltsyData.SerialiseL(expectData);	    
       
   519        
       
   520     // data for the second ExpectL
       
   521 	TMockLtsyData1< RMmCustomAPI::TSetDriveMode > ltsyData2(modeStatus2);	
       
   522     ltsyData2.SerialiseL(expectData2);	    
       
   523         
       
   524     // first SetDriveMode
       
   525     iMockLTSY.ExpectL(ECustomSetDriveModeIPC, expectData);
       
   526     iMockLTSY.CompleteL(ECustomSetDriveModeIPC, KErrNone, 20);
       
   527     
       
   528     customAPI.SetDriveMode(requestStatus, modeStatus);
       
   529                 
       
   530     
       
   531     
       
   532     customAPI2.SetDriveMode(requestStatus2, modeStatus2); 	
       
   533  	
       
   534  	
       
   535  	// wait for the first answer
       
   536  	User::WaitForRequest(requestStatus);		
       
   537 	ASSERT_EQUALS(KErrNone, requestStatus.Int());		
       
   538 	
       
   539 	// wait for the second answer
       
   540  	User::WaitForRequest(requestStatus2);
       
   541  	// Documentation says that KErrServerBusy should be in case of multiple requests
       
   542 	ASSERT_EQUALS(KErrServerBusy, requestStatus2.Int());	
       
   543 	
       
   544 	AssertMockLtsyStatusL();
       
   545 
       
   546 	CleanupStack::PopAndDestroy(8, this); 
       
   547 
       
   548 	}
       
   549 
       
   550 
       
   551 /**
       
   552 @SYMTestCaseID BA-CTSY-CIPC-MCSDM-0005
       
   553 @SYMComponent  telephony_ctsy
       
   554 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::SetDriveMode with timeout
       
   555 @SYMTestPriority High
       
   556 @SYMTestActions Invokes RMmCustomAPI::SetDriveMode and tests for timeout
       
   557 @SYMTestExpectedResults Pass
       
   558 @SYMTestType CT
       
   559 */
       
   560 void CCTsyCustomIPCFU::TestSetDriveMode0005L()
       
   561 	{
       
   562 
       
   563 	OpenEtelServerL(EUseExtendedError);
       
   564 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
   565 	OpenPhoneL();
       
   566 
       
   567 	RBuf8 expectData;
       
   568 	CleanupClosePushL(expectData);
       
   569 	
       
   570 	RMmCustomAPI customAPI;
       
   571 	OpenCustomAPILC(customAPI, iPhone);
       
   572 	
       
   573 	
       
   574 	TRequestStatus requestStatus;	
       
   575 	RMmCustomAPI::TSetDriveMode modeStatus(RMmCustomAPI::EActivateDriveMode); 
       
   576 
       
   577 	//-------------------------------------------------------------------------
       
   578 	// Test A: Test timeout of RMmCustomAPI::SetDriveMode
       
   579  	//-------------------------------------------------------------------------
       
   580 
       
   581 	// data for ExpectL
       
   582 	TMockLtsyData1< RMmCustomAPI::TSetDriveMode > ltsyData(modeStatus);	
       
   583     ltsyData.SerialiseL(expectData);	    
       
   584     iMockLTSY.ExpectL(ECustomSetDriveModeIPC, expectData); 
       
   585     
       
   586     customAPI.SetDriveMode(requestStatus, modeStatus);
       
   587 		
       
   588 	User::WaitForRequest(requestStatus);	
       
   589 	ASSERT_EQUALS(KErrTimedOut, requestStatus.Int());
       
   590 
       
   591 	AssertMockLtsyStatusL();
       
   592 
       
   593 	CleanupStack::PopAndDestroy(3, this); 
       
   594 
       
   595 	}
       
   596 
       
   597 
       
   598 /**
       
   599 @SYMTestCaseID BA-CTSY-CIPC-MCASL-0001
       
   600 @SYMComponent  telephony_ctsy
       
   601 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::ActivateSimLock
       
   602 @SYMTestPriority High
       
   603 @SYMTestActions Invokes RMmCustomAPI::ActivateSimLock
       
   604 @SYMTestExpectedResults Pass
       
   605 @SYMTestType CT
       
   606 */
       
   607 void CCTsyCustomIPCFU::TestActivateSimLock0001L()
       
   608 	{
       
   609 
       
   610 	OpenEtelServerL(EUseExtendedError);
       
   611 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
   612 	OpenPhoneL();
       
   613 
       
   614 	RBuf8 expectData;
       
   615 	CleanupClosePushL(expectData);
       
   616 	
       
   617 	RMmCustomAPI customAPI;
       
   618 	OpenCustomAPILC(customAPI, iPhone);
       
   619 	
       
   620 	
       
   621 	TRequestStatus requestStatus;	
       
   622 	 
       
   623  	//-------------------------------------------------------------------------
       
   624 	// TEST A: failure to dispatch request to LTSY
       
   625  	//-------------------------------------------------------------------------
       
   626 	RMmCustomAPI::TSimLockPassword password(_L("changeme"));
       
   627 	RMmCustomAPI::TLockNumber lockNumber(RMmCustomAPI::EOperator);	
       
   628 	
       
   629 	// data for ExpectL
       
   630 	TMockLtsyData2< RMmCustomAPI::TSimLockPassword, RMmCustomAPI::TLockNumber > 
       
   631 									ltsyData(password, lockNumber);	    
       
   632     ltsyData.SerialiseL(expectData);    	    
       
   633     iMockLTSY.ExpectL(ECustomSimLockActivateIPC, expectData, KErrNotSupported);
       
   634     
       
   635 	customAPI.ActivateSimLock(requestStatus, password, lockNumber);
       
   636 	
       
   637 	User::WaitForRequest(requestStatus);	
       
   638 	
       
   639 	ASSERT_EQUALS(KErrNotSupported, requestStatus.Int());
       
   640 	AssertMockLtsyStatusL();
       
   641 
       
   642 	//-------------------------------------------------------------------------
       
   643 	// TEST B: failure on completion of pending request from LTSY->CTSY
       
   644  	//-------------------------------------------------------------------------	
       
   645 
       
   646 	// use othere number for coverage increasing
       
   647 	lockNumber = RMmCustomAPI::EGid1;
       
   648 	
       
   649 	// data for ExpectL
       
   650 	expectData.Close();
       
   651     ltsyData.SerialiseL(expectData);    	    
       
   652     iMockLTSY.ExpectL(ECustomSimLockActivateIPC, expectData);
       
   653     iMockLTSY.CompleteL(ECustomSimLockActivateIPC, KErrGeneral);
       
   654 	
       
   655 	customAPI.ActivateSimLock(requestStatus, password, lockNumber);
       
   656 	
       
   657 	User::WaitForRequest(requestStatus);	
       
   658 	ASSERT_EQUALS(KErrGeneral, requestStatus.Int());
       
   659 	AssertMockLtsyStatusL();
       
   660 
       
   661  	//-------------------------------------------------------------------------
       
   662 	// TEST C: Successful completion request of
       
   663 	// RMmCustomAPI::ActivateSimLock when result is not cached.
       
   664  	//-------------------------------------------------------------------------
       
   665 	// use othere number for coverage increasing
       
   666 	lockNumber = RMmCustomAPI::EGid2;
       
   667 	
       
   668 	// data for ExpectL 
       
   669 	expectData.Close();
       
   670     ltsyData.SerialiseL(expectData);    	    
       
   671        
       
   672     iMockLTSY.ExpectL(ECustomSimLockActivateIPC, expectData);
       
   673     iMockLTSY.CompleteL(ECustomSimLockActivateIPC, KErrNone);
       
   674 	
       
   675 	customAPI.ActivateSimLock(requestStatus, password, lockNumber);
       
   676 	
       
   677 	User::WaitForRequest(requestStatus);	
       
   678 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
   679 	AssertMockLtsyStatusL();
       
   680 
       
   681  	//-------------------------------------------------------------------------
       
   682 	// TEST E: Unsolicited completion of RMmCustomAPI::ActivateSimLock
       
   683 	// from LTSY.
       
   684  	//-------------------------------------------------------------------------
       
   685 
       
   686 	TRequestStatus mockLtsyStatus;
       
   687 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
   688 	iMockLTSY.CompleteL(ECustomSimLockActivateIPC, KErrNone);
       
   689 	User::WaitForRequest(mockLtsyStatus);
       
   690 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());	
       
   691 	AssertMockLtsyStatusL();
       
   692 	
       
   693 	
       
   694 	//-------------------------------------------------------------------------
       
   695 	// just to increase coverage
       
   696 	//-------------------------------------------------------------------------	
       
   697 	// use othere number for coverage increasing
       
   698 	lockNumber = RMmCustomAPI::EImsi;
       
   699 	
       
   700 	// data for ExpectL	    
       
   701 	expectData.Close();
       
   702     ltsyData.SerialiseL(expectData);    	    
       
   703        
       
   704     iMockLTSY.ExpectL(ECustomSimLockActivateIPC, expectData);
       
   705     iMockLTSY.CompleteL(ECustomSimLockActivateIPC, KErrNone);
       
   706 	
       
   707 	customAPI.ActivateSimLock(requestStatus, password, lockNumber);
       
   708 	
       
   709 	User::WaitForRequest(requestStatus);	
       
   710 	ASSERT_EQUALS(KErrNone, requestStatus.Int());	
       
   711 	
       
   712 	AssertMockLtsyStatusL();
       
   713 	
       
   714 	CleanupStack::PopAndDestroy(3, this); 
       
   715 	
       
   716 	}
       
   717 
       
   718 
       
   719 /**
       
   720 @SYMTestCaseID BA-CTSY-CIPC-MCASL-0002
       
   721 @SYMComponent  telephony_ctsy
       
   722 @SYMTestCaseDesc Test support in CTSY for cancelling of RMmCustomAPI::ActivateSimLock
       
   723 @SYMTestPriority High
       
   724 @SYMTestActions Invokes cancelling of RMmCustomAPI::ActivateSimLock
       
   725 @SYMTestExpectedResults Pass
       
   726 @SYMTestType CT
       
   727 */
       
   728 void CCTsyCustomIPCFU::TestActivateSimLock0002L()
       
   729 	{
       
   730 
       
   731 	OpenEtelServerL(EUseExtendedError);
       
   732 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
   733 	OpenPhoneL();
       
   734 
       
   735 	RBuf8 expectData;
       
   736 	CleanupClosePushL(expectData);
       
   737 	
       
   738 	RMmCustomAPI customAPI;
       
   739 	OpenCustomAPILC(customAPI, iPhone);
       
   740 	
       
   741 	TRequestStatus mockLtsyStatus;
       
   742 	// to wait CompleteL
       
   743 	iMockLTSY.NotifyTerminated(mockLtsyStatus);	
       
   744 
       
   745 	TRequestStatus requestStatus;
       
   746  	//-------------------------------------------------------------------------
       
   747 	// Test cancelling of RMmCustomAPI::ActivateSimLock
       
   748  	//-------------------------------------------------------------------------
       
   749  	RMmCustomAPI::TSimLockPassword password(_L("changeme"));
       
   750 	RMmCustomAPI::TLockNumber lockNumber(RMmCustomAPI::EImsi);	
       
   751 	
       
   752 	// data for ExpectL
       
   753 	TMockLtsyData2< RMmCustomAPI::TSimLockPassword, RMmCustomAPI::TLockNumber > 
       
   754 									ltsyData(password, lockNumber);	    
       
   755     ltsyData.SerialiseL(expectData);    	    
       
   756     iMockLTSY.ExpectL(ECustomSimLockActivateIPC, expectData);
       
   757 	
       
   758 	customAPI.ActivateSimLock(requestStatus, password, lockNumber);
       
   759 	// cancel this request
       
   760 	customAPI.CancelAsyncRequest(ECustomSimLockActivateIPC);
       
   761 	// try to complete canceled request
       
   762 	iMockLTSY.CompleteL(ECustomSimLockActivateIPC, KErrNone);		
       
   763 			
       
   764 	// wait for request
       
   765 	User::WaitForRequest(requestStatus);
       
   766 	// this request can't be canceled 
       
   767 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
   768 	
       
   769 	// wait for CompleteL
       
   770 	User::WaitForRequest(mockLtsyStatus);
       
   771 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
   772 	
       
   773 	AssertMockLtsyStatusL();
       
   774 	CleanupStack::PopAndDestroy(3, this); 	
       
   775 	}
       
   776 
       
   777 
       
   778 /**
       
   779 @SYMTestCaseID BA-CTSY-CIPC-MCASL-0003
       
   780 @SYMComponent  telephony_ctsy
       
   781 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::ActivateSimLock with bad parameter data
       
   782 @SYMTestPriority High
       
   783 @SYMTestActions Invokes RMmCustomAPI::ActivateSimLock with bad parameter data
       
   784 @SYMTestExpectedResults Pass
       
   785 @SYMTestType CT
       
   786 */
       
   787 void CCTsyCustomIPCFU::TestActivateSimLock0003L()
       
   788 	{
       
   789 
       
   790 	OpenEtelServerL(EUseExtendedError);
       
   791 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
   792 	OpenPhoneL();
       
   793 
       
   794 	RBuf8 expectData;
       
   795 	CleanupClosePushL(expectData);
       
   796 	
       
   797 	RMmCustomAPI customAPI;
       
   798 	OpenCustomAPILC(customAPI, iPhone);
       
   799 	
       
   800 	TRequestStatus requestStatus;	
       
   801 
       
   802 	//-------------------------------------------------------------------------
       
   803 	// Test A: Test passing wrong parameters to
       
   804 	// RMmCustomAPI::ActivateSimLock
       
   805  	//-------------------------------------------------------------------------
       
   806 	RMmCustomAPI::TSimLockPassword password(_L("changeme"));
       
   807 	RMmCustomAPI::TLockNumber lockNumber((RMmCustomAPI::TLockNumber) 0); 	
       
   808 	  
       
   809     customAPI.ActivateSimLock(requestStatus, password, lockNumber);
       
   810 	
       
   811 	User::WaitForRequest(requestStatus);	
       
   812 	ASSERT_EQUALS(KErrArgument, requestStatus.Int());
       
   813 	AssertMockLtsyStatusL();
       
   814 	
       
   815 	CleanupStack::PopAndDestroy(3, this); 
       
   816 
       
   817 	}
       
   818 
       
   819 
       
   820 /**
       
   821 @SYMTestCaseID BA-CTSY-CIPC-MCASL-0004
       
   822 @SYMComponent  telephony_ctsy
       
   823 @SYMTestCaseDesc Test support in CTSY for multiple client requests to RMmCustomAPI::ActivateSimLock
       
   824 @SYMTestPriority High
       
   825 @SYMTestActions Invokes multiple client requests to RMmCustomAPI::ActivateSimLock
       
   826 @SYMTestExpectedResults Pass
       
   827 @SYMTestType CT
       
   828 */
       
   829 void CCTsyCustomIPCFU::TestActivateSimLock0004L()
       
   830 	{
       
   831 					
       
   832 	OpenEtelServerL(EUseExtendedError);
       
   833 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
   834 	OpenPhoneL();
       
   835 	
       
   836 	RBuf8 expectData;
       
   837 	CleanupClosePushL(expectData);
       
   838 
       
   839 	// Open second client
       
   840 	RTelServer telServer2;
       
   841 	TInt ret = telServer2.Connect();
       
   842 	ASSERT_EQUALS(KErrNone, ret);
       
   843 	CleanupClosePushL(telServer2);
       
   844 
       
   845 	RMobilePhone phone2;
       
   846 	ret = phone2.Open(telServer2,KMmTsyPhoneName);
       
   847 	ASSERT_EQUALS(KErrNone, ret);
       
   848 	CleanupClosePushL(phone2);
       
   849 	
       
   850 	RMmCustomAPI customAPI;
       
   851 	OpenCustomAPILC(customAPI, iPhone);
       
   852 	
       
   853 	RMmCustomAPI customAPI2;
       
   854 	OpenCustomAPILC(customAPI2, phone2, EFalse);
       
   855 	
       
   856 	TRequestStatus requestStatus;
       
   857 	TRequestStatus requestStatus2;
       
   858 
       
   859 	//-------------------------------------------------------------------------
       
   860 	// Test A: Test multiple clients requesting RMmCustomAPI::ActivateSimLock
       
   861  	//-------------------------------------------------------------------------	
       
   862 	// data for the first request
       
   863 	RMmCustomAPI::TSimLockPassword password(_L("changeme"));
       
   864 	RMmCustomAPI::TLockNumber lockNumber(RMmCustomAPI::EOperator_Gid1);	
       
   865 	
       
   866 	// data for the second request
       
   867 	RMmCustomAPI::TSimLockPassword password2(_L("changeme2"));
       
   868 	RMmCustomAPI::TLockNumber lockNumber2(RMmCustomAPI::EOperator_Gid2);	
       
   869 	
       
   870 	// data for the first ExpectL
       
   871 	TMockLtsyData2< RMmCustomAPI::TSimLockPassword, RMmCustomAPI::TLockNumber > ltsyData(password, lockNumber);	    
       
   872     ltsyData.SerialiseL(expectData);       
       
   873   		
       
   874 	// send first request
       
   875 	iMockLTSY.ExpectL(ECustomSimLockActivateIPC, expectData);
       
   876     iMockLTSY.CompleteL(ECustomSimLockActivateIPC, KErrNone);	
       
   877 	customAPI.ActivateSimLock(requestStatus, password, lockNumber);
       
   878 		
       
   879 	// send second request
       
   880 	customAPI2.ActivateSimLock(requestStatus2, password2, lockNumber2);
       
   881 	
       
   882 	// wait for the first answer
       
   883 	User::WaitForRequest(requestStatus);	
       
   884 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
   885 	
       
   886 	// wait for the second answer
       
   887 	User::WaitForRequest(requestStatus2);	
       
   888 	ASSERT_EQUALS(KErrServerBusy, requestStatus2.Int());		
       
   889 	
       
   890 	AssertMockLtsyStatusL();
       
   891 	// Done !
       
   892 	CleanupStack::PopAndDestroy(6, this); 
       
   893 
       
   894 	}
       
   895 
       
   896 
       
   897 /**
       
   898 @SYMTestCaseID BA-CTSY-CIPC-MCASL-0005
       
   899 @SYMComponent  telephony_ctsy
       
   900 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::ActivateSimLock with timeout
       
   901 @SYMTestPriority High
       
   902 @SYMTestActions Invokes RMmCustomAPI::ActivateSimLock and tests for timeout
       
   903 @SYMTestExpectedResults Pass
       
   904 @SYMTestType CT
       
   905 */
       
   906 void CCTsyCustomIPCFU::TestActivateSimLock0005L()
       
   907 	{
       
   908 
       
   909 	OpenEtelServerL(EUseExtendedError);
       
   910 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
   911 	OpenPhoneL();
       
   912 
       
   913 	RBuf8 expectData;
       
   914 	CleanupClosePushL(expectData);
       
   915 	
       
   916 	RMmCustomAPI customAPI;
       
   917 	OpenCustomAPILC(customAPI, iPhone);
       
   918 	
       
   919 	TRequestStatus requestStatus;
       
   920 
       
   921 	//-------------------------------------------------------------------------
       
   922 	// Test A: Test timeout of RMmCustomAPI::ActivateSimLock
       
   923  	//-------------------------------------------------------------------------
       
   924  	RMmCustomAPI::TSimLockPassword password(_L("changeme"));
       
   925 	RMmCustomAPI::TLockNumber lockNumber(RMmCustomAPI::EOperator_Gid2);	
       
   926 	
       
   927 	// data for ExpectL
       
   928 	TMockLtsyData2< RMmCustomAPI::TSimLockPassword, RMmCustomAPI::TLockNumber > 
       
   929 									ltsyData(password, lockNumber);	    
       
   930     ltsyData.SerialiseL(expectData);    	    
       
   931     iMockLTSY.ExpectL(ECustomSimLockActivateIPC, expectData);
       
   932     
       
   933 	customAPI.ActivateSimLock(requestStatus, password, lockNumber);
       
   934 	
       
   935 	User::WaitForRequest(requestStatus);	
       
   936 	ASSERT_EQUALS(KErrTimedOut, requestStatus.Int());
       
   937 	
       
   938 	AssertMockLtsyStatusL();
       
   939 	
       
   940 	// Done !
       
   941 	CleanupStack::PopAndDestroy(3, this); 
       
   942 
       
   943 	}
       
   944 
       
   945 
       
   946 /**
       
   947 @SYMTestCaseID BA-CTSY-CIPC-MCDASL-0001
       
   948 @SYMComponent  telephony_ctsy
       
   949 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::DeActivateSimLock
       
   950 @SYMTestPriority High
       
   951 @SYMTestActions Invokes RMmCustomAPI::DeActivateSimLock
       
   952 @SYMTestExpectedResults Pass
       
   953 @SYMTestType CT
       
   954 */
       
   955 void CCTsyCustomIPCFU::TestDeActivateSimLock0001L()
       
   956 	{
       
   957 
       
   958 	OpenEtelServerL(EUseExtendedError);
       
   959 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
   960 	OpenPhoneL();
       
   961 
       
   962 	RBuf8 expectData;
       
   963 	CleanupClosePushL(expectData);
       
   964 	
       
   965 	RMmCustomAPI customAPI;
       
   966 	OpenCustomAPILC(customAPI, iPhone);
       
   967 	
       
   968 	
       
   969 	TRequestStatus requestStatus;	
       
   970 	
       
   971  	//-------------------------------------------------------------------------
       
   972 	// TEST A: failure to dispatch request to LTSY
       
   973  	//-------------------------------------------------------------------------
       
   974 	RMmCustomAPI::TSimLockPassword password(_L("changeme"));
       
   975 	RMmCustomAPI::TLockNumber lockNumber(RMmCustomAPI::EOperator);	
       
   976 	
       
   977 	// data for ExpectL
       
   978 	TMockLtsyData2< RMmCustomAPI::TSimLockPassword, RMmCustomAPI::TLockNumber > 
       
   979 									ltsyData(password, lockNumber);	    
       
   980     ltsyData.SerialiseL(expectData);    	    
       
   981     iMockLTSY.ExpectL(ECustomSimLockDeActivateIPC, expectData, KErrNotSupported);
       
   982     
       
   983 	customAPI.DeActivateSimLock(requestStatus, password, lockNumber);
       
   984 	
       
   985 	User::WaitForRequest(requestStatus);	
       
   986 	ASSERT_EQUALS(KErrNotSupported, requestStatus.Int());
       
   987 	AssertMockLtsyStatusL();
       
   988 
       
   989 	//-------------------------------------------------------------------------
       
   990 	// TEST B: failure on completion of pending request from LTSY->CTSY
       
   991  	//-------------------------------------------------------------------------	
       
   992 	// use othere number for coverage increasing
       
   993 	lockNumber = RMmCustomAPI::EGid1;
       
   994 	
       
   995 	// data for ExpectL  
       
   996 	expectData.Close();
       
   997     ltsyData.SerialiseL(expectData);    	    
       
   998     iMockLTSY.ExpectL(ECustomSimLockDeActivateIPC, expectData);
       
   999     iMockLTSY.CompleteL(ECustomSimLockDeActivateIPC, KErrGeneral);
       
  1000 	
       
  1001 	customAPI.DeActivateSimLock(requestStatus, password, lockNumber);
       
  1002 	
       
  1003 	User::WaitForRequest(requestStatus);	
       
  1004 	ASSERT_EQUALS(KErrGeneral, requestStatus.Int());
       
  1005 	AssertMockLtsyStatusL();
       
  1006 
       
  1007  	//-------------------------------------------------------------------------
       
  1008 	// TEST C: Successful completion request of
       
  1009 	// RMmCustomAPI::DeActivateSimLock when result is not cached.
       
  1010  	//-------------------------------------------------------------------------
       
  1011 	// use othere number for coverage increasing
       
  1012 	lockNumber = RMmCustomAPI::EGid2;
       
  1013 	
       
  1014 	// data for ExpectL
       
  1015 	expectData.Close();
       
  1016     ltsyData.SerialiseL(expectData);    	    
       
  1017        
       
  1018     iMockLTSY.ExpectL(ECustomSimLockDeActivateIPC, expectData);
       
  1019     iMockLTSY.CompleteL(ECustomSimLockDeActivateIPC, KErrNone);
       
  1020 	
       
  1021 	customAPI.DeActivateSimLock(requestStatus, password, lockNumber);
       
  1022 	
       
  1023 	User::WaitForRequest(requestStatus);	
       
  1024 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
  1025 	AssertMockLtsyStatusL();
       
  1026 
       
  1027  	//-------------------------------------------------------------------------
       
  1028 	// TEST E: Unsolicited completion of RMmCustomAPI::DeActivateSimLock
       
  1029 	// from LTSY.
       
  1030  	//-------------------------------------------------------------------------
       
  1031 	TRequestStatus mockLtsyStatus;
       
  1032 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
  1033 	iMockLTSY.CompleteL(ECustomSimLockDeActivateIPC, KErrNone);
       
  1034 	User::WaitForRequest(mockLtsyStatus);
       
  1035 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
  1036 	AssertMockLtsyStatusL();
       
  1037 	
       
  1038 	//-------------------------------------------------------------------------
       
  1039 	// just to increase coverage
       
  1040 	//-------------------------------------------------------------------------	
       
  1041 	// use othere number for coverage increasing
       
  1042 	lockNumber = RMmCustomAPI::EGlobalUnlock;
       
  1043 	
       
  1044 	// data for ExpectL	    
       
  1045 	expectData.Close();
       
  1046     ltsyData.SerialiseL(expectData);    	    
       
  1047        
       
  1048     iMockLTSY.ExpectL(ECustomSimLockDeActivateIPC, expectData);
       
  1049     iMockLTSY.CompleteL(ECustomSimLockDeActivateIPC, KErrNone);
       
  1050 	
       
  1051 	customAPI.DeActivateSimLock(requestStatus, password, lockNumber);
       
  1052 	
       
  1053 	User::WaitForRequest(requestStatus);	
       
  1054 	ASSERT_EQUALS(KErrNone, requestStatus.Int());	
       
  1055 	AssertMockLtsyStatusL();
       
  1056 	
       
  1057 	//-------------------------------------------------------------------------
       
  1058 	// just to increase coverage
       
  1059 	//-------------------------------------------------------------------------	
       
  1060 	// use othere number for coverage increasing
       
  1061 	lockNumber = RMmCustomAPI::EImsi;
       
  1062 	
       
  1063 	// data for ExpectL	    
       
  1064 	expectData.Close();
       
  1065     ltsyData.SerialiseL(expectData);    	    
       
  1066        
       
  1067     iMockLTSY.ExpectL(ECustomSimLockDeActivateIPC, expectData);
       
  1068     iMockLTSY.CompleteL(ECustomSimLockDeActivateIPC, KErrNone);
       
  1069 	
       
  1070 	customAPI.DeActivateSimLock(requestStatus, password, lockNumber);
       
  1071 	
       
  1072 	User::WaitForRequest(requestStatus);	
       
  1073 	ASSERT_EQUALS(KErrNone, requestStatus.Int());	
       
  1074 	
       
  1075 	
       
  1076 	AssertMockLtsyStatusL();
       
  1077 	CleanupStack::PopAndDestroy(3, this); 
       
  1078 	
       
  1079 	}
       
  1080 
       
  1081 
       
  1082 /**
       
  1083 @SYMTestCaseID BA-CTSY-CIPC-MCDASL-0002
       
  1084 @SYMComponent  telephony_ctsy
       
  1085 @SYMTestCaseDesc Test support in CTSY for cancelling of RMmCustomAPI::DeActivateSimLock
       
  1086 @SYMTestPriority High
       
  1087 @SYMTestActions Invokes cancelling of RMmCustomAPI::DeActivateSimLock
       
  1088 @SYMTestExpectedResults Pass
       
  1089 @SYMTestType CT
       
  1090 */
       
  1091 void CCTsyCustomIPCFU::TestDeActivateSimLock0002L()
       
  1092 	{
       
  1093 
       
  1094 	OpenEtelServerL(EUseExtendedError);
       
  1095 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  1096 	OpenPhoneL();
       
  1097 
       
  1098 	RBuf8 expectData;
       
  1099 	CleanupClosePushL(expectData);
       
  1100 	
       
  1101 	RMmCustomAPI customAPI;
       
  1102 	OpenCustomAPILC(customAPI, iPhone);
       
  1103 
       
  1104 	
       
  1105 	TRequestStatus mockLtsyStatus;
       
  1106 	// to wait CompleteL
       
  1107 	iMockLTSY.NotifyTerminated(mockLtsyStatus);	
       
  1108 
       
  1109 	TRequestStatus requestStatus;
       
  1110  	//-------------------------------------------------------------------------
       
  1111 	// Test cancelling of RMmCustomAPI::DeActivateSimLock
       
  1112  	//-------------------------------------------------------------------------
       
  1113  	RMmCustomAPI::TSimLockPassword password(_L("changeme"));
       
  1114 	RMmCustomAPI::TLockNumber lockNumber(RMmCustomAPI::EImsi);	
       
  1115 	
       
  1116 	// data for ExpectL
       
  1117 	TMockLtsyData2< RMmCustomAPI::TSimLockPassword, RMmCustomAPI::TLockNumber > 
       
  1118 									ltsyData(password, lockNumber);	    
       
  1119     ltsyData.SerialiseL(expectData);    	    
       
  1120     iMockLTSY.ExpectL(ECustomSimLockDeActivateIPC, expectData);
       
  1121 	
       
  1122 	customAPI.DeActivateSimLock(requestStatus, password, lockNumber);
       
  1123 	// cancel this request
       
  1124 	customAPI.CancelAsyncRequest(ECustomSimLockDeActivateIPC);
       
  1125 	// try to complete canceled request
       
  1126 	iMockLTSY.CompleteL(ECustomSimLockDeActivateIPC, KErrNone);		
       
  1127 			
       
  1128 	// wait for request
       
  1129 	User::WaitForRequest(requestStatus);
       
  1130 	// this request can't be canceled 
       
  1131 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
  1132 	
       
  1133 	// wait for CompleteL
       
  1134 	User::WaitForRequest(mockLtsyStatus);
       
  1135 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
  1136 
       
  1137 	AssertMockLtsyStatusL();
       
  1138 	CleanupStack::PopAndDestroy(3, this); 	
       
  1139 	
       
  1140 	}
       
  1141 
       
  1142 
       
  1143 /**
       
  1144 @SYMTestCaseID BA-CTSY-CIPC-MCDASL-0003
       
  1145 @SYMComponent  telephony_ctsy
       
  1146 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::DeActivateSimLock with bad parameter data
       
  1147 @SYMTestPriority High
       
  1148 @SYMTestActions Invokes RMmCustomAPI::DeActivateSimLock with bad parameter data
       
  1149 @SYMTestExpectedResults Pass
       
  1150 @SYMTestType CT
       
  1151 */
       
  1152 void CCTsyCustomIPCFU::TestDeActivateSimLock0003L()
       
  1153 	{
       
  1154 
       
  1155 	OpenEtelServerL(EUseExtendedError);
       
  1156 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  1157 	OpenPhoneL();
       
  1158 
       
  1159 	RBuf8 expectData;
       
  1160 	CleanupClosePushL(expectData);
       
  1161 	
       
  1162 	RMmCustomAPI customAPI;
       
  1163 	OpenCustomAPILC(customAPI, iPhone);
       
  1164 	
       
  1165 	TRequestStatus requestStatus;	
       
  1166 
       
  1167 	//-------------------------------------------------------------------------
       
  1168 	// Test A: Test passing wrong version of parameters to
       
  1169 	// RMmCustomAPI::DeActivateSimLock
       
  1170  	//-------------------------------------------------------------------------
       
  1171 	RMmCustomAPI::TSimLockPassword password(_L("changeme"));
       
  1172 	RMmCustomAPI::TLockNumber lockNumber((RMmCustomAPI::TLockNumber) 0); 	
       
  1173 	  
       
  1174     customAPI.DeActivateSimLock(requestStatus, password, lockNumber);
       
  1175 	
       
  1176 	User::WaitForRequest(requestStatus);	
       
  1177 	ASSERT_EQUALS(KErrArgument, requestStatus.Int());
       
  1178 	AssertMockLtsyStatusL();
       
  1179 	
       
  1180 	CleanupStack::PopAndDestroy(3, this);
       
  1181 
       
  1182 	}
       
  1183 
       
  1184 
       
  1185 /**
       
  1186 @SYMTestCaseID BA-CTSY-CIPC-MCDASL-0004
       
  1187 @SYMComponent  telephony_ctsy
       
  1188 @SYMTestCaseDesc Test support in CTSY for multiple client requests to RMmCustomAPI::DeActivateSimLock
       
  1189 @SYMTestPriority High
       
  1190 @SYMTestActions Invokes multiple client requests to RMmCustomAPI::DeActivateSimLock
       
  1191 @SYMTestExpectedResults Pass
       
  1192 @SYMTestType CT
       
  1193 */
       
  1194 void CCTsyCustomIPCFU::TestDeActivateSimLock0004L()
       
  1195 	{
       
  1196 					
       
  1197 	OpenEtelServerL(EUseExtendedError);
       
  1198 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  1199 	OpenPhoneL();
       
  1200 	
       
  1201 	RBuf8 expectData;
       
  1202 	CleanupClosePushL(expectData);
       
  1203 
       
  1204 	// Open second client
       
  1205 	RTelServer telServer2;
       
  1206 	TInt ret = telServer2.Connect();
       
  1207 	ASSERT_EQUALS(KErrNone, ret);
       
  1208 	CleanupClosePushL(telServer2);
       
  1209 
       
  1210 	RMobilePhone phone2;
       
  1211 	ret = phone2.Open(telServer2,KMmTsyPhoneName);
       
  1212 	ASSERT_EQUALS(KErrNone, ret);
       
  1213 	CleanupClosePushL(phone2);
       
  1214 	
       
  1215 	RMmCustomAPI customAPI;
       
  1216 	OpenCustomAPILC(customAPI, iPhone);
       
  1217 	
       
  1218 	RMmCustomAPI customAPI2;
       
  1219 	OpenCustomAPILC(customAPI2, phone2, EFalse);
       
  1220 	
       
  1221 	TRequestStatus requestStatus;
       
  1222 	TRequestStatus requestStatus2;
       
  1223 
       
  1224 	//-------------------------------------------------------------------------
       
  1225 	// Test A: Test multiple clients requesting RMmCustomAPI::DeActivateSimLock
       
  1226  	//-------------------------------------------------------------------------	
       
  1227 	// data for the first request
       
  1228 	RMmCustomAPI::TSimLockPassword password(_L("changeme"));
       
  1229 	RMmCustomAPI::TLockNumber lockNumber(RMmCustomAPI::EOperator_Gid1);	
       
  1230 	
       
  1231 	// data for the second request
       
  1232 	RMmCustomAPI::TSimLockPassword password2(_L("changeme2"));
       
  1233 	RMmCustomAPI::TLockNumber lockNumber2(RMmCustomAPI::EOperator_Gid2);	
       
  1234 	
       
  1235 	// data for the first ExpectL
       
  1236 	TMockLtsyData2< RMmCustomAPI::TSimLockPassword, RMmCustomAPI::TLockNumber > ltsyData(password, lockNumber);	    
       
  1237     ltsyData.SerialiseL(expectData);       
       
  1238   		
       
  1239 	// send first request
       
  1240 	iMockLTSY.ExpectL(ECustomSimLockDeActivateIPC, expectData);
       
  1241     iMockLTSY.CompleteL(ECustomSimLockDeActivateIPC, KErrNone);	
       
  1242 	customAPI.DeActivateSimLock(requestStatus, password, lockNumber);
       
  1243 		
       
  1244 	// send second request
       
  1245 	customAPI2.DeActivateSimLock(requestStatus2, password2, lockNumber2);
       
  1246 	
       
  1247 	// wait for the first answer
       
  1248 	User::WaitForRequest(requestStatus);	
       
  1249 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
  1250 	
       
  1251 	// wait for the second answer
       
  1252 	User::WaitForRequest(requestStatus2);	
       
  1253 	ASSERT_EQUALS(KErrServerBusy, requestStatus2.Int());		
       
  1254 	
       
  1255 	AssertMockLtsyStatusL();
       
  1256 	// Done !
       
  1257 	CleanupStack::PopAndDestroy(6, this); 
       
  1258 
       
  1259 	}
       
  1260 
       
  1261 
       
  1262 /**
       
  1263 @SYMTestCaseID BA-CTSY-CIPC-MCDASL-0005
       
  1264 @SYMComponent  telephony_ctsy
       
  1265 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::DeActivateSimLock with timeout
       
  1266 @SYMTestPriority High
       
  1267 @SYMTestActions Invokes RMmCustomAPI::DeActivateSimLock and tests for timeout
       
  1268 @SYMTestExpectedResults Pass
       
  1269 @SYMTestType CT
       
  1270 */
       
  1271 void CCTsyCustomIPCFU::TestDeActivateSimLock0005L()
       
  1272 	{
       
  1273 
       
  1274 	OpenEtelServerL(EUseExtendedError);
       
  1275 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  1276 	OpenPhoneL();
       
  1277 
       
  1278 	RBuf8 expectData;
       
  1279 	CleanupClosePushL(expectData);
       
  1280 	
       
  1281 	RMmCustomAPI customAPI;
       
  1282 	OpenCustomAPILC(customAPI, iPhone);
       
  1283 	
       
  1284 	TRequestStatus requestStatus;
       
  1285 
       
  1286 	//-------------------------------------------------------------------------
       
  1287 	// Test A: Test timeout of RMmCustomAPI::DeActivateSimLock
       
  1288  	//-------------------------------------------------------------------------
       
  1289  	RMmCustomAPI::TSimLockPassword password(_L("changeme"));
       
  1290 	RMmCustomAPI::TLockNumber lockNumber(RMmCustomAPI::EOperator_Gid2);	
       
  1291 	
       
  1292 	// data for ExpectL
       
  1293 	TMockLtsyData2< RMmCustomAPI::TSimLockPassword, RMmCustomAPI::TLockNumber > 
       
  1294 									ltsyData(password, lockNumber);	    
       
  1295     ltsyData.SerialiseL(expectData);    	    
       
  1296     iMockLTSY.ExpectL(ECustomSimLockDeActivateIPC, expectData);
       
  1297     
       
  1298 	customAPI.DeActivateSimLock(requestStatus, password, lockNumber);
       
  1299 	
       
  1300 	User::WaitForRequest(requestStatus);	
       
  1301 	ASSERT_EQUALS(KErrTimedOut, requestStatus.Int());
       
  1302 	
       
  1303 	AssertMockLtsyStatusL();
       
  1304 	
       
  1305 	// Done !
       
  1306 	CleanupStack::PopAndDestroy(3, this); 
       
  1307 	}
       
  1308 
       
  1309 
       
  1310 /**
       
  1311 @SYMTestCaseID BA-CTSY-CIPC-MCNDE-0001
       
  1312 @SYMComponent  telephony_ctsy
       
  1313 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::NotifyDtmfEvent
       
  1314 @SYMTestPriority High
       
  1315 @SYMTestActions Invokes RMmCustomAPI::NotifyDtmfEvent
       
  1316 @SYMTestExpectedResults Pass
       
  1317 @SYMTestType CT
       
  1318 */
       
  1319 void CCTsyCustomIPCFU::TestNotifyDtmfEvent0001L()
       
  1320 	{
       
  1321 
       
  1322 	OpenEtelServerL(EUseExtendedError);
       
  1323 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  1324 	OpenPhoneL();
       
  1325 
       
  1326 	RBuf8 completeData;
       
  1327 	CleanupClosePushL(completeData);
       
  1328 	
       
  1329 	RMmCustomAPI customAPI;
       
  1330 	OpenCustomAPILC(customAPI, iPhone);
       
  1331 	
       
  1332 	// data for CompleteL
       
  1333 	RMmCustomAPI::TDtmfInfo completeInfo;
       
  1334 	completeInfo.iType  = RMmCustomAPI::EDtmfSequence;	
       
  1335 	completeInfo.iEvent = RMmCustomAPI::EDtmfStop;
       
  1336 	completeInfo.iTone = 0x10;
       
  1337 	TMockLtsyData1 <RMmCustomAPI::TDtmfInfo> ltsyData(completeInfo);
       
  1338 	ltsyData.SerialiseL(completeData); 	
       
  1339 	
       
  1340 	//-------------------------------------------------------------------------
       
  1341 	// TEST E: Unsolicited completion of RMmCustomAPI::NotifyDtmfEvent
       
  1342 	// from LTSY.
       
  1343 	// Test here cause this is a self-reposting request.
       
  1344  	//-------------------------------------------------------------------------
       
  1345 	TRequestStatus mockLtsyStatus;
       
  1346 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
  1347 	iMockLTSY.CompleteL(ECustomNotifyDtmfEventIPC, KErrNone, completeData);
       
  1348 	User::WaitForRequest(mockLtsyStatus);
       
  1349 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());	
       
  1350 	
       
  1351 	// data for NotifyDtmfEvent itself
       
  1352 	TRequestStatus requestStatus;
       
  1353 	RMmCustomAPI::TDtmfInfo info;
       
  1354 	
       
  1355 	//-------------------------------------------------------------------------
       
  1356 	// TEST B: failure on completion of pending request from LTSY->CTSY
       
  1357  	//-------------------------------------------------------------------------
       
  1358 	customAPI.NotifyDtmfEvent(requestStatus, info);	
       
  1359 	iMockLTSY.CompleteL(ECustomNotifyDtmfEventIPC, KErrGeneral, completeData);
       
  1360 		
       
  1361 	User::WaitForRequest(requestStatus);	
       
  1362 	ASSERT_EQUALS(KErrGeneral, requestStatus.Int());
       
  1363 	AssertMockLtsyStatusL();
       
  1364 
       
  1365  	//-------------------------------------------------------------------------
       
  1366 	// TEST C: Successful completion request of
       
  1367 	// RMmCustomAPI::NotifyDtmfEvent when result is not cached.
       
  1368  	//-------------------------------------------------------------------------
       
  1369 	customAPI.NotifyDtmfEvent(requestStatus, info);	
       
  1370 	iMockLTSY.CompleteL(ECustomNotifyDtmfEventIPC, KErrNone, completeData);
       
  1371 		
       
  1372 	User::WaitForRequest(requestStatus);	
       
  1373 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
  1374 	AssertMockLtsyStatusL();	
       
  1375 	ASSERT_EQUALS(completeInfo.iType,   info.iType);
       
  1376 	ASSERT_EQUALS(completeInfo.iEvent,	info.iEvent);
       
  1377 	ASSERT_EQUALS(completeInfo.iTone,	info.iTone); 
       
  1378 	
       
  1379 	AssertMockLtsyStatusL();
       
  1380 	CleanupStack::PopAndDestroy(3, this); 
       
  1381 	
       
  1382 	}
       
  1383 
       
  1384 
       
  1385 /**
       
  1386 @SYMTestCaseID BA-CTSY-CIPC-MCNDE-0002
       
  1387 @SYMComponent  telephony_ctsy
       
  1388 @SYMTestCaseDesc Test support in CTSY for cancelling of RMmCustomAPI::NotifyDtmfEvent
       
  1389 @SYMTestPriority High
       
  1390 @SYMTestActions Invokes cancelling of RMmCustomAPI::NotifyDtmfEvent
       
  1391 @SYMTestExpectedResults Pass
       
  1392 @SYMTestType CT
       
  1393 */
       
  1394 void CCTsyCustomIPCFU::TestNotifyDtmfEvent0002L()
       
  1395 	{
       
  1396 
       
  1397 	OpenEtelServerL(EUseExtendedError);
       
  1398 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  1399 	OpenPhoneL();
       
  1400 
       
  1401 	RBuf8 completeData;
       
  1402 	CleanupClosePushL(completeData);
       
  1403 	
       
  1404 	RMmCustomAPI customAPI;
       
  1405 	OpenCustomAPILC(customAPI, iPhone);
       
  1406 	
       
  1407 	// data for CompleteL
       
  1408 	RMmCustomAPI::TDtmfInfo completeInfo;
       
  1409 	completeInfo.iType  = RMmCustomAPI::EDtmfSequence;	
       
  1410 	completeInfo.iEvent = RMmCustomAPI::EDtmfStop;
       
  1411 	completeInfo.iTone = 0x10;
       
  1412 	TMockLtsyData1 <RMmCustomAPI::TDtmfInfo> ltsyData(completeInfo);
       
  1413 	ltsyData.SerialiseL(completeData); 		
       
  1414 	
       
  1415 	// data for NotifyDtmfEvent itself
       
  1416 	TRequestStatus requestStatus;
       
  1417 	RMmCustomAPI::TDtmfInfo info;
       
  1418 	
       
  1419 	TRequestStatus mockLtsyStatus;
       
  1420 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
  1421 
       
  1422  	//-------------------------------------------------------------------------
       
  1423 	// Test cancelling of RMmCustomAPI::NotifyDtmfEvent
       
  1424  	//-------------------------------------------------------------------------
       
  1425  	
       
  1426 	customAPI.NotifyDtmfEvent(requestStatus, info);
       
  1427 	// cancel request
       
  1428 	customAPI.CancelAsyncRequest(ECustomNotifyDtmfEventIPC);		
       
  1429 	// try to complete request
       
  1430 	iMockLTSY.CompleteL(ECustomNotifyDtmfEventIPC, KErrNone, completeData);
       
  1431 		
       
  1432 	User::WaitForRequest(requestStatus);	
       
  1433 	ASSERT_EQUALS(KErrCancel, requestStatus.Int());
       
  1434 	
       
  1435 	// Wait for completion of iMockLTSY.NotifyTerminated
       
  1436 	User::WaitForRequest(mockLtsyStatus);
       
  1437 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
  1438 	AssertMockLtsyStatusL();
       
  1439 	
       
  1440 	CleanupStack::PopAndDestroy(3, this); 
       
  1441 	
       
  1442 	}
       
  1443 
       
  1444 
       
  1445 /**
       
  1446 @SYMTestCaseID BA-CTSY-CIPC-MCNDE-0004
       
  1447 @SYMComponent  telephony_ctsy
       
  1448 @SYMTestCaseDesc Test support in CTSY for multiple client requests to RMmCustomAPI::NotifyDtmfEvent
       
  1449 @SYMTestPriority High
       
  1450 @SYMTestActions Invokes multiple client requests to RMmCustomAPI::NotifyDtmfEvent
       
  1451 @SYMTestExpectedResults Pass
       
  1452 @SYMTestType CT
       
  1453 */
       
  1454 void CCTsyCustomIPCFU::TestNotifyDtmfEvent0004L()
       
  1455 	{
       
  1456 					
       
  1457 	OpenEtelServerL(EUseExtendedError);
       
  1458 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  1459 	OpenPhoneL();
       
  1460 			
       
  1461 	RBuf8 completeData;
       
  1462 	CleanupClosePushL(completeData);	
       
  1463 	
       
  1464 	RMmCustomAPI customAPI;
       
  1465 	OpenCustomAPILC(customAPI, iPhone);
       
  1466 		
       
  1467 	
       
  1468 	// Open second client
       
  1469 	RTelServer telServer2;
       
  1470 	TInt ret = telServer2.Connect();
       
  1471 	ASSERT_EQUALS(KErrNone, ret);
       
  1472 	CleanupClosePushL(telServer2);
       
  1473 
       
  1474 	RMobilePhone phone2;
       
  1475 	ret = phone2.Open(telServer2, KMmTsyPhoneName);
       
  1476 	ASSERT_EQUALS(KErrNone, ret);
       
  1477 	CleanupClosePushL(phone2);
       
  1478 	
       
  1479 	RMmCustomAPI customAPI2;
       
  1480 	CleanupClosePushL(customAPI2);
       
  1481 	customAPI2.Open(phone2);
       
  1482 		
       
  1483 	// data for CompleteL
       
  1484 	RMmCustomAPI::TDtmfInfo completeInfo;
       
  1485 	completeInfo.iType  = RMmCustomAPI::EDtmfSequence;	
       
  1486 	completeInfo.iEvent = RMmCustomAPI::EDtmfStop;
       
  1487 	completeInfo.iTone = 0x10;
       
  1488 	TMockLtsyData1 <RMmCustomAPI::TDtmfInfo> ltsyData(completeInfo);
       
  1489 	ltsyData.SerialiseL(completeData); 		
       
  1490 	
       
  1491 	// data for the first NotifyDtmfEvent 
       
  1492 	TRequestStatus requestStatus;
       
  1493 	RMmCustomAPI::TDtmfInfo info;
       
  1494 
       
  1495 	
       
  1496 	// data for the second NotifyDtmfEvent 
       
  1497 	TRequestStatus requestStatus2;
       
  1498 	RMmCustomAPI::TDtmfInfo info2;
       
  1499 
       
  1500 	//-------------------------------------------------------------------------
       
  1501 	// Test A: Test multiple clients requesting RMmCustomAPI::NotifyDtmfEvent
       
  1502  	//-------------------------------------------------------------------------
       
  1503 
       
  1504 	// send first request
       
  1505 	customAPI.NotifyDtmfEvent(requestStatus, info);	
       
  1506 	
       
  1507 	// send second request
       
  1508 	customAPI2.NotifyDtmfEvent(requestStatus2, info2);	
       
  1509 	
       
  1510 	// Complete
       
  1511 	iMockLTSY.CompleteL(ECustomNotifyDtmfEventIPC, KErrNone, completeData);
       
  1512 	
       
  1513 	// wait for the first answer	
       
  1514 	User::WaitForRequest(requestStatus);	
       
  1515 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
  1516 	
       
  1517 	// wait for the second answer	
       
  1518 	User::WaitForRequest(requestStatus2);	
       
  1519 	ASSERT_EQUALS(KErrNone, requestStatus2.Int());
       
  1520 	
       
  1521 	AssertMockLtsyStatusL();
       
  1522 		
       
  1523 	// check first request's data
       
  1524 	ASSERT_EQUALS(completeInfo.iType,   info.iType);
       
  1525 	ASSERT_EQUALS(completeInfo.iEvent,	info.iEvent);
       
  1526 	ASSERT_EQUALS(completeInfo.iTone,	info.iTone);
       
  1527 	
       
  1528 	// check second request's data
       
  1529 	ASSERT_EQUALS(completeInfo.iType,   info2.iType);
       
  1530 	ASSERT_EQUALS(completeInfo.iEvent,	info2.iEvent);
       
  1531 	ASSERT_EQUALS(completeInfo.iTone,	info2.iTone);
       
  1532 
       
  1533 	// Done !
       
  1534 	CleanupStack::PopAndDestroy(6, this); 
       
  1535 
       
  1536 	}
       
  1537 
       
  1538 
       
  1539 /**
       
  1540 @SYMTestCaseID BA-CTSY-CIPC-MCGDO-0001
       
  1541 @SYMComponent  telephony_ctsy
       
  1542 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::GetDiagnosticInfo
       
  1543 @SYMTestPriority High
       
  1544 @SYMTestActions Invokes RMmCustomAPI::GetDiagnosticInfo
       
  1545 @SYMTestExpectedResults Pass
       
  1546 @SYMTestType CT
       
  1547 */
       
  1548 void CCTsyCustomIPCFU::TestGetDiagnosticInfo0001L()
       
  1549 	{
       
  1550 
       
  1551 	OpenEtelServerL(EUseExtendedError);
       
  1552 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  1553 	OpenPhoneL();	
       
  1554 	
       
  1555 	RBuf8 completeData;
       
  1556 	CleanupClosePushL(completeData);
       
  1557 	
       
  1558 	RMmCustomAPI customAPI;
       
  1559 	OpenCustomAPILC(customAPI, iPhone);
       
  1560 	
       
  1561 	
       
  1562 	//-------------------------------------------------------------------------
       
  1563 	// try to get info for non-existing call
       
  1564  	//-------------------------------------------------------------------------
       
  1565 	TName callName;
       
  1566 	TInt status = customAPI.GetDiagnosticInfo(callName);
       
  1567 	
       
  1568 	ASSERT_EQUALS(KErrNotFound, status);	
       
  1569 	AssertMockLtsyStatusL();	
       
  1570 	
       
  1571 
       
  1572 	//-------------------------------------------------------------------------
       
  1573 	// try to get info for existing call,  with initial iDiagnosticOctet ( == NULL)
       
  1574  	//-------------------------------------------------------------------------
       
  1575 	
       
  1576 	// -----------Open Line and Call ---------------------
       
  1577 	RLine line;
       
  1578 	RCall call;
       
  1579    	// Open new line
       
  1580     TInt errorCode = line.Open(iPhone, KMmTsyVoice1LineName);    
       
  1581 	ASSERT_EQUALS(KErrNone, errorCode);	
       
  1582 	CleanupClosePushL(line);
       
  1583 		
       
  1584 	TName incomingCallName;
       
  1585 	TInt callId = 1;
       
  1586     RMobilePhone::TMobileService mobileService = RMobilePhone::EVoiceService;
       
  1587     RMobileCall::TMobileCallStatus mobileCallStatus = RMobileCall::EStatusRinging;
       
  1588 	 	
       
  1589 	// create new incoming call
       
  1590 	errorCode = CreateIncomingCallL(line, callId, KMmTsyVoice1LineName, incomingCallName, 
       
  1591 	                               mobileService, mobileCallStatus);	
       
  1592 	ASSERT_EQUALS(KErrNone, errorCode);		
       
  1593 	CleanupClosePushL(call);
       
  1594 		
       
  1595     errorCode = call.OpenExistingCall(line, incomingCallName);
       
  1596     ASSERT_EQUALS(KErrNone, errorCode);
       
  1597     //-------------------------------------------------------------------------    
       
  1598     
       
  1599     status = customAPI.GetDiagnosticInfo(incomingCallName);	
       
  1600 	ASSERT_EQUALS(KErrNone, status);
       
  1601 	AssertMockLtsyStatusL();
       
  1602 
       
  1603 
       
  1604  	//-------------------------------------------------------------------------
       
  1605 	//  try to get info for existing call, with iDiagnosticOctet = KDiagnosticInfoBarredWithCUG
       
  1606  	//-------------------------------------------------------------------------
       
  1607 	
       
  1608 	// set iDiagnosticOctet ...
       
  1609 	TRequestStatus mockLtsyStatus;
       
  1610 	iMockLTSY.NotifyTerminated(mockLtsyStatus);	
       
  1611 	TDiagnosticInfoValues diagnostic(KDiagnosticInfoBarredWithCUG);	
       
  1612 	TMockLtsyData2 <TInt, TDiagnosticInfoValues> ltsyData(callId, diagnostic);
       
  1613 	ltsyData.SerialiseL(completeData);	
       
  1614 	
       
  1615 	iMockLTSY.CompleteL(ECustomGetDiagnosticOctetsIPC, KErrNone, completeData);
       
  1616 	
       
  1617 	User::WaitForRequest(mockLtsyStatus);	
       
  1618 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
  1619 	
       
  1620 	// ... and get info
       
  1621 	status = customAPI.GetDiagnosticInfo(incomingCallName);	
       
  1622 	ASSERT_EQUALS(KErrDiagnosticInfoBarredWithCUG, status);
       
  1623 	AssertMockLtsyStatusL();	
       
  1624 	
       
  1625 	
       
  1626 	//-------------------------------------------------------------------------
       
  1627 	//  try to get info for existing call, with iDiagnosticOctet = KDiagnosticInfoBarredNoCUG
       
  1628  	//-------------------------------------------------------------------------
       
  1629 	
       
  1630 	// set iDiagnosticOctet ...
       
  1631 	iMockLTSY.NotifyTerminated(mockLtsyStatus);	
       
  1632 	diagnostic = KDiagnosticInfoBarredNoCUG;	
       
  1633 	completeData.Close();
       
  1634 	ltsyData.SerialiseL(completeData);	
       
  1635 	
       
  1636 	iMockLTSY.CompleteL(ECustomGetDiagnosticOctetsIPC, KErrNone, completeData);
       
  1637 	
       
  1638 	User::WaitForRequest(mockLtsyStatus);	
       
  1639 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
  1640 	
       
  1641 	// ... and get info
       
  1642 	status = customAPI.GetDiagnosticInfo(incomingCallName);	
       
  1643 	ASSERT_EQUALS(KErrDiagnosticInfoBarredNoCUG, status);
       
  1644 	AssertMockLtsyStatusL();
       
  1645 	
       
  1646 		
       
  1647 	//-------------------------------------------------------------------------
       
  1648 	//  try to get info for existing call, with iDiagnosticOctet = KDiagnosticInfoBarredUnknownCUG
       
  1649  	//-------------------------------------------------------------------------
       
  1650 	
       
  1651 	// set iDiagnosticOctet ...
       
  1652 	iMockLTSY.NotifyTerminated(mockLtsyStatus);	
       
  1653 	diagnostic = KDiagnosticInfoBarredUnknownCUG;
       
  1654 	completeData.Close();
       
  1655 	ltsyData.SerialiseL(completeData);	
       
  1656 	
       
  1657 	iMockLTSY.CompleteL(ECustomGetDiagnosticOctetsIPC, KErrNone, completeData);
       
  1658 	
       
  1659 	User::WaitForRequest(mockLtsyStatus);	
       
  1660 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
  1661 	
       
  1662 	// ... and get info
       
  1663 	status = customAPI.GetDiagnosticInfo(incomingCallName);	
       
  1664 	ASSERT_EQUALS(KErrDiagnosticInfoBarredUnknownCUG, status);
       
  1665 	AssertMockLtsyStatusL();
       
  1666 	
       
  1667 	//-------------------------------------------------------------------------
       
  1668 	//  try to get info for existing call, with iDiagnosticOctet = KDiagnosticInfoBarredIncompatibleCUG
       
  1669  	//-------------------------------------------------------------------------
       
  1670 	
       
  1671 	// set iDiagnosticOctet ...
       
  1672 	iMockLTSY.NotifyTerminated(mockLtsyStatus);	
       
  1673 	diagnostic = KDiagnosticInfoBarredIncompatibleCUG;	
       
  1674 	completeData.Close();
       
  1675 	ltsyData.SerialiseL(completeData);	
       
  1676 	
       
  1677 	iMockLTSY.CompleteL(ECustomGetDiagnosticOctetsIPC, KErrNone, completeData);
       
  1678 	
       
  1679 	User::WaitForRequest(mockLtsyStatus);	
       
  1680 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
  1681 	
       
  1682 	// ... and get info
       
  1683 	status = customAPI.GetDiagnosticInfo(incomingCallName);	
       
  1684 	ASSERT_EQUALS(KErrDiagnosticInfoBarredIncompatibleCUG, status);
       
  1685 	AssertMockLtsyStatusL();
       
  1686 	
       
  1687 		
       
  1688 	//-------------------------------------------------------------------------
       
  1689 	//  try to get info for existing call, with iDiagnosticOctet = KDiagnosticInfoBarredFailureCUG
       
  1690  	//-------------------------------------------------------------------------
       
  1691 	
       
  1692 	// set iDiagnosticOctet ...
       
  1693 	iMockLTSY.NotifyTerminated(mockLtsyStatus);	
       
  1694 	diagnostic = KDiagnosticInfoBarredFailureCUG;	
       
  1695 	completeData.Close();
       
  1696 	ltsyData.SerialiseL(completeData);	
       
  1697 	
       
  1698 	iMockLTSY.CompleteL(ECustomGetDiagnosticOctetsIPC, KErrNone, completeData);
       
  1699 	
       
  1700 	User::WaitForRequest(mockLtsyStatus);	
       
  1701 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
  1702 	
       
  1703 	// ... and get info
       
  1704 	status = customAPI.GetDiagnosticInfo(incomingCallName);	
       
  1705 	ASSERT_EQUALS(KErrDiagnosticInfoBarredFailureCUG, status);
       
  1706 	AssertMockLtsyStatusL();	
       
  1707 	
       
  1708 	
       
  1709 	//-------------------------------------------------------------------------
       
  1710 	//  try to get info for existing call, with iDiagnosticOctet = KDiagnosticInfoBarredClirNotSubscribed
       
  1711  	//-------------------------------------------------------------------------
       
  1712 	
       
  1713 	// set iDiagnosticOctet ...
       
  1714 	iMockLTSY.NotifyTerminated(mockLtsyStatus);	
       
  1715 	diagnostic = KDiagnosticInfoBarredClirNotSubscribed;
       
  1716 	completeData.Close();
       
  1717 	ltsyData.SerialiseL(completeData);	
       
  1718 	
       
  1719 	iMockLTSY.CompleteL(ECustomGetDiagnosticOctetsIPC, KErrNone, completeData);
       
  1720 	
       
  1721 	User::WaitForRequest(mockLtsyStatus);	
       
  1722 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
  1723 	
       
  1724 	// ... and get info
       
  1725 	status = customAPI.GetDiagnosticInfo(incomingCallName);	
       
  1726 	ASSERT_EQUALS(KErrDiagnosticInfoBarredClirNotSubscribed, status);
       
  1727 	AssertMockLtsyStatusL();
       
  1728 	
       
  1729 	
       
  1730 	//-------------------------------------------------------------------------
       
  1731 	//  try to get info for existing call, with iDiagnosticOctet = KDiagnosticInfoBarredCCBSPossible
       
  1732  	//-------------------------------------------------------------------------
       
  1733 	
       
  1734 	// set iDiagnosticOctet ...
       
  1735 	iMockLTSY.NotifyTerminated(mockLtsyStatus);	
       
  1736 	diagnostic = KDiagnosticInfoBarredCCBSPossible;		
       
  1737 	completeData.Close();
       
  1738 	ltsyData.SerialiseL(completeData);	
       
  1739 	
       
  1740 	iMockLTSY.CompleteL(ECustomGetDiagnosticOctetsIPC, KErrNone, completeData);
       
  1741 	
       
  1742 	User::WaitForRequest(mockLtsyStatus);	
       
  1743 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
  1744 	
       
  1745 	// ... and get info
       
  1746 	status = customAPI.GetDiagnosticInfo(incomingCallName);	
       
  1747 	ASSERT_EQUALS(KErrDiagnosticInfoBarredCCBSPossible, status);
       
  1748 	AssertMockLtsyStatusL();
       
  1749 	
       
  1750 	
       
  1751 	//-------------------------------------------------------------------------
       
  1752 	//  try to get info for existing call, with iDiagnosticOctet = KDiagnosticInfoBarredCCBSNotPossible
       
  1753  	//-------------------------------------------------------------------------
       
  1754 	
       
  1755 	// set iDiagnosticOctet ...
       
  1756 	iMockLTSY.NotifyTerminated(mockLtsyStatus);	
       
  1757 	diagnostic = KDiagnosticInfoBarredCCBSNotPossible;		
       
  1758 	completeData.Close();
       
  1759 	ltsyData.SerialiseL(completeData);	
       
  1760 	
       
  1761 	iMockLTSY.CompleteL(ECustomGetDiagnosticOctetsIPC, KErrNone, completeData);
       
  1762 	
       
  1763 	User::WaitForRequest(mockLtsyStatus);	
       
  1764 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
  1765 	
       
  1766 	// ... and get info
       
  1767 	status = customAPI.GetDiagnosticInfo(incomingCallName);	
       
  1768 	ASSERT_EQUALS(KErrDiagnosticInfoBarredCCBSNotPossible, status);
       
  1769 	AssertMockLtsyStatusL();
       
  1770 	
       
  1771 	
       
  1772 	//-------------------------------------------------------------------------
       
  1773 	//  try to get info for existing call, with iDiagnosticOctet = some arbitrary value
       
  1774  	//-------------------------------------------------------------------------
       
  1775 	
       
  1776 	// set iDiagnosticOctet ...
       
  1777 	iMockLTSY.NotifyTerminated(mockLtsyStatus);	
       
  1778 	TInt someDiagnostic = -11; //	some arbitrary value
       
  1779 	TMockLtsyData2 <TInt, TInt> ltsyData2(callId, someDiagnostic);
       
  1780 	completeData.Close();
       
  1781 	ltsyData2.SerialiseL(completeData);	
       
  1782 	
       
  1783 	iMockLTSY.CompleteL(ECustomGetDiagnosticOctetsIPC, KErrNone, completeData);
       
  1784 	
       
  1785 	User::WaitForRequest(mockLtsyStatus);	
       
  1786 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
  1787 	
       
  1788 	// ... and get info
       
  1789 	status = customAPI.GetDiagnosticInfo(incomingCallName);	
       
  1790 	ASSERT_EQUALS(KErrNone, status);
       
  1791 	AssertMockLtsyStatusL();
       
  1792 	
       
  1793 	
       
  1794 	//-------------------------------------------------------------------------
       
  1795 	// TEST E: Unsolicited completion of RMmCustomAPI::GetDiagnosticInfo
       
  1796 	// from LTSY.
       
  1797  	//-------------------------------------------------------------------------
       
  1798 	//just  set iDiagnosticOctet to non-existing callId
       
  1799 	iMockLTSY.NotifyTerminated(mockLtsyStatus);	
       
  1800 	callId = 100;
       
  1801 	completeData.Close();
       
  1802 	ltsyData2.SerialiseL(completeData);	
       
  1803 	
       
  1804 	iMockLTSY.CompleteL(ECustomGetDiagnosticOctetsIPC, KErrNone, completeData);
       
  1805 	
       
  1806 	User::WaitForRequest(mockLtsyStatus);	
       
  1807 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
  1808 	
       
  1809 	
       
  1810 	CleanupStack::PopAndDestroy(5, this); 
       
  1811 	
       
  1812 	}
       
  1813 
       
  1814 
       
  1815 /**
       
  1816 @SYMTestCaseID BA-CTSY-CIPC-MCSAB-0001
       
  1817 @SYMComponent  telephony_ctsy
       
  1818 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::SetAlsBlocked
       
  1819 @SYMTestPriority High
       
  1820 @SYMTestActions Invokes RMmCustomAPI::SetAlsBlocked
       
  1821 @SYMTestExpectedResults Pass
       
  1822 @SYMTestType CT
       
  1823 */
       
  1824 void CCTsyCustomIPCFU::TestSetAlsBlocked0001L()
       
  1825 	{
       
  1826 
       
  1827 	OpenEtelServerL(EUseExtendedError);
       
  1828 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  1829 	OpenPhoneL();
       
  1830 
       
  1831 	RBuf8 expectData;
       
  1832 	CleanupClosePushL(expectData);
       
  1833 	
       
  1834 	RMmCustomAPI customAPI;
       
  1835 	OpenCustomAPILC(customAPI, iPhone);
       
  1836 	
       
  1837 	// data for SetAlsBlocked itself
       
  1838 	TRequestStatus reguestStatus;
       
  1839 	RMmCustomAPI::TSetAlsBlock blockStatus(RMmCustomAPI::EActivateBlock);
       
  1840 	
       
  1841 	// data for ExpectL
       
  1842 	TMockLtsyData1< RMmCustomAPI::TSetAlsBlock > ltsyData(blockStatus);	
       
  1843     ltsyData.SerialiseL(expectData);	
       
  1844 	
       
  1845  	//-------------------------------------------------------------------------
       
  1846 	// TEST A: failure to dispatch request to LTSY
       
  1847  	//-------------------------------------------------------------------------
       
  1848 	iMockLTSY.ExpectL(ECustomSetAlsBlockedIPC, expectData, KErrNotSupported);	
       
  1849 	
       
  1850 	customAPI.SetAlsBlocked(reguestStatus, blockStatus);
       
  1851 	
       
  1852 	User::WaitForRequest(reguestStatus);	
       
  1853 	ASSERT_EQUALS(KErrNotSupported, reguestStatus.Int());
       
  1854 	AssertMockLtsyStatusL();
       
  1855 
       
  1856 	//-------------------------------------------------------------------------
       
  1857 	// TEST B: failure on completion of pending request from LTSY->CTSY
       
  1858  	//-------------------------------------------------------------------------
       
  1859 	iMockLTSY.ExpectL(ECustomSetAlsBlockedIPC, expectData);	
       
  1860 	iMockLTSY.CompleteL(ECustomSetAlsBlockedIPC, KErrGeneral);
       
  1861 	
       
  1862 	customAPI.SetAlsBlocked(reguestStatus, blockStatus);
       
  1863 	
       
  1864 	User::WaitForRequest(reguestStatus);	
       
  1865 	ASSERT_EQUALS(KErrGeneral, reguestStatus.Int());
       
  1866 	AssertMockLtsyStatusL();
       
  1867 
       
  1868  	//-------------------------------------------------------------------------
       
  1869 	// TEST C: Successful completion request of
       
  1870 	// RMmCustomAPI::SetAlsBlocked when result is not cached.
       
  1871  	//-------------------------------------------------------------------------
       
  1872 	iMockLTSY.ExpectL(ECustomSetAlsBlockedIPC, expectData);	
       
  1873 	iMockLTSY.CompleteL(ECustomSetAlsBlockedIPC, KErrNone);
       
  1874 	
       
  1875 	customAPI.SetAlsBlocked(reguestStatus, blockStatus);
       
  1876 	
       
  1877 	User::WaitForRequest(reguestStatus);	
       
  1878 	ASSERT_EQUALS(KErrNone, reguestStatus.Int());
       
  1879 	AssertMockLtsyStatusL();
       
  1880 
       
  1881  
       
  1882  	//-------------------------------------------------------------------------
       
  1883 	// TEST E: Unsolicited completion of RMmCustomAPI::SetAlsBlocked
       
  1884 	// from LTSY.
       
  1885  	//-------------------------------------------------------------------------
       
  1886 	TRequestStatus mockLtsyStatus;
       
  1887 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
  1888 	iMockLTSY.CompleteL(ECustomSetAlsBlockedIPC, KErrNone);
       
  1889 	User::WaitForRequest(mockLtsyStatus);
       
  1890 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
  1891 
       
  1892 	AssertMockLtsyStatusL();
       
  1893 	CleanupStack::PopAndDestroy(3, this); 
       
  1894 	
       
  1895 	}
       
  1896 
       
  1897 
       
  1898 /**
       
  1899 @SYMTestCaseID BA-CTSY-CIPC-MCSAB-0002
       
  1900 @SYMComponent  telephony_ctsy
       
  1901 @SYMTestCaseDesc Test support in CTSY for cancelling of RMmCustomAPI::SetAlsBlocked
       
  1902 @SYMTestPriority High
       
  1903 @SYMTestActions Invokes cancelling of RMmCustomAPI::SetAlsBlocked
       
  1904 @SYMTestExpectedResults Pass
       
  1905 @SYMTestType CT
       
  1906 */
       
  1907 void CCTsyCustomIPCFU::TestSetAlsBlocked0002L()
       
  1908 	{
       
  1909 
       
  1910 	OpenEtelServerL(EUseExtendedError);
       
  1911 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  1912 	OpenPhoneL();
       
  1913 
       
  1914 	RBuf8 expectData;
       
  1915 	CleanupClosePushL(expectData);
       
  1916 	
       
  1917 	RMmCustomAPI customAPI;
       
  1918 	OpenCustomAPILC(customAPI, iPhone);
       
  1919 	
       
  1920 	// data for SetAlsBlocked itself
       
  1921 	TRequestStatus reguestStatus;
       
  1922 	RMmCustomAPI::TSetAlsBlock blockStatus(RMmCustomAPI::EActivateBlock);
       
  1923 	
       
  1924 	// data for ExpectL
       
  1925 	TMockLtsyData1< RMmCustomAPI::TSetAlsBlock > ltsyData(blockStatus);	
       
  1926     ltsyData.SerialiseL(expectData);	
       
  1927 
       
  1928  	//-------------------------------------------------------------------------
       
  1929 	// Test cancelling of RMmCustomAPI::SetAlsBlocked
       
  1930  	//------------------------------------------------------------------------- 	
       
  1931 	iMockLTSY.ExpectL(ECustomSetAlsBlockedIPC, expectData);	
       
  1932 	
       
  1933 	customAPI.SetAlsBlocked(reguestStatus, blockStatus);
       
  1934 	// try to cancel request
       
  1935 	customAPI.CancelAsyncRequest(ECustomSetAlsBlockedIPC);
       
  1936 	
       
  1937 	iMockLTSY.CompleteL(ECustomSetAlsBlockedIPC, KErrNone);
       
  1938 	
       
  1939 	User::WaitForRequest(reguestStatus);	
       
  1940 	
       
  1941 	// TSY has started a request and it is not possible to then
       
  1942     // cancel it. The best thing for the TSY to do in
       
  1943     // this case is to proceed as though the Cancel never happened.
       
  1944     // The server's call to the TSY cancel function will return
       
  1945     // synchronously. The TSY then continues to wait for the methods
       
  1946     // acknowledgement and when it receives it, the TSY will complete
       
  1947     // the original request.
       
  1948 	ASSERT_EQUALS(KErrNone, reguestStatus.Int());
       
  1949 	
       
  1950 	AssertMockLtsyStatusL();
       
  1951 	CleanupStack::PopAndDestroy(3, this);
       
  1952 	
       
  1953 	}
       
  1954 
       
  1955 
       
  1956 /**
       
  1957 @SYMTestCaseID BA-CTSY-CIPC-MCSAB-0004
       
  1958 @SYMComponent  telephony_ctsy
       
  1959 @SYMTestCaseDesc Test support in CTSY for multiple client requests to RMmCustomAPI::SetAlsBlocked
       
  1960 @SYMTestPriority High
       
  1961 @SYMTestActions Invokes multiple client requests to RMmCustomAPI::SetAlsBlocked
       
  1962 @SYMTestExpectedResults Pass
       
  1963 @SYMTestType CT
       
  1964 */
       
  1965 void CCTsyCustomIPCFU::TestSetAlsBlocked0004L()
       
  1966 	{
       
  1967 				
       
  1968 	OpenEtelServerL(EUseExtendedError);
       
  1969 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  1970 	OpenPhoneL();
       
  1971 
       
  1972 	RBuf8 expectData;
       
  1973 	CleanupClosePushL(expectData);
       
  1974 	
       
  1975 	RBuf8 expectData2;
       
  1976 	CleanupClosePushL(expectData2);
       
  1977 	
       
  1978 	RMmCustomAPI customAPI;
       
  1979 	OpenCustomAPILC(customAPI, iPhone);
       
  1980 	
       
  1981 	// Open second client
       
  1982 	RTelServer telServer2;
       
  1983 	TInt ret = telServer2.Connect();
       
  1984 	ASSERT_EQUALS(KErrNone, ret);
       
  1985 	CleanupClosePushL(telServer2);
       
  1986 
       
  1987 	RMobilePhone phone2;
       
  1988 	ret = phone2.Open(telServer2,KMmTsyPhoneName);
       
  1989 	ASSERT_EQUALS(KErrNone, ret);
       
  1990 	CleanupClosePushL(phone2);
       
  1991 	
       
  1992 	RMmCustomAPI customAPI2;
       
  1993 	OpenCustomAPILC(customAPI2, phone2, EFalse);
       
  1994 		
       
  1995 	// data for the first SetAlsBlocked 
       
  1996 	TRequestStatus reguestStatus;
       
  1997 	RMmCustomAPI::TSetAlsBlock blockStatus(RMmCustomAPI::EDeactivateBlock);
       
  1998 	
       
  1999 	// data for the first ExpectL
       
  2000 	TMockLtsyData1< RMmCustomAPI::TSetAlsBlock > ltsyData(blockStatus);	
       
  2001     ltsyData.SerialiseL(expectData);
       
  2002     
       
  2003     
       
  2004     // data for the second SetAlsBlocked 
       
  2005 	TRequestStatus reguestStatus2;
       
  2006 	RMmCustomAPI::TSetAlsBlock blockStatus2(RMmCustomAPI::EActivateBlock);
       
  2007 	
       
  2008 	// data for the second ExpectL
       
  2009 	TMockLtsyData1< RMmCustomAPI::TSetAlsBlock > ltsyData2(blockStatus2);	
       
  2010     ltsyData2.SerialiseL(expectData2);
       
  2011     
       
  2012 
       
  2013 	//-------------------------------------------------------------------------
       
  2014 	// Test A: Test multiple clients requesting RMmCustomAPI::SetAlsBlocked
       
  2015  	//-------------------------------------------------------------------------
       
  2016  	
       
  2017  	
       
  2018  	// first request
       
  2019  	iMockLTSY.ExpectL(ECustomSetAlsBlockedIPC, expectData);	
       
  2020 	iMockLTSY.CompleteL(ECustomSetAlsBlockedIPC, KErrNone, 10);	
       
  2021 	customAPI.SetAlsBlocked(reguestStatus, blockStatus);
       
  2022 
       
  2023 	// there is no way to check KErrServerBusy return value because second 
       
  2024 	// request is put to a wating queue by ETel and it is resumed only after 
       
  2025 	// first request is completed
       
  2026 		
       
  2027 
       
  2028 	customAPI2.SetAlsBlocked(reguestStatus2, blockStatus2);
       
  2029 	
       
  2030 	// wait for the first request
       
  2031 	User::WaitForRequest(reguestStatus);	
       
  2032 	ASSERT_EQUALS(KErrNone, reguestStatus.Int());	
       
  2033 	
       
  2034 	// wait for the second request
       
  2035 	User::WaitForRequest(reguestStatus2);
       
  2036 	// Documentation says that KErrServerBusy should be in case of multiple requests
       
  2037 
       
  2038 	ASSERT_EQUALS(KErrServerBusy, reguestStatus2.Int());
       
  2039 	
       
  2040 	AssertMockLtsyStatusL();
       
  2041 
       
  2042 	CleanupStack::PopAndDestroy(7, this); 
       
  2043 
       
  2044 	}
       
  2045 
       
  2046 
       
  2047 /**
       
  2048 @SYMTestCaseID BA-CTSY-CIPC-MCSAB-0005
       
  2049 @SYMComponent  telephony_ctsy
       
  2050 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::SetAlsBlocked with timeout
       
  2051 @SYMTestPriority High
       
  2052 @SYMTestActions Invokes RMmCustomAPI::SetAlsBlocked and tests for timeout
       
  2053 @SYMTestExpectedResults Pass
       
  2054 @SYMTestType CT
       
  2055 */
       
  2056 void CCTsyCustomIPCFU::TestSetAlsBlocked0005L()
       
  2057 	{
       
  2058 	
       
  2059 	OpenEtelServerL(EUseExtendedError);
       
  2060 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  2061 	OpenPhoneL();
       
  2062 
       
  2063 	RBuf8 expectData;
       
  2064 	CleanupClosePushL(expectData);
       
  2065 	
       
  2066 	RMmCustomAPI customAPI;
       
  2067 	OpenCustomAPILC(customAPI, iPhone);
       
  2068 	
       
  2069 	// data for SetAlsBlocked itself
       
  2070 	TRequestStatus reguestStatus;
       
  2071 	RMmCustomAPI::TSetAlsBlock blockStatus(RMmCustomAPI::EActivateBlock);
       
  2072 	
       
  2073 	// data for ExpectL
       
  2074 	TMockLtsyData1< RMmCustomAPI::TSetAlsBlock > ltsyData(blockStatus);	
       
  2075     ltsyData.SerialiseL(expectData);
       
  2076 
       
  2077 	//-------------------------------------------------------------------------
       
  2078 	// Test A: Test timeout of RMmCustomAPI::SetAlsBlocked
       
  2079  	//-------------------------------------------------------------------------
       
  2080 	iMockLTSY.ExpectL(ECustomSetAlsBlockedIPC, expectData);		
       
  2081 	customAPI.SetAlsBlocked(reguestStatus, blockStatus);
       
  2082 	
       
  2083 	User::WaitForRequest(reguestStatus);
       
  2084 	ASSERT_EQUALS(KErrTimedOut, reguestStatus.Int());
       
  2085 	
       
  2086 	AssertMockLtsyStatusL();	
       
  2087 	CleanupStack::PopAndDestroy(3, this); 
       
  2088 
       
  2089 	}
       
  2090 
       
  2091 
       
  2092 /**
       
  2093 @SYMTestCaseID BA-CTSY-CIPC-MCGAB-0001
       
  2094 @SYMComponent  telephony_ctsy
       
  2095 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::GetAlsBlocked
       
  2096 @SYMTestPriority High
       
  2097 @SYMTestActions Invokes RMmCustomAPI::GetAlsBlocked
       
  2098 @SYMTestExpectedResults Pass
       
  2099 @SYMTestType CT
       
  2100 */
       
  2101 void CCTsyCustomIPCFU::TestGetAlsBlocked0001L()
       
  2102 	{
       
  2103 
       
  2104 	OpenEtelServerL(EUseExtendedError);
       
  2105 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  2106 	OpenPhoneL();
       
  2107 
       
  2108 	RBuf8 completeData;
       
  2109 	CleanupClosePushL(completeData);
       
  2110 	
       
  2111 	RMmCustomAPI customAPI;
       
  2112 	OpenCustomAPILC(customAPI, iPhone);
       
  2113 	
       
  2114 	// data for GetAlsBlocked itself
       
  2115 	TRequestStatus reguestStatus;
       
  2116 	RMmCustomAPI::TGetAlsBlockStatus blockStatus(RMmCustomAPI::EBlockStatusUnknown);
       
  2117 	
       
  2118 	// data for CompleteL
       
  2119 	RMmCustomAPI::TGetAlsBlockStatus completeBlockStatus(RMmCustomAPI::EBlockStatusActive);
       
  2120 	TMockLtsyData1< RMmCustomAPI::TGetAlsBlockStatus > ltsyData(completeBlockStatus);	
       
  2121     ltsyData.SerialiseL(completeData);
       
  2122 
       
  2123 
       
  2124  	//-------------------------------------------------------------------------
       
  2125 	// TEST A: failure to dispatch request to LTSY
       
  2126  	//-------------------------------------------------------------------------
       
  2127 	iMockLTSY.ExpectL(ECustomGetAlsBlockedIPC, KErrNotSupported);
       
  2128 		
       
  2129 	customAPI.GetAlsBlocked(reguestStatus, blockStatus);
       
  2130 	
       
  2131 	User::WaitForRequest(reguestStatus);
       
  2132 	ASSERT_EQUALS(KErrNotSupported, reguestStatus.Int());
       
  2133 	AssertMockLtsyStatusL();	
       
  2134 
       
  2135 	//-------------------------------------------------------------------------
       
  2136 	// TEST B: failure on completion of pending request from LTSY->CTSY
       
  2137  	//-------------------------------------------------------------------------
       
  2138 	iMockLTSY.ExpectL(ECustomGetAlsBlockedIPC);
       
  2139 	iMockLTSY.CompleteL(ECustomGetAlsBlockedIPC, KErrGeneral, completeData);		
       
  2140 		
       
  2141 	customAPI.GetAlsBlocked(reguestStatus, blockStatus);
       
  2142 	
       
  2143 	User::WaitForRequest(reguestStatus);
       
  2144 	ASSERT_EQUALS(KErrGeneral, reguestStatus.Int());
       
  2145 	AssertMockLtsyStatusL();	
       
  2146 	
       
  2147  	//-------------------------------------------------------------------------
       
  2148 	// TEST C: Successful completion request of
       
  2149 	// RMmCustomAPI::GetAlsBlocked when result is not cached.
       
  2150  	//-------------------------------------------------------------------------
       
  2151 
       
  2152 	iMockLTSY.ExpectL(ECustomGetAlsBlockedIPC);
       
  2153 	iMockLTSY.CompleteL(ECustomGetAlsBlockedIPC, KErrNone, completeData);		
       
  2154 		
       
  2155 	customAPI.GetAlsBlocked(reguestStatus, blockStatus);
       
  2156 	
       
  2157 	User::WaitForRequest(reguestStatus);
       
  2158 	ASSERT_EQUALS(KErrNone, reguestStatus.Int());
       
  2159 	ASSERT_EQUALS(completeBlockStatus, blockStatus);
       
  2160 	AssertMockLtsyStatusL();
       
  2161 
       
  2162  	//-------------------------------------------------------------------------
       
  2163 	// TEST E: Unsolicited completion of RMmCustomAPI::GetAlsBlocked
       
  2164 	// from LTSY.
       
  2165  	//-------------------------------------------------------------------------
       
  2166 	TRequestStatus mockLtsyStatus;
       
  2167 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
  2168 	iMockLTSY.CompleteL(ECustomGetAlsBlockedIPC, KErrNone);
       
  2169 	User::WaitForRequest(mockLtsyStatus);
       
  2170 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
  2171 	
       
  2172 	AssertMockLtsyStatusL();
       
  2173 	CleanupStack::PopAndDestroy(3, this); 
       
  2174 	
       
  2175 	}
       
  2176 
       
  2177 
       
  2178 /**
       
  2179 @SYMTestCaseID BA-CTSY-CIPC-MCGAB-0002
       
  2180 @SYMComponent  telephony_ctsy
       
  2181 @SYMTestCaseDesc Test support in CTSY for cancelling of RMmCustomAPI::GetAlsBlocked
       
  2182 @SYMTestPriority High
       
  2183 @SYMTestActions Invokes cancelling of RMmCustomAPI::GetAlsBlocked
       
  2184 @SYMTestExpectedResults Pass
       
  2185 @SYMTestType CT
       
  2186 */
       
  2187 void CCTsyCustomIPCFU::TestGetAlsBlocked0002L()
       
  2188 	{
       
  2189 
       
  2190 	OpenEtelServerL(EUseExtendedError);
       
  2191 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  2192 	OpenPhoneL();
       
  2193 
       
  2194 	RBuf8 completeData;
       
  2195 	CleanupClosePushL(completeData);
       
  2196 	
       
  2197 	RMmCustomAPI customAPI;
       
  2198 	OpenCustomAPILC(customAPI, iPhone);
       
  2199 	
       
  2200 	// data for GetAlsBlocked itself
       
  2201 	TRequestStatus reguestStatus;
       
  2202 	RMmCustomAPI::TGetAlsBlockStatus blockStatus(RMmCustomAPI::EBlockStatusUnknown);
       
  2203 	
       
  2204 	// data for CompleteL
       
  2205 	RMmCustomAPI::TGetAlsBlockStatus completeBlockStatus(RMmCustomAPI::EBlockStatusActive);
       
  2206 	TMockLtsyData1< RMmCustomAPI::TGetAlsBlockStatus > ltsyData(completeBlockStatus);	
       
  2207     ltsyData.SerialiseL(completeData);
       
  2208     
       
  2209  	//-------------------------------------------------------------------------
       
  2210 	// Test cancelling of RMmCustomAPI::GetAlsBlocked
       
  2211  	//-------------------------------------------------------------------------    
       
  2212     iMockLTSY.ExpectL(ECustomGetAlsBlockedIPC);    
       
  2213     customAPI.GetAlsBlocked(reguestStatus, blockStatus);
       
  2214     
       
  2215     // try to cancel request
       
  2216 	customAPI.CancelAsyncRequest(ECustomGetAlsBlockedIPC);	
       
  2217 	
       
  2218 	// try to Complete request
       
  2219 	TRequestStatus mockLtsyStatus;
       
  2220 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
  2221 	iMockLTSY.CompleteL(ECustomGetAlsBlockedIPC, KErrNone, completeData);		
       
  2222 	User::WaitForRequest(mockLtsyStatus);
       
  2223 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
  2224 	
       
  2225 	// wait for request completion	
       
  2226 	User::WaitForRequest(reguestStatus);
       
  2227 	ASSERT_EQUALS(KErrCancel, reguestStatus.Int());
       
  2228 	AssertMockLtsyStatusL(); 
       
  2229 	
       
  2230 
       
  2231 
       
  2232 	CleanupStack::PopAndDestroy(3, this); 
       
  2233 	
       
  2234 	}
       
  2235 
       
  2236 /**
       
  2237 @SYMTestCaseID BA-CTSY-CIPC-MCGAB-0004
       
  2238 @SYMComponent  telephony_ctsy
       
  2239 @SYMTestCaseDesc Test support in CTSY for multiple client requests to RMmCustomAPI::GetAlsBlocked
       
  2240 @SYMTestPriority High
       
  2241 @SYMTestActions Invokes multiple client requests to RMmCustomAPI::GetAlsBlocked
       
  2242 @SYMTestExpectedResults Pass
       
  2243 @SYMTestType CT
       
  2244 */
       
  2245 void CCTsyCustomIPCFU::TestGetAlsBlocked0004L()
       
  2246 	{
       
  2247 					
       
  2248 	OpenEtelServerL(EUseExtendedError);
       
  2249 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  2250 	OpenPhoneL();
       
  2251 
       
  2252 	RBuf8 completeData;
       
  2253 	CleanupClosePushL(completeData);	
       
  2254 	
       
  2255 	RMmCustomAPI customAPI;
       
  2256 	OpenCustomAPILC(customAPI, iPhone);
       
  2257 
       
  2258 	// Open second client
       
  2259 	RTelServer telServer2;
       
  2260 	TInt ret = telServer2.Connect();
       
  2261 	ASSERT_EQUALS(KErrNone, ret);
       
  2262 	CleanupClosePushL(telServer2);
       
  2263 
       
  2264 	RMobilePhone phone2;
       
  2265 	ret = phone2.Open(telServer2,KMmTsyPhoneName);
       
  2266 	ASSERT_EQUALS(KErrNone, ret);
       
  2267 	CleanupClosePushL(phone2);
       
  2268 	
       
  2269 	RMmCustomAPI customAPI2;
       
  2270 	CleanupClosePushL(customAPI2);
       
  2271 	customAPI2.Open(phone2);
       
  2272 	
       
  2273 	
       
  2274 	// data for the first GetAlsBlocked
       
  2275 	TRequestStatus reguestStatus;
       
  2276 	RMmCustomAPI::TGetAlsBlockStatus blockStatus(RMmCustomAPI::EBlockStatusUnknown);	
       
  2277 	// data for the first CompleteL
       
  2278 	RMmCustomAPI::TGetAlsBlockStatus completeBlockStatus(RMmCustomAPI::EBlockStatusInactive);
       
  2279 	TMockLtsyData1< RMmCustomAPI::TGetAlsBlockStatus > ltsyData(completeBlockStatus);	
       
  2280     ltsyData.SerialiseL(completeData);    
       
  2281     
       
  2282 	// data for the second GetAlsBlocked 
       
  2283 	TRequestStatus reguestStatus2;
       
  2284 	RMmCustomAPI::TGetAlsBlockStatus blockStatus2(RMmCustomAPI::EBlockStatusUnknown);	
       
  2285 
       
  2286 	//-------------------------------------------------------------------------
       
  2287 	// Test A: Test multiple clients requesting RMmCustomAPI::GetAlsBlocked
       
  2288  	//------------------------------------------------------------------------- 	
       
  2289  	// first request
       
  2290  	iMockLTSY.ExpectL(ECustomGetAlsBlockedIPC);
       
  2291 	iMockLTSY.CompleteL(ECustomGetAlsBlockedIPC, KErrNone, completeData, 10);		
       
  2292 	customAPI.GetAlsBlocked(reguestStatus, blockStatus);
       
  2293 	
       
  2294 	// second request
       
  2295  	customAPI2.GetAlsBlocked(reguestStatus2, blockStatus2);
       
  2296 	
       
  2297 	// wait for the first answer	
       
  2298 	User::WaitForRequest(reguestStatus);
       
  2299 	ASSERT_EQUALS(KErrNone, reguestStatus.Int());
       
  2300 	ASSERT_EQUALS(completeBlockStatus, blockStatus);
       
  2301 
       
  2302 	// wait for the second answer
       
  2303 	User::WaitForRequest(reguestStatus2);
       
  2304 	ASSERT_EQUALS(KErrServerBusy, reguestStatus2.Int());
       
  2305 	AssertMockLtsyStatusL();	
       
  2306 
       
  2307 	CleanupStack::PopAndDestroy(6, this); 
       
  2308 	
       
  2309 	}
       
  2310 
       
  2311 
       
  2312 /**
       
  2313 @SYMTestCaseID BA-CTSY-CIPC-MCGAB-0005
       
  2314 @SYMComponent  telephony_ctsy
       
  2315 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::GetAlsBlocked with timeout
       
  2316 @SYMTestPriority High
       
  2317 @SYMTestActions Invokes RMmCustomAPI::GetAlsBlocked and tests for timeout
       
  2318 @SYMTestExpectedResults Pass
       
  2319 @SYMTestType CT
       
  2320 */
       
  2321 void CCTsyCustomIPCFU::TestGetAlsBlocked0005L()
       
  2322 	{
       
  2323 	OpenEtelServerL(EUseExtendedError);
       
  2324 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  2325 	OpenPhoneL();
       
  2326 	
       
  2327 	RMmCustomAPI customAPI;
       
  2328 	OpenCustomAPILC(customAPI, iPhone);
       
  2329 	
       
  2330 	// data for GetAlsBlocked itself
       
  2331 	TRequestStatus reguestStatus;
       
  2332 	RMmCustomAPI::TGetAlsBlockStatus blockStatus(RMmCustomAPI::EBlockStatusUnknown);
       
  2333 	
       
  2334 	//-------------------------------------------------------------------------
       
  2335 	// Test A: Test timeout of RMmCustomAPI::GetAlsBlocked
       
  2336  	//-------------------------------------------------------------------------
       
  2337     iMockLTSY.ExpectL(ECustomGetAlsBlockedIPC);    
       
  2338     customAPI.GetAlsBlocked(reguestStatus, blockStatus);
       
  2339   	
       
  2340 	// wait for request completion	
       
  2341 	User::WaitForRequest(reguestStatus);
       
  2342 	
       
  2343 	ASSERT_EQUALS(KErrTimedOut, reguestStatus.Int());
       
  2344 	AssertMockLtsyStatusL(); 
       
  2345 	
       
  2346 	CleanupStack::PopAndDestroy(2, this); 
       
  2347 
       
  2348 	}
       
  2349 
       
  2350 
       
  2351 /**
       
  2352 @SYMTestCaseID BA-CTSY-CIPC-MCCAPS-0001
       
  2353 @SYMComponent  telephony_ctsy
       
  2354 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::CheckAlsPpSupport
       
  2355 @SYMTestPriority High
       
  2356 @SYMTestActions Invokes RMmCustomAPI::CheckAlsPpSupport
       
  2357 @SYMTestExpectedResults Pass
       
  2358 @SYMTestType CT
       
  2359 */
       
  2360 void CCTsyCustomIPCFU::TestCheckAlsPpSupport0001L()
       
  2361 	{
       
  2362 
       
  2363 	OpenEtelServerL(EUseExtendedError);
       
  2364 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  2365 	OpenPhoneL();
       
  2366 
       
  2367 	RBuf8 completeData;
       
  2368 	CleanupClosePushL(completeData);
       
  2369 	
       
  2370 	RMmCustomAPI customAPI;
       
  2371 	OpenCustomAPILC(customAPI, iPhone);
       
  2372 	
       
  2373 	// data for CompleteL
       
  2374 	RMmCustomAPI::TAlsSupport completeAlsSupport(RMmCustomAPI::EAlsSupportOff);
       
  2375 	TMockLtsyData1< RMmCustomAPI::TAlsSupport > ltsyData(completeAlsSupport);	
       
  2376     ltsyData.SerialiseL(completeData);   
       
  2377 	
       
  2378 	// data for CheckAlsPpSupport itself
       
  2379 	TRequestStatus reguestStatus;
       
  2380 	RMmCustomAPI::TAlsSupport alsSupport;
       
  2381 	
       
  2382  	//-------------------------------------------------------------------------
       
  2383 	// TEST A: failure to dispatch request to LTSY
       
  2384  	//-------------------------------------------------------------------------
       
  2385 	iMockLTSY.ExpectL(ECustomCheckAlsPpSupportIPC, KErrNotSupported); 
       
  2386 	
       
  2387 	customAPI.CheckAlsPpSupport(reguestStatus, alsSupport);
       
  2388 	
       
  2389 	User::WaitForRequest(reguestStatus);
       
  2390 	ASSERT_EQUALS(KErrNotSupported, reguestStatus.Int());	
       
  2391 	AssertMockLtsyStatusL();
       
  2392 
       
  2393 	//-------------------------------------------------------------------------
       
  2394 	// TEST B: failure on completion of pending request from LTSY->CTSY
       
  2395  	//-------------------------------------------------------------------------
       
  2396 	iMockLTSY.ExpectL(ECustomCheckAlsPpSupportIPC); 
       
  2397 	iMockLTSY.CompleteL(ECustomCheckAlsPpSupportIPC, KErrGeneral, completeData);
       
  2398 
       
  2399 	customAPI.CheckAlsPpSupport(reguestStatus, alsSupport);
       
  2400 	
       
  2401 	User::WaitForRequest(reguestStatus);	
       
  2402 	ASSERT_EQUALS(KErrGeneral, reguestStatus.Int());
       
  2403 	AssertMockLtsyStatusL();
       
  2404 
       
  2405  	//-------------------------------------------------------------------------
       
  2406 	// TEST C: Successful completion request of
       
  2407 	// RMmCustomAPI::CheckAlsPpSupport when result is not cached.
       
  2408  	//-------------------------------------------------------------------------
       
  2409 	iMockLTSY.ExpectL(ECustomCheckAlsPpSupportIPC); 
       
  2410 	iMockLTSY.CompleteL(ECustomCheckAlsPpSupportIPC, KErrNone, completeData);
       
  2411 
       
  2412 	customAPI.CheckAlsPpSupport(reguestStatus, alsSupport);
       
  2413 	
       
  2414 	User::WaitForRequest(reguestStatus);	
       
  2415 	ASSERT_EQUALS(KErrNone, reguestStatus.Int());
       
  2416 	ASSERT_EQUALS(completeAlsSupport, alsSupport);
       
  2417 	AssertMockLtsyStatusL();
       
  2418 
       
  2419  	//-------------------------------------------------------------------------
       
  2420 	// TEST C1 just to increase coverage
       
  2421  	//-------------------------------------------------------------------------
       
  2422 	// new data for CompleteL
       
  2423 	RMmCustomAPI::TAlsSupport completeAlsSupport2(RMmCustomAPI::EAlsSupportOn);
       
  2424 	TMockLtsyData1< RMmCustomAPI::TAlsSupport > ltsyData2(completeAlsSupport2);	
       
  2425 	completeData.Close();
       
  2426     ltsyData2.SerialiseL(completeData); 
       
  2427     
       
  2428     iMockLTSY.ExpectL(ECustomCheckAlsPpSupportIPC); 
       
  2429 	iMockLTSY.CompleteL(ECustomCheckAlsPpSupportIPC, KErrNone, completeData);
       
  2430 
       
  2431 	customAPI.CheckAlsPpSupport(reguestStatus, alsSupport);
       
  2432 	
       
  2433 	User::WaitForRequest(reguestStatus);	
       
  2434 	ASSERT_EQUALS(KErrNone, reguestStatus.Int());
       
  2435 	ASSERT_EQUALS(completeAlsSupport2, alsSupport);
       
  2436 	AssertMockLtsyStatusL();	
       
  2437 
       
  2438  	//-------------------------------------------------------------------------
       
  2439 	// TEST E: Unsolicited completion of RMmCustomAPI::CheckAlsPpSupport
       
  2440 	// from LTSY.
       
  2441  	//-------------------------------------------------------------------------
       
  2442 	TRequestStatus mockLtsyStatus;
       
  2443 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
  2444 	iMockLTSY.CompleteL(ECustomCheckAlsPpSupportIPC, KErrNone, completeData);
       
  2445 	User::WaitForRequest(mockLtsyStatus);
       
  2446 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());	
       
  2447 
       
  2448 	AssertMockLtsyStatusL();
       
  2449 	CleanupStack::PopAndDestroy(3, this); 
       
  2450 	
       
  2451 	}
       
  2452 
       
  2453 
       
  2454 /**
       
  2455 @SYMTestCaseID BA-CTSY-CIPC-MCCAPS-0002
       
  2456 @SYMComponent  telephony_ctsy
       
  2457 @SYMTestCaseDesc Test support in CTSY for cancelling of RMmCustomAPI::CheckAlsPpSupport
       
  2458 @SYMTestPriority High
       
  2459 @SYMTestActions Invokes cancelling of RMmCustomAPI::CheckAlsPpSupport
       
  2460 @SYMTestExpectedResults Pass
       
  2461 @SYMTestType CT
       
  2462 */
       
  2463 void CCTsyCustomIPCFU::TestCheckAlsPpSupport0002L()
       
  2464 	{
       
  2465 
       
  2466 	OpenEtelServerL(EUseExtendedError);
       
  2467 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  2468 	OpenPhoneL();
       
  2469 
       
  2470 	RBuf8 completeData;
       
  2471 	CleanupClosePushL(completeData);
       
  2472 	
       
  2473 	RMmCustomAPI customAPI;
       
  2474 	OpenCustomAPILC(customAPI, iPhone);
       
  2475 	
       
  2476 	// data for CompleteL
       
  2477 	RMmCustomAPI::TAlsSupport completeAlsSupport(RMmCustomAPI::EAlsSupportOff);
       
  2478 	TMockLtsyData1< RMmCustomAPI::TAlsSupport > ltsyData(completeAlsSupport);	
       
  2479     ltsyData.SerialiseL(completeData);   
       
  2480 	
       
  2481 	// data for CheckAlsPpSupport itself
       
  2482 	TRequestStatus reguestStatus;
       
  2483 	RMmCustomAPI::TAlsSupport alsSupport;
       
  2484 	
       
  2485 	TRequestStatus mockLtsyStatus;
       
  2486 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
  2487 
       
  2488  	//-------------------------------------------------------------------------
       
  2489 	// Test cancelling of RMmCustomAPI::CheckAlsPpSupport
       
  2490  	//------------------------------------------------------------------------- 	
       
  2491 	iMockLTSY.ExpectL(ECustomCheckAlsPpSupportIPC); 
       
  2492 	iMockLTSY.CompleteL(ECustomCheckAlsPpSupportIPC, KErrNone, completeData, 20);
       
  2493 	
       
  2494 	customAPI.CheckAlsPpSupport(reguestStatus, alsSupport);
       
  2495 
       
  2496 	customAPI.CancelAsyncRequest(ECustomCheckAlsPpSupportIPC);	
       
  2497 	
       
  2498 	User::WaitForRequest(reguestStatus);	
       
  2499 	ASSERT_EQUALS(KErrCancel, reguestStatus.Int());
       
  2500 	
       
  2501 	// Wait for completion of iMockLTSY.NotifyTerminated
       
  2502 	User::WaitForRequest(mockLtsyStatus);
       
  2503 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
  2504 	
       
  2505 	AssertMockLtsyStatusL();
       
  2506 	CleanupStack::PopAndDestroy(3, this); 
       
  2507 	
       
  2508 	}
       
  2509 
       
  2510 
       
  2511 
       
  2512 /**
       
  2513 @SYMTestCaseID BA-CTSY-CIPC-MCCAPS-0004
       
  2514 @SYMComponent  telephony_ctsy
       
  2515 @SYMTestCaseDesc Test support in CTSY for multiple client requests to RMmCustomAPI::CheckAlsPpSupport
       
  2516 @SYMTestPriority High
       
  2517 @SYMTestActions Invokes multiple client requests to RMmCustomAPI::CheckAlsPpSupport
       
  2518 @SYMTestExpectedResults Pass
       
  2519 @SYMTestType CT
       
  2520 */
       
  2521 void CCTsyCustomIPCFU::TestCheckAlsPpSupport0004L()
       
  2522 	{
       
  2523 					
       
  2524 	OpenEtelServerL(EUseExtendedError);
       
  2525 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  2526 	OpenPhoneL();
       
  2527 
       
  2528 	RBuf8 completeData;
       
  2529 	CleanupClosePushL(completeData);
       
  2530 	
       
  2531 	RMmCustomAPI customAPI;
       
  2532 	OpenCustomAPILC(customAPI, iPhone);
       
  2533 
       
  2534 	// Open second client
       
  2535 	RTelServer telServer2;
       
  2536 	TInt ret = telServer2.Connect();
       
  2537 	ASSERT_EQUALS(KErrNone, ret);
       
  2538 	CleanupClosePushL(telServer2);
       
  2539 
       
  2540 	RMobilePhone phone2;
       
  2541 	ret = phone2.Open(telServer2,KMmTsyPhoneName);
       
  2542 	ASSERT_EQUALS(KErrNone, ret);
       
  2543 	CleanupClosePushL(phone2);
       
  2544 	
       
  2545 	RBuf8 completeData2;
       
  2546 	CleanupClosePushL(completeData2);
       
  2547 	
       
  2548 	RMmCustomAPI customAPI2;
       
  2549 	OpenCustomAPILC(customAPI2, phone2, EFalse);
       
  2550 	
       
  2551 	// data for the first CompleteL
       
  2552 	RMmCustomAPI::TAlsSupport completeAlsSupport(RMmCustomAPI::EAlsSupportOff);
       
  2553 	TMockLtsyData1< RMmCustomAPI::TAlsSupport > ltsyData(completeAlsSupport);	
       
  2554     ltsyData.SerialiseL(completeData);   
       
  2555 	
       
  2556 	// data for the first CheckAlsPpSupport itself
       
  2557 	TRequestStatus reguestStatus;
       
  2558 	RMmCustomAPI::TAlsSupport alsSupport;
       
  2559 	
       
  2560 	// data for the second CheckAlsPpSupport itself
       
  2561 	TRequestStatus reguestStatus2;
       
  2562 	RMmCustomAPI::TAlsSupport alsSupport2;	
       
  2563 
       
  2564 	//-------------------------------------------------------------------------
       
  2565 	// Test A: Test multiple clients requesting RMmCustomAPI::CheckAlsPpSupport
       
  2566  	//-------------------------------------------------------------------------
       
  2567 	// send first request
       
  2568 	iMockLTSY.ExpectL(ECustomCheckAlsPpSupportIPC); 
       
  2569 	iMockLTSY.CompleteL(ECustomCheckAlsPpSupportIPC, KErrNone, completeData, 10);
       
  2570 	customAPI.CheckAlsPpSupport(reguestStatus, alsSupport);
       
  2571 	
       
  2572 	// send second request
       
  2573 	customAPI2.CheckAlsPpSupport(reguestStatus2, alsSupport2);
       
  2574 	
       
  2575 	// wait for the first answer
       
  2576 	User::WaitForRequest(reguestStatus);	
       
  2577 	ASSERT_EQUALS(KErrNone, reguestStatus.Int());	
       
  2578 	ASSERT_EQUALS(completeAlsSupport, alsSupport);
       
  2579 		
       
  2580 	// wait for the second answer
       
  2581 	User::WaitForRequest(reguestStatus2);	
       
  2582 	ASSERT_EQUALS(KErrNone, reguestStatus2.Int());	
       
  2583 	ASSERT_EQUALS(completeAlsSupport, alsSupport2);
       
  2584 	AssertMockLtsyStatusL();
       
  2585 	
       
  2586 	CleanupStack::PopAndDestroy(7, this); 
       
  2587 	}
       
  2588 
       
  2589 
       
  2590 /**
       
  2591 @SYMTestCaseID BA-CTSY-CIPC-MCCAPS-0005
       
  2592 @SYMComponent  telephony_ctsy
       
  2593 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::CheckAlsPpSupport with timeout
       
  2594 @SYMTestPriority High
       
  2595 @SYMTestActions Invokes RMmCustomAPI::CheckAlsPpSupport and tests for timeout
       
  2596 @SYMTestExpectedResults Pass
       
  2597 @SYMTestType CT
       
  2598 */
       
  2599 void CCTsyCustomIPCFU::TestCheckAlsPpSupport0005L()
       
  2600 	{
       
  2601 	
       
  2602 	OpenEtelServerL(EUseExtendedError);
       
  2603 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  2604 	OpenPhoneL();
       
  2605 
       
  2606 	RMmCustomAPI customAPI;
       
  2607 	OpenCustomAPILC(customAPI, iPhone);
       
  2608 		
       
  2609 	// data for CheckAlsPpSupport itself
       
  2610 	TRequestStatus reguestStatus;
       
  2611 	RMmCustomAPI::TAlsSupport alsSupport;
       
  2612 
       
  2613 	//-------------------------------------------------------------------------
       
  2614 	// Test A: Test timeout of RMmCustomAPI::CheckAlsPpSupport
       
  2615  	//-------------------------------------------------------------------------
       
  2616 	iMockLTSY.ExpectL(ECustomCheckAlsPpSupportIPC); 	
       
  2617 	customAPI.CheckAlsPpSupport(reguestStatus, alsSupport);
       
  2618 	
       
  2619 	// There is no time out for this IPC (ECustomCheckAlsPpSupportIPC)
       
  2620 	User::WaitForRequest(reguestStatus);
       
  2621 	ASSERT_EQUALS(KErrTimedOut, reguestStatus.Int());	
       
  2622 	AssertMockLtsyStatusL();
       
  2623 	
       
  2624 	CleanupStack::PopAndDestroy(2, this); 
       
  2625 	}
       
  2626 
       
  2627 
       
  2628 /**
       
  2629 @SYMTestCaseID BA-CTSY-CIPC-MCGRATS-0001
       
  2630 @SYMComponent  telephony_ctsy
       
  2631 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::GetRemoteAlertingToneStatus
       
  2632 @SYMTestPriority High
       
  2633 @SYMTestActions Invokes RMmCustomAPI::GetRemoteAlertingToneStatus
       
  2634 @SYMTestExpectedResults Pass
       
  2635 @SYMTestType CT
       
  2636 */
       
  2637 void CCTsyCustomIPCFU::TestGetRemoteAlertingToneStatus0001L()
       
  2638 	{
       
  2639 
       
  2640 	OpenEtelServerL(EUseExtendedError);
       
  2641 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  2642 	OpenPhoneL();
       
  2643 	
       
  2644 	RBuf8 completeData;
       
  2645 	CleanupClosePushL(completeData);
       
  2646 
       
  2647 	RMmCustomAPI customAPI;
       
  2648 	OpenCustomAPILC(customAPI, iPhone);
       
  2649 	
       
  2650 	//-------------------------------------------------------------------------
       
  2651 	// TEST Get initial toneStatus
       
  2652  	//-------------------------------------------------------------------------
       
  2653 	RMmCustomAPI::TRemoteAlertingToneStatus expectedStatus(RMmCustomAPI::EUiNoTone);
       
  2654 	RMmCustomAPI::TRemoteAlertingToneStatus toneStatus;	
       
  2655 	
       
  2656 	customAPI.GetRemoteAlertingToneStatus(toneStatus);
       
  2657 		
       
  2658 	ASSERT_EQUALS(expectedStatus, toneStatus);	
       
  2659 	AssertMockLtsyStatusL();	
       
  2660 
       
  2661  	//-------------------------------------------------------------------------
       
  2662 	// TEST D: RMmCustomAPI::GetRemoteAlertingToneStatus again, this time CTSY
       
  2663 	// will get result from the cache.
       
  2664  	//-------------------------------------------------------------------------
       
  2665  	 	
       
  2666  	// --- change tone status --- 	
       
  2667  	TRequestStatus mockLtsyStatus;
       
  2668 	iMockLTSY.NotifyTerminated(mockLtsyStatus);	
       
  2669 	// data for changing
       
  2670 	TBool playRemoteAlertToneLocally (ETrue);
       
  2671 	TMockLtsyData1<TBool> ltsyData(playRemoteAlertToneLocally);	
       
  2672     ltsyData.SerialiseL(completeData);  
       
  2673 		
       
  2674 	iMockLTSY.CompleteL(ECustomGetRemoteAlertingToneStatusIPC, KErrNone, completeData);
       
  2675 	User::WaitForRequest(mockLtsyStatus);
       
  2676 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());	
       
  2677 	// new expected Status
       
  2678 	expectedStatus = RMmCustomAPI::EUiRbtTone;
       
  2679 	// --------------------------
       
  2680 		
       
  2681 	// get changed data
       
  2682 	customAPI.GetRemoteAlertingToneStatus(toneStatus);
       
  2683 		
       
  2684 	ASSERT_EQUALS(expectedStatus, toneStatus);	
       
  2685 	AssertMockLtsyStatusL();	
       
  2686 	
       
  2687 	//-------------------------------------------------------------------------
       
  2688 	// TEST D2: just for coverage increasing
       
  2689  	//-------------------------------------------------------------------------
       
  2690  	
       
  2691  	// --- change tone status --- 	
       
  2692  	iMockLTSY.NotifyTerminated(mockLtsyStatus);	
       
  2693 	// data for changing
       
  2694 	playRemoteAlertToneLocally = EFalse;
       
  2695 	TMockLtsyData1<TBool> ltsyData2(playRemoteAlertToneLocally);
       
  2696 	completeData.Close();	
       
  2697     ltsyData2.SerialiseL(completeData);  
       
  2698 		
       
  2699 	iMockLTSY.CompleteL(ECustomGetRemoteAlertingToneStatusIPC, KErrNone, completeData);
       
  2700 	User::WaitForRequest(mockLtsyStatus);
       
  2701 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());	
       
  2702 	// new expected Status
       
  2703 	expectedStatus = RMmCustomAPI::EUiStopTone;
       
  2704 	// --------------------------
       
  2705 		
       
  2706 	// get changed data
       
  2707 	customAPI.GetRemoteAlertingToneStatus(toneStatus);
       
  2708 		
       
  2709 	ASSERT_EQUALS(expectedStatus, toneStatus);	
       
  2710 	AssertMockLtsyStatusL();
       
  2711 	
       
  2712 	CleanupStack::PopAndDestroy(3, this); 
       
  2713 	}
       
  2714 
       
  2715 
       
  2716 /**
       
  2717 @SYMTestCaseID BA-CTSY-CIPC-MCCO-0001
       
  2718 @SYMComponent  telephony_ctsy
       
  2719 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::CallOrigin
       
  2720 @SYMTestPriority High
       
  2721 @SYMTestActions Invokes RMmCustomAPI::CallOrigin
       
  2722 @SYMTestExpectedResults Pass
       
  2723 @SYMTestType CT
       
  2724 */
       
  2725 void CCTsyCustomIPCFU::TestCallOrigin0001L()
       
  2726 	{
       
  2727 
       
  2728 	OpenEtelServerL(EUseExtendedError);
       
  2729 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  2730 	OpenPhoneL();
       
  2731 
       
  2732 	RMmCustomAPI customAPI;
       
  2733 	OpenCustomAPILC(customAPI, iPhone);
       
  2734 	
       
  2735 	RBuf8 completeData;
       
  2736 	CleanupClosePushL(completeData);
       
  2737 
       
  2738 	// data for CallOrigin itself
       
  2739 	TName callName;
       
  2740     RMmCustomAPI::TCallOrigin origin;    
       
  2741     	
       
  2742 	//-------------------------------------------------------------------------
       
  2743 	// TEST: Get origin for non-existing call
       
  2744  	//-------------------------------------------------------------------------	
       
  2745 	customAPI.CallOrigin(callName, origin);			
       
  2746 	ASSERT_EQUALS(RMmCustomAPI::EUnknown, origin);
       
  2747 	AssertMockLtsyStatusL();
       
  2748 	
       
  2749 	//-------------------------------------------------------------------------
       
  2750 	// TEST: Get origin for call created through ETel
       
  2751  	//-------------------------------------------------------------------------	
       
  2752  	RLine line;
       
  2753 	RCall call;
       
  2754    	// Open Line and Call
       
  2755     TInt errorCode = line.Open(iPhone, KMmTsyVoice1LineName);    
       
  2756 	ASSERT_EQUALS(KErrNone, errorCode);	
       
  2757 	CleanupClosePushL(line);
       
  2758 	TInt callId = 1;
       
  2759     RMobilePhone::TMobileService mobileService = RMobilePhone::EVoiceService;
       
  2760     RMobileCall::TMobileCallStatus mobileCallStatus = RMobileCall::EStatusRinging;
       
  2761 	
       
  2762 	// create new incoming call
       
  2763 	errorCode = CreateIncomingCallL(line, callId, KMmTsyVoice1LineName,callName, 
       
  2764 	                               mobileService, mobileCallStatus);	
       
  2765 	ASSERT_EQUALS(KErrNone, errorCode);		
       
  2766 	CleanupClosePushL(call);		
       
  2767 	
       
  2768     errorCode = call.OpenExistingCall(line, callName);
       
  2769     ASSERT_EQUALS(KErrNone, errorCode);   
       
  2770     
       
  2771     //Get origin for call created through ETel    		
       
  2772 	customAPI.CallOrigin(callName, origin);			
       
  2773 	ASSERT_EQUALS(RMmCustomAPI::EETelCall, origin);
       
  2774 	AssertMockLtsyStatusL();
       
  2775 	
       
  2776 	//-------------------------------------------------------------------------
       
  2777 	// TEST: Get origin for Ghost call (NOT created through ETel)
       
  2778  	//-------------------------------------------------------------------------		
       
  2779  	TRequestStatus requestStatus;
       
  2780  	// for getting ghost call name 
       
  2781 	TName ghostCallName;
       
  2782  	line.NotifyCallAdded(requestStatus, ghostCallName);
       
  2783  	
       
  2784  	// ------------ Create ghost call -----------------------------------------
       
  2785 	TRequestStatus mockLtsyStatus;
       
  2786 	iMockLTSY.NotifyTerminated(mockLtsyStatus);		
       
  2787 	RMobileCall::TMobileCallInfoV1 callInfo;	
       
  2788 	callId = 2;
       
  2789 	callInfo.iCallId = callId;
       
  2790 	callInfo.iStatus = RMobileCall::EStatusDialling;
       
  2791 	callInfo.iService = mobileService;	
       
  2792 
       
  2793 	TMockLtsyCallData1<RMobileCall::TMobileCallInfoV1> callInfoData(callId, mobileService, callInfo);
       
  2794 	callInfoData.SerialiseL(completeData);		
       
  2795     iMockLTSY.CompleteL(EMobileCallGetMobileCallInfo, KErrNone, completeData);
       
  2796     
       
  2797     User::WaitForRequest(mockLtsyStatus);
       
  2798 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
  2799 	//-------------------------------------------------------------------------
       
  2800 	
       
  2801 	// wait for NotifyCallAdded (for getting ghost call name)
       
  2802 	User::WaitForRequest(requestStatus);
       
  2803 	ASSERT_EQUALS(KErrNone, requestStatus.Int());	
       
  2804 	
       
  2805 	//Get origin for call NOT created through ETel    		
       
  2806 	customAPI.CallOrigin(ghostCallName, origin);		
       
  2807 
       
  2808 	ASSERT_EQUALS(RMmCustomAPI::EOutsider, origin);		
       
  2809 	AssertMockLtsyStatusL();
       
  2810 	
       
  2811 	CleanupStack::PopAndDestroy(5, this); 	
       
  2812 	}
       
  2813 
       
  2814 
       
  2815 
       
  2816 /**
       
  2817 @SYMTestCaseID BA-CTSY-CIPC-MCTC-0001
       
  2818 @SYMComponent  telephony_ctsy
       
  2819 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::TerminateCall
       
  2820 @SYMTestPriority High
       
  2821 @SYMTestActions Invokes RMmCustomAPI::TerminateCall
       
  2822 @SYMTestExpectedResults Pass
       
  2823 @SYMTestType CT
       
  2824 */
       
  2825 void CCTsyCustomIPCFU::TestTerminateCall0001L()
       
  2826 	{
       
  2827 
       
  2828 	OpenEtelServerL(EUseExtendedError);
       
  2829 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  2830 	OpenPhoneL();
       
  2831 
       
  2832 	RBuf8 expectData;
       
  2833 	CleanupClosePushL(expectData);
       
  2834 
       
  2835 	TRequestStatus requestStatus;
       
  2836     TRequestStatus mockLtsyStatus;
       
  2837 
       
  2838     TName callName;
       
  2839 	TBool isError(ETrue);
       
  2840 	TInt callId(1);
       
  2841 	RLine line;
       
  2842 	RCall call;
       
  2843 
       
  2844 	RMmCustomAPI customAPI;
       
  2845 	OpenCustomAPILC(customAPI, iPhone);
       
  2846 
       
  2847 	OpenLineLC(line, iPhone, KMmTsyVoice1LineName);
       
  2848 
       
  2849 	CreateAndOpenIncomingCalLC(line, call, callName, KMmTsyVoice1LineName, 
       
  2850 								callId, RMobileCall::EStatusRinging, RMobilePhone::EVoiceService);
       
  2851 
       
  2852 	//-------------------------------------------------------------------------
       
  2853 	// TEST A: failure to dispatch request to LTSY
       
  2854  	//-------------------------------------------------------------------------
       
  2855 
       
  2856 	TMockLtsyData2<TInt, TBool> mockData2(callId, isError);
       
  2857 	mockData2.SerialiseL(expectData);
       
  2858     iMockLTSY.ExpectL(ECustomTerminateCallIPC, expectData, KErrNotSupported);
       
  2859     customAPI.TerminateCall(requestStatus, callName);
       
  2860     User::WaitForRequest(requestStatus);
       
  2861     AssertMockLtsyStatusL();
       
  2862     ASSERT_EQUALS(KErrNotSupported, requestStatus.Int());
       
  2863 
       
  2864 	//-------------------------------------------------------------------------
       
  2865 	// TEST B: failure on completion of pending request from LTSY->CTSY
       
  2866  	//-------------------------------------------------------------------------
       
  2867 
       
  2868     iMockLTSY.ExpectL(ECustomTerminateCallIPC, expectData);
       
  2869     iMockLTSY.CompleteL(ECustomTerminateCallIPC, KErrGeneral);
       
  2870     customAPI.TerminateCall(requestStatus, callName);
       
  2871     User::WaitForRequest(requestStatus);
       
  2872     AssertMockLtsyStatusL();
       
  2873     ASSERT_EQUALS(KErrGeneral, requestStatus.Int());
       
  2874 
       
  2875  	//-------------------------------------------------------------------------
       
  2876 	// TEST C: Successful completion request of
       
  2877 	// RMmCustomAPI::TerminateCall when result is not cached.
       
  2878  	//-------------------------------------------------------------------------
       
  2879 
       
  2880 	iMockLTSY.ExpectL(ECustomTerminateCallIPC, expectData, KErrNone);
       
  2881 	iMockLTSY.CompleteL(ECustomTerminateCallIPC, KErrNone);
       
  2882 	customAPI.TerminateCall(requestStatus, callName);
       
  2883 	User::WaitForRequest(requestStatus);
       
  2884 	AssertMockLtsyStatusL();
       
  2885 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
  2886 
       
  2887  	//-------------------------------------------------------------------------
       
  2888 	// TEST E: Unsolicited completion of RMmCustomAPI::TerminateCall
       
  2889 	// from LTSY.
       
  2890  	//-------------------------------------------------------------------------
       
  2891 
       
  2892 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
  2893 	iMockLTSY.CompleteL(ECustomTerminateCallIPC, KErrNone);
       
  2894 	User::WaitForRequest(mockLtsyStatus);
       
  2895 	AssertMockLtsyStatusL();
       
  2896 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
  2897 
       
  2898  	//-------------------------------------------------------------------------
       
  2899 	// TerminateCall with KTerminateAllCalls
       
  2900  	//-------------------------------------------------------------------------
       
  2901 
       
  2902 	callName.Copy(KTerminateAllCalls);
       
  2903 	customAPI.TerminateCall(requestStatus, callName);
       
  2904 	User::WaitForRequest(requestStatus);
       
  2905 	AssertMockLtsyStatusL();
       
  2906 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
  2907 
       
  2908 
       
  2909  	//-------------------------------------------------------------------------
       
  2910 	// TerminateCall with KTerminateAllCalls when there is a call with EStatusConnecting
       
  2911  	//-------------------------------------------------------------------------
       
  2912 
       
  2913 	RCall call2;
       
  2914 	callId = 2;
       
  2915 
       
  2916 	CreateAndOpenIncomingCalLC(line, call2, callName, KMmTsyVoice1LineName, 
       
  2917 								callId, RMobileCall::EStatusConnecting, RMobilePhone::EVoiceService);
       
  2918 
       
  2919 	callName.Copy(KTerminateAllCalls);
       
  2920 	callId = (-callId);
       
  2921 	isError = EFalse;
       
  2922 	TMockLtsyData2<TInt, TBool> mockData2b(callId, isError);
       
  2923 	expectData.Close();
       
  2924 	mockData2b.SerialiseL(expectData);
       
  2925 	iMockLTSY.ExpectL(ECustomTerminateCallIPC, expectData, KErrNone);
       
  2926 	iMockLTSY.CompleteL(ECustomTerminateCallIPC, KErrNone);
       
  2927 	customAPI.TerminateCall(requestStatus, callName);
       
  2928 	User::WaitForRequest(requestStatus);
       
  2929 	AssertMockLtsyStatusL();
       
  2930 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
  2931 
       
  2932 
       
  2933 	CleanupStack::PopAndDestroy(6, this); 
       
  2934 	}
       
  2935 
       
  2936 
       
  2937 /**
       
  2938 @SYMTestCaseID BA-CTSY-CIPC-MCTC-0002
       
  2939 @SYMComponent  telephony_ctsy
       
  2940 @SYMTestCaseDesc Test support in CTSY for cancelling of RMmCustomAPI::TerminateCall
       
  2941 @SYMTestPriority High
       
  2942 @SYMTestActions Invokes cancelling of RMmCustomAPI::TerminateCall
       
  2943 @SYMTestExpectedResults Pass
       
  2944 @SYMTestType CT
       
  2945 */
       
  2946 void CCTsyCustomIPCFU::TestTerminateCall0002L()
       
  2947 	{
       
  2948 
       
  2949 	OpenEtelServerL(EUseExtendedError);
       
  2950 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  2951 	OpenPhoneL();
       
  2952 
       
  2953 	RBuf8 expectData;
       
  2954 	CleanupClosePushL(expectData);
       
  2955 
       
  2956 	TRequestStatus requestStatus;
       
  2957     TRequestStatus mockLtsyStatus;
       
  2958 
       
  2959     TName callName;
       
  2960 	TBool isError(ETrue);
       
  2961 	TInt callId(1);
       
  2962 	RLine line;
       
  2963 	RCall call;
       
  2964 	
       
  2965 	RMmCustomAPI customAPI;
       
  2966 	OpenCustomAPILC(customAPI, iPhone);
       
  2967 	
       
  2968 	OpenLineLC(line, iPhone, KMmTsyVoice1LineName);
       
  2969 	
       
  2970 	CreateAndOpenIncomingCalLC(line, call, callName, KMmTsyVoice1LineName, 
       
  2971 								callId, RMobileCall::EStatusRinging, RMobilePhone::EVoiceService);
       
  2972 
       
  2973  	//-------------------------------------------------------------------------
       
  2974 	// Test cancelling of RMmCustomAPI::TerminateCall
       
  2975  	//-------------------------------------------------------------------------
       
  2976 
       
  2977 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
  2978  	
       
  2979 	TMockLtsyData2<TInt, TBool> mockData2(callId, isError);
       
  2980 	mockData2.SerialiseL(expectData);
       
  2981     iMockLTSY.ExpectL(ECustomTerminateCallIPC, expectData);
       
  2982     iMockLTSY.CompleteL(ECustomTerminateCallIPC, KErrNone, 10);
       
  2983 	
       
  2984     customAPI.TerminateCall(requestStatus, callName);
       
  2985     customAPI.CancelAsyncRequest(ECustomTerminateCallIPC);
       
  2986 		
       
  2987 	User::WaitForRequest(mockLtsyStatus);
       
  2988 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
  2989 
       
  2990     User::WaitForRequest(requestStatus);
       
  2991     ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
  2992 
       
  2993     AssertMockLtsyStatusL();
       
  2994 
       
  2995     CleanupStack::PopAndDestroy(5); 
       
  2996 	
       
  2997 	}
       
  2998 
       
  2999 
       
  3000 /**
       
  3001 @SYMTestCaseID BA-CTSY-CIPC-MCTC-0003
       
  3002 @SYMComponent  telephony_ctsy
       
  3003 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::TerminateCall with bad parameter data
       
  3004 @SYMTestPriority High
       
  3005 @SYMTestActions Invokes RMmCustomAPI::TerminateCall with bad parameter data
       
  3006 @SYMTestExpectedResults Pass
       
  3007 @SYMTestType CT
       
  3008 */
       
  3009 void CCTsyCustomIPCFU::TestTerminateCall0003L()
       
  3010 	{
       
  3011 
       
  3012 	OpenEtelServerL(EUseExtendedError);
       
  3013 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  3014 	OpenPhoneL();
       
  3015 
       
  3016 	TRequestStatus requestStatus;
       
  3017     TRequestStatus mockLtsyStatus;
       
  3018 
       
  3019     TName callName;
       
  3020 	RMmCustomAPI customAPI;
       
  3021 	OpenCustomAPILC(customAPI, iPhone);
       
  3022 
       
  3023 	//-------------------------------------------------------------------------
       
  3024 	// Test passing callName with length equals null
       
  3025 	//-------------------------------------------------------------------------
       
  3026 
       
  3027     customAPI.TerminateCall(requestStatus, callName);
       
  3028     User::WaitForRequest(requestStatus);
       
  3029     AssertMockLtsyStatusL();
       
  3030     ASSERT_EQUALS(KErrNotFound, requestStatus.Int());
       
  3031 
       
  3032 	//-------------------------------------------------------------------------
       
  3033 	// Test A: Test passing wrong version of parameters to
       
  3034 	// RMmCustomAPI::TerminateCall
       
  3035  	//-------------------------------------------------------------------------
       
  3036 
       
  3037     _LIT(KBadParam, "Bad name");
       
  3038     callName.Copy(KBadParam);
       
  3039     customAPI.TerminateCall(requestStatus, callName);
       
  3040     User::WaitForRequest(requestStatus);
       
  3041     AssertMockLtsyStatusL();
       
  3042     ASSERT_EQUALS(KErrNotFound, requestStatus.Int());
       
  3043 
       
  3044 	CleanupStack::PopAndDestroy(2, this); 
       
  3045 
       
  3046 	}
       
  3047 
       
  3048 
       
  3049 /**
       
  3050 @SYMTestCaseID BA-CTSY-CIPC-MCTC-0004
       
  3051 @SYMComponent  telephony_ctsy
       
  3052 @SYMTestCaseDesc Test support in CTSY for multiple client requests to RMmCustomAPI::TerminateCall
       
  3053 @SYMTestPriority High
       
  3054 @SYMTestActions Invokes multiple client requests to RMmCustomAPI::TerminateCall
       
  3055 @SYMTestExpectedResults Pass
       
  3056 @SYMTestType CT
       
  3057 */
       
  3058 void CCTsyCustomIPCFU::TestTerminateCall0004L()
       
  3059 	{
       
  3060 					
       
  3061 	OpenEtelServerL(EUseExtendedError);
       
  3062 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  3063 	OpenPhoneL();
       
  3064 
       
  3065 	// Open second client
       
  3066 	RTelServer telServer2;
       
  3067 	TInt ret = telServer2.Connect();
       
  3068 	ASSERT_EQUALS(KErrNone, ret);
       
  3069 	CleanupClosePushL(telServer2);
       
  3070 
       
  3071 	TRequestStatus requestStatus1;
       
  3072 	TRequestStatus requestStatus2;
       
  3073 
       
  3074 	RMobilePhone phone2;
       
  3075 	ret = phone2.Open(iTelServer,KMmTsyPhoneName);
       
  3076 	ASSERT_EQUALS(KErrNone, ret);
       
  3077 	CleanupClosePushL(phone2);
       
  3078 
       
  3079 	RBuf8 expectData;
       
  3080 	CleanupClosePushL(expectData);
       
  3081 
       
  3082 	TRequestStatus requestStatus;
       
  3083     TRequestStatus mockLtsyStatus;
       
  3084 
       
  3085 	//-------------------------------------------------------------------------
       
  3086 	// Calls of functions for first client. 
       
  3087  	//-------------------------------------------------------------------------
       
  3088 
       
  3089     TName callName1;
       
  3090 	TBool isError(ETrue);
       
  3091 	TInt callId1(1);
       
  3092 
       
  3093 	RLine line1;
       
  3094 	RCall call1;
       
  3095 	
       
  3096 	RMmCustomAPI customAPI1;
       
  3097 	OpenCustomAPILC(customAPI1, iPhone);
       
  3098 
       
  3099 	OpenLineLC(line1, iPhone, KMmTsyVoice1LineName);
       
  3100 
       
  3101 	CreateAndOpenIncomingCalLC(line1, call1, callName1, KMmTsyVoice1LineName, 
       
  3102 								callId1, RMobileCall::EStatusRinging, RMobilePhone::EVoiceService);
       
  3103 
       
  3104 	//-------------------------------------------------------------------------
       
  3105 	// Calls of functions for second client. 
       
  3106  	//-------------------------------------------------------------------------
       
  3107 
       
  3108     TName callName2;
       
  3109 	TInt callId2(2);
       
  3110 
       
  3111 	RLine line2;
       
  3112 	RCall call2;
       
  3113 	RMmCustomAPI customAPI2;
       
  3114 
       
  3115 	OpenCustomAPILC(customAPI2, phone2, EFalse);
       
  3116 
       
  3117 	OpenLineLC(line2, phone2, KMmTsyVoice1LineName);
       
  3118 
       
  3119 	CreateAndOpenIncomingCalLC(line2, call2, callName2, KMmTsyVoice1LineName, 
       
  3120 								callId2, RMobileCall::EStatusRinging, RMobilePhone::EVoiceService);
       
  3121 
       
  3122 	//-------------------------------------------------------------------------
       
  3123 	// Test A: Test multiple clients requesting RMmCustomAPI::TerminateCall
       
  3124  	//-------------------------------------------------------------------------
       
  3125 
       
  3126 	TMockLtsyData2<TInt, TBool> mockData21(callId1, isError);
       
  3127 	mockData21.SerialiseL(expectData);
       
  3128 	iMockLTSY.ExpectL(ECustomTerminateCallIPC, expectData, KErrNone);
       
  3129 	iMockLTSY.CompleteL(ECustomTerminateCallIPC, KErrNone, 20);
       
  3130 	customAPI1.TerminateCall(requestStatus1, callName1);
       
  3131 
       
  3132 	customAPI2.TerminateCall(requestStatus2, callName2);
       
  3133 
       
  3134 	User::WaitForRequest(requestStatus1);
       
  3135 	ASSERT_EQUALS(KErrNone, requestStatus1.Int());
       
  3136 
       
  3137 	User::WaitForRequest(requestStatus2);
       
  3138 	ASSERT_EQUALS(KErrServerBusy, requestStatus2.Int());
       
  3139 
       
  3140 	AssertMockLtsyStatusL();
       
  3141 
       
  3142 	CleanupStack::PopAndDestroy(10, this);
       
  3143 	}
       
  3144 
       
  3145 
       
  3146 /**
       
  3147 @SYMTestCaseID BA-CTSY-CIPC-MCTC-0005
       
  3148 @SYMComponent  telephony_ctsy
       
  3149 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::TerminateCall with timeout
       
  3150 @SYMTestPriority High
       
  3151 @SYMTestActions Invokes RMmCustomAPI::TerminateCall and tests for timeout
       
  3152 @SYMTestExpectedResults Pass
       
  3153 @SYMTestType CT
       
  3154 */
       
  3155 void CCTsyCustomIPCFU::TestTerminateCall0005L()
       
  3156 	{
       
  3157 
       
  3158 	OpenEtelServerL(EUseExtendedError);
       
  3159 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  3160 	OpenPhoneL();
       
  3161 
       
  3162 	RBuf8 expectData;
       
  3163 	CleanupClosePushL(expectData);
       
  3164 
       
  3165 	TRequestStatus requestStatus;
       
  3166 
       
  3167     TName callName;
       
  3168 	TBool isError(ETrue);
       
  3169 	TInt callId(1);
       
  3170 	RLine line;
       
  3171 	RCall call;
       
  3172 	RMmCustomAPI customAPI;
       
  3173 	
       
  3174 	OpenCustomAPILC(customAPI, iPhone);
       
  3175 
       
  3176 	OpenLineLC(line, iPhone, KMmTsyVoice1LineName);
       
  3177 
       
  3178 	CreateAndOpenIncomingCalLC(line, call, callName, KMmTsyVoice1LineName, 
       
  3179 								callId, RMobileCall::EStatusRinging, RMobilePhone::EVoiceService);
       
  3180 
       
  3181 	//-------------------------------------------------------------------------
       
  3182 	// Test A: Test timeout of RMmCustomAPI::TerminateCall
       
  3183  	//-------------------------------------------------------------------------
       
  3184 
       
  3185 	TMockLtsyData2<TInt, TBool> mockData2(callId, isError);
       
  3186 	mockData2.SerialiseL(expectData);
       
  3187 	iMockLTSY.ExpectL(ECustomTerminateCallIPC, expectData, KErrNone);
       
  3188 	customAPI.TerminateCall(requestStatus, callName);
       
  3189 	User::WaitForRequest(requestStatus);
       
  3190 	AssertMockLtsyStatusL();
       
  3191 	ASSERT_EQUALS(KErrTimedOut, requestStatus.Int());
       
  3192 
       
  3193 	CleanupStack::PopAndDestroy(5, this); 
       
  3194 	}
       
  3195 
       
  3196 
       
  3197 /**
       
  3198 @SYMTestCaseID BA-CTSY-CIPC-MCBABC-0001
       
  3199 @SYMComponent  telephony_ctsy
       
  3200 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::NotifyAlsBlockedChanged
       
  3201 @SYMTestPriority High
       
  3202 @SYMTestActions Invokes RMmCustomAPI::NotifyAlsBlockedChanged
       
  3203 @SYMTestExpectedResults Pass
       
  3204 @SYMTestType CT
       
  3205 */
       
  3206 void CCTsyCustomIPCFU::TestNotifyAlsBlockedChanged0001L()
       
  3207 	{
       
  3208 
       
  3209 	OpenEtelServerL(EUseExtendedError);
       
  3210 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  3211 	OpenPhoneL();
       
  3212 
       
  3213 	TRequestStatus requestStatus;
       
  3214 	RMmCustomAPI::TGetAlsBlockStatus completeBlockStatus;
       
  3215 	RMmCustomAPI::TSetAlsBlock blockStatus(RMmCustomAPI::EActivateBlock);
       
  3216 	RMmCustomAPI customAPI;
       
  3217 
       
  3218 	RBuf8 expectData;
       
  3219 	CleanupClosePushL(expectData);
       
  3220 
       
  3221 	OpenCustomAPILC(customAPI, iPhone);
       
  3222 
       
  3223  	//-------------------------------------------------------------------------
       
  3224 	// TEST E: Unsolicited completion of RMmCustomAPI::NotifyAlsBlockedChanged
       
  3225 	// from LTSY.
       
  3226 	// Must be first because the request is self-reposting
       
  3227  	//-------------------------------------------------------------------------
       
  3228 
       
  3229 	TRequestStatus mockLtsyStatus;
       
  3230 
       
  3231 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
  3232 	iMockLTSY.CompleteL(ECustomNotifyAlsBlockedChangedIPC, KErrNone);
       
  3233 	User::WaitForRequest(mockLtsyStatus);
       
  3234 	AssertMockLtsyStatusL();
       
  3235 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
  3236 
       
  3237 
       
  3238 	//-------------------------------------------------------------------------
       
  3239 	// TEST C: Successful completion request of
       
  3240 	// RMmCustomAPI::NotifyAlsBlockedChanged when result is not cached.
       
  3241  	//-------------------------------------------------------------------------
       
  3242 
       
  3243 	customAPI.NotifyAlsBlockedChanged(requestStatus, completeBlockStatus);
       
  3244 
       
  3245 	TMockLtsyData1< RMmCustomAPI::TSetAlsBlock > ltsyData(blockStatus);	
       
  3246 	ltsyData.SerialiseL(expectData);
       
  3247 	iMockLTSY.ExpectL(ECustomSetAlsBlockedIPC, expectData);	
       
  3248 	iMockLTSY.CompleteL(ECustomSetAlsBlockedIPC, KErrNone);
       
  3249 
       
  3250 	TRequestStatus requestStatus2;
       
  3251 	customAPI.SetAlsBlocked(requestStatus2, blockStatus);
       
  3252 
       
  3253 	User::WaitForRequest(requestStatus2);	
       
  3254 	ASSERT_EQUALS(KErrNone, requestStatus2.Int());
       
  3255 	AssertMockLtsyStatusL();
       
  3256 
       
  3257 	User::WaitForRequest(requestStatus);
       
  3258 	AssertMockLtsyStatusL();
       
  3259 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
  3260 
       
  3261 	ASSERT_EQUALS(RMmCustomAPI::EBlockStatusActive, completeBlockStatus);
       
  3262 
       
  3263 	//-------------------------------------------------------------------------
       
  3264 	// for coverage increasing
       
  3265  	//-------------------------------------------------------------------------
       
  3266 
       
  3267 	customAPI.NotifyAlsBlockedChanged(requestStatus, completeBlockStatus);
       
  3268 
       
  3269 	blockStatus = RMmCustomAPI::EDeactivateBlock;	
       
  3270 	expectData.Close();
       
  3271 	ltsyData.SerialiseL(expectData);
       
  3272 	iMockLTSY.ExpectL(ECustomSetAlsBlockedIPC, expectData);	
       
  3273 	iMockLTSY.CompleteL(ECustomSetAlsBlockedIPC, KErrNone);
       
  3274 	customAPI.SetAlsBlocked(requestStatus2, blockStatus);
       
  3275 
       
  3276 	User::WaitForRequest(requestStatus2);	
       
  3277 	ASSERT_EQUALS(KErrNone, requestStatus2.Int());
       
  3278 	AssertMockLtsyStatusL();
       
  3279 
       
  3280 	User::WaitForRequest(requestStatus);
       
  3281 	AssertMockLtsyStatusL();
       
  3282 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
  3283 
       
  3284 	ASSERT_EQUALS(RMmCustomAPI::EBlockStatusInactive, completeBlockStatus);
       
  3285 
       
  3286 	CleanupStack::PopAndDestroy(3, this); 
       
  3287 	
       
  3288 	}
       
  3289 
       
  3290 
       
  3291 /**
       
  3292 @SYMTestCaseID BA-CTSY-CIPC-MCBABC-0002
       
  3293 @SYMComponent  telephony_ctsy
       
  3294 @SYMTestCaseDesc Test support in CTSY for cancelling of RMmCustomAPI::NotifyAlsBlockedChanged
       
  3295 @SYMTestPriority High
       
  3296 @SYMTestActions Invokes cancelling of RMmCustomAPI::NotifyAlsBlockedChanged
       
  3297 @SYMTestExpectedResults Pass
       
  3298 @SYMTestType CT
       
  3299 */
       
  3300 void CCTsyCustomIPCFU::TestNotifyAlsBlockedChanged0002L()
       
  3301 	{
       
  3302 	OpenEtelServerL(EUseExtendedError);
       
  3303 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  3304 	OpenPhoneL();
       
  3305 
       
  3306 	TRequestStatus requestStatus;
       
  3307 	TRequestStatus requestStatus2;
       
  3308 	RMmCustomAPI::TGetAlsBlockStatus completeBlockStatus;
       
  3309 	RMmCustomAPI::TSetAlsBlock blockStatus(RMmCustomAPI::EActivateBlock);
       
  3310 	RMmCustomAPI customAPI;
       
  3311 
       
  3312 	RBuf8 expectData;
       
  3313 	CleanupClosePushL(expectData);
       
  3314 
       
  3315 	OpenCustomAPILC(customAPI, iPhone);
       
  3316 
       
  3317  	//-------------------------------------------------------------------------
       
  3318 	// Test cancelling of RMmCustomAPI::NotifyAlsBlockedChanged
       
  3319  	//-------------------------------------------------------------------------
       
  3320  	
       
  3321 	customAPI.NotifyAlsBlockedChanged(requestStatus, completeBlockStatus);
       
  3322 	customAPI.CancelAsyncRequest(ECustomNotifyAlsBlockedChangedIPC);
       
  3323 
       
  3324 	TMockLtsyData1< RMmCustomAPI::TSetAlsBlock > ltsyData(blockStatus);	
       
  3325 	ltsyData.SerialiseL(expectData);
       
  3326 	iMockLTSY.ExpectL(ECustomSetAlsBlockedIPC, expectData);	
       
  3327 	iMockLTSY.CompleteL(ECustomSetAlsBlockedIPC, KErrNone);
       
  3328 	customAPI.SetAlsBlocked(requestStatus2, blockStatus);
       
  3329 
       
  3330 	User::WaitForRequest(requestStatus2);
       
  3331 	ASSERT_EQUALS(KErrNone, requestStatus2.Int());
       
  3332 
       
  3333 	User::WaitForRequest(requestStatus);
       
  3334 	AssertMockLtsyStatusL();
       
  3335 	ASSERT_EQUALS(KErrCancel, requestStatus.Int());
       
  3336 
       
  3337     CleanupStack::PopAndDestroy(3); 
       
  3338 	
       
  3339 	}
       
  3340 
       
  3341 
       
  3342 /**
       
  3343 @SYMTestCaseID BA-CTSY-CIPC-MCBABC-0004
       
  3344 @SYMComponent  telephony_ctsy
       
  3345 @SYMTestCaseDesc Test support in CTSY for multiple client requests to RMmCustomAPI::NotifyAlsBlockedChanged
       
  3346 @SYMTestPriority High
       
  3347 @SYMTestActions Invokes multiple client requests to RMmCustomAPI::NotifyAlsBlockedChanged
       
  3348 @SYMTestExpectedResults Pass
       
  3349 @SYMTestType CT
       
  3350 */
       
  3351 void CCTsyCustomIPCFU::TestNotifyAlsBlockedChanged0004L()
       
  3352 	{
       
  3353 					
       
  3354 	OpenEtelServerL(EUseExtendedError);
       
  3355 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  3356 	OpenPhoneL();
       
  3357 
       
  3358 	// Open second client
       
  3359 	RTelServer telServer2;
       
  3360 	TInt ret = telServer2.Connect();
       
  3361 	ASSERT_EQUALS(KErrNone, ret);
       
  3362 	CleanupClosePushL(telServer2);
       
  3363 
       
  3364 	RMobilePhone phone2;
       
  3365 	ret = phone2.Open(iTelServer,KMmTsyPhoneName);
       
  3366 	ASSERT_EQUALS(KErrNone, ret);
       
  3367 	CleanupClosePushL(phone2);
       
  3368 
       
  3369 	TRequestStatus requestStatus1;
       
  3370 	TRequestStatus requestStatus2;
       
  3371 	TRequestStatus reqStatus;
       
  3372 	RMmCustomAPI::TGetAlsBlockStatus completeBlockStatus1;
       
  3373 	RMmCustomAPI::TGetAlsBlockStatus completeBlockStatus2;
       
  3374 	RMmCustomAPI::TSetAlsBlock activateBlockStatus(RMmCustomAPI::EActivateBlock);
       
  3375 
       
  3376 	RMmCustomAPI customAPI1;
       
  3377 	RMmCustomAPI customAPI2;
       
  3378 
       
  3379 	RBuf8 expectData;
       
  3380 	CleanupClosePushL(expectData);
       
  3381 
       
  3382 	OpenCustomAPILC(customAPI1, iPhone);
       
  3383 	OpenCustomAPILC(customAPI2, phone2, EFalse);
       
  3384 
       
  3385 	//-------------------------------------------------------------------------
       
  3386 	// Test A: Test multiple clients requesting RMmCustomAPI::NotifyAlsBlockedChanged
       
  3387  	//-------------------------------------------------------------------------
       
  3388 
       
  3389 	customAPI1.NotifyAlsBlockedChanged(requestStatus1, completeBlockStatus1);
       
  3390 	customAPI2.NotifyAlsBlockedChanged(requestStatus2, completeBlockStatus2);
       
  3391 
       
  3392 	TMockLtsyData1< RMmCustomAPI::TSetAlsBlock > ltsyData(activateBlockStatus);	
       
  3393 	ltsyData.SerialiseL(expectData);
       
  3394 	iMockLTSY.ExpectL(ECustomSetAlsBlockedIPC, expectData);	
       
  3395 	iMockLTSY.CompleteL(ECustomSetAlsBlockedIPC, KErrNone);
       
  3396 	customAPI1.SetAlsBlocked(reqStatus, activateBlockStatus);
       
  3397 
       
  3398 	User::WaitForRequest(reqStatus);	
       
  3399 	ASSERT_EQUALS(KErrNone, reqStatus.Int());
       
  3400 
       
  3401 	User::WaitForRequest(requestStatus1);
       
  3402 	ASSERT_EQUALS(KErrNone, requestStatus1.Int());
       
  3403 
       
  3404 	User::WaitForRequest(requestStatus2);
       
  3405 	AssertMockLtsyStatusL();
       
  3406 	ASSERT_EQUALS(KErrNone, requestStatus2.Int());
       
  3407 
       
  3408 	ASSERT_EQUALS(RMmCustomAPI::EBlockStatusActive, completeBlockStatus1);
       
  3409 	ASSERT_EQUALS(RMmCustomAPI::EBlockStatusActive, completeBlockStatus2);
       
  3410 
       
  3411 	CleanupStack::PopAndDestroy(6, this); 
       
  3412 	}
       
  3413 
       
  3414 
       
  3415 /**
       
  3416 @SYMTestCaseID BA-CTSY-CIPC-MCGCI-0001
       
  3417 @SYMComponent  telephony_ctsy
       
  3418 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::GetCipheringInfo
       
  3419 @SYMTestPriority High
       
  3420 @SYMTestActions Invokes RMmCustomAPI::GetCipheringInfo
       
  3421 @SYMTestExpectedResults Pass
       
  3422 @SYMTestType CT
       
  3423 */
       
  3424 void CCTsyCustomIPCFU::TestGetCipheringInfo0001L()
       
  3425 	{
       
  3426 
       
  3427 	OpenEtelServerL(EUseExtendedError);
       
  3428 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  3429 	OpenPhoneL();
       
  3430 
       
  3431 	RMmCustomAPI customAPI;
       
  3432 	OpenCustomAPILC(customAPI, iPhone);
       
  3433 
       
  3434 	TRequestStatus requestStatus;
       
  3435 	TRequestStatus mockLtsyStatus;
       
  3436 	RMmCustomAPI::TCipheringInfo info;
       
  3437 
       
  3438 	TBool indReq(ETrue);
       
  3439 	TPckg<TBool> pckgIndReq(indReq);
       
  3440 
       
  3441  	//-------------------------------------------------------------------------
       
  3442 	// TEST D: RMmCustomAPI::GetCipheringInfo again, this time CTSY
       
  3443 	// will get result from the cache.
       
  3444  	//-------------------------------------------------------------------------
       
  3445 
       
  3446 	iMockLTSY.ExpectL(ECustomGetCipheringInfoIPC);
       
  3447 	iMockLTSY.CompleteL(ECustomGetCipheringInfoIPC, KErrNone, pckgIndReq);
       
  3448 	customAPI.GetCipheringInfo(requestStatus, info);
       
  3449 
       
  3450 	User::WaitForRequest(requestStatus);
       
  3451 	AssertMockLtsyStatusL();
       
  3452 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
  3453 	
       
  3454 	ASSERT_EQUALS(indReq, info.iIndStatus);
       
  3455 	ASSERT_TRUE(EFalse == info.iCiphStatus);
       
  3456 
       
  3457  	//-------------------------------------------------------------------------
       
  3458 	// TEST A: failure to dispatch request to LTSY
       
  3459  	//-------------------------------------------------------------------------
       
  3460 
       
  3461 	iMockLTSY.ExpectL(ECustomGetCipheringInfoIPC, KErrNotSupported);
       
  3462 	customAPI.GetCipheringInfo(requestStatus, info);
       
  3463 
       
  3464 	User::WaitForRequest(requestStatus);
       
  3465 	AssertMockLtsyStatusL();
       
  3466 	ASSERT_EQUALS(KErrNotSupported, requestStatus.Int());
       
  3467 
       
  3468 	//-------------------------------------------------------------------------
       
  3469 	// TEST B: failure on completion of pending request from LTSY->CTSY
       
  3470  	//-------------------------------------------------------------------------
       
  3471 
       
  3472 	iMockLTSY.ExpectL(ECustomGetCipheringInfoIPC);
       
  3473 	iMockLTSY.CompleteL(ECustomGetCipheringInfoIPC, KErrGeneral, pckgIndReq);
       
  3474 	customAPI.GetCipheringInfo(requestStatus, info);
       
  3475 
       
  3476 	User::WaitForRequest(requestStatus);
       
  3477 	AssertMockLtsyStatusL();
       
  3478 	ASSERT_EQUALS(KErrGeneral, requestStatus.Int());
       
  3479 
       
  3480  	//-------------------------------------------------------------------------
       
  3481 	// TEST C: Successful completion request of
       
  3482 	// RMmCustomAPI::GetCipheringInfo when result is not cached.
       
  3483  	//-------------------------------------------------------------------------
       
  3484 
       
  3485 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
  3486 	RMmCustomAPI::TCipheringInfo strInfo;
       
  3487 	strInfo.iCiphStatus = ETrue;
       
  3488 	TPckg<RMmCustomAPI::TCipheringInfo> pckg(strInfo);
       
  3489 	iMockLTSY.CompleteL(ECustomNotifyCipheringInfoChangeIPC, KErrNone, pckg);
       
  3490 	User::WaitForRequest(mockLtsyStatus);
       
  3491 	AssertMockLtsyStatusL();
       
  3492 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
  3493 
       
  3494 	iMockLTSY.ExpectL(ECustomGetCipheringInfoIPC);
       
  3495 	iMockLTSY.CompleteL(ECustomGetCipheringInfoIPC, KErrNone, pckgIndReq);
       
  3496 	customAPI.GetCipheringInfo(requestStatus, info);
       
  3497 
       
  3498 	User::WaitForRequest(requestStatus);
       
  3499 	AssertMockLtsyStatusL();
       
  3500 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
  3501 	
       
  3502 	ASSERT_EQUALS(indReq, info.iIndStatus);
       
  3503 	ASSERT_EQUALS(strInfo.iCiphStatus, info.iCiphStatus);
       
  3504 
       
  3505  	//-------------------------------------------------------------------------
       
  3506 	// TEST E: Unsolicited completion of RMmCustomAPI::GetCipheringInfo
       
  3507 	// from LTSY.
       
  3508  	//-------------------------------------------------------------------------
       
  3509 
       
  3510 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
  3511 	iMockLTSY.CompleteL(ECustomGetCipheringInfoIPC, KErrNone, pckgIndReq);
       
  3512 	User::WaitForRequest(mockLtsyStatus);
       
  3513 	AssertMockLtsyStatusL();
       
  3514 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());	
       
  3515 
       
  3516 	CleanupStack::PopAndDestroy(2, this); 
       
  3517 	
       
  3518 	}
       
  3519 
       
  3520 /**
       
  3521 @SYMTestCaseID BA-CTSY-CIPC-MCGCI-0002
       
  3522 @SYMComponent  telephony_ctsy
       
  3523 @SYMTestCaseDesc Test support in CTSY for cancelling of RMmCustomAPI::GetCipheringInfo
       
  3524 @SYMTestPriority High
       
  3525 @SYMTestActions Invokes cancelling of RMmCustomAPI::GetCipheringInfo
       
  3526 @SYMTestExpectedResults Pass
       
  3527 @SYMTestType CT
       
  3528 */
       
  3529 void CCTsyCustomIPCFU::TestGetCipheringInfo0002L()
       
  3530 	{
       
  3531 
       
  3532 	OpenEtelServerL(EUseExtendedError);
       
  3533 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  3534 	OpenPhoneL();
       
  3535 
       
  3536 	TRequestStatus requestStatus;
       
  3537 	TRequestStatus mockLtsyStatus;
       
  3538 	RMmCustomAPI::TCipheringInfo info;
       
  3539 
       
  3540 	RMmCustomAPI customAPI;
       
  3541 	OpenCustomAPILC(customAPI, iPhone);
       
  3542 
       
  3543 	TBool indReq(ETrue);
       
  3544 	TPckg<TBool> pckgIndReq(indReq);
       
  3545 
       
  3546  	//-------------------------------------------------------------------------
       
  3547 	// Test cancelling of RMmCustomAPI::GetCipheringInfo
       
  3548  	//-------------------------------------------------------------------------
       
  3549  	
       
  3550 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
  3551  	
       
  3552 	iMockLTSY.ExpectL(ECustomGetCipheringInfoIPC);
       
  3553 	iMockLTSY.CompleteL(ECustomGetCipheringInfoIPC, KErrNone, pckgIndReq, 10);
       
  3554 	customAPI.GetCipheringInfo(requestStatus, info);
       
  3555 	customAPI.CancelAsyncRequest(ECustomGetCipheringInfoIPC);
       
  3556 		
       
  3557 	User::WaitForRequest(mockLtsyStatus);
       
  3558 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
  3559 
       
  3560 	User::WaitForRequest(requestStatus);
       
  3561 	ASSERT_EQUALS(KErrCancel, requestStatus.Int());
       
  3562 
       
  3563 	AssertMockLtsyStatusL();
       
  3564 
       
  3565     CleanupStack::PopAndDestroy(2); 
       
  3566 	
       
  3567 	}
       
  3568 
       
  3569 
       
  3570 /**
       
  3571 @SYMTestCaseID BA-CTSY-CIPC-MCGCI-0004
       
  3572 @SYMComponent  telephony_ctsy
       
  3573 @SYMTestCaseDesc Test support in CTSY for multiple client requests to RMmCustomAPI::GetCipheringInfo
       
  3574 @SYMTestPriority High
       
  3575 @SYMTestActions Invokes multiple client requests to RMmCustomAPI::GetCipheringInfo
       
  3576 @SYMTestExpectedResults Pass
       
  3577 @SYMTestType CT
       
  3578 */
       
  3579 void CCTsyCustomIPCFU::TestGetCipheringInfo0004L()
       
  3580 	{
       
  3581 					
       
  3582 	OpenEtelServerL(EUseExtendedError);
       
  3583 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  3584 	OpenPhoneL();
       
  3585 
       
  3586 	// Open second client
       
  3587 	RTelServer telServer2;
       
  3588 	TInt ret = telServer2.Connect();
       
  3589 	ASSERT_EQUALS(KErrNone, ret);
       
  3590 	CleanupClosePushL(telServer2);
       
  3591 
       
  3592 	RMobilePhone phone2;
       
  3593 	ret = phone2.Open(iTelServer,KMmTsyPhoneName);
       
  3594 	ASSERT_EQUALS(KErrNone, ret);
       
  3595 	CleanupClosePushL(phone2);
       
  3596 
       
  3597 	RMmCustomAPI customAPI1;
       
  3598 	RMmCustomAPI customAPI2;
       
  3599 
       
  3600 	OpenCustomAPILC(customAPI1, iPhone);
       
  3601 	OpenCustomAPILC(customAPI2, phone2, EFalse);
       
  3602 
       
  3603 	TRequestStatus requestStatus1;
       
  3604 	TRequestStatus requestStatus2;
       
  3605 
       
  3606 	RMmCustomAPI::TCipheringInfo info1;
       
  3607 	RMmCustomAPI::TCipheringInfo info2;
       
  3608 
       
  3609 	TBool ciphStatus(EFalse);
       
  3610 	TBool indReq(ETrue);
       
  3611 	TPckg<TBool> pckgIndReq(indReq);
       
  3612 
       
  3613 	//-------------------------------------------------------------------------
       
  3614 	// Test A: Test multiple clients requesting RMmCustomAPI::GetCipheringInfo
       
  3615  	//-------------------------------------------------------------------------
       
  3616 
       
  3617 	iMockLTSY.ExpectL(ECustomGetCipheringInfoIPC);
       
  3618 	iMockLTSY.CompleteL(ECustomGetCipheringInfoIPC, KErrNone, pckgIndReq);
       
  3619 	customAPI1.GetCipheringInfo(requestStatus1, info1);
       
  3620 
       
  3621 	customAPI2.GetCipheringInfo(requestStatus2, info2);
       
  3622 
       
  3623 	User::WaitForRequest(requestStatus1);
       
  3624 	ASSERT_EQUALS(KErrNone, requestStatus1.Int());
       
  3625 
       
  3626 	User::WaitForRequest(requestStatus2);
       
  3627 	AssertMockLtsyStatusL();
       
  3628 	ASSERT_EQUALS(KErrServerBusy, requestStatus2.Int());
       
  3629 
       
  3630 	ASSERT_EQUALS(indReq, info1.iIndStatus);
       
  3631 	ASSERT_EQUALS(ciphStatus, info1.iCiphStatus);
       
  3632 
       
  3633 	CleanupStack::PopAndDestroy(5, this); 
       
  3634 
       
  3635 	}
       
  3636 
       
  3637 
       
  3638 /**
       
  3639 @SYMTestCaseID BA-CTSY-CIPC-MCGCI-0005
       
  3640 @SYMComponent  telephony_ctsy
       
  3641 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::GetCipheringInfo with timeout
       
  3642 @SYMTestPriority High
       
  3643 @SYMTestActions Invokes RMmCustomAPI::GetCipheringInfo and tests for timeout
       
  3644 @SYMTestExpectedResults Pass
       
  3645 @SYMTestType CT
       
  3646 */
       
  3647 void CCTsyCustomIPCFU::TestGetCipheringInfo0005L()
       
  3648 	{
       
  3649 
       
  3650 	OpenEtelServerL(EUseExtendedError);
       
  3651 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  3652 	OpenPhoneL();
       
  3653 
       
  3654 	RMmCustomAPI customAPI;
       
  3655 	OpenCustomAPILC(customAPI, iPhone);
       
  3656 
       
  3657 	TRequestStatus requestStatus;
       
  3658 	RMmCustomAPI::TCipheringInfo info;
       
  3659 
       
  3660 	//-------------------------------------------------------------------------
       
  3661 	// Test A: Test timeout of RMmCustomAPI::GetCipheringInfo
       
  3662  	//-------------------------------------------------------------------------
       
  3663 
       
  3664 	iMockLTSY.ExpectL(ECustomGetCipheringInfoIPC);
       
  3665 	customAPI.GetCipheringInfo(requestStatus, info);
       
  3666 	User::WaitForRequest(requestStatus);
       
  3667 	AssertMockLtsyStatusL();
       
  3668 	ASSERT_EQUALS(KErrTimedOut, requestStatus.Int());
       
  3669 
       
  3670 	CleanupStack::PopAndDestroy(2, this);
       
  3671 
       
  3672 	}
       
  3673 
       
  3674 
       
  3675 /**
       
  3676 @SYMTestCaseID BA-CTSY-CIPC-MCNCIC-0001
       
  3677 @SYMComponent  telephony_ctsy
       
  3678 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::NotifyCipheringInfoChange
       
  3679 @SYMTestPriority High
       
  3680 @SYMTestActions Invokes RMmCustomAPI::NotifyCipheringInfoChange
       
  3681 @SYMTestExpectedResults Pass
       
  3682 @SYMTestType CT
       
  3683 */
       
  3684 void CCTsyCustomIPCFU::TestNotifyCipheringInfoChange0001L()
       
  3685 	{
       
  3686 
       
  3687 	OpenEtelServerL(EUseExtendedError);
       
  3688 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  3689 	OpenPhoneL();
       
  3690 
       
  3691 	RMmCustomAPI customAPI;
       
  3692 	OpenCustomAPILC(customAPI, iPhone);
       
  3693 
       
  3694 	TRequestStatus requestStatus;
       
  3695 	TRequestStatus mockLtsyStatus;
       
  3696 
       
  3697 	RMmCustomAPI::TCipheringInfo info;
       
  3698 	RMmCustomAPI::TCipheringInfo completeInfo;
       
  3699 	completeInfo.iIndStatus = ETrue;
       
  3700 	completeInfo.iCiphStatus = ETrue;
       
  3701 	TPckg<RMmCustomAPI::TCipheringInfo> pckg(completeInfo);
       
  3702 
       
  3703  	//-------------------------------------------------------------------------
       
  3704 	// TEST C: Successful completion request of
       
  3705 	// RMmCustomAPI::NotifyCipheringInfoChange when result is not cached.
       
  3706  	//-------------------------------------------------------------------------
       
  3707 
       
  3708 	customAPI.NotifyCipheringInfoChange(requestStatus, info);
       
  3709 
       
  3710 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
  3711 	iMockLTSY.CompleteL(ECustomNotifyCipheringInfoChangeIPC, KErrNone, pckg);
       
  3712 	User::WaitForRequest(mockLtsyStatus);
       
  3713 	AssertMockLtsyStatusL();
       
  3714 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
  3715 
       
  3716 	User::WaitForRequest(requestStatus);
       
  3717 	AssertMockLtsyStatusL();
       
  3718 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
  3719 
       
  3720 	ASSERT_EQUALS(completeInfo.iIndStatus, info.iIndStatus);
       
  3721 	ASSERT_EQUALS(completeInfo.iCiphStatus, info.iCiphStatus);
       
  3722 
       
  3723  	//-------------------------------------------------------------------------
       
  3724 	// TEST E: Unsolicited completion of RMmCustomAPI::NotifyCipheringInfoChange
       
  3725 	// from LTSY.
       
  3726  	//-------------------------------------------------------------------------
       
  3727 
       
  3728 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
  3729 	iMockLTSY.CompleteL(ECustomNotifyCipheringInfoChangeIPC, KErrNone, pckg);
       
  3730 	User::WaitForRequest(mockLtsyStatus);
       
  3731 	AssertMockLtsyStatusL();
       
  3732 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());	
       
  3733 
       
  3734 	CleanupStack::PopAndDestroy(2, this); 
       
  3735 	
       
  3736 	}
       
  3737 
       
  3738 
       
  3739 /**
       
  3740 @SYMTestCaseID BA-CTSY-CIPC-MCNCIC-0002
       
  3741 @SYMComponent  telephony_ctsy
       
  3742 @SYMTestCaseDesc Test support in CTSY for cancelling of RMmCustomAPI::NotifyCipheringInfoChange
       
  3743 @SYMTestPriority High
       
  3744 @SYMTestActions Invokes cancelling of RMmCustomAPI::NotifyCipheringInfoChange
       
  3745 @SYMTestExpectedResults Pass
       
  3746 @SYMTestType CT
       
  3747 */
       
  3748 void CCTsyCustomIPCFU::TestNotifyCipheringInfoChange0002L()
       
  3749 	{
       
  3750 
       
  3751 	OpenEtelServerL(EUseExtendedError);
       
  3752 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  3753 	OpenPhoneL();
       
  3754 
       
  3755 	RMmCustomAPI customAPI;
       
  3756 	OpenCustomAPILC(customAPI, iPhone);
       
  3757 
       
  3758 	TRequestStatus requestStatus;
       
  3759 	TRequestStatus mockLtsyStatus;
       
  3760 
       
  3761 	RMmCustomAPI::TCipheringInfo info;
       
  3762 	RMmCustomAPI::TCipheringInfo completeInfo;
       
  3763 	completeInfo.iIndStatus = ETrue;
       
  3764 	completeInfo.iCiphStatus = ETrue;
       
  3765 	TPckg<RMmCustomAPI::TCipheringInfo> pckg(completeInfo);
       
  3766 
       
  3767  	//-------------------------------------------------------------------------
       
  3768 	// Test cancelling of RMmCustomAPI::NotifyCipheringInfoChange
       
  3769  	//-------------------------------------------------------------------------
       
  3770 
       
  3771 	customAPI.NotifyCipheringInfoChange(requestStatus, info);
       
  3772 	customAPI.CancelAsyncRequest(ECustomNotifyCipheringInfoChangeIPC);
       
  3773 
       
  3774 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
  3775 	iMockLTSY.CompleteL(ECustomNotifyCipheringInfoChangeIPC, KErrNone, pckg);
       
  3776 	User::WaitForRequest(mockLtsyStatus);
       
  3777 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
  3778 
       
  3779 	User::WaitForRequest(requestStatus);
       
  3780 	ASSERT_EQUALS(KErrCancel, requestStatus.Int());
       
  3781 
       
  3782 	AssertMockLtsyStatusL();
       
  3783 
       
  3784 	CleanupStack::PopAndDestroy(2); 
       
  3785 	
       
  3786 	}
       
  3787 
       
  3788 
       
  3789 /**
       
  3790 @SYMTestCaseID BA-CTSY-CIPC-MCNCIC-0004
       
  3791 @SYMComponent  telephony_ctsy
       
  3792 @SYMTestCaseDesc Test support in CTSY for multiple client requests to RMmCustomAPI::NotifyCipheringInfoChange
       
  3793 @SYMTestPriority High
       
  3794 @SYMTestActions Invokes multiple client requests to RMmCustomAPI::NotifyCipheringInfoChange
       
  3795 @SYMTestExpectedResults Pass
       
  3796 @SYMTestType CT
       
  3797 */
       
  3798 void CCTsyCustomIPCFU::TestNotifyCipheringInfoChange0004L()
       
  3799 	{
       
  3800 					
       
  3801 	OpenEtelServerL(EUseExtendedError);
       
  3802 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  3803 	OpenPhoneL();
       
  3804 
       
  3805 	// Open second client
       
  3806 	RTelServer telServer2;
       
  3807 	TInt ret = telServer2.Connect();
       
  3808 	ASSERT_EQUALS(KErrNone, ret);
       
  3809 	CleanupClosePushL(telServer2);
       
  3810 
       
  3811 	RMobilePhone phone2;
       
  3812 	ret = phone2.Open(iTelServer,KMmTsyPhoneName);
       
  3813 	ASSERT_EQUALS(KErrNone, ret);
       
  3814 	CleanupClosePushL(phone2);
       
  3815 
       
  3816 	RMmCustomAPI customAPI1;
       
  3817 	RMmCustomAPI customAPI2;
       
  3818 	OpenCustomAPILC(customAPI1, iPhone);
       
  3819 	OpenCustomAPILC(customAPI2, phone2, EFalse);
       
  3820 
       
  3821 	TRequestStatus requestStatus1;
       
  3822 	TRequestStatus requestStatus2;
       
  3823 	TRequestStatus mockLtsyStatus;
       
  3824 
       
  3825 	RMmCustomAPI::TCipheringInfo info1;
       
  3826 	RMmCustomAPI::TCipheringInfo info2;
       
  3827 	RMmCustomAPI::TCipheringInfo completeInfo;
       
  3828 	completeInfo.iIndStatus = ETrue;
       
  3829 	completeInfo.iCiphStatus = ETrue;
       
  3830 	TPckg<RMmCustomAPI::TCipheringInfo> pckg(completeInfo);
       
  3831 
       
  3832 	//-------------------------------------------------------------------------
       
  3833 	// Test A: Test multiple clients requesting RMmCustomAPI::NotifyCipheringInfoChange
       
  3834  	//-------------------------------------------------------------------------
       
  3835 
       
  3836 	customAPI1.NotifyCipheringInfoChange(requestStatus1, info1);
       
  3837 	customAPI2.NotifyCipheringInfoChange(requestStatus2, info2);
       
  3838 
       
  3839 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
  3840 	iMockLTSY.CompleteL(ECustomNotifyCipheringInfoChangeIPC, KErrNone, pckg);
       
  3841 	
       
  3842 	User::WaitForRequest(mockLtsyStatus);
       
  3843 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
  3844 
       
  3845 	User::WaitForRequest(requestStatus1);
       
  3846 	ASSERT_EQUALS(KErrNone, requestStatus1.Int());
       
  3847 
       
  3848 	User::WaitForRequest(requestStatus2);
       
  3849 	ASSERT_EQUALS(KErrNone, requestStatus2.Int());
       
  3850 
       
  3851 	ASSERT_EQUALS(completeInfo.iIndStatus, info1.iIndStatus);
       
  3852 	ASSERT_EQUALS(completeInfo.iCiphStatus, info1.iCiphStatus);
       
  3853 	ASSERT_EQUALS(completeInfo.iIndStatus, info2.iIndStatus);
       
  3854 	ASSERT_EQUALS(completeInfo.iCiphStatus, info2.iCiphStatus);
       
  3855 
       
  3856 	AssertMockLtsyStatusL();
       
  3857 
       
  3858 	CleanupStack::PopAndDestroy(5, this); 
       
  3859 
       
  3860 	}
       
  3861 
       
  3862 
       
  3863 /**
       
  3864 @SYMTestCaseID BA-CTSY-CIPC-MCNNS-0001
       
  3865 @SYMComponent  telephony_ctsy
       
  3866 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::NotifyNSPSStatus
       
  3867 @SYMTestPriority High
       
  3868 @SYMTestActions Invokes RMmCustomAPI::NotifyNSPSStatus
       
  3869 @SYMTestExpectedResults Pass
       
  3870 @SYMTestType CT
       
  3871 */
       
  3872 void CCTsyCustomIPCFU::TestNotifyNSPSStatus0001L()
       
  3873 	{
       
  3874 
       
  3875 	OpenEtelServerL(EUseExtendedError);
       
  3876 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  3877 	OpenPhoneL();
       
  3878 
       
  3879 	RMmCustomAPI customAPI;
       
  3880 	OpenCustomAPILC(customAPI, iPhone);
       
  3881 
       
  3882 	TRequestStatus requestStatus;
       
  3883 	TRequestStatus mockLtsyStatus;
       
  3884 
       
  3885 	TBool nspsIsOn(ETrue);
       
  3886 	TPckg<TBool> pckg(nspsIsOn);
       
  3887 	RMmCustomAPI::TNspsStatus nspsStatus;
       
  3888 
       
  3889  	//-------------------------------------------------------------------------
       
  3890 	// TEST E: Unsolicited completion of RMmCustomAPI::NotifyNSPSStatus
       
  3891 	// from LTSY.
       
  3892  	//-------------------------------------------------------------------------
       
  3893 
       
  3894 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
  3895 	iMockLTSY.CompleteL(ECustomNotifyNSPSStatusIPC, KErrNone, pckg);
       
  3896 	User::WaitForRequest(mockLtsyStatus);
       
  3897 	AssertMockLtsyStatusL();
       
  3898 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());	
       
  3899 
       
  3900  	//-------------------------------------------------------------------------
       
  3901 	// TEST C: Successful completion request of
       
  3902 	// RMmCustomAPI::NotifyNSPSStatus when result is not cached.
       
  3903  	//-------------------------------------------------------------------------
       
  3904 
       
  3905 	customAPI.NotifyNSPSStatus(requestStatus, nspsStatus);
       
  3906 
       
  3907 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
  3908 	iMockLTSY.CompleteL(ECustomNotifyNSPSStatusIPC, KErrNone, pckg);
       
  3909 	User::WaitForRequest(mockLtsyStatus);
       
  3910 	AssertMockLtsyStatusL();
       
  3911 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
  3912 
       
  3913 	User::WaitForRequest(requestStatus);
       
  3914 	AssertMockLtsyStatusL();
       
  3915 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
  3916 
       
  3917 	ASSERT_EQUALS(RMmCustomAPI::ENspsOn, nspsStatus);
       
  3918 
       
  3919  	//-------------------------------------------------------------------------
       
  3920 	// for coverage increasing
       
  3921  	//-------------------------------------------------------------------------
       
  3922 
       
  3923 	customAPI.NotifyNSPSStatus(requestStatus, nspsStatus);
       
  3924 
       
  3925 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
  3926 	nspsIsOn = EFalse;
       
  3927 	iMockLTSY.CompleteL(ECustomNotifyNSPSStatusIPC, KErrNone, pckg);
       
  3928 	User::WaitForRequest(mockLtsyStatus);
       
  3929 	AssertMockLtsyStatusL();
       
  3930 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
  3931 
       
  3932 	User::WaitForRequest(requestStatus);
       
  3933 	AssertMockLtsyStatusL();
       
  3934 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
  3935 
       
  3936 	ASSERT_EQUALS(RMmCustomAPI::ENspsOff, nspsStatus);
       
  3937 
       
  3938 	CleanupStack::PopAndDestroy(2, this);
       
  3939 	
       
  3940 	}
       
  3941 
       
  3942 
       
  3943 /**
       
  3944 @SYMTestCaseID BA-CTSY-CIPC-MCNNS-0002
       
  3945 @SYMComponent  telephony_ctsy
       
  3946 @SYMTestCaseDesc Test support in CTSY for cancelling of RMmCustomAPI::NotifyNSPSStatus
       
  3947 @SYMTestPriority High
       
  3948 @SYMTestActions Invokes cancelling of RMmCustomAPI::NotifyNSPSStatus
       
  3949 @SYMTestExpectedResults Pass
       
  3950 @SYMTestType CT
       
  3951 */
       
  3952 void CCTsyCustomIPCFU::TestNotifyNSPSStatus0002L()
       
  3953 	{
       
  3954 
       
  3955 	OpenEtelServerL(EUseExtendedError);
       
  3956 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  3957 	OpenPhoneL();
       
  3958 
       
  3959 	RMmCustomAPI customAPI;
       
  3960 	OpenCustomAPILC(customAPI, iPhone);
       
  3961 
       
  3962 	TRequestStatus requestStatus;
       
  3963 	TRequestStatus mockLtsyStatus;
       
  3964 
       
  3965 	TBool nspsIsOn(ETrue);
       
  3966 	TPckg<TBool> pckg(nspsIsOn);
       
  3967 	RMmCustomAPI::TNspsStatus nspsStatus;
       
  3968 
       
  3969  	//-------------------------------------------------------------------------
       
  3970 	// Test cancelling of RMmCustomAPI::NotifyNSPSStatus
       
  3971  	//-------------------------------------------------------------------------
       
  3972  
       
  3973 	customAPI.NotifyNSPSStatus(requestStatus, nspsStatus);
       
  3974 	customAPI.CancelAsyncRequest(ECustomNotifyNSPSStatusIPC);
       
  3975 
       
  3976 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
  3977 	iMockLTSY.CompleteL(ECustomNotifyNSPSStatusIPC, KErrNone, pckg);
       
  3978 	User::WaitForRequest(mockLtsyStatus);
       
  3979 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
  3980 
       
  3981 	User::WaitForRequest(requestStatus);
       
  3982 	ASSERT_EQUALS(KErrCancel, requestStatus.Int());
       
  3983 
       
  3984 	AssertMockLtsyStatusL();
       
  3985 
       
  3986 	CleanupStack::PopAndDestroy(2); 
       
  3987 	}
       
  3988 
       
  3989 
       
  3990 /**
       
  3991 @SYMTestCaseID BA-CTSY-CIPC-MCNNS-0004
       
  3992 @SYMComponent  telephony_ctsy
       
  3993 @SYMTestCaseDesc Test support in CTSY for multiple client requests to RMmCustomAPI::NotifyNSPSStatus
       
  3994 @SYMTestPriority High
       
  3995 @SYMTestActions Invokes multiple client requests to RMmCustomAPI::NotifyNSPSStatus
       
  3996 @SYMTestExpectedResults Pass
       
  3997 @SYMTestType CT
       
  3998 */
       
  3999 void CCTsyCustomIPCFU::TestNotifyNSPSStatus0004L()
       
  4000 	{
       
  4001 					
       
  4002 	OpenEtelServerL(EUseExtendedError);
       
  4003 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  4004 	OpenPhoneL();
       
  4005 
       
  4006 	// Open second client
       
  4007 	RTelServer telServer2;
       
  4008 	TInt ret = telServer2.Connect();
       
  4009 	ASSERT_EQUALS(KErrNone, ret);
       
  4010 	CleanupClosePushL(telServer2);
       
  4011 
       
  4012 	RMobilePhone phone2;
       
  4013 	ret = phone2.Open(iTelServer,KMmTsyPhoneName);
       
  4014 	ASSERT_EQUALS(KErrNone, ret);
       
  4015 	CleanupClosePushL(phone2);
       
  4016 
       
  4017 	RMmCustomAPI customAPI1;
       
  4018 	RMmCustomAPI customAPI2;
       
  4019 	OpenCustomAPILC(customAPI1, iPhone);
       
  4020 	OpenCustomAPILC(customAPI2, phone2, EFalse);
       
  4021 
       
  4022 	TRequestStatus requestStatus1;
       
  4023 	TRequestStatus requestStatus2;
       
  4024 	TRequestStatus mockLtsyStatus;
       
  4025 
       
  4026 	TBool nspsIsOn(ETrue);
       
  4027 	TPckg<TBool> pckg(nspsIsOn);
       
  4028 	RMmCustomAPI::TNspsStatus nspsStatus1;
       
  4029 	RMmCustomAPI::TNspsStatus nspsStatus2;
       
  4030 	RMmCustomAPI::TNspsStatus nspsOn(RMmCustomAPI::ENspsOn);
       
  4031 
       
  4032 	//-------------------------------------------------------------------------
       
  4033 	// Test A: Test multiple clients requesting RMmCustomAPI::NotifyNSPSStatus
       
  4034  	//-------------------------------------------------------------------------
       
  4035 
       
  4036 	customAPI1.NotifyNSPSStatus(requestStatus1, nspsStatus1);
       
  4037 	customAPI2.NotifyNSPSStatus(requestStatus2, nspsStatus2);
       
  4038 
       
  4039 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
  4040 	iMockLTSY.CompleteL(ECustomNotifyNSPSStatusIPC, KErrNone, pckg);
       
  4041 	
       
  4042 	User::WaitForRequest(mockLtsyStatus);
       
  4043 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
  4044 
       
  4045 	User::WaitForRequest(requestStatus1);
       
  4046 	ASSERT_EQUALS(KErrNone, requestStatus1.Int());
       
  4047 
       
  4048 	User::WaitForRequest(requestStatus2);
       
  4049 	ASSERT_EQUALS(KErrNone, requestStatus2.Int());
       
  4050 
       
  4051 	ASSERT_EQUALS(nspsOn, nspsStatus1);
       
  4052 	ASSERT_EQUALS(nspsOn, nspsStatus2);
       
  4053 
       
  4054 	AssertMockLtsyStatusL();
       
  4055 
       
  4056 	CleanupStack::PopAndDestroy(5, this); 
       
  4057 
       
  4058 	}
       
  4059 
       
  4060 
       
  4061 /**
       
  4062 @SYMTestCaseID BA-CTSY-CIPC-MCNW-0001
       
  4063 @SYMComponent  telephony_ctsy
       
  4064 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::NetWakeup
       
  4065 @SYMTestPriority High
       
  4066 @SYMTestActions Invokes RMmCustomAPI::NetWakeup
       
  4067 @SYMTestExpectedResults Pass
       
  4068 @SYMTestType CT
       
  4069 */
       
  4070 void CCTsyCustomIPCFU::TestNetWakeup0001L()
       
  4071 	{
       
  4072 
       
  4073 	OpenEtelServerL(EUseExtendedError);
       
  4074 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  4075 	OpenPhoneL();
       
  4076 
       
  4077 	RMmCustomAPI customAPI;
       
  4078 	OpenCustomAPILC(customAPI, iPhone);
       
  4079 
       
  4080 	TRequestStatus requestStatus;
       
  4081 	TRequestStatus mockLtsyStatus;
       
  4082 
       
  4083  	//-------------------------------------------------------------------------
       
  4084 	// TEST A: failure to dispatch request to LTSY
       
  4085  	//-------------------------------------------------------------------------
       
  4086 
       
  4087 	iMockLTSY.ExpectL(ECustomNetWakeupIPC, KErrNotSupported);
       
  4088 	customAPI.NetWakeup(requestStatus);
       
  4089 
       
  4090 	User::WaitForRequest(requestStatus);
       
  4091 	AssertMockLtsyStatusL();
       
  4092 	ASSERT_EQUALS(KErrNotSupported, requestStatus.Int());
       
  4093 
       
  4094 	//-------------------------------------------------------------------------
       
  4095 	// TEST B: failure on completion of pending request from LTSY->CTSY
       
  4096  	//-------------------------------------------------------------------------
       
  4097 
       
  4098 	iMockLTSY.ExpectL(ECustomNetWakeupIPC);
       
  4099 	iMockLTSY.CompleteL(ECustomNetWakeupIPC, KErrGeneral);
       
  4100 	customAPI.NetWakeup(requestStatus);
       
  4101 
       
  4102 	User::WaitForRequest(requestStatus);
       
  4103 	AssertMockLtsyStatusL();
       
  4104 	ASSERT_EQUALS(KErrGeneral, requestStatus.Int());
       
  4105 
       
  4106  	//-------------------------------------------------------------------------
       
  4107 	// TEST C: Successful completion request of
       
  4108 	// RMmCustomAPI::NetWakeup when result is not cached.
       
  4109  	//-------------------------------------------------------------------------
       
  4110 
       
  4111 	iMockLTSY.ExpectL(ECustomNetWakeupIPC);
       
  4112 	iMockLTSY.CompleteL(ECustomNetWakeupIPC, KErrNone);
       
  4113 	customAPI.NetWakeup(requestStatus);
       
  4114 
       
  4115 	User::WaitForRequest(requestStatus);
       
  4116 	AssertMockLtsyStatusL();
       
  4117 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
  4118 
       
  4119  	//-------------------------------------------------------------------------
       
  4120 	// TEST E: Unsolicited completion of RMmCustomAPI::NetWakeup
       
  4121 	// from LTSY.
       
  4122  	//-------------------------------------------------------------------------
       
  4123 
       
  4124 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
  4125 	iMockLTSY.CompleteL(ECustomNetWakeupIPC, KErrNone);
       
  4126 	User::WaitForRequest(mockLtsyStatus);
       
  4127 	AssertMockLtsyStatusL();
       
  4128 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());	
       
  4129 
       
  4130 	CleanupStack::PopAndDestroy(2, this); 
       
  4131 	
       
  4132 	}
       
  4133 
       
  4134 
       
  4135 /**
       
  4136 @SYMTestCaseID BA-CTSY-CIPC-MCNW-0002
       
  4137 @SYMComponent  telephony_ctsy
       
  4138 @SYMTestCaseDesc Test support in CTSY for cancelling of RMmCustomAPI::NetWakeup
       
  4139 @SYMTestPriority High
       
  4140 @SYMTestActions Invokes cancelling of RMmCustomAPI::NetWakeup
       
  4141 @SYMTestExpectedResults Pass
       
  4142 @SYMTestType CT
       
  4143 */
       
  4144 void CCTsyCustomIPCFU::TestNetWakeup0002L()
       
  4145 	{
       
  4146 
       
  4147 	OpenEtelServerL(EUseExtendedError);
       
  4148 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  4149 	OpenPhoneL();
       
  4150 
       
  4151 	RMmCustomAPI customAPI;
       
  4152 	OpenCustomAPILC(customAPI, iPhone);
       
  4153 
       
  4154 	TRequestStatus requestStatus;
       
  4155 	TRequestStatus mockLtsyStatus;
       
  4156 
       
  4157  	//-------------------------------------------------------------------------
       
  4158 	// Test cancelling of RMmCustomAPI::NetWakeup
       
  4159  	//-------------------------------------------------------------------------
       
  4160  	
       
  4161 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
  4162  	
       
  4163 	iMockLTSY.ExpectL(ECustomNetWakeupIPC);
       
  4164 	iMockLTSY.CompleteL(ECustomNetWakeupIPC, KErrNone, 10);
       
  4165 	customAPI.NetWakeup(requestStatus);
       
  4166 	customAPI.CancelAsyncRequest(ECustomNetWakeupIPC);
       
  4167 		
       
  4168 	User::WaitForRequest(mockLtsyStatus);
       
  4169 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
  4170 
       
  4171 	User::WaitForRequest(requestStatus);
       
  4172 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
  4173 
       
  4174 	AssertMockLtsyStatusL();
       
  4175 
       
  4176 	CleanupStack::PopAndDestroy(2); 
       
  4177 	
       
  4178 	}
       
  4179 
       
  4180 
       
  4181 /**
       
  4182 @SYMTestCaseID BA-CTSY-CIPC-MCNW-0004
       
  4183 @SYMComponent  telephony_ctsy
       
  4184 @SYMTestCaseDesc Test support in CTSY for multiple client requests to RMmCustomAPI::NetWakeup
       
  4185 @SYMTestPriority High
       
  4186 @SYMTestActions Invokes multiple client requests to RMmCustomAPI::NetWakeup
       
  4187 @SYMTestExpectedResults Pass
       
  4188 @SYMTestType CT
       
  4189 */
       
  4190 void CCTsyCustomIPCFU::TestNetWakeup0004L()
       
  4191 	{
       
  4192 					
       
  4193 	OpenEtelServerL(EUseExtendedError);
       
  4194 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  4195 	OpenPhoneL();
       
  4196 
       
  4197 	// Open second client
       
  4198 	RTelServer telServer2;
       
  4199 	TInt ret = telServer2.Connect();
       
  4200 	ASSERT_EQUALS(KErrNone, ret);
       
  4201 	CleanupClosePushL(telServer2);
       
  4202 
       
  4203 	RMobilePhone phone2;
       
  4204 	ret = phone2.Open(iTelServer,KMmTsyPhoneName);
       
  4205 	ASSERT_EQUALS(KErrNone, ret);
       
  4206 	CleanupClosePushL(phone2);
       
  4207 
       
  4208 	RMmCustomAPI customAPI1;
       
  4209 	RMmCustomAPI customAPI2;
       
  4210 	OpenCustomAPILC(customAPI1, iPhone);
       
  4211 	OpenCustomAPILC(customAPI2, phone2, EFalse);
       
  4212 
       
  4213 	TRequestStatus requestStatus1;
       
  4214 	TRequestStatus requestStatus2;
       
  4215 
       
  4216 	//-------------------------------------------------------------------------
       
  4217 	// Test A: Test multiple clients requesting RMmCustomAPI::NetWakeup
       
  4218  	//-------------------------------------------------------------------------
       
  4219 
       
  4220 	iMockLTSY.ExpectL(ECustomNetWakeupIPC);
       
  4221 	iMockLTSY.CompleteL(ECustomNetWakeupIPC, KErrNone);
       
  4222 	customAPI1.NetWakeup(requestStatus1);
       
  4223 
       
  4224 	iMockLTSY.ExpectL(ECustomNetWakeupIPC);
       
  4225 	iMockLTSY.CompleteL(ECustomNetWakeupIPC, KErrNone);
       
  4226 	customAPI2.NetWakeup(requestStatus2);
       
  4227 
       
  4228 	User::WaitForRequest(requestStatus1);
       
  4229 	ASSERT_EQUALS(KErrNone, requestStatus1.Int());
       
  4230 
       
  4231 	User::WaitForRequest(requestStatus2);
       
  4232 	AssertMockLtsyStatusL();
       
  4233 	ASSERT_EQUALS(KErrNone, requestStatus2.Int());
       
  4234 
       
  4235 	CleanupStack::PopAndDestroy(5, this);
       
  4236 	}
       
  4237 
       
  4238 
       
  4239 /**
       
  4240 @SYMTestCaseID BA-CTSY-CIPC-MCNW-0005
       
  4241 @SYMComponent  telephony_ctsy
       
  4242 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::NetWakeup with timeout
       
  4243 @SYMTestPriority High
       
  4244 @SYMTestActions Invokes RMmCustomAPI::NetWakeup and tests for timeout
       
  4245 @SYMTestExpectedResults Pass
       
  4246 @SYMTestType CT
       
  4247 */
       
  4248 void CCTsyCustomIPCFU::TestNetWakeup0005L()
       
  4249 	{
       
  4250 
       
  4251 	OpenEtelServerL(EUseExtendedError);
       
  4252 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  4253 	OpenPhoneL();
       
  4254 
       
  4255 	RMmCustomAPI customAPI;
       
  4256 	OpenCustomAPILC(customAPI, iPhone);
       
  4257 
       
  4258 	TRequestStatus requestStatus;
       
  4259 
       
  4260 	//-------------------------------------------------------------------------
       
  4261 	// Test A: Test timeout of RMmCustomAPI::NetWakeup
       
  4262  	//-------------------------------------------------------------------------
       
  4263 
       
  4264 	iMockLTSY.ExpectL(ECustomNetWakeupIPC);
       
  4265 	customAPI.NetWakeup(requestStatus);
       
  4266 
       
  4267 	/*
       
  4268 	 * Test support in CTSY for RmobilePhone::GetServiceTable with timeout 
       
  4269 	 * IS ABOUT TO ABORT DUE TO TEF TIMEOUT.
       
  4270 	 */
       
  4271 
       
  4272 	ERR_PRINTF2(_L("<font color=Orange>$CTSYKnownFailure: defect id = %d</font>"), 401601);
       
  4273 
       
  4274 	User::WaitForRequest(requestStatus);
       
  4275 	AssertMockLtsyStatusL();
       
  4276 	ASSERT_EQUALS(KErrTimedOut, requestStatus.Int());
       
  4277 
       
  4278 	CleanupStack::PopAndDestroy(2, this); 
       
  4279 
       
  4280 	}
       
  4281 
       
  4282 
       
  4283 void CCTsyCustomIPCFU::FillWithRandomDataLC( RMmCustomAPI::TViagElements*& aElem, TInt aRnd) const
       
  4284 	{
       
  4285 	
       
  4286 	aElem = new (ELeave) RMmCustomAPI::TViagElements( RMmCustomAPI::KViagElementCount );
       
  4287 	CleanupStack::PushL(aElem);
       
  4288 	
       
  4289 	_LIT(KName, "Name");
       
  4290 	
       
  4291 	RMmCustomAPI::TViagElement element;
       
  4292 	
       
  4293 	for (TInt i = 0; i < RMmCustomAPI::KViagElementCount; i++)
       
  4294 		{
       
  4295 		element.iActiveFlag = ( i%2 == 0 ) ? RMmCustomAPI::ECityZone : RMmCustomAPI::ENotActive;
       
  4296 		element.iCoordinates.iR2 = 2*i + aRnd;
       
  4297 		element.iCoordinates.iX  = i + aRnd;
       
  4298 		element.iCoordinates.iY  = RMmCustomAPI::KViagElementCount - i + aRnd;
       
  4299 		element.iCoordinates.iZoneId = 2*i + 1 + aRnd;
       
  4300 		element.iName = KName;
       
  4301 		TBuf<2> number;
       
  4302 		number.Format(_L("%d"), i + aRnd);
       
  4303 		element.iName.Append(number);
       
  4304 		aElem->AppendL(element);
       
  4305 		}
       
  4306 	}
       
  4307 
       
  4308 
       
  4309 
       
  4310 /**
       
  4311 @SYMTestCaseID BA-CTSY-CIPC-MCRVHZP-0001
       
  4312 @SYMComponent  telephony_ctsy
       
  4313 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::ReadViagHomeZoneParams
       
  4314 @SYMTestPriority High
       
  4315 @SYMTestActions Invokes RMmCustomAPI::ReadViagHomeZoneParams
       
  4316 @SYMTestExpectedResults Pass
       
  4317 @SYMTestType CT
       
  4318 */
       
  4319 void CCTsyCustomIPCFU::TestReadViagHomeZoneParams0001L()
       
  4320 	{
       
  4321 	
       
  4322 	AuxReadViagHomeZoneParamsL();
       
  4323 	
       
  4324 	/*
       
  4325 	 * Test increases CMmSIMTsy::ReadViagHomeZoneParamsL coverage
       
  4326 	 * covers "if ( iMmCustomTsy->Phone()->NosBootState()->iSIMReady )" condition
       
  4327 	 */
       
  4328 	
       
  4329 	AuxReadViagHomeZoneParamsForIncreasingCoverageL();
       
  4330 	
       
  4331 	}
       
  4332 
       
  4333 /**
       
  4334 @SYMTestCaseID BA-CTSY-CIPC-MCRVHZP-0002
       
  4335 @SYMComponent  telephony_ctsy
       
  4336 @SYMTestCaseDesc Test support in CTSY for cancelling of RMmCustomAPI::ReadViagHomeZoneParams
       
  4337 @SYMTestPriority High
       
  4338 @SYMTestActions Invokes cancelling of RMmCustomAPI::ReadViagHomeZoneParams
       
  4339 @SYMTestExpectedResults Pass
       
  4340 @SYMTestType CT
       
  4341 */
       
  4342 void CCTsyCustomIPCFU::TestReadViagHomeZoneParams0002L()
       
  4343 	{
       
  4344 
       
  4345 	OpenEtelServerL(EUseExtendedError);
       
  4346 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  4347 	OpenPhoneL();
       
  4348 
       
  4349 	RMmCustomAPI customAPI;
       
  4350 	OpenCustomAPILC(customAPI, iPhone);
       
  4351 
       
  4352 	RBuf8 completeData;
       
  4353 	CleanupClosePushL(completeData);
       
  4354 
       
  4355 	TRequestStatus requestStatus;
       
  4356 	TRequestStatus mockLtsyStatus;
       
  4357 
       
  4358 	RMmCustomAPI::TViagElement element;
       
  4359 	_LIT(KScp, "Lenin lives!");
       
  4360 	_LIT(KSmsC, "revolution");
       
  4361 
       
  4362 	// Variables for call ReadViagHomeZoneParams.
       
  4363 	RMmCustomAPI::TViagParams param;
       
  4364 	RMmCustomAPI::TViagElements* elems;
       
  4365 	
       
  4366 	elems = new (ELeave) RMmCustomAPI::TViagElements( RMmCustomAPI::KViagElementCount );
       
  4367 	CleanupStack::PushL(elems);
       
  4368 	
       
  4369 	for (TInt i = 0; i < RMmCustomAPI::KViagElementCount; i++)
       
  4370 		{			
       
  4371 		elems->AppendL(element);
       
  4372 		}
       
  4373 
       
  4374 	// Variables for call CompleteL.
       
  4375 	RMmCustomAPI::TViagParams completeParam;
       
  4376 	completeParam.iScp = KScp;
       
  4377 	completeParam.iSmsC = KSmsC;
       
  4378 	completeParam.iSubscribedZoneAndVersion = 17;
       
  4379 
       
  4380 	RMmCustomAPI::TViagElements* completeElems;
       
  4381 	
       
  4382 	FillWithRandomDataLC(completeElems);
       
  4383 
       
  4384 	TMockLtsyData2<RMmCustomAPI::TViagParams, RMmCustomAPI::TViagElements*> 
       
  4385 		mockData2(completeParam, completeElems);
       
  4386 
       
  4387  	//-------------------------------------------------------------------------
       
  4388 	// Test cancelling of RMmCustomAPI::ReadViagHomeZoneParams
       
  4389  	//-------------------------------------------------------------------------
       
  4390 
       
  4391 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
  4392  	
       
  4393 	iMockLTSY.ExpectL(EReadViagHomeZoneParamsIPC);
       
  4394 	
       
  4395 	mockData2.SerialiseL(completeData);
       
  4396 	iMockLTSY.CompleteL(EReadViagHomeZoneParamsIPC, KErrNone, completeData, 10);
       
  4397 	
       
  4398 	customAPI.ReadViagHomeZoneParams(requestStatus, param, *elems);
       
  4399 	
       
  4400 	customAPI.CancelAsyncRequest(EReadViagHomeZoneParamsIPC);
       
  4401 
       
  4402 	User::WaitForRequest(mockLtsyStatus);
       
  4403 	AssertMockLtsyStatusL();
       
  4404 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
  4405 
       
  4406 	User::WaitForRequest(requestStatus);
       
  4407 	AssertMockLtsyStatusL();
       
  4408 	ASSERT_EQUALS(KErrCancel, requestStatus.Int());
       
  4409 
       
  4410 	CleanupStack::PopAndDestroy(5, this); 
       
  4411 	
       
  4412 	}
       
  4413 
       
  4414 
       
  4415 /**
       
  4416 @SYMTestCaseID BA-CTSY-CIPC-MCRVHZP-0003
       
  4417 @SYMComponent  telephony_ctsy
       
  4418 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::ReadViagHomeZoneParams with bad parameter data
       
  4419 @SYMTestPriority High
       
  4420 @SYMTestActions Invokes RMmCustomAPI::ReadViagHomeZoneParams with bad parameter data
       
  4421 @SYMTestExpectedResults Pass
       
  4422 @SYMTestType CT
       
  4423 */
       
  4424 void CCTsyCustomIPCFU::TestReadViagHomeZoneParams0003L()
       
  4425 	{
       
  4426 
       
  4427 	OpenEtelServerL(EUseExtendedError);
       
  4428 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  4429 	OpenPhoneL();
       
  4430 
       
  4431 	RMmCustomAPI customAPI;
       
  4432 	OpenCustomAPILC(customAPI, iPhone);
       
  4433 
       
  4434 	TRequestStatus requestStatus;
       
  4435 
       
  4436 	// Variables for call ReadViagHomeZoneParams.
       
  4437 	RMmCustomAPI::TViagParams param;
       
  4438 	RMmCustomAPI::TViagElements* elems = NULL;
       
  4439 	elems = new (ELeave) RMmCustomAPI::TViagElements( RMmCustomAPI::KViagElementCount );
       
  4440 	CleanupStack::PushL(elems);
       
  4441 
       
  4442 	//-------------------------------------------------------------------------
       
  4443 	// Test C: Test passing out of bounds parameters to
       
  4444 	// RMmCustomAPI::ReadViagHomeZoneParams
       
  4445  	//-------------------------------------------------------------------------
       
  4446 	
       
  4447 	customAPI.ReadViagHomeZoneParams(requestStatus, param, *elems);
       
  4448 
       
  4449 	User::WaitForRequest(requestStatus);
       
  4450 	AssertMockLtsyStatusL();
       
  4451 	ASSERT_EQUALS(KErrArgument, requestStatus.Int());
       
  4452 
       
  4453 	CleanupStack::PopAndDestroy(3, this); 
       
  4454 
       
  4455 	}
       
  4456 
       
  4457 
       
  4458 /**
       
  4459 @SYMTestCaseID BA-CTSY-CIPC-MCRVHZP-0004
       
  4460 @SYMComponent  telephony_ctsy
       
  4461 @SYMTestCaseDesc Test support in CTSY for multiple client requests to RMmCustomAPI::ReadViagHomeZoneParams
       
  4462 @SYMTestPriority High
       
  4463 @SYMTestActions Invokes multiple client requests to RMmCustomAPI::ReadViagHomeZoneParams
       
  4464 @SYMTestExpectedResults Pass
       
  4465 @SYMTestType CT
       
  4466 */
       
  4467 void CCTsyCustomIPCFU::TestReadViagHomeZoneParams0004L()
       
  4468 	{
       
  4469 					
       
  4470 	OpenEtelServerL(EUseExtendedError);
       
  4471 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  4472 	OpenPhoneL();
       
  4473 
       
  4474 	// Open second client
       
  4475 	RTelServer telServer2;
       
  4476 	TInt ret = telServer2.Connect();
       
  4477 	ASSERT_EQUALS(KErrNone, ret);
       
  4478 	CleanupClosePushL(telServer2);
       
  4479 
       
  4480 	RMobilePhone phone2;
       
  4481 	ret = phone2.Open(iTelServer,KMmTsyPhoneName);
       
  4482 	ASSERT_EQUALS(KErrNone, ret);
       
  4483 	CleanupClosePushL(phone2);
       
  4484 
       
  4485 	RMmCustomAPI customAPI1;
       
  4486 	RMmCustomAPI customAPI2;
       
  4487 	OpenCustomAPILC(customAPI1, iPhone);
       
  4488 	OpenCustomAPILC(customAPI2, phone2, EFalse);
       
  4489 
       
  4490 	RBuf8 completeData;
       
  4491 	CleanupClosePushL(completeData);
       
  4492 
       
  4493 	TRequestStatus requestStatus1;
       
  4494 	TRequestStatus requestStatus2;
       
  4495 
       
  4496 	RMmCustomAPI::TViagElement element;
       
  4497 	_LIT(KScp, "Lenin lives!");
       
  4498 	_LIT(KSmsC, "revolution");
       
  4499 
       
  4500 	// Variables for call ReadViagHomeZoneParams of first client.
       
  4501 	RMmCustomAPI::TViagParams param1;
       
  4502 	RMmCustomAPI::TViagElements* elems1 = NULL;
       
  4503 	
       
  4504 	elems1 = new (ELeave) RMmCustomAPI::TViagElements( RMmCustomAPI::KViagElementCount );
       
  4505 	CleanupStack::PushL(elems1);
       
  4506 	
       
  4507 	for (TInt i = 0; i < RMmCustomAPI::KViagElementCount; i++)
       
  4508 		{			
       
  4509 		elems1->AppendL(element);
       
  4510 		}
       
  4511 
       
  4512 	// Variables for call ReadViagHomeZoneParams of second client.
       
  4513 	RMmCustomAPI::TViagParams param2;
       
  4514 	RMmCustomAPI::TViagElements* elems2 = NULL;
       
  4515 	
       
  4516 	elems2 = new (ELeave) RMmCustomAPI::TViagElements( RMmCustomAPI::KViagElementCount );
       
  4517 	CleanupStack::PushL(elems2);
       
  4518 	
       
  4519 	for (TInt i = 0; i < RMmCustomAPI::KViagElementCount; i++)
       
  4520 		{			
       
  4521 		elems2->AppendL(element);
       
  4522 		}
       
  4523 
       
  4524 	// Variables for call CompleteL.
       
  4525 	RMmCustomAPI::TViagParams completeParam;
       
  4526 	completeParam.iScp = KScp;
       
  4527 	completeParam.iSmsC = KSmsC;
       
  4528 	completeParam.iSubscribedZoneAndVersion = 17;
       
  4529 
       
  4530 	RMmCustomAPI::TViagElements* completeElems;
       
  4531 	
       
  4532 	FillWithRandomDataLC(completeElems);
       
  4533 
       
  4534 
       
  4535 	TMockLtsyData2<RMmCustomAPI::TViagParams, RMmCustomAPI::TViagElements*> 
       
  4536 		mockData2(completeParam, completeElems);
       
  4537 
       
  4538 	//-------------------------------------------------------------------------
       
  4539 	// Test A: Test multiple clients requesting RMmCustomAPI::ReadViagHomeZoneParams
       
  4540  	//-------------------------------------------------------------------------
       
  4541 
       
  4542 	iMockLTSY.ExpectL(EReadViagHomeZoneParamsIPC);
       
  4543 	mockData2.SerialiseL(completeData);
       
  4544 	iMockLTSY.CompleteL(EReadViagHomeZoneParamsIPC, KErrNone, completeData);
       
  4545 	customAPI1.ReadViagHomeZoneParams(requestStatus1, param1, *elems1);
       
  4546 
       
  4547 	customAPI2.ReadViagHomeZoneParams(requestStatus2, param2, *elems2);
       
  4548 
       
  4549 	User::WaitForRequest(requestStatus1);
       
  4550 	ASSERT_EQUALS(KErrNone, requestStatus1.Int());
       
  4551 
       
  4552 	User::WaitForRequest(requestStatus2);
       
  4553 	ASSERT_EQUALS(KErrServerBusy, requestStatus2.Int());
       
  4554 
       
  4555 	ASSERT_EQUALS(0, completeParam.iScp.Compare(param1.iScp));
       
  4556 	ASSERT_EQUALS(0, completeParam.iSmsC.Compare(param1.iSmsC));
       
  4557 	ASSERT_EQUALS(completeParam.iSubscribedZoneAndVersion, param1.iSubscribedZoneAndVersion);
       
  4558 
       
  4559 	for (TInt i = 0; i < RMmCustomAPI::KViagElementCount; i++)
       
  4560 		{
       
  4561 		ASSERT_EQUALS(completeElems->At(i).iActiveFlag         , elems1->At(i).iActiveFlag         );
       
  4562 		ASSERT_EQUALS(completeElems->At(i).iCoordinates.iR2    , elems1->At(i).iCoordinates.iR2    );
       
  4563 		ASSERT_EQUALS(completeElems->At(i).iCoordinates.iX     , elems1->At(i).iCoordinates.iX     );
       
  4564 		ASSERT_EQUALS(completeElems->At(i).iCoordinates.iY     , elems1->At(i).iCoordinates.iY     );
       
  4565 		ASSERT_EQUALS(completeElems->At(i).iCoordinates.iZoneId, elems1->At(i).iCoordinates.iZoneId);
       
  4566 		ASSERT_EQUALS(0, completeElems->At(i).iName.Compare(elems1->At(i).iName));
       
  4567 		}
       
  4568 
       
  4569 	AssertMockLtsyStatusL();
       
  4570 
       
  4571 	CleanupStack::PopAndDestroy(9, this); 
       
  4572 
       
  4573 	}
       
  4574 
       
  4575 
       
  4576 /**
       
  4577 @SYMTestCaseID BA-CTSY-CIPC-MCRVHZP-0005
       
  4578 @SYMComponent  telephony_ctsy
       
  4579 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::ReadViagHomeZoneParams with timeout
       
  4580 @SYMTestPriority High
       
  4581 @SYMTestActions Invokes RMmCustomAPI::ReadViagHomeZoneParams and tests for timeout
       
  4582 @SYMTestExpectedResults Pass
       
  4583 @SYMTestType CT
       
  4584 */
       
  4585 void CCTsyCustomIPCFU::TestReadViagHomeZoneParams0005L()
       
  4586 	{
       
  4587 
       
  4588 	OpenEtelServerL(EUseExtendedError);
       
  4589 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  4590 	OpenPhoneL();
       
  4591 
       
  4592 	RMmCustomAPI customAPI;
       
  4593 	OpenCustomAPILC(customAPI, iPhone);
       
  4594 
       
  4595 	TRequestStatus requestStatus;
       
  4596 
       
  4597 	RMmCustomAPI::TViagElement element;
       
  4598 
       
  4599 	// Variables for call ReadViagHomeZoneParams.
       
  4600 	RMmCustomAPI::TViagParams param;
       
  4601 	RMmCustomAPI::TViagElements* elems = NULL;
       
  4602 	
       
  4603 	elems = new (ELeave) RMmCustomAPI::TViagElements( RMmCustomAPI::KViagElementCount );
       
  4604 	CleanupStack::PushL(elems);
       
  4605 	
       
  4606 	for (TInt i = 0; i < RMmCustomAPI::KViagElementCount; i++)
       
  4607 		{			
       
  4608 		elems->AppendL(element);
       
  4609 		}
       
  4610 
       
  4611 	//-------------------------------------------------------------------------
       
  4612 	// Test A: Test timeout of RMmCustomAPI::ReadViagHomeZoneParams
       
  4613  	//-------------------------------------------------------------------------
       
  4614 
       
  4615 	iMockLTSY.ExpectL(EReadViagHomeZoneParamsIPC);
       
  4616 	customAPI.ReadViagHomeZoneParams(requestStatus, param, *elems);
       
  4617 
       
  4618 	/*
       
  4619 	 * Test support in CTSY for RMmCustomAPI::ReadViagHomeZoneParams with timeout 
       
  4620 	 * IS ABOUT TO ABORT DUE TO TEF TIMEOUT.
       
  4621 	 */
       
  4622 
       
  4623 	ERR_PRINTF2(_L("<font color=Orange>$CTSYKnownFailure: defect id = %d</font>"), 401702);
       
  4624 
       
  4625 	User::WaitForRequest(requestStatus);
       
  4626 	AssertMockLtsyStatusL();
       
  4627 	ASSERT_EQUALS(KErrTimedOut, requestStatus.Int());
       
  4628 
       
  4629 	CleanupStack::PopAndDestroy(3, this); 
       
  4630 
       
  4631 	}
       
  4632 
       
  4633 
       
  4634 /**
       
  4635 @SYMTestCaseID BA-CTSY-CIPC-MCRVHZC-0001
       
  4636 @SYMComponent  telephony_ctsy
       
  4637 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::ReadViagHomeZoneCache
       
  4638 @SYMTestPriority High
       
  4639 @SYMTestActions Invokes RMmCustomAPI::ReadViagHomeZoneCache
       
  4640 @SYMTestExpectedResults Pass
       
  4641 @SYMTestType CT
       
  4642 */
       
  4643 void CCTsyCustomIPCFU::TestReadViagHomeZoneCache0001L()
       
  4644 	{
       
  4645 	OpenEtelServerL(EUseExtendedError);
       
  4646 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  4647 
       
  4648 	RMmCustomAPI customAPI;
       
  4649 
       
  4650 	//----------------------------------------------
       
  4651 	// TEST D: CTSY will get results from the cache.
       
  4652  	//----------------------------------------------
       
  4653 
       
  4654 	//********************************************************************************
       
  4655 	//* To initialize the VIAG home zone cache properly RMmCustomAPI::OpenL should be
       
  4656 	//* invoked _before_ EMmTsyBootNotifySimStatusReadyIPC is triggered.
       
  4657 	//* That's why OpenPhoneAndCustomAPILC was implemented and is used here 
       
  4658 	//* instead of usual OpenPhoneL/OpenCustomAPILC sequence.
       
  4659 	//********************************************************************************
       
  4660 
       
  4661 	OpenPhoneAndCustomAPILC(customAPI);
       
  4662 
       
  4663 	for(TInt c = KViagHomeZoneCacheIdMin; c <= KViagHomeZoneCacheIdMin; c++)
       
  4664 		{
       
  4665 		for(TInt r = KViagHomeZoneCacheRecordIdMin; r <= KViagHomeZoneCacheRecordIdMax; r++)
       
  4666 			{			
       
  4667 			RMmCustomAPI::TViagCacheRecordId recId;
       
  4668 			recId.iCacheId  = c; 
       
  4669 			recId.iRecordId = r;
       
  4670 		
       
  4671 			RMmCustomAPI::TViagCacheRecordContent recContent;
       
  4672 
       
  4673 			TRequestStatus reqStatus;
       
  4674 			customAPI.ReadViagHomeZoneCache(reqStatus,recId,recContent);
       
  4675 			User::WaitForRequest(reqStatus);
       
  4676 
       
  4677 			ASSERT_EQUALS(KErrNone,reqStatus.Int());
       
  4678 			
       
  4679 			const RMmCustomAPI::TViagCacheRecordContent& expectedContent =
       
  4680 				iViagHomeZoneCache[c - KViagHomeZoneCacheIdMin][r - KViagHomeZoneCacheRecordIdMin];
       
  4681 			ASSERT_EQUALS(expectedContent.iLac, recContent.iLac);
       
  4682 			ASSERT_EQUALS(expectedContent.iCellId, recContent.iCellId);
       
  4683 			}
       
  4684 		}	
       
  4685 
       
  4686 	AssertMockLtsyStatusL();
       
  4687 
       
  4688 	//-------------------------------------------------------------------------
       
  4689 	// TEST E: Unsolicited completion of RMmCustomAPI::ReadViagHomeZoneCache
       
  4690 	// from LTSY.
       
  4691  	//-------------------------------------------------------------------------
       
  4692 
       
  4693 	// unsolicited EReadViagHomeZoneCacheIPC completion crashes CTSY
       
  4694 	
       
  4695 	RMmCustomAPI::TViagCacheRecordContent unsolicitedData;
       
  4696 	TPckgC<RMmCustomAPI::TViagCacheRecordContent> unsolicitedDataPckg(unsolicitedData);
       
  4697 	unsolicitedData.iCellId = 111;
       
  4698 	unsolicitedData.iLac = 222;
       
  4699 	
       
  4700 	TRequestStatus mockLtsyStatus;
       
  4701 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
  4702 	iMockLTSY.CompleteL(EReadViagHomeZoneCacheIPC,KErrNone,unsolicitedDataPckg);
       
  4703 
       
  4704 	User::WaitForRequest(mockLtsyStatus);
       
  4705 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
  4706 	AssertMockLtsyStatusL();
       
  4707 	
       
  4708 	CleanupStack::PopAndDestroy(2, this); // customAPI, this
       
  4709 	}
       
  4710 
       
  4711 
       
  4712 /**
       
  4713 @SYMTestCaseID BA-CTSY-CIPC-MCRVHZC-0002
       
  4714 @SYMComponent  telephony_ctsy
       
  4715 @SYMTestCaseDesc Test support in CTSY for cancelling of RMmCustomAPI::ReadViagHomeZoneCache
       
  4716 @SYMTestPriority High
       
  4717 @SYMTestActions Invokes cancelling of RMmCustomAPI::ReadViagHomeZoneCache
       
  4718 @SYMTestExpectedResults Pass
       
  4719 @SYMTestType CT
       
  4720 */
       
  4721 void CCTsyCustomIPCFU::TestReadViagHomeZoneCache0002L()
       
  4722 	{
       
  4723 	OpenEtelServerL(EUseExtendedError);
       
  4724 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  4725 
       
  4726 	OpenPhoneL();
       
  4727 
       
  4728 	RMmCustomAPI customAPI;	
       
  4729 	OpenCustomAPILC(customAPI, iPhone);
       
  4730 
       
  4731 	TRequestStatus reqStatus;
       
  4732 
       
  4733 	RMmCustomAPI::TViagCacheRecordId recId;
       
  4734 	recId.iCacheId  = KViagHomeZoneCacheIdMax;
       
  4735 	recId.iRecordId = KViagHomeZoneCacheRecordIdMax;
       
  4736 	RMmCustomAPI::TViagCacheRecordContent recContent;
       
  4737 
       
  4738 	customAPI.ReadViagHomeZoneCache(reqStatus,recId,recContent);
       
  4739 	customAPI.CancelAsyncRequest(EReadViagHomeZoneCacheIPC);
       
  4740 
       
  4741 	User::WaitForRequest(reqStatus);
       
  4742 	ASSERT_EQUALS(KErrCancel, reqStatus.Int());
       
  4743 
       
  4744 	AssertMockLtsyStatusL();	
       
  4745 
       
  4746 	CleanupStack::PopAndDestroy(2, this); // customAPI, this	
       
  4747 	}
       
  4748 
       
  4749 
       
  4750 /**
       
  4751 @SYMTestCaseID BA-CTSY-CIPC-MCRVHZC-0003
       
  4752 @SYMComponent  telephony_ctsy
       
  4753 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::ReadViagHomeZoneCache with bad parameter data
       
  4754 @SYMTestPriority High
       
  4755 @SYMTestActions Invokes RMmCustomAPI::ReadViagHomeZoneCache with bad parameter data
       
  4756 @SYMTestExpectedResults Pass
       
  4757 @SYMTestType CT
       
  4758 */
       
  4759 void CCTsyCustomIPCFU::TestReadViagHomeZoneCache0003L()
       
  4760 	{
       
  4761 	OpenEtelServerL(EUseExtendedError);
       
  4762 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  4763 	OpenPhoneL();
       
  4764 
       
  4765 	RMmCustomAPI customAPI;	
       
  4766 	OpenCustomAPILC(customAPI, iPhone);
       
  4767 	
       
  4768 	//-------------------------------------------------------------------------
       
  4769 	// Test C: Test passing out of bounds parameters to RMmCustomAPI::ReadViagHomeZoneCache
       
  4770  	//-------------------------------------------------------------------------
       
  4771 
       
  4772 	RMmCustomAPI::TViagCacheRecordId KBadRecId[] =
       
  4773 	 	{
       
  4774 		{KViagHomeZoneCacheIdMin - 1, KViagHomeZoneCacheRecordIdMin },
       
  4775 		{KViagHomeZoneCacheIdMax + 1, KViagHomeZoneCacheRecordIdMin },
       
  4776 		{KViagHomeZoneCacheIdMin,     KViagHomeZoneCacheRecordIdMin -1 },
       
  4777 		{KViagHomeZoneCacheIdMin,     KViagHomeZoneCacheRecordIdMax + 1}
       
  4778 	 	};
       
  4779 
       
  4780  	for(TInt i = 0; i < sizeof(KBadRecId)/sizeof(KBadRecId[0]); i++)
       
  4781  		{
       
  4782  		TRequestStatus reqStatus;
       
  4783 
       
  4784  		RMmCustomAPI::TViagCacheRecordContent recContent;
       
  4785 
       
  4786  		customAPI.ReadViagHomeZoneCache(reqStatus,KBadRecId[i],recContent);
       
  4787 
       
  4788  		User::WaitForRequest(reqStatus);
       
  4789  		ASSERT_EQUALS(KErrArgument,reqStatus.Int());
       
  4790  		}
       
  4791 
       
  4792 	AssertMockLtsyStatusL();	
       
  4793 
       
  4794 	CleanupStack::PopAndDestroy(2, this); // customAPI, this
       
  4795 	}
       
  4796 
       
  4797 
       
  4798 /**
       
  4799 @SYMTestCaseID BA-CTSY-CIPC-MCRVHZC-0004
       
  4800 @SYMComponent  telephony_ctsy
       
  4801 @SYMTestCaseDesc Test support in CTSY for multiple client requests to RMmCustomAPI::ReadViagHomeZoneCache
       
  4802 @SYMTestPriority High
       
  4803 @SYMTestActions Invokes multiple client requests to RMmCustomAPI::ReadViagHomeZoneCache
       
  4804 @SYMTestExpectedResults Pass
       
  4805 @SYMTestType CT
       
  4806 */
       
  4807 void CCTsyCustomIPCFU::TestReadViagHomeZoneCache0004L()
       
  4808 	{
       
  4809 					
       
  4810 	OpenEtelServerL(EUseExtendedError);
       
  4811 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  4812 
       
  4813 	RTelServer telServer2;
       
  4814 	TInt ret = telServer2.Connect();
       
  4815 	ASSERT_EQUALS(KErrNone, ret);
       
  4816 	CleanupClosePushL(telServer2);
       
  4817 
       
  4818 	RMobilePhone phone2;
       
  4819 	ret = phone2.Open(telServer2,KMmTsyPhoneName);
       
  4820 	ASSERT_EQUALS(KErrNone, ret);
       
  4821 	CleanupClosePushL(phone2);
       
  4822 
       
  4823 	//-------------------------------------------------------------------------
       
  4824 	// Test A: Test multiple clients requesting RMmCustomAPI::ReadViagHomeZoneCache
       
  4825  	//-------------------------------------------------------------------------
       
  4826 	RMmCustomAPI customAPI2;
       
  4827 	RMmCustomAPI customAPI1;
       
  4828 	
       
  4829 	const RMmCustomAPI::TViagCacheRecordContent& expectedContent2 =
       
  4830 		iViagHomeZoneCache[0][0];
       
  4831 
       
  4832 	const RMmCustomAPI::TViagCacheRecordContent& expectedContent1 =
       
  4833 		iViagHomeZoneCache[KViagHomeZoneCacheIdMax - KViagHomeZoneCacheIdMin][KViagHomeZoneCacheRecordIdMax - KViagHomeZoneCacheRecordIdMin];
       
  4834 
       
  4835 	RMmCustomAPI::TViagCacheRecordId recId2 = {KViagHomeZoneCacheIdMin, KViagHomeZoneCacheRecordIdMin };
       
  4836 	RMmCustomAPI::TViagCacheRecordId recId1 = {KViagHomeZoneCacheIdMax, KViagHomeZoneCacheRecordIdMax };
       
  4837 
       
  4838 	RMmCustomAPI::TViagCacheRecordContent recContent2;
       
  4839 	RMmCustomAPI::TViagCacheRecordContent recContent1;
       
  4840 
       
  4841 	TRequestStatus reqStatus2;
       
  4842 	TRequestStatus reqStatus1;
       
  4843 
       
  4844     //OpenPhoneAndCustomAPILC(customAPI1);
       
  4845 	OpenPhoneL();
       
  4846     OpenCustomAPILC(customAPI1, iPhone, ETrue);
       
  4847 	OpenCustomAPILC(customAPI2, phone2, EFalse);
       
  4848 
       
  4849 	// start reading from the 2-nd client. 
       
  4850 	customAPI2.ReadViagHomeZoneCache(reqStatus2,recId2,recContent2);
       
  4851 
       
  4852 	// start reading from the 1-st client 
       
  4853 	customAPI1.ReadViagHomeZoneCache(reqStatus1,recId1,recContent1);
       
  4854 
       
  4855 	// Complete the cashing
       
  4856 	TBool expect = EFalse;
       
  4857     for(TInt c = KViagHomeZoneCacheIdMin; c <= KViagHomeZoneCacheIdMax; c++)
       
  4858         {
       
  4859         for(TInt r = KViagHomeZoneCacheRecordIdMin; r <= KViagHomeZoneCacheRecordIdMax; r++)
       
  4860             {
       
  4861             MockPrimeEReadViagHomeZoneCacheIPCL(c,r, ETrue, expect);
       
  4862             expect = ETrue;
       
  4863             }
       
  4864         }
       
  4865 	
       
  4866 	// wait for results
       
  4867 	User::WaitForRequest(reqStatus1);
       
  4868 	User::WaitForRequest(reqStatus2);
       
  4869 
       
  4870 	// check 1-st client results
       
  4871 	ASSERT_EQUALS(KErrNone,reqStatus1.Int());
       
  4872 	ASSERT_EQUALS(expectedContent1.iLac, recContent1.iLac);
       
  4873 	ASSERT_EQUALS(expectedContent1.iCellId, recContent1.iCellId);
       
  4874 
       
  4875 	// check 2-nd client results
       
  4876 	ASSERT_EQUALS(KErrNone,reqStatus2.Int());
       
  4877 	ASSERT_EQUALS(expectedContent2.iLac, recContent2.iLac);
       
  4878 	ASSERT_EQUALS(expectedContent2.iCellId, recContent2.iCellId);
       
  4879 
       
  4880 	AssertMockLtsyStatusL();	
       
  4881 
       
  4882 	CleanupStack::PopAndDestroy(5, this); // customAPI2,phone2,telServer2,customAPI,this 
       
  4883 	}
       
  4884 
       
  4885 
       
  4886 /**
       
  4887 @SYMTestCaseID BA-CTSY-CIPC-MCRVHZC-0005
       
  4888 @SYMComponent  telephony_ctsy
       
  4889 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::ReadViagHomeZoneCache with timeout
       
  4890 @SYMTestPriority High
       
  4891 @SYMTestActions Invokes RMmCustomAPI::ReadViagHomeZoneCache and tests for timeout
       
  4892 @SYMTestExpectedResults Pass
       
  4893 @SYMTestType CT
       
  4894 */
       
  4895 void CCTsyCustomIPCFU::TestReadViagHomeZoneCache0005L()
       
  4896 	{
       
  4897 	ERR_PRINTF2(_L("<font color=Orange>$CTSYKnownFailure: defect id = %d</font>"), 404902);
       
  4898 	ASSERT_TRUE(EFalse);
       
  4899 
       
  4900 	OpenEtelServerL(EUseExtendedError);
       
  4901 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  4902 	OpenPhoneL();
       
  4903 
       
  4904 	RMmCustomAPI customAPI;	
       
  4905 	OpenCustomAPILC(customAPI);
       
  4906 
       
  4907 	//-------------------------------------------------------------------------
       
  4908 	// Test A: Test timeout of RMmCustomAPI::ReadViagHomeZoneCache
       
  4909  	//-------------------------------------------------------------------------
       
  4910 	TRequestStatus reqStatus;
       
  4911 
       
  4912  	RMmCustomAPI::TViagCacheRecordId recId = {KViagHomeZoneCacheIdMin, KViagHomeZoneCacheRecordIdMin };
       
  4913 
       
  4914 	RMmCustomAPI::TViagCacheRecordContent recContent;
       
  4915 
       
  4916 	// the request is never timed out
       
  4917 	ERR_PRINTF2(_L("<font color=Orange>$CTSYKnownFailure: defect id = %d</font>"), 401805);
       
  4918 	ASSERT_TRUE(EFalse);
       
  4919 
       
  4920 	customAPI.ReadViagHomeZoneCache(reqStatus,recId,recContent);
       
  4921 		
       
  4922 	User::WaitForRequest(reqStatus);
       
  4923 	ASSERT_EQUALS(KErrTimedOut,reqStatus.Int());
       
  4924 
       
  4925 	AssertMockLtsyStatusL();	
       
  4926 	
       
  4927  	CleanupStack::PopAndDestroy(2, this); // customAPI, this
       
  4928 	}
       
  4929 
       
  4930 
       
  4931 /**
       
  4932 @SYMTestCaseID BA-CTSY-CIPC-MCWVHZC-0001
       
  4933 @SYMComponent  telephony_ctsy
       
  4934 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::WriteViagHomeZoneCache
       
  4935 @SYMTestPriority High
       
  4936 @SYMTestActions Invokes RMmCustomAPI::WriteViagHomeZoneCache
       
  4937 @SYMTestExpectedResults Pass
       
  4938 @SYMTestType CT
       
  4939 */
       
  4940 void CCTsyCustomIPCFU::TestWriteViagHomeZoneCache0001L()
       
  4941 	{
       
  4942 
       
  4943 	OpenEtelServerL(EUseExtendedError);
       
  4944 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  4945 
       
  4946 	RMmCustomAPI customAPI;	
       
  4947 
       
  4948 	//********************************************************************************
       
  4949 	//* To initiazlize the VIAG home zone cache properly RMmCustomAPI::OpenL should be
       
  4950 	//* invoked _before_ EMmTsyBootNotifySimStatusReadyIPC is triggered.
       
  4951 	//* That's why OpenPhoneAndCustomAPILC was implemented and is used here 
       
  4952 	//* instead of usual OpenPhoneL/OpenCustomAPILC sequence.
       
  4953 	//********************************************************************************
       
  4954 
       
  4955 	OpenPhoneAndCustomAPILC(customAPI);
       
  4956 	
       
  4957 	RBuf8 data;
       
  4958 	data.CleanupClosePushL();
       
  4959 
       
  4960 	RMmCustomAPI::TViagCacheRecordId expRecId;
       
  4961 	expRecId.iCacheId  = KViagHomeZoneCacheIdMin;
       
  4962 	expRecId.iRecordId = KViagHomeZoneCacheRecordIdMin;
       
  4963 	
       
  4964 	RMmCustomAPI::TViagCacheRecordContent expContent; 
       
  4965 	expContent.iCellId = 3000;
       
  4966 	expContent.iLac = 4000;
       
  4967 
       
  4968 	TMockLtsyData2<RMmCustomAPI::TViagCacheRecordId,
       
  4969 					RMmCustomAPI::TViagCacheRecordContent> expData(expRecId,expContent);
       
  4970 	
       
  4971 	TRequestStatus reqStatus;
       
  4972 
       
  4973 	//-------------------------------------------------------------------------
       
  4974 	// TEST A: failure to dispatch request to LTSY
       
  4975  	//-------------------------------------------------------------------------
       
  4976 	expData.SerialiseL(data);
       
  4977 	iMockLTSY.ExpectL(EWriteViagHomeZoneCacheIPC,data,KErrGeneral);
       
  4978 	
       
  4979 	customAPI.WriteViagHomeZoneCache(reqStatus,expRecId,expContent);
       
  4980 	User::WaitForRequest(reqStatus);
       
  4981 	ASSERT_EQUALS(KErrGeneral,reqStatus.Int())
       
  4982 
       
  4983 	//-------------------------------------------------------------------------
       
  4984 	// TEST B: failure on completion of pending request from LTSY->CTSY
       
  4985  	//-------------------------------------------------------------------------
       
  4986 	iMockLTSY.ExpectL(EWriteViagHomeZoneCacheIPC,data);
       
  4987 	iMockLTSY.CompleteL(EWriteViagHomeZoneCacheIPC,KErrGeneral);
       
  4988 
       
  4989 	customAPI.WriteViagHomeZoneCache(reqStatus,expRecId,expContent);
       
  4990 	User::WaitForRequest(reqStatus);
       
  4991 	ASSERT_EQUALS(KErrGeneral,reqStatus.Int())
       
  4992 
       
  4993  	//-------------------------------------------------------------------------
       
  4994 	// TEST C: Successful completion request of
       
  4995 	// RMmCustomAPI::WriteViagHomeZoneCache when result is not cached.
       
  4996  	//-------------------------------------------------------------------------
       
  4997 	for(TInt c = KViagHomeZoneCacheIdMin; c <= KViagHomeZoneCacheIdMax; c++)
       
  4998 		{
       
  4999 		for(TInt r = KViagHomeZoneCacheRecordIdMin; r <= KViagHomeZoneCacheRecordIdMax; r++)
       
  5000 			{
       
  5001 			expRecId.iCacheId  = c;
       
  5002 			expRecId.iRecordId = r;
       
  5003 
       
  5004 			expContent.iCellId = 3000 + c;
       
  5005 			expContent.iLac = 4000 + r;
       
  5006 
       
  5007 			expData.Close();
       
  5008 			expData.SerialiseL(data);
       
  5009 
       
  5010 			iMockLTSY.ExpectL(EWriteViagHomeZoneCacheIPC,data);
       
  5011 			iMockLTSY.CompleteL(EWriteViagHomeZoneCacheIPC,KErrNone);
       
  5012 		
       
  5013 			// write new cache content
       
  5014 			customAPI.WriteViagHomeZoneCache(reqStatus,expRecId,expContent);
       
  5015 			User::WaitForRequest(reqStatus);
       
  5016 			ASSERT_EQUALS(KErrNone,reqStatus.Int())
       
  5017 		
       
  5018 			// read it to verify that it was written correctly
       
  5019 			RMmCustomAPI::TViagCacheRecordContent newContent; 
       
  5020 			customAPI.ReadViagHomeZoneCache(reqStatus,expRecId,newContent);
       
  5021 			User::WaitForRequest(reqStatus);
       
  5022 			ASSERT_EQUALS(KErrNone,reqStatus.Int())
       
  5023 			ASSERT_EQUALS(expContent.iCellId,newContent.iCellId);
       
  5024 			ASSERT_EQUALS(expContent.iLac,newContent.iLac);
       
  5025 			}
       
  5026 		}
       
  5027 
       
  5028 	AssertMockLtsyStatusL();
       
  5029 
       
  5030 	//-------------------------------------------------------------------------
       
  5031 	// TEST E: Unsolicited completion of RMmCustomAPI::WriteViagHomeZoneCache
       
  5032 	// from LTSY.
       
  5033  	//-------------------------------------------------------------------------
       
  5034 
       
  5035 	TRequestStatus mockLtsyStatus;
       
  5036 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
  5037 	iMockLTSY.CompleteL(EWriteViagHomeZoneCacheIPC,KErrNone);
       
  5038 	User::WaitForRequest(mockLtsyStatus);
       
  5039 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
  5040 
       
  5041 	AssertMockLtsyStatusL();
       
  5042 
       
  5043 	CleanupStack::PopAndDestroy(3, this); // data, customAPI, this
       
  5044 	}
       
  5045 
       
  5046 
       
  5047 /**
       
  5048 @SYMTestCaseID BA-CTSY-CIPC-MCWVHZC-0002
       
  5049 @SYMComponent  telephony_ctsy
       
  5050 @SYMTestCaseDesc Test support in CTSY for cancelling of RMmCustomAPI::WriteViagHomeZoneCache
       
  5051 @SYMTestPriority High
       
  5052 @SYMTestActions Invokes cancelling of RMmCustomAPI::WriteViagHomeZoneCache
       
  5053 @SYMTestExpectedResults Pass
       
  5054 @SYMTestType CT
       
  5055 */
       
  5056 void CCTsyCustomIPCFU::TestWriteViagHomeZoneCache0002L()
       
  5057 	{
       
  5058 	
       
  5059 	OpenEtelServerL(EUseExtendedError);
       
  5060 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  5061 	OpenPhoneL();
       
  5062 
       
  5063 	RMmCustomAPI customAPI;	
       
  5064 	OpenCustomAPILC(customAPI, iPhone);
       
  5065 	
       
  5066 	RBuf8 data;
       
  5067 	data.CleanupClosePushL();
       
  5068 
       
  5069 	RMmCustomAPI::TViagCacheRecordId expRecId;
       
  5070 	expRecId.iCacheId  = KViagHomeZoneCacheIdMin;
       
  5071 	expRecId.iRecordId = KViagHomeZoneCacheRecordIdMin;
       
  5072 	
       
  5073 	RMmCustomAPI::TViagCacheRecordContent expContent; 
       
  5074 	expContent.iCellId = 3000;
       
  5075 	expContent.iLac = 4000;
       
  5076 
       
  5077 	TMockLtsyData2<RMmCustomAPI::TViagCacheRecordId,
       
  5078 					RMmCustomAPI::TViagCacheRecordContent> expData(expRecId,expContent);
       
  5079 	
       
  5080 	TRequestStatus reqStatus;
       
  5081 
       
  5082 	//-------------------------------------------------------------------------
       
  5083 	// Test cancelling of RMmCustomAPI::WriteViagHomeZoneCache
       
  5084  	//-------------------------------------------------------------------------
       
  5085 	expData.SerialiseL(data);
       
  5086 	iMockLTSY.ExpectL(EWriteViagHomeZoneCacheIPC,data);
       
  5087 	
       
  5088 	customAPI.WriteViagHomeZoneCache(reqStatus,expRecId,expContent);
       
  5089 	customAPI.CancelAsyncRequest(EWriteViagHomeZoneCacheIPC);
       
  5090 	
       
  5091 	User::WaitForRequest(reqStatus);
       
  5092 	ASSERT_EQUALS(KErrCancel,reqStatus.Int())
       
  5093 
       
  5094 	AssertMockLtsyStatusL();
       
  5095 
       
  5096 	CleanupStack::PopAndDestroy(3,this); // data, customAPI, this	
       
  5097 	}
       
  5098 
       
  5099 
       
  5100 /**
       
  5101 @SYMTestCaseID BA-CTSY-CIPC-MCWVHZC-0003
       
  5102 @SYMComponent  telephony_ctsy
       
  5103 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::WriteViagHomeZoneCache with bad parameter data
       
  5104 @SYMTestPriority High
       
  5105 @SYMTestActions Invokes RMmCustomAPI::WriteViagHomeZoneCache with bad parameter data
       
  5106 @SYMTestExpectedResults Pass
       
  5107 @SYMTestType CT
       
  5108 */
       
  5109 void CCTsyCustomIPCFU::TestWriteViagHomeZoneCache0003L()
       
  5110 	{
       
  5111 
       
  5112 	OpenEtelServerL(EUseExtendedError);
       
  5113 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  5114 	OpenPhoneL();
       
  5115 
       
  5116 	RMmCustomAPI customAPI;
       
  5117 	OpenCustomAPILC(customAPI, iPhone);
       
  5118 
       
  5119 	//-------------------------------------------------------------------------
       
  5120 	// Test C: Test passing out of bounds parameters to
       
  5121 	// RMmCustomAPI::WriteViagHomeZoneCache
       
  5122  	//-------------------------------------------------------------------------
       
  5123 	const RMmCustomAPI::TViagCacheRecordId KBadRecId[] =
       
  5124 	 	{
       
  5125 		{KViagHomeZoneCacheIdMin - 1, KViagHomeZoneCacheRecordIdMin },
       
  5126 		{KViagHomeZoneCacheIdMax + 1, KViagHomeZoneCacheRecordIdMin },
       
  5127 		{KViagHomeZoneCacheIdMin,     KViagHomeZoneCacheRecordIdMin -1 },
       
  5128 		{KViagHomeZoneCacheIdMin,     KViagHomeZoneCacheRecordIdMax + 1}
       
  5129 	 	};
       
  5130 
       
  5131 	const RMmCustomAPI::TViagCacheRecordContent KRecContent = {0,0};
       
  5132 
       
  5133  	for(TInt i = 0; i < sizeof(KBadRecId)/sizeof(KBadRecId[0]); i++)
       
  5134  		{
       
  5135  		TRequestStatus reqStatus;
       
  5136 
       
  5137  		customAPI.WriteViagHomeZoneCache(reqStatus,KBadRecId[i],KRecContent);
       
  5138 
       
  5139  		User::WaitForRequest(reqStatus);
       
  5140  		ASSERT_EQUALS(KErrArgument,reqStatus.Int());
       
  5141  		}
       
  5142  	
       
  5143 	AssertMockLtsyStatusL();
       
  5144 
       
  5145 	CleanupStack::PopAndDestroy(2, this); // customAPI, this
       
  5146 	}
       
  5147 
       
  5148 
       
  5149 /**
       
  5150 @SYMTestCaseID BA-CTSY-CIPC-MCWVHZC-0004
       
  5151 @SYMComponent  telephony_ctsy
       
  5152 @SYMTestCaseDesc Test support in CTSY for multiple client requests to RMmCustomAPI::WriteViagHomeZoneCache
       
  5153 @SYMTestPriority High
       
  5154 @SYMTestActions Invokes multiple client requests to RMmCustomAPI::WriteViagHomeZoneCache
       
  5155 @SYMTestExpectedResults Pass
       
  5156 @SYMTestType CT
       
  5157 */
       
  5158 void CCTsyCustomIPCFU::TestWriteViagHomeZoneCache0004L()
       
  5159 	{
       
  5160 					
       
  5161 	OpenEtelServerL(EUseExtendedError);
       
  5162 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  5163 
       
  5164 	// Open 2-nd phone
       
  5165 	RTelServer telServer2;
       
  5166 	TInt ret = telServer2.Connect();
       
  5167 	ASSERT_EQUALS(KErrNone, ret);
       
  5168 	CleanupClosePushL(telServer2);
       
  5169 
       
  5170 	RMobilePhone phone2;
       
  5171 	ret = phone2.Open(telServer2,KMmTsyPhoneName);
       
  5172 	ASSERT_EQUALS(KErrNone, ret);
       
  5173 	CleanupClosePushL(phone2);
       
  5174 	
       
  5175 	// now open 1-st phone and two RMmCustomAPI-s 
       
  5176 	RMmCustomAPI customAPI1;
       
  5177 	RMmCustomAPI customAPI2;
       
  5178 
       
  5179 	OpenPhoneAndCustomAPILC(customAPI1);
       
  5180 	OpenCustomAPILC(customAPI2, phone2, EFalse);
       
  5181 
       
  5182 	//-------------------------------------------------------------------------
       
  5183 	// Test A: Test multiple clients requesting RMmCustomAPI::WriteViagHomeZoneCache
       
  5184  	//-------------------------------------------------------------------------
       
  5185 	RMmCustomAPI::TViagCacheRecordId expRecId1;
       
  5186 	expRecId1.iCacheId  = KViagHomeZoneCacheIdMin;
       
  5187 	expRecId1.iRecordId = KViagHomeZoneCacheRecordIdMin;
       
  5188 
       
  5189 	RMmCustomAPI::TViagCacheRecordId expRecId2;
       
  5190 	expRecId2.iCacheId  = KViagHomeZoneCacheIdMax;
       
  5191 	expRecId2.iRecordId = KViagHomeZoneCacheRecordIdMax;
       
  5192 	
       
  5193 	RMmCustomAPI::TViagCacheRecordContent expContent1; 
       
  5194 	expContent1.iCellId = 3001;
       
  5195 	expContent1.iLac = 4001;
       
  5196 
       
  5197 	RMmCustomAPI::TViagCacheRecordContent expContent2; 
       
  5198 	expContent2.iCellId = 3002;
       
  5199 	expContent2.iLac = 4002;
       
  5200 
       
  5201 	TRequestStatus reqStatus1;
       
  5202 	TRequestStatus reqStatus2;
       
  5203 
       
  5204 	TMockLtsyData2<RMmCustomAPI::TViagCacheRecordId,
       
  5205 					RMmCustomAPI::TViagCacheRecordContent> expData(expRecId1,expContent1);
       
  5206 	
       
  5207 	RBuf8 data;
       
  5208 	data.CleanupClosePushL();
       
  5209 
       
  5210 	// Only one EWriteViagHomeZoneCacheIPC request is passed to the Mock LTSY
       
  5211 	expData.SerialiseL(data);
       
  5212 	iMockLTSY.ExpectL(EWriteViagHomeZoneCacheIPC,data);
       
  5213 	iMockLTSY.CompleteL(EWriteViagHomeZoneCacheIPC,KErrNone);
       
  5214 
       
  5215 	// Try to invoke two simultaneous EWriteViagHomeZoneCacheIPC requests.
       
  5216 	// The 2-nd one should fail with KErrServerBusy.
       
  5217 	customAPI1.WriteViagHomeZoneCache(reqStatus1,expRecId1,expContent1);
       
  5218 	customAPI2.WriteViagHomeZoneCache(reqStatus2,expRecId2,expContent2);
       
  5219 	User::WaitForRequest(reqStatus1);
       
  5220 	User::WaitForRequest(reqStatus2);
       
  5221 	ASSERT_EQUALS(KErrNone,reqStatus1.Int());
       
  5222 	ASSERT_EQUALS(KErrServerBusy,reqStatus2.Int());
       
  5223 
       
  5224 	// verify that the record changed by the 1-st client is changed succesfully 
       
  5225 	RMmCustomAPI::TViagCacheRecordContent newContent;
       
  5226 	customAPI1.ReadViagHomeZoneCache(reqStatus1,expRecId1,newContent);
       
  5227 	User::WaitForRequest(reqStatus1);
       
  5228 
       
  5229 	ASSERT_EQUALS(KErrNone,reqStatus1.Int());
       
  5230 	ASSERT_EQUALS(expContent1.iLac, newContent.iLac);
       
  5231 	ASSERT_EQUALS(expContent1.iCellId, newContent.iCellId);
       
  5232 	
       
  5233 	AssertMockLtsyStatusL();
       
  5234 
       
  5235 	// data, customAPI2, customAPI1, phone2, telServer2,  this
       
  5236 	CleanupStack::PopAndDestroy(6, this); 
       
  5237 
       
  5238 	}
       
  5239 
       
  5240 
       
  5241 /**
       
  5242 @SYMTestCaseID BA-CTSY-CIPC-MCWVHZC-0005
       
  5243 @SYMComponent  telephony_ctsy
       
  5244 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::WriteViagHomeZoneCache with timeout
       
  5245 @SYMTestPriority High
       
  5246 @SYMTestActions Invokes RMmCustomAPI::WriteViagHomeZoneCache and tests for timeout
       
  5247 @SYMTestExpectedResults Pass
       
  5248 @SYMTestType CT
       
  5249 */
       
  5250 void CCTsyCustomIPCFU::TestWriteViagHomeZoneCache0005L()
       
  5251 	{
       
  5252 	ERR_PRINTF2(_L("<font color=Orange>$CTSYKnownFailure: defect id = %d</font>"), 404902);
       
  5253 	ASSERT_TRUE(EFalse);
       
  5254 
       
  5255 	OpenEtelServerL(EUseExtendedError);
       
  5256 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  5257 	OpenPhoneL();
       
  5258 
       
  5259 	RMmCustomAPI customAPI;
       
  5260 	OpenCustomAPILC(customAPI);
       
  5261 
       
  5262 	RBuf8 data;
       
  5263 	data.CleanupClosePushL();
       
  5264 
       
  5265 	RMmCustomAPI::TViagCacheRecordId expRecId;
       
  5266 	expRecId.iCacheId  = KViagHomeZoneCacheIdMax;
       
  5267 	expRecId.iRecordId = KViagHomeZoneCacheRecordIdMax;
       
  5268 	
       
  5269 	RMmCustomAPI::TViagCacheRecordContent expContent; 
       
  5270 	expContent.iCellId = 6000;
       
  5271 	expContent.iLac = 7000;
       
  5272 
       
  5273 	TMockLtsyData2<RMmCustomAPI::TViagCacheRecordId,
       
  5274 					RMmCustomAPI::TViagCacheRecordContent> expData(expRecId,expContent);
       
  5275 
       
  5276 	TRequestStatus reqStatus;
       
  5277 
       
  5278 	//-------------------------------------------------------------------------
       
  5279 	// Test A: Test timeout of RMmCustomAPI::WriteViagHomeZoneCache
       
  5280  	//-------------------------------------------------------------------------
       
  5281 	expData.SerialiseL(data);
       
  5282 	iMockLTSY.ExpectL(EWriteViagHomeZoneCacheIPC,data);
       
  5283 	
       
  5284 	customAPI.WriteViagHomeZoneCache(reqStatus,expRecId,expContent);
       
  5285 	User::WaitForRequest(reqStatus);
       
  5286 	ASSERT_EQUALS(KErrTimedOut,reqStatus.Int())
       
  5287 
       
  5288 	AssertMockLtsyStatusL();
       
  5289 
       
  5290 	CleanupStack::PopAndDestroy(3, this); // data, customAPI, this
       
  5291 	}
       
  5292 
       
  5293 
       
  5294 /**
       
  5295 @SYMTestCaseID BA-CTSY-CIPC-MCCCBL-0001
       
  5296 @SYMComponent  telephony_ctsy
       
  5297 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::ClearCallBlackList
       
  5298 @SYMTestPriority High
       
  5299 @SYMTestActions Invokes RMmCustomAPI::ClearCallBlackList
       
  5300 @SYMTestExpectedResults Pass
       
  5301 @SYMTestType CT
       
  5302 */
       
  5303 void CCTsyCustomIPCFU::TestClearCallBlackList0001L()
       
  5304 	{
       
  5305 
       
  5306 	OpenEtelServerL(EUseExtendedError);
       
  5307 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  5308 	OpenPhoneL();
       
  5309 
       
  5310 	RMmCustomAPI customAPI;
       
  5311 	OpenCustomAPILC(customAPI, iPhone);
       
  5312 
       
  5313     TRequestStatus requestStatus;
       
  5314 	
       
  5315  	//-------------------------------------------------------------------------
       
  5316 	// TEST A: failure to dispatch request to LTSY
       
  5317  	//-------------------------------------------------------------------------
       
  5318 
       
  5319     iMockLTSY.ExpectL( ECustomClearCallBlackListIPC, KErrNotSupported);
       
  5320     
       
  5321     customAPI.ClearCallBlackList(requestStatus);
       
  5322 	
       
  5323 	User::WaitForRequest(requestStatus);	
       
  5324 	ASSERT_EQUALS(KErrNotSupported, requestStatus.Int());
       
  5325 
       
  5326 	AssertMockLtsyStatusL();
       
  5327 
       
  5328 	//-------------------------------------------------------------------------
       
  5329 	// TEST B: failure on completion of pending request from LTSY->CTSY
       
  5330  	//-------------------------------------------------------------------------
       
  5331 
       
  5332     iMockLTSY.ExpectL( ECustomClearCallBlackListIPC);
       
  5333 
       
  5334     iMockLTSY.CompleteL( ECustomClearCallBlackListIPC, KErrGeneral);
       
  5335 
       
  5336     customAPI.ClearCallBlackList(requestStatus);
       
  5337 	
       
  5338 	User::WaitForRequest(requestStatus);	
       
  5339 	ASSERT_EQUALS(KErrGeneral, requestStatus.Int());
       
  5340 
       
  5341 	AssertMockLtsyStatusL();
       
  5342 
       
  5343  	//-------------------------------------------------------------------------
       
  5344 	// TEST C: Successful completion request of
       
  5345 	// RMmCustomAPI::ClearCallBlackList when result is not cached.
       
  5346  	//-------------------------------------------------------------------------
       
  5347 
       
  5348     iMockLTSY.ExpectL( ECustomClearCallBlackListIPC);
       
  5349     iMockLTSY.CompleteL( ECustomClearCallBlackListIPC, KErrNone);
       
  5350 
       
  5351     customAPI.ClearCallBlackList(requestStatus);
       
  5352 	
       
  5353 	User::WaitForRequest(requestStatus);	
       
  5354 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
  5355 	
       
  5356 	AssertMockLtsyStatusL();
       
  5357 
       
  5358  	//-------------------------------------------------------------------------
       
  5359 	// TEST E: Unsolicited completion of RMmCustomAPI::ClearCallBlackList
       
  5360 	// from LTSY.
       
  5361  	//-------------------------------------------------------------------------
       
  5362 
       
  5363 	TRequestStatus mockLtsyStatus;
       
  5364 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
  5365 
       
  5366     iMockLTSY.CompleteL( ECustomClearCallBlackListIPC, KErrNone);
       
  5367 
       
  5368 	User::WaitForRequest(mockLtsyStatus);
       
  5369 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
  5370 
       
  5371 	AssertMockLtsyStatusL();
       
  5372 	CleanupStack::PopAndDestroy(2, this); 	
       
  5373 	
       
  5374 	}
       
  5375 
       
  5376 
       
  5377 /**
       
  5378 @SYMTestCaseID BA-CTSY-CIPC-MCCCBL-0002
       
  5379 @SYMComponent  telephony_ctsy
       
  5380 @SYMTestCaseDesc Test support in CTSY for cancelling of RMmCustomAPI::ClearCallBlackList
       
  5381 @SYMTestPriority High
       
  5382 @SYMTestActions Invokes cancelling of RMmCustomAPI::ClearCallBlackList
       
  5383 @SYMTestExpectedResults Pass
       
  5384 @SYMTestType CT
       
  5385 */
       
  5386 void CCTsyCustomIPCFU::TestClearCallBlackList0002L()
       
  5387 	{
       
  5388 	
       
  5389 	OpenEtelServerL(EUseExtendedError);
       
  5390 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  5391 	OpenPhoneL();
       
  5392 
       
  5393 	RMmCustomAPI customAPI;
       
  5394 	OpenCustomAPILC(customAPI, iPhone);
       
  5395 
       
  5396     TRequestStatus requestStatus;
       
  5397 	
       
  5398 
       
  5399 	TRequestStatus mockLtsyStatus;
       
  5400 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
  5401 
       
  5402  	//-------------------------------------------------------------------------
       
  5403 	// Test cancelling of RMmCustomAPI::ClearCallBlackList
       
  5404  	//-------------------------------------------------------------------------
       
  5405 
       
  5406     iMockLTSY.ExpectL( ECustomClearCallBlackListIPC);
       
  5407     iMockLTSY.CompleteL( ECustomClearCallBlackListIPC, KErrNone, 20);
       
  5408 
       
  5409     customAPI.ClearCallBlackList(requestStatus);
       
  5410 	
       
  5411 	customAPI.CancelAsyncRequest(ECustomClearCallBlackListIPC);
       
  5412 
       
  5413 	User::WaitForRequest(requestStatus);	
       
  5414 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
  5415 
       
  5416 	User::WaitForRequest(mockLtsyStatus);
       
  5417 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
  5418 
       
  5419 	AssertMockLtsyStatusL();
       
  5420 
       
  5421 	CleanupStack::PopAndDestroy(2); 
       
  5422 	
       
  5423 	}
       
  5424 
       
  5425 
       
  5426 
       
  5427 /**
       
  5428 @SYMTestCaseID BA-CTSY-CIPC-MCCCBL-0004
       
  5429 @SYMComponent  telephony_ctsy
       
  5430 @SYMTestCaseDesc Test support in CTSY for multiple client requests to RMmCustomAPI::ClearCallBlackList
       
  5431 @SYMTestPriority High
       
  5432 @SYMTestActions Invokes multiple client requests to RMmCustomAPI::ClearCallBlackList
       
  5433 @SYMTestExpectedResults Pass
       
  5434 @SYMTestType CT
       
  5435 */
       
  5436 void CCTsyCustomIPCFU::TestClearCallBlackList0004L()
       
  5437 	{
       
  5438 
       
  5439 	OpenEtelServerL(EUseExtendedError);
       
  5440 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  5441 	OpenPhoneL();
       
  5442 
       
  5443 	// Open second client
       
  5444 	RTelServer telServer2;
       
  5445 	TInt ret = telServer2.Connect();
       
  5446 	ASSERT_EQUALS(KErrNone, ret);
       
  5447 	CleanupClosePushL(telServer2);
       
  5448 
       
  5449 	RMobilePhone phone2;
       
  5450 	ret = phone2.Open(telServer2,KMmTsyPhoneName);
       
  5451 	ASSERT_EQUALS(KErrNone, ret);
       
  5452 	CleanupClosePushL(phone2);
       
  5453 
       
  5454 	RMmCustomAPI customAPI;
       
  5455 	OpenCustomAPILC(customAPI, iPhone);
       
  5456 
       
  5457 	RMmCustomAPI customAPI2;
       
  5458 	OpenCustomAPILC(customAPI2, phone2, EFalse);
       
  5459 
       
  5460     TRequestStatus requestStatus;
       
  5461     TRequestStatus requestStatus2;
       
  5462 	
       
  5463 	//-------------------------------------------------------------------------
       
  5464 	// Test A: Test multiple clients requesting RMmCustomAPI::ClearCallBlackList
       
  5465  	//-------------------------------------------------------------------------
       
  5466 
       
  5467     iMockLTSY.ExpectL( ECustomClearCallBlackListIPC, KErrNone);
       
  5468     iMockLTSY.CompleteL( ECustomClearCallBlackListIPC, KErrNone, 20);
       
  5469     customAPI.ClearCallBlackList(requestStatus);
       
  5470 
       
  5471     customAPI2.ClearCallBlackList(requestStatus2);
       
  5472     
       
  5473 	User::WaitForRequest(requestStatus);	
       
  5474 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
  5475 
       
  5476 	User::WaitForRequest(requestStatus2);	
       
  5477 	ASSERT_EQUALS(KErrServerBusy, requestStatus2.Int());
       
  5478 
       
  5479 	AssertMockLtsyStatusL();
       
  5480 
       
  5481 	CleanupStack::PopAndDestroy(5, this);
       
  5482 
       
  5483 	}
       
  5484 
       
  5485 
       
  5486 /**
       
  5487 @SYMTestCaseID BA-CTSY-CIPC-MCCCBL-0005
       
  5488 @SYMComponent  telephony_ctsy
       
  5489 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::ClearCallBlackList with timeout
       
  5490 @SYMTestPriority High
       
  5491 @SYMTestActions Invokes RMmCustomAPI::ClearCallBlackList and tests for timeout
       
  5492 @SYMTestExpectedResults Pass
       
  5493 @SYMTestType CT
       
  5494 */
       
  5495 void CCTsyCustomIPCFU::TestClearCallBlackList0005L()
       
  5496 	{
       
  5497 	
       
  5498 	OpenEtelServerL(EUseExtendedError);
       
  5499 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  5500 	OpenPhoneL();
       
  5501 
       
  5502 	RMmCustomAPI customAPI;
       
  5503 	OpenCustomAPILC(customAPI, iPhone);
       
  5504 
       
  5505     TRequestStatus requestStatus;
       
  5506 
       
  5507     iMockLTSY.ExpectL( ECustomClearCallBlackListIPC);
       
  5508 
       
  5509     customAPI.ClearCallBlackList(requestStatus);
       
  5510 	
       
  5511 	User::WaitForRequest(requestStatus);	
       
  5512 	ASSERT_EQUALS(KErrTimedOut, requestStatus.Int());
       
  5513 
       
  5514 	AssertMockLtsyStatusL();
       
  5515 
       
  5516 	CleanupStack::PopAndDestroy(2); 	
       
  5517 
       
  5518 	}
       
  5519 
       
  5520 
       
  5521 /**
       
  5522 @SYMTestCaseID BA-CTSY-CIPC-MCSAIN-0001
       
  5523 @SYMComponent  telephony_ctsy
       
  5524 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::SsAdditionalInfoNotification
       
  5525 @SYMTestPriority High
       
  5526 @SYMTestActions Invokes RMmCustomAPI::SsAdditionalInfoNotification
       
  5527 @SYMTestExpectedResults Pass
       
  5528 @SYMTestType CT
       
  5529 */
       
  5530 void CCTsyCustomIPCFU::TestSsAdditionalInfoNotification0001L()
       
  5531 	{
       
  5532 
       
  5533 	OpenEtelServerL(EUseExtendedError);
       
  5534 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  5535 	OpenPhoneL();
       
  5536 
       
  5537 	RMmCustomAPI customAPI;
       
  5538 	OpenCustomAPILC(customAPI, iPhone);
       
  5539 
       
  5540 	TRequestStatus requestStatus;
       
  5541 	TRequestStatus mockLtsyStatus;
       
  5542 
       
  5543 	_LIT8(KInfo, "Info");
       
  5544 
       
  5545 	RMmCustomAPI::TSsAdditionalInfo info;
       
  5546 	RMmCustomAPI::TSsAdditionalInfo compInfo;
       
  5547 	compInfo.iOperationCode = 0xFF;
       
  5548 	compInfo.iAdditionalInfo.Copy(KInfo);	
       
  5549 	TPckg<RMmCustomAPI::TSsAdditionalInfo> pckg(compInfo);
       
  5550 
       
  5551  	//-------------------------------------------------------------------------
       
  5552 	// TEST E: Unsolicited completion of RMmCustomAPI::SsAdditionalInfoNotification
       
  5553 	// from LTSY.
       
  5554  	//-------------------------------------------------------------------------
       
  5555 
       
  5556 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
  5557 	iMockLTSY.CompleteL(ECustomSsAdditionalInfoNotificationIPC, KErrNone, pckg);
       
  5558 	User::WaitForRequest(mockLtsyStatus);
       
  5559 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());	
       
  5560 
       
  5561 	AssertMockLtsyStatusL();
       
  5562 
       
  5563  	//-------------------------------------------------------------------------
       
  5564 	// TEST C: Successful completion request of
       
  5565 	// RMmCustomAPI::SsAdditionalInfoNotification when result is not cached.
       
  5566  	//-------------------------------------------------------------------------
       
  5567 
       
  5568 	customAPI.SsAdditionalInfoNotification(requestStatus, info);
       
  5569 
       
  5570 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
  5571 	iMockLTSY.CompleteL(ECustomSsAdditionalInfoNotificationIPC, KErrNone, pckg);
       
  5572 	User::WaitForRequest(mockLtsyStatus);
       
  5573 	AssertMockLtsyStatusL();
       
  5574 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
  5575 
       
  5576 	User::WaitForRequest(requestStatus);
       
  5577 	AssertMockLtsyStatusL();
       
  5578 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
  5579 
       
  5580 	ASSERT_TRUE(compInfo.iOperationCode == info.iOperationCode);
       
  5581 	ASSERT_TRUE(0 == info.iAdditionalInfo.Compare(compInfo.iAdditionalInfo));
       
  5582 
       
  5583 	AssertMockLtsyStatusL();
       
  5584 
       
  5585 	CleanupStack::PopAndDestroy(2, this); 	
       
  5586 	
       
  5587 	}
       
  5588 
       
  5589 
       
  5590 /**
       
  5591 @SYMTestCaseID BA-CTSY-CIPC-MCSAIN-0002
       
  5592 @SYMComponent  telephony_ctsy
       
  5593 @SYMTestCaseDesc Test support in CTSY for cancelling of RMmCustomAPI::SsAdditionalInfoNotification
       
  5594 @SYMTestPriority High
       
  5595 @SYMTestActions Invokes cancelling of RMmCustomAPI::SsAdditionalInfoNotification
       
  5596 @SYMTestExpectedResults Pass
       
  5597 @SYMTestType CT
       
  5598 */
       
  5599 void CCTsyCustomIPCFU::TestSsAdditionalInfoNotification0002L()
       
  5600 	{
       
  5601 
       
  5602 	OpenEtelServerL(EUseExtendedError);
       
  5603 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  5604 	OpenPhoneL();
       
  5605 
       
  5606 	RMmCustomAPI customAPI;
       
  5607 	OpenCustomAPILC(customAPI, iPhone);
       
  5608 
       
  5609 	TRequestStatus requestStatus;
       
  5610 	TRequestStatus mockLtsyStatus;
       
  5611 
       
  5612 	_LIT8(KInfo, "Info");
       
  5613 
       
  5614 	RMmCustomAPI::TSsAdditionalInfo info;
       
  5615 	RMmCustomAPI::TSsAdditionalInfo compInfo;
       
  5616 	compInfo.iOperationCode = 0xFF;
       
  5617 	compInfo.iAdditionalInfo.Copy(KInfo);	
       
  5618 	TPckg<RMmCustomAPI::TSsAdditionalInfo> pckg(compInfo);
       
  5619 
       
  5620  	//-------------------------------------------------------------------------
       
  5621 	// Test cancelling of RMmCustomAPI::SsAdditionalInfoNotification
       
  5622  	//-------------------------------------------------------------------------
       
  5623 
       
  5624 	customAPI.SsAdditionalInfoNotification(requestStatus, info);
       
  5625 	customAPI.CancelAsyncRequest(ECustomSsAdditionalInfoNotificationIPC);
       
  5626 
       
  5627 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
  5628 	iMockLTSY.CompleteL(ECustomSsAdditionalInfoNotificationIPC, KErrNone, pckg);
       
  5629 	User::WaitForRequest(mockLtsyStatus);
       
  5630 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
  5631 
       
  5632 	User::WaitForRequest(requestStatus);
       
  5633 	ASSERT_EQUALS(KErrCancel, requestStatus.Int());
       
  5634 
       
  5635 	AssertMockLtsyStatusL();
       
  5636 
       
  5637 	CleanupStack::PopAndDestroy(2); 	
       
  5638 	
       
  5639 	}
       
  5640 
       
  5641 
       
  5642 /**
       
  5643 @SYMTestCaseID BA-CTSY-CIPC-MCSAIN-0004
       
  5644 @SYMComponent  telephony_ctsy
       
  5645 @SYMTestCaseDesc Test support in CTSY for multiple client requests to RMmCustomAPI::SsAdditionalInfoNotification
       
  5646 @SYMTestPriority High
       
  5647 @SYMTestActions Invokes multiple client requests to RMmCustomAPI::SsAdditionalInfoNotification
       
  5648 @SYMTestExpectedResults Pass
       
  5649 @SYMTestType CT
       
  5650 */
       
  5651 void CCTsyCustomIPCFU::TestSsAdditionalInfoNotification0004L()
       
  5652 	{
       
  5653 					
       
  5654 	OpenEtelServerL(EUseExtendedError);
       
  5655 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  5656 	OpenPhoneL();
       
  5657 
       
  5658 	// Open second client
       
  5659 	RTelServer telServer2;
       
  5660 	TInt ret = telServer2.Connect();
       
  5661 	ASSERT_EQUALS(KErrNone, ret);
       
  5662 	CleanupClosePushL(telServer2);
       
  5663 
       
  5664 	RMobilePhone phone2;
       
  5665 	ret = phone2.Open(iTelServer,KMmTsyPhoneName);
       
  5666 	ASSERT_EQUALS(KErrNone, ret);
       
  5667 	CleanupClosePushL(phone2);
       
  5668 
       
  5669 	RMmCustomAPI customAPI1;
       
  5670 	RMmCustomAPI customAPI2;
       
  5671 	OpenCustomAPILC(customAPI1, iPhone);
       
  5672 	OpenCustomAPILC(customAPI2, phone2, EFalse);
       
  5673 
       
  5674 	TRequestStatus requestStatus;
       
  5675 	TRequestStatus requestStatus2;
       
  5676 	TRequestStatus mockLtsyStatus;
       
  5677 
       
  5678 	_LIT8(KInfo, "Info");
       
  5679 
       
  5680 	RMmCustomAPI::TSsAdditionalInfo info;
       
  5681 	RMmCustomAPI::TSsAdditionalInfo info2;
       
  5682 	RMmCustomAPI::TSsAdditionalInfo compInfo;
       
  5683 	compInfo.iOperationCode = 0xFF;
       
  5684 	compInfo.iAdditionalInfo.Copy(KInfo);	
       
  5685 	TPckg<RMmCustomAPI::TSsAdditionalInfo> pckg(compInfo);
       
  5686 
       
  5687 	//-------------------------------------------------------------------------
       
  5688 	// Test A: Test multiple clients requesting RMmCustomAPI::SsAdditionalInfoNotification
       
  5689  	//-------------------------------------------------------------------------
       
  5690 
       
  5691 	customAPI1.SsAdditionalInfoNotification(requestStatus, info);
       
  5692 	customAPI2.SsAdditionalInfoNotification(requestStatus2, info2);
       
  5693 
       
  5694 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
  5695 	iMockLTSY.CompleteL(ECustomSsAdditionalInfoNotificationIPC, KErrNone, pckg);
       
  5696 	
       
  5697 	User::WaitForRequest(mockLtsyStatus);
       
  5698 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
  5699 
       
  5700 	User::WaitForRequest(requestStatus);
       
  5701 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
  5702 
       
  5703 	User::WaitForRequest(requestStatus2);
       
  5704 	ASSERT_EQUALS(KErrNone, requestStatus2.Int());
       
  5705 
       
  5706 	ASSERT_TRUE(compInfo.iOperationCode == info.iOperationCode);
       
  5707 	ASSERT_TRUE(0 == info.iAdditionalInfo.Compare(compInfo.iAdditionalInfo));
       
  5708 
       
  5709 	ASSERT_TRUE(compInfo.iOperationCode == info2.iOperationCode);
       
  5710 	ASSERT_TRUE(0 == info2.iAdditionalInfo.Compare(compInfo.iAdditionalInfo));
       
  5711 
       
  5712 	AssertMockLtsyStatusL();
       
  5713 
       
  5714 	CleanupStack::PopAndDestroy(5, this); 
       
  5715 
       
  5716 	}
       
  5717 
       
  5718 
       
  5719 /**
       
  5720 @SYMTestCaseID BA-CTSY-CIPC-MCSRCN-0001
       
  5721 @SYMComponent  telephony_ctsy
       
  5722 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::SsRequestCompleteNotification
       
  5723 @SYMTestPriority High
       
  5724 @SYMTestActions Invokes RMmCustomAPI::SsRequestCompleteNotification
       
  5725 @SYMTestExpectedResults Pass
       
  5726 @SYMTestType CT
       
  5727 */
       
  5728 void CCTsyCustomIPCFU::TestSsRequestCompleteNotification0001L()
       
  5729 	{
       
  5730 
       
  5731 	OpenEtelServerL(EUseExtendedError);
       
  5732 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  5733 	OpenPhoneL();
       
  5734 
       
  5735 	RMmCustomAPI customAPI;
       
  5736 	OpenCustomAPILC(customAPI, iPhone);
       
  5737 
       
  5738 	TRequestStatus requestStatus;
       
  5739 	TRequestStatus mockLtsyStatus;
       
  5740 
       
  5741 	TInt status;
       
  5742 	const TInt compStatus = 0xFF;
       
  5743 	TPckg<TInt> pckg(compStatus);
       
  5744 
       
  5745  	//-------------------------------------------------------------------------
       
  5746 	// TEST E: Unsolicited completion of RMmCustomAPI::SsRequestCompleteNotification
       
  5747 	// from LTSY.
       
  5748  	//-------------------------------------------------------------------------
       
  5749 
       
  5750 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
  5751 	iMockLTSY.CompleteL(ECustomNotifySsRequestCompleteIPC, KErrNone, pckg);
       
  5752 	User::WaitForRequest(mockLtsyStatus);
       
  5753 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());	
       
  5754 
       
  5755 	AssertMockLtsyStatusL();
       
  5756 
       
  5757  	//-------------------------------------------------------------------------
       
  5758 	// TEST C: Successful completion request of
       
  5759 	// RMmCustomAPI::SsRequestCompleteNotification when result is not cached.
       
  5760  	//-------------------------------------------------------------------------
       
  5761 
       
  5762 	customAPI.SsRequestCompleteNotification(requestStatus, status);
       
  5763 
       
  5764 	iMockLTSY.CompleteL(ECustomNotifySsRequestCompleteIPC, KErrNone, pckg);
       
  5765 
       
  5766 	User::WaitForRequest(requestStatus);
       
  5767 	AssertMockLtsyStatusL();
       
  5768 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
  5769 
       
  5770 	ASSERT_EQUALS(status, compStatus);
       
  5771 
       
  5772 	AssertMockLtsyStatusL();
       
  5773 
       
  5774 	CleanupStack::PopAndDestroy(2, this); 	
       
  5775 	
       
  5776 	}
       
  5777 
       
  5778 
       
  5779 /**
       
  5780 @SYMTestCaseID BA-CTSY-CIPC-MCSRCN-0002
       
  5781 @SYMComponent  telephony_ctsy
       
  5782 @SYMTestCaseDesc Test support in CTSY for cancelling of RMmCustomAPI::SsRequestCompleteNotification
       
  5783 @SYMTestPriority High
       
  5784 @SYMTestActions Invokes cancelling of RMmCustomAPI::SsRequestCompleteNotification
       
  5785 @SYMTestExpectedResults Pass
       
  5786 @SYMTestType CT
       
  5787 */
       
  5788 void CCTsyCustomIPCFU::TestSsRequestCompleteNotification0002L()
       
  5789 	{
       
  5790 
       
  5791 	OpenEtelServerL(EUseExtendedError);
       
  5792 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  5793 	OpenPhoneL();
       
  5794 
       
  5795 	RMmCustomAPI customAPI;
       
  5796 	OpenCustomAPILC(customAPI, iPhone);
       
  5797 
       
  5798 	TRequestStatus requestStatus;
       
  5799 	TRequestStatus mockLtsyStatus;
       
  5800 
       
  5801 	TInt status;
       
  5802 	const TInt compStatus = 0xFF;
       
  5803 	TPckg<TInt> pckg(compStatus);
       
  5804 
       
  5805  	//-------------------------------------------------------------------------
       
  5806 	// Test cancelling of RMmCustomAPI::SsRequestCompleteNotification
       
  5807  	//-------------------------------------------------------------------------
       
  5808 
       
  5809 	customAPI.SsRequestCompleteNotification(requestStatus, status);
       
  5810 	customAPI.CancelAsyncRequest(ECustomNotifySsRequestCompleteIPC);
       
  5811 
       
  5812 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
  5813 	iMockLTSY.CompleteL(ECustomNotifySsRequestCompleteIPC, KErrNone, pckg);
       
  5814 	User::WaitForRequest(mockLtsyStatus);
       
  5815 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
  5816 
       
  5817 	User::WaitForRequest(requestStatus);
       
  5818 	ASSERT_EQUALS(KErrCancel, requestStatus.Int());
       
  5819 
       
  5820 	AssertMockLtsyStatusL();
       
  5821 
       
  5822 	CleanupStack::PopAndDestroy(2); 
       
  5823 	
       
  5824 	
       
  5825 	}
       
  5826 
       
  5827 
       
  5828 /**
       
  5829 @SYMTestCaseID BA-CTSY-CIPC-MCSRCN-0004
       
  5830 @SYMComponent  telephony_ctsy
       
  5831 @SYMTestCaseDesc Test support in CTSY for multiple client requests to RMmCustomAPI::SsRequestCompleteNotification
       
  5832 @SYMTestPriority High
       
  5833 @SYMTestActions Invokes multiple client requests to RMmCustomAPI::SsRequestCompleteNotification
       
  5834 @SYMTestExpectedResults Pass
       
  5835 @SYMTestType CT
       
  5836 */
       
  5837 void CCTsyCustomIPCFU::TestSsRequestCompleteNotification0004L()
       
  5838 	{
       
  5839 					
       
  5840 	OpenEtelServerL(EUseExtendedError);
       
  5841 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  5842 	OpenPhoneL();
       
  5843 
       
  5844 	// Open second client
       
  5845 	RTelServer telServer2;
       
  5846 	TInt ret = telServer2.Connect();
       
  5847 	ASSERT_EQUALS(KErrNone, ret);
       
  5848 	CleanupClosePushL(telServer2);
       
  5849 
       
  5850 	RMobilePhone phone2;
       
  5851 	ret = phone2.Open(iTelServer,KMmTsyPhoneName);
       
  5852 	ASSERT_EQUALS(KErrNone, ret);
       
  5853 	CleanupClosePushL(phone2);
       
  5854 
       
  5855 	RMmCustomAPI customAPI1;
       
  5856 	RMmCustomAPI customAPI2;
       
  5857 	OpenCustomAPILC(customAPI1, iPhone);
       
  5858 	OpenCustomAPILC(customAPI2, phone2, EFalse);
       
  5859 
       
  5860 	TRequestStatus requestStatus;
       
  5861 	TRequestStatus requestStatus2;
       
  5862 
       
  5863 	TInt status;
       
  5864 	TInt status2;
       
  5865 	const TInt compStatus = 0xFF;
       
  5866 	TPckg<TInt> pckg(compStatus);
       
  5867 
       
  5868 	//-------------------------------------------------------------------------
       
  5869 	// Test A: Test multiple clients requesting RMmCustomAPI::SsRequestCompleteNotification
       
  5870  	//-------------------------------------------------------------------------
       
  5871 
       
  5872 	customAPI1.SsRequestCompleteNotification(requestStatus, status);
       
  5873 	customAPI2.SsRequestCompleteNotification(requestStatus2, status2);
       
  5874 
       
  5875 	iMockLTSY.CompleteL(ECustomNotifySsRequestCompleteIPC, KErrNone, pckg);
       
  5876 	
       
  5877 	User::WaitForRequest(requestStatus);
       
  5878 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
  5879 
       
  5880 	User::WaitForRequest(requestStatus2);
       
  5881 	ASSERT_EQUALS(KErrNone, requestStatus2.Int());
       
  5882 
       
  5883 	ASSERT_EQUALS(compStatus, status);
       
  5884 	ASSERT_EQUALS(compStatus, status2);
       
  5885 
       
  5886 	AssertMockLtsyStatusL();
       
  5887 
       
  5888 	CleanupStack::PopAndDestroy(5, this); 
       
  5889 
       
  5890 	}
       
  5891 
       
  5892 
       
  5893 /**
       
  5894 @SYMTestCaseID BA-CTSY-CIPC-MCIB-0001
       
  5895 @SYMComponent  telephony_ctsy
       
  5896 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::IsBlocked
       
  5897 @SYMTestPriority High
       
  5898 @SYMTestActions Invokes RMmCustomAPI::IsBlocked
       
  5899 @SYMTestExpectedResults Pass
       
  5900 @SYMTestType CT
       
  5901 */
       
  5902 void CCTsyCustomIPCFU::TestIsBlocked0001L()
       
  5903 	{
       
  5904 
       
  5905 	OpenEtelServerL(EUseExtendedError);
       
  5906 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  5907 	OpenPhoneL();
       
  5908 
       
  5909 	RMmCustomAPI customAPI;
       
  5910 	OpenCustomAPILC(customAPI, iPhone);
       
  5911 
       
  5912 	RBuf8 data;
       
  5913 	CleanupClosePushL(data);
       
  5914 
       
  5915     RMmCustomAPI::TSecurityCodeType type(RMmCustomAPI::ESecurityCodePin1);
       
  5916 	TBool result;
       
  5917 
       
  5918     TUint8 codeId(KSecCodePin);
       
  5919 
       
  5920 	TMockLtsyData1 <TUint8> ltsyData(codeId);
       
  5921 	ltsyData.SerialiseL(data);	
       
  5922     	
       
  5923  	//-------------------------------------------------------------------------
       
  5924 	// TEST A: failure to dispatch request to LTSY
       
  5925  	//-------------------------------------------------------------------------
       
  5926 
       
  5927     iMockLTSY.ExpectL( ECustomIsBlockedIPC, data, KErrNotSupported);
       
  5928 
       
  5929 	TInt ret = customAPI.IsBlocked(type, result);
       
  5930 	
       
  5931 	ASSERT_EQUALS(KErrNotSupported, ret);
       
  5932 
       
  5933 	AssertMockLtsyStatusL();
       
  5934 
       
  5935 	//-------------------------------------------------------------------------
       
  5936 	// TEST B: failure on completion of pending request from LTSY->CTSY
       
  5937  	//-------------------------------------------------------------------------
       
  5938 
       
  5939 	const TBool compResult(ETrue);
       
  5940 	TPckg<TBool> resPckg(compResult);
       
  5941 
       
  5942     iMockLTSY.ExpectL( ECustomIsBlockedIPC, data);
       
  5943     iMockLTSY.CompleteL( ECustomIsBlockedIPC, KErrGeneral, resPckg);
       
  5944 
       
  5945 	ret = customAPI.IsBlocked(type, result);
       
  5946 	
       
  5947 	ASSERT_EQUALS(KErrGeneral, ret);
       
  5948 
       
  5949 	AssertMockLtsyStatusL();
       
  5950 
       
  5951  	//-------------------------------------------------------------------------
       
  5952 	// TEST C: Successful completion request of
       
  5953 	// RMmCustomAPI::IsBlocked when result is not cached.
       
  5954  	//-------------------------------------------------------------------------
       
  5955 
       
  5956     iMockLTSY.ExpectL( ECustomIsBlockedIPC, data);
       
  5957     iMockLTSY.CompleteL( ECustomIsBlockedIPC, KErrNone, resPckg);
       
  5958 
       
  5959 	ret = customAPI.IsBlocked(type, result);
       
  5960 	
       
  5961 	ASSERT_EQUALS(KErrNone, ret);
       
  5962 	ASSERT_EQUALS(compResult, result);
       
  5963 
       
  5964 	AssertMockLtsyStatusL();
       
  5965 
       
  5966  	//-------------------------------------------------------------------------
       
  5967 	// TEST C2: Successful completion request of
       
  5968 	// RMmCustomAPI::IsBlocked when result is not cached.
       
  5969  	//-------------------------------------------------------------------------
       
  5970 
       
  5971 	type = RMmCustomAPI::ESecurityCodePin2;
       
  5972     codeId = KSecCodePin2;
       
  5973 
       
  5974 	data.Close();
       
  5975 	ltsyData.SerialiseL(data);	
       
  5976     iMockLTSY.ExpectL( ECustomIsBlockedIPC, data);
       
  5977     iMockLTSY.CompleteL( ECustomIsBlockedIPC, KErrNone, resPckg);
       
  5978 
       
  5979 	ret = customAPI.IsBlocked(type, result);
       
  5980 	
       
  5981 	ASSERT_EQUALS(KErrNone, ret);
       
  5982 	ASSERT_EQUALS(compResult, result);
       
  5983 
       
  5984 	AssertMockLtsyStatusL();
       
  5985 
       
  5986  	//-------------------------------------------------------------------------
       
  5987 	// TEST C3: Completion request of
       
  5988 	// RMmCustomAPI::IsBlocked 
       
  5989  	//-------------------------------------------------------------------------
       
  5990 
       
  5991 	type = RMmCustomAPI::ESecurityCodePuk1;
       
  5992 
       
  5993 	ret = customAPI.IsBlocked(type, result);
       
  5994 	
       
  5995 	ASSERT_EQUALS(KErrArgument, ret);
       
  5996 
       
  5997 	AssertMockLtsyStatusL();
       
  5998 
       
  5999 
       
  6000  	//-------------------------------------------------------------------------
       
  6001 	// TEST C4: Completion request of
       
  6002 	// RMmCustomAPI::IsBlocked 
       
  6003  	//-------------------------------------------------------------------------
       
  6004 
       
  6005 	type = RMmCustomAPI::ESecurityUniversalPin;
       
  6006 
       
  6007 	ret = customAPI.IsBlocked(type, result);
       
  6008 	
       
  6009 	ASSERT_EQUALS(KErrArgument, ret);
       
  6010 
       
  6011 	AssertMockLtsyStatusL();
       
  6012 
       
  6013 
       
  6014 
       
  6015     //- making ICC3G ----------------------------
       
  6016     
       
  6017 	TRequestStatus mockLtsyStatus;
       
  6018 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
  6019 
       
  6020     TICCType iccType(EICCTypeSim3G);
       
  6021 
       
  6022 	TMockLtsyData1<TICCType> iccData(iccType);
       
  6023 	data.Close();
       
  6024 	iccData.SerialiseL(data);
       
  6025 
       
  6026 	iMockLTSY.CompleteL(EMmTsySimGetICCType, KErrNone, data);    
       
  6027 
       
  6028 	iMockLTSY.ExpectL(EMmTsySecurityGetSimActivePinStateIPC);
       
  6029 	iMockLTSY.CompleteL(EMmTsySecurityGetSimActivePinStateIPC, KErrNone);
       
  6030 
       
  6031 	// Wait for completion of iMockLTSY.NotifyTerminated
       
  6032 	User::WaitForRequest(mockLtsyStatus);
       
  6033 	AssertMockLtsyStatusL();
       
  6034 
       
  6035  	//-------------------------------------------------------------------------
       
  6036 	// TEST C5: Successful completion request of
       
  6037 	// RMmCustomAPI::IsBlocked when result is not cached.
       
  6038  	//-------------------------------------------------------------------------
       
  6039 
       
  6040 	type = RMmCustomAPI::ESecurityUniversalPin;
       
  6041     codeId = KSecCodeUpin;
       
  6042 
       
  6043 	data.Close();
       
  6044 	ltsyData.SerialiseL(data);	
       
  6045     iMockLTSY.ExpectL( ECustomIsBlockedIPC, data);
       
  6046     iMockLTSY.CompleteL( ECustomIsBlockedIPC, KErrNone, resPckg);
       
  6047 
       
  6048 	ret = customAPI.IsBlocked(type, result);
       
  6049 	
       
  6050 	ASSERT_EQUALS(KErrNone, ret);
       
  6051 	ASSERT_EQUALS(compResult, result);
       
  6052 
       
  6053 	AssertMockLtsyStatusL();
       
  6054 
       
  6055  	//-------------------------------------------------------------------------
       
  6056 	// TEST C6: Successful completion request of
       
  6057 	// RMmCustomAPI::IsBlocked when result is not cached.
       
  6058  	//-------------------------------------------------------------------------
       
  6059 
       
  6060 	type = RMmCustomAPI::ESecurityCodePassPhrase;
       
  6061     codeId = KSecCodeSecurity;
       
  6062 
       
  6063 	data.Close();
       
  6064 	ltsyData.SerialiseL(data);	
       
  6065 
       
  6066     iMockLTSY.ExpectL( ECustomIsBlockedIPC, data);
       
  6067     iMockLTSY.CompleteL( ECustomIsBlockedIPC, KErrNone, resPckg);
       
  6068 
       
  6069 	ret = customAPI.IsBlocked(type, result);
       
  6070 	
       
  6071 	ASSERT_EQUALS(KErrNone, ret);
       
  6072 	ASSERT_EQUALS(compResult, result);
       
  6073 
       
  6074 	AssertMockLtsyStatusL();
       
  6075 
       
  6076  	//-------------------------------------------------------------------------
       
  6077 	// TEST E: Unsolicited completion of RMmCustomAPI::IsBlocked
       
  6078 	// from LTSY.
       
  6079  	//-------------------------------------------------------------------------
       
  6080 
       
  6081 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
  6082 
       
  6083     iMockLTSY.CompleteL( ECustomIsBlockedIPC, KErrNone, resPckg);
       
  6084 
       
  6085 	User::WaitForRequest(mockLtsyStatus);
       
  6086 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
  6087 
       
  6088 
       
  6089 	AssertMockLtsyStatusL();
       
  6090 	CleanupStack::PopAndDestroy(3, this); 
       
  6091 	
       
  6092 	}
       
  6093 
       
  6094 
       
  6095 /**
       
  6096 @SYMTestCaseID BA-CTSY-CIPC-MCIB-0005
       
  6097 @SYMComponent  telephony_ctsy
       
  6098 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::IsBlocked with timeout
       
  6099 @SYMTestPriority High
       
  6100 @SYMTestActions Invokes RMmCustomAPI::IsBlocked and tests for timeout
       
  6101 @SYMTestExpectedResults Pass
       
  6102 @SYMTestType CT
       
  6103 */
       
  6104 void CCTsyCustomIPCFU::TestIsBlocked0005L()
       
  6105 	{
       
  6106 
       
  6107 	OpenEtelServerL(EUseExtendedError);
       
  6108 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  6109 	OpenPhoneL();
       
  6110 
       
  6111 	RMmCustomAPI customAPI;
       
  6112 	OpenCustomAPILC(customAPI, iPhone);
       
  6113 
       
  6114 	RBuf8 data;
       
  6115 	CleanupClosePushL(data);
       
  6116 
       
  6117     RMmCustomAPI::TSecurityCodeType type(RMmCustomAPI::ESecurityCodePin1);
       
  6118 	TBool result;
       
  6119 
       
  6120     TUint8 codeId(KSecCodePin);
       
  6121 
       
  6122 	TMockLtsyData1 <TUint8> ltsyData(codeId);
       
  6123 	ltsyData.SerialiseL(data);	
       
  6124     	
       
  6125  	//-------------------------------------------------------------------------
       
  6126 	// TEST A: failure to dispatch request to LTSY
       
  6127  	//-------------------------------------------------------------------------
       
  6128 
       
  6129     iMockLTSY.ExpectL( ECustomIsBlockedIPC, data);
       
  6130 
       
  6131 	ERR_PRINTF2(_L("<font color=Orange>$CTSYKnownFailure: defect id = %d</font>"), 402401);
       
  6132 	// Request ECustomIsBlockedIPC is not completed by timeout.
       
  6133 
       
  6134 	// to void next test blocking
       
  6135 	ASSERT_TRUE(EFalse);
       
  6136 
       
  6137 	TInt ret = customAPI.IsBlocked(type, result);
       
  6138 	
       
  6139 	ASSERT_EQUALS(KErrTimedOut, ret);
       
  6140 
       
  6141 	AssertMockLtsyStatusL();
       
  6142 	CleanupStack::PopAndDestroy(3, this); 
       
  6143 
       
  6144 	}
       
  6145 
       
  6146 
       
  6147 /**
       
  6148 @SYMTestCaseID BA-CTSY-CIPC-MCCSC-0001
       
  6149 @SYMComponent  telephony_ctsy
       
  6150 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::CheckSecurityCode
       
  6151 @SYMTestPriority High
       
  6152 @SYMTestActions Invokes RMmCustomAPI::CheckSecurityCode
       
  6153 @SYMTestExpectedResults Pass
       
  6154 @SYMTestType CT
       
  6155 */
       
  6156 void CCTsyCustomIPCFU::TestCheckSecurityCode0001L()
       
  6157 	{
       
  6158 
       
  6159 	OpenEtelServerL(EUseExtendedError);
       
  6160 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  6161 	OpenPhoneL();
       
  6162 
       
  6163 	RMmCustomAPI customAPI;
       
  6164 	OpenCustomAPILC(customAPI, iPhone);
       
  6165 
       
  6166 	RBuf8 data;
       
  6167 	CleanupClosePushL(data);
       
  6168 
       
  6169 	RBuf8 data2;
       
  6170 	CleanupClosePushL(data2);
       
  6171 
       
  6172     TRequestStatus requestStatus;
       
  6173     
       
  6174     RMmCustomAPI::TSecurityCodeType type(RMmCustomAPI::ESecurityCodePin1);
       
  6175     TUint8 codeId(KSecCodePin);
       
  6176     RMobilePhone::TMobilePassword secCode;
       
  6177    
       
  6178  	//-------------------------------------------------------------------------
       
  6179 	// TEST A: failure to dispatch request to LTSY
       
  6180  	//-------------------------------------------------------------------------
       
  6181 
       
  6182 	TMockLtsyData2 <TUint8, RMobilePhone::TMobilePassword> ltsyData(codeId, secCode);
       
  6183 	ltsyData.SerialiseL(data);	
       
  6184 
       
  6185     iMockLTSY.ExpectL( ECustomCheckSecurityCodeIPC, data, KErrNotSupported);
       
  6186     
       
  6187     customAPI.CheckSecurityCode(requestStatus, type);
       
  6188 	
       
  6189 	User::WaitForRequest(requestStatus);	
       
  6190 	ASSERT_EQUALS(KErrNotSupported, requestStatus.Int());
       
  6191 
       
  6192 	AssertMockLtsyStatusL();
       
  6193 
       
  6194 	//-------------------------------------------------------------------------
       
  6195 	// TEST B: failure on completion of pending request from LTSY->CTSY
       
  6196  	//-------------------------------------------------------------------------
       
  6197 
       
  6198     iMockLTSY.ExpectL( ECustomCheckSecurityCodeIPC, data);    
       
  6199     iMockLTSY.CompleteL( ECustomCheckSecurityCodeIPC, KErrGeneral);
       
  6200 
       
  6201 	TBool flag(EFalse);
       
  6202 	TMockLtsyData2 <TUint8, TBool> ltsyData2(codeId, flag);
       
  6203 	ltsyData2.SerialiseL(data2);	
       
  6204 
       
  6205 	// this is because HandleRequest(ECustomCheckSecurityCodeCancelIPC) is called when completing by error
       
  6206     iMockLTSY.ExpectL( ECustomCheckSecurityCodeCancelIPC, data2);    
       
  6207 
       
  6208     customAPI.CheckSecurityCode(requestStatus, type);
       
  6209 	
       
  6210 	User::WaitForRequest(requestStatus);	
       
  6211 	ASSERT_EQUALS(KErrGeneral, requestStatus.Int());
       
  6212 
       
  6213 	AssertMockLtsyStatusL();
       
  6214 
       
  6215  	//-------------------------------------------------------------------------
       
  6216 	// TEST C: Successful completion request of
       
  6217 	// RMmCustomAPI::CheckSecurityCode when result is not cached.
       
  6218  	//-------------------------------------------------------------------------
       
  6219 
       
  6220     iMockLTSY.ExpectL( ECustomCheckSecurityCodeIPC, data);    
       
  6221     iMockLTSY.CompleteL( ECustomCheckSecurityCodeIPC, KErrNone);
       
  6222 
       
  6223     customAPI.CheckSecurityCode(requestStatus, type);
       
  6224 	
       
  6225 	User::WaitForRequest(requestStatus);	
       
  6226 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
  6227 
       
  6228 	AssertMockLtsyStatusL();
       
  6229 
       
  6230 
       
  6231  	//-------------------------------------------------------------------------
       
  6232 	// TEST C2: Successful completion request of
       
  6233 	// RMmCustomAPI::CheckSecurityCode when result is not cached.
       
  6234  	//-------------------------------------------------------------------------
       
  6235 
       
  6236     type = RMmCustomAPI::ESecurityCodePin2;
       
  6237     codeId = KSecCodePin2;
       
  6238    
       
  6239     data.Close();
       
  6240 	ltsyData.SerialiseL(data);	
       
  6241 	
       
  6242     iMockLTSY.ExpectL( ECustomCheckSecurityCodeIPC, data);    
       
  6243     iMockLTSY.CompleteL( ECustomCheckSecurityCodeIPC, KErrNone);
       
  6244 
       
  6245     customAPI.CheckSecurityCode(requestStatus, type);
       
  6246 	
       
  6247 	User::WaitForRequest(requestStatus);	
       
  6248 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
  6249 
       
  6250 	AssertMockLtsyStatusL();
       
  6251 
       
  6252  	//-------------------------------------------------------------------------
       
  6253 	// TEST C3: Successful completion request of
       
  6254 	// RMmCustomAPI::CheckSecurityCode when result is not cached.
       
  6255  	//-------------------------------------------------------------------------
       
  6256 
       
  6257     type = RMmCustomAPI::ESecurityCodePuk1;
       
  6258     codeId = KSecCodePuk;
       
  6259    
       
  6260     data.Close();
       
  6261 	ltsyData.SerialiseL(data);	
       
  6262 	
       
  6263     iMockLTSY.ExpectL( ECustomCheckSecurityCodeIPC, data);    
       
  6264     iMockLTSY.CompleteL( ECustomCheckSecurityCodeIPC, KErrNone);
       
  6265 
       
  6266     customAPI.CheckSecurityCode(requestStatus, type);
       
  6267 	
       
  6268 	User::WaitForRequest(requestStatus);	
       
  6269 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
  6270 
       
  6271 	AssertMockLtsyStatusL();
       
  6272 	
       
  6273  	//-------------------------------------------------------------------------
       
  6274 	// TEST C4: Successful completion request of
       
  6275 	// RMmCustomAPI::CheckSecurityCode when result is not cached.
       
  6276  	//-------------------------------------------------------------------------
       
  6277 
       
  6278     type = RMmCustomAPI::ESecurityCodePuk2;
       
  6279     codeId = KSecCodePuk2;
       
  6280    
       
  6281     data.Close();
       
  6282 	ltsyData.SerialiseL(data);	
       
  6283 	
       
  6284     iMockLTSY.ExpectL( ECustomCheckSecurityCodeIPC, data);    
       
  6285     iMockLTSY.CompleteL( ECustomCheckSecurityCodeIPC, KErrNone);
       
  6286 
       
  6287     customAPI.CheckSecurityCode(requestStatus, type);
       
  6288 	
       
  6289 	User::WaitForRequest(requestStatus);	
       
  6290 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
  6291 
       
  6292 	AssertMockLtsyStatusL();
       
  6293 	
       
  6294 
       
  6295  	//-------------------------------------------------------------------------
       
  6296 	// TEST C5: Successful completion request of
       
  6297 	// RMmCustomAPI::CheckSecurityCode when result is not cached.
       
  6298  	//-------------------------------------------------------------------------
       
  6299 
       
  6300     type = RMmCustomAPI::ESecurityCodePassPhrase;
       
  6301     codeId = KSecCodeSecurity;
       
  6302    
       
  6303     data.Close();
       
  6304 	ltsyData.SerialiseL(data);	
       
  6305 	
       
  6306     iMockLTSY.ExpectL( ECustomCheckSecurityCodeIPC, data);    
       
  6307     iMockLTSY.CompleteL( ECustomCheckSecurityCodeIPC, KErrNone);
       
  6308 
       
  6309     customAPI.CheckSecurityCode(requestStatus, type);
       
  6310 	
       
  6311 	User::WaitForRequest(requestStatus);	
       
  6312 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
  6313 
       
  6314 	AssertMockLtsyStatusL();
       
  6315 
       
  6316  	//-------------------------------------------------------------------------
       
  6317 	// TEST C6: Completion request of
       
  6318 	// RMmCustomAPI::CheckSecurityCode when result type is ESecurityUniversalPin
       
  6319  	//-------------------------------------------------------------------------
       
  6320 
       
  6321     type = RMmCustomAPI::ESecurityUniversalPin;
       
  6322 
       
  6323     customAPI.CheckSecurityCode(requestStatus, type);
       
  6324 	
       
  6325 	User::WaitForRequest(requestStatus);	
       
  6326 	ASSERT_EQUALS(KErrArgument, requestStatus.Int());
       
  6327 
       
  6328 	AssertMockLtsyStatusL();
       
  6329 		
       
  6330 
       
  6331  	//-------------------------------------------------------------------------
       
  6332 	// TEST E: Unsolicited completion of RMmCustomAPI::CheckSecurityCode
       
  6333 	// from LTSY.
       
  6334  	//-------------------------------------------------------------------------
       
  6335 
       
  6336 	TRequestStatus mockLtsyStatus;
       
  6337 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
  6338 
       
  6339     iMockLTSY.CompleteL( ECustomCheckSecurityCodeIPC, KErrNone);
       
  6340 
       
  6341 	User::WaitForRequest(mockLtsyStatus);
       
  6342 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
  6343 
       
  6344 	AssertMockLtsyStatusL();
       
  6345 	CleanupStack::PopAndDestroy(4, this); 		
       
  6346 	
       
  6347 	}
       
  6348 
       
  6349 
       
  6350 /**
       
  6351 @SYMTestCaseID BA-CTSY-CIPC-MCCSC-0002
       
  6352 @SYMComponent  telephony_ctsy
       
  6353 @SYMTestCaseDesc Test support in CTSY for cancelling of RMmCustomAPI::CheckSecurityCode
       
  6354 @SYMTestPriority High
       
  6355 @SYMTestActions Invokes cancelling of RMmCustomAPI::CheckSecurityCode
       
  6356 @SYMTestExpectedResults Pass
       
  6357 @SYMTestType CT
       
  6358 */
       
  6359 void CCTsyCustomIPCFU::TestCheckSecurityCode0002L()
       
  6360 	{
       
  6361 
       
  6362 	OpenEtelServerL(EUseExtendedError);
       
  6363 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  6364 	OpenPhoneL();
       
  6365 
       
  6366 	RMmCustomAPI customAPI;
       
  6367 	OpenCustomAPILC(customAPI, iPhone);
       
  6368 
       
  6369 	RBuf8 data;
       
  6370 	CleanupClosePushL(data);
       
  6371 
       
  6372 	RBuf8 data2;
       
  6373 	CleanupClosePushL(data2);
       
  6374 
       
  6375     TRequestStatus requestStatus;
       
  6376     
       
  6377     RMmCustomAPI::TSecurityCodeType type(RMmCustomAPI::ESecurityCodePin1);
       
  6378     TUint8 codeId(KSecCodePin);
       
  6379     RMobilePhone::TMobilePassword secCode;
       
  6380    
       
  6381 	TMockLtsyData2 <TUint8, RMobilePhone::TMobilePassword> ltsyData(codeId, secCode);
       
  6382 	ltsyData.SerialiseL(data);	
       
  6383    
       
  6384 	TRequestStatus mockLtsyStatus;
       
  6385 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
  6386 
       
  6387  	//-------------------------------------------------------------------------
       
  6388 	// Test A: Cancelling of RMmCustomAPI::CheckSecurityCode
       
  6389  	//-------------------------------------------------------------------------
       
  6390 
       
  6391     iMockLTSY.ExpectL( ECustomCheckSecurityCodeIPC, data);
       
  6392 
       
  6393     customAPI.CheckSecurityCode(requestStatus, type);
       
  6394 
       
  6395 	TBool flag(ETrue);
       
  6396 	TMockLtsyData2 <TUint8, TBool> ltsyData2(codeId, flag);
       
  6397 	ltsyData2.SerialiseL(data2);	
       
  6398 
       
  6399     iMockLTSY.ExpectL( ECustomCheckSecurityCodeCancelIPC, data2);    
       
  6400     iMockLTSY.CompleteL( ECustomCheckSecurityCodeIPC, KErrCancel);
       
  6401 	
       
  6402 	customAPI.CancelAsyncRequest(ECustomCheckSecurityCodeIPC);
       
  6403 
       
  6404 	User::WaitForRequest(requestStatus);	
       
  6405 	ASSERT_EQUALS(KErrCancel, requestStatus.Int());
       
  6406 
       
  6407 	//-------------------------------------------------------------------------
       
  6408 	// Test B: Cancelling of RMmCustomAPI::CheckSecurityCode
       
  6409 	//		Baseband returns the request successfully before handling cancel function.
       
  6410 	//-------------------------------------------------------------------------
       
  6411 	iMockLTSY.ExpectL( ECustomCheckSecurityCodeIPC, data);
       
  6412 	iMockLTSY.CompleteL( ECustomCheckSecurityCodeIPC, KErrNone, 20);
       
  6413 
       
  6414 	customAPI.CheckSecurityCode(requestStatus, type);
       
  6415 
       
  6416 	iMockLTSY.ExpectL( ECustomCheckSecurityCodeCancelIPC, data2);
       
  6417 
       
  6418 	customAPI.CancelAsyncRequest(ECustomCheckSecurityCodeIPC);
       
  6419 
       
  6420 	User::WaitForRequest(requestStatus);	
       
  6421 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
  6422 
       
  6423 	User::WaitForRequest(mockLtsyStatus);	
       
  6424 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
  6425 
       
  6426 	AssertMockLtsyStatusL();
       
  6427 
       
  6428 	CleanupStack::PopAndDestroy(4, this); 				
       
  6429 	
       
  6430 	}
       
  6431 
       
  6432 
       
  6433 /**
       
  6434 @SYMTestCaseID BA-CTSY-CIPC-MCCSC-0004
       
  6435 @SYMComponent  telephony_ctsy
       
  6436 @SYMTestCaseDesc Test support in CTSY for multiple client requests to RMmCustomAPI::CheckSecurityCode
       
  6437 @SYMTestPriority High
       
  6438 @SYMTestActions Invokes multiple client requests to RMmCustomAPI::CheckSecurityCode
       
  6439 @SYMTestExpectedResults Pass
       
  6440 @SYMTestType CT
       
  6441 */
       
  6442 void CCTsyCustomIPCFU::TestCheckSecurityCode0004L()
       
  6443 	{
       
  6444 
       
  6445 	OpenEtelServerL(EUseExtendedError);
       
  6446 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  6447 	OpenPhoneL();
       
  6448 
       
  6449 	// Open second client
       
  6450 	RTelServer telServer2;
       
  6451 	TInt ret = telServer2.Connect();
       
  6452 	ASSERT_EQUALS(KErrNone, ret);
       
  6453 	CleanupClosePushL(telServer2);
       
  6454 
       
  6455 	RMobilePhone phone2;
       
  6456 	ret = phone2.Open(telServer2,KMmTsyPhoneName);
       
  6457 	ASSERT_EQUALS(KErrNone, ret);
       
  6458 	CleanupClosePushL(phone2);
       
  6459 
       
  6460 	RMmCustomAPI customAPI;
       
  6461 	OpenCustomAPILC(customAPI, iPhone);
       
  6462 
       
  6463 	RMmCustomAPI customAPI2;
       
  6464 	OpenCustomAPILC(customAPI2, phone2, EFalse);
       
  6465 
       
  6466     TRequestStatus requestStatus;
       
  6467     TRequestStatus requestStatus2;
       
  6468 
       
  6469 	RBuf8 data;
       
  6470 	CleanupClosePushL(data);
       
  6471 
       
  6472     RMmCustomAPI::TSecurityCodeType type(RMmCustomAPI::ESecurityCodePin1);
       
  6473     RMmCustomAPI::TSecurityCodeType type2(RMmCustomAPI::ESecurityCodePin1);
       
  6474     TUint8 codeId(KSecCodePin);
       
  6475     RMobilePhone::TMobilePassword secCode;
       
  6476    
       
  6477 	TMockLtsyData2 <TUint8, RMobilePhone::TMobilePassword> ltsyData(codeId, secCode);
       
  6478 	ltsyData.SerialiseL(data);	
       
  6479 
       
  6480 	//-------------------------------------------------------------------------
       
  6481 	// Test A: Test multiple clients requesting RMmCustomAPI::CheckSecurityCode
       
  6482  	//-------------------------------------------------------------------------
       
  6483 
       
  6484     iMockLTSY.ExpectL( ECustomCheckSecurityCodeIPC, data);
       
  6485     iMockLTSY.CompleteL( ECustomCheckSecurityCodeIPC, KErrNone,20);
       
  6486 
       
  6487     customAPI.CheckSecurityCode(requestStatus, type);
       
  6488     customAPI2.CheckSecurityCode(requestStatus2, type2);		
       
  6489         
       
  6490 	User::WaitForRequest(requestStatus);	
       
  6491 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
  6492 
       
  6493 	User::WaitForRequest(requestStatus2);	
       
  6494 	ASSERT_EQUALS(KErrServerBusy, requestStatus2.Int());
       
  6495 
       
  6496 	AssertMockLtsyStatusL();
       
  6497 
       
  6498 	CleanupStack::PopAndDestroy(6, this);
       
  6499 
       
  6500 	}
       
  6501 
       
  6502 
       
  6503 /**
       
  6504 @SYMTestCaseID BA-CTSY-CIPC-MCCSC-0005
       
  6505 @SYMComponent  telephony_ctsy
       
  6506 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::CheckSecurityCode with timeout
       
  6507 @SYMTestPriority High
       
  6508 @SYMTestActions Invokes RMmCustomAPI::CheckSecurityCode and tests for timeout
       
  6509 @SYMTestExpectedResults Pass
       
  6510 @SYMTestType CT
       
  6511 */
       
  6512 void CCTsyCustomIPCFU::TestCheckSecurityCode0005L()
       
  6513 	{
       
  6514 	
       
  6515 	OpenEtelServerL(EUseExtendedError);
       
  6516 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  6517 	OpenPhoneL();
       
  6518 
       
  6519 	RMmCustomAPI customAPI;
       
  6520 	OpenCustomAPILC(customAPI, iPhone);
       
  6521 
       
  6522 	RBuf8 data;
       
  6523 	CleanupClosePushL(data);
       
  6524 
       
  6525     TRequestStatus requestStatus;
       
  6526     
       
  6527     RMmCustomAPI::TSecurityCodeType type(RMmCustomAPI::ESecurityCodePin1);
       
  6528     TUint8 codeId(KSecCodePin);
       
  6529     RMobilePhone::TMobilePassword secCode;
       
  6530    
       
  6531 	TMockLtsyData2 <TUint8, RMobilePhone::TMobilePassword> ltsyData(codeId, secCode);
       
  6532 	ltsyData.SerialiseL(data);	
       
  6533 
       
  6534     iMockLTSY.ExpectL( ECustomCheckSecurityCodeIPC, data);    
       
  6535 
       
  6536 	ERR_PRINTF2(_L("<font color=Orange>$CTSYKnownFailure: defect id = %d</font>"), 402502);
       
  6537 	// Request ECustomCheckSecurityCodeIPC is not completed by timeout.
       
  6538 	
       
  6539 	// to avoid next test blocking
       
  6540 	ASSERT_TRUE(EFalse);
       
  6541 
       
  6542     customAPI.CheckSecurityCode(requestStatus, type);
       
  6543 
       
  6544 	User::WaitForRequest(requestStatus);	
       
  6545 	ASSERT_EQUALS(KErrTimedOut, requestStatus.Int());
       
  6546 
       
  6547 	AssertMockLtsyStatusL();
       
  6548 
       
  6549 	CleanupStack::PopAndDestroy(3, this); 			
       
  6550 	
       
  6551 	}
       
  6552 
       
  6553 
       
  6554 /**
       
  6555 @SYMTestCaseID BA-CTSY-CIPC-MCGAP-0001
       
  6556 @SYMComponent  telephony_ctsy
       
  6557 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::GetActivePin
       
  6558 @SYMTestPriority High
       
  6559 @SYMTestActions Invokes RMmCustomAPI::GetActivePin
       
  6560 @SYMTestExpectedResults Pass
       
  6561 @SYMTestType CT
       
  6562 */
       
  6563 void CCTsyCustomIPCFU::TestGetActivePin0001L()
       
  6564 	{
       
  6565 
       
  6566 	OpenEtelServerL(EUseExtendedError);
       
  6567 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  6568 	OpenPhoneL();
       
  6569 
       
  6570 	RMmCustomAPI customAPI;
       
  6571 	OpenCustomAPILC(customAPI, iPhone);
       
  6572 
       
  6573     TRequestStatus requestStatus;
       
  6574     RMobilePhone::TMobilePhoneSecurityCode code;    
       
  6575 
       
  6576  	//-------------------------------------------------------------------------
       
  6577 	// TEST C: Successful completion request of
       
  6578 	// RMmCustomAPI::GetActivePin when result is not cached.
       
  6579  	//-------------------------------------------------------------------------
       
  6580 
       
  6581     customAPI.GetActivePin(code);
       
  6582     
       
  6583     ASSERT_EQUALS(RMobilePhone::ESecurityCodePin1, code);
       
  6584 	
       
  6585 	AssertMockLtsyStatusL();	
       
  6586 
       
  6587 	// now change the pin and get the changed value
       
  6588 
       
  6589 	TRequestStatus mockLtsyStatus;
       
  6590 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
  6591 
       
  6592 	const RMobilePhone::TMobilePhoneSecurityCode compCode(RMobilePhone::ESecurityCodePin2);
       
  6593 	TPckg<RMobilePhone::TMobilePhoneSecurityCode> compPckg(compCode);
       
  6594 
       
  6595     iMockLTSY.CompleteL(EMmTsySecurityGetSimActivePinStateIPC, KErrNone, compPckg);
       
  6596 
       
  6597 	User::WaitForRequest(mockLtsyStatus);
       
  6598     ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
  6599 
       
  6600     customAPI.GetActivePin(code);
       
  6601 
       
  6602     ASSERT_EQUALS(compCode, code);
       
  6603 
       
  6604 	AssertMockLtsyStatusL();	
       
  6605 
       
  6606 	CleanupStack::PopAndDestroy(2, this); 			
       
  6607 	
       
  6608 	}
       
  6609 
       
  6610 
       
  6611 /**
       
  6612 @SYMTestCaseID BA-CTSY-CIPC-MCGATD-0001
       
  6613 @SYMComponent  telephony_ctsy
       
  6614 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::GetAirTimeDuration
       
  6615 @SYMTestPriority High
       
  6616 @SYMTestActions Invokes RMmCustomAPI::GetAirTimeDuration
       
  6617 @SYMTestExpectedResults Pass
       
  6618 @SYMTestType CT
       
  6619 */
       
  6620 void CCTsyCustomIPCFU::TestGetAirTimeDuration0001L()
       
  6621 	{
       
  6622 
       
  6623 	OpenEtelServerL(EUseExtendedError);
       
  6624 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  6625 	OpenPhoneL();
       
  6626 
       
  6627 	RMmCustomAPI customAPI;
       
  6628 	OpenCustomAPILC(customAPI, iPhone);
       
  6629 
       
  6630     TRequestStatus requestStatus;
       
  6631     TTimeIntervalSeconds sec;    
       
  6632 
       
  6633  	//-------------------------------------------------------------------------
       
  6634 	// TEST C: Successful completion request of
       
  6635 	// RMmCustomAPI::GetAirTimeDuration when result is not cached.
       
  6636  	//-------------------------------------------------------------------------
       
  6637  	// check when there were no any calls on air
       
  6638 
       
  6639     TInt ret = customAPI.GetAirTimeDuration(sec);
       
  6640 	
       
  6641 	ASSERT_EQUALS(KErrNone, ret);
       
  6642 	ASSERT_EQUALS(0, sec.Int());
       
  6643 
       
  6644 	AssertMockLtsyStatusL();	
       
  6645 
       
  6646  	//-------------------------------------------------------------------------
       
  6647 	// TEST C2: Successful completion request of
       
  6648 	// RMmCustomAPI::GetAirTimeDuration when result is not cached.
       
  6649  	//-------------------------------------------------------------------------
       
  6650  	// check when there was a call on air
       
  6651 
       
  6652 	// first make the connected call 
       
  6653 
       
  6654     TName callName;
       
  6655 	TInt callId(1);
       
  6656 	RLine line;
       
  6657 	RMobileCall call;
       
  6658 	RMobilePhone::TMobileService mobileService = RMobilePhone::EVoiceService;
       
  6659 
       
  6660 	OpenLineLC(line, iPhone, KMmTsyVoice1LineName);
       
  6661 
       
  6662 	CreateAndOpenIncomingCalLC(line, call, callName, KMmTsyVoice1LineName, 
       
  6663 								callId, RMobileCall::EStatusAnswering, mobileService);
       
  6664 
       
  6665     RBuf8 completeData;
       
  6666     CleanupClosePushL(completeData);
       
  6667 
       
  6668     RMobileCall::TMobileCallStatus mobileCallStatus = RMobileCall::EStatusConnected;
       
  6669     TMockLtsyCallData1<RMobileCall::TMobileCallStatus> mockCallData2(callId, mobileService, mobileCallStatus);
       
  6670     mockCallData2.SerialiseL(completeData);
       
  6671 
       
  6672 	TRequestStatus mockLtsyStatus;
       
  6673     iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
  6674     iMockLTSY.CompleteL(EMobileCallNotifyMobileCallStatusChange, KErrNone, completeData);
       
  6675     User::WaitForRequest(mockLtsyStatus);
       
  6676     AssertMockLtsyStatusL();
       
  6677     ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
  6678 
       
  6679 	// wait a little 
       
  6680 	User::After(2000000);	//mcsec
       
  6681 	
       
  6682 	ret = customAPI.GetAirTimeDuration(sec);
       
  6683 	
       
  6684 	ASSERT_EQUALS(KErrNone, ret);
       
  6685 
       
  6686 	ASSERT_TRUE(0 < sec.Int());
       
  6687 
       
  6688 	AssertMockLtsyStatusL();	
       
  6689 
       
  6690 	CleanupStack::PopAndDestroy(5, this); 			
       
  6691 	
       
  6692 	}
       
  6693 
       
  6694 
       
  6695 /**
       
  6696 @SYMTestCaseID BA-CTSY-CIPC-MCGNPN-0001
       
  6697 @SYMComponent  telephony_ctsy
       
  6698 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::GetNetworkProviderName
       
  6699 @SYMTestPriority High
       
  6700 @SYMTestActions Invokes RMmCustomAPI::GetNetworkProviderName
       
  6701 @SYMTestExpectedResults Pass
       
  6702 @SYMTestType CT
       
  6703 */
       
  6704 void CCTsyCustomIPCFU::TestGetNetworkProviderName0001L()
       
  6705 	{
       
  6706 
       
  6707 	OpenEtelServerL(EUseExtendedError);
       
  6708 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  6709 	OpenPhoneL();
       
  6710 
       
  6711 	RMmCustomAPI customAPI;
       
  6712 	OpenCustomAPILC(customAPI, iPhone);
       
  6713 
       
  6714     TRequestStatus requestStatus;
       
  6715     TName name;
       
  6716     	
       
  6717  	//-------------------------------------------------------------------------
       
  6718 	// TEST A: failure to dispatch request to LTSY
       
  6719  	//-------------------------------------------------------------------------
       
  6720 
       
  6721     iMockLTSY.ExpectL( ECustomGetNetworkProviderNameIPC, KErrNotSupported);
       
  6722     
       
  6723     customAPI.GetNetworkProviderName(requestStatus, name);
       
  6724 	
       
  6725 	User::WaitForRequest(requestStatus);	
       
  6726 	ASSERT_EQUALS(KErrNotSupported, requestStatus.Int());
       
  6727 
       
  6728 	AssertMockLtsyStatusL();
       
  6729 
       
  6730 	//-------------------------------------------------------------------------
       
  6731 	// TEST B: failure on completion of pending request from LTSY->CTSY
       
  6732  	//-------------------------------------------------------------------------
       
  6733 
       
  6734     iMockLTSY.ExpectL( ECustomGetNetworkProviderNameIPC);
       
  6735 
       
  6736 	_LIT(KName, "ProviderName");
       
  6737 	TName compName(KName);
       
  6738 	TPckg<TName> compPckg(compName);
       
  6739 
       
  6740     iMockLTSY.CompleteL( ECustomGetNetworkProviderNameIPC, KErrGeneral, compPckg);
       
  6741 
       
  6742     customAPI.GetNetworkProviderName(requestStatus, name);
       
  6743 	
       
  6744 	User::WaitForRequest(requestStatus);	
       
  6745 	ASSERT_EQUALS(KErrGeneral, requestStatus.Int());
       
  6746 
       
  6747 	AssertMockLtsyStatusL();
       
  6748 
       
  6749  	//-------------------------------------------------------------------------
       
  6750 	// TEST C: Successful completion request of
       
  6751 	// RMmCustomAPI::GetNetworkProviderName when result is not cached.
       
  6752  	//-------------------------------------------------------------------------
       
  6753 
       
  6754     iMockLTSY.ExpectL( ECustomGetNetworkProviderNameIPC);
       
  6755     iMockLTSY.CompleteL( ECustomGetNetworkProviderNameIPC, KErrNone, compPckg);
       
  6756 
       
  6757     customAPI.GetNetworkProviderName(requestStatus, name);
       
  6758 	
       
  6759 	User::WaitForRequest(requestStatus);	
       
  6760 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
  6761 
       
  6762 	ASSERT_TRUE(0 == name.Compare(compName));
       
  6763 	
       
  6764 	AssertMockLtsyStatusL();
       
  6765 
       
  6766  	//-------------------------------------------------------------------------
       
  6767 	// TEST E: Unsolicited completion of RMmCustomAPI::GetNetworkProviderName
       
  6768 	// from LTSY.
       
  6769  	//-------------------------------------------------------------------------
       
  6770 
       
  6771 	TRequestStatus mockLtsyStatus;
       
  6772 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
  6773 
       
  6774     iMockLTSY.CompleteL( ECustomGetNetworkProviderNameIPC, KErrNone, compPckg);
       
  6775 
       
  6776 	User::WaitForRequest(mockLtsyStatus);
       
  6777 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
  6778 
       
  6779 	AssertMockLtsyStatusL();
       
  6780 	CleanupStack::PopAndDestroy(2, this);   // customAPI, this		
       
  6781 	
       
  6782 	}
       
  6783 
       
  6784 
       
  6785 /**
       
  6786 @SYMTestCaseID BA-CTSY-CIPC-MCGNPN-0002
       
  6787 @SYMComponent  telephony_ctsy
       
  6788 @SYMTestCaseDesc Test support in CTSY for cancelling of RMmCustomAPI::GetNetworkProviderName
       
  6789 @SYMTestPriority High
       
  6790 @SYMTestActions Invokes cancelling of RMmCustomAPI::GetNetworkProviderName
       
  6791 @SYMTestExpectedResults Pass
       
  6792 @SYMTestType CT
       
  6793 */
       
  6794 void CCTsyCustomIPCFU::TestGetNetworkProviderName0002L()
       
  6795 	{
       
  6796 
       
  6797 	OpenEtelServerL(EUseExtendedError);
       
  6798 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  6799 	OpenPhoneL();
       
  6800 
       
  6801 	RMmCustomAPI customAPI;
       
  6802 	OpenCustomAPILC(customAPI, iPhone);
       
  6803 
       
  6804     TRequestStatus requestStatus;
       
  6805     TName name;
       
  6806 
       
  6807 	TRequestStatus mockLtsyStatus;
       
  6808 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
  6809 
       
  6810  	//-------------------------------------------------------------------------
       
  6811 	// Test cancelling of RMmCustomAPI::GetNetworkProviderName
       
  6812  	//-------------------------------------------------------------------------
       
  6813 
       
  6814     iMockLTSY.ExpectL( ECustomGetNetworkProviderNameIPC);
       
  6815     
       
  6816 
       
  6817 	_LIT(KName, "ProviderName");
       
  6818 	TName compName(KName);
       
  6819 	TPckg<TName> compPckg(compName);
       
  6820 
       
  6821     iMockLTSY.CompleteL( ECustomGetNetworkProviderNameIPC, KErrNone, compPckg, 20);
       
  6822 
       
  6823     customAPI.GetNetworkProviderName(requestStatus, name);
       
  6824 	
       
  6825 	customAPI.CancelAsyncRequest(ECustomGetNetworkProviderNameIPC);
       
  6826 
       
  6827 	User::WaitForRequest(requestStatus);	
       
  6828 	ASSERT_EQUALS(KErrCancel, requestStatus.Int());
       
  6829 
       
  6830 	User::WaitForRequest(mockLtsyStatus);
       
  6831 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
  6832 
       
  6833 	AssertMockLtsyStatusL();
       
  6834 
       
  6835 	CleanupStack::PopAndDestroy(2); // customAPI, this		
       
  6836 	
       
  6837 	}
       
  6838 
       
  6839 
       
  6840 /**
       
  6841 @SYMTestCaseID BA-CTSY-CIPC-MCGNPN-0003
       
  6842 @SYMComponent  telephony_ctsy
       
  6843 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::GetNetworkProviderName with bad parameter data
       
  6844 @SYMTestPriority High
       
  6845 @SYMTestActions Invokes RMmCustomAPI::GetNetworkProviderName with bad parameter data
       
  6846 @SYMTestExpectedResults Pass
       
  6847 @SYMTestType CT
       
  6848 */
       
  6849 void CCTsyCustomIPCFU::TestGetNetworkProviderName0003L()
       
  6850 	{
       
  6851 
       
  6852 	OpenEtelServerL(EUseExtendedError);
       
  6853 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  6854 	OpenPhoneL();
       
  6855 
       
  6856 	RMmCustomAPI customAPI;
       
  6857 	OpenCustomAPILC(customAPI, iPhone);
       
  6858 
       
  6859     TRequestStatus requestStatus;
       
  6860     TBuf<1> littleBuf;
       
  6861 
       
  6862     iMockLTSY.ExpectL( ECustomGetNetworkProviderNameIPC);
       
  6863     
       
  6864 	_LIT(KName, "ProviderName");
       
  6865 	TName compName(KName);
       
  6866 	TPckg<TName> compPckg(compName);
       
  6867 
       
  6868     iMockLTSY.CompleteL( ECustomGetNetworkProviderNameIPC, KErrNone, compPckg);
       
  6869 
       
  6870     customAPI.GetNetworkProviderName(requestStatus, littleBuf);
       
  6871 	
       
  6872 	User::WaitForRequest(requestStatus);	
       
  6873 	ASSERT_EQUALS(KErrArgument, requestStatus.Int());
       
  6874 
       
  6875 	AssertMockLtsyStatusL();
       
  6876 
       
  6877 	CleanupStack::PopAndDestroy(2); // customAPI, this	
       
  6878 
       
  6879 	}
       
  6880 
       
  6881 
       
  6882 /**
       
  6883 @SYMTestCaseID BA-CTSY-CIPC-MCGNPN-0004
       
  6884 @SYMComponent  telephony_ctsy
       
  6885 @SYMTestCaseDesc Test support in CTSY for multiple client requests to RMmCustomAPI::GetNetworkProviderName
       
  6886 @SYMTestPriority High
       
  6887 @SYMTestActions Invokes multiple client requests to RMmCustomAPI::GetNetworkProviderName
       
  6888 @SYMTestExpectedResults Pass
       
  6889 @SYMTestType CT
       
  6890 */
       
  6891 void CCTsyCustomIPCFU::TestGetNetworkProviderName0004L()
       
  6892 	{
       
  6893 
       
  6894 	OpenEtelServerL(EUseExtendedError);
       
  6895 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  6896 	OpenPhoneL();
       
  6897 
       
  6898 	// Open second client
       
  6899 	RTelServer telServer2;
       
  6900 	TInt ret = telServer2.Connect();
       
  6901 	ASSERT_EQUALS(KErrNone, ret);
       
  6902 	CleanupClosePushL(telServer2);
       
  6903 
       
  6904 	RMobilePhone phone2;
       
  6905 	ret = phone2.Open(telServer2,KMmTsyPhoneName);
       
  6906 	ASSERT_EQUALS(KErrNone, ret);
       
  6907 	CleanupClosePushL(phone2);
       
  6908 
       
  6909 	RMmCustomAPI customAPI;
       
  6910 	OpenCustomAPILC(customAPI, iPhone);
       
  6911 
       
  6912 	RMmCustomAPI customAPI2;
       
  6913 	OpenCustomAPILC(customAPI2, phone2, EFalse);
       
  6914 
       
  6915     TRequestStatus requestStatus;
       
  6916     TRequestStatus requestStatus2;
       
  6917 
       
  6918     TName name;
       
  6919     TName name2;
       
  6920 	
       
  6921 	//-------------------------------------------------------------------------
       
  6922 	// Test A: Test multiple clients requesting RMmCustomAPI::GetNetworkProviderName
       
  6923  	//-------------------------------------------------------------------------
       
  6924 
       
  6925 	_LIT(KName, "ProviderName");
       
  6926 	TName compName(KName);
       
  6927 	TPckg<TName> compPckg(compName);
       
  6928 
       
  6929     iMockLTSY.ExpectL( ECustomGetNetworkProviderNameIPC);
       
  6930     iMockLTSY.CompleteL( ECustomGetNetworkProviderNameIPC, KErrNone, compPckg, 20);
       
  6931 
       
  6932     customAPI.GetNetworkProviderName(requestStatus, name);
       
  6933 
       
  6934     iMockLTSY.ExpectL( ECustomGetNetworkProviderNameIPC);
       
  6935     
       
  6936     _LIT(KName2, "ProviderName2");
       
  6937 	TName compName2(KName2);
       
  6938 	TPckg<TName> compPckg2(compName2);
       
  6939 
       
  6940     iMockLTSY.CompleteL( ECustomGetNetworkProviderNameIPC, KErrNone, compPckg2);
       
  6941 
       
  6942     customAPI2.GetNetworkProviderName(requestStatus2, name2);
       
  6943     
       
  6944 	User::WaitForRequest(requestStatus);	
       
  6945 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
  6946     
       
  6947 	ASSERT_TRUE(0 == name.Compare(compName));
       
  6948 	    
       
  6949 	User::WaitForRequest(requestStatus2);	
       
  6950 	ASSERT_EQUALS(KErrNone, requestStatus2.Int());
       
  6951 
       
  6952 	ASSERT_TRUE(0 == name2.Compare(compName2));
       
  6953 	
       
  6954 	AssertMockLtsyStatusL();
       
  6955 
       
  6956 	CleanupStack::PopAndDestroy(5, this);   // customAPI2, customAPI, phone2, telServer2, this
       
  6957 
       
  6958 	}
       
  6959 
       
  6960 
       
  6961 /**
       
  6962 @SYMTestCaseID BA-CTSY-CIPC-MCGNPN-0005
       
  6963 @SYMComponent  telephony_ctsy
       
  6964 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::GetNetworkProviderName with timeout
       
  6965 @SYMTestPriority High
       
  6966 @SYMTestActions Invokes RMmCustomAPI::GetNetworkProviderName and tests for timeout
       
  6967 @SYMTestExpectedResults Pass
       
  6968 @SYMTestType CT
       
  6969 */
       
  6970 void CCTsyCustomIPCFU::TestGetNetworkProviderName0005L()
       
  6971 	{
       
  6972 
       
  6973 	OpenEtelServerL(EUseExtendedError);
       
  6974 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  6975 	OpenPhoneL();
       
  6976 
       
  6977 	RMmCustomAPI customAPI;
       
  6978 	OpenCustomAPILC(customAPI, iPhone);
       
  6979 
       
  6980     TRequestStatus requestStatus;
       
  6981     TName name;
       
  6982 
       
  6983     iMockLTSY.ExpectL( ECustomGetNetworkProviderNameIPC);
       
  6984     
       
  6985     customAPI.GetNetworkProviderName(requestStatus, name);
       
  6986 	
       
  6987 	User::WaitForRequest(requestStatus);	
       
  6988 	ASSERT_EQUALS(KErrTimedOut, requestStatus.Int());
       
  6989 
       
  6990 	AssertMockLtsyStatusL();
       
  6991 
       
  6992 	CleanupStack::PopAndDestroy(2); // customAPI, this	
       
  6993 
       
  6994 	}
       
  6995 
       
  6996 
       
  6997 /**
       
  6998 @SYMTestCaseID BA-CTSY-CIPC-MCCEN-0001
       
  6999 @SYMComponent  telephony_ctsy
       
  7000 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::CheckEmergencyNumber
       
  7001 @SYMTestPriority High
       
  7002 @SYMTestActions Invokes RMmCustomAPI::CheckEmergencyNumber
       
  7003 @SYMTestExpectedResults Pass
       
  7004 @SYMTestType CT
       
  7005 */
       
  7006 void CCTsyCustomIPCFU::TestCheckEmergencyNumber0001L()
       
  7007 	{
       
  7008 
       
  7009 	OpenEtelServerL(EUseExtendedError);
       
  7010 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  7011 	OpenPhoneL();
       
  7012 
       
  7013 	RMmCustomAPI customAPI;
       
  7014 	OpenCustomAPILC(customAPI, iPhone);
       
  7015 
       
  7016 	_LIT(KEmerNum, "IfThisIsEmer?");
       
  7017 
       
  7018     TRequestStatus requestStatus;
       
  7019     RMmCustomAPI::TEmerNumberCheckMode mode;
       
  7020     
       
  7021     mode.iCheckMode = RMmCustomAPI::EEmerNumberCheckAdvanced;
       
  7022     mode.iNumber.Copy(KEmerNum);
       
  7023     
       
  7024     TBool result;
       
  7025    
       
  7026 	RBuf8 expectData;
       
  7027 	CleanupClosePushL(expectData);
       
  7028 
       
  7029 	RBuf8 compData;
       
  7030 	CleanupClosePushL(compData);
       
  7031 
       
  7032 	TMockLtsyData1< RMmCustomAPI::TEmerNumberCheckMode > ltsyData(mode);	
       
  7033 	ltsyData.SerialiseL(expectData);
       
  7034     	
       
  7035  	//-------------------------------------------------------------------------
       
  7036 	// TEST A: failure to dispatch request to LTSY
       
  7037  	//-------------------------------------------------------------------------
       
  7038 
       
  7039     iMockLTSY.ExpectL( ECustomCheckEmergencyNumberIPC, expectData, KErrNotSupported);
       
  7040     
       
  7041     customAPI.CheckEmergencyNumber(requestStatus, mode, result);
       
  7042 	
       
  7043 	User::WaitForRequest(requestStatus);	
       
  7044 	ASSERT_EQUALS(KErrNotSupported, requestStatus.Int());
       
  7045 
       
  7046 	AssertMockLtsyStatusL();
       
  7047 
       
  7048 	//-------------------------------------------------------------------------
       
  7049 	// TEST B: failure on completion of pending request from LTSY->CTSY
       
  7050  	//-------------------------------------------------------------------------
       
  7051 
       
  7052     iMockLTSY.ExpectL( ECustomCheckEmergencyNumberIPC, expectData);
       
  7053     
       
  7054     _LIT(KNumber, "Number");
       
  7055     
       
  7056 	RMmCustomAPI::TMobileTelNumber telNumber(KNumber);
       
  7057 	RMmCustomAPI::TMobileTelNumber* telNumberPtr(&telNumber);
       
  7058 
       
  7059 	TMockLtsyData1< RMmCustomAPI::TMobileTelNumber* > ltsyData2(telNumberPtr);	
       
  7060 	ltsyData2.SerialiseL(compData);
       
  7061     
       
  7062     iMockLTSY.CompleteL( ECustomCheckEmergencyNumberIPC, KErrGeneral, compData);
       
  7063 
       
  7064     customAPI.CheckEmergencyNumber(requestStatus, mode, result);
       
  7065 	
       
  7066 	User::WaitForRequest(requestStatus);	
       
  7067 	ASSERT_EQUALS(KErrGeneral, requestStatus.Int());
       
  7068 
       
  7069 	AssertMockLtsyStatusL();
       
  7070 
       
  7071  	//-------------------------------------------------------------------------
       
  7072 	// TEST C: Successful completion request of
       
  7073 	// RMmCustomAPI::CheckEmergencyNumber when result is not cached.
       
  7074  	//-------------------------------------------------------------------------
       
  7075 
       
  7076     iMockLTSY.ExpectL( ECustomCheckEmergencyNumberIPC, expectData);
       
  7077     iMockLTSY.CompleteL( ECustomCheckEmergencyNumberIPC, KErrNone, compData);
       
  7078 
       
  7079     customAPI.CheckEmergencyNumber(requestStatus, mode, result);
       
  7080 	
       
  7081 	User::WaitForRequest(requestStatus);	
       
  7082 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
  7083 
       
  7084 	ASSERT_EQUALS(0, mode.iNumber.Compare(telNumber));
       
  7085 	ASSERT_EQUALS(1, result);
       
  7086 
       
  7087 
       
  7088  	//-------------------------------------------------------------------------
       
  7089 	// TEST C1: mode.iCheckMode = RMmCustomAPI::EEmerNumberCheckNormal;
       
  7090  	//-------------------------------------------------------------------------
       
  7091 
       
  7092 	mode.iNumber.Copy(KEmerNum);
       
  7093 	mode.iCheckMode = RMmCustomAPI::EEmerNumberCheckNormal;
       
  7094 	ltsyData.SerialiseL(expectData);
       
  7095 
       
  7096     iMockLTSY.ExpectL( ECustomCheckEmergencyNumberIPC, expectData);
       
  7097     iMockLTSY.CompleteL( ECustomCheckEmergencyNumberIPC, KErrNone, compData);
       
  7098 
       
  7099     customAPI.CheckEmergencyNumber(requestStatus, mode, result);
       
  7100 	
       
  7101 	User::WaitForRequest(requestStatus);	
       
  7102 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
  7103 
       
  7104 	ASSERT_EQUALS(0, mode.iNumber.Compare(telNumber));
       
  7105 	ASSERT_EQUALS(1, result);
       
  7106 
       
  7107 
       
  7108  	//-------------------------------------------------------------------------
       
  7109 	// TEST C2: now check with telNumberPtr = NULL
       
  7110  	//-------------------------------------------------------------------------
       
  7111 
       
  7112 	telNumberPtr = NULL;
       
  7113 	compData.Close();
       
  7114 	ltsyData2.SerialiseL(compData);
       
  7115 
       
  7116     iMockLTSY.ExpectL( ECustomCheckEmergencyNumberIPC, expectData);
       
  7117     iMockLTSY.CompleteL( ECustomCheckEmergencyNumberIPC, KErrNone, compData);
       
  7118 
       
  7119     mode.iNumber.Copy(KEmerNum);
       
  7120     customAPI.CheckEmergencyNumber(requestStatus, mode, result);
       
  7121 	
       
  7122 	User::WaitForRequest(requestStatus);	
       
  7123 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
  7124 
       
  7125 	ASSERT_EQUALS(0, mode.iNumber.Compare(KEmerNum));
       
  7126 	ASSERT_TRUE(EFalse == result);
       
  7127 
       
  7128 	AssertMockLtsyStatusL();
       
  7129 
       
  7130  	//-------------------------------------------------------------------------
       
  7131 	// TEST E: Unsolicited completion of RMmCustomAPI::CheckEmergencyNumber
       
  7132 	// from LTSY.
       
  7133  	//-------------------------------------------------------------------------
       
  7134 
       
  7135 	TRequestStatus mockLtsyStatus;
       
  7136 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
  7137 
       
  7138     iMockLTSY.CompleteL( ECustomCheckEmergencyNumberIPC, KErrNone, compData);
       
  7139 
       
  7140 	User::WaitForRequest(mockLtsyStatus);
       
  7141 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
  7142 
       
  7143 
       
  7144 	// check a branch with iISVDialNumberCheck
       
  7145 
       
  7146     TName callName;
       
  7147 	TInt callId(1);
       
  7148 	RLine line;
       
  7149 	RMobileCall call;
       
  7150 	RMobilePhone::TMobileService mobileService = RMobilePhone::EVoiceService;
       
  7151 
       
  7152 	OpenLineLC(line, iPhone, KMmTsyVoice1LineName);
       
  7153 
       
  7154 	CreateAndOpenIncomingCalLC(line, call, callName, KMmTsyVoice1LineName, 
       
  7155 								callId, RMobileCall::EStatusIdle, mobileService);
       
  7156 
       
  7157 	_LIT(KPhoneNumber, "135468456456");   	
       
  7158 
       
  7159 	RMobileCall::TEtel3rdPartyMobileCallParamsV1 callParams;
       
  7160 	callParams.iIdRestrict = RMobileCall::ESendMyId;
       
  7161 	callParams.iAutoRedial = ETrue;
       
  7162     
       
  7163     mode.iCheckMode = RMmCustomAPI::EEmerNumberCheckNormal;
       
  7164     mode.iNumber.Copy(KPhoneNumber);    
       
  7165     expectData.Close();
       
  7166 	ltsyData.SerialiseL(expectData);
       
  7167     iMockLTSY.ExpectL( ECustomCheckEmergencyNumberIPC, expectData, KErrNotSupported);
       
  7168 
       
  7169 	TPckg<RMobileCall::TEtel3rdPartyMobileCallParamsV1> pckgCallParams(callParams);
       
  7170 
       
  7171 	call.DialISV(requestStatus, pckgCallParams, KPhoneNumber);
       
  7172 	
       
  7173 	User::WaitForRequest(requestStatus);
       
  7174 	ASSERT_EQUALS(KErrServerBusy, requestStatus.Int());
       
  7175 
       
  7176 	AssertMockLtsyStatusL();
       
  7177 	CleanupStack::PopAndDestroy(6, this); 	
       
  7178 	
       
  7179 	}
       
  7180 
       
  7181 
       
  7182 /**
       
  7183 @SYMTestCaseID BA-CTSY-CIPC-MCCEN-0002
       
  7184 @SYMComponent  telephony_ctsy
       
  7185 @SYMTestCaseDesc Test support in CTSY for cancelling of RMmCustomAPI::CheckEmergencyNumber
       
  7186 @SYMTestPriority High
       
  7187 @SYMTestActions Invokes cancelling of RMmCustomAPI::CheckEmergencyNumber
       
  7188 @SYMTestExpectedResults Pass
       
  7189 @SYMTestType CT
       
  7190 */
       
  7191 void CCTsyCustomIPCFU::TestCheckEmergencyNumber0002L()
       
  7192 	{
       
  7193 
       
  7194 	OpenEtelServerL(EUseExtendedError);
       
  7195 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  7196 	OpenPhoneL();
       
  7197 
       
  7198 	RMmCustomAPI customAPI;
       
  7199 	OpenCustomAPILC(customAPI, iPhone);
       
  7200 
       
  7201 	RBuf8 expectData;
       
  7202 	CleanupClosePushL(expectData);
       
  7203 
       
  7204 	RBuf8 compData;
       
  7205 	CleanupClosePushL(compData);
       
  7206 	
       
  7207 	_LIT(KEmerNum, "IfThisIsEmer?");
       
  7208 
       
  7209     TRequestStatus requestStatus;
       
  7210     TBool result;
       
  7211     RMmCustomAPI::TEmerNumberCheckMode mode;
       
  7212     
       
  7213     mode.iCheckMode = RMmCustomAPI::EEmerNumberCheckAdvanced;
       
  7214     mode.iNumber.Copy(KEmerNum);
       
  7215        
       
  7216 	TMockLtsyData1< RMmCustomAPI::TEmerNumberCheckMode > ltsyData(mode);	
       
  7217 	ltsyData.SerialiseL(expectData);
       
  7218     	
       
  7219  	//-------------------------------------------------------------------------
       
  7220 	// Test cancelling of RMmCustomAPI::CheckEmergencyNumber
       
  7221  	//-------------------------------------------------------------------------
       
  7222 
       
  7223     iMockLTSY.ExpectL( ECustomCheckEmergencyNumberIPC, expectData);
       
  7224 
       
  7225     customAPI.CheckEmergencyNumber(requestStatus, mode, result);
       
  7226 	
       
  7227 	customAPI.CancelAsyncRequest(ECustomCheckEmergencyNumberIPC);
       
  7228 
       
  7229 	User::WaitForRequest(requestStatus);	
       
  7230 	ASSERT_EQUALS(KErrCancel, requestStatus.Int());
       
  7231 
       
  7232 	TRequestStatus mockLtsyStatus;
       
  7233 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
  7234 
       
  7235     _LIT(KNumber, "Number");
       
  7236     
       
  7237 	RMmCustomAPI::TMobileTelNumber telNumber(KNumber);
       
  7238 	RMmCustomAPI::TMobileTelNumber* telNumberPtr(&telNumber);
       
  7239 
       
  7240 	TMockLtsyData1< RMmCustomAPI::TMobileTelNumber* > ltsyData2(telNumberPtr);	
       
  7241 	ltsyData2.SerialiseL(compData);
       
  7242     
       
  7243     iMockLTSY.CompleteL( ECustomCheckEmergencyNumberIPC, KErrNone, compData);
       
  7244 
       
  7245 	User::WaitForRequest(mockLtsyStatus);
       
  7246 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
  7247 	
       
  7248 	AssertMockLtsyStatusL();
       
  7249 	CleanupStack::PopAndDestroy(4); 	
       
  7250 	
       
  7251 	}
       
  7252 
       
  7253 
       
  7254 
       
  7255 /**
       
  7256 @SYMTestCaseID BA-CTSY-CIPC-MCCEN-0004
       
  7257 @SYMComponent  telephony_ctsy
       
  7258 @SYMTestCaseDesc Test support in CTSY for multiple client requests to RMmCustomAPI::CheckEmergencyNumber
       
  7259 @SYMTestPriority High
       
  7260 @SYMTestActions Invokes multiple client requests to RMmCustomAPI::CheckEmergencyNumber
       
  7261 @SYMTestExpectedResults Pass
       
  7262 @SYMTestType CT
       
  7263 */
       
  7264 void CCTsyCustomIPCFU::TestCheckEmergencyNumber0004L()
       
  7265 	{
       
  7266 					
       
  7267 	OpenEtelServerL(EUseExtendedError);
       
  7268 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  7269 	OpenPhoneL();
       
  7270 
       
  7271 	// Open second client
       
  7272 	RTelServer telServer2;
       
  7273 	TInt ret = telServer2.Connect();
       
  7274 	ASSERT_EQUALS(KErrNone, ret);
       
  7275 	CleanupClosePushL(telServer2);
       
  7276 
       
  7277 	RMobilePhone phone2;
       
  7278 	ret = phone2.Open(telServer2,KMmTsyPhoneName);
       
  7279 	ASSERT_EQUALS(KErrNone, ret);
       
  7280 	CleanupClosePushL(phone2);
       
  7281 
       
  7282 	RMmCustomAPI customAPI;
       
  7283 	OpenCustomAPILC(customAPI, iPhone);
       
  7284 
       
  7285 	RMmCustomAPI customAPI2;
       
  7286 	OpenCustomAPILC(customAPI2, phone2, EFalse);
       
  7287 
       
  7288 	RBuf8 expectData;
       
  7289 	CleanupClosePushL(expectData);
       
  7290 
       
  7291 	RBuf8 compData;
       
  7292 	CleanupClosePushL(compData);
       
  7293 
       
  7294 
       
  7295 	_LIT(KEmerNum, "IfThisIsEmer?");
       
  7296 
       
  7297     TRequestStatus requestStatus;
       
  7298     TBool result;
       
  7299     RMmCustomAPI::TEmerNumberCheckMode mode;
       
  7300     
       
  7301     mode.iCheckMode = RMmCustomAPI::EEmerNumberCheckAdvanced;
       
  7302     mode.iNumber.Copy(KEmerNum);
       
  7303        
       
  7304 	TMockLtsyData1< RMmCustomAPI::TEmerNumberCheckMode > ltsyData(mode);	
       
  7305 	ltsyData.SerialiseL(expectData);
       
  7306     	
       
  7307     TRequestStatus requestStatus2;
       
  7308     TBool result2;
       
  7309     RMmCustomAPI::TEmerNumberCheckMode mode2;
       
  7310 
       
  7311     mode2.iCheckMode = RMmCustomAPI::EEmerNumberCheckAdvanced;
       
  7312     mode2.iNumber.Copy(KEmerNum);
       
  7313    
       
  7314     iMockLTSY.ExpectL( ECustomCheckEmergencyNumberIPC, expectData);
       
  7315 
       
  7316     _LIT(KNumber, "Number");
       
  7317     
       
  7318 	RMmCustomAPI::TMobileTelNumber telNumber(KNumber);
       
  7319 	RMmCustomAPI::TMobileTelNumber* telNumberPtr(&telNumber);
       
  7320 
       
  7321 	TMockLtsyData1< RMmCustomAPI::TMobileTelNumber* > ltsyData2(telNumberPtr);	
       
  7322 	ltsyData2.SerialiseL(compData);
       
  7323     
       
  7324     iMockLTSY.CompleteL( ECustomCheckEmergencyNumberIPC, KErrNone, compData, 10);
       
  7325 
       
  7326     customAPI.CheckEmergencyNumber(requestStatus, mode, result);
       
  7327     customAPI2.CheckEmergencyNumber(requestStatus2, mode2, result2);
       
  7328 
       
  7329 	User::WaitForRequest(requestStatus);	
       
  7330 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
  7331 
       
  7332 	User::WaitForRequest(requestStatus2);	
       
  7333 	ASSERT_EQUALS(KErrServerBusy, requestStatus2.Int());
       
  7334 
       
  7335 	AssertMockLtsyStatusL();
       
  7336 
       
  7337 	CleanupStack::PopAndDestroy(7, this);
       
  7338 	
       
  7339 	}
       
  7340 
       
  7341 
       
  7342 /**
       
  7343 @SYMTestCaseID BA-CTSY-CIPC-MCCEN-0005
       
  7344 @SYMComponent  telephony_ctsy
       
  7345 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::CheckEmergencyNumber with timeout
       
  7346 @SYMTestPriority High
       
  7347 @SYMTestActions Invokes RMmCustomAPI::CheckEmergencyNumber and tests for timeout
       
  7348 @SYMTestExpectedResults Pass
       
  7349 @SYMTestType CT
       
  7350 */
       
  7351 void CCTsyCustomIPCFU::TestCheckEmergencyNumber0005L()
       
  7352 	{
       
  7353 
       
  7354 	OpenEtelServerL(EUseExtendedError);
       
  7355 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  7356 	OpenPhoneL();
       
  7357 
       
  7358 	RMmCustomAPI customAPI;
       
  7359 	OpenCustomAPILC(customAPI, iPhone);
       
  7360 
       
  7361 	RBuf8 expectData;
       
  7362 	CleanupClosePushL(expectData);
       
  7363 
       
  7364 	_LIT(KEmerNum, "IfThisIsEmer?");
       
  7365 
       
  7366     TRequestStatus requestStatus;
       
  7367     TBool result;
       
  7368     RMmCustomAPI::TEmerNumberCheckMode mode;
       
  7369     
       
  7370     mode.iCheckMode = RMmCustomAPI::EEmerNumberCheckAdvanced;
       
  7371     mode.iNumber.Copy(KEmerNum);
       
  7372        
       
  7373 	TMockLtsyData1< RMmCustomAPI::TEmerNumberCheckMode > ltsyData(mode);	
       
  7374 	ltsyData.SerialiseL(expectData);
       
  7375     	
       
  7376     iMockLTSY.ExpectL( ECustomCheckEmergencyNumberIPC, expectData);
       
  7377 
       
  7378     customAPI.CheckEmergencyNumber(requestStatus, mode, result);
       
  7379 	
       
  7380 	User::WaitForRequest(requestStatus);	
       
  7381 	ASSERT_EQUALS(KErrTimedOut, requestStatus.Int());
       
  7382 	
       
  7383 	AssertMockLtsyStatusL();
       
  7384 	CleanupStack::PopAndDestroy(3); 	
       
  7385 	
       
  7386 	}
       
  7387 
       
  7388 
       
  7389 /**
       
  7390 @SYMTestCaseID BA-CTSY-CIPC-MCNPCR-0001
       
  7391 @SYMComponent  telephony_ctsy
       
  7392 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::NotifyPndCacheReady
       
  7393 @SYMTestPriority High
       
  7394 @SYMTestActions Invokes RMmCustomAPI::NotifyPndCacheReady
       
  7395 @SYMTestExpectedResults Pass
       
  7396 @SYMTestType CT
       
  7397 */
       
  7398 void CCTsyCustomIPCFU::TestNotifyPndCacheReady0001L()
       
  7399 	{
       
  7400 
       
  7401 	OpenEtelServerL(EUseExtendedError);
       
  7402 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  7403 	OpenPhoneL();
       
  7404 
       
  7405 	RMmCustomAPI customAPI;
       
  7406 	OpenCustomAPILC(customAPI, iPhone);
       
  7407 
       
  7408     TRequestStatus requestStatus;
       
  7409     TName name;
       
  7410 
       
  7411 	RMobilePhoneBookStore bookStore;
       
  7412 	TName pbName(KETelIccAdnPhoneBook);	
       
  7413 
       
  7414  	//-------------------------------------------------------------------------
       
  7415 	// TEST C: Successful completion request of RMmCustomAPI::NotifyPndCacheReady
       
  7416  	//-------------------------------------------------------------------------
       
  7417 
       
  7418 	customAPI.NotifyPndCacheReady(requestStatus, name);
       
  7419 
       
  7420     OpenPhoneBookStoreL(bookStore, pbName, iPhone);
       
  7421 	CleanupClosePushL(bookStore);
       
  7422 
       
  7423 	User::WaitForRequest(requestStatus);	
       
  7424 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
  7425 	ASSERT_EQUALS(0, name.Compare(pbName));
       
  7426 	
       
  7427 	AssertMockLtsyStatusL();
       
  7428 
       
  7429 	CleanupStack::PopAndDestroy(3, this); 
       
  7430 	
       
  7431 	}
       
  7432 
       
  7433 /**
       
  7434 @SYMTestCaseID BA-CTSY-CIPC-MCNPCR-0001b
       
  7435 @SYMComponent  telephony_ctsy
       
  7436 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::NotifyPndCacheReady when caching has been originated from SIM.
       
  7437 @SYMTestPriority High
       
  7438 @SYMTestActions Invokes RMmCustomAPI::NotifyPndCacheReady
       
  7439 @SYMTestExpectedResults Pass
       
  7440 @SYMTestType CT
       
  7441 */
       
  7442 void CCTsyCustomIPCFU::TestNotifyPndCacheReady0001bL()
       
  7443     {
       
  7444 
       
  7445     OpenEtelServerL(EUseExtendedError);
       
  7446     CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  7447     OpenPhoneL();
       
  7448 
       
  7449     RMmCustomAPI customAPI;
       
  7450     OpenCustomAPILC(customAPI, iPhone);
       
  7451 
       
  7452     TRequestStatus requestStatus;
       
  7453     TName name;
       
  7454 
       
  7455     TName pbName(KETelIccAdnPhoneBook); 
       
  7456 
       
  7457     //-------------------------------------------------------------------------
       
  7458     // TEST A: Successful completion request of RMmCustomAPI::NotifyPndCacheReady
       
  7459     //              when caching has been originated from SIM.
       
  7460     //-------------------------------------------------------------------------
       
  7461     customAPI.NotifyPndCacheReady(requestStatus, name);
       
  7462 
       
  7463     TInt simError = KErrNone;
       
  7464 
       
  7465     RMobilePhoneBookStore bookStore;
       
  7466     OpenPhoneBookStoreWithSIMRefreshL(bookStore, pbName, iPhone, simError);
       
  7467     CleanupClosePushL(bookStore);
       
  7468 
       
  7469     User::WaitForRequest(requestStatus);    
       
  7470     ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
  7471     ASSERT_EQUALS(0, name.Compare(pbName));
       
  7472 
       
  7473     AssertMockLtsyStatusL();
       
  7474 
       
  7475     CleanupStack::PopAndDestroy(3, this);    
       
  7476 
       
  7477     //----------------------------------------------------------
       
  7478     //  Telephony server has to be opened to test this
       
  7479     //      scenario otherwise the below condition is not
       
  7480     //      easy to test.
       
  7481     //----------------------------------------------------------
       
  7482     OpenEtelServerL(EUseExtendedError);
       
  7483     CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  7484     OpenPhoneL();
       
  7485 
       
  7486     RMmCustomAPI customAPI2;
       
  7487     OpenCustomAPILC(customAPI2, iPhone);
       
  7488 
       
  7489     TRequestStatus requestStatus2;
       
  7490     TName name2; 
       
  7491 
       
  7492     //-------------------------------------------------------------------------
       
  7493     // TEST B: Unsuccessful completion request of RMmCustomAPI::NotifyPndCacheReady
       
  7494     //              when caching has been originated from SIM.
       
  7495     //-------------------------------------------------------------------------    
       
  7496     customAPI2.NotifyPndCacheReady(requestStatus2, name2);
       
  7497 
       
  7498     RMobilePhoneBookStore bookStore2;
       
  7499     simError = KErrGeneral;
       
  7500     OpenPhoneBookStoreWithSIMRefreshL(bookStore2, pbName, iPhone, simError);
       
  7501     CleanupClosePushL(bookStore2);
       
  7502 
       
  7503     User::WaitForRequest(requestStatus2);    
       
  7504     ASSERT_EQUALS(KErrGeneral, requestStatus2.Int());
       
  7505 
       
  7506     AssertMockLtsyStatusL();
       
  7507 
       
  7508     CleanupStack::PopAndDestroy(3, this);    
       
  7509 
       
  7510     }
       
  7511 
       
  7512 /**
       
  7513 @SYMTestCaseID BA-CTSY-CIPC-MCNPCR-0002
       
  7514 @SYMComponent  telephony_ctsy
       
  7515 @SYMTestCaseDesc Test support in CTSY for cancelling of RMmCustomAPI::NotifyPndCacheReady
       
  7516 @SYMTestPriority High
       
  7517 @SYMTestActions Invokes cancelling of RMmCustomAPI::NotifyPndCacheReady
       
  7518 @SYMTestExpectedResults Pass
       
  7519 @SYMTestType CT
       
  7520 */
       
  7521 void CCTsyCustomIPCFU::TestNotifyPndCacheReady0002L()
       
  7522 	{
       
  7523 
       
  7524 	OpenEtelServerL(EUseExtendedError);
       
  7525 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  7526 	OpenPhoneL();
       
  7527 
       
  7528 	RMmCustomAPI customAPI;
       
  7529 	OpenCustomAPILC(customAPI, iPhone);
       
  7530 
       
  7531     TRequestStatus requestStatus;
       
  7532     TName name;
       
  7533 	
       
  7534 	TRequestStatus mockLtsyStatus;
       
  7535 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
  7536 
       
  7537  	//-------------------------------------------------------------------------
       
  7538 	// Test cancelling of RMmCustomAPI::NotifyPndCacheReady
       
  7539  	//-------------------------------------------------------------------------
       
  7540 
       
  7541 	customAPI.NotifyPndCacheReady(requestStatus, name);
       
  7542 
       
  7543  	_LIT(KName, "Name");
       
  7544  	
       
  7545  	TName compName(KName);
       
  7546 	TPckg<TName> compNamePckg(compName);	
       
  7547 
       
  7548     iMockLTSY.CompleteL(ECustomNotifyPndCacheReadyIPC, KErrNone, compNamePckg, 20);
       
  7549 		
       
  7550 	customAPI.CancelAsyncRequest(ECustomNotifyPndCacheReadyIPC);
       
  7551 
       
  7552 	User::WaitForRequest(requestStatus);	
       
  7553 	ASSERT_EQUALS(KErrCancel, requestStatus.Int());
       
  7554 
       
  7555 	User::WaitForRequest(mockLtsyStatus);
       
  7556 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
  7557 
       
  7558 	CleanupStack::PopAndDestroy(2); 
       
  7559 	
       
  7560 	}
       
  7561 
       
  7562 
       
  7563 /**
       
  7564 @SYMTestCaseID BA-CTSY-CIPC-MCNPCR-0003
       
  7565 @SYMComponent  telephony_ctsy
       
  7566 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::NotifyPndCacheReady with bad parameter data
       
  7567 @SYMTestPriority High
       
  7568 @SYMTestActions Invokes RMmCustomAPI::NotifyPndCacheReady with bad parameter data
       
  7569 @SYMTestExpectedResults Pass
       
  7570 @SYMTestType CT
       
  7571 */
       
  7572 void CCTsyCustomIPCFU::TestNotifyPndCacheReady0003L()
       
  7573 	{
       
  7574 
       
  7575 	OpenEtelServerL(EUseExtendedError);
       
  7576 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  7577 	OpenPhoneL();
       
  7578 
       
  7579 	RMmCustomAPI customAPI;
       
  7580 	OpenCustomAPILC(customAPI, iPhone);
       
  7581 
       
  7582     TRequestStatus requestStatus;
       
  7583     TName name;
       
  7584 
       
  7585 	RBuf8 data;
       
  7586 	CleanupClosePushL(data);
       
  7587 
       
  7588 	RBuf8 data2;
       
  7589 	CleanupClosePushL(data2);
       
  7590 
       
  7591 	RBuf8 data3;
       
  7592 	CleanupClosePushL(data3);
       
  7593 	
       
  7594 	RMobilePhoneBookStore bookStore;
       
  7595 	TName pbName(KETelIccAdnPhoneBook);	
       
  7596 	
       
  7597 	TRequestStatus mockLtsyStatus;
       
  7598 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
  7599             
       
  7600     TMockLtsyPhoneBookData0 storeInitData(pbName);
       
  7601     storeInitData.SerialiseL(data);
       
  7602     
       
  7603     CStorageInfoData storageData;
       
  7604 
       
  7605 	SetStorageInfoData(storageData);
       
  7606         
       
  7607 	TMockLtsyPhoneBookData1< CStorageInfoData > retStoreInitC(pbName, storageData); 
       
  7608 	retStoreInitC.SerialiseL(data2);
       
  7609 	
       
  7610 	//EMmTsyPhoneBookStoreCacheIPC
       
  7611     CArrayPtrSeg<CPhoneBookStoreEntry>* cache = new(ELeave) CArrayPtrSeg<CPhoneBookStoreEntry>( 1 );
       
  7612     CleanupStack::PushL(cache);
       
  7613     
       
  7614     TMockLtsyPhoneBookData1<CArrayPtrSeg<CPhoneBookStoreEntry>*> storeCacheData(pbName, cache);
       
  7615     storeCacheData.SerialiseL(data3);	
       
  7616                   
       
  7617  	//-------------------------------------------------------------------------
       
  7618 	// TEST 1: completion by error value from CMmPhoneBookStoreTsy::CompletePBStoreInitializationL()
       
  7619  	//-------------------------------------------------------------------------
       
  7620 
       
  7621 	iMockLTSY.ExpectL(EMmTsyPhoneBookStoreInitIPC, data);	
       
  7622     iMockLTSY.CompleteL(EMmTsyPhoneBookStoreInitIPC, KErrGeneral, data2);
       
  7623 
       
  7624 	customAPI.NotifyPndCacheReady(requestStatus, name);
       
  7625 
       
  7626 	TInt ret = bookStore.Open(iPhone, pbName);
       
  7627 	ASSERT_EQUALS(KErrNone, ret);	    	
       
  7628 	CleanupClosePushL(bookStore);
       
  7629 
       
  7630     User::WaitForRequest(mockLtsyStatus);        	
       
  7631 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());	
       
  7632 	
       
  7633 	User::WaitForRequest(requestStatus);	
       
  7634 	ASSERT_EQUALS(KErrGeneral, requestStatus.Int());
       
  7635 	ASSERT_EQUALS(0, name.Compare(pbName));
       
  7636 	
       
  7637 	AssertMockLtsyStatusL();
       
  7638 
       
  7639 	CleanupStack::PopAndDestroy(1);
       
  7640 
       
  7641  	//-------------------------------------------------------------------------
       
  7642 	// TEST 2: completion by error value from CMmPhoneBookStoreTsy::CompleteCachingL()
       
  7643  	//-------------------------------------------------------------------------
       
  7644 
       
  7645 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
  7646 
       
  7647 	iMockLTSY.ExpectL(EMmTsyPhoneBookStoreInitIPC, data);	
       
  7648     iMockLTSY.CompleteL(EMmTsyPhoneBookStoreInitIPC, KErrNone, data2);
       
  7649 
       
  7650 	iMockLTSY.ExpectL(EMmTsyPhoneBookStoreCacheIPC, data);
       
  7651 	iMockLTSY.CompleteL(EMmTsyPhoneBookStoreCacheIPC, KErrGeneral, data3);
       
  7652 
       
  7653 	customAPI.NotifyPndCacheReady(requestStatus, name);
       
  7654 
       
  7655 	ret = bookStore.Open(iPhone, pbName);
       
  7656 	ASSERT_EQUALS(KErrNone, ret);	    	
       
  7657 	CleanupClosePushL(bookStore);
       
  7658 
       
  7659     User::WaitForRequest(mockLtsyStatus);        	
       
  7660 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());	
       
  7661 	
       
  7662 	User::WaitForRequest(requestStatus);	
       
  7663 	ASSERT_EQUALS(KErrGeneral, requestStatus.Int());
       
  7664 	ASSERT_EQUALS(0, name.Compare(pbName));
       
  7665 
       
  7666 	
       
  7667 	AssertMockLtsyStatusL();
       
  7668 
       
  7669 	CleanupStack::PopAndDestroy(7, this); 
       
  7670 
       
  7671 	}
       
  7672 
       
  7673 
       
  7674 
       
  7675 /**
       
  7676 @SYMTestCaseID BA-CTSY-CIPC-MCNPCR-0004
       
  7677 @SYMComponent  telephony_ctsy
       
  7678 @SYMTestCaseDesc Test support in CTSY for multiple client requests to RMmCustomAPI::NotifyPndCacheReady
       
  7679 @SYMTestPriority High
       
  7680 @SYMTestActions Invokes multiple client requests to RMmCustomAPI::NotifyPndCacheReady
       
  7681 @SYMTestExpectedResults Pass
       
  7682 @SYMTestType CT
       
  7683 */
       
  7684 void CCTsyCustomIPCFU::TestNotifyPndCacheReady0004L()
       
  7685 	{
       
  7686 
       
  7687 	OpenEtelServerL(EUseExtendedError);
       
  7688 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  7689 	OpenPhoneL();
       
  7690 
       
  7691 	RTelServer telServer2;
       
  7692 	TInt ret = telServer2.Connect();
       
  7693 	ASSERT_EQUALS(KErrNone, ret);
       
  7694 	CleanupClosePushL(telServer2);
       
  7695 
       
  7696 	RMobilePhone phone2;
       
  7697 	ret = phone2.Open(telServer2,KMmTsyPhoneName);
       
  7698 	ASSERT_EQUALS(KErrNone, ret);
       
  7699 	CleanupClosePushL(phone2);
       
  7700 
       
  7701 
       
  7702 	RMmCustomAPI customAPI;
       
  7703 	OpenCustomAPILC(customAPI, iPhone);
       
  7704 
       
  7705 	RMmCustomAPI customAPI2;
       
  7706 	OpenCustomAPILC(customAPI2, phone2, EFalse);
       
  7707 
       
  7708 	TRequestStatus requestStatus;
       
  7709 	TRequestStatus requestStatus2;
       
  7710 
       
  7711     TName name;
       
  7712     TName name2;
       
  7713 
       
  7714 	//-------------------------------------------------------------------------
       
  7715 	// Test A: Test multiple clients requesting RMmCustomAPI::NotifyPndCacheReady
       
  7716  	//-------------------------------------------------------------------------
       
  7717 
       
  7718 	customAPI.NotifyPndCacheReady(requestStatus, name);
       
  7719 	customAPI2.NotifyPndCacheReady(requestStatus2, name2);
       
  7720 
       
  7721 	RMobilePhoneBookStore bookStore;
       
  7722 	TName pbName(KETelIccAdnPhoneBook);	
       
  7723 
       
  7724     OpenPhoneBookStoreL(bookStore, pbName, iPhone);
       
  7725 	CleanupClosePushL(bookStore);
       
  7726 
       
  7727 	User::WaitForRequest(requestStatus);	
       
  7728 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
  7729 	ASSERT_EQUALS(0, name.Compare(pbName));
       
  7730 
       
  7731 	User::WaitForRequest(requestStatus2);	
       
  7732 	ASSERT_EQUALS(KErrNone, requestStatus2.Int());
       
  7733 	ASSERT_EQUALS(0, name2.Compare(pbName));
       
  7734 
       
  7735 	AssertMockLtsyStatusL();
       
  7736 
       
  7737 	CleanupStack::PopAndDestroy(6, this);
       
  7738 	}
       
  7739 
       
  7740 
       
  7741 /**
       
  7742 @SYMTestCaseID BA-CTSY-CIPC-MCGPCS-0001
       
  7743 @SYMComponent  telephony_ctsy
       
  7744 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::GetPndCacheStatus
       
  7745 @SYMTestPriority High
       
  7746 @SYMTestActions Invokes RMmCustomAPI::GetPndCacheStatus
       
  7747 @SYMTestExpectedResults Pass
       
  7748 @SYMTestType CT
       
  7749 */
       
  7750 void CCTsyCustomIPCFU::TestGetPndCacheStatus0001L()
       
  7751 	{
       
  7752 
       
  7753 	OpenEtelServerL(EUseExtendedError);
       
  7754 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  7755 	OpenPhoneL();
       
  7756 
       
  7757 	RMmCustomAPI customAPI;
       
  7758 	OpenCustomAPILC(customAPI, iPhone);
       
  7759 
       
  7760     TRequestStatus requestStatus;
       
  7761     RMmCustomAPI::TPndCacheStatus status;
       
  7762 
       
  7763 	// TEST C: Successful completion request of
       
  7764 	// RMmCustomAPI::GetPndCacheStatus when result is not cached.
       
  7765 	// Check KETelIccAdnPhoneBook 	
       
  7766 
       
  7767 	TName name;
       
  7768 	name.Copy(KETelIccAdnPhoneBook);
       
  7769 
       
  7770     customAPI.GetPndCacheStatus(requestStatus, status, name);
       
  7771 	
       
  7772 	User::WaitForRequest(requestStatus);	
       
  7773 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
  7774 
       
  7775     ASSERT_TRUE( RMmCustomAPI::ECacheNotReady == status);
       
  7776 
       
  7777 	AssertMockLtsyStatusL();		
       
  7778 
       
  7779 
       
  7780 	// TEST C2: Successful completion request of
       
  7781 	// RMmCustomAPI::GetPndCacheStatus when result is not cached.
       
  7782 	// Check KETelIccFdnPhoneBook 	
       
  7783 
       
  7784 	name.Copy(KETelIccFdnPhoneBook);
       
  7785 
       
  7786     customAPI.GetPndCacheStatus(requestStatus, status, name);
       
  7787 	
       
  7788 	User::WaitForRequest(requestStatus);	
       
  7789 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
  7790 
       
  7791     ASSERT_TRUE( RMmCustomAPI::ECacheNotReady == status);
       
  7792 
       
  7793 	AssertMockLtsyStatusL();	
       
  7794 
       
  7795 	// TEST C3: Successful completion request of
       
  7796 	// RMmCustomAPI::GetPndCacheStatus when result is not cached.
       
  7797 	// Check KETelIccBdnPhoneBook  	
       
  7798 
       
  7799 	name.Copy(KETelIccBdnPhoneBook );
       
  7800 
       
  7801     customAPI.GetPndCacheStatus(requestStatus, status, name);
       
  7802 	
       
  7803 	User::WaitForRequest(requestStatus);	
       
  7804 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
  7805 
       
  7806     ASSERT_TRUE( RMmCustomAPI::ECacheNotUsed == status);
       
  7807 
       
  7808 	AssertMockLtsyStatusL();	
       
  7809 
       
  7810 	// TEST C4: Successful completion request of
       
  7811 	// RMmCustomAPI::GetPndCacheStatus when result is not cached.
       
  7812 	// Check KETelIccSdnPhoneBook  	
       
  7813 
       
  7814 	name.Copy(KETelIccSdnPhoneBook );
       
  7815 
       
  7816     customAPI.GetPndCacheStatus(requestStatus, status, name);
       
  7817 	
       
  7818 	User::WaitForRequest(requestStatus);	
       
  7819 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
  7820 
       
  7821     ASSERT_TRUE( RMmCustomAPI::ECacheNotUsed == status);
       
  7822 
       
  7823 	AssertMockLtsyStatusL();	
       
  7824 
       
  7825 	// TEST C5: Successful completion request of
       
  7826 	// RMmCustomAPI::GetPndCacheStatus when result is not cached.
       
  7827 	// Check KETelIccVoiceMailBox   	
       
  7828 
       
  7829 	name.Copy(KETelIccVoiceMailBox  );
       
  7830 
       
  7831     customAPI.GetPndCacheStatus(requestStatus, status, name);
       
  7832 	
       
  7833 	User::WaitForRequest(requestStatus);	
       
  7834 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
  7835 
       
  7836     ASSERT_TRUE( RMmCustomAPI::ECacheNotUsed == status);
       
  7837 
       
  7838 	AssertMockLtsyStatusL();
       
  7839 	
       
  7840 	// TEST C6: Successful completion request of
       
  7841 	// RMmCustomAPI::GetPndCacheStatus.
       
  7842 	// Get cache ready.
       
  7843 	
       
  7844 	name.Copy(KETelIccAdnPhoneBook  );
       
  7845 	RMobilePhoneBookStore bookStore;
       
  7846 	
       
  7847     OpenPhoneBookStoreL(bookStore, name, iPhone);
       
  7848 	CleanupClosePushL(bookStore);
       
  7849 
       
  7850     customAPI.GetPndCacheStatus(requestStatus, status, name);
       
  7851 	
       
  7852 	User::WaitForRequest(requestStatus);	
       
  7853 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
  7854 
       
  7855     ASSERT_TRUE( RMmCustomAPI::ECacheReady == status);
       
  7856 
       
  7857 	AssertMockLtsyStatusL();
       
  7858 	CleanupStack::PopAndDestroy(3, this); 	
       
  7859 			
       
  7860 	}
       
  7861 
       
  7862 
       
  7863 
       
  7864 /**
       
  7865 @SYMTestCaseID BA-CTSY-CIPC-MCGPCS-0003
       
  7866 @SYMComponent  telephony_ctsy
       
  7867 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::GetPndCacheStatus with bad parameter data
       
  7868 @SYMTestPriority High
       
  7869 @SYMTestActions Invokes RMmCustomAPI::GetPndCacheStatus with bad parameter data
       
  7870 @SYMTestExpectedResults Pass
       
  7871 @SYMTestType CT
       
  7872 */
       
  7873 void CCTsyCustomIPCFU::TestGetPndCacheStatus0003L()
       
  7874 	{
       
  7875 
       
  7876 	OpenEtelServerL(EUseExtendedError);
       
  7877 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  7878 	OpenPhoneL();
       
  7879 
       
  7880 	RMmCustomAPI customAPI;
       
  7881 	OpenCustomAPILC(customAPI, iPhone);
       
  7882 
       
  7883     TRequestStatus requestStatus;
       
  7884     RMmCustomAPI::TPndCacheStatus status;
       
  7885 
       
  7886 	// Check non-existing phoneBookStore
       
  7887 
       
  7888 	_LIT(KBadName, "BadName");
       
  7889 
       
  7890 	TName name;
       
  7891 	name.Copy(KBadName);
       
  7892 
       
  7893     customAPI.GetPndCacheStatus(requestStatus, status, name);
       
  7894 	
       
  7895 	User::WaitForRequest(requestStatus);	
       
  7896 	ASSERT_EQUALS(KErrArgument, requestStatus.Int());
       
  7897 
       
  7898 	AssertMockLtsyStatusL();	
       
  7899 
       
  7900 	CleanupStack::PopAndDestroy(2, this); 				
       
  7901 
       
  7902 	}
       
  7903 
       
  7904 
       
  7905 
       
  7906 /**
       
  7907 @SYMTestCaseID BA-CTSY-CIPC-MCGON-0001
       
  7908 @SYMComponent  telephony_ctsy
       
  7909 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::GetOperatorName
       
  7910 @SYMTestPriority High
       
  7911 @SYMTestActions Invokes RMmCustomAPI::GetOperatorName
       
  7912 @SYMTestExpectedResults Pass
       
  7913 @SYMTestType CT
       
  7914 */
       
  7915 void CCTsyCustomIPCFU::TestGetOperatorName0001L()
       
  7916 	{
       
  7917 	
       
  7918 	OpenEtelServerL(EUseExtendedError);
       
  7919 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  7920 	OpenPhoneL();
       
  7921 
       
  7922 	RMmCustomAPI customAPI;
       
  7923 	OpenCustomAPILC(customAPI, iPhone);
       
  7924 
       
  7925     TRequestStatus requestStatus;
       
  7926     RMmCustomAPI::TOperatorNameInfo info;
       
  7927     	
       
  7928  	//-------------------------------------------------------------------------
       
  7929 	// TEST A: failure to dispatch request to LTSY
       
  7930  	//-------------------------------------------------------------------------
       
  7931 
       
  7932     iMockLTSY.ExpectL( ECustomGetOperatorNameIPC, KErrNotSupported);
       
  7933     
       
  7934     customAPI.GetOperatorName(requestStatus, info);
       
  7935 	
       
  7936 	User::WaitForRequest(requestStatus);	
       
  7937 	ASSERT_EQUALS(KErrNotSupported, requestStatus.Int());
       
  7938 
       
  7939 	AssertMockLtsyStatusL();
       
  7940 
       
  7941 	//-------------------------------------------------------------------------
       
  7942 	// TEST B: failure on completion of pending request from LTSY->CTSY
       
  7943  	//-------------------------------------------------------------------------
       
  7944 
       
  7945     iMockLTSY.ExpectL( ECustomGetOperatorNameIPC);
       
  7946 
       
  7947 	_LIT(KName, "OperName");
       
  7948 
       
  7949     RMmCustomAPI::TOperatorNameInfo compInfo;
       
  7950     compInfo.iType = RMmCustomAPI::EOperatorNameProgrammableLatin;
       
  7951     compInfo.iName.Copy(KName);
       
  7952     TPckg<RMmCustomAPI::TOperatorNameInfo> compInfoPckg(compInfo);
       
  7953 
       
  7954     iMockLTSY.CompleteL( ECustomGetOperatorNameIPC, KErrGeneral, compInfoPckg);
       
  7955 
       
  7956     customAPI.GetOperatorName(requestStatus, info);
       
  7957 	
       
  7958 	User::WaitForRequest(requestStatus);	
       
  7959 	ASSERT_EQUALS(KErrGeneral, requestStatus.Int());
       
  7960 
       
  7961 	AssertMockLtsyStatusL();
       
  7962 
       
  7963  	//-------------------------------------------------------------------------
       
  7964 	// TEST C: Successful completion request of
       
  7965 	// RMmCustomAPI::GetOperatorName when result is not cached.
       
  7966  	//-------------------------------------------------------------------------
       
  7967 
       
  7968     iMockLTSY.ExpectL( ECustomGetOperatorNameIPC);
       
  7969     iMockLTSY.CompleteL( ECustomGetOperatorNameIPC, KErrNone, compInfoPckg);
       
  7970 
       
  7971     customAPI.GetOperatorName(requestStatus, info);
       
  7972 	
       
  7973 	User::WaitForRequest(requestStatus);	
       
  7974 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
  7975 
       
  7976 	ASSERT_TRUE(compInfo.iType == info.iType);
       
  7977 	ASSERT_TRUE(0 == info.iName.Compare(compInfo.iName));
       
  7978 	
       
  7979 	AssertMockLtsyStatusL();
       
  7980 
       
  7981  	//-------------------------------------------------------------------------
       
  7982 	// TEST E: Unsolicited completion of RMmCustomAPI::GetOperatorName
       
  7983 	// from LTSY.
       
  7984  	//-------------------------------------------------------------------------
       
  7985 
       
  7986 	TRequestStatus mockLtsyStatus;
       
  7987 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
  7988 
       
  7989     iMockLTSY.CompleteL( ECustomGetOperatorNameIPC, KErrNone, compInfoPckg);
       
  7990 
       
  7991 	User::WaitForRequest(mockLtsyStatus);
       
  7992 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
  7993 
       
  7994 	AssertMockLtsyStatusL();
       
  7995 	CleanupStack::PopAndDestroy(2, this); 	
       
  7996 		
       
  7997 	}
       
  7998 
       
  7999 
       
  8000 /**
       
  8001 @SYMTestCaseID BA-CTSY-CIPC-MCGON-0002
       
  8002 @SYMComponent  telephony_ctsy
       
  8003 @SYMTestCaseDesc Test support in CTSY for cancelling of RMmCustomAPI::GetOperatorName
       
  8004 @SYMTestPriority High
       
  8005 @SYMTestActions Invokes cancelling of RMmCustomAPI::GetOperatorName
       
  8006 @SYMTestExpectedResults Pass
       
  8007 @SYMTestType CT
       
  8008 */
       
  8009 void CCTsyCustomIPCFU::TestGetOperatorName0002L()
       
  8010 	{
       
  8011 
       
  8012 	OpenEtelServerL(EUseExtendedError);
       
  8013 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  8014 	OpenPhoneL();
       
  8015 
       
  8016 	RMmCustomAPI customAPI;
       
  8017 	OpenCustomAPILC(customAPI, iPhone);
       
  8018 
       
  8019     TRequestStatus requestStatus;
       
  8020     RMmCustomAPI::TOperatorNameInfo info;
       
  8021 
       
  8022 	TRequestStatus mockLtsyStatus;
       
  8023 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
  8024 
       
  8025  	//-------------------------------------------------------------------------
       
  8026 	// Test cancelling of RMmCustomAPI::GetOperatorName
       
  8027  	//-------------------------------------------------------------------------
       
  8028 
       
  8029     iMockLTSY.ExpectL( ECustomGetOperatorNameIPC);
       
  8030     
       
  8031 	_LIT(KName, "OperName");
       
  8032 
       
  8033     RMmCustomAPI::TOperatorNameInfo compInfo;
       
  8034     compInfo.iType = RMmCustomAPI::EOperatorNameProgrammableLatin;
       
  8035     compInfo.iName.Copy(KName);
       
  8036     TPckg<RMmCustomAPI::TOperatorNameInfo> compInfoPckg(compInfo);
       
  8037     
       
  8038     iMockLTSY.CompleteL( ECustomGetOperatorNameIPC, KErrNone, compInfoPckg, 20);
       
  8039 
       
  8040     customAPI.GetOperatorName(requestStatus, info);
       
  8041 	
       
  8042 	customAPI.CancelAsyncRequest(ECustomGetOperatorNameIPC);
       
  8043 
       
  8044 	User::WaitForRequest(requestStatus);	
       
  8045 	ASSERT_EQUALS(KErrCancel, requestStatus.Int());
       
  8046 
       
  8047 	User::WaitForRequest(mockLtsyStatus);
       
  8048 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
  8049 
       
  8050 	AssertMockLtsyStatusL();
       
  8051 
       
  8052 	CleanupStack::PopAndDestroy(2); 	
       
  8053 	
       
  8054 	}
       
  8055 
       
  8056 
       
  8057 
       
  8058 /**
       
  8059 @SYMTestCaseID BA-CTSY-CIPC-MCGON-0004
       
  8060 @SYMComponent  telephony_ctsy
       
  8061 @SYMTestCaseDesc Test support in CTSY for multiple client requests to RMmCustomAPI::GetOperatorName
       
  8062 @SYMTestPriority High
       
  8063 @SYMTestActions Invokes multiple client requests to RMmCustomAPI::GetOperatorName
       
  8064 @SYMTestExpectedResults Pass
       
  8065 @SYMTestType CT
       
  8066 */
       
  8067 void CCTsyCustomIPCFU::TestGetOperatorName0004L()
       
  8068 	{
       
  8069 
       
  8070 	OpenEtelServerL(EUseExtendedError);
       
  8071 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  8072 	OpenPhoneL();
       
  8073 
       
  8074 	// Open second client
       
  8075 	RTelServer telServer2;
       
  8076 	TInt ret = telServer2.Connect();
       
  8077 	ASSERT_EQUALS(KErrNone, ret);
       
  8078 	CleanupClosePushL(telServer2);
       
  8079 
       
  8080 	RMobilePhone phone2;
       
  8081 	ret = phone2.Open(telServer2,KMmTsyPhoneName);
       
  8082 	ASSERT_EQUALS(KErrNone, ret);
       
  8083 	CleanupClosePushL(phone2);
       
  8084 
       
  8085 	RMmCustomAPI customAPI;
       
  8086 	OpenCustomAPILC(customAPI, iPhone);
       
  8087 
       
  8088 	RMmCustomAPI customAPI2;
       
  8089 	OpenCustomAPILC(customAPI2, phone2, EFalse);
       
  8090 
       
  8091     TRequestStatus requestStatus;
       
  8092     TRequestStatus requestStatus2;
       
  8093 
       
  8094     RMmCustomAPI::TOperatorNameInfo info;
       
  8095     RMmCustomAPI::TOperatorNameInfo info2;
       
  8096 	
       
  8097 	//-------------------------------------------------------------------------
       
  8098 	// Test A: Test multiple clients requesting RMmCustomAPI::GetOperatorName
       
  8099  	//-------------------------------------------------------------------------
       
  8100 
       
  8101 	_LIT(KName, "OperName");
       
  8102 
       
  8103     RMmCustomAPI::TOperatorNameInfo compInfo;
       
  8104     compInfo.iType = RMmCustomAPI::EOperatorNameProgrammableLatin;
       
  8105     compInfo.iName.Copy(KName);
       
  8106     TPckg<RMmCustomAPI::TOperatorNameInfo> compInfoPckg(compInfo);
       
  8107 
       
  8108     iMockLTSY.ExpectL( ECustomGetOperatorNameIPC, KErrNone);
       
  8109     iMockLTSY.CompleteL( ECustomGetOperatorNameIPC, KErrNone, compInfoPckg, 20);
       
  8110 
       
  8111     customAPI.GetOperatorName(requestStatus, info);
       
  8112 
       
  8113 	_LIT(KName2, "OperName2");
       
  8114 
       
  8115     RMmCustomAPI::TOperatorNameInfo compInfo2;
       
  8116     compInfo2.iType = RMmCustomAPI::EOperatorNameNitzShort;
       
  8117     compInfo2.iName.Copy(KName2);
       
  8118     TPckg<RMmCustomAPI::TOperatorNameInfo> compInfoPckg2(compInfo2);
       
  8119 
       
  8120     iMockLTSY.ExpectL( ECustomGetOperatorNameIPC, KErrNone);
       
  8121     iMockLTSY.CompleteL( ECustomGetOperatorNameIPC, KErrNone, compInfoPckg2);
       
  8122 
       
  8123     customAPI2.GetOperatorName(requestStatus2, info2);
       
  8124     
       
  8125 	User::WaitForRequest(requestStatus);	
       
  8126 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
  8127     
       
  8128 	ASSERT_TRUE(compInfo.iType == info.iType);
       
  8129 	ASSERT_TRUE(0 == info.iName.Compare(compInfo.iName));
       
  8130 	    
       
  8131 	User::WaitForRequest(requestStatus2);	
       
  8132 	ASSERT_EQUALS(KErrNone, requestStatus2.Int());
       
  8133 
       
  8134 	ASSERT_TRUE(compInfo2.iType == info2.iType);
       
  8135 	ASSERT_TRUE(0 == info2.iName.Compare(compInfo2.iName));
       
  8136 	
       
  8137 	AssertMockLtsyStatusL();
       
  8138 
       
  8139 	CleanupStack::PopAndDestroy(5, this);
       
  8140 
       
  8141 	}
       
  8142 
       
  8143 
       
  8144 /**
       
  8145 @SYMTestCaseID BA-CTSY-CIPC-MCGON-0005
       
  8146 @SYMComponent  telephony_ctsy
       
  8147 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::GetOperatorName with timeout
       
  8148 @SYMTestPriority High
       
  8149 @SYMTestActions Invokes RMmCustomAPI::GetOperatorName and tests for timeout
       
  8150 @SYMTestExpectedResults Pass
       
  8151 @SYMTestType CT
       
  8152 */
       
  8153 void CCTsyCustomIPCFU::TestGetOperatorName0005L()
       
  8154 	{
       
  8155 
       
  8156 	OpenEtelServerL(EUseExtendedError);
       
  8157 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  8158 	OpenPhoneL();
       
  8159 
       
  8160 	RMmCustomAPI customAPI;
       
  8161 	OpenCustomAPILC(customAPI, iPhone);
       
  8162 
       
  8163     TRequestStatus requestStatus;
       
  8164     RMmCustomAPI::TOperatorNameInfo info;
       
  8165 
       
  8166     iMockLTSY.ExpectL( ECustomGetOperatorNameIPC);
       
  8167 
       
  8168     customAPI.GetOperatorName(requestStatus, info);
       
  8169 	
       
  8170 	User::WaitForRequest(requestStatus);	
       
  8171 	ASSERT_EQUALS(KErrTimedOut, requestStatus.Int());
       
  8172 
       
  8173 	AssertMockLtsyStatusL();
       
  8174 
       
  8175 	CleanupStack::PopAndDestroy(2); 
       
  8176 
       
  8177 	}
       
  8178 
       
  8179 
       
  8180 /**
       
  8181 @SYMTestCaseID BA-CTSY-CIPC-MCGPOL-0001
       
  8182 @SYMComponent  telephony_ctsy
       
  8183 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::GetProgrammableOperatorLogo
       
  8184 @SYMTestPriority High
       
  8185 @SYMTestActions Invokes RMmCustomAPI::GetProgrammableOperatorLogo
       
  8186 @SYMTestExpectedResults Pass
       
  8187 @SYMTestType CT
       
  8188 */
       
  8189 void CCTsyCustomIPCFU::TestGetProgrammableOperatorLogo0001L()
       
  8190 	{
       
  8191 
       
  8192 	OpenEtelServerL(EUseExtendedError);
       
  8193 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  8194 	OpenPhoneL();
       
  8195 
       
  8196 	RMmCustomAPI customAPI;
       
  8197 	OpenCustomAPILC(customAPI, iPhone);
       
  8198 
       
  8199     RMmCustomAPI::TOperatorId oper;
       
  8200     RMmCustomAPI::TOperatorLogo logo;
       
  8201     
       
  8202     TBuf8<128> buf;
       
  8203     logo.iOperatorLogo = &buf;
       
  8204 
       
  8205 	oper.iMcc = 0;
       
  8206 	oper.iMnc = 0;    
       
  8207        
       
  8208 	RBuf8 expectData;
       
  8209 	CleanupClosePushL(expectData);
       
  8210 
       
  8211 	RBuf8 compData;
       
  8212 	CleanupClosePushL(compData);
       
  8213 	TRequestStatus requestStatus;
       
  8214 
       
  8215 	TMockLtsyData1< RMmCustomAPI::TOperatorId > ltsyData(oper);	
       
  8216 	ltsyData.SerialiseL(expectData);
       
  8217     	
       
  8218  	//-------------------------------------------------------------------------
       
  8219 	// TEST A: failure to dispatch request to LTSY
       
  8220  	//-------------------------------------------------------------------------
       
  8221 
       
  8222     iMockLTSY.ExpectL( ECustomGetProgrammableOperatorLogoIPC, expectData, KErrNotSupported);
       
  8223     
       
  8224     customAPI.GetProgrammableOperatorLogo(requestStatus, oper, logo);
       
  8225 	
       
  8226 	User::WaitForRequest(requestStatus);	
       
  8227 	ASSERT_EQUALS(KErrNotSupported, requestStatus.Int());
       
  8228 
       
  8229 	AssertMockLtsyStatusL();
       
  8230 
       
  8231 	//-------------------------------------------------------------------------
       
  8232 	// TEST B: failure on completion of pending request from LTSY->CTSY
       
  8233  	//-------------------------------------------------------------------------
       
  8234 
       
  8235     iMockLTSY.ExpectL( ECustomGetProgrammableOperatorLogoIPC, expectData);
       
  8236         
       
  8237     _LIT8(KBuf, "BufBufBufBufBuf");
       
  8238     TBuf8<KSerialNumberLength> compBuf(KBuf);
       
  8239     
       
  8240     RMmCustomAPI::TOperatorId operComp;
       
  8241     RMmCustomAPI::TOperatorLogo logoComp;
       
  8242 
       
  8243 	operComp.iMcc = 1;
       
  8244 	operComp.iMnc = 1;    
       
  8245 	
       
  8246 	logoComp.iLogoInfo.iLogoWidth = 2;
       
  8247 	logoComp.iLogoInfo.iLogoHeight = 2;
       
  8248 	logoComp.iLogoInfo.iCompression = 2;
       
  8249 	logoComp.iLogoInfo.iDepth = RMmCustomAPI::EBitPerPixel1;
       
  8250 	logoComp.iOperatorLogo = &compBuf;
       
  8251 
       
  8252 	TMockLtsyData2< RMmCustomAPI::TOperatorId, RMmCustomAPI::TOperatorLogo> ltsyData2(operComp, logoComp);
       
  8253     ltsyData2.SerialiseL(compData);       
       
  8254     
       
  8255     iMockLTSY.CompleteL( ECustomGetProgrammableOperatorLogoIPC, KErrGeneral, compData);
       
  8256 
       
  8257     customAPI.GetProgrammableOperatorLogo(requestStatus, oper, logo);
       
  8258 	
       
  8259 	User::WaitForRequest(requestStatus);	
       
  8260 	ASSERT_EQUALS(KErrGeneral, requestStatus.Int());
       
  8261 
       
  8262 	AssertMockLtsyStatusL();
       
  8263 
       
  8264  	//-------------------------------------------------------------------------
       
  8265 	// TEST C: Successful completion request of
       
  8266 	// RMmCustomAPI::GetProgrammableOperatorLogo when result is not cached.
       
  8267  	//-------------------------------------------------------------------------
       
  8268 
       
  8269   
       
  8270     iMockLTSY.ExpectL( ECustomGetProgrammableOperatorLogoIPC, expectData);
       
  8271     iMockLTSY.CompleteL( ECustomGetProgrammableOperatorLogoIPC, KErrNone, compData);
       
  8272 
       
  8273     customAPI.GetProgrammableOperatorLogo(requestStatus, oper, logo);
       
  8274 	
       
  8275 	User::WaitForRequest(requestStatus);	
       
  8276 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
  8277 
       
  8278 	ASSERT_TRUE(operComp.iMcc == oper.iMcc);
       
  8279 	ASSERT_TRUE(operComp.iMnc == oper.iMnc);
       
  8280 	ASSERT_TRUE(logoComp.iLogoInfo.iLogoWidth == logo.iLogoInfo.iLogoWidth);
       
  8281 	ASSERT_TRUE(logoComp.iLogoInfo.iLogoHeight == logo.iLogoInfo.iLogoHeight);
       
  8282 	ASSERT_TRUE(logoComp.iLogoInfo.iCompression == logo.iLogoInfo.iCompression);
       
  8283 	ASSERT_TRUE(logoComp.iLogoInfo.iDepth == logo.iLogoInfo.iDepth);
       
  8284 	ASSERT_TRUE(0 == logoComp.iOperatorLogo->Compare(*logo.iOperatorLogo));
       
  8285 
       
  8286 	AssertMockLtsyStatusL();
       
  8287 
       
  8288  	//-------------------------------------------------------------------------
       
  8289 	// TEST E: Unsolicited completion of RMmCustomAPI::GetProgrammableOperatorLogo
       
  8290 	// from LTSY.
       
  8291  	//-------------------------------------------------------------------------
       
  8292 
       
  8293 	TRequestStatus mockLtsyStatus;
       
  8294 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
  8295 
       
  8296     iMockLTSY.CompleteL( ECustomGetProgrammableOperatorLogoIPC, KErrNone, compData);
       
  8297 
       
  8298 	User::WaitForRequest(mockLtsyStatus);
       
  8299 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
  8300 
       
  8301 	AssertMockLtsyStatusL();
       
  8302 	CleanupStack::PopAndDestroy(4, this); 	
       
  8303 	
       
  8304 	}
       
  8305 
       
  8306 
       
  8307 /**
       
  8308 @SYMTestCaseID BA-CTSY-CIPC-MCGPOL-0002
       
  8309 @SYMComponent  telephony_ctsy
       
  8310 @SYMTestCaseDesc Test support in CTSY for cancelling of RMmCustomAPI::GetProgrammableOperatorLogo
       
  8311 @SYMTestPriority High
       
  8312 @SYMTestActions Invokes cancelling of RMmCustomAPI::GetProgrammableOperatorLogo
       
  8313 @SYMTestExpectedResults Pass
       
  8314 @SYMTestType CT
       
  8315 */
       
  8316 void CCTsyCustomIPCFU::TestGetProgrammableOperatorLogo0002L()
       
  8317 	{
       
  8318 
       
  8319 	OpenEtelServerL(EUseExtendedError);
       
  8320 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  8321 	OpenPhoneL();
       
  8322 
       
  8323 	RMmCustomAPI customAPI;
       
  8324 	OpenCustomAPILC(customAPI, iPhone);
       
  8325 
       
  8326     TRequestStatus requestStatus;
       
  8327    
       
  8328 	RBuf8 expectData;
       
  8329 	CleanupClosePushL(expectData);
       
  8330 
       
  8331 	RBuf8 compData;
       
  8332 	CleanupClosePushL(compData);
       
  8333 	
       
  8334     RMmCustomAPI::TOperatorId oper;
       
  8335     RMmCustomAPI::TOperatorLogo logo;
       
  8336 
       
  8337 	oper.iMcc = 0;
       
  8338 	oper.iMnc = 0;
       
  8339        
       
  8340 	TMockLtsyData1< RMmCustomAPI::TOperatorId > ltsyData(oper);	
       
  8341 	ltsyData.SerialiseL(expectData);
       
  8342     	
       
  8343  	//-------------------------------------------------------------------------
       
  8344 	// Test cancelling of RMmCustomAPI::GetProgrammableOperatorLogo
       
  8345  	//-------------------------------------------------------------------------
       
  8346 
       
  8347     iMockLTSY.ExpectL( ECustomGetProgrammableOperatorLogoIPC, expectData);
       
  8348 
       
  8349     customAPI.GetProgrammableOperatorLogo(requestStatus, oper, logo);
       
  8350 	
       
  8351 	customAPI.CancelAsyncRequest(ECustomGetProgrammableOperatorLogoIPC);
       
  8352 
       
  8353 	User::WaitForRequest(requestStatus);	
       
  8354 	ASSERT_EQUALS(KErrCancel, requestStatus.Int());
       
  8355 
       
  8356 	TRequestStatus mockLtsyStatus;
       
  8357 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
  8358 
       
  8359     RMmCustomAPI::TOperatorId operComp;
       
  8360     RMmCustomAPI::TOperatorLogo logoComp;
       
  8361     
       
  8362     _LIT8(KBuf, "BufBufBufBufBuf");
       
  8363     TBuf8<KSerialNumberLength> compBuf(KBuf);
       
  8364 	logoComp.iOperatorLogo = &compBuf;
       
  8365     
       
  8366     TMockLtsyData2< RMmCustomAPI::TOperatorId, RMmCustomAPI::TOperatorLogo> ltsyData2(operComp, logoComp);
       
  8367     ltsyData2.SerialiseL(compData);       
       
  8368 
       
  8369     iMockLTSY.CompleteL( ECustomGetProgrammableOperatorLogoIPC, KErrNone, compData);
       
  8370 
       
  8371 	User::WaitForRequest(mockLtsyStatus);
       
  8372 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
  8373 	
       
  8374 	AssertMockLtsyStatusL();
       
  8375 	CleanupStack::PopAndDestroy(4); 	
       
  8376 	}
       
  8377 
       
  8378 
       
  8379 
       
  8380 /**
       
  8381 @SYMTestCaseID BA-CTSY-CIPC-MCGPOL-0003
       
  8382 @SYMComponent  telephony_ctsy
       
  8383 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::GetProgrammableOperatorLogo with bad parameter data
       
  8384 @SYMTestPriority High
       
  8385 @SYMTestActions Invokes RMmCustomAPI::GetProgrammableOperatorLogo with bad parameter data
       
  8386 @SYMTestExpectedResults Pass
       
  8387 @SYMTestType CT
       
  8388 */
       
  8389 void CCTsyCustomIPCFU::TestGetProgrammableOperatorLogo0003L()
       
  8390 	{
       
  8391 	OpenEtelServerL(EUseExtendedError);
       
  8392 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  8393 	OpenPhoneL();
       
  8394 
       
  8395 	RMmCustomAPI customAPI;
       
  8396 	OpenCustomAPILC(customAPI, iPhone);
       
  8397 
       
  8398 
       
  8399 
       
  8400 	TRequestStatus requestStatus;
       
  8401     
       
  8402     RMmCustomAPI::TOperatorId oper;
       
  8403     RMmCustomAPI::TOperatorLogo logo;
       
  8404 
       
  8405 	oper.iMcc = 0;
       
  8406 	oper.iMnc = 0;    
       
  8407 
       
  8408     TBuf8<1> littleBuf;
       
  8409     logo.iOperatorLogo = &littleBuf;
       
  8410        
       
  8411 	RBuf8 expectData;
       
  8412 	CleanupClosePushL(expectData);
       
  8413 
       
  8414 	RBuf8 compData;
       
  8415 	CleanupClosePushL(compData);
       
  8416 	
       
  8417 	TMockLtsyData1< RMmCustomAPI::TOperatorId > ltsyData(oper);	
       
  8418 	ltsyData.SerialiseL(expectData);
       
  8419 
       
  8420     RMmCustomAPI::TOperatorId operComp;
       
  8421     RMmCustomAPI::TOperatorLogo logoComp;
       
  8422 
       
  8423     _LIT8(KBuf, "BufBufBufBufBuf");
       
  8424 	TBuf8<KSerialNumberLength> compBuf(KBuf);
       
  8425 
       
  8426 	operComp.iMcc = 1;
       
  8427 	operComp.iMnc = 1;    
       
  8428 	
       
  8429 	logoComp.iLogoInfo.iLogoWidth = 2;
       
  8430 	logoComp.iLogoInfo.iLogoHeight = 2;
       
  8431 	logoComp.iLogoInfo.iCompression = 2;
       
  8432 	logoComp.iLogoInfo.iDepth = RMmCustomAPI::EBitPerPixel1;
       
  8433 	logoComp.iOperatorLogo = &compBuf;
       
  8434 
       
  8435 	TMockLtsyData2< RMmCustomAPI::TOperatorId, RMmCustomAPI::TOperatorLogo> ltsyData2(operComp, logoComp);
       
  8436     ltsyData2.SerialiseL(compData);       
       
  8437     
       
  8438     iMockLTSY.ExpectL( ECustomGetProgrammableOperatorLogoIPC, expectData);
       
  8439     iMockLTSY.CompleteL( ECustomGetProgrammableOperatorLogoIPC, KErrNone, compData);
       
  8440 
       
  8441     customAPI.GetProgrammableOperatorLogo(requestStatus, oper, logo);
       
  8442 	
       
  8443 	User::WaitForRequest(requestStatus);	
       
  8444 	ASSERT_EQUALS(KErrTooBig, requestStatus.Int());
       
  8445 
       
  8446 	AssertMockLtsyStatusL();
       
  8447 
       
  8448 	CleanupStack::PopAndDestroy(4, this); 		
       
  8449 	}
       
  8450 
       
  8451 
       
  8452 
       
  8453 
       
  8454 /**
       
  8455 @SYMTestCaseID BA-CTSY-CIPC-MCGPOL-0004
       
  8456 @SYMComponent  telephony_ctsy
       
  8457 @SYMTestCaseDesc Test support in CTSY for multiple client requests to RMmCustomAPI::GetProgrammableOperatorLogo
       
  8458 @SYMTestPriority High
       
  8459 @SYMTestActions Invokes multiple client requests to RMmCustomAPI::GetProgrammableOperatorLogo
       
  8460 @SYMTestExpectedResults Pass
       
  8461 @SYMTestType CT
       
  8462 */
       
  8463 void CCTsyCustomIPCFU::TestGetProgrammableOperatorLogo0004L()
       
  8464 	{
       
  8465 					
       
  8466 	OpenEtelServerL(EUseExtendedError);
       
  8467 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  8468 	OpenPhoneL();
       
  8469 
       
  8470 	// Open second client
       
  8471 	RTelServer telServer2;
       
  8472 	TInt ret = telServer2.Connect();
       
  8473 	ASSERT_EQUALS(KErrNone, ret);
       
  8474 	CleanupClosePushL(telServer2);
       
  8475 
       
  8476 	RMobilePhone phone2;
       
  8477 	ret = phone2.Open(telServer2,KMmTsyPhoneName);
       
  8478 	ASSERT_EQUALS(KErrNone, ret);
       
  8479 	CleanupClosePushL(phone2);
       
  8480 
       
  8481 	RMmCustomAPI customAPI;
       
  8482 	OpenCustomAPILC(customAPI, iPhone);
       
  8483 
       
  8484 	RMmCustomAPI customAPI2;
       
  8485 	OpenCustomAPILC(customAPI2, phone2, EFalse);
       
  8486   
       
  8487     TRequestStatus requestStatus;
       
  8488     TRequestStatus requestStatus2;
       
  8489 
       
  8490     RMmCustomAPI::TOperatorId oper;
       
  8491     RMmCustomAPI::TOperatorLogo logo;
       
  8492    
       
  8493 	oper.iMcc = 0;
       
  8494 	oper.iMnc = 0;
       
  8495    
       
  8496     RMmCustomAPI::TOperatorId oper2;
       
  8497     RMmCustomAPI::TOperatorLogo logo2;
       
  8498 
       
  8499 	oper2.iMcc = 0;
       
  8500 	oper2.iMnc = 0;
       
  8501    
       
  8502 	RBuf8 expectData;
       
  8503 	CleanupClosePushL(expectData);
       
  8504 
       
  8505 	RBuf8 compData;
       
  8506 	CleanupClosePushL(compData);
       
  8507 	
       
  8508 	TMockLtsyData1< RMmCustomAPI::TOperatorId > ltsyData(oper);	
       
  8509 	ltsyData.SerialiseL(expectData);
       
  8510     	
       
  8511     iMockLTSY.ExpectL( ECustomGetProgrammableOperatorLogoIPC, expectData);
       
  8512 
       
  8513     RMmCustomAPI::TOperatorId operComp;
       
  8514     RMmCustomAPI::TOperatorLogo logoComp;
       
  8515 
       
  8516     _LIT8(KBuf, "BufBufBufBufBuf");
       
  8517 	TBuf8<KSerialNumberLength> compBuf(KBuf);
       
  8518 
       
  8519 	operComp.iMcc = 1;
       
  8520 	operComp.iMnc = 1;    
       
  8521 	
       
  8522 	logoComp.iLogoInfo.iLogoWidth = 2;
       
  8523 	logoComp.iLogoInfo.iLogoHeight = 2;
       
  8524 	logoComp.iLogoInfo.iCompression = 2;
       
  8525 	logoComp.iLogoInfo.iDepth = RMmCustomAPI::EBitPerPixel1;
       
  8526 	logoComp.iOperatorLogo = &compBuf;
       
  8527 
       
  8528 	TMockLtsyData2< RMmCustomAPI::TOperatorId, RMmCustomAPI::TOperatorLogo> ltsyData2(operComp, logoComp);
       
  8529     ltsyData2.SerialiseL(compData);       
       
  8530     
       
  8531     iMockLTSY.CompleteL( ECustomGetProgrammableOperatorLogoIPC, KErrNone, compData, 20);
       
  8532 
       
  8533     
       
  8534 	customAPI.GetProgrammableOperatorLogo(requestStatus, oper, logo);
       
  8535     customAPI2.GetProgrammableOperatorLogo(requestStatus2, oper2, logo2);
       
  8536 
       
  8537 	User::WaitForRequest(requestStatus);	
       
  8538 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
  8539 
       
  8540 	User::WaitForRequest(requestStatus2);	
       
  8541 	ASSERT_EQUALS(KErrServerBusy, requestStatus2.Int());
       
  8542 
       
  8543 	AssertMockLtsyStatusL();
       
  8544 
       
  8545 	CleanupStack::PopAndDestroy(7, this);
       
  8546 
       
  8547 	}
       
  8548 
       
  8549 
       
  8550 /**
       
  8551 @SYMTestCaseID BA-CTSY-CIPC-MCGPOL-0005
       
  8552 @SYMComponent  telephony_ctsy
       
  8553 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::GetProgrammableOperatorLogo with timeout
       
  8554 @SYMTestPriority High
       
  8555 @SYMTestActions Invokes RMmCustomAPI::GetProgrammableOperatorLogo and tests for timeout
       
  8556 @SYMTestExpectedResults Pass
       
  8557 @SYMTestType CT
       
  8558 */
       
  8559 void CCTsyCustomIPCFU::TestGetProgrammableOperatorLogo0005L()
       
  8560 	{
       
  8561 
       
  8562 	OpenEtelServerL(EUseExtendedError);
       
  8563 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  8564 	OpenPhoneL();
       
  8565 
       
  8566 	RMmCustomAPI customAPI;
       
  8567 	OpenCustomAPILC(customAPI, iPhone);
       
  8568 
       
  8569     TRequestStatus requestStatus;
       
  8570 
       
  8571     RMmCustomAPI::TOperatorId oper;
       
  8572     RMmCustomAPI::TOperatorLogo logo;   
       
  8573    
       
  8574 	RBuf8 expectData;
       
  8575 	CleanupClosePushL(expectData);
       
  8576 
       
  8577 	TMockLtsyData1< RMmCustomAPI::TOperatorId > ltsyData(oper);	
       
  8578 	ltsyData.SerialiseL(expectData);
       
  8579     	
       
  8580     iMockLTSY.ExpectL( ECustomGetProgrammableOperatorLogoIPC, expectData);
       
  8581 
       
  8582     customAPI.GetProgrammableOperatorLogo(requestStatus, oper, logo);
       
  8583 
       
  8584 	User::WaitForRequest(requestStatus);	
       
  8585 	ASSERT_EQUALS(KErrTimedOut, requestStatus.Int());
       
  8586 	
       
  8587 	AssertMockLtsyStatusL();
       
  8588 	CleanupStack::PopAndDestroy(3); 
       
  8589 	
       
  8590 	}
       
  8591 
       
  8592 
       
  8593 /**
       
  8594 @SYMTestCaseID BA-CTSY-CIPC-MCNPOLC-0001
       
  8595 @SYMComponent  telephony_ctsy
       
  8596 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::NotifyProgrammableOperatorLogoChange
       
  8597 @SYMTestPriority High
       
  8598 @SYMTestActions Invokes RMmCustomAPI::NotifyProgrammableOperatorLogoChange
       
  8599 @SYMTestExpectedResults Pass
       
  8600 @SYMTestType CT
       
  8601 */
       
  8602 void CCTsyCustomIPCFU::TestNotifyProgrammableOperatorLogoChange0001L()
       
  8603 	{
       
  8604 
       
  8605 	OpenEtelServerL(EUseExtendedError);
       
  8606 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  8607 	OpenPhoneL();
       
  8608 
       
  8609 	RMmCustomAPI customAPI;
       
  8610 	OpenCustomAPILC(customAPI, iPhone);
       
  8611 
       
  8612     TRequestStatus requestStatus;
       
  8613 
       
  8614 	RMmCustomAPI::TOperatorId operatorId;
       
  8615 	operatorId.iMcc = 0;
       
  8616 	operatorId.iMnc = 0;
       
  8617     
       
  8618     // tests for RMmCustomAPI::NotifyProgrammableOperatorLogoChange should be written when ECustomNotifyProgrammableOperatorLogoChangeIPC 
       
  8619     // would be proccessed.
       
  8620 
       
  8621 	customAPI.NotifyProgrammableOperatorLogoChange( requestStatus, operatorId);
       
  8622 
       
  8623 	User::WaitForRequest(requestStatus);	
       
  8624 	ASSERT_EQUALS(KErrNotSupported, requestStatus.Int());
       
  8625 
       
  8626 	AssertMockLtsyStatusL();
       
  8627 	CleanupStack::PopAndDestroy(2, this); 
       
  8628 	
       
  8629 	}
       
  8630 
       
  8631 
       
  8632 /**
       
  8633 @SYMTestCaseID BA-CTSY-CIPC-MCNSNE-0001
       
  8634 @SYMComponent  telephony_ctsy
       
  8635 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::NotifySsNetworkEvent
       
  8636 @SYMTestPriority High
       
  8637 @SYMTestActions Invokes RMmCustomAPI::NotifySsNetworkEvent
       
  8638 @SYMTestExpectedResults Pass
       
  8639 @SYMTestType CT
       
  8640 */
       
  8641 void CCTsyCustomIPCFU::TestNotifySsNetworkEvent0001L()
       
  8642 	{
       
  8643 
       
  8644 	OpenEtelServerL(EUseExtendedError);
       
  8645 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  8646 	OpenPhoneL();
       
  8647 
       
  8648 	RMmCustomAPI customAPI;
       
  8649 	OpenCustomAPILC(customAPI, iPhone);
       
  8650 
       
  8651 	RBuf8 data;
       
  8652 	CleanupClosePushL(data);
       
  8653 
       
  8654 	TRequestStatus requestStatus;
       
  8655 
       
  8656     RMmCustomAPI::TSsTypeAndMode ssTypeAndMode;
       
  8657     RMmCustomAPI::TSsInfo ssInfo;
       
  8658 
       
  8659     RMmCustomAPI::TSsTypeAndMode ssTypeAndModeComp;
       
  8660     RMmCustomAPI::TSsInfo ssInfoComp;
       
  8661 
       
  8662 	// fill with random data
       
  8663 	_LIT(KRemote, "Remote");
       
  8664 
       
  8665 	ssTypeAndModeComp.iSsType = RMmCustomAPI::ESsForwNoReply;
       
  8666 	ssTypeAndModeComp.iSsMode = RMmCustomAPI::ESsModeActive;
       
  8667 	
       
  8668 	ssInfoComp.iForwMode = RMmCustomAPI::ESsOutCallForwToC;
       
  8669 	ssInfoComp.iCallWait = ETrue;
       
  8670 	ssInfoComp.iCallHold = RMmCustomAPI::ESsHoldResume;
       
  8671 	ssInfoComp.iConfInd = ETrue;
       
  8672 	ssInfoComp.iCugIndex = 15;
       
  8673 	ssInfoComp.iClirSuppReject = EFalse;
       
  8674 	ssInfoComp.iEctCallState = RMmCustomAPI::ESsEctAlerting;
       
  8675 	ssInfoComp.iChoice = RMmCustomAPI::ESsPresRestrictedAddress;
       
  8676 	ssInfoComp.iRemoteAddress.Copy(KRemote);
       
  8677            
       
  8678 	TMockLtsyData2< RMmCustomAPI::TSsTypeAndMode, RMmCustomAPI::TSsInfo > 
       
  8679 						ltsyData(ssTypeAndModeComp, ssInfoComp);	
       
  8680     ltsyData.SerialiseL(data); 
       
  8681 
       
  8682 
       
  8683  	//-------------------------------------------------------------------------
       
  8684 	// TEST E: Unsolicited completion of RMmCustomAPI::NotifySsNetworkEvent
       
  8685 	// from LTSY.
       
  8686  	//-------------------------------------------------------------------------
       
  8687 
       
  8688 	TRequestStatus mockLtsyStatus;
       
  8689 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
  8690 
       
  8691     iMockLTSY.CompleteL(ECustomNotifySsNetworkEventIPC, KErrNone, data);        	
       
  8692 
       
  8693 	User::WaitForRequest(mockLtsyStatus);
       
  8694 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
  8695 
       
  8696 	AssertMockLtsyStatusL();
       
  8697 	
       
  8698 	//-------------------------------------------------------------------------
       
  8699 	// TEST B: failure on completion of pending request from LTSY->CTSY
       
  8700  	//-------------------------------------------------------------------------
       
  8701 
       
  8702 	customAPI.NotifySsNetworkEvent(requestStatus, ssTypeAndMode, ssInfo);
       
  8703 
       
  8704     iMockLTSY.CompleteL(ECustomNotifySsNetworkEventIPC, KErrGeneral, data);        	
       
  8705 
       
  8706 	User::WaitForRequest(requestStatus);	
       
  8707 	ASSERT_EQUALS(KErrGeneral, requestStatus.Int());
       
  8708 	
       
  8709 	AssertMockLtsyStatusL();	
       
  8710 
       
  8711  	//-------------------------------------------------------------------------
       
  8712 	// TEST C: Successful completion request of
       
  8713 	// RMmCustomAPI::NotifySsNetworkEvent when result is not cached.
       
  8714  	//-------------------------------------------------------------------------
       
  8715 
       
  8716 	customAPI.NotifySsNetworkEvent(requestStatus, ssTypeAndMode, ssInfo);
       
  8717 
       
  8718     iMockLTSY.CompleteL(ECustomNotifySsNetworkEventIPC, KErrNone, data);        	
       
  8719 
       
  8720 	User::WaitForRequest(requestStatus);	
       
  8721 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
  8722 
       
  8723 	ASSERT_TRUE(ssTypeAndModeComp.iSsType == ssTypeAndMode.iSsType);
       
  8724 	ASSERT_TRUE(ssTypeAndModeComp.iSsMode == ssTypeAndMode.iSsMode);
       
  8725 	ASSERT_TRUE(ssInfoComp.iForwMode == ssInfo.iForwMode);
       
  8726 	ASSERT_TRUE(ssInfoComp.iCallWait == ssInfo.iCallWait);
       
  8727 	ASSERT_TRUE(ssInfoComp.iCallHold == ssInfo.iCallHold);
       
  8728 	ASSERT_TRUE(ssInfoComp.iConfInd == ssInfo.iConfInd);
       
  8729 	ASSERT_TRUE(ssInfoComp.iCugIndex == ssInfo.iCugIndex);
       
  8730 	ASSERT_TRUE(ssInfoComp.iClirSuppReject == ssInfo.iClirSuppReject);
       
  8731 	ASSERT_TRUE(ssInfoComp.iEctCallState == ssInfo.iEctCallState);
       
  8732 	ASSERT_TRUE(ssInfoComp.iChoice == ssInfo.iChoice);
       
  8733 	ASSERT_TRUE(0 == ssInfo.iRemoteAddress.Compare(ssInfoComp.iRemoteAddress));
       
  8734 	
       
  8735 	AssertMockLtsyStatusL();	
       
  8736 
       
  8737 	CleanupStack::PopAndDestroy(3, this);
       
  8738 	
       
  8739 	}
       
  8740 
       
  8741 
       
  8742 /**
       
  8743 @SYMTestCaseID BA-CTSY-CIPC-MCNSNE-0002
       
  8744 @SYMComponent  telephony_ctsy
       
  8745 @SYMTestCaseDesc Test support in CTSY for cancelling of RMmCustomAPI::NotifySsNetworkEvent
       
  8746 @SYMTestPriority High
       
  8747 @SYMTestActions Invokes cancelling of RMmCustomAPI::NotifySsNetworkEvent
       
  8748 @SYMTestExpectedResults Pass
       
  8749 @SYMTestType CT
       
  8750 */
       
  8751 void CCTsyCustomIPCFU::TestNotifySsNetworkEvent0002L()
       
  8752 	{
       
  8753 
       
  8754 	OpenEtelServerL(EUseExtendedError);
       
  8755 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  8756 	OpenPhoneL();
       
  8757 
       
  8758 	RMmCustomAPI customAPI;
       
  8759 	OpenCustomAPILC(customAPI, iPhone);
       
  8760 
       
  8761 	TRequestStatus mockLtsyStatus;
       
  8762 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
  8763 
       
  8764 	RBuf8 data;
       
  8765 	CleanupClosePushL(data);
       
  8766 
       
  8767 	TRequestStatus requestStatus;
       
  8768 
       
  8769     RMmCustomAPI::TSsTypeAndMode ssTypeAndMode;
       
  8770     RMmCustomAPI::TSsInfo ssInfo;
       
  8771 
       
  8772     RMmCustomAPI::TSsTypeAndMode ssTypeAndModeComp;
       
  8773     RMmCustomAPI::TSsInfo ssInfoComp;
       
  8774           
       
  8775 	TMockLtsyData2< RMmCustomAPI::TSsTypeAndMode, RMmCustomAPI::TSsInfo > 
       
  8776 						ltsyData(ssTypeAndModeComp, ssInfoComp);	
       
  8777     ltsyData.SerialiseL(data); 
       
  8778 	
       
  8779  	//-------------------------------------------------------------------------
       
  8780 	// Test cancelling of RMmCustomAPI::NotifySsNetworkEvent
       
  8781  	//-------------------------------------------------------------------------
       
  8782 	customAPI.NotifySsNetworkEvent(requestStatus, ssTypeAndMode, ssInfo);
       
  8783 	
       
  8784 	customAPI.CancelAsyncRequest(ECustomNotifySsNetworkEventIPC);
       
  8785 
       
  8786     iMockLTSY.CompleteL(ECustomNotifySsNetworkEventIPC, KErrNone, data);        	
       
  8787 
       
  8788 	User::WaitForRequest(mockLtsyStatus);
       
  8789 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
  8790 
       
  8791 	User::WaitForRequest(requestStatus);
       
  8792 	ASSERT_EQUALS(KErrCancel, requestStatus.Int());	
       
  8793 	
       
  8794 	AssertMockLtsyStatusL();	
       
  8795 	
       
  8796 	CleanupStack::PopAndDestroy(3); 
       
  8797 
       
  8798 	}
       
  8799 
       
  8800 
       
  8801 /**
       
  8802 @SYMTestCaseID BA-CTSY-CIPC-MCNSNE-0004
       
  8803 @SYMComponent  telephony_ctsy
       
  8804 @SYMTestCaseDesc Test support in CTSY for multiple client requests to RMmCustomAPI::NotifySsNetworkEvent
       
  8805 @SYMTestPriority High
       
  8806 @SYMTestActions Invokes multiple client requests to RMmCustomAPI::NotifySsNetworkEvent
       
  8807 @SYMTestExpectedResults Pass
       
  8808 @SYMTestType CT
       
  8809 */
       
  8810 void CCTsyCustomIPCFU::TestNotifySsNetworkEvent0004L()
       
  8811 	{
       
  8812 					
       
  8813 	OpenEtelServerL(EUseExtendedError);
       
  8814 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  8815 	OpenPhoneL();
       
  8816 
       
  8817 	// Open second client
       
  8818 	RTelServer telServer2;
       
  8819 	TInt ret = telServer2.Connect();
       
  8820 	ASSERT_EQUALS(KErrNone, ret);
       
  8821 	CleanupClosePushL(telServer2);
       
  8822 
       
  8823 	RMobilePhone phone2;
       
  8824 	ret = phone2.Open(telServer2,KMmTsyPhoneName);
       
  8825 	ASSERT_EQUALS(KErrNone, ret);
       
  8826 	CleanupClosePushL(phone2);
       
  8827 
       
  8828 	RMmCustomAPI customAPI;
       
  8829 	OpenCustomAPILC(customAPI, iPhone);
       
  8830 
       
  8831 	RMmCustomAPI customAPI2;
       
  8832 	OpenCustomAPILC(customAPI2, phone2, EFalse);
       
  8833 
       
  8834 	RBuf8 data;
       
  8835 	CleanupClosePushL(data);
       
  8836 
       
  8837 	TRequestStatus requestStatus;
       
  8838 	TRequestStatus requestStatus2;
       
  8839 
       
  8840     RMmCustomAPI::TSsTypeAndMode ssTypeAndMode;
       
  8841     RMmCustomAPI::TSsInfo ssInfo;
       
  8842 
       
  8843     RMmCustomAPI::TSsTypeAndMode ssTypeAndMode2;
       
  8844     RMmCustomAPI::TSsInfo ssInfo2;
       
  8845 	
       
  8846 	//-------------------------------------------------------------------------
       
  8847 	// Test A: Test multiple clients requesting RMmCustomAPI::NotifySsNetworkEvent
       
  8848  	//-------------------------------------------------------------------------
       
  8849 	customAPI.NotifySsNetworkEvent(requestStatus, ssTypeAndMode, ssInfo);
       
  8850 	customAPI2.NotifySsNetworkEvent(requestStatus2, ssTypeAndMode2, ssInfo2);
       
  8851 
       
  8852 	// fill with random data
       
  8853 	_LIT(KRemote, "Remote");
       
  8854 
       
  8855     RMmCustomAPI::TSsTypeAndMode ssTypeAndModeComp;
       
  8856     RMmCustomAPI::TSsInfo ssInfoComp;
       
  8857 
       
  8858 	ssTypeAndModeComp.iSsType = RMmCustomAPI::ESsForwNoReply;
       
  8859 	ssTypeAndModeComp.iSsMode = RMmCustomAPI::ESsModeActive;
       
  8860 	
       
  8861 	ssInfoComp.iForwMode = RMmCustomAPI::ESsOutCallForwToC;
       
  8862 	ssInfoComp.iCallWait = ETrue;
       
  8863 	ssInfoComp.iCallHold = RMmCustomAPI::ESsHoldResume;
       
  8864 	ssInfoComp.iConfInd = ETrue;
       
  8865 	ssInfoComp.iCugIndex = 15;
       
  8866 	ssInfoComp.iClirSuppReject = EFalse;
       
  8867 	ssInfoComp.iEctCallState = RMmCustomAPI::ESsEctAlerting;
       
  8868 	ssInfoComp.iChoice = RMmCustomAPI::ESsPresRestrictedAddress;
       
  8869 	ssInfoComp.iRemoteAddress.Copy(KRemote);
       
  8870            
       
  8871 	TMockLtsyData2< RMmCustomAPI::TSsTypeAndMode, RMmCustomAPI::TSsInfo > 
       
  8872 						ltsyData(ssTypeAndModeComp, ssInfoComp);	
       
  8873     ltsyData.SerialiseL(data); 
       
  8874 
       
  8875     iMockLTSY.CompleteL(ECustomNotifySsNetworkEventIPC, KErrNone, data);        	
       
  8876 
       
  8877 	User::WaitForRequest(requestStatus);	
       
  8878 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
  8879 
       
  8880 	ASSERT_TRUE(ssTypeAndModeComp.iSsType == ssTypeAndMode.iSsType);
       
  8881 	ASSERT_TRUE(ssTypeAndModeComp.iSsMode == ssTypeAndMode.iSsMode);
       
  8882 	ASSERT_TRUE(ssInfoComp.iForwMode == ssInfo.iForwMode);
       
  8883 	ASSERT_TRUE(ssInfoComp.iCallWait == ssInfo.iCallWait);
       
  8884 	ASSERT_TRUE(ssInfoComp.iCallHold == ssInfo.iCallHold);
       
  8885 	ASSERT_TRUE(ssInfoComp.iConfInd == ssInfo.iConfInd);
       
  8886 	ASSERT_TRUE(ssInfoComp.iCugIndex == ssInfo.iCugIndex);
       
  8887 	ASSERT_TRUE(ssInfoComp.iClirSuppReject == ssInfo.iClirSuppReject);
       
  8888 	ASSERT_TRUE(ssInfoComp.iEctCallState == ssInfo.iEctCallState);
       
  8889 	ASSERT_TRUE(ssInfoComp.iChoice == ssInfo.iChoice);
       
  8890 	ASSERT_TRUE(0 == ssInfo.iRemoteAddress.Compare(ssInfoComp.iRemoteAddress));
       
  8891 	
       
  8892 	User::WaitForRequest(requestStatus2);	
       
  8893 	ASSERT_EQUALS(KErrNone, requestStatus2.Int());
       
  8894 
       
  8895 	ASSERT_TRUE(ssTypeAndModeComp.iSsType == ssTypeAndMode2.iSsType);
       
  8896 	ASSERT_TRUE(ssTypeAndModeComp.iSsMode == ssTypeAndMode2.iSsMode);
       
  8897 	ASSERT_TRUE(ssInfoComp.iForwMode == ssInfo2.iForwMode);
       
  8898 	ASSERT_TRUE(ssInfoComp.iCallWait == ssInfo2.iCallWait);
       
  8899 	ASSERT_TRUE(ssInfoComp.iCallHold == ssInfo2.iCallHold);
       
  8900 	ASSERT_TRUE(ssInfoComp.iConfInd == ssInfo2.iConfInd);
       
  8901 	ASSERT_TRUE(ssInfoComp.iCugIndex == ssInfo2.iCugIndex);
       
  8902 	ASSERT_TRUE(ssInfoComp.iClirSuppReject == ssInfo2.iClirSuppReject);
       
  8903 	ASSERT_TRUE(ssInfoComp.iEctCallState == ssInfo2.iEctCallState);
       
  8904 	ASSERT_TRUE(ssInfoComp.iChoice == ssInfo2.iChoice);
       
  8905 	ASSERT_TRUE(0 == ssInfo2.iRemoteAddress.Compare(ssInfoComp.iRemoteAddress));	
       
  8906 	AssertMockLtsyStatusL();	
       
  8907 
       
  8908 	CleanupStack::PopAndDestroy(6, this); 
       
  8909 	
       
  8910 	}
       
  8911 
       
  8912 
       
  8913 /**
       
  8914 @SYMTestCaseID BA-CTSY-CIPC-MCCUS-0001
       
  8915 @SYMComponent  telephony_ctsy
       
  8916 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::CancelUssdSession
       
  8917 @SYMTestPriority High
       
  8918 @SYMTestActions Invokes RMmCustomAPI::CancelUssdSession
       
  8919 @SYMTestExpectedResults Pass
       
  8920 @SYMTestType CT
       
  8921 */
       
  8922 void CCTsyCustomIPCFU::TestCancelUssdSession0001L()
       
  8923 	{
       
  8924 
       
  8925 	OpenEtelServerL(EUseExtendedError);
       
  8926 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  8927 	OpenPhoneL();
       
  8928 
       
  8929 	RMmCustomAPI customAPI;
       
  8930 	OpenCustomAPILC(customAPI, iPhone);
       
  8931 
       
  8932     TRequestStatus requestStatus;
       
  8933     
       
  8934     // tests for RMmCustomAPI::CancelUssdSession should be written when ECustomCancelUssdSessionIPC 
       
  8935     // would be proccessed.
       
  8936 
       
  8937 	customAPI.CancelUssdSession( requestStatus);
       
  8938 
       
  8939 	User::WaitForRequest(requestStatus);	
       
  8940 	ASSERT_EQUALS(KErrNotSupported, requestStatus.Int());
       
  8941 
       
  8942 	AssertMockLtsyStatusL();
       
  8943 	CleanupStack::PopAndDestroy(2, this); 
       
  8944 	
       
  8945 	}
       
  8946 
       
  8947 
       
  8948 /**
       
  8949 @SYMTestCaseID BA-CTSY-CIPC-MCSRCN2-0001
       
  8950 @SYMComponent  telephony_ctsy
       
  8951 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::SatRefreshCompleteNotification
       
  8952 @SYMTestPriority High
       
  8953 @SYMTestActions Invokes RMmCustomAPI::SatRefreshCompleteNotification
       
  8954 @SYMTestExpectedResults Pass
       
  8955 @SYMTestType CT
       
  8956 */
       
  8957 void CCTsyCustomIPCFU::TestSatRefreshCompleteNotification0001L()
       
  8958 	{
       
  8959 
       
  8960 	OpenEtelServerL(EUseExtendedError);
       
  8961 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  8962 	OpenPhoneL();
       
  8963 
       
  8964 	RMmCustomAPI customAPI;
       
  8965 	OpenCustomAPILC(customAPI, iPhone);
       
  8966 
       
  8967     TRequestStatus requestStatus;
       
  8968 	
       
  8969  	//-------------------------------------------------------------------------
       
  8970 	// TEST E: Unsolicited completion of RMmCustomAPI::SatRefreshCompleteNotification
       
  8971 	// from LTSY.
       
  8972 	// The test comes first because the request is self-reposting
       
  8973  	//-------------------------------------------------------------------------
       
  8974 
       
  8975 	TRequestStatus mockLtsyStatus;
       
  8976 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
  8977 
       
  8978     iMockLTSY.CompleteL(ECustomSatRefreshCompleteNotificationIPC, KErrNone);
       
  8979 
       
  8980 	User::WaitForRequest(mockLtsyStatus);
       
  8981 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
  8982 
       
  8983 	AssertMockLtsyStatusL();
       
  8984 
       
  8985  	//-------------------------------------------------------------------------
       
  8986 	// TEST C: Successful completion request of
       
  8987 	// RMmCustomAPI::SatRefreshCompleteNotification when result is not cached.
       
  8988  	//-------------------------------------------------------------------------
       
  8989 
       
  8990     iMockLTSY.CompleteL(ECustomSatRefreshCompleteNotificationIPC, KErrNone);
       
  8991 	
       
  8992 	customAPI.SatRefreshCompleteNotification(requestStatus);
       
  8993 	
       
  8994 	User::WaitForRequest(requestStatus);	
       
  8995 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
  8996 
       
  8997 	AssertMockLtsyStatusL();
       
  8998 
       
  8999 	CleanupStack::PopAndDestroy(2, this); 	
       
  9000 	
       
  9001 	}
       
  9002 
       
  9003 
       
  9004 /**
       
  9005 @SYMTestCaseID BA-CTSY-CIPC-MCSRCN2-0002
       
  9006 @SYMComponent  telephony_ctsy
       
  9007 @SYMTestCaseDesc Test support in CTSY for cancelling of RMmCustomAPI::SatRefreshCompleteNotification
       
  9008 @SYMTestPriority High
       
  9009 @SYMTestActions Invokes cancelling of RMmCustomAPI::SatRefreshCompleteNotification
       
  9010 @SYMTestExpectedResults Pass
       
  9011 @SYMTestType CT
       
  9012 */
       
  9013 void CCTsyCustomIPCFU::TestSatRefreshCompleteNotification0002L()
       
  9014 	{
       
  9015 
       
  9016 	OpenEtelServerL(EUseExtendedError);
       
  9017 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  9018 	OpenPhoneL();
       
  9019 
       
  9020 	RMmCustomAPI customAPI;
       
  9021 	OpenCustomAPILC(customAPI, iPhone);
       
  9022 
       
  9023     TRequestStatus requestStatus;
       
  9024 	
       
  9025 	TRequestStatus mockLtsyStatus;
       
  9026 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
  9027 
       
  9028  	//-------------------------------------------------------------------------
       
  9029 	// Test cancelling of RMmCustomAPI::SatRefreshCompleteNotification
       
  9030  	//-------------------------------------------------------------------------
       
  9031 
       
  9032 	customAPI.SatRefreshCompleteNotification(requestStatus);
       
  9033 
       
  9034     iMockLTSY.CompleteL(ECustomSatRefreshCompleteNotificationIPC, KErrNone, 20);
       
  9035 		
       
  9036 	customAPI.CancelAsyncRequest(ECustomSatRefreshCompleteNotificationIPC);
       
  9037 
       
  9038 	User::WaitForRequest(requestStatus);	
       
  9039 	ASSERT_EQUALS(KErrCancel, requestStatus.Int());
       
  9040 
       
  9041 	User::WaitForRequest(mockLtsyStatus);
       
  9042 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
  9043 
       
  9044 	CleanupStack::PopAndDestroy(2); 
       
  9045 	
       
  9046 	}
       
  9047 
       
  9048 
       
  9049 /**
       
  9050 @SYMTestCaseID BA-CTSY-CIPC-MCSRCN2-0004
       
  9051 @SYMComponent  telephony_ctsy
       
  9052 @SYMTestCaseDesc Test support in CTSY for multiple client requests to RMmCustomAPI::SatRefreshCompleteNotification
       
  9053 @SYMTestPriority High
       
  9054 @SYMTestActions Invokes multiple client requests to RMmCustomAPI::SatRefreshCompleteNotification
       
  9055 @SYMTestExpectedResults Pass
       
  9056 @SYMTestType CT
       
  9057 */
       
  9058 void CCTsyCustomIPCFU::TestSatRefreshCompleteNotification0004L()
       
  9059 	{
       
  9060 
       
  9061 	OpenEtelServerL(EUseExtendedError);
       
  9062 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  9063 	OpenPhoneL();
       
  9064 
       
  9065 	RTelServer telServer2;
       
  9066 	TInt ret = telServer2.Connect();
       
  9067 	ASSERT_EQUALS(KErrNone, ret);
       
  9068 	CleanupClosePushL(telServer2);
       
  9069 
       
  9070 	RMobilePhone phone2;
       
  9071 	ret = phone2.Open(telServer2,KMmTsyPhoneName);
       
  9072 	ASSERT_EQUALS(KErrNone, ret);
       
  9073 	CleanupClosePushL(phone2);
       
  9074 
       
  9075 
       
  9076 	RMmCustomAPI customAPI;
       
  9077 	OpenCustomAPILC(customAPI, iPhone);
       
  9078 
       
  9079 	RMmCustomAPI customAPI2;
       
  9080 	OpenCustomAPILC(customAPI2, phone2, EFalse);
       
  9081 
       
  9082 	TRequestStatus requestStatus;
       
  9083 	TRequestStatus requestStatus2;
       
  9084 
       
  9085 	//-------------------------------------------------------------------------
       
  9086 	// Test A: Test multiple clients requesting RMmCustomAPI::NotifyNetworkConnectionFailure
       
  9087  	//-------------------------------------------------------------------------
       
  9088 
       
  9089     iMockLTSY.CompleteL(ECustomSatRefreshCompleteNotificationIPC, KErrNone, 20);
       
  9090 
       
  9091 	customAPI.SatRefreshCompleteNotification(requestStatus);
       
  9092 	customAPI2.SatRefreshCompleteNotification(requestStatus2);
       
  9093 
       
  9094 	User::WaitForRequest(requestStatus);	
       
  9095 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
  9096 
       
  9097 	User::WaitForRequest(requestStatus2);	
       
  9098 	ASSERT_EQUALS(KErrNone, requestStatus2.Int());
       
  9099 
       
  9100 	AssertMockLtsyStatusL();
       
  9101 
       
  9102 	CleanupStack::PopAndDestroy(5, this);
       
  9103 	
       
  9104 	}
       
  9105 
       
  9106 
       
  9107 
       
  9108 /**
       
  9109 @SYMTestCaseID BA-CTSY-CIPC-MCCTDDS-0001
       
  9110 @SYMComponent  telephony_ctsy
       
  9111 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::CheckTwoDigitDialSupport
       
  9112 @SYMTestPriority High
       
  9113 @SYMTestActions Invokes RMmCustomAPI::CheckTwoDigitDialSupport
       
  9114 @SYMTestExpectedResults Pass
       
  9115 @SYMTestType CT
       
  9116 */
       
  9117 void CCTsyCustomIPCFU::TestCheckTwoDigitDialSupport0001L()
       
  9118 	{
       
  9119 	
       
  9120 	OpenEtelServerL(EUseExtendedError);
       
  9121 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  9122 	OpenPhoneL();
       
  9123 
       
  9124 	RMmCustomAPI customAPI;
       
  9125 	OpenCustomAPILC(customAPI, iPhone);
       
  9126 
       
  9127     TRequestStatus requestStatus;
       
  9128     
       
  9129     RMmCustomAPI::TTwoDigitDialSupport  support;
       
  9130    
       
  9131  	//-------------------------------------------------------------------------
       
  9132 	// TEST A: failure to dispatch request to LTSY
       
  9133  	//-------------------------------------------------------------------------
       
  9134 
       
  9135     iMockLTSY.ExpectL( ECustomCheckTwoDigitDialSupportIPC, KErrNotSupported);
       
  9136     
       
  9137     customAPI.CheckTwoDigitDialSupport(requestStatus, support);
       
  9138 	
       
  9139 	User::WaitForRequest(requestStatus);	
       
  9140 	ASSERT_EQUALS(KErrNotSupported, requestStatus.Int());
       
  9141 
       
  9142 	AssertMockLtsyStatusL();
       
  9143 
       
  9144 	//-------------------------------------------------------------------------
       
  9145 	// TEST B: failure on completion of pending request from LTSY->CTSY
       
  9146  	//-------------------------------------------------------------------------
       
  9147 
       
  9148     iMockLTSY.ExpectL( ECustomCheckTwoDigitDialSupportIPC);
       
  9149     
       
  9150     const RMmCustomAPI::TTwoDigitDialSupport compData(RMmCustomAPI::ETwoDigitDialSupportOn);
       
  9151     TPckg<RMmCustomAPI::TTwoDigitDialSupport> compPckg(compData);
       
  9152     
       
  9153     iMockLTSY.CompleteL( ECustomCheckTwoDigitDialSupportIPC, KErrGeneral, compPckg);
       
  9154 
       
  9155     customAPI.CheckTwoDigitDialSupport(requestStatus, support);
       
  9156 	
       
  9157 	User::WaitForRequest(requestStatus);	
       
  9158 	ASSERT_EQUALS(KErrGeneral, requestStatus.Int());
       
  9159 
       
  9160 	AssertMockLtsyStatusL();
       
  9161 
       
  9162  	//-------------------------------------------------------------------------
       
  9163 	// TEST C: Successful completion request of
       
  9164 	// RMmCustomAPI::CheckTwoDigitDialSupport when result is not cached.
       
  9165  	//-------------------------------------------------------------------------
       
  9166 
       
  9167     iMockLTSY.ExpectL( ECustomCheckTwoDigitDialSupportIPC);
       
  9168     iMockLTSY.CompleteL( ECustomCheckTwoDigitDialSupportIPC, KErrNone, compPckg);
       
  9169 
       
  9170     customAPI.CheckTwoDigitDialSupport(requestStatus, support);
       
  9171 	
       
  9172 	User::WaitForRequest(requestStatus);	
       
  9173 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
  9174 
       
  9175 	ASSERT_EQUALS(compData, support);
       
  9176 
       
  9177 	AssertMockLtsyStatusL();
       
  9178 
       
  9179  	//-------------------------------------------------------------------------
       
  9180 	// TEST E: Unsolicited completion of RMmCustomAPI::CheckTwoDigitDialSupport
       
  9181 	// from LTSY.
       
  9182  	//-------------------------------------------------------------------------
       
  9183 
       
  9184 	TRequestStatus mockLtsyStatus;
       
  9185 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
  9186 
       
  9187     iMockLTSY.CompleteL( ECustomCheckTwoDigitDialSupportIPC, KErrNone, compPckg);
       
  9188 
       
  9189 	User::WaitForRequest(mockLtsyStatus);
       
  9190 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
  9191 
       
  9192 	AssertMockLtsyStatusL();
       
  9193 	CleanupStack::PopAndDestroy(2, this); 	
       
  9194 	
       
  9195 	}
       
  9196 
       
  9197 
       
  9198 /**
       
  9199 @SYMTestCaseID BA-CTSY-CIPC-MCCTDDS-0002
       
  9200 @SYMComponent  telephony_ctsy
       
  9201 @SYMTestCaseDesc Test support in CTSY for cancelling of RMmCustomAPI::CheckTwoDigitDialSupport
       
  9202 @SYMTestPriority High
       
  9203 @SYMTestActions Invokes cancelling of RMmCustomAPI::CheckTwoDigitDialSupport
       
  9204 @SYMTestExpectedResults Pass
       
  9205 @SYMTestType CT
       
  9206 */
       
  9207 void CCTsyCustomIPCFU::TestCheckTwoDigitDialSupport0002L()
       
  9208 	{
       
  9209 
       
  9210 	OpenEtelServerL(EUseExtendedError);
       
  9211 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  9212 	OpenPhoneL();
       
  9213 
       
  9214 	RMmCustomAPI customAPI;
       
  9215 	OpenCustomAPILC(customAPI, iPhone);
       
  9216 
       
  9217     TRequestStatus requestStatus;
       
  9218     RMmCustomAPI::TTwoDigitDialSupport  support;
       
  9219    
       
  9220 	TRequestStatus mockLtsyStatus;
       
  9221 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
  9222 
       
  9223 
       
  9224  	//-------------------------------------------------------------------------
       
  9225 	// Test cancelling of RMmCustomAPI::CheckTwoDigitDialSupport
       
  9226  	//-------------------------------------------------------------------------
       
  9227 
       
  9228     iMockLTSY.ExpectL( ECustomCheckTwoDigitDialSupportIPC);
       
  9229     
       
  9230     const RMmCustomAPI::TTwoDigitDialSupport compData(RMmCustomAPI::ETwoDigitDialSupportOn);
       
  9231     TPckg<RMmCustomAPI::TTwoDigitDialSupport> compPckg(compData);
       
  9232     
       
  9233     iMockLTSY.CompleteL( ECustomCheckTwoDigitDialSupportIPC, KErrNone, compPckg, 20);
       
  9234 
       
  9235     customAPI.CheckTwoDigitDialSupport(requestStatus, support);
       
  9236 	
       
  9237 	customAPI.CancelAsyncRequest(ECustomCheckTwoDigitDialSupportIPC);
       
  9238 
       
  9239 	User::WaitForRequest(requestStatus);	
       
  9240 	ASSERT_EQUALS(KErrCancel, requestStatus.Int());
       
  9241 
       
  9242 	User::WaitForRequest(mockLtsyStatus);	
       
  9243 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
  9244 
       
  9245 	AssertMockLtsyStatusL();
       
  9246 
       
  9247 	CleanupStack::PopAndDestroy(2, this); 			
       
  9248 	
       
  9249 	}
       
  9250 
       
  9251 
       
  9252 /**
       
  9253 @SYMTestCaseID BA-CTSY-CIPC-MCCTDDS-0004
       
  9254 @SYMComponent  telephony_ctsy
       
  9255 @SYMTestCaseDesc Test support in CTSY for multiple client requests to RMmCustomAPI::CheckTwoDigitDialSupport
       
  9256 @SYMTestPriority High
       
  9257 @SYMTestActions Invokes multiple client requests to RMmCustomAPI::CheckTwoDigitDialSupport
       
  9258 @SYMTestExpectedResults Pass
       
  9259 @SYMTestType CT
       
  9260 */
       
  9261 void CCTsyCustomIPCFU::TestCheckTwoDigitDialSupport0004L()
       
  9262 	{
       
  9263 
       
  9264 	OpenEtelServerL(EUseExtendedError);
       
  9265 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  9266 	OpenPhoneL();
       
  9267 
       
  9268 	// Open second client
       
  9269 	RTelServer telServer2;
       
  9270 	TInt ret = telServer2.Connect();
       
  9271 	ASSERT_EQUALS(KErrNone, ret);
       
  9272 	CleanupClosePushL(telServer2);
       
  9273 
       
  9274 	RMobilePhone phone2;
       
  9275 	ret = phone2.Open(telServer2,KMmTsyPhoneName);
       
  9276 	ASSERT_EQUALS(KErrNone, ret);
       
  9277 	CleanupClosePushL(phone2);
       
  9278 
       
  9279 	RMmCustomAPI customAPI;
       
  9280 	OpenCustomAPILC(customAPI, iPhone);
       
  9281 
       
  9282 	RMmCustomAPI customAPI2;
       
  9283 	OpenCustomAPILC(customAPI2, phone2, EFalse);
       
  9284 
       
  9285     TRequestStatus requestStatus;
       
  9286     TRequestStatus requestStatus2;
       
  9287 
       
  9288     RMmCustomAPI::TTwoDigitDialSupport  support;
       
  9289     RMmCustomAPI::TTwoDigitDialSupport  support2;
       
  9290 
       
  9291 	//-------------------------------------------------------------------------
       
  9292 	// Test A: Test multiple clients requesting RMmCustomAPI::CheckTwoDigitDialSupport
       
  9293  	//-------------------------------------------------------------------------
       
  9294 
       
  9295     iMockLTSY.ExpectL( ECustomCheckTwoDigitDialSupportIPC);
       
  9296 
       
  9297     const RMmCustomAPI::TTwoDigitDialSupport compData(RMmCustomAPI::ETwoDigitDialSupportOn);
       
  9298     TPckg<RMmCustomAPI::TTwoDigitDialSupport> compPckg(compData);
       
  9299 
       
  9300     iMockLTSY.CompleteL( ECustomCheckTwoDigitDialSupportIPC, KErrNone, compPckg, 20);
       
  9301 
       
  9302     customAPI.CheckTwoDigitDialSupport(requestStatus, support);
       
  9303 
       
  9304 	// second client
       
  9305     iMockLTSY.ExpectL( ECustomCheckTwoDigitDialSupportIPC);
       
  9306 
       
  9307     const RMmCustomAPI::TTwoDigitDialSupport compData2(RMmCustomAPI::ETwoDigitDialSupportOff);
       
  9308     TPckg<RMmCustomAPI::TTwoDigitDialSupport> compPckg2(compData2);
       
  9309 
       
  9310     iMockLTSY.CompleteL( ECustomCheckTwoDigitDialSupportIPC, KErrNone, compPckg2);
       
  9311 
       
  9312     customAPI2.CheckTwoDigitDialSupport(requestStatus2, support2);		
       
  9313         
       
  9314 	User::WaitForRequest(requestStatus);	
       
  9315 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
  9316 
       
  9317 	ASSERT_EQUALS(compData, support);
       
  9318 
       
  9319 	User::WaitForRequest(requestStatus2);	
       
  9320 	ASSERT_EQUALS(KErrNone, requestStatus2.Int());
       
  9321 
       
  9322 	ASSERT_EQUALS(compData2, support2);
       
  9323 
       
  9324 	AssertMockLtsyStatusL();
       
  9325 
       
  9326 	CleanupStack::PopAndDestroy(5, this);
       
  9327 
       
  9328 	}
       
  9329 
       
  9330 
       
  9331 /**
       
  9332 @SYMTestCaseID BA-CTSY-CIPC-MCCTDDS-0005
       
  9333 @SYMComponent  telephony_ctsy
       
  9334 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::CheckTwoDigitDialSupport with timeout
       
  9335 @SYMTestPriority High
       
  9336 @SYMTestActions Invokes RMmCustomAPI::CheckTwoDigitDialSupport and tests for timeout
       
  9337 @SYMTestExpectedResults Pass
       
  9338 @SYMTestType CT
       
  9339 */
       
  9340 void CCTsyCustomIPCFU::TestCheckTwoDigitDialSupport0005L()
       
  9341 	{
       
  9342 
       
  9343 	OpenEtelServerL(EUseExtendedError);
       
  9344 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  9345 	OpenPhoneL();
       
  9346 
       
  9347 	RMmCustomAPI customAPI;
       
  9348 	OpenCustomAPILC(customAPI, iPhone);
       
  9349 
       
  9350     TRequestStatus requestStatus;
       
  9351     RMmCustomAPI::TLifeTimeData ltData;
       
  9352     TPckg<RMmCustomAPI::TLifeTimeData> ltPckg(ltData);
       
  9353 
       
  9354     iMockLTSY.ExpectL( ECustomCheckTwoDigitDialSupportIPC);
       
  9355     
       
  9356     RMmCustomAPI::TTwoDigitDialSupport  support;
       
  9357 
       
  9358     customAPI.CheckTwoDigitDialSupport(requestStatus, support);
       
  9359 	
       
  9360 	User::WaitForRequest(requestStatus);	
       
  9361 	ASSERT_EQUALS(KErrTimedOut, requestStatus.Int());
       
  9362 
       
  9363 	AssertMockLtsyStatusL();
       
  9364 
       
  9365 	CleanupStack::PopAndDestroy(2, this); 			
       
  9366 
       
  9367 	}
       
  9368 
       
  9369 
       
  9370 /**
       
  9371 @SYMTestCaseID BA-CTSY-CIPC-MCRNS-0001
       
  9372 @SYMComponent  telephony_ctsy
       
  9373 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::ResetNetServer
       
  9374 @SYMTestPriority High
       
  9375 @SYMTestActions Invokes RMmCustomAPI::ResetNetServer
       
  9376 @SYMTestExpectedResults Pass
       
  9377 @SYMTestType CT
       
  9378 */
       
  9379 void CCTsyCustomIPCFU::TestResetNetServer0001L()
       
  9380 	{
       
  9381 
       
  9382 	OpenEtelServerL(EUseExtendedError);
       
  9383 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  9384 	OpenPhoneL();
       
  9385 
       
  9386 	RMmCustomAPI customAPI;
       
  9387 	OpenCustomAPILC(customAPI, iPhone);
       
  9388 
       
  9389     TRequestStatus requestStatus;
       
  9390 	
       
  9391  	//-------------------------------------------------------------------------
       
  9392 	// TEST A: failure to dispatch request to LTSY
       
  9393  	//-------------------------------------------------------------------------
       
  9394 
       
  9395     iMockLTSY.ExpectL( ECustomResetNetServerIPC, KErrNotSupported);
       
  9396     
       
  9397     customAPI.ResetNetServer(requestStatus);
       
  9398 	
       
  9399 	User::WaitForRequest(requestStatus);	
       
  9400 	ASSERT_EQUALS(KErrNotSupported, requestStatus.Int());
       
  9401 
       
  9402 	AssertMockLtsyStatusL();
       
  9403 
       
  9404 	//-------------------------------------------------------------------------
       
  9405 	// TEST B: failure on completion of pending request from LTSY->CTSY
       
  9406  	//-------------------------------------------------------------------------
       
  9407 
       
  9408     iMockLTSY.ExpectL( ECustomResetNetServerIPC);
       
  9409 
       
  9410     iMockLTSY.CompleteL( ECustomResetNetServerIPC, KErrGeneral);
       
  9411 
       
  9412     customAPI.ResetNetServer(requestStatus);
       
  9413 	
       
  9414 	User::WaitForRequest(requestStatus);	
       
  9415 	ASSERT_EQUALS(KErrGeneral, requestStatus.Int());
       
  9416 
       
  9417 	AssertMockLtsyStatusL();
       
  9418 
       
  9419  	//-------------------------------------------------------------------------
       
  9420 	// TEST C: Successful completion request of
       
  9421 	// RMmCustomAPI::ResetNetServer when result is not cached.
       
  9422  	//-------------------------------------------------------------------------
       
  9423 
       
  9424     iMockLTSY.ExpectL( ECustomResetNetServerIPC);
       
  9425     iMockLTSY.CompleteL( ECustomResetNetServerIPC, KErrNone);
       
  9426 
       
  9427     customAPI.ResetNetServer(requestStatus);
       
  9428 	
       
  9429 	User::WaitForRequest(requestStatus);	
       
  9430 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
  9431 	
       
  9432 	AssertMockLtsyStatusL();
       
  9433 
       
  9434  	//-------------------------------------------------------------------------
       
  9435 	// TEST E: Unsolicited completion of RMmCustomAPI::ResetNetServer
       
  9436 	// from LTSY.
       
  9437  	//-------------------------------------------------------------------------
       
  9438 
       
  9439 	TRequestStatus mockLtsyStatus;
       
  9440 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
  9441 
       
  9442     iMockLTSY.CompleteL( ECustomResetNetServerIPC, KErrNone);
       
  9443 
       
  9444 	User::WaitForRequest(mockLtsyStatus);
       
  9445 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
  9446 
       
  9447 	AssertMockLtsyStatusL();
       
  9448 	CleanupStack::PopAndDestroy(2, this); 	
       
  9449 	}
       
  9450 
       
  9451 
       
  9452 /**
       
  9453 @SYMTestCaseID BA-CTSY-CIPC-MCRNS-0002
       
  9454 @SYMComponent  telephony_ctsy
       
  9455 @SYMTestCaseDesc Test support in CTSY for cancelling of RMmCustomAPI::ResetNetServer
       
  9456 @SYMTestPriority High
       
  9457 @SYMTestActions Invokes cancelling of RMmCustomAPI::ResetNetServer
       
  9458 @SYMTestExpectedResults Pass
       
  9459 @SYMTestType CT
       
  9460 */
       
  9461 void CCTsyCustomIPCFU::TestResetNetServer0002L()
       
  9462 	{
       
  9463 	
       
  9464 	OpenEtelServerL(EUseExtendedError);
       
  9465 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  9466 	OpenPhoneL();
       
  9467 
       
  9468 	RMmCustomAPI customAPI;
       
  9469 	OpenCustomAPILC(customAPI, iPhone);
       
  9470 
       
  9471     TRequestStatus requestStatus;
       
  9472 	
       
  9473 
       
  9474 	TRequestStatus mockLtsyStatus;
       
  9475 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
  9476 
       
  9477  	//-------------------------------------------------------------------------
       
  9478 	// Test cancelling of RMmCustomAPI::ResetNetServer
       
  9479  	//-------------------------------------------------------------------------
       
  9480 
       
  9481     iMockLTSY.ExpectL( ECustomResetNetServerIPC);
       
  9482     iMockLTSY.CompleteL( ECustomResetNetServerIPC, KErrNone, 20);
       
  9483 
       
  9484     customAPI.ResetNetServer(requestStatus);
       
  9485 	
       
  9486 	customAPI.CancelAsyncRequest(ECustomResetNetServerIPC);
       
  9487 
       
  9488 	User::WaitForRequest(requestStatus);	
       
  9489 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
  9490 
       
  9491 	User::WaitForRequest(mockLtsyStatus);
       
  9492 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
  9493 
       
  9494 	AssertMockLtsyStatusL();
       
  9495 
       
  9496 	CleanupStack::PopAndDestroy(2); 	
       
  9497 	
       
  9498 	}
       
  9499 
       
  9500 
       
  9501 
       
  9502 /**
       
  9503 @SYMTestCaseID BA-CTSY-CIPC-MCRNS-0004
       
  9504 @SYMComponent  telephony_ctsy
       
  9505 @SYMTestCaseDesc Test support in CTSY for multiple client requests to RMmCustomAPI::ResetNetServer
       
  9506 @SYMTestPriority High
       
  9507 @SYMTestActions Invokes multiple client requests to RMmCustomAPI::ResetNetServer
       
  9508 @SYMTestExpectedResults Pass
       
  9509 @SYMTestType CT
       
  9510 */
       
  9511 void CCTsyCustomIPCFU::TestResetNetServer0004L()
       
  9512 	{
       
  9513 
       
  9514 	OpenEtelServerL(EUseExtendedError);
       
  9515 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  9516 	OpenPhoneL();
       
  9517 
       
  9518 	// Open second client
       
  9519 	RTelServer telServer2;
       
  9520 	TInt ret = telServer2.Connect();
       
  9521 	ASSERT_EQUALS(KErrNone, ret);
       
  9522 	CleanupClosePushL(telServer2);
       
  9523 
       
  9524 	RMobilePhone phone2;
       
  9525 	ret = phone2.Open(telServer2,KMmTsyPhoneName);
       
  9526 	ASSERT_EQUALS(KErrNone, ret);
       
  9527 	CleanupClosePushL(phone2);
       
  9528 
       
  9529 	RMmCustomAPI customAPI;
       
  9530 	OpenCustomAPILC(customAPI, iPhone);
       
  9531 
       
  9532 	RMmCustomAPI customAPI2;
       
  9533 	OpenCustomAPILC(customAPI2, phone2, EFalse);
       
  9534 
       
  9535     TRequestStatus requestStatus;
       
  9536     TRequestStatus requestStatus2;
       
  9537 	
       
  9538 	//-------------------------------------------------------------------------
       
  9539 	// Test A: Test multiple clients requesting RMmCustomAPI::ResetNetServer
       
  9540  	//-------------------------------------------------------------------------
       
  9541 
       
  9542     iMockLTSY.ExpectL( ECustomResetNetServerIPC, KErrNone);
       
  9543     iMockLTSY.CompleteL( ECustomResetNetServerIPC, KErrNone, 20);
       
  9544     customAPI.ResetNetServer(requestStatus);
       
  9545 
       
  9546     iMockLTSY.ExpectL( ECustomResetNetServerIPC, KErrNone);
       
  9547     iMockLTSY.CompleteL( ECustomResetNetServerIPC, KErrNone);
       
  9548     customAPI2.ResetNetServer(requestStatus2);
       
  9549     
       
  9550 	User::WaitForRequest(requestStatus);	
       
  9551 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
  9552 
       
  9553 	User::WaitForRequest(requestStatus2);	
       
  9554 	ASSERT_EQUALS(KErrNone, requestStatus2.Int());
       
  9555 
       
  9556 	AssertMockLtsyStatusL();
       
  9557 
       
  9558 	CleanupStack::PopAndDestroy(5, this);
       
  9559 
       
  9560 	}
       
  9561 
       
  9562 
       
  9563 /**
       
  9564 @SYMTestCaseID BA-CTSY-CIPC-MCRNS-0005
       
  9565 @SYMComponent  telephony_ctsy
       
  9566 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::ResetNetServer with timeout
       
  9567 @SYMTestPriority High
       
  9568 @SYMTestActions Invokes RMmCustomAPI::ResetNetServer and tests for timeout
       
  9569 @SYMTestExpectedResults Pass
       
  9570 @SYMTestType CT
       
  9571 */
       
  9572 void CCTsyCustomIPCFU::TestResetNetServer0005L()
       
  9573 	{
       
  9574 	
       
  9575 	OpenEtelServerL(EUseExtendedError);
       
  9576 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  9577 	OpenPhoneL();
       
  9578 
       
  9579 	RMmCustomAPI customAPI;
       
  9580 	OpenCustomAPILC(customAPI, iPhone);
       
  9581 
       
  9582     TRequestStatus requestStatus;
       
  9583 
       
  9584     iMockLTSY.ExpectL( ECustomResetNetServerIPC);
       
  9585 
       
  9586     customAPI.ResetNetServer(requestStatus);
       
  9587 	
       
  9588 	User::WaitForRequest(requestStatus);	
       
  9589 	ASSERT_EQUALS(KErrTimedOut, requestStatus.Int());
       
  9590 
       
  9591 	AssertMockLtsyStatusL();
       
  9592 
       
  9593 	CleanupStack::PopAndDestroy(2); 	
       
  9594 
       
  9595 	}
       
  9596 
       
  9597 
       
  9598 /**
       
  9599 @SYMTestCaseID BA-CTSY-CIPC-MCRF-0001
       
  9600 @SYMComponent  telephony_ctsy
       
  9601 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::ReleaseFile
       
  9602 @SYMTestPriority High
       
  9603 @SYMTestActions Invokes RMmCustomAPI::ReleaseFile
       
  9604 @SYMTestExpectedResults Pass
       
  9605 @SYMTestType CT
       
  9606 */
       
  9607 void CCTsyCustomIPCFU::TestReleaseFile0001L()
       
  9608 	{
       
  9609 
       
  9610 	OpenEtelServerL(EUseExtendedError);
       
  9611 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  9612 	OpenPhoneL();
       
  9613 
       
  9614 	RMmCustomAPI customAPI;
       
  9615 	OpenCustomAPILC(customAPI, iPhone);
       
  9616 
       
  9617 	_LIT(KFile, "FileName");
       
  9618     TRequestStatus requestStatus;
       
  9619 
       
  9620 	customAPI.ReleaseFile( requestStatus, KFile);
       
  9621 
       
  9622     // tests for RMmCustomAPI::ReleaseFile should be written when ECustomReleaseFileIPC 
       
  9623     // would be proccessed.
       
  9624 
       
  9625 	User::WaitForRequest(requestStatus);	
       
  9626 	ASSERT_EQUALS(KErrNotSupported, requestStatus.Int());
       
  9627 
       
  9628 	AssertMockLtsyStatusL();
       
  9629 	CleanupStack::PopAndDestroy(2, this); 
       
  9630 	
       
  9631 	}
       
  9632 
       
  9633 
       
  9634 /**
       
  9635 @SYMTestCaseID BA-CTSY-CIPC-MCREF-0001
       
  9636 @SYMComponent  telephony_ctsy
       
  9637 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::RestartFile
       
  9638 @SYMTestPriority High
       
  9639 @SYMTestActions Invokes RMmCustomAPI::RestartFile
       
  9640 @SYMTestExpectedResults Pass
       
  9641 @SYMTestType CT
       
  9642 */
       
  9643 void CCTsyCustomIPCFU::TestRestartFile0001L()
       
  9644 	{
       
  9645 
       
  9646 	OpenEtelServerL(EUseExtendedError);
       
  9647 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  9648 	OpenPhoneL();
       
  9649 
       
  9650 	RMmCustomAPI customAPI;
       
  9651 	OpenCustomAPILC(customAPI, iPhone);
       
  9652 
       
  9653 	_LIT(KFile, "FileName");
       
  9654     TRequestStatus requestStatus;
       
  9655     
       
  9656     // tests for RMmCustomAPI::RestartFile should be written when ECustomRestartFileIPC 
       
  9657     // would be proccessed.
       
  9658 
       
  9659 	customAPI.RestartFile( requestStatus, KFile);
       
  9660 
       
  9661 	User::WaitForRequest(requestStatus);	
       
  9662 	ASSERT_EQUALS(KErrNotSupported, requestStatus.Int());
       
  9663 
       
  9664 	AssertMockLtsyStatusL();
       
  9665 	CleanupStack::PopAndDestroy(2, this); 
       
  9666 	
       
  9667 	}
       
  9668 
       
  9669 
       
  9670 
       
  9671 /**
       
  9672 @SYMTestCaseID BA-CTSY-CIPC-MCSSCTB-0001
       
  9673 @SYMComponent  telephony_ctsy
       
  9674 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::StartSimCbTopicBrowsing
       
  9675 @SYMTestPriority High
       
  9676 @SYMTestActions Invokes RMmCustomAPI::StartSimCbTopicBrowsing
       
  9677 @SYMTestExpectedResults Pass
       
  9678 @SYMTestType CT
       
  9679 */
       
  9680 void CCTsyCustomIPCFU::TestStartSimCbTopicBrowsing0001L()
       
  9681 	{
       
  9682 
       
  9683 	OpenEtelServerL(EUseExtendedError);
       
  9684 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  9685 	OpenPhoneL();
       
  9686 
       
  9687 	RMmCustomAPI customAPI;
       
  9688 	OpenCustomAPILC(customAPI, iPhone);
       
  9689     
       
  9690 	//-------------------------------------------------------------------------
       
  9691 	// TEST B: failure on completion of pending request from LTSY->CTSY
       
  9692  	//-------------------------------------------------------------------------
       
  9693 
       
  9694 	RBuf8 compData;
       
  9695 	CleanupClosePushL(compData);
       
  9696 
       
  9697 	CArrayFixFlat<RMmCustomAPI::TSimCbTopic>* simTopicArray =  new ( ELeave ) CArrayFixFlat
       
  9698                             <RMmCustomAPI::TSimCbTopic>(1);	
       
  9699 	CleanupStack::PushL(simTopicArray);
       
  9700 	
       
  9701 	_LIT(KTopic, "Topic");
       
  9702 	RMmCustomAPI::TSimCbTopic topic;
       
  9703 	topic.iNumber = 0;
       
  9704 	topic.iName.Copy(KTopic);
       
  9705 
       
  9706 	simTopicArray->AppendL( topic );
       
  9707 	
       
  9708 	TMockLtsyData1< CArrayFixFlat<RMmCustomAPI::TSimCbTopic>* > ltsyData(simTopicArray);	
       
  9709     ltsyData.SerialiseL(compData); 
       
  9710 
       
  9711 	iMockLTSY.ExpectL( ECustomStartSimCbTopicBrowsingIPC);    
       
  9712 	iMockLTSY.CompleteL( ECustomStartSimCbTopicBrowsingIPC, KErrGeneral, compData);    
       
  9713 	
       
  9714 	TInt ret = customAPI.StartSimCbTopicBrowsing();
       
  9715 	
       
  9716 	ASSERT_EQUALS(KErrGeneral, ret);
       
  9717 
       
  9718 	AssertMockLtsyStatusL();
       
  9719 
       
  9720  	//-------------------------------------------------------------------------
       
  9721 	// TEST C: Successful completion request of
       
  9722 	// RMmCustomAPI::StartSimCbTopicBrowsing when result is not cached.
       
  9723  	//-------------------------------------------------------------------------
       
  9724 
       
  9725     iMockLTSY.ExpectL( ECustomStartSimCbTopicBrowsingIPC);
       
  9726     iMockLTSY.CompleteL( ECustomStartSimCbTopicBrowsingIPC, KErrNone, compData);
       
  9727 
       
  9728     ret = customAPI.StartSimCbTopicBrowsing();
       
  9729 	
       
  9730 	ASSERT_EQUALS(KErrNone, ret);
       
  9731 
       
  9732 	AssertMockLtsyStatusL();
       
  9733 
       
  9734  	//-------------------------------------------------------------------------
       
  9735 	// TEST E: Unsolicited completion of RMmCustomAPI::StartSimCbTopicBrowsing
       
  9736 	// from LTSY.
       
  9737  	//-------------------------------------------------------------------------
       
  9738 
       
  9739 	TRequestStatus mockLtsyStatus;
       
  9740 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
  9741 
       
  9742     iMockLTSY.CompleteL( ECustomStartSimCbTopicBrowsingIPC, KErrNone, compData);
       
  9743 
       
  9744 	User::WaitForRequest(mockLtsyStatus);
       
  9745 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
  9746 
       
  9747 	AssertMockLtsyStatusL();
       
  9748 	
       
  9749  	//-------------------------------------------------------------------------
       
  9750 	// TEST A: failure to dispatch request to LTSY
       
  9751  	//-------------------------------------------------------------------------
       
  9752 
       
  9753     iMockLTSY.ExpectL( ECustomStartSimCbTopicBrowsingIPC, KErrNotSupported);
       
  9754     
       
  9755     ret = customAPI.StartSimCbTopicBrowsing();
       
  9756 	
       
  9757 	ASSERT_EQUALS(KErrNotSupported, ret);
       
  9758 
       
  9759 	AssertMockLtsyStatusL();
       
  9760 	CleanupStack::PopAndDestroy(4, this); 			
       
  9761 	}
       
  9762 
       
  9763 
       
  9764 
       
  9765 /**
       
  9766 @SYMTestCaseID BA-CTSY-CIPC-MCSSCTB-0003
       
  9767 @SYMComponent  telephony_ctsy
       
  9768 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::StartSimCbTopicBrowsing with bad parameter data
       
  9769 @SYMTestPriority High
       
  9770 @SYMTestActions Invokes RMmCustomAPI::StartSimCbTopicBrowsing with bad parameter data
       
  9771 @SYMTestExpectedResults Pass
       
  9772 @SYMTestType CT
       
  9773 */
       
  9774 void CCTsyCustomIPCFU::TestStartSimCbTopicBrowsing0003L()
       
  9775 	{
       
  9776 
       
  9777 	OpenEtelServerL(EUseExtendedError);
       
  9778 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  9779 	OpenPhoneL();
       
  9780 
       
  9781 	RMmCustomAPI customAPI;
       
  9782 	OpenCustomAPILC(customAPI, iPhone);
       
  9783 
       
  9784     TRequestStatus requestStatus;
       
  9785 
       
  9786 	// Passing zero pointer
       
  9787 
       
  9788     iMockLTSY.ExpectL( ECustomStartSimCbTopicBrowsingIPC);
       
  9789     
       
  9790 	RBuf8 compData;
       
  9791 	CleanupClosePushL(compData);
       
  9792 
       
  9793 	CArrayFixFlat<RMmCustomAPI::TSimCbTopic>* simTopicArray = NULL;	
       
  9794 	
       
  9795 	TMockLtsyData1< CArrayFixFlat<RMmCustomAPI::TSimCbTopic>* > ltsyData(simTopicArray);	
       
  9796     ltsyData.SerialiseL(compData); 
       
  9797     
       
  9798     iMockLTSY.CompleteL( ECustomStartSimCbTopicBrowsingIPC, KErrNone, compData);
       
  9799 
       
  9800     TInt ret = customAPI.StartSimCbTopicBrowsing();
       
  9801 	
       
  9802 	ASSERT_EQUALS(KErrNone, ret);
       
  9803 
       
  9804 	AssertMockLtsyStatusL();
       
  9805 
       
  9806 	CleanupStack::PopAndDestroy(3, this); 				
       
  9807 
       
  9808 	}
       
  9809 
       
  9810 
       
  9811 
       
  9812 /**
       
  9813 @SYMTestCaseID BA-CTSY-CIPC-MCSSCTB-0005
       
  9814 @SYMComponent  telephony_ctsy
       
  9815 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::StartSimCbTopicBrowsing with timeout
       
  9816 @SYMTestPriority High
       
  9817 @SYMTestActions Invokes RMmCustomAPI::StartSimCbTopicBrowsing and tests for timeout
       
  9818 @SYMTestExpectedResults Pass
       
  9819 @SYMTestType CT
       
  9820 */
       
  9821 void CCTsyCustomIPCFU::TestStartSimCbTopicBrowsing0005L()
       
  9822 	{
       
  9823 
       
  9824 	OpenEtelServerL(EUseExtendedError);
       
  9825 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  9826 	OpenPhoneL();
       
  9827 
       
  9828 	RMmCustomAPI customAPI;
       
  9829 	OpenCustomAPILC(customAPI, iPhone);
       
  9830 
       
  9831     TRequestStatus requestStatus;
       
  9832 
       
  9833     iMockLTSY.ExpectL( ECustomStartSimCbTopicBrowsingIPC);
       
  9834     
       
  9835     TInt ret = customAPI.StartSimCbTopicBrowsing();
       
  9836 	
       
  9837 	ASSERT_EQUALS(KErrTimedOut, ret);
       
  9838 
       
  9839 	AssertMockLtsyStatusL();
       
  9840 
       
  9841 	CleanupStack::PopAndDestroy(2, this); 				
       
  9842 
       
  9843 	}
       
  9844 
       
  9845 
       
  9846 /**
       
  9847 @SYMTestCaseID BA-CTSY-CIPC-MCGNSCT-0001
       
  9848 @SYMComponent  telephony_ctsy
       
  9849 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::GetNextSimCbTopic
       
  9850 @SYMTestPriority High
       
  9851 @SYMTestActions Invokes RMmCustomAPI::GetNextSimCbTopic
       
  9852 @SYMTestExpectedResults Pass
       
  9853 @SYMTestType CT
       
  9854 */
       
  9855 void CCTsyCustomIPCFU::TestGetNextSimCbTopic0001L()
       
  9856 	{
       
  9857 
       
  9858 	OpenEtelServerL(EUseExtendedError);
       
  9859 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  9860 	OpenPhoneL();
       
  9861 
       
  9862 	RMmCustomAPI customAPI;
       
  9863 	OpenCustomAPILC(customAPI, iPhone);
       
  9864 
       
  9865     TRequestStatus requestStatus;
       
  9866    
       
  9867  	//-------------------------------------------------------------------------
       
  9868 	// TEST C: Successful completion request of
       
  9869 	// RMmCustomAPI::GetNextSimCbTopic when result is not cached.
       
  9870  	//-------------------------------------------------------------------------
       
  9871  	// testing with not initialized topics
       
  9872 
       
  9873 	RMmCustomAPI::TSimCbTopic topic;
       
  9874 
       
  9875     customAPI.GetNextSimCbTopic(requestStatus, topic);
       
  9876 	
       
  9877 	User::WaitForRequest(requestStatus);	
       
  9878 	ASSERT_EQUALS(KErrNotFound, requestStatus.Int());
       
  9879 
       
  9880 	AssertMockLtsyStatusL();
       
  9881 
       
  9882 	_LIT(KTopic, "Topic");
       
  9883 	TInt num = 0;
       
  9884  	
       
  9885  	InitSimCbTopicsL(customAPI, KTopic, num);
       
  9886 
       
  9887  	//-------------------------------------------------------------------------
       
  9888 	// TEST C2: Successful completion request of
       
  9889 	// RMmCustomAPI::GetNextSimCbTopic when result is not cached.
       
  9890  	//-------------------------------------------------------------------------
       
  9891 
       
  9892     customAPI.GetNextSimCbTopic(requestStatus, topic);
       
  9893 	
       
  9894 	User::WaitForRequest(requestStatus);	
       
  9895 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
  9896 
       
  9897 	ASSERT_TRUE(num == topic.iNumber);
       
  9898 	ASSERT_TRUE(0 == topic.iName.Compare(KTopic));
       
  9899 
       
  9900 	CleanupStack::PopAndDestroy(2, this); 	
       
  9901 	
       
  9902 	}
       
  9903 
       
  9904 
       
  9905 
       
  9906 void CCTsyCustomIPCFU::InitSimCbTopicsL(RMmCustomAPI &aCustomApi, const TDesC& aTopic, TInt aNum)
       
  9907 	{
       
  9908 
       
  9909 	RBuf8 compData;
       
  9910 	CleanupClosePushL(compData);
       
  9911 
       
  9912 	CArrayFixFlat<RMmCustomAPI::TSimCbTopic>* simTopicArray =  new ( ELeave ) CArrayFixFlat
       
  9913                             <RMmCustomAPI::TSimCbTopic>(1);	
       
  9914 	CleanupStack::PushL(simTopicArray);
       
  9915 	
       
  9916 	RMmCustomAPI::TSimCbTopic topic;
       
  9917 	topic.iNumber = aNum;
       
  9918 	topic.iName.Copy(aTopic);
       
  9919 
       
  9920 	simTopicArray->AppendL( topic );
       
  9921 	
       
  9922 	TMockLtsyData1< CArrayFixFlat<RMmCustomAPI::TSimCbTopic>* > ltsyData(simTopicArray);	
       
  9923     ltsyData.SerialiseL(compData); 
       
  9924 
       
  9925 	iMockLTSY.ExpectL( ECustomStartSimCbTopicBrowsingIPC);    
       
  9926 	iMockLTSY.CompleteL( ECustomStartSimCbTopicBrowsingIPC, KErrNone, compData);    
       
  9927 	TInt ret = aCustomApi.StartSimCbTopicBrowsing();
       
  9928 	ASSERT_EQUALS(KErrNone, ret);
       
  9929 
       
  9930 	CleanupStack::PopAndDestroy(2);	//simTopicArray, compData
       
  9931 	}
       
  9932 
       
  9933 /**
       
  9934 @SYMTestCaseID BA-CTSY-CIPC-MCDSCT-0001
       
  9935 @SYMComponent  telephony_ctsy
       
  9936 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::DeleteSimCbTopic
       
  9937 @SYMTestPriority High
       
  9938 @SYMTestActions Invokes RMmCustomAPI::DeleteSimCbTopic
       
  9939 @SYMTestExpectedResults Pass
       
  9940 @SYMTestType CT
       
  9941 */
       
  9942 void CCTsyCustomIPCFU::TestDeleteSimCbTopic0001L()
       
  9943 	{
       
  9944 
       
  9945 	OpenEtelServerL(EUseExtendedError);
       
  9946 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  9947 	OpenPhoneL();
       
  9948 
       
  9949 	RMmCustomAPI customAPI;
       
  9950 	OpenCustomAPILC(customAPI, iPhone);
       
  9951 
       
  9952     TRequestStatus requestStatus;
       
  9953    
       
  9954 	RBuf8 expectData;
       
  9955 	CleanupClosePushL(expectData);
       
  9956  	
       
  9957  	InitSimCbTopicsL(customAPI, _L("Topic"), 0);
       
  9958 	
       
  9959 	TUint index(0);
       
  9960 	TUint expIndex(index);
       
  9961 	TBool deleteFlag(ETrue);
       
  9962 
       
  9963 	TMockLtsyData2< TUint, TBool > ltsyData2(expIndex, deleteFlag);	
       
  9964 	ltsyData2.SerialiseL(expectData);
       
  9965 
       
  9966 	//-------------------------------------------------------------------------
       
  9967 	// TEST A: failure to dispatch request to LTSY
       
  9968  	//-------------------------------------------------------------------------
       
  9969 
       
  9970     iMockLTSY.ExpectL( ECustomDeleteSimCbTopicIPC, expectData, KErrNotSupported);
       
  9971 
       
  9972     customAPI.DeleteSimCbTopic(requestStatus, index);
       
  9973 	
       
  9974 	User::WaitForRequest(requestStatus);	
       
  9975 	ASSERT_EQUALS(KErrNotSupported, requestStatus.Int());
       
  9976 
       
  9977 	AssertMockLtsyStatusL();
       
  9978 
       
  9979 	//-------------------------------------------------------------------------
       
  9980 	// TEST B: failure on completion of pending request from LTSY->CTSY
       
  9981  	//-------------------------------------------------------------------------
       
  9982 
       
  9983     iMockLTSY.ExpectL( ECustomDeleteSimCbTopicIPC, expectData);    
       
  9984     iMockLTSY.CompleteL( ECustomDeleteSimCbTopicIPC, KErrGeneral);
       
  9985 
       
  9986     customAPI.DeleteSimCbTopic(requestStatus, index);
       
  9987 	
       
  9988 	User::WaitForRequest(requestStatus);	
       
  9989 	ASSERT_EQUALS(KErrGeneral, requestStatus.Int());
       
  9990 
       
  9991 	AssertMockLtsyStatusL();
       
  9992 
       
  9993  	//-------------------------------------------------------------------------
       
  9994 	// TEST E: Unsolicited completion of RMmCustomAPI::DeleteSimCbTopic
       
  9995 	// from LTSY.
       
  9996  	//-------------------------------------------------------------------------
       
  9997 
       
  9998 	TRequestStatus mockLtsyStatus;
       
  9999 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
 10000 
       
 10001     iMockLTSY.CompleteL( ECustomDeleteSimCbTopicIPC, KErrNone);
       
 10002 
       
 10003 	User::WaitForRequest(mockLtsyStatus);
       
 10004 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
 10005 
       
 10006 	AssertMockLtsyStatusL();	
       
 10007 	
       
 10008 
       
 10009  	//-------------------------------------------------------------------------
       
 10010 	// TEST C: deletion of not existing entry.
       
 10011  	//-------------------------------------------------------------------------
       
 10012  	
       
 10013  	index = 100;
       
 10014  	expIndex  = index;
       
 10015 	deleteFlag = EFalse;
       
 10016 	expectData.Close();
       
 10017 	ltsyData2.SerialiseL(expectData);
       
 10018 
       
 10019     iMockLTSY.ExpectL( ECustomDeleteSimCbTopicIPC, expectData);
       
 10020     iMockLTSY.CompleteL( ECustomDeleteSimCbTopicIPC, KErrArgument);
       
 10021 
       
 10022     customAPI.DeleteSimCbTopic(requestStatus, index);
       
 10023 	
       
 10024 	User::WaitForRequest(requestStatus);	
       
 10025 	ASSERT_EQUALS(KErrArgument, requestStatus.Int());
       
 10026 
       
 10027 	AssertMockLtsyStatusL();
       
 10028 
       
 10029  	//-------------------------------------------------------------------------
       
 10030 	// TEST C2: Successful completion request of
       
 10031 	// RMmCustomAPI::DeleteSimCbTopic when result is not cached.
       
 10032  	//-------------------------------------------------------------------------
       
 10033 
       
 10034  	index = 0;
       
 10035  	expIndex  = index;
       
 10036 	deleteFlag = ETrue;
       
 10037 	expectData.Close();
       
 10038 	ltsyData2.SerialiseL(expectData);
       
 10039 
       
 10040     iMockLTSY.ExpectL( ECustomDeleteSimCbTopicIPC, expectData);
       
 10041     iMockLTSY.CompleteL( ECustomDeleteSimCbTopicIPC, KErrNone);
       
 10042 
       
 10043     customAPI.DeleteSimCbTopic(requestStatus, index);
       
 10044 	
       
 10045 	User::WaitForRequest(requestStatus);	
       
 10046 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
 10047 
       
 10048 	AssertMockLtsyStatusL();
       
 10049 
       
 10050 	CleanupStack::PopAndDestroy(3, this); 	
       
 10051 	
       
 10052 	}
       
 10053 
       
 10054 
       
 10055 /**
       
 10056 @SYMTestCaseID BA-CTSY-CIPC-MCDSCT-0002
       
 10057 @SYMComponent  telephony_ctsy
       
 10058 @SYMTestCaseDesc Test support in CTSY for cancelling of RMmCustomAPI::DeleteSimCbTopic
       
 10059 @SYMTestPriority High
       
 10060 @SYMTestActions Invokes cancelling of RMmCustomAPI::DeleteSimCbTopic
       
 10061 @SYMTestExpectedResults Pass
       
 10062 @SYMTestType CT
       
 10063 */
       
 10064 void CCTsyCustomIPCFU::TestDeleteSimCbTopic0002L()
       
 10065 	{
       
 10066 
       
 10067 	OpenEtelServerL(EUseExtendedError);
       
 10068 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
 10069 	OpenPhoneL();
       
 10070 
       
 10071 	RMmCustomAPI customAPI;
       
 10072 	OpenCustomAPILC(customAPI, iPhone);
       
 10073 
       
 10074  	InitSimCbTopicsL(customAPI, _L("Topic"), 0);
       
 10075    
       
 10076     TRequestStatus requestStatus;
       
 10077    
       
 10078 	TUint index(0);
       
 10079 	TUint expIndex(index);
       
 10080 	TBool deleteFlag(ETrue);
       
 10081 
       
 10082 	RBuf8 expectData;
       
 10083 	CleanupClosePushL(expectData);
       
 10084 
       
 10085 	TMockLtsyData2< TUint, TBool > ltsyData2(expIndex, deleteFlag);	
       
 10086 	ltsyData2.SerialiseL(expectData);
       
 10087     		
       
 10088 	TRequestStatus mockLtsyStatus;
       
 10089 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
 10090 
       
 10091  	//-------------------------------------------------------------------------
       
 10092 	// Test cancelling of RMmCustomAPI::DeleteSimCbTopic
       
 10093  	//-------------------------------------------------------------------------
       
 10094 
       
 10095     iMockLTSY.ExpectL( ECustomDeleteSimCbTopicIPC, expectData);    
       
 10096     iMockLTSY.CompleteL( ECustomDeleteSimCbTopicIPC, KErrNone, 20);
       
 10097 
       
 10098     customAPI.DeleteSimCbTopic(requestStatus, index);
       
 10099 	
       
 10100 	customAPI.CancelAsyncRequest(ECustomDeleteSimCbTopicIPC);
       
 10101 
       
 10102 	// operation (ECustomDeleteSimCbTopicIPC) cannot be cancelled on DOS side as per CTSY.
       
 10103 
       
 10104 	User::WaitForRequest(requestStatus);	
       
 10105 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
 10106 
       
 10107 	User::WaitForRequest(mockLtsyStatus);
       
 10108 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
 10109 
       
 10110 	AssertMockLtsyStatusL();
       
 10111 
       
 10112 	CleanupStack::PopAndDestroy(3, this); 	
       
 10113 	
       
 10114 	
       
 10115 	}
       
 10116 
       
 10117 
       
 10118 /**
       
 10119 @SYMTestCaseID BA-CTSY-CIPC-MCDSCT-0003
       
 10120 @SYMComponent  telephony_ctsy
       
 10121 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::DeleteSimCbTopic with bad parameter data
       
 10122 @SYMTestPriority High
       
 10123 @SYMTestActions Invokes RMmCustomAPI::DeleteSimCbTopic with bad parameter data
       
 10124 @SYMTestExpectedResults Pass
       
 10125 @SYMTestType CT
       
 10126 */
       
 10127 void CCTsyCustomIPCFU::TestDeleteSimCbTopic0003L()
       
 10128 	{
       
 10129 
       
 10130 	OpenEtelServerL(EUseExtendedError);
       
 10131 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
 10132 	OpenPhoneL();
       
 10133 
       
 10134 	RMmCustomAPI customAPI;
       
 10135 	OpenCustomAPILC(customAPI, iPhone);
       
 10136 
       
 10137     TRequestStatus requestStatus;
       
 10138    
       
 10139 	RBuf8 expectData;
       
 10140 	CleanupClosePushL(expectData);
       
 10141 
       
 10142 	TUint index(0);
       
 10143 	TUint expIndex(index);
       
 10144 	TBool deleteFlag(EFalse);
       
 10145 
       
 10146 	TMockLtsyData2< TUint, TBool > ltsyData2(expIndex, deleteFlag);	
       
 10147 	ltsyData2.SerialiseL(expectData);
       
 10148     	
       
 10149     iMockLTSY.ExpectL( ECustomDeleteSimCbTopicIPC, expectData);
       
 10150     iMockLTSY.CompleteL( ECustomDeleteSimCbTopicIPC, KErrNone);
       
 10151 
       
 10152 	// Successful completion of ECustomDeleteSimCbTopicIPC request in case of not initialized iSimCbTopics
       
 10153     customAPI.DeleteSimCbTopic(requestStatus, index);
       
 10154 	
       
 10155 	User::WaitForRequest(requestStatus);	
       
 10156 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
 10157 
       
 10158 	AssertMockLtsyStatusL();
       
 10159 
       
 10160 	CleanupStack::PopAndDestroy(3, this); 		
       
 10161 
       
 10162 	}
       
 10163 
       
 10164 
       
 10165 /**
       
 10166 @SYMTestCaseID BA-CTSY-CIPC-MCDSCT-0004
       
 10167 @SYMComponent  telephony_ctsy
       
 10168 @SYMTestCaseDesc Test support in CTSY for multiple client requests to RMmCustomAPI::DeleteSimCbTopic
       
 10169 @SYMTestPriority High
       
 10170 @SYMTestActions Invokes multiple client requests to RMmCustomAPI::DeleteSimCbTopic
       
 10171 @SYMTestExpectedResults Pass
       
 10172 @SYMTestType CT
       
 10173 */
       
 10174 void CCTsyCustomIPCFU::TestDeleteSimCbTopic0004L()
       
 10175 	{
       
 10176 
       
 10177 	OpenEtelServerL(EUseExtendedError);
       
 10178 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
 10179 	OpenPhoneL();
       
 10180 
       
 10181 	// Open second client
       
 10182 	RTelServer telServer2;
       
 10183 	TInt ret = telServer2.Connect();
       
 10184 	ASSERT_EQUALS(KErrNone, ret);
       
 10185 	CleanupClosePushL(telServer2);
       
 10186 
       
 10187 	RMobilePhone phone2;
       
 10188 	ret = phone2.Open(telServer2,KMmTsyPhoneName);
       
 10189 	ASSERT_EQUALS(KErrNone, ret);
       
 10190 	CleanupClosePushL(phone2);
       
 10191 
       
 10192 	RMmCustomAPI customAPI;
       
 10193 	OpenCustomAPILC(customAPI, iPhone);
       
 10194 
       
 10195 	RMmCustomAPI customAPI2;
       
 10196 	OpenCustomAPILC(customAPI2, phone2, EFalse);
       
 10197 
       
 10198  	InitSimCbTopicsL(customAPI, _L("Topic"), 0);
       
 10199 
       
 10200     TRequestStatus requestStatus;
       
 10201     TRequestStatus requestStatus2;
       
 10202 
       
 10203 	TUint index(0);
       
 10204 	TUint index2(0);
       
 10205 	TUint expIndex(index);
       
 10206 	TBool deleteFlag(ETrue);
       
 10207 
       
 10208 	RBuf8 expectData;
       
 10209 	CleanupClosePushL(expectData);
       
 10210 
       
 10211 	TMockLtsyData2< TUint, TBool > ltsyData2(expIndex, deleteFlag);	
       
 10212 	ltsyData2.SerialiseL(expectData);
       
 10213     	
       
 10214 	//-------------------------------------------------------------------------
       
 10215 	// Test A: Test multiple clients requesting RMmCustomAPI::DeleteSimCbTopic
       
 10216  	//-------------------------------------------------------------------------
       
 10217 
       
 10218     iMockLTSY.ExpectL( ECustomDeleteSimCbTopicIPC, expectData);    
       
 10219     iMockLTSY.CompleteL( ECustomDeleteSimCbTopicIPC, KErrNone, 20);
       
 10220 
       
 10221     customAPI.DeleteSimCbTopic(requestStatus, index);
       
 10222     customAPI2.DeleteSimCbTopic(requestStatus2, index2);
       
 10223     
       
 10224 	User::WaitForRequest(requestStatus);	
       
 10225 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
 10226 
       
 10227 	User::WaitForRequest(requestStatus2);	
       
 10228 	ASSERT_EQUALS(KErrServerBusy, requestStatus2.Int());
       
 10229 
       
 10230 	AssertMockLtsyStatusL();
       
 10231 
       
 10232 	CleanupStack::PopAndDestroy(6, this); // telServer2, phone2, customAPI, customAPI2, expectData, this
       
 10233 
       
 10234 	}
       
 10235 
       
 10236 
       
 10237 /**
       
 10238 @SYMTestCaseID BA-CTSY-CIPC-MCDSCT-0005
       
 10239 @SYMComponent  telephony_ctsy
       
 10240 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::DeleteSimCbTopic with timeout
       
 10241 @SYMTestPriority High
       
 10242 @SYMTestActions Invokes RMmCustomAPI::DeleteSimCbTopic and tests for timeout
       
 10243 @SYMTestExpectedResults Pass
       
 10244 @SYMTestType CT
       
 10245 */
       
 10246 void CCTsyCustomIPCFU::TestDeleteSimCbTopic0005L()
       
 10247 	{
       
 10248 
       
 10249 	OpenEtelServerL(EUseExtendedError);
       
 10250 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
 10251 	OpenPhoneL();
       
 10252 
       
 10253 	RMmCustomAPI customAPI;
       
 10254 	OpenCustomAPILC(customAPI, iPhone);
       
 10255 
       
 10256  	InitSimCbTopicsL(customAPI, _L("Topic"), 0);
       
 10257    
       
 10258     TRequestStatus requestStatus;
       
 10259    
       
 10260 	TUint index(0);
       
 10261 	TUint expIndex(index);
       
 10262 	TBool deleteFlag(ETrue);
       
 10263 
       
 10264 	RBuf8 expectData;
       
 10265 	CleanupClosePushL(expectData);
       
 10266 
       
 10267 	TMockLtsyData2< TUint, TBool > ltsyData2(expIndex, deleteFlag);	
       
 10268 	ltsyData2.SerialiseL(expectData);
       
 10269     		
       
 10270     iMockLTSY.ExpectL( ECustomDeleteSimCbTopicIPC, expectData);    
       
 10271 
       
 10272     customAPI.DeleteSimCbTopic(requestStatus, index);
       
 10273 		
       
 10274 	User::WaitForRequest(requestStatus);	
       
 10275 	ASSERT_EQUALS(KErrTimedOut, requestStatus.Int());
       
 10276 
       
 10277 	AssertMockLtsyStatusL();
       
 10278 
       
 10279 	CleanupStack::PopAndDestroy(3, this); 		
       
 10280 
       
 10281 	}
       
 10282 
       
 10283 
       
 10284 /**
       
 10285 @SYMTestCaseID BA-CTSY-CIPC-MCNNCF-0001
       
 10286 @SYMComponent  telephony_ctsy
       
 10287 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::NotifyNetworkConnectionFailure
       
 10288 @SYMTestPriority High
       
 10289 @SYMTestActions Invokes RMmCustomAPI::NotifyNetworkConnectionFailure
       
 10290 @SYMTestExpectedResults Pass
       
 10291 @SYMTestType CT
       
 10292 */
       
 10293 void CCTsyCustomIPCFU::TestNotifyNetworkConnectionFailure0001L()
       
 10294 	{
       
 10295 
       
 10296 	OpenEtelServerL(EUseExtendedError);
       
 10297 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
 10298 	OpenPhoneL();
       
 10299 
       
 10300 	RMmCustomAPI customAPI;
       
 10301 	OpenCustomAPILC(customAPI, iPhone);
       
 10302 
       
 10303     TRequestStatus requestStatus;
       
 10304 	
       
 10305  	//-------------------------------------------------------------------------
       
 10306 	// TEST E: Unsolicited completion of RMmCustomAPI::NotifyNetworkConnectionFailure
       
 10307 	// from LTSY.
       
 10308 	// The test comes first because the request is self-reposting
       
 10309  	//-------------------------------------------------------------------------
       
 10310 
       
 10311 	TRequestStatus mockLtsyStatus;
       
 10312 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
 10313 
       
 10314     iMockLTSY.CompleteL(ECustomNotifyNetworkConnectionFailureIPC, KErrNone);
       
 10315 
       
 10316 	User::WaitForRequest(mockLtsyStatus);
       
 10317 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
 10318 
       
 10319 	AssertMockLtsyStatusL();
       
 10320 
       
 10321  	//-------------------------------------------------------------------------
       
 10322 	// TEST C: Successful completion request of
       
 10323 	// RMmCustomAPI::NotifyNetworkConnectionFailure when result is not cached.
       
 10324  	//-------------------------------------------------------------------------
       
 10325 
       
 10326     iMockLTSY.CompleteL(ECustomNotifyNetworkConnectionFailureIPC, KErrNone);
       
 10327 
       
 10328 	customAPI.NotifyNetworkConnectionFailure(requestStatus);
       
 10329 	
       
 10330 	User::WaitForRequest(requestStatus);	
       
 10331 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
 10332 
       
 10333 	AssertMockLtsyStatusL();
       
 10334 
       
 10335 	CleanupStack::PopAndDestroy(2, this); 
       
 10336 	
       
 10337 	}
       
 10338 
       
 10339 
       
 10340 /**
       
 10341 @SYMTestCaseID BA-CTSY-CIPC-MCNNCF-0002
       
 10342 @SYMComponent  telephony_ctsy
       
 10343 @SYMTestCaseDesc Test support in CTSY for cancelling of RMmCustomAPI::NotifyNetworkConnectionFailure
       
 10344 @SYMTestPriority High
       
 10345 @SYMTestActions Invokes cancelling of RMmCustomAPI::NotifyNetworkConnectionFailure
       
 10346 @SYMTestExpectedResults Pass
       
 10347 @SYMTestType CT
       
 10348 */
       
 10349 void CCTsyCustomIPCFU::TestNotifyNetworkConnectionFailure0002L()
       
 10350 	{
       
 10351 
       
 10352 	OpenEtelServerL(EUseExtendedError);
       
 10353 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
 10354 	OpenPhoneL();
       
 10355 
       
 10356 	RMmCustomAPI customAPI;
       
 10357 	OpenCustomAPILC(customAPI, iPhone);
       
 10358 
       
 10359     TRequestStatus requestStatus;
       
 10360 	
       
 10361 	TRequestStatus mockLtsyStatus;
       
 10362 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
 10363 
       
 10364  	//-------------------------------------------------------------------------
       
 10365 	// Test cancelling of RMmCustomAPI::NotifyNetworkConnectionFailure
       
 10366  	//-------------------------------------------------------------------------
       
 10367 
       
 10368 	customAPI.NotifyNetworkConnectionFailure(requestStatus);
       
 10369 
       
 10370     iMockLTSY.CompleteL(ECustomNotifyNetworkConnectionFailureIPC, KErrNone, 20);
       
 10371 		
       
 10372 	customAPI.CancelAsyncRequest(ECustomNotifyNetworkConnectionFailureIPC);
       
 10373 
       
 10374 	User::WaitForRequest(requestStatus);	
       
 10375 	ASSERT_EQUALS(KErrCancel, requestStatus.Int());
       
 10376 
       
 10377 	User::WaitForRequest(mockLtsyStatus);
       
 10378 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
 10379 
       
 10380 	CleanupStack::PopAndDestroy(2); 
       
 10381 	
       
 10382 	}
       
 10383 
       
 10384 
       
 10385 /**
       
 10386 @SYMTestCaseID BA-CTSY-CIPC-MCNNCF-0004
       
 10387 @SYMComponent  telephony_ctsy
       
 10388 @SYMTestCaseDesc Test support in CTSY for multiple client requests to RMmCustomAPI::NotifyNetworkConnectionFailure
       
 10389 @SYMTestPriority High
       
 10390 @SYMTestActions Invokes multiple client requests to RMmCustomAPI::NotifyNetworkConnectionFailure
       
 10391 @SYMTestExpectedResults Pass
       
 10392 @SYMTestType CT
       
 10393 */
       
 10394 void CCTsyCustomIPCFU::TestNotifyNetworkConnectionFailure0004L()
       
 10395 	{
       
 10396 
       
 10397 	OpenEtelServerL(EUseExtendedError);
       
 10398 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
 10399 	OpenPhoneL();
       
 10400 
       
 10401 	RTelServer telServer2;
       
 10402 	TInt ret = telServer2.Connect();
       
 10403 	ASSERT_EQUALS(KErrNone, ret);
       
 10404 	CleanupClosePushL(telServer2);
       
 10405 
       
 10406 	RMobilePhone phone2;
       
 10407 	ret = phone2.Open(telServer2,KMmTsyPhoneName);
       
 10408 	ASSERT_EQUALS(KErrNone, ret);
       
 10409 	CleanupClosePushL(phone2);
       
 10410 
       
 10411 
       
 10412 	RMmCustomAPI customAPI;
       
 10413 	OpenCustomAPILC(customAPI, iPhone);
       
 10414 
       
 10415 	RMmCustomAPI customAPI2;
       
 10416 	OpenCustomAPILC(customAPI2, phone2, EFalse);
       
 10417 
       
 10418 	TRequestStatus requestStatus;
       
 10419 	TRequestStatus requestStatus2;
       
 10420 
       
 10421 	//-------------------------------------------------------------------------
       
 10422 	// Test A: Test multiple clients requesting RMmCustomAPI::NotifyNetworkConnectionFailure
       
 10423  	//-------------------------------------------------------------------------
       
 10424 
       
 10425     iMockLTSY.CompleteL(ECustomNotifyNetworkConnectionFailureIPC, KErrNone, 20);
       
 10426 
       
 10427 	customAPI.NotifyNetworkConnectionFailure(requestStatus);
       
 10428 	customAPI2.NotifyNetworkConnectionFailure(requestStatus2);
       
 10429 
       
 10430 	User::WaitForRequest(requestStatus);	
       
 10431 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
 10432 
       
 10433 	User::WaitForRequest(requestStatus2);	
       
 10434 	ASSERT_EQUALS(KErrNone, requestStatus2.Int());
       
 10435 
       
 10436 	AssertMockLtsyStatusL();
       
 10437 
       
 10438 	CleanupStack::PopAndDestroy(5, this);
       
 10439 	
       
 10440 	}
       
 10441 
       
 10442 
       
 10443 
       
 10444 /**
       
 10445 @SYMTestCaseID BA-CTSY-CIPC-MCSAR-0001
       
 10446 @SYMComponent  telephony_ctsy
       
 10447 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::SendAPDUReq
       
 10448 @SYMTestPriority High
       
 10449 @SYMTestActions Invokes RMmCustomAPI::SendAPDUReq
       
 10450 @SYMTestExpectedResults Pass
       
 10451 @SYMTestType CT
       
 10452 */
       
 10453 void CCTsyCustomIPCFU::TestSendAPDUReq0001L()
       
 10454 	{
       
 10455 
       
 10456 	OpenEtelServerL(EUseExtendedError);
       
 10457 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
 10458 	OpenPhoneL();
       
 10459 
       
 10460 	RMmCustomAPI   customAPI;
       
 10461 	OpenCustomAPILC(customAPI, iPhone);
       
 10462 	
       
 10463 	TInt           cardReaderId = 1; 
       
 10464 	_LIT8(KCmdData, "1234");
       
 10465 	CmdDataBuf       cmdData(KCmdData);	
       
 10466 
       
 10467     TRequestStatus requestStatus;
       
 10468 	RMmCustomAPI::TApduParameters apdu;
       
 10469 	
       
 10470 	apdu.iCardReaderId = cardReaderId;
       
 10471 	apdu.iCmdData.Copy(cmdData);
       
 10472    
       
 10473 	RBuf8 expectData;
       
 10474 	CleanupClosePushL(expectData);
       
 10475 
       
 10476 	RBuf8 compData;
       
 10477 	CleanupClosePushL(compData);
       
 10478 	
       
 10479 	TMockLtsyData1< RMmCustomAPI::TApduParameters > ltsyData(apdu);	
       
 10480 	ltsyData.SerialiseL(expectData);
       
 10481     	
       
 10482  	//-------------------------------------------------------------------------
       
 10483 	// TEST A: failure to dispatch request to LTSY
       
 10484  	//-------------------------------------------------------------------------
       
 10485 
       
 10486     iMockLTSY.ExpectL( ECustomSendAPDUReqV2IPC, expectData, KErrNotSupported);
       
 10487     customAPI.SendAPDUReq(requestStatus, apdu);
       
 10488 	
       
 10489 	User::WaitForRequest(requestStatus);	
       
 10490 	ASSERT_EQUALS(KErrNotSupported, requestStatus.Int());
       
 10491 
       
 10492 	AssertMockLtsyStatusL();
       
 10493 
       
 10494 	//-------------------------------------------------------------------------
       
 10495 	// TEST B: failure on completion of pending request from LTSY->CTSY
       
 10496  	//-------------------------------------------------------------------------
       
 10497 
       
 10498     iMockLTSY.ExpectL( ECustomSendAPDUReqV2IPC, expectData);
       
 10499     
       
 10500     _LIT8(KRspData,"ApduResponse");
       
 10501     RspDataBuf rspData(KRspData);    
       
 10502 
       
 10503     TMockLtsyData1< RspDataBuf > ltsyRetData(rspData);
       
 10504     ltsyRetData.SerialiseL(compData);       
       
 10505     
       
 10506     iMockLTSY.CompleteL( ECustomSendAPDUReqV2IPC, KErrGeneral, compData);
       
 10507 
       
 10508     customAPI.SendAPDUReq (requestStatus, apdu);
       
 10509 	
       
 10510 	User::WaitForRequest(requestStatus);	
       
 10511 	ASSERT_EQUALS(KErrGeneral, requestStatus.Int());
       
 10512 
       
 10513 	AssertMockLtsyStatusL();
       
 10514 
       
 10515  	//-------------------------------------------------------------------------
       
 10516 	// TEST C: Successful completion request of
       
 10517 	// RMmCustomAPI::SendAPDUReq when result is not cached.
       
 10518  	//-------------------------------------------------------------------------
       
 10519 
       
 10520     iMockLTSY.ExpectL( ECustomSendAPDUReqV2IPC, expectData);
       
 10521     iMockLTSY.CompleteL( ECustomSendAPDUReqV2IPC, KErrNone, compData);
       
 10522 
       
 10523     customAPI.SendAPDUReq(requestStatus, apdu);
       
 10524 	
       
 10525 	User::WaitForRequest(requestStatus);	
       
 10526 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
 10527 
       
 10528 	ASSERT_EQUALS(0, (apdu.iCardReaderId != cardReaderId)?1:0);
       
 10529 	ASSERT_EQUALS(0, apdu.iCmdData.Compare(cmdData));
       
 10530 	ASSERT_EQUALS(0, apdu.iRspData.Compare(rspData));
       
 10531 
       
 10532 	AssertMockLtsyStatusL();
       
 10533 
       
 10534  	//-------------------------------------------------------------------------
       
 10535 	// TEST E: Unsolicited completion of RMmCustomAPI::SendAPDUReq
       
 10536 	// from LTSY.
       
 10537  	//-------------------------------------------------------------------------
       
 10538 
       
 10539 	TRequestStatus mockLtsyStatus;
       
 10540 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
 10541 
       
 10542     iMockLTSY.CompleteL( ECustomSendAPDUReqV2IPC, KErrNone, compData);
       
 10543 
       
 10544 	User::WaitForRequest(mockLtsyStatus);
       
 10545 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
 10546 
       
 10547 	AssertMockLtsyStatusL();
       
 10548 	CleanupStack::PopAndDestroy(4, this); 	
       
 10549 	
       
 10550 	}
       
 10551 
       
 10552 
       
 10553 /**
       
 10554 @SYMTestCaseID BA-CTSY-CIPC-MCSAR-0002
       
 10555 @SYMComponent  telephony_ctsy
       
 10556 @SYMTestCaseDesc Test support in CTSY for cancelling of RMmCustomAPI::SendAPDUReq
       
 10557 @SYMTestPriority High
       
 10558 @SYMTestActions Invokes cancelling of RMmCustomAPI::SendAPDUReq
       
 10559 @SYMTestExpectedResults Pass
       
 10560 @SYMTestType CT
       
 10561 */
       
 10562 void CCTsyCustomIPCFU::TestSendAPDUReq0002L()
       
 10563 	{
       
 10564 
       
 10565 	OpenEtelServerL(EUseExtendedError);
       
 10566 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
 10567 	OpenPhoneL();
       
 10568 
       
 10569 	RMmCustomAPI customAPI;
       
 10570 	OpenCustomAPILC(customAPI, iPhone);
       
 10571 
       
 10572     TInt           cardReaderId = 1; 
       
 10573     _LIT8(KCmdData, "1234");
       
 10574     CmdDataBuf      cmdData(KCmdData);   
       
 10575 
       
 10576     TRequestStatus requestStatus;
       
 10577     RMmCustomAPI::TApduParameters apdu;
       
 10578     
       
 10579     apdu.iCardReaderId = cardReaderId;
       
 10580     apdu.iCmdData.Copy(cmdData);
       
 10581    
       
 10582 	RBuf8 expectData;
       
 10583 	CleanupClosePushL(expectData);
       
 10584 
       
 10585 	RBuf8 compData;
       
 10586 	CleanupClosePushL(compData);
       
 10587 	
       
 10588 	TMockLtsyData1< RMmCustomAPI::TApduParameters > ltsyData(apdu);	
       
 10589 	ltsyData.SerialiseL(expectData);
       
 10590 
       
 10591 	
       
 10592  	//-------------------------------------------------------------------------
       
 10593 	// Test cancelling of RMmCustomAPI::SendAPDUReq
       
 10594  	//-------------------------------------------------------------------------
       
 10595 
       
 10596     iMockLTSY.ExpectL( ECustomSendAPDUReqV2IPC, expectData);
       
 10597 
       
 10598     customAPI.SendAPDUReq(requestStatus, apdu);
       
 10599 	
       
 10600 	customAPI.CancelAsyncRequest(ECustomSendAPDUReqV2IPC);
       
 10601 	
       
 10602 	User::WaitForRequest(requestStatus);	
       
 10603 	ASSERT_EQUALS(KErrCancel, requestStatus.Int());
       
 10604 
       
 10605 	TRequestStatus mockLtsyStatus;
       
 10606 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
 10607 	
       
 10608 	
       
 10609     _LIT8(KRspData,"ApduResponse");
       
 10610     RspDataBuf      rspData(KRspData);    
       
 10611 
       
 10612     TMockLtsyData1< RspDataBuf > ltsyRetData(rspData);
       
 10613     ltsyRetData.SerialiseL(compData);  
       
 10614     
       
 10615     iMockLTSY.CompleteL( ECustomSendAPDUReqV2IPC, KErrNone, compData);
       
 10616 
       
 10617 	User::WaitForRequest(mockLtsyStatus);
       
 10618 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
 10619 	
       
 10620 	AssertMockLtsyStatusL();
       
 10621 	CleanupStack::PopAndDestroy(4); 
       
 10622 	
       
 10623 	}
       
 10624 
       
 10625 
       
 10626 /**
       
 10627 @SYMTestCaseID BA-CTSY-CIPC-MCSAR-0003
       
 10628 @SYMComponent  telephony_ctsy
       
 10629 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::SendAPDUReq with bad parameter data
       
 10630 @SYMTestPriority High
       
 10631 @SYMTestActions Invokes RMmCustomAPI::SendAPDUReq with bad parameter data
       
 10632 @SYMTestExpectedResults Pass
       
 10633 @SYMTestType CT
       
 10634 */
       
 10635 void CCTsyCustomIPCFU::TestSendAPDUReq0003L()
       
 10636 	{
       
 10637 
       
 10638 	OpenEtelServerL(EUseExtendedError);
       
 10639 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
 10640 	OpenPhoneL();
       
 10641 
       
 10642 	RMmCustomAPI customAPI;
       
 10643 	OpenCustomAPILC(customAPI, iPhone);
       
 10644 
       
 10645     TInt           cardReaderId = 1; 
       
 10646     _LIT8(KCmdData, "1234");
       
 10647     CmdDataBuf      cmdData(KCmdData);   
       
 10648 
       
 10649     TRequestStatus requestStatus;
       
 10650     RMmCustomAPI::TApduParameters apdu;
       
 10651     
       
 10652     apdu.iCardReaderId = cardReaderId;
       
 10653     apdu.iCmdData.Copy(cmdData);
       
 10654    
       
 10655 	RBuf8 expectData;
       
 10656 	CleanupClosePushL(expectData);
       
 10657 
       
 10658 	RBuf8 compData;
       
 10659 	CleanupClosePushL(compData);
       
 10660 	
       
 10661 	TMockLtsyData1< RMmCustomAPI::TApduParameters > ltsyData(apdu);	
       
 10662 	ltsyData.SerialiseL(expectData);
       
 10663     	
       
 10664     iMockLTSY.ExpectL( ECustomSendAPDUReqV2IPC, expectData);
       
 10665     customAPI.SendAPDUReq(requestStatus, apdu);    
       
 10666 
       
 10667     _LIT8(KRspBig,"bigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbi");
       
 10668     RspBigBuf bigBuf(KRspBig);
       
 10669 
       
 10670 	TMockLtsyData1< TBuf8<300> > ltsyDataComp(bigBuf);
       
 10671     ltsyDataComp.SerialiseL(compData);       
       
 10672    
       
 10673     iMockLTSY.CompleteL( ECustomSendAPDUReqV2IPC, KErrNone, compData);
       
 10674 
       
 10675 	User::WaitForRequest(requestStatus);	
       
 10676 	ASSERT_EQUALS(KErrOverflow, requestStatus.Int());
       
 10677 
       
 10678 	AssertMockLtsyStatusL();
       
 10679 	CleanupStack::PopAndDestroy(4); 
       
 10680 	
       
 10681 	}
       
 10682 
       
 10683 
       
 10684 /**
       
 10685 @SYMTestCaseID BA-CTSY-CIPC-MCSAR-0004
       
 10686 @SYMComponent  telephony_ctsy
       
 10687 @SYMTestCaseDesc Test support in CTSY for multiple client requests to RMmCustomAPI::SendAPDUReq
       
 10688 @SYMTestPriority High
       
 10689 @SYMTestActions Invokes multiple client requests to RMmCustomAPI::SendAPDUReq
       
 10690 @SYMTestExpectedResults Pass
       
 10691 @SYMTestType CT
       
 10692 */
       
 10693 void CCTsyCustomIPCFU::TestSendAPDUReq0004L()
       
 10694 	{
       
 10695 					
       
 10696 	OpenEtelServerL(EUseExtendedError);
       
 10697 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
 10698 	OpenPhoneL();
       
 10699 
       
 10700 	// Open second client
       
 10701 	RTelServer telServer2;
       
 10702 	TInt ret = telServer2.Connect();
       
 10703 	ASSERT_EQUALS(KErrNone, ret);
       
 10704 	CleanupClosePushL(telServer2);
       
 10705 
       
 10706 	RMobilePhone phone2;
       
 10707 	ret = phone2.Open(telServer2,KMmTsyPhoneName);
       
 10708 	ASSERT_EQUALS(KErrNone, ret);
       
 10709 	CleanupClosePushL(phone2);
       
 10710 
       
 10711 	RMmCustomAPI customAPI;
       
 10712 	OpenCustomAPILC(customAPI, iPhone);
       
 10713 
       
 10714 	RMmCustomAPI customAPI2;
       
 10715 	OpenCustomAPILC(customAPI2, phone2, EFalse);
       
 10716 
       
 10717 
       
 10718     TInt           cardReaderId = 1; 
       
 10719     _LIT8(KCmdData, "1234");
       
 10720     CmdDataBuf      cmdData(KCmdData);   
       
 10721 
       
 10722     TRequestStatus requestStatus;
       
 10723     RMmCustomAPI::TApduParameters apdu;
       
 10724     
       
 10725     apdu.iCardReaderId = cardReaderId;
       
 10726     apdu.iCmdData.Copy(cmdData);
       
 10727    
       
 10728 	RBuf8 expectData;
       
 10729 	CleanupClosePushL(expectData);
       
 10730 
       
 10731 	RBuf8 compData;
       
 10732 	CleanupClosePushL(compData);
       
 10733 	
       
 10734 	TMockLtsyData1< RMmCustomAPI::TApduParameters > ltsyData(apdu);	
       
 10735 	ltsyData.SerialiseL(expectData);
       
 10736     	
       
 10737 	
       
 10738     iMockLTSY.ExpectL( ECustomSendAPDUReqV2IPC, expectData);
       
 10739 
       
 10740     
       
 10741     _LIT8(KRspData,"ApduResponse");
       
 10742     RspDataBuf     rspData(KRspData);    
       
 10743 
       
 10744     TMockLtsyData1< TBuf8<20> > ltsyRetData(rspData);
       
 10745     ltsyRetData.SerialiseL(compData);        
       
 10746     
       
 10747     iMockLTSY.CompleteL(ECustomSendAPDUReqV2IPC, KErrNone, compData, 20);
       
 10748 
       
 10749 	//sending request to the first client
       
 10750     customAPI.SendAPDUReq(requestStatus, apdu);
       
 10751   
       
 10752     TRequestStatus requestStatus2;
       
 10753     RMmCustomAPI::TApduParameters apdu2; // empty request as api cannot be called twice 
       
 10754  
       
 10755 
       
 10756 	//sending request to the second client
       
 10757     customAPI2.SendAPDUReq(requestStatus2, apdu2);
       
 10758 
       
 10759 	User::WaitForRequest(requestStatus);	
       
 10760 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
 10761 
       
 10762 	User::WaitForRequest(requestStatus2);	
       
 10763 	ASSERT_EQUALS(KErrServerBusy, requestStatus2.Int());
       
 10764 	
       
 10765 	AssertMockLtsyStatusL();
       
 10766 
       
 10767 	CleanupStack::PopAndDestroy(7, this);
       
 10768 
       
 10769 	}
       
 10770 
       
 10771 
       
 10772 /**
       
 10773 @SYMTestCaseID BA-CTSY-CIPC-MCSAR-0005
       
 10774 @SYMComponent  telephony_ctsy
       
 10775 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::SendAPDUReq with timeout
       
 10776 @SYMTestPriority High
       
 10777 @SYMTestActions Invokes RMmCustomAPI::SendAPDUReq and tests for timeout
       
 10778 @SYMTestExpectedResults Pass
       
 10779 @SYMTestType CT
       
 10780 */
       
 10781 void CCTsyCustomIPCFU::TestSendAPDUReq0005L()
       
 10782 	{
       
 10783 
       
 10784 	OpenEtelServerL(EUseExtendedError);
       
 10785 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
 10786 	OpenPhoneL();
       
 10787 
       
 10788 	RMmCustomAPI customAPI;
       
 10789 	OpenCustomAPILC(customAPI, iPhone);
       
 10790 
       
 10791     _LIT8(KCmdData, "1234");
       
 10792     CmdDataBuf      cmdData(KCmdData);   
       
 10793 
       
 10794     TRequestStatus requestStatus;
       
 10795     RMmCustomAPI::TApduParameters apdu;
       
 10796    
       
 10797 	RBuf8 expectData;
       
 10798 	CleanupClosePushL(expectData);
       
 10799 
       
 10800 	TMockLtsyData1< RMmCustomAPI::TApduParameters > ltsyData(apdu);	
       
 10801 	ltsyData.SerialiseL(expectData);
       
 10802 	
       
 10803     iMockLTSY.ExpectL(ECustomSendAPDUReqV2IPC, expectData);
       
 10804 
       
 10805     customAPI.SendAPDUReq(requestStatus, apdu);
       
 10806 
       
 10807 	User::WaitForRequest(requestStatus);	
       
 10808 	ASSERT_EQUALS(KErrTimedOut, requestStatus.Int());
       
 10809 	
       
 10810 	AssertMockLtsyStatusL();
       
 10811 	CleanupStack::PopAndDestroy(3); 
       
 10812 	
       
 10813 	}
       
 10814 
       
 10815 
       
 10816 /**
       
 10817 @SYMTestCaseID BA-CTSY-CIPC-MCDPL-0001
       
 10818 @SYMComponent  telephony_ctsy
       
 10819 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::DisablePhoneLock
       
 10820 @SYMTestPriority High
       
 10821 @SYMTestActions Invokes RMmCustomAPI::DisablePhoneLock
       
 10822 @SYMTestExpectedResults Pass
       
 10823 @SYMTestType CT
       
 10824 */
       
 10825 void CCTsyCustomIPCFU::TestDisablePhoneLock0001L()
       
 10826 	{
       
 10827 
       
 10828 	OpenEtelServerL(EUseExtendedError);
       
 10829 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
 10830 	OpenPhoneL();
       
 10831 
       
 10832 	RMmCustomAPI customAPI;
       
 10833 	OpenCustomAPILC(customAPI, iPhone);
       
 10834 
       
 10835 	_LIT(KPassword, "password");
       
 10836 
       
 10837     TRequestStatus requestStatus;
       
 10838     RMobilePhone::TMobilePassword pswd(KPassword);
       
 10839    
       
 10840 	RBuf8 expectData;
       
 10841 	CleanupClosePushL(expectData);
       
 10842 
       
 10843 	TMockLtsyData1< RMobilePhone::TMobilePassword > ltsyData(pswd);	
       
 10844 	ltsyData.SerialiseL(expectData);
       
 10845     	
       
 10846  	//-------------------------------------------------------------------------
       
 10847 	// TEST A: failure to dispatch request to LTSY
       
 10848  	//-------------------------------------------------------------------------
       
 10849 
       
 10850     iMockLTSY.ExpectL( ECustomDisablePhoneLockIPC, expectData, KErrNotSupported);
       
 10851     
       
 10852     customAPI.DisablePhoneLock(requestStatus, pswd);
       
 10853 	
       
 10854 	User::WaitForRequest(requestStatus);	
       
 10855 	ASSERT_EQUALS(KErrNotSupported, requestStatus.Int());
       
 10856 
       
 10857 	AssertMockLtsyStatusL();
       
 10858 
       
 10859 	//-------------------------------------------------------------------------
       
 10860 	// TEST B: failure on completion of pending request from LTSY->CTSY
       
 10861  	//-------------------------------------------------------------------------
       
 10862 
       
 10863     iMockLTSY.ExpectL( ECustomDisablePhoneLockIPC, expectData);    
       
 10864     iMockLTSY.CompleteL( ECustomDisablePhoneLockIPC, KErrGeneral);
       
 10865 
       
 10866     customAPI.DisablePhoneLock(requestStatus, pswd);
       
 10867 	
       
 10868 	User::WaitForRequest(requestStatus);	
       
 10869 	ASSERT_EQUALS(KErrGeneral, requestStatus.Int());
       
 10870 
       
 10871 	AssertMockLtsyStatusL();
       
 10872 
       
 10873  	//-------------------------------------------------------------------------
       
 10874 	// TEST C: Successful completion request of
       
 10875 	// RMmCustomAPI::DisablePhoneLock when result is not cached.
       
 10876  	//-------------------------------------------------------------------------
       
 10877 
       
 10878     iMockLTSY.ExpectL( ECustomDisablePhoneLockIPC, expectData);
       
 10879     iMockLTSY.CompleteL( ECustomDisablePhoneLockIPC, KErrNone);
       
 10880 
       
 10881     customAPI.DisablePhoneLock(requestStatus, pswd);
       
 10882 	
       
 10883 	User::WaitForRequest(requestStatus);	
       
 10884 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
 10885 
       
 10886 	AssertMockLtsyStatusL();
       
 10887 
       
 10888  	//-------------------------------------------------------------------------
       
 10889 	// TEST E: Unsolicited completion of RMmCustomAPI::DisablePhoneLock
       
 10890 	// from LTSY.
       
 10891  	//-------------------------------------------------------------------------
       
 10892 
       
 10893 	TRequestStatus mockLtsyStatus;
       
 10894 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
 10895 
       
 10896     iMockLTSY.CompleteL( ECustomDisablePhoneLockIPC, KErrNone);
       
 10897 
       
 10898 	User::WaitForRequest(mockLtsyStatus);
       
 10899 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
 10900 
       
 10901 	AssertMockLtsyStatusL();
       
 10902 	CleanupStack::PopAndDestroy(3, this); 	
       
 10903 	
       
 10904 	}
       
 10905 
       
 10906 
       
 10907 /**
       
 10908 @SYMTestCaseID BA-CTSY-CIPC-MCDPL-0002
       
 10909 @SYMComponent  telephony_ctsy
       
 10910 @SYMTestCaseDesc Test support in CTSY for cancelling of RMmCustomAPI::DisablePhoneLock
       
 10911 @SYMTestPriority High
       
 10912 @SYMTestActions Invokes cancelling of RMmCustomAPI::DisablePhoneLock
       
 10913 @SYMTestExpectedResults Pass
       
 10914 @SYMTestType CT
       
 10915 */
       
 10916 void CCTsyCustomIPCFU::TestDisablePhoneLock0002L()
       
 10917 	{
       
 10918 
       
 10919 	OpenEtelServerL(EUseExtendedError);
       
 10920 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
 10921 	OpenPhoneL();
       
 10922 
       
 10923 	RMmCustomAPI customAPI;
       
 10924 	OpenCustomAPILC(customAPI, iPhone);
       
 10925 
       
 10926 	_LIT(KPassword, "password");
       
 10927 
       
 10928     TRequestStatus requestStatus;
       
 10929     RMobilePhone::TMobilePassword pswd(KPassword);
       
 10930    
       
 10931 	RBuf8 expectData;
       
 10932 	CleanupClosePushL(expectData);
       
 10933 
       
 10934 	TMockLtsyData1< RMobilePhone::TMobilePassword > ltsyData(pswd);	
       
 10935 	ltsyData.SerialiseL(expectData);
       
 10936     		
       
 10937 	TRequestStatus mockLtsyStatus;
       
 10938 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
 10939 
       
 10940  	//-------------------------------------------------------------------------
       
 10941 	// Test cancelling of RMmCustomAPI::DisablePhoneLock
       
 10942  	//-------------------------------------------------------------------------
       
 10943 
       
 10944     iMockLTSY.ExpectL( ECustomDisablePhoneLockIPC, expectData);    
       
 10945     iMockLTSY.CompleteL( ECustomDisablePhoneLockIPC, KErrNone, 20);
       
 10946 
       
 10947     customAPI.DisablePhoneLock(requestStatus, pswd);
       
 10948 	
       
 10949 	customAPI.CancelAsyncRequest(ECustomDisablePhoneLockIPC);
       
 10950 
       
 10951 	User::WaitForRequest(requestStatus);	
       
 10952 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
 10953 
       
 10954 	User::WaitForRequest(mockLtsyStatus);
       
 10955 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
 10956 
       
 10957 	AssertMockLtsyStatusL();
       
 10958 
       
 10959 	CleanupStack::PopAndDestroy(3, this); 	
       
 10960 	
       
 10961 	}
       
 10962 
       
 10963 
       
 10964 
       
 10965 /**
       
 10966 @SYMTestCaseID BA-CTSY-CIPC-MCDPL-0004
       
 10967 @SYMComponent  telephony_ctsy
       
 10968 @SYMTestCaseDesc Test support in CTSY for multiple client requests to RMmCustomAPI::DisablePhoneLock
       
 10969 @SYMTestPriority High
       
 10970 @SYMTestActions Invokes multiple client requests to RMmCustomAPI::DisablePhoneLock
       
 10971 @SYMTestExpectedResults Pass
       
 10972 @SYMTestType CT
       
 10973 */
       
 10974 void CCTsyCustomIPCFU::TestDisablePhoneLock0004L()
       
 10975 	{
       
 10976 
       
 10977 	OpenEtelServerL(EUseExtendedError);
       
 10978 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
 10979 	OpenPhoneL();
       
 10980 
       
 10981 	// Open second client
       
 10982 	RTelServer telServer2;
       
 10983 	TInt ret = telServer2.Connect();
       
 10984 	ASSERT_EQUALS(KErrNone, ret);
       
 10985 	CleanupClosePushL(telServer2);
       
 10986 
       
 10987 	RMobilePhone phone2;
       
 10988 	ret = phone2.Open(telServer2,KMmTsyPhoneName);
       
 10989 	ASSERT_EQUALS(KErrNone, ret);
       
 10990 	CleanupClosePushL(phone2);
       
 10991 
       
 10992 	RMmCustomAPI customAPI;
       
 10993 	OpenCustomAPILC(customAPI, iPhone);
       
 10994 
       
 10995 	RMmCustomAPI customAPI2;
       
 10996 	OpenCustomAPILC(customAPI2, phone2, EFalse);
       
 10997 
       
 10998     TRequestStatus requestStatus;
       
 10999     TRequestStatus requestStatus2;
       
 11000 
       
 11001 	_LIT(KPassword, "password");
       
 11002 
       
 11003     RMobilePhone::TMobilePassword pswd(KPassword);
       
 11004     RMobilePhone::TMobilePassword pswd2(KPassword);
       
 11005    
       
 11006 	RBuf8 expectData;
       
 11007 	CleanupClosePushL(expectData);
       
 11008 
       
 11009 	TMockLtsyData1< RMobilePhone::TMobilePassword > ltsyData(pswd);	
       
 11010 	ltsyData.SerialiseL(expectData);
       
 11011 	
       
 11012 	//-------------------------------------------------------------------------
       
 11013 	// Test A: Test multiple clients requesting RMmCustomAPI::DisablePhoneLock
       
 11014  	//-------------------------------------------------------------------------
       
 11015 
       
 11016     iMockLTSY.ExpectL( ECustomDisablePhoneLockIPC, expectData);    
       
 11017     iMockLTSY.CompleteL( ECustomDisablePhoneLockIPC, KErrNone, 20);
       
 11018 
       
 11019     customAPI.DisablePhoneLock(requestStatus, pswd);
       
 11020     customAPI2.DisablePhoneLock(requestStatus2, pswd2);
       
 11021     
       
 11022 	User::WaitForRequest(requestStatus);	
       
 11023 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
 11024 
       
 11025 	User::WaitForRequest(requestStatus2);	
       
 11026 	ASSERT_EQUALS(KErrServerBusy, requestStatus2.Int());
       
 11027 
       
 11028 	AssertMockLtsyStatusL();
       
 11029 
       
 11030 	CleanupStack::PopAndDestroy(6, this);
       
 11031 
       
 11032 	}
       
 11033 
       
 11034 
       
 11035 /**
       
 11036 @SYMTestCaseID BA-CTSY-CIPC-MCDPL-0005
       
 11037 @SYMComponent  telephony_ctsy
       
 11038 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::DisablePhoneLock with timeout
       
 11039 @SYMTestPriority High
       
 11040 @SYMTestActions Invokes RMmCustomAPI::DisablePhoneLock and tests for timeout
       
 11041 @SYMTestExpectedResults Pass
       
 11042 @SYMTestType CT
       
 11043 */
       
 11044 void CCTsyCustomIPCFU::TestDisablePhoneLock0005L()
       
 11045 	{
       
 11046 
       
 11047 	OpenEtelServerL(EUseExtendedError);
       
 11048 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
 11049 	OpenPhoneL();
       
 11050 
       
 11051 	RMmCustomAPI customAPI;
       
 11052 	OpenCustomAPILC(customAPI, iPhone);
       
 11053 
       
 11054 	_LIT(KPassword, "password");
       
 11055 
       
 11056     TRequestStatus requestStatus;
       
 11057     RMobilePhone::TMobilePassword pswd(KPassword);
       
 11058    
       
 11059 	RBuf8 expectData;
       
 11060 	CleanupClosePushL(expectData);
       
 11061 
       
 11062 	TMockLtsyData1< RMobilePhone::TMobilePassword > ltsyData(pswd);	
       
 11063 	ltsyData.SerialiseL(expectData);
       
 11064 	
       
 11065     iMockLTSY.ExpectL( ECustomDisablePhoneLockIPC, expectData);
       
 11066 
       
 11067 	ERR_PRINTF2(_L("<font color=Orange>$CTSYKnownFailure: defect id = %d</font>"), 404602);
       
 11068 	//Request ECustomDisablePhoneLockIPC is not completed by timeout. 		
       
 11069 	
       
 11070 	//The test is stopped to avoid blocking of next tests.
       
 11071 	ASSERT_TRUE(EFalse);
       
 11072     
       
 11073     customAPI.DisablePhoneLock(requestStatus, pswd);
       
 11074 	
       
 11075 	User::WaitForRequest(requestStatus);	
       
 11076 	ASSERT_EQUALS(KErrTimedOut, requestStatus.Int());
       
 11077 
       
 11078 	AssertMockLtsyStatusL();
       
 11079 
       
 11080 	CleanupStack::PopAndDestroy(3); 	
       
 11081 
       
 11082 	}
       
 11083 
       
 11084 
       
 11085 /**
       
 11086 @SYMTestCaseID BA-CTSY-CIPC-MCNEIC-0001
       
 11087 @SYMComponent  telephony_ctsy
       
 11088 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::NotifyEGprsInfoChange
       
 11089 @SYMTestPriority High
       
 11090 @SYMTestActions Invokes RMmCustomAPI::NotifyEGprsInfoChange
       
 11091 @SYMTestExpectedResults Pass
       
 11092 @SYMTestType CT
       
 11093 */
       
 11094 void CCTsyCustomIPCFU::TestNotifyEGprsInfoChange0001L()
       
 11095 	{
       
 11096 
       
 11097 	OpenEtelServerL(EUseExtendedError);
       
 11098 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
 11099 	OpenPhoneL();
       
 11100 
       
 11101 	RMmCustomAPI customAPI;
       
 11102 	OpenCustomAPILC(customAPI, iPhone);
       
 11103 
       
 11104 	RPacketService packetService;		
       
 11105 
       
 11106 	OpenPacketServiceL(packetService);
       
 11107 	CleanupClosePushL(packetService);
       
 11108 
       
 11109 	RBuf8 data;
       
 11110 	CleanupClosePushL(data);
       
 11111 
       
 11112     TRequestStatus requestStatus;
       
 11113     RMmCustomAPI::TGprsInformation info;
       
 11114     TPckg<RMmCustomAPI::TGprsInformation> infoPckg(info);    
       
 11115 
       
 11116  	//-------------------------------------------------------------------------
       
 11117 	// TEST E: Unsolicited completion of RMmCustomAPI::NotifyEGprsInfoChange
       
 11118 	// from LTSY.
       
 11119  	//-------------------------------------------------------------------------
       
 11120 
       
 11121 	TBool lastEdgeGprsSupport = ETrue;	
       
 11122 	TMockLtsyData1 <TBool> ltsyData(lastEdgeGprsSupport);
       
 11123 	ltsyData.SerialiseL(data);	
       
 11124 		
       
 11125  	TRequestStatus mockLtsyStatus;
       
 11126 	iMockLTSY.NotifyTerminated(mockLtsyStatus);		
       
 11127 	iMockLTSY.CompleteL(EMmTsyNotifyEGprsInfoChangeIPC, KErrNone, data);	
       
 11128 	User::WaitForRequest(mockLtsyStatus);
       
 11129 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());			
       
 11130 	AssertMockLtsyStatusL();	
       
 11131 
       
 11132  	//-------------------------------------------------------------------------
       
 11133 	// TEST C: Successful completion request of
       
 11134 	// RMmCustomAPI::NotifyEGprsInfoChange when result is not cached.
       
 11135  	//-------------------------------------------------------------------------
       
 11136 
       
 11137     customAPI.NotifyEGprsInfoChange(requestStatus, infoPckg);	
       
 11138 	
       
 11139 	iMockLTSY.CompleteL(EMmTsyNotifyEGprsInfoChangeIPC, KErrNone, data);	
       
 11140 
       
 11141 	User::WaitForRequest(requestStatus);	
       
 11142 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
 11143 
       
 11144     ASSERT_TRUE( RMmCustomAPI::EEdgeGprs == info.iGprsInfo);
       
 11145 
       
 11146 	AssertMockLtsyStatusL();	
       
 11147 
       
 11148  	//-------------------------------------------------------------------------
       
 11149 	// TEST C2: Successful completion request of
       
 11150 	// RMmCustomAPI::NotifyEGprsInfoChange
       
 11151  	//-------------------------------------------------------------------------
       
 11152 
       
 11153 	lastEdgeGprsSupport = EFalse;	
       
 11154 
       
 11155 	data.Close();
       
 11156 	ltsyData.SerialiseL(data);	
       
 11157 
       
 11158     customAPI.NotifyEGprsInfoChange(requestStatus, infoPckg);	
       
 11159 	
       
 11160 	iMockLTSY.CompleteL(EMmTsyNotifyEGprsInfoChangeIPC, KErrNone, data);	
       
 11161 
       
 11162 	User::WaitForRequest(requestStatus);	
       
 11163 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
 11164 
       
 11165     ASSERT_TRUE( RMmCustomAPI::EGprs == info.iGprsInfo);
       
 11166 
       
 11167 	AssertMockLtsyStatusL();	
       
 11168 
       
 11169 	CleanupStack::PopAndDestroy(4, this); 	
       
 11170 	
       
 11171 	}
       
 11172 
       
 11173 
       
 11174 /**
       
 11175 @SYMTestCaseID BA-CTSY-CIPC-MCNEIC-0002
       
 11176 @SYMComponent  telephony_ctsy
       
 11177 @SYMTestCaseDesc Test support in CTSY for cancelling of RMmCustomAPI::NotifyEGprsInfoChange
       
 11178 @SYMTestPriority High
       
 11179 @SYMTestActions Invokes cancelling of RMmCustomAPI::NotifyEGprsInfoChange
       
 11180 @SYMTestExpectedResults Pass
       
 11181 @SYMTestType CT
       
 11182 */
       
 11183 void CCTsyCustomIPCFU::TestNotifyEGprsInfoChange0002L()
       
 11184 	{
       
 11185 
       
 11186 	OpenEtelServerL(EUseExtendedError);
       
 11187 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
 11188 	OpenPhoneL();
       
 11189 
       
 11190 	RMmCustomAPI customAPI;
       
 11191 	OpenCustomAPILC(customAPI, iPhone);
       
 11192 
       
 11193 	RPacketService packetService;		
       
 11194 
       
 11195 	OpenPacketServiceL(packetService);
       
 11196 	CleanupClosePushL(packetService);
       
 11197 
       
 11198 	RBuf8 data;
       
 11199 	CleanupClosePushL(data);
       
 11200 
       
 11201     TRequestStatus requestStatus;
       
 11202     RMmCustomAPI::TGprsInformation info;
       
 11203     TPckg<RMmCustomAPI::TGprsInformation> infoPckg(info);    
       
 11204 
       
 11205  	//-------------------------------------------------------------------------
       
 11206 	// Test cancelling of RMmCustomAPI::NotifyEGprsInfoChange
       
 11207  	//-------------------------------------------------------------------------
       
 11208  	
       
 11209     customAPI.NotifyEGprsInfoChange(requestStatus, infoPckg);	
       
 11210     
       
 11211     customAPI.CancelAsyncRequest(ECustomNotifyEGprsInfoChange);
       
 11212     
       
 11213 	User::WaitForRequest(requestStatus);	
       
 11214 	ASSERT_EQUALS(KErrCancel, requestStatus.Int());
       
 11215 
       
 11216 	TBool lastEdgeGprsSupport = ETrue;	
       
 11217 	TMockLtsyData1 <TBool> ltsyData(lastEdgeGprsSupport);
       
 11218 	ltsyData.SerialiseL(data);	
       
 11219 
       
 11220 	TRequestStatus mockLtsyStatus;
       
 11221 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
 11222 		
       
 11223 	iMockLTSY.CompleteL(EMmTsyNotifyEGprsInfoChangeIPC, KErrNone, data);	
       
 11224 	
       
 11225 	User::WaitForRequest(mockLtsyStatus);
       
 11226 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());			
       
 11227 
       
 11228 	AssertMockLtsyStatusL();	
       
 11229 
       
 11230 	CleanupStack::PopAndDestroy(4); 
       
 11231 	
       
 11232 	}
       
 11233 
       
 11234 
       
 11235 /**
       
 11236 @SYMTestCaseID BA-CTSY-CIPC-MCNEIC-0003
       
 11237 @SYMComponent  telephony_ctsy
       
 11238 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::NotifyEGprsInfoChange with bad parameter data
       
 11239 @SYMTestPriority High
       
 11240 @SYMTestActions Invokes RMmCustomAPI::NotifyEGprsInfoChange with bad parameter data
       
 11241 @SYMTestExpectedResults Pass
       
 11242 @SYMTestType CT
       
 11243 */
       
 11244 void CCTsyCustomIPCFU::TestNotifyEGprsInfoChange0003L()
       
 11245 	{
       
 11246 
       
 11247 	OpenEtelServerL(EUseExtendedError);
       
 11248 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
 11249 	OpenPhoneL();
       
 11250 
       
 11251 	RMmCustomAPI customAPI;
       
 11252 	OpenCustomAPILC(customAPI, iPhone);
       
 11253 
       
 11254 	RPacketService packetService;		
       
 11255 
       
 11256 	OpenPacketServiceL(packetService);
       
 11257 	CleanupClosePushL(packetService);
       
 11258 
       
 11259 	RBuf8 data;
       
 11260 	CleanupClosePushL(data);
       
 11261 
       
 11262     TRequestStatus requestStatus;
       
 11263     TBuf8<1> littleBuf;
       
 11264 
       
 11265  	//-------------------------------------------------------------------------
       
 11266 	// Test on passing too little buffer to NotifyEGprsInfoChange
       
 11267  	//-------------------------------------------------------------------------
       
 11268  	
       
 11269     customAPI.NotifyEGprsInfoChange(requestStatus, littleBuf);	
       
 11270     
       
 11271 	TBool lastEdgeGprsSupport = ETrue;	
       
 11272 	TMockLtsyData1 <TBool> ltsyData(lastEdgeGprsSupport);
       
 11273 	ltsyData.SerialiseL(data);
       
 11274 
       
 11275 	User::WaitForRequest(requestStatus);	
       
 11276 	ASSERT_EQUALS(KErrArgument, requestStatus.Int());
       
 11277 
       
 11278 	AssertMockLtsyStatusL();	
       
 11279 
       
 11280 	CleanupStack::PopAndDestroy(4); 
       
 11281 	}
       
 11282 
       
 11283 
       
 11284 /**
       
 11285 @SYMTestCaseID BA-CTSY-CIPC-MCNEIC-0004
       
 11286 @SYMComponent  telephony_ctsy
       
 11287 @SYMTestCaseDesc Test support in CTSY for multiple client requests to RMmCustomAPI::NotifyEGprsInfoChange
       
 11288 @SYMTestPriority High
       
 11289 @SYMTestActions Invokes multiple client requests to RMmCustomAPI::NotifyEGprsInfoChange
       
 11290 @SYMTestExpectedResults Pass
       
 11291 @SYMTestType CT
       
 11292 */
       
 11293 void CCTsyCustomIPCFU::TestNotifyEGprsInfoChange0004L()
       
 11294 	{
       
 11295 
       
 11296 	OpenEtelServerL(EUseExtendedError);
       
 11297 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
 11298 	OpenPhoneL();
       
 11299 
       
 11300 	// Open second client
       
 11301 	RTelServer telServer2;
       
 11302 	TInt ret = telServer2.Connect();
       
 11303 	ASSERT_EQUALS(KErrNone, ret);
       
 11304 	CleanupClosePushL(telServer2);
       
 11305 
       
 11306 	RMobilePhone phone2;
       
 11307 	ret = phone2.Open(telServer2,KMmTsyPhoneName);
       
 11308 	ASSERT_EQUALS(KErrNone, ret);
       
 11309 	CleanupClosePushL(phone2);
       
 11310 
       
 11311 	RMmCustomAPI customAPI;
       
 11312 	OpenCustomAPILC(customAPI, iPhone);
       
 11313 
       
 11314 	RMmCustomAPI customAPI2;
       
 11315 	OpenCustomAPILC(customAPI2, phone2, EFalse);
       
 11316 
       
 11317 	RPacketService packetService;		
       
 11318 
       
 11319 	OpenPacketServiceL(packetService);
       
 11320 	CleanupClosePushL(packetService);
       
 11321 
       
 11322 	RPacketService packetService2;                
       
 11323 	ret = packetService2.Open(phone2);
       
 11324 	ASSERT_EQUALS(KErrNone, ret);
       
 11325 	CleanupClosePushL(packetService2);
       
 11326 
       
 11327 	RBuf8 data;
       
 11328 	CleanupClosePushL(data);
       
 11329 
       
 11330     TRequestStatus requestStatus;
       
 11331     TRequestStatus requestStatus2;
       
 11332 	
       
 11333     RMmCustomAPI::TGprsInformation info;
       
 11334     TPckg<RMmCustomAPI::TGprsInformation> infoPckg(info);    
       
 11335 
       
 11336     RMmCustomAPI::TGprsInformation info2;
       
 11337     TPckg<RMmCustomAPI::TGprsInformation> infoPckg2(info2);    
       
 11338 
       
 11339  	
       
 11340 	//-------------------------------------------------------------------------
       
 11341 	// Test A: Test multiple clients requesting RMmCustomAPI::NotifyEGprsInfoChange
       
 11342  	//-------------------------------------------------------------------------
       
 11343     customAPI.NotifyEGprsInfoChange(requestStatus, infoPckg);	
       
 11344     customAPI2.NotifyEGprsInfoChange(requestStatus2, infoPckg2);	
       
 11345 
       
 11346 	TBool lastEdgeGprsSupport = ETrue;	
       
 11347 	TMockLtsyData1 <TBool> ltsyData(lastEdgeGprsSupport);
       
 11348 	ltsyData.SerialiseL(data);	
       
 11349 		
       
 11350 	iMockLTSY.CompleteL(EMmTsyNotifyEGprsInfoChangeIPC, KErrNone, data, 20);	
       
 11351 
       
 11352 	User::WaitForRequest(requestStatus);	
       
 11353 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
 11354 
       
 11355     ASSERT_TRUE( RMmCustomAPI::EEdgeGprs == info.iGprsInfo);
       
 11356 
       
 11357 	User::WaitForRequest(requestStatus2);	
       
 11358 	ASSERT_EQUALS(KErrNone, requestStatus2.Int());
       
 11359 
       
 11360     ASSERT_TRUE( RMmCustomAPI::EEdgeGprs == info2.iGprsInfo);
       
 11361 
       
 11362 	AssertMockLtsyStatusL();	
       
 11363 
       
 11364 	CleanupStack::PopAndDestroy(8, this);
       
 11365 
       
 11366 	}
       
 11367 
       
 11368 
       
 11369 /**
       
 11370 @SYMTestCaseID BA-CTSY-CIPC-MCGEI-0001
       
 11371 @SYMComponent  telephony_ctsy
       
 11372 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::GetEGprsInfo
       
 11373 @SYMTestPriority High
       
 11374 @SYMTestActions Invokes RMmCustomAPI::GetEGprsInfo
       
 11375 @SYMTestExpectedResults Pass
       
 11376 @SYMTestType CT
       
 11377 */
       
 11378 void CCTsyCustomIPCFU::TestGetEGprsInfo0001L()
       
 11379 	{
       
 11380 
       
 11381 	OpenEtelServerL(EUseExtendedError);
       
 11382 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
 11383 	OpenPhoneL();
       
 11384 
       
 11385 	RMmCustomAPI customAPI;
       
 11386 	OpenCustomAPILC(customAPI, iPhone);
       
 11387 
       
 11388 	RPacketService packetService;		
       
 11389 
       
 11390 	OpenPacketServiceL(packetService);
       
 11391 	CleanupClosePushL(packetService);
       
 11392 
       
 11393     TRequestStatus requestStatus;
       
 11394     RMmCustomAPI::TGprsInformation info;
       
 11395     TPckg<RMmCustomAPI::TGprsInformation> infoPckg(info);
       
 11396     
       
 11397 
       
 11398  	//-------------------------------------------------------------------------
       
 11399 	// TEST C: Successful completion request of
       
 11400 	// RMmCustomAPI::GetEGprsInfo when result is not cached.
       
 11401  	//-------------------------------------------------------------------------
       
 11402 
       
 11403     customAPI.GetEGprsInfo(requestStatus, infoPckg);
       
 11404 	
       
 11405 	User::WaitForRequest(requestStatus);	
       
 11406 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
 11407 
       
 11408     ASSERT_TRUE( RMmCustomAPI::EGprs == info.iGprsInfo);
       
 11409 
       
 11410 	AssertMockLtsyStatusL();	
       
 11411 
       
 11412 	// now set EdgeGprs
       
 11413 	
       
 11414 	RBuf8 data;
       
 11415 	CleanupClosePushL(data);
       
 11416 	
       
 11417 	TBool lastEdgeGprsSupport = ETrue;	
       
 11418 	TMockLtsyData1 <TBool> ltsyData(lastEdgeGprsSupport);
       
 11419 	ltsyData.SerialiseL(data);	
       
 11420 		
       
 11421  	TRequestStatus mockLtsyStatus;
       
 11422 	iMockLTSY.NotifyTerminated(mockLtsyStatus);		
       
 11423 	iMockLTSY.CompleteL(EMmTsyNotifyEGprsInfoChangeIPC, KErrNone, data);	
       
 11424 	User::WaitForRequest(mockLtsyStatus);
       
 11425 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());			
       
 11426 	AssertMockLtsyStatusL();	
       
 11427 
       
 11428 
       
 11429  	//-------------------------------------------------------------------------
       
 11430 	// TEST C2: Successful completion request of
       
 11431 	// RMmCustomAPI::GetEGprsInfo when EdgeGprs
       
 11432  	//-------------------------------------------------------------------------
       
 11433 
       
 11434     customAPI.GetEGprsInfo(requestStatus, infoPckg);
       
 11435 	
       
 11436 	User::WaitForRequest(requestStatus);	
       
 11437 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
 11438 
       
 11439     ASSERT_TRUE( RMmCustomAPI::EEdgeGprs == info.iGprsInfo);
       
 11440 
       
 11441 	AssertMockLtsyStatusL();	
       
 11442 
       
 11443 	CleanupStack::PopAndDestroy(4, this); 	
       
 11444 		
       
 11445 	}
       
 11446 
       
 11447 
       
 11448 /**
       
 11449 @SYMTestCaseID BA-CTSY-CIPC-MCGEI-0003
       
 11450 @SYMComponent  telephony_ctsy
       
 11451 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::GetEGprsInfo with bad parameter data
       
 11452 @SYMTestPriority High
       
 11453 @SYMTestActions Invokes RMmCustomAPI::GetEGprsInfo with bad parameter data
       
 11454 @SYMTestExpectedResults Pass
       
 11455 @SYMTestType CT
       
 11456 */
       
 11457 void CCTsyCustomIPCFU::TestGetEGprsInfo0003L()
       
 11458 	{
       
 11459 
       
 11460 	OpenEtelServerL(EUseExtendedError);
       
 11461 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
 11462 	OpenPhoneL();
       
 11463 
       
 11464 	RMmCustomAPI customAPI;
       
 11465 	OpenCustomAPILC(customAPI, iPhone);
       
 11466 
       
 11467     TRequestStatus requestStatus;
       
 11468     RMmCustomAPI::TGprsInformation info;
       
 11469     TPckg<RMmCustomAPI::TGprsInformation> infoPckg(info);
       
 11470     
       
 11471 	// Calling GetEGprsInfo without opening RPacketService
       
 11472 
       
 11473     customAPI.GetEGprsInfo(requestStatus, infoPckg);
       
 11474 	
       
 11475 	User::WaitForRequest(requestStatus);	
       
 11476 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
 11477 
       
 11478 	AssertMockLtsyStatusL();	
       
 11479 	
       
 11480 	
       
 11481 	// test on passing too little buffer
       
 11482 
       
 11483 	RPacketService packetService;		
       
 11484 
       
 11485 	OpenPacketServiceL(packetService);
       
 11486 	CleanupClosePushL(packetService);
       
 11487 		
       
 11488 	TBuf8<1> littleBuf;
       
 11489 
       
 11490     customAPI.GetEGprsInfo(requestStatus, littleBuf);
       
 11491 
       
 11492 	User::WaitForRequest(requestStatus);	
       
 11493 	ASSERT_EQUALS(KErrArgument, requestStatus.Int());
       
 11494 
       
 11495 	CleanupStack::PopAndDestroy(3, this); 			
       
 11496 
       
 11497 	}
       
 11498 
       
 11499 
       
 11500 /**
       
 11501 @SYMTestCaseID BA-CTSY-CIPC-MCRSF-0001
       
 11502 @SYMComponent  telephony_ctsy
       
 11503 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::ReadSimFile
       
 11504 @SYMTestPriority High
       
 11505 @SYMTestActions Invokes RMmCustomAPI::ReadSimFile
       
 11506 @SYMTestExpectedResults Pass
       
 11507 @SYMTestType CT
       
 11508 */
       
 11509 void CCTsyCustomIPCFU::TestReadSimFile0001L()
       
 11510 	{
       
 11511 	
       
 11512 	OpenEtelServerL(EUseExtendedError);
       
 11513 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
 11514 	OpenPhoneL();
       
 11515 
       
 11516 	RMmCustomAPI customAPI;
       
 11517 	OpenCustomAPILC(customAPI, iPhone);
       
 11518 
       
 11519     TRequestStatus requestStatus;
       
 11520 	
       
 11521 	RBuf8 expData;
       
 11522 	CleanupClosePushL(expData);
       
 11523 
       
 11524 	TBuf8<32> responce;
       
 11525 	RMmCustomAPI::TSimFileInfo fileInfo;
       
 11526 	fileInfo.iPath.Fill(0x00);
       
 11527 	fileInfo.iOffSet = 0;
       
 11528 	fileInfo.iSize = responce.Size();
       
 11529 	RMmCustomAPI::TSimFileInfo expFileInfo(fileInfo);
       
 11530 	TPckg<RMmCustomAPI::TSimFileInfo> fileInfoPckg(fileInfo);	
       
 11531 
       
 11532 	TMockLtsyData1< RMmCustomAPI::TSimFileInfo > ltsyData(fileInfo);	    
       
 11533     ltsyData.SerialiseL(expData);       
       
 11534 	
       
 11535  	//-------------------------------------------------------------------------
       
 11536 	// TEST A: failure to dispatch request to LTSY
       
 11537  	//-------------------------------------------------------------------------
       
 11538 
       
 11539     iMockLTSY.ExpectL( ECustomReadSimFileIPC, expData, KErrNotSupported);
       
 11540    
       
 11541     customAPI.ReadSimFile(requestStatus, fileInfoPckg, responce);
       
 11542 	
       
 11543 	User::WaitForRequest(requestStatus);	
       
 11544 	ASSERT_EQUALS(KErrNotSupported, requestStatus.Int());
       
 11545 
       
 11546 	AssertMockLtsyStatusL();
       
 11547 
       
 11548 	//-------------------------------------------------------------------------
       
 11549 	// TEST B: failure on completion of pending request from LTSY->CTSY
       
 11550  	//-------------------------------------------------------------------------
       
 11551 
       
 11552     iMockLTSY.ExpectL( ECustomReadSimFileIPC, expData);
       
 11553 
       
 11554 	_LIT8(KResponce, "Responce");
       
 11555 
       
 11556     iMockLTSY.CompleteL( ECustomReadSimFileIPC, KErrGeneral, KResponce);
       
 11557 
       
 11558     customAPI.ReadSimFile(requestStatus, fileInfoPckg, responce);
       
 11559 	
       
 11560 	User::WaitForRequest(requestStatus);	
       
 11561 	ASSERT_EQUALS(KErrGeneral, requestStatus.Int());
       
 11562 
       
 11563 	AssertMockLtsyStatusL();
       
 11564 
       
 11565  	//-------------------------------------------------------------------------
       
 11566 	// TEST C: Successful completion request of
       
 11567 	// RMmCustomAPI::ReadSimFile when result is not cached.
       
 11568  	//-------------------------------------------------------------------------
       
 11569 
       
 11570     iMockLTSY.ExpectL( ECustomReadSimFileIPC, expData);
       
 11571     iMockLTSY.CompleteL( ECustomReadSimFileIPC, KErrNone, KResponce);
       
 11572 
       
 11573     customAPI.ReadSimFile(requestStatus, fileInfoPckg, responce);
       
 11574 	
       
 11575 	User::WaitForRequest(requestStatus);	
       
 11576 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
 11577 	
       
 11578 	ASSERT_EQUALS(0, responce.Compare(KResponce));
       
 11579 
       
 11580 	AssertMockLtsyStatusL();
       
 11581 
       
 11582  	//-------------------------------------------------------------------------
       
 11583 	// TEST E: Unsolicited completion of RMmCustomAPI::ReadSimFile
       
 11584 	// from LTSY.
       
 11585  	//-------------------------------------------------------------------------
       
 11586 
       
 11587 	TRequestStatus mockLtsyStatus;
       
 11588 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
 11589 
       
 11590     iMockLTSY.CompleteL( ECustomReadSimFileIPC, KErrNone, KResponce);
       
 11591 
       
 11592 	User::WaitForRequest(mockLtsyStatus);
       
 11593 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
 11594 
       
 11595 	AssertMockLtsyStatusL();
       
 11596 	CleanupStack::PopAndDestroy(3, this); 
       
 11597 	
       
 11598 	}
       
 11599 
       
 11600 
       
 11601 /**
       
 11602 @SYMTestCaseID BA-CTSY-CIPC-MCRSF-0002
       
 11603 @SYMComponent  telephony_ctsy
       
 11604 @SYMTestCaseDesc Test support in CTSY for cancelling of RMmCustomAPI::ReadSimFile
       
 11605 @SYMTestPriority High
       
 11606 @SYMTestActions Invokes cancelling of RMmCustomAPI::ReadSimFile
       
 11607 @SYMTestExpectedResults Pass
       
 11608 @SYMTestType CT
       
 11609 */
       
 11610 void CCTsyCustomIPCFU::TestReadSimFile0002L()
       
 11611 	{
       
 11612 
       
 11613 	OpenEtelServerL(EUseExtendedError);
       
 11614 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
 11615 	OpenPhoneL();
       
 11616 
       
 11617 	RMmCustomAPI customAPI;
       
 11618 	OpenCustomAPILC(customAPI, iPhone);
       
 11619 
       
 11620 	TRequestStatus mockLtsyStatus;
       
 11621 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
 11622 
       
 11623     TRequestStatus requestStatus;
       
 11624 	
       
 11625 	RBuf8 expData;
       
 11626 	CleanupClosePushL(expData);
       
 11627 
       
 11628 	TBuf8<32> responce;
       
 11629 	RMmCustomAPI::TSimFileInfo fileInfo;
       
 11630 	fileInfo.iPath.Fill(0x00);
       
 11631 	fileInfo.iOffSet = 0;
       
 11632 	fileInfo.iSize = responce.Size();
       
 11633 	RMmCustomAPI::TSimFileInfo expFileInfo(fileInfo);
       
 11634 	TPckg<RMmCustomAPI::TSimFileInfo> fileInfoPckg(fileInfo);	
       
 11635 
       
 11636 	TMockLtsyData1< RMmCustomAPI::TSimFileInfo > ltsyData(fileInfo);	    
       
 11637     ltsyData.SerialiseL(expData);       
       
 11638 
       
 11639  	//-------------------------------------------------------------------------
       
 11640 	// Test cancelling of RMmCustomAPI::ReadSimFile
       
 11641  	//-------------------------------------------------------------------------
       
 11642 
       
 11643     iMockLTSY.ExpectL( ECustomReadSimFileIPC, expData);
       
 11644     
       
 11645 	_LIT8(KResponce, "Responce");
       
 11646 
       
 11647     iMockLTSY.CompleteL( ECustomReadSimFileIPC, KErrNone, KResponce, 20);
       
 11648     
       
 11649     customAPI.ReadSimFile(requestStatus, fileInfoPckg, responce);
       
 11650     
       
 11651     customAPI.CancelAsyncRequest(ECustomReadSimFileIPC);
       
 11652 	
       
 11653 	User::WaitForRequest(requestStatus);	
       
 11654 	ASSERT_EQUALS(KErrCancel, requestStatus.Int());
       
 11655  	
       
 11656 	User::WaitForRequest(mockLtsyStatus);
       
 11657 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
 11658 
       
 11659 	AssertMockLtsyStatusL();
       
 11660 		
       
 11661 	CleanupStack::PopAndDestroy(3);	
       
 11662 	
       
 11663 	}
       
 11664 
       
 11665 
       
 11666 /**
       
 11667 @SYMTestCaseID BA-CTSY-CIPC-MCRSF-0003
       
 11668 @SYMComponent  telephony_ctsy
       
 11669 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::ReadSimFile with bad parameter data
       
 11670 @SYMTestPriority High
       
 11671 @SYMTestActions Invokes RMmCustomAPI::ReadSimFile with bad parameter data
       
 11672 @SYMTestExpectedResults Pass
       
 11673 @SYMTestType CT
       
 11674 */
       
 11675 void CCTsyCustomIPCFU::TestReadSimFile0003L()
       
 11676 	{
       
 11677 
       
 11678 	OpenEtelServerL(EUseExtendedError);
       
 11679 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
 11680 	OpenPhoneL();
       
 11681 
       
 11682 	RMmCustomAPI customAPI;
       
 11683 	OpenCustomAPILC(customAPI, iPhone);
       
 11684 
       
 11685     TRequestStatus requestStatus;
       
 11686 	
       
 11687 	RBuf8 expData;
       
 11688 	CleanupClosePushL(expData);
       
 11689 
       
 11690 	RMmCustomAPI::TSimFileInfo fileInfo;
       
 11691 	fileInfo.iPath.Fill(0x00);
       
 11692 	fileInfo.iOffSet = 0;
       
 11693 	fileInfo.iSize = 32;
       
 11694 	RMmCustomAPI::TSimFileInfo expFileInfo(fileInfo);
       
 11695 	TPckg<RMmCustomAPI::TSimFileInfo> fileInfoPckg(fileInfo);	
       
 11696 	TBuf8<1> littleBuf;
       
 11697 
       
 11698 	TMockLtsyData1< RMmCustomAPI::TSimFileInfo > ltsyData(fileInfo);	    
       
 11699     ltsyData.SerialiseL(expData);       
       
 11700 
       
 11701     iMockLTSY.ExpectL( ECustomReadSimFileIPC, expData);
       
 11702     
       
 11703 	_LIT8(KResponce, "Responce");
       
 11704 
       
 11705     iMockLTSY.CompleteL( ECustomReadSimFileIPC, KErrNone, KResponce);
       
 11706     
       
 11707     customAPI.ReadSimFile(requestStatus, fileInfoPckg, littleBuf);
       
 11708     
       
 11709 	User::WaitForRequest(requestStatus);	
       
 11710 	ASSERT_EQUALS(KErrOverflow, requestStatus.Int());
       
 11711 
       
 11712 	AssertMockLtsyStatusL();
       
 11713 		
       
 11714 	CleanupStack::PopAndDestroy(3);
       
 11715 
       
 11716 	}
       
 11717 
       
 11718 
       
 11719 /**
       
 11720 @SYMTestCaseID BA-CTSY-CIPC-MCRSF-0004
       
 11721 @SYMComponent  telephony_ctsy
       
 11722 @SYMTestCaseDesc Test support in CTSY for multiple client requests to RMmCustomAPI::ReadSimFile
       
 11723 @SYMTestPriority High
       
 11724 @SYMTestActions Invokes multiple client requests to RMmCustomAPI::ReadSimFile
       
 11725 @SYMTestExpectedResults Pass
       
 11726 @SYMTestType CT
       
 11727 */
       
 11728 void CCTsyCustomIPCFU::TestReadSimFile0004L()
       
 11729 	{
       
 11730 
       
 11731 	OpenEtelServerL(EUseExtendedError);
       
 11732 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
 11733 	OpenPhoneL();
       
 11734 
       
 11735 	// Open second client
       
 11736 	RTelServer telServer2;
       
 11737 	TInt ret = telServer2.Connect();
       
 11738 	ASSERT_EQUALS(KErrNone, ret);
       
 11739 	CleanupClosePushL(telServer2);
       
 11740 
       
 11741 	RMobilePhone phone2;
       
 11742 	ret = phone2.Open(telServer2,KMmTsyPhoneName);
       
 11743 	ASSERT_EQUALS(KErrNone, ret);
       
 11744 	CleanupClosePushL(phone2);
       
 11745 
       
 11746 	RMmCustomAPI customAPI;
       
 11747 	OpenCustomAPILC(customAPI, iPhone);
       
 11748 
       
 11749 	RMmCustomAPI customAPI2;
       
 11750 	OpenCustomAPILC(customAPI2, phone2, EFalse);
       
 11751 
       
 11752     TRequestStatus requestStatus;
       
 11753     TRequestStatus requestStatus2;
       
 11754 	
       
 11755 	RBuf8 expData;
       
 11756 	CleanupClosePushL(expData);
       
 11757 
       
 11758 	TBuf8<32> responce;
       
 11759 	RMmCustomAPI::TSimFileInfo fileInfo;
       
 11760 	fileInfo.iPath.Fill(0x00);
       
 11761 	fileInfo.iOffSet = 0;
       
 11762 	fileInfo.iSize = responce.Size();
       
 11763 	RMmCustomAPI::TSimFileInfo expFileInfo(fileInfo);
       
 11764 	TPckg<RMmCustomAPI::TSimFileInfo> fileInfoPckg(fileInfo);	
       
 11765 
       
 11766 	TMockLtsyData1< RMmCustomAPI::TSimFileInfo > ltsyData(fileInfo);	    
       
 11767     ltsyData.SerialiseL(expData);       
       
 11768 
       
 11769 	RBuf8 expData2;
       
 11770 	CleanupClosePushL(expData2);
       
 11771 //	TMockLtsyData1< RMmCustomAPI::TSimFileInfo > ltsyData2(fileInfo3);
       
 11772 //	ltsyData2.SerialiseL(expData3);
       
 11773 
       
 11774 	TBuf8<32> responce2;
       
 11775 	RMmCustomAPI::TSimFileInfo fileInfo2;
       
 11776 	fileInfo2.iPath.Fill(0x00);
       
 11777 	fileInfo2.iOffSet = 0;
       
 11778 	fileInfo2.iSize = responce2.Size();
       
 11779 	RMmCustomAPI::TSimFileInfo expFileInfo2(fileInfo2);
       
 11780 	TPckg<RMmCustomAPI::TSimFileInfo> fileInfoPckg2(fileInfo2);	
       
 11781 
       
 11782 
       
 11783     RMmCustomAPI::TSimFileInfo fileInfo3;
       
 11784     fileInfo3.iPath.Fill(0x00);
       
 11785     fileInfo3.iOffSet = 0x10;
       
 11786     fileInfo3.iSize = responce2.Size();
       
 11787     RMmCustomAPI::TSimFileInfo expFileInfo3(fileInfo3);
       
 11788     TPckg<RMmCustomAPI::TSimFileInfo> fileInfoPckg3(fileInfo3); 	
       
 11789 
       
 11790 	//-------------------------------------------------------------------------------------
       
 11791 	// Test A: Test multiple clients requesting RMmCustomAPI::ReadSimFile - different data 
       
 11792  	//-------------------------------------------------------------------------------------
       
 11793 
       
 11794     iMockLTSY.ExpectL( ECustomReadSimFileIPC, expData);    
       
 11795 	_LIT8(KResponce, "Responce");
       
 11796     iMockLTSY.CompleteL( ECustomReadSimFileIPC, KErrNone, KResponce, 20);
       
 11797     
       
 11798     customAPI.ReadSimFile(requestStatus, fileInfoPckg, responce);
       
 11799 
       
 11800     //iMockLTSY.ExpectL( ECustomReadSimFileIPC, expData2);    
       
 11801     //iMockLTSY.CompleteL( ECustomReadSimFileIPC, KErrNone, KResponce);
       
 11802     customAPI2.ReadSimFile(requestStatus2, fileInfoPckg2, responce2);
       
 11803     
       
 11804 	User::WaitForRequest(requestStatus);	
       
 11805 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
 11806 
       
 11807 	ASSERT_EQUALS(0, responce.Compare(KResponce));
       
 11808 	    
       
 11809 	User::WaitForRequest(requestStatus2);	
       
 11810 	ASSERT_EQUALS(KErrNone, requestStatus2.Int());
       
 11811 
       
 11812 	ASSERT_EQUALS(0, responce2.Compare(KResponce));
       
 11813 
       
 11814 	AssertMockLtsyStatusL();
       
 11815 		
       
 11816     //-----------------------------------------------------------------------------------
       
 11817     // Test B: Test multiple clients requesting RMmCustomAPI::ReadSimFile with same data
       
 11818     //-----------------------------------------------------------------------------------
       
 11819 	
       
 11820 
       
 11821 
       
 11822     iMockLTSY.ExpectL( ECustomReadSimFileIPC, expData); 
       
 11823     iMockLTSY.CompleteL( ECustomReadSimFileIPC, KErrNone, KResponce, 20);
       
 11824     
       
 11825     customAPI.ReadSimFile(requestStatus, fileInfoPckg, responce);
       
 11826     customAPI2.ReadSimFile(requestStatus2, fileInfoPckg3, responce);
       
 11827     
       
 11828     User::WaitForRequest(requestStatus);    
       
 11829     ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
 11830     ASSERT_EQUALS(0, responce.Compare(KResponce));
       
 11831         
       
 11832     User::WaitForRequest(requestStatus2);   
       
 11833     ASSERT_EQUALS(KErrServerBusy, requestStatus2.Int());
       
 11834 
       
 11835     AssertMockLtsyStatusL();	
       
 11836 	
       
 11837 
       
 11838 	CleanupStack::PopAndDestroy(7, this);
       
 11839 
       
 11840 	}
       
 11841 
       
 11842 
       
 11843 /**
       
 11844 @SYMTestCaseID BA-CTSY-CIPC-MCRSF-0005
       
 11845 @SYMComponent  telephony_ctsy
       
 11846 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::ReadSimFile with timeout
       
 11847 @SYMTestPriority High
       
 11848 @SYMTestActions Invokes RMmCustomAPI::ReadSimFile and tests for timeout
       
 11849 @SYMTestExpectedResults Pass
       
 11850 @SYMTestType CT
       
 11851 */
       
 11852 void CCTsyCustomIPCFU::TestReadSimFile0005L()
       
 11853 	{
       
 11854 
       
 11855 	OpenEtelServerL(EUseExtendedError);
       
 11856 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
 11857 	OpenPhoneL();
       
 11858 
       
 11859 	RMmCustomAPI customAPI;
       
 11860 	OpenCustomAPILC(customAPI, iPhone);
       
 11861 
       
 11862     TRequestStatus requestStatus;
       
 11863 	
       
 11864 	RBuf8 expData;
       
 11865 	CleanupClosePushL(expData);
       
 11866 
       
 11867 	TBuf8<32> responce;
       
 11868 	RMmCustomAPI::TSimFileInfo fileInfo;
       
 11869 	fileInfo.iPath.Fill(0x00);
       
 11870 	fileInfo.iOffSet = 0;
       
 11871 	fileInfo.iSize = responce.Size();
       
 11872 	RMmCustomAPI::TSimFileInfo expFileInfo(fileInfo);
       
 11873 	TPckg<RMmCustomAPI::TSimFileInfo> fileInfoPckg(fileInfo);	
       
 11874 
       
 11875 	TMockLtsyData1< RMmCustomAPI::TSimFileInfo > ltsyData(fileInfo);	    
       
 11876     ltsyData.SerialiseL(expData);       
       
 11877 
       
 11878     iMockLTSY.ExpectL( ECustomReadSimFileIPC, expData);
       
 11879 
       
 11880 	ERR_PRINTF2(_L("<font color=Orange>$CTSYKnownFailure: defect id = %d</font>"), 404902);
       
 11881 	// Location capability missing
       
 11882     
       
 11883     customAPI.ReadSimFile(requestStatus, fileInfoPckg, responce);
       
 11884     
       
 11885 	User::WaitForRequest(requestStatus);	
       
 11886 	ASSERT_EQUALS(KErrTimedOut, requestStatus.Int());
       
 11887 
       
 11888 	AssertMockLtsyStatusL();
       
 11889 		
       
 11890 	CleanupStack::PopAndDestroy(3);
       
 11891 
       
 11892 
       
 11893 	}
       
 11894 
       
 11895 
       
 11896 /**
       
 11897 @SYMTestCaseID BA-CTSY-CIPC-MCGLT-0001
       
 11898 @SYMComponent  telephony_ctsy
       
 11899 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::GetLifeTime
       
 11900 @SYMTestPriority High
       
 11901 @SYMTestActions Invokes RMmCustomAPI::GetLifeTime
       
 11902 @SYMTestExpectedResults Pass
       
 11903 @SYMTestType CT
       
 11904 */
       
 11905 void CCTsyCustomIPCFU::TestGetLifeTime0001L()
       
 11906 	{
       
 11907 
       
 11908 	OpenEtelServerL(EUseExtendedError);
       
 11909 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
 11910 	OpenPhoneL();
       
 11911 
       
 11912 	RMmCustomAPI customAPI;
       
 11913 	OpenCustomAPILC(customAPI, iPhone);
       
 11914 
       
 11915     TRequestStatus requestStatus;
       
 11916     
       
 11917     RMmCustomAPI::TLifeTimeData ltData;
       
 11918     TPckg<RMmCustomAPI::TLifeTimeData> ltPckg(ltData);
       
 11919    
       
 11920  	//-------------------------------------------------------------------------
       
 11921 	// TEST A: failure to dispatch request to LTSY
       
 11922  	//-------------------------------------------------------------------------
       
 11923 
       
 11924     iMockLTSY.ExpectL( ECustomGetLifeTimeIPC, KErrNotSupported);
       
 11925     
       
 11926     customAPI.GetLifeTime(requestStatus, ltPckg);
       
 11927 	
       
 11928 	User::WaitForRequest(requestStatus);	
       
 11929 	ASSERT_EQUALS(KErrNotSupported, requestStatus.Int());
       
 11930 
       
 11931 	AssertMockLtsyStatusL();
       
 11932 
       
 11933 	//-------------------------------------------------------------------------
       
 11934 	// TEST B: failure on completion of pending request from LTSY->CTSY
       
 11935  	//-------------------------------------------------------------------------
       
 11936 
       
 11937     iMockLTSY.ExpectL( ECustomGetLifeTimeIPC);
       
 11938     
       
 11939     RMmCustomAPI::TLifeTimeData compData;
       
 11940 	compData.iCaps = 0x34;		// fill with random data
       
 11941 	compData.iHours = 123;
       
 11942 	compData.iMinutes = 21;
       
 11943     compData.iManufacturingDate = TDateTime(1,(TMonth)2,3,4,5,6,7);
       
 11944     TPckg<RMmCustomAPI::TLifeTimeData> compPckg(compData);
       
 11945     
       
 11946     iMockLTSY.CompleteL( ECustomGetLifeTimeIPC, KErrGeneral, compPckg);
       
 11947 
       
 11948     customAPI.GetLifeTime(requestStatus, ltPckg);
       
 11949 	
       
 11950 	User::WaitForRequest(requestStatus);	
       
 11951 	ASSERT_EQUALS(KErrGeneral, requestStatus.Int());
       
 11952 
       
 11953 	AssertMockLtsyStatusL();
       
 11954 
       
 11955  	//-------------------------------------------------------------------------
       
 11956 	// TEST C: Successful completion request of
       
 11957 	// RMmCustomAPI::GetLifeTime when result is not cached.
       
 11958  	//-------------------------------------------------------------------------
       
 11959 
       
 11960     iMockLTSY.ExpectL( ECustomGetLifeTimeIPC);
       
 11961     iMockLTSY.CompleteL( ECustomGetLifeTimeIPC, KErrNone, compPckg);
       
 11962 
       
 11963     customAPI.GetLifeTime(requestStatus, ltPckg);
       
 11964 	
       
 11965 	User::WaitForRequest(requestStatus);	
       
 11966 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
 11967 
       
 11968 	ASSERT_TRUE(compData.iCaps == ltData.iCaps);
       
 11969 	ASSERT_TRUE(compData.iHours == ltData.iHours);
       
 11970 	ASSERT_TRUE(compData.iMinutes == ltData.iMinutes);
       
 11971 	ASSERT_TRUE(compData.iManufacturingDate.Year() == ltData.iManufacturingDate.Year());
       
 11972 	ASSERT_TRUE(compData.iManufacturingDate.Month() == ltData.iManufacturingDate.Month());
       
 11973 	ASSERT_TRUE(compData.iManufacturingDate.Day() == ltData.iManufacturingDate.Day());
       
 11974 	ASSERT_TRUE(compData.iManufacturingDate.Hour() == ltData.iManufacturingDate.Hour());
       
 11975 	ASSERT_TRUE(compData.iManufacturingDate.Minute() == ltData.iManufacturingDate.Minute());
       
 11976 	ASSERT_TRUE(compData.iManufacturingDate.Second() == ltData.iManufacturingDate.Second());
       
 11977 	ASSERT_TRUE(compData.iManufacturingDate.MicroSecond() == ltData.iManufacturingDate.MicroSecond());
       
 11978 
       
 11979 	AssertMockLtsyStatusL();
       
 11980 
       
 11981  	//-------------------------------------------------------------------------
       
 11982 	// TEST E: Unsolicited completion of RMmCustomAPI::GetLifeTime
       
 11983 	// from LTSY.
       
 11984  	//-------------------------------------------------------------------------
       
 11985 
       
 11986 	TRequestStatus mockLtsyStatus;
       
 11987 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
 11988 
       
 11989     iMockLTSY.CompleteL( ECustomGetLifeTimeIPC, KErrNone, compPckg);
       
 11990 
       
 11991 	User::WaitForRequest(mockLtsyStatus);
       
 11992 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
 11993 
       
 11994 	AssertMockLtsyStatusL();
       
 11995 	CleanupStack::PopAndDestroy(2, this); 	
       
 11996 	
       
 11997 	}
       
 11998 
       
 11999 
       
 12000 /**
       
 12001 @SYMTestCaseID BA-CTSY-CIPC-MCGLT-0002
       
 12002 @SYMComponent  telephony_ctsy
       
 12003 @SYMTestCaseDesc Test support in CTSY for cancelling of RMmCustomAPI::GetLifeTime
       
 12004 @SYMTestPriority High
       
 12005 @SYMTestActions Invokes cancelling of RMmCustomAPI::GetLifeTime
       
 12006 @SYMTestExpectedResults Pass
       
 12007 @SYMTestType CT
       
 12008 */
       
 12009 void CCTsyCustomIPCFU::TestGetLifeTime0002L()
       
 12010 	{
       
 12011 
       
 12012 	OpenEtelServerL(EUseExtendedError);
       
 12013 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
 12014 	OpenPhoneL();
       
 12015 
       
 12016 	RMmCustomAPI customAPI;
       
 12017 	OpenCustomAPILC(customAPI, iPhone);
       
 12018 
       
 12019     TRequestStatus requestStatus;
       
 12020     RMmCustomAPI::TLifeTimeData ltData;
       
 12021     TPckg<RMmCustomAPI::TLifeTimeData> ltPckg(ltData);
       
 12022 
       
 12023 	TRequestStatus mockLtsyStatus;
       
 12024 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
 12025 
       
 12026 
       
 12027  	//-------------------------------------------------------------------------
       
 12028 	// Test cancelling of RMmCustomAPI::GetLifeTime
       
 12029  	//-------------------------------------------------------------------------
       
 12030 
       
 12031     iMockLTSY.ExpectL( ECustomGetLifeTimeIPC);
       
 12032     
       
 12033     RMmCustomAPI::TLifeTimeData compData;
       
 12034 	compData.iCaps = 0xFF;
       
 12035     TPckg<RMmCustomAPI::TLifeTimeData> compPckg(compData);
       
 12036     
       
 12037     iMockLTSY.CompleteL( ECustomGetLifeTimeIPC, KErrNone, compPckg, 20);
       
 12038 
       
 12039     customAPI.GetLifeTime(requestStatus, ltPckg);
       
 12040 	
       
 12041 	customAPI.CancelAsyncRequest(ECustomGetLifeTimeIPC);
       
 12042 
       
 12043 	User::WaitForRequest(requestStatus);	
       
 12044 	ASSERT_EQUALS(KErrCancel, requestStatus.Int());
       
 12045 
       
 12046 	User::WaitForRequest(mockLtsyStatus);	
       
 12047 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
 12048 
       
 12049 	AssertMockLtsyStatusL();
       
 12050 
       
 12051 	CleanupStack::PopAndDestroy(2, this); 	
       
 12052 		
       
 12053 	
       
 12054 	}
       
 12055 
       
 12056 
       
 12057 /**
       
 12058 @SYMTestCaseID BA-CTSY-CIPC-MCGLT-0003
       
 12059 @SYMComponent  telephony_ctsy
       
 12060 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::GetLifeTime with bad parameter data
       
 12061 @SYMTestPriority High
       
 12062 @SYMTestActions Invokes RMmCustomAPI::GetLifeTime with bad parameter data
       
 12063 @SYMTestExpectedResults Pass
       
 12064 @SYMTestType CT
       
 12065 */
       
 12066 void CCTsyCustomIPCFU::TestGetLifeTime0003L()
       
 12067 	{
       
 12068 
       
 12069 	OpenEtelServerL(EUseExtendedError);
       
 12070 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
 12071 	OpenPhoneL();
       
 12072 
       
 12073 	RMmCustomAPI customAPI;
       
 12074 	OpenCustomAPILC(customAPI, iPhone);
       
 12075 
       
 12076     TRequestStatus requestStatus;
       
 12077     TBuf8<1> badPckg;
       
 12078 
       
 12079     customAPI.GetLifeTime(requestStatus, badPckg);
       
 12080 	
       
 12081 	User::WaitForRequest(requestStatus);	
       
 12082 	ASSERT_EQUALS(KErrArgument, requestStatus.Int());
       
 12083 
       
 12084 	AssertMockLtsyStatusL();
       
 12085 
       
 12086 	CleanupStack::PopAndDestroy(2, this); 	
       
 12087 
       
 12088 	}
       
 12089 
       
 12090 
       
 12091 /**
       
 12092 @SYMTestCaseID BA-CTSY-CIPC-MCGLT-0004
       
 12093 @SYMComponent  telephony_ctsy
       
 12094 @SYMTestCaseDesc Test support in CTSY for multiple client requests to RMmCustomAPI::GetLifeTime
       
 12095 @SYMTestPriority High
       
 12096 @SYMTestActions Invokes multiple client requests to RMmCustomAPI::GetLifeTime
       
 12097 @SYMTestExpectedResults Pass
       
 12098 @SYMTestType CT
       
 12099 */
       
 12100 void CCTsyCustomIPCFU::TestGetLifeTime0004L()
       
 12101 	{
       
 12102 
       
 12103 	OpenEtelServerL(EUseExtendedError);
       
 12104 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
 12105 	OpenPhoneL();
       
 12106 
       
 12107 	// Open second client
       
 12108 	RTelServer telServer2;
       
 12109 	TInt ret = telServer2.Connect();
       
 12110 	ASSERT_EQUALS(KErrNone, ret);
       
 12111 	CleanupClosePushL(telServer2);
       
 12112 
       
 12113 	RMobilePhone phone2;
       
 12114 	ret = phone2.Open(telServer2,KMmTsyPhoneName);
       
 12115 	ASSERT_EQUALS(KErrNone, ret);
       
 12116 	CleanupClosePushL(phone2);
       
 12117 
       
 12118 	RMmCustomAPI customAPI;
       
 12119 	OpenCustomAPILC(customAPI, iPhone);
       
 12120 
       
 12121 	RMmCustomAPI customAPI2;
       
 12122 	OpenCustomAPILC(customAPI2, phone2, EFalse);
       
 12123 
       
 12124     TRequestStatus requestStatus;
       
 12125     TRequestStatus requestStatus2;
       
 12126 
       
 12127     RMmCustomAPI::TLifeTimeData ltData;
       
 12128     TPckg<RMmCustomAPI::TLifeTimeData> ltPckg(ltData);
       
 12129 
       
 12130     RMmCustomAPI::TLifeTimeData ltData2;
       
 12131     TPckg<RMmCustomAPI::TLifeTimeData> ltPckg2(ltData2);
       
 12132 
       
 12133 	//-------------------------------------------------------------------------
       
 12134 	// Test A: Test multiple clients requesting RMmCustomAPI::GetLifeTime
       
 12135  	//-------------------------------------------------------------------------
       
 12136 
       
 12137     iMockLTSY.ExpectL( ECustomGetLifeTimeIPC);
       
 12138 
       
 12139     RMmCustomAPI::TLifeTimeData compData;
       
 12140 	compData.iCaps = 0x11;		
       
 12141 	compData.iHours = 111;
       
 12142 	compData.iMinutes = 111;
       
 12143     compData.iManufacturingDate = TDateTime(1,(TMonth)1,1,1,1,1,1);
       
 12144     TPckg<RMmCustomAPI::TLifeTimeData> compPckg(compData);
       
 12145 
       
 12146     iMockLTSY.CompleteL( ECustomGetLifeTimeIPC, KErrNone, compPckg, 20);
       
 12147 
       
 12148     customAPI.GetLifeTime(requestStatus, ltPckg);
       
 12149 
       
 12150 
       
 12151     customAPI2.GetLifeTime(requestStatus2, ltPckg2);		
       
 12152         
       
 12153 	User::WaitForRequest(requestStatus);	
       
 12154 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
 12155 
       
 12156 	ASSERT_TRUE(compData.iCaps == ltData.iCaps);
       
 12157 	ASSERT_TRUE(compData.iHours == ltData.iHours);
       
 12158 	ASSERT_TRUE(compData.iMinutes == ltData.iMinutes);
       
 12159 	ASSERT_TRUE(compData.iManufacturingDate.Year() == ltData.iManufacturingDate.Year());
       
 12160 	ASSERT_TRUE(compData.iManufacturingDate.Month() == ltData.iManufacturingDate.Month());
       
 12161 	ASSERT_TRUE(compData.iManufacturingDate.Day() == ltData.iManufacturingDate.Day());
       
 12162 	ASSERT_TRUE(compData.iManufacturingDate.Hour() == ltData.iManufacturingDate.Hour());
       
 12163 	ASSERT_TRUE(compData.iManufacturingDate.Minute() == ltData.iManufacturingDate.Minute());
       
 12164 	ASSERT_TRUE(compData.iManufacturingDate.Second() == ltData.iManufacturingDate.Second());
       
 12165 	ASSERT_TRUE(compData.iManufacturingDate.MicroSecond() == ltData.iManufacturingDate.MicroSecond());
       
 12166 
       
 12167 	User::WaitForRequest(requestStatus2);	
       
 12168 	ASSERT_EQUALS(KErrServerBusy, requestStatus2.Int());
       
 12169 
       
 12170 
       
 12171 	AssertMockLtsyStatusL();
       
 12172 
       
 12173 	CleanupStack::PopAndDestroy(5, this);
       
 12174 
       
 12175 	}
       
 12176 
       
 12177 
       
 12178 /**
       
 12179 @SYMTestCaseID BA-CTSY-CIPC-MCGB-0001
       
 12180 @SYMComponent  telephony_ctsy
       
 12181 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::Get3GPBInfo
       
 12182 @SYMTestPriority High
       
 12183 @SYMTestActions Invokes RMmCustomAPI::Get3GPBInfo
       
 12184 @SYMTestExpectedResults Pass
       
 12185 @SYMTestType CT
       
 12186 */
       
 12187 void CCTsyCustomIPCFU::TestGet3GPBInfo0001L()
       
 12188 	{
       
 12189 	OpenEtelServerL(EUseExtendedError);
       
 12190 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
 12191 	OpenPhoneL();
       
 12192 
       
 12193 	RMmCustomAPI customAPI;
       
 12194 	OpenCustomAPILC(customAPI, iPhone);
       
 12195 
       
 12196     TRequestStatus requestStatus;
       
 12197     RMmCustomAPI::T3GPBInfo info;
       
 12198     
       
 12199     Mem::FillZ((TAny*)&info, sizeof(info));
       
 12200 
       
 12201  	//-------------------------------------------------------------------------
       
 12202 	// TEST C: Successful completion request of
       
 12203 	// RMmCustomAPI::Get3GPBInfo when result is not cached.
       
 12204 	// Getting data for uninitialized PB
       
 12205  	//-------------------------------------------------------------------------
       
 12206 
       
 12207     customAPI.Get3GPBInfo(requestStatus, info);
       
 12208 	
       
 12209 	User::WaitForRequest(requestStatus);	
       
 12210 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
 12211 
       
 12212 	
       
 12213 	// for a not initializes PB all values are -1.
       
 12214     ASSERT_TRUE( -1 == info.iMaxLenEmail);
       
 12215     ASSERT_TRUE( -1 == info.iMaxLenSne);
       
 12216     ASSERT_TRUE( -1 == info.iMaxLenAnr);
       
 12217     ASSERT_TRUE( -1 == info.iMaxLenGroupName);
       
 12218     ASSERT_TRUE( -1 == info.iMaxNumEmail);
       
 12219     ASSERT_TRUE( -1 == info.iMaxNumSne);
       
 12220     ASSERT_TRUE( -1 == info.iMaxNumAnr);
       
 12221     ASSERT_TRUE( -1 == info.iMaxNumGroupName);
       
 12222 
       
 12223 	AssertMockLtsyStatusL();
       
 12224 
       
 12225  	//-------------------------------------------------------------------------
       
 12226 	// TEST C2: Successful completion request of
       
 12227 	// RMmCustomAPI::Get3GPBInfo when phoneBookStore is initialized
       
 12228  	//-------------------------------------------------------------------------
       
 12229 
       
 12230 	TName name(KETelIccAdnPhoneBook);
       
 12231 	RMobilePhoneBookStore bookStore;
       
 12232 	
       
 12233     OpenPhoneBookStoreL(bookStore, name, iPhone);
       
 12234 	CleanupClosePushL(bookStore);
       
 12235 
       
 12236 	RBuf8 data;
       
 12237 	CleanupClosePushL(data);
       
 12238     
       
 12239     CStorageInfoData storageData;       
       
 12240     
       
 12241     storageData.iADNNumOfEntries = 1;
       
 12242     storageData.iADNTextLengthMax = 2;
       
 12243     storageData.iADNNumberLengthMax = 3;
       
 12244     storageData.iSNENumOfEntries = 4;
       
 12245     storageData.iSNENumOfEntriesPerEntry = 5;
       
 12246     storageData.iSNETextLengthMax = 6;
       
 12247     storageData.iEmailNumOfEntries = 7;
       
 12248     storageData.iEmailNumOfEntriesPerEntry = 8;
       
 12249     storageData.iEmailTextLengthMax = 9;
       
 12250     storageData.iFDNNumOfEntries = 10;
       
 12251     storageData.iFDNTextLengthMax = 11;
       
 12252     storageData.iFDNNumberLengthMax = 12;
       
 12253     storageData.iSDNNumOfEntries = 13;
       
 12254     storageData.iSDNTextLengthMax = 14;
       
 12255     storageData.iSDNNumberLengthMax = 15;
       
 12256     storageData.iVMBXNumOfEntries = 16;
       
 12257     storageData.iVMBXTextLengthMax = 17;
       
 12258     storageData.iVMBXNumberLengthMax = 18;
       
 12259     storageData.iMSISDNNumOfEntries = 19;
       
 12260     storageData.iMSISDNTextLengthMax = 20;
       
 12261     storageData.iMSISDNNumberLengthMax = 21;
       
 12262     storageData.iGRPNumOfEntriesPerEntry = 22;
       
 12263     storageData.iANRNumOfEntries = 23;
       
 12264     storageData.iANRNumOfEntriesPerEntry = 24;
       
 12265     storageData.iANRNumLengthMax = 25;
       
 12266     storageData.iMBDNNumOfEntries = 26;
       
 12267     storageData.iMBDNTextLengthMax = 27;
       
 12268     storageData.iMBDNNumberLengthMax = 28;    
       
 12269     
       
 12270 	TMockLtsyPhoneBookData1< CStorageInfoData > retStoreAndName(name, storageData); 
       
 12271 	retStoreAndName.SerialiseL(data);	
       
 12272 	
       
 12273     TRequestStatus mockLtsyStatus;
       
 12274 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
 12275     iMockLTSY.CompleteL(EMmTsyPhoneBookStoreInitIPC, KErrNone, data, 0);
       
 12276     User::WaitForRequest(mockLtsyStatus);        
       
 12277 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
 12278 
       
 12279     customAPI.Get3GPBInfo(requestStatus, info);
       
 12280 	
       
 12281 	User::WaitForRequest(requestStatus);	
       
 12282 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
 12283 	
       
 12284     ASSERT_TRUE( storageData.iEmailTextLengthMax == info.iMaxLenEmail);
       
 12285     ASSERT_TRUE( storageData.iSNETextLengthMax == info.iMaxLenSne);
       
 12286     ASSERT_TRUE( storageData.iANRNumLengthMax == info.iMaxLenAnr);
       
 12287     ASSERT_TRUE( -1 == info.iMaxLenGroupName);
       
 12288     ASSERT_TRUE( storageData.iEmailNumOfEntriesPerEntry == info.iMaxNumEmail);
       
 12289     ASSERT_TRUE( storageData.iSNENumOfEntriesPerEntry == info.iMaxNumSne);
       
 12290     ASSERT_TRUE( storageData.iANRNumOfEntriesPerEntry == info.iMaxNumAnr);
       
 12291     ASSERT_TRUE( storageData.iGRPNumOfEntriesPerEntry == info.iMaxNumGroupName);
       
 12292     
       
 12293 	AssertMockLtsyStatusL();
       
 12294 	CleanupStack::PopAndDestroy(4, this); 	
       
 12295 	
       
 12296 	}
       
 12297 
       
 12298 
       
 12299 /**
       
 12300 @SYMTestCaseID BA-CTSY-CIPC-MCGSNM-0001
       
 12301 @SYMComponent  telephony_ctsy
       
 12302 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::GetSystemNetworkModes
       
 12303 @SYMTestPriority High
       
 12304 @SYMTestActions Invokes RMmCustomAPI::GetSystemNetworkModes
       
 12305 @SYMTestExpectedResults Pass
       
 12306 @SYMTestType CT
       
 12307 */
       
 12308 void CCTsyCustomIPCFU::TestGetSystemNetworkModes0001L()
       
 12309 	{
       
 12310 
       
 12311 	OpenEtelServerL(EUseExtendedError);
       
 12312 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
 12313 	OpenPhoneL();
       
 12314 
       
 12315 	RMmCustomAPI customAPI;
       
 12316 	OpenCustomAPILC(customAPI, iPhone);
       
 12317 
       
 12318     TRequestStatus requestStatus;
       
 12319     TUint32 modes;
       
 12320     TBool useRats(EFalse);
       
 12321    
       
 12322 	RBuf8 expectData;
       
 12323 	CleanupClosePushL(expectData);
       
 12324 
       
 12325 	TMockLtsyData1< TBool > ltsyData(useRats);	
       
 12326 	ltsyData.SerialiseL(expectData);
       
 12327     	
       
 12328  	//-------------------------------------------------------------------------
       
 12329 	// TEST A: failure to dispatch request to LTSY
       
 12330  	//-------------------------------------------------------------------------
       
 12331 
       
 12332     iMockLTSY.ExpectL( ECustomGetSystemNetworkModesIPC, expectData, KErrNotSupported);
       
 12333     
       
 12334     customAPI.GetSystemNetworkModes(requestStatus, modes);
       
 12335 	
       
 12336 	User::WaitForRequest(requestStatus);	
       
 12337 	ASSERT_EQUALS(KErrNotSupported, requestStatus.Int());
       
 12338 
       
 12339 	AssertMockLtsyStatusL();
       
 12340 
       
 12341 	//-------------------------------------------------------------------------
       
 12342 	// TEST B: failure on completion of pending request from LTSY->CTSY
       
 12343  	//-------------------------------------------------------------------------
       
 12344 
       
 12345     iMockLTSY.ExpectL( ECustomGetSystemNetworkModesIPC, expectData);
       
 12346     
       
 12347     const TUint32 compModes = 0xFFFF;
       
 12348     TPckg<TUint32> modesPckg(compModes);
       
 12349     
       
 12350     iMockLTSY.CompleteL( ECustomGetSystemNetworkModesIPC, KErrGeneral, modesPckg);
       
 12351 
       
 12352     customAPI.GetSystemNetworkModes(requestStatus, modes);
       
 12353 	
       
 12354 	User::WaitForRequest(requestStatus);	
       
 12355 	ASSERT_EQUALS(KErrGeneral, requestStatus.Int());
       
 12356 
       
 12357 	AssertMockLtsyStatusL();
       
 12358 
       
 12359  	//-------------------------------------------------------------------------
       
 12360 	// TEST C: Successful completion request of
       
 12361 	// RMmCustomAPI::GetSystemNetworkModes when result is not cached.
       
 12362  	//-------------------------------------------------------------------------
       
 12363 
       
 12364     iMockLTSY.ExpectL( ECustomGetSystemNetworkModesIPC, expectData);
       
 12365     iMockLTSY.CompleteL( ECustomGetSystemNetworkModesIPC, KErrNone, modesPckg);
       
 12366 
       
 12367     customAPI.GetSystemNetworkModes(requestStatus, modes);
       
 12368 	
       
 12369 	User::WaitForRequest(requestStatus);	
       
 12370 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
 12371 
       
 12372 	ASSERT_EQUALS(compModes, modes);
       
 12373 
       
 12374 	AssertMockLtsyStatusL();
       
 12375 
       
 12376  	//-------------------------------------------------------------------------
       
 12377 	// TEST E: Unsolicited completion of RMmCustomAPI::GetSystemNetworkModes
       
 12378 	// from LTSY.
       
 12379  	//-------------------------------------------------------------------------
       
 12380 
       
 12381 	TRequestStatus mockLtsyStatus;
       
 12382 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
 12383 
       
 12384     iMockLTSY.CompleteL( ECustomGetSystemNetworkModesIPC, KErrNone, modesPckg);
       
 12385 
       
 12386 	User::WaitForRequest(mockLtsyStatus);
       
 12387 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
 12388 
       
 12389 	AssertMockLtsyStatusL();
       
 12390 	CleanupStack::PopAndDestroy(3, this); 	
       
 12391 	
       
 12392 	}
       
 12393 
       
 12394 
       
 12395 /**
       
 12396 @SYMTestCaseID BA-CTSY-CIPC-MCGSNM-0002
       
 12397 @SYMComponent  telephony_ctsy
       
 12398 @SYMTestCaseDesc Test support in CTSY for cancelling of RMmCustomAPI::GetSystemNetworkModes
       
 12399 @SYMTestPriority High
       
 12400 @SYMTestActions Invokes cancelling of RMmCustomAPI::GetSystemNetworkModes
       
 12401 @SYMTestExpectedResults Pass
       
 12402 @SYMTestType CT
       
 12403 */
       
 12404 void CCTsyCustomIPCFU::TestGetSystemNetworkModes0002L()
       
 12405 	{
       
 12406 
       
 12407 	OpenEtelServerL(EUseExtendedError);
       
 12408 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
 12409 	OpenPhoneL();
       
 12410 
       
 12411 	RMmCustomAPI customAPI;
       
 12412 	OpenCustomAPILC(customAPI, iPhone);
       
 12413 
       
 12414     TRequestStatus requestStatus;
       
 12415     TUint32 modes;	
       
 12416     TBool useRats(EFalse);
       
 12417    
       
 12418 	RBuf8 expectData;
       
 12419 	CleanupClosePushL(expectData);
       
 12420 
       
 12421 	TMockLtsyData1< TBool > ltsyData(useRats);	
       
 12422 	ltsyData.SerialiseL(expectData);
       
 12423 	
       
 12424 	TRequestStatus mockLtsyStatus;
       
 12425 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
 12426 
       
 12427  	//-------------------------------------------------------------------------
       
 12428 	// Test cancelling of RMmCustomAPI::GetSystemNetworkModes
       
 12429  	//-------------------------------------------------------------------------
       
 12430 
       
 12431     iMockLTSY.ExpectL( ECustomGetSystemNetworkModesIPC, expectData);
       
 12432     
       
 12433     const TUint32 compModes = 0xFFFF;
       
 12434     TPckg<TUint32> modesPckg(compModes);
       
 12435     
       
 12436     iMockLTSY.CompleteL( ECustomGetSystemNetworkModesIPC, KErrNone, modesPckg, 20);
       
 12437 
       
 12438     customAPI.GetSystemNetworkModes(requestStatus, modes);
       
 12439 	
       
 12440 	customAPI.CancelAsyncRequest(ECustomGetSystemNetworkModesIPC);
       
 12441 
       
 12442 	User::WaitForRequest(requestStatus);	
       
 12443 	ASSERT_EQUALS(KErrCancel, requestStatus.Int());
       
 12444 
       
 12445 	User::WaitForRequest(mockLtsyStatus);
       
 12446 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
 12447 
       
 12448 	AssertMockLtsyStatusL();
       
 12449 
       
 12450 	CleanupStack::PopAndDestroy(3, this); 	
       
 12451 		
       
 12452 	}
       
 12453 
       
 12454 
       
 12455 
       
 12456 /**
       
 12457 @SYMTestCaseID BA-CTSY-CIPC-MCGSNM-0004
       
 12458 @SYMComponent  telephony_ctsy
       
 12459 @SYMTestCaseDesc Test support in CTSY for multiple client requests to RMmCustomAPI::GetSystemNetworkModes
       
 12460 @SYMTestPriority High
       
 12461 @SYMTestActions Invokes multiple client requests to RMmCustomAPI::GetSystemNetworkModes
       
 12462 @SYMTestExpectedResults Pass
       
 12463 @SYMTestType CT
       
 12464 */
       
 12465 void CCTsyCustomIPCFU::TestGetSystemNetworkModes0004L()
       
 12466 	{
       
 12467 
       
 12468 	OpenEtelServerL(EUseExtendedError);
       
 12469 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
 12470 	OpenPhoneL();
       
 12471 
       
 12472 	// Open second client
       
 12473 	RTelServer telServer2;
       
 12474 	TInt ret = telServer2.Connect();
       
 12475 	ASSERT_EQUALS(KErrNone, ret);
       
 12476 	CleanupClosePushL(telServer2);
       
 12477 
       
 12478 	RMobilePhone phone2;
       
 12479 	ret = phone2.Open(telServer2,KMmTsyPhoneName);
       
 12480 	ASSERT_EQUALS(KErrNone, ret);
       
 12481 	CleanupClosePushL(phone2);
       
 12482 
       
 12483 	RMmCustomAPI customAPI;
       
 12484 	OpenCustomAPILC(customAPI, iPhone);
       
 12485 
       
 12486 	RMmCustomAPI customAPI2;
       
 12487 	OpenCustomAPILC(customAPI2, phone2, EFalse);
       
 12488 
       
 12489     TRequestStatus requestStatus;
       
 12490     TRequestStatus requestStatus2;
       
 12491 
       
 12492     TUint32 modes;	
       
 12493     TUint32 modes2;	
       
 12494 
       
 12495     TBool useRats(EFalse);
       
 12496    
       
 12497 	RBuf8 expectData;
       
 12498 	CleanupClosePushL(expectData);
       
 12499 
       
 12500 	TMockLtsyData1< TBool > ltsyData(useRats);	
       
 12501 	ltsyData.SerialiseL(expectData);
       
 12502 	
       
 12503 	//-------------------------------------------------------------------------
       
 12504 	// Test A: Test multiple clients requesting RMmCustomAPI::GetSystemNetworkModes
       
 12505  	//-------------------------------------------------------------------------
       
 12506 
       
 12507     iMockLTSY.ExpectL( ECustomGetSystemNetworkModesIPC, expectData);
       
 12508 
       
 12509     customAPI.GetSystemNetworkModes(requestStatus, modes);
       
 12510     customAPI2.GetSystemNetworkModes(requestStatus2, modes2);
       
 12511 
       
 12512     const TUint32 compModes = 0xFFFF;
       
 12513     TPckg<TUint32> modesPckg(compModes);
       
 12514 
       
 12515     iMockLTSY.CompleteL( ECustomGetSystemNetworkModesIPC, KErrNone, modesPckg);
       
 12516     
       
 12517 	User::WaitForRequest(requestStatus);	
       
 12518 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
 12519 
       
 12520 	ASSERT_EQUALS(compModes, modes);
       
 12521     
       
 12522 	User::WaitForRequest(requestStatus2);	
       
 12523 	ASSERT_EQUALS(KErrServerBusy, requestStatus2.Int());
       
 12524 
       
 12525 	AssertMockLtsyStatusL();
       
 12526 
       
 12527 	CleanupStack::PopAndDestroy(6, this);
       
 12528 
       
 12529 	}
       
 12530 
       
 12531 
       
 12532 /**
       
 12533 @SYMTestCaseID BA-CTSY-CIPC-MCGSNM-0005
       
 12534 @SYMComponent  telephony_ctsy
       
 12535 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::GetSystemNetworkModes with timeout
       
 12536 @SYMTestPriority High
       
 12537 @SYMTestActions Invokes RMmCustomAPI::GetSystemNetworkModes and tests for timeout
       
 12538 @SYMTestExpectedResults Pass
       
 12539 @SYMTestType CT
       
 12540 */
       
 12541 void CCTsyCustomIPCFU::TestGetSystemNetworkModes0005L()
       
 12542 	{
       
 12543 
       
 12544 	OpenEtelServerL(EUseExtendedError);
       
 12545 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
 12546 	OpenPhoneL();
       
 12547 
       
 12548 	RMmCustomAPI customAPI;
       
 12549 	OpenCustomAPILC(customAPI, iPhone);
       
 12550 
       
 12551     TRequestStatus requestStatus;
       
 12552     TUint32 modes;	
       
 12553     TBool useRats(EFalse);
       
 12554    
       
 12555 	RBuf8 expectData;
       
 12556 	CleanupClosePushL(expectData);
       
 12557 
       
 12558 	TMockLtsyData1< TBool > ltsyData(useRats);	
       
 12559 	ltsyData.SerialiseL(expectData);
       
 12560 	
       
 12561     iMockLTSY.ExpectL( ECustomGetSystemNetworkModesIPC, expectData);
       
 12562     
       
 12563     customAPI.GetSystemNetworkModes(requestStatus, modes);
       
 12564 
       
 12565 	ERR_PRINTF2(_L("<font color=Orange>$CTSYKnownFailure: defect id = %d</font>"), 405201);
       
 12566 	//Request ECustomGetSystemNetworkModesIPC is not completed by timeout. 		
       
 12567 	
       
 12568 	User::WaitForRequest(requestStatus);	
       
 12569 	ASSERT_EQUALS(KErrTimedOut, requestStatus.Int());
       
 12570 
       
 12571 	AssertMockLtsyStatusL();
       
 12572 
       
 12573 	CleanupStack::PopAndDestroy(3); 	
       
 12574 
       
 12575 	}
       
 12576 
       
 12577 
       
 12578 /**
       
 12579 @SYMTestCaseID BA-CTSY-CIPC-MCSSNM-0001
       
 12580 @SYMComponent  telephony_ctsy
       
 12581 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::SetSystemNetworkMode
       
 12582 @SYMTestPriority High
       
 12583 @SYMTestActions Invokes RMmCustomAPI::SetSystemNetworkMode
       
 12584 @SYMTestExpectedResults Pass
       
 12585 @SYMTestType CT
       
 12586 */
       
 12587 void CCTsyCustomIPCFU::TestSetSystemNetworkMode0001L()
       
 12588 	{
       
 12589 
       
 12590 	OpenEtelServerL(EUseExtendedError);
       
 12591 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
 12592 	OpenPhoneL();
       
 12593 
       
 12594 	RMmCustomAPI customAPI;
       
 12595 	OpenCustomAPILC(customAPI, iPhone);
       
 12596 
       
 12597     TRequestStatus requestStatus;
       
 12598     RMmCustomAPI::TNetworkModeCaps caps(RMmCustomAPI::KCapsNetworkModeGsm);
       
 12599     RMmCustomAPI::TNetworkModeCaps expCaps(caps);
       
 12600    
       
 12601 	RBuf8 expectData;
       
 12602 	CleanupClosePushL(expectData);
       
 12603 
       
 12604 	TMockLtsyData1< RMmCustomAPI::TNetworkModeCaps > ltsyData(expCaps);	
       
 12605 	ltsyData.SerialiseL(expectData);
       
 12606     	
       
 12607  	//-------------------------------------------------------------------------
       
 12608 	// TEST A: failure to dispatch request to LTSY
       
 12609  	//-------------------------------------------------------------------------
       
 12610 
       
 12611     iMockLTSY.ExpectL( ECustomSetSystemNetworkModeIPC, expectData, KErrNotSupported);
       
 12612     
       
 12613     customAPI.SetSystemNetworkMode(requestStatus, caps);
       
 12614 	
       
 12615 	User::WaitForRequest(requestStatus);	
       
 12616 	ASSERT_EQUALS(KErrNotSupported, requestStatus.Int());
       
 12617 
       
 12618 	AssertMockLtsyStatusL();
       
 12619 
       
 12620 	//-------------------------------------------------------------------------
       
 12621 	// TEST B: failure on completion of pending request from LTSY->CTSY
       
 12622  	//-------------------------------------------------------------------------
       
 12623 
       
 12624     iMockLTSY.ExpectL( ECustomSetSystemNetworkModeIPC, expectData);
       
 12625     iMockLTSY.CompleteL( ECustomSetSystemNetworkModeIPC, KErrGeneral);
       
 12626 
       
 12627     customAPI.SetSystemNetworkMode(requestStatus, caps);
       
 12628 	
       
 12629 	User::WaitForRequest(requestStatus);	
       
 12630 	ASSERT_EQUALS(KErrGeneral, requestStatus.Int());
       
 12631 
       
 12632 	AssertMockLtsyStatusL();
       
 12633 
       
 12634  	//-------------------------------------------------------------------------
       
 12635 	// TEST C: Successful completion request of
       
 12636 	// RMmCustomAPI::SetSystemNetworkMode when result is not cached.
       
 12637  	//-------------------------------------------------------------------------
       
 12638 
       
 12639     iMockLTSY.ExpectL( ECustomSetSystemNetworkModeIPC, expectData);
       
 12640     iMockLTSY.CompleteL( ECustomSetSystemNetworkModeIPC, KErrNone);
       
 12641 
       
 12642     customAPI.SetSystemNetworkMode(requestStatus, caps);
       
 12643 	
       
 12644 	User::WaitForRequest(requestStatus);	
       
 12645 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
 12646 
       
 12647 	AssertMockLtsyStatusL();
       
 12648 
       
 12649  	//-------------------------------------------------------------------------
       
 12650 	// TEST E: Unsolicited completion of RMmCustomAPI::SetSystemNetworkMode
       
 12651 	// from LTSY.
       
 12652  	//-------------------------------------------------------------------------
       
 12653 
       
 12654 	TRequestStatus mockLtsyStatus;
       
 12655 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
 12656 
       
 12657     iMockLTSY.CompleteL( ECustomSetSystemNetworkModeIPC, KErrNone);
       
 12658 
       
 12659 	User::WaitForRequest(mockLtsyStatus);
       
 12660 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
 12661 
       
 12662 	AssertMockLtsyStatusL();
       
 12663 	CleanupStack::PopAndDestroy(3, this); 	
       
 12664 	
       
 12665 	}
       
 12666 
       
 12667 
       
 12668 /**
       
 12669 @SYMTestCaseID BA-CTSY-CIPC-MCSSNM-0002
       
 12670 @SYMComponent  telephony_ctsy
       
 12671 @SYMTestCaseDesc Test support in CTSY for cancelling of RMmCustomAPI::SetSystemNetworkMode
       
 12672 @SYMTestPriority High
       
 12673 @SYMTestActions Invokes cancelling of RMmCustomAPI::SetSystemNetworkMode
       
 12674 @SYMTestExpectedResults Pass
       
 12675 @SYMTestType CT
       
 12676 */
       
 12677 void CCTsyCustomIPCFU::TestSetSystemNetworkMode0002L()
       
 12678 	{
       
 12679 
       
 12680 	OpenEtelServerL(EUseExtendedError);
       
 12681 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
 12682 	OpenPhoneL();
       
 12683 
       
 12684 	RMmCustomAPI customAPI;
       
 12685 	OpenCustomAPILC(customAPI, iPhone);
       
 12686 
       
 12687     TRequestStatus requestStatus;
       
 12688 
       
 12689     RMmCustomAPI::TNetworkModeCaps caps(RMmCustomAPI::KCapsNetworkModeGsm);
       
 12690     RMmCustomAPI::TNetworkModeCaps expCaps(caps);
       
 12691    
       
 12692 	RBuf8 expectData;
       
 12693 	CleanupClosePushL(expectData);
       
 12694 
       
 12695 	TMockLtsyData1< RMmCustomAPI::TNetworkModeCaps > ltsyData(expCaps);	
       
 12696 	ltsyData.SerialiseL(expectData);
       
 12697 
       
 12698  	//-------------------------------------------------------------------------
       
 12699 	// Test cancelling of RMmCustomAPI::ECustomSetSystemNetworkModeIPC
       
 12700  	//-------------------------------------------------------------------------
       
 12701 
       
 12702     iMockLTSY.ExpectL( ECustomSetSystemNetworkModeIPC, expectData);    
       
 12703     iMockLTSY.CompleteL( ECustomSetSystemNetworkModeIPC, KErrNone, 20);
       
 12704 
       
 12705     customAPI.SetSystemNetworkMode(requestStatus, caps);
       
 12706 	
       
 12707 	customAPI.CancelAsyncRequest(ECustomSetSystemNetworkModeIPC);
       
 12708 
       
 12709 
       
 12710 	User::WaitForRequest(requestStatus);	
       
 12711 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
 12712 
       
 12713 	AssertMockLtsyStatusL();
       
 12714 
       
 12715 	CleanupStack::PopAndDestroy(3); 	
       
 12716 		
       
 12717 	}
       
 12718 
       
 12719 
       
 12720 
       
 12721 /**
       
 12722 @SYMTestCaseID BA-CTSY-CIPC-MCSSNM-0004
       
 12723 @SYMComponent  telephony_ctsy
       
 12724 @SYMTestCaseDesc Test support in CTSY for multiple client requests to RMmCustomAPI::SetSystemNetworkMode
       
 12725 @SYMTestPriority High
       
 12726 @SYMTestActions Invokes multiple client requests to RMmCustomAPI::SetSystemNetworkMode
       
 12727 @SYMTestExpectedResults Pass
       
 12728 @SYMTestType CT
       
 12729 */
       
 12730 void CCTsyCustomIPCFU::TestSetSystemNetworkMode0004L()
       
 12731 	{
       
 12732 
       
 12733 	OpenEtelServerL(EUseExtendedError);
       
 12734 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
 12735 	OpenPhoneL();
       
 12736 
       
 12737 	// Open second client
       
 12738 	RTelServer telServer2;
       
 12739 	TInt ret = telServer2.Connect();
       
 12740 	ASSERT_EQUALS(KErrNone, ret);
       
 12741 	CleanupClosePushL(telServer2);
       
 12742 
       
 12743 	RMobilePhone phone2;
       
 12744 	ret = phone2.Open(telServer2,KMmTsyPhoneName);
       
 12745 	ASSERT_EQUALS(KErrNone, ret);
       
 12746 	CleanupClosePushL(phone2);
       
 12747 
       
 12748 	RMmCustomAPI customAPI;
       
 12749 	OpenCustomAPILC(customAPI, iPhone);
       
 12750 
       
 12751 	RMmCustomAPI customAPI2;
       
 12752 	OpenCustomAPILC(customAPI2, phone2, EFalse);
       
 12753 
       
 12754     TRequestStatus requestStatus;
       
 12755     TRequestStatus requestStatus2;
       
 12756 
       
 12757     RMmCustomAPI::TNetworkModeCaps caps(RMmCustomAPI::KCapsNetworkModeGsm);
       
 12758     RMmCustomAPI::TNetworkModeCaps caps2(RMmCustomAPI::KCapsNetworkModeUmts);
       
 12759     RMmCustomAPI::TNetworkModeCaps expCaps(caps);
       
 12760    
       
 12761 	RBuf8 expectData;
       
 12762 	CleanupClosePushL(expectData);
       
 12763 
       
 12764 	TMockLtsyData1< RMmCustomAPI::TNetworkModeCaps > ltsyData(expCaps);	
       
 12765 	ltsyData.SerialiseL(expectData);
       
 12766 	
       
 12767 	//-------------------------------------------------------------------------
       
 12768 	// Test A: Test multiple clients requesting RMmCustomAPI::SetSystemNetworkMode
       
 12769  	//-------------------------------------------------------------------------
       
 12770 
       
 12771     iMockLTSY.ExpectL( ECustomSetSystemNetworkModeIPC, expectData, KErrNone);
       
 12772 
       
 12773     customAPI.SetSystemNetworkMode(requestStatus, caps);
       
 12774     customAPI2.SetSystemNetworkMode(requestStatus2, caps2);
       
 12775 
       
 12776     iMockLTSY.CompleteL( ECustomSetSystemNetworkModeIPC, KErrNone);
       
 12777     
       
 12778 	User::WaitForRequest(requestStatus);	
       
 12779 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
 12780     
       
 12781 	User::WaitForRequest(requestStatus2);	
       
 12782 	ASSERT_EQUALS(KErrServerBusy, requestStatus2.Int());
       
 12783 
       
 12784 	AssertMockLtsyStatusL();
       
 12785 
       
 12786 	CleanupStack::PopAndDestroy(6, this);
       
 12787 
       
 12788 	}
       
 12789 
       
 12790 
       
 12791 /**
       
 12792 @SYMTestCaseID BA-CTSY-CIPC-MCSSNM-0005
       
 12793 @SYMComponent  telephony_ctsy
       
 12794 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::SetSystemNetworkMode with timeout
       
 12795 @SYMTestPriority High
       
 12796 @SYMTestActions Invokes RMmCustomAPI::SetSystemNetworkMode and tests for timeout
       
 12797 @SYMTestExpectedResults Pass
       
 12798 @SYMTestType CT
       
 12799 */
       
 12800 void CCTsyCustomIPCFU::TestSetSystemNetworkMode0005L()
       
 12801 	{
       
 12802 
       
 12803 	OpenEtelServerL(EUseExtendedError);
       
 12804 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
 12805 	OpenPhoneL();
       
 12806 
       
 12807 	RMmCustomAPI customAPI;
       
 12808 	OpenCustomAPILC(customAPI, iPhone);
       
 12809 
       
 12810     TRequestStatus requestStatus;
       
 12811 
       
 12812     RMmCustomAPI::TNetworkModeCaps caps(RMmCustomAPI::KCapsNetworkModeGsm);
       
 12813     RMmCustomAPI::TNetworkModeCaps expCaps(caps);
       
 12814    
       
 12815 	RBuf8 expectData;
       
 12816 	CleanupClosePushL(expectData);
       
 12817 
       
 12818 	TMockLtsyData1< RMmCustomAPI::TNetworkModeCaps > ltsyData(expCaps);	
       
 12819 	ltsyData.SerialiseL(expectData);
       
 12820 	
       
 12821 	ERR_PRINTF2(_L("<font color=Orange>$CTSYKnownFailure: defect id = %d</font>"), 405302);
       
 12822 	//When testing RMmCustomAPI::SetSystemNetworkMode on timeout request ECustomSetSystemNetworkModeIPC
       
 12823 	// is not completed. Test is aborted by testexecute.
       
 12824 	
       
 12825 	// test is stopped because otherwise it blockes the next test
       
 12826 	ASSERT_TRUE(EFalse);
       
 12827 	
       
 12828     iMockLTSY.ExpectL( ECustomSetSystemNetworkModeIPC, expectData);
       
 12829 
       
 12830     customAPI.SetSystemNetworkMode(requestStatus, caps);
       
 12831 	
       
 12832 	User::WaitForRequest(requestStatus);	
       
 12833 	ASSERT_EQUALS(KErrTimedOut, requestStatus.Int());
       
 12834 
       
 12835 	AssertMockLtsyStatusL();
       
 12836 
       
 12837 	CleanupStack::PopAndDestroy(3); 
       
 12838 	
       
 12839 	}
       
 12840 
       
 12841 
       
 12842 /**
       
 12843 @SYMTestCaseID BA-CTSY-CIPC-MCGCSNM-0001
       
 12844 @SYMComponent  telephony_ctsy
       
 12845 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::GetCurrentSystemNetworkModes
       
 12846 @SYMTestPriority High
       
 12847 @SYMTestActions Invokes RMmCustomAPI::GetCurrentSystemNetworkModes
       
 12848 @SYMTestExpectedResults Pass
       
 12849 @SYMTestType CT
       
 12850 */
       
 12851 void CCTsyCustomIPCFU::TestGetCurrentSystemNetworkModes0001L()
       
 12852 	{
       
 12853 	
       
 12854 	OpenEtelServerL(EUseExtendedError);
       
 12855 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
 12856 	OpenPhoneL();
       
 12857 
       
 12858 	RMmCustomAPI customAPI;
       
 12859 	OpenCustomAPILC(customAPI, iPhone);
       
 12860 
       
 12861     TRequestStatus requestStatus;
       
 12862     TUint32 modes;
       
 12863     	
       
 12864  	//-------------------------------------------------------------------------
       
 12865 	// TEST A: failure to dispatch request to LTSY
       
 12866  	//-------------------------------------------------------------------------
       
 12867 
       
 12868     iMockLTSY.ExpectL( ECustomGetCurrentSystemNetworkModesIPC, KErrNotSupported);
       
 12869     
       
 12870     customAPI.GetCurrentSystemNetworkModes(requestStatus, modes);
       
 12871 	
       
 12872 	User::WaitForRequest(requestStatus);	
       
 12873 	ASSERT_EQUALS(KErrNotSupported, requestStatus.Int());
       
 12874 
       
 12875 	AssertMockLtsyStatusL();
       
 12876 
       
 12877 	//-------------------------------------------------------------------------
       
 12878 	// TEST B: failure on completion of pending request from LTSY->CTSY
       
 12879  	//-------------------------------------------------------------------------
       
 12880 
       
 12881     iMockLTSY.ExpectL( ECustomGetCurrentSystemNetworkModesIPC);
       
 12882 
       
 12883     const TUint32 compModes = 0xFFFF;
       
 12884     TPckg<TUint32> modesPckg(compModes);
       
 12885 
       
 12886     iMockLTSY.CompleteL( ECustomGetCurrentSystemNetworkModesIPC, KErrGeneral, modesPckg);
       
 12887 
       
 12888     customAPI.GetCurrentSystemNetworkModes(requestStatus, modes);
       
 12889 	
       
 12890 	User::WaitForRequest(requestStatus);	
       
 12891 	ASSERT_EQUALS(KErrGeneral, requestStatus.Int());
       
 12892 
       
 12893 	AssertMockLtsyStatusL();
       
 12894 
       
 12895  	//-------------------------------------------------------------------------
       
 12896 	// TEST C: Successful completion request of
       
 12897 	// RMmCustomAPI::GetCurrentSystemNetworkModes when result is not cached.
       
 12898  	//-------------------------------------------------------------------------
       
 12899 
       
 12900     iMockLTSY.ExpectL( ECustomGetCurrentSystemNetworkModesIPC);
       
 12901     iMockLTSY.CompleteL( ECustomGetCurrentSystemNetworkModesIPC, KErrNone, modesPckg);
       
 12902 
       
 12903     customAPI.GetCurrentSystemNetworkModes(requestStatus, modes);
       
 12904 	
       
 12905 	User::WaitForRequest(requestStatus);	
       
 12906 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
 12907 
       
 12908 	ASSERT_EQUALS(compModes, modes);
       
 12909 	
       
 12910 	AssertMockLtsyStatusL();
       
 12911 
       
 12912  	//-------------------------------------------------------------------------
       
 12913 	// TEST E: Unsolicited completion of RMmCustomAPI::GetCurrentSystemNetworkModes
       
 12914 	// from LTSY.
       
 12915  	//-------------------------------------------------------------------------
       
 12916 
       
 12917 	TRequestStatus mockLtsyStatus;
       
 12918 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
 12919 
       
 12920     iMockLTSY.CompleteL( ECustomGetCurrentSystemNetworkModesIPC, KErrNone, modesPckg);
       
 12921 
       
 12922 	User::WaitForRequest(mockLtsyStatus);
       
 12923 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
 12924 
       
 12925 	AssertMockLtsyStatusL();
       
 12926 	CleanupStack::PopAndDestroy(2, this); 	
       
 12927 	
       
 12928 	}
       
 12929 
       
 12930 
       
 12931 /**
       
 12932 @SYMTestCaseID BA-CTSY-CIPC-MCGCSNM-0002
       
 12933 @SYMComponent  telephony_ctsy
       
 12934 @SYMTestCaseDesc Test support in CTSY for cancelling of RMmCustomAPI::GetCurrentSystemNetworkModes
       
 12935 @SYMTestPriority High
       
 12936 @SYMTestActions Invokes cancelling of RMmCustomAPI::GetCurrentSystemNetworkModes
       
 12937 @SYMTestExpectedResults Pass
       
 12938 @SYMTestType CT
       
 12939 */
       
 12940 void CCTsyCustomIPCFU::TestGetCurrentSystemNetworkModes0002L()
       
 12941 	{
       
 12942 
       
 12943 	OpenEtelServerL(EUseExtendedError);
       
 12944 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
 12945 	OpenPhoneL();
       
 12946 
       
 12947 	RMmCustomAPI customAPI;
       
 12948 	OpenCustomAPILC(customAPI, iPhone);
       
 12949 
       
 12950     TRequestStatus requestStatus;
       
 12951     TUint32 modes;	
       
 12952 
       
 12953 	TRequestStatus mockLtsyStatus;
       
 12954 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
 12955 
       
 12956  	//-------------------------------------------------------------------------
       
 12957 	// Test cancelling of RMmCustomAPI::GetCurrentSystemNetworkModes
       
 12958  	//-------------------------------------------------------------------------
       
 12959 
       
 12960     iMockLTSY.ExpectL( ECustomGetCurrentSystemNetworkModesIPC);
       
 12961     
       
 12962     const TUint32 compModes = 0xFFFF;
       
 12963     TPckg<TUint32> modesPckg(compModes);
       
 12964     
       
 12965     iMockLTSY.CompleteL( ECustomGetCurrentSystemNetworkModesIPC, KErrNone, modesPckg, 20);
       
 12966 
       
 12967     customAPI.GetCurrentSystemNetworkModes(requestStatus, modes);
       
 12968 	
       
 12969 	customAPI.CancelAsyncRequest(ECustomGetCurrentSystemNetworkModesIPC);
       
 12970 
       
 12971 	User::WaitForRequest(requestStatus);	
       
 12972 	ASSERT_EQUALS(KErrCancel, requestStatus.Int());
       
 12973 
       
 12974 	User::WaitForRequest(mockLtsyStatus);
       
 12975 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
 12976 
       
 12977 	AssertMockLtsyStatusL();
       
 12978 
       
 12979 	CleanupStack::PopAndDestroy(2); 	
       
 12980 		
       
 12981 	}
       
 12982 
       
 12983 
       
 12984 
       
 12985 
       
 12986 /**
       
 12987 @SYMTestCaseID BA-CTSY-CIPC-MCGCSNM-0004
       
 12988 @SYMComponent  telephony_ctsy
       
 12989 @SYMTestCaseDesc Test support in CTSY for multiple client requests to RMmCustomAPI::GetCurrentSystemNetworkModes
       
 12990 @SYMTestPriority High
       
 12991 @SYMTestActions Invokes multiple client requests to RMmCustomAPI::GetCurrentSystemNetworkModes
       
 12992 @SYMTestExpectedResults Pass
       
 12993 @SYMTestType CT
       
 12994 */
       
 12995 void CCTsyCustomIPCFU::TestGetCurrentSystemNetworkModes0004L()
       
 12996 	{
       
 12997 
       
 12998 	OpenEtelServerL(EUseExtendedError);
       
 12999 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
 13000 	OpenPhoneL();
       
 13001 
       
 13002 	// Open second client
       
 13003 	RTelServer telServer2;
       
 13004 	TInt ret = telServer2.Connect();
       
 13005 	ASSERT_EQUALS(KErrNone, ret);
       
 13006 	CleanupClosePushL(telServer2);
       
 13007 
       
 13008 	RMobilePhone phone2;
       
 13009 	ret = phone2.Open(telServer2,KMmTsyPhoneName);
       
 13010 	ASSERT_EQUALS(KErrNone, ret);
       
 13011 	CleanupClosePushL(phone2);
       
 13012 
       
 13013 	RMmCustomAPI customAPI;
       
 13014 	OpenCustomAPILC(customAPI, iPhone);
       
 13015 
       
 13016 	RMmCustomAPI customAPI2;
       
 13017 	OpenCustomAPILC(customAPI2, phone2, EFalse);
       
 13018 
       
 13019     TRequestStatus requestStatus;
       
 13020     TRequestStatus requestStatus2;
       
 13021 
       
 13022     TUint32 modes;	
       
 13023     TUint32 modes2;	
       
 13024 	
       
 13025 	//-------------------------------------------------------------------------
       
 13026 	// Test A: Test multiple clients requesting RMmCustomAPI::GetCurrentSystemNetworkModes
       
 13027  	//-------------------------------------------------------------------------
       
 13028 
       
 13029     iMockLTSY.ExpectL( ECustomGetCurrentSystemNetworkModesIPC, KErrNone);
       
 13030 
       
 13031     customAPI.GetCurrentSystemNetworkModes(requestStatus, modes);
       
 13032     customAPI2.GetCurrentSystemNetworkModes(requestStatus2, modes2);
       
 13033 
       
 13034     const TUint32 compModes = 0xFFFF;
       
 13035     TPckg<TUint32> modesPckg(compModes);
       
 13036 
       
 13037     iMockLTSY.CompleteL( ECustomGetCurrentSystemNetworkModesIPC, KErrNone, modesPckg);
       
 13038     
       
 13039 	User::WaitForRequest(requestStatus);	
       
 13040 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
 13041     
       
 13042 	User::WaitForRequest(requestStatus2);	
       
 13043 	ASSERT_EQUALS(KErrServerBusy, requestStatus2.Int());
       
 13044 
       
 13045 	AssertMockLtsyStatusL();
       
 13046 
       
 13047 	CleanupStack::PopAndDestroy(5, this);
       
 13048 
       
 13049 	}
       
 13050 
       
 13051 
       
 13052 /**
       
 13053 @SYMTestCaseID BA-CTSY-CIPC-MCGCSNM-0005
       
 13054 @SYMComponent  telephony_ctsy
       
 13055 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::GetCurrentSystemNetworkModes with timeout
       
 13056 @SYMTestPriority High
       
 13057 @SYMTestActions Invokes RMmCustomAPI::GetCurrentSystemNetworkModes and tests for timeout
       
 13058 @SYMTestExpectedResults Pass
       
 13059 @SYMTestType CT
       
 13060 */
       
 13061 void CCTsyCustomIPCFU::TestGetCurrentSystemNetworkModes0005L()
       
 13062 	{
       
 13063 
       
 13064 	OpenEtelServerL(EUseExtendedError);
       
 13065 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
 13066 	OpenPhoneL();
       
 13067 
       
 13068 	RMmCustomAPI customAPI;
       
 13069 	OpenCustomAPILC(customAPI, iPhone);
       
 13070 
       
 13071     TRequestStatus requestStatus;
       
 13072     TUint32 modes;	
       
 13073 
       
 13074     iMockLTSY.ExpectL( ECustomGetCurrentSystemNetworkModesIPC);
       
 13075 
       
 13076     customAPI.GetCurrentSystemNetworkModes(requestStatus, modes);
       
 13077 	
       
 13078 	ERR_PRINTF2(_L("<font color=Orange>$CTSYKnownFailure: defect id = %d</font>"), 405401);
       
 13079 	//Request ECustomGetCurrentSystemNetworkModesIPC is not completed by timeout. 		
       
 13080 	
       
 13081 	User::WaitForRequest(requestStatus);	
       
 13082 	ASSERT_EQUALS(KErrTimedOut, requestStatus.Int());
       
 13083 
       
 13084 	AssertMockLtsyStatusL();
       
 13085 
       
 13086 	CleanupStack::PopAndDestroy(2); 
       
 13087 
       
 13088 	}
       
 13089 
       
 13090 
       
 13091 /**
       
 13092 @SYMTestCaseID BA-CTSY-CIPC-MCPSON-0001
       
 13093 @SYMComponent  telephony_ctsy
       
 13094 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::PowerSimOn
       
 13095 @SYMTestPriority High
       
 13096 @SYMTestActions Invokes RMmCustomAPI::PowerSimOn
       
 13097 @SYMTestExpectedResults Pass
       
 13098 @SYMTestType CT
       
 13099 */
       
 13100 void CCTsyCustomIPCFU::TestPowerSimOn0001L()
       
 13101 	{
       
 13102 
       
 13103 	OpenEtelServerL(EUseExtendedError);
       
 13104 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
 13105 	OpenPhoneL();
       
 13106 
       
 13107 	RMmCustomAPI customAPI;
       
 13108 	OpenCustomAPILC(customAPI, iPhone);
       
 13109 
       
 13110     TRequestStatus requestStatus;
       
 13111 	
       
 13112  	//-------------------------------------------------------------------------
       
 13113 	// TEST A: failure to dispatch request to LTSY
       
 13114  	//-------------------------------------------------------------------------
       
 13115 
       
 13116     iMockLTSY.ExpectL( ECustomPowerSimOnIPC, KErrNotSupported);
       
 13117     
       
 13118     customAPI.PowerSimOn(requestStatus);
       
 13119 	
       
 13120 	User::WaitForRequest(requestStatus);	
       
 13121 	ASSERT_EQUALS(KErrNotSupported, requestStatus.Int());
       
 13122 
       
 13123 	AssertMockLtsyStatusL();
       
 13124 
       
 13125 	//-------------------------------------------------------------------------
       
 13126 	// TEST B: failure on completion of pending request from LTSY->CTSY
       
 13127  	//-------------------------------------------------------------------------
       
 13128 
       
 13129     iMockLTSY.ExpectL( ECustomPowerSimOnIPC);
       
 13130 
       
 13131     iMockLTSY.CompleteL( ECustomPowerSimOnIPC, KErrGeneral);
       
 13132 
       
 13133     customAPI.PowerSimOn(requestStatus);
       
 13134 	
       
 13135 	User::WaitForRequest(requestStatus);	
       
 13136 	ASSERT_EQUALS(KErrGeneral, requestStatus.Int());
       
 13137 
       
 13138 	AssertMockLtsyStatusL();
       
 13139 
       
 13140  	//-------------------------------------------------------------------------
       
 13141 	// TEST C: Successful completion request of
       
 13142 	// RMmCustomAPI::PowerSimOn when result is not cached.
       
 13143  	//-------------------------------------------------------------------------
       
 13144 
       
 13145     iMockLTSY.ExpectL( ECustomPowerSimOnIPC);
       
 13146     iMockLTSY.CompleteL( ECustomPowerSimOnIPC, KErrNone);
       
 13147 
       
 13148     customAPI.PowerSimOn(requestStatus);
       
 13149 	
       
 13150 	User::WaitForRequest(requestStatus);	
       
 13151 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
 13152 	
       
 13153 	AssertMockLtsyStatusL();
       
 13154 
       
 13155  	//-------------------------------------------------------------------------
       
 13156 	// TEST E: Unsolicited completion of RMmCustomAPI::PowerSimOn
       
 13157 	// from LTSY.
       
 13158  	//-------------------------------------------------------------------------
       
 13159 
       
 13160 	TRequestStatus mockLtsyStatus;
       
 13161 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
 13162 
       
 13163     iMockLTSY.CompleteL( ECustomPowerSimOnIPC, KErrNone);
       
 13164 
       
 13165 	User::WaitForRequest(mockLtsyStatus);
       
 13166 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
 13167 
       
 13168 	AssertMockLtsyStatusL();
       
 13169 	CleanupStack::PopAndDestroy(2, this); 	
       
 13170 	
       
 13171 	}
       
 13172 
       
 13173 
       
 13174 /**
       
 13175 @SYMTestCaseID BA-CTSY-CIPC-MCPSON-0002
       
 13176 @SYMComponent  telephony_ctsy
       
 13177 @SYMTestCaseDesc Test support in CTSY for cancelling of RMmCustomAPI::PowerSimOn
       
 13178 @SYMTestPriority High
       
 13179 @SYMTestActions Invokes cancelling of RMmCustomAPI::PowerSimOn
       
 13180 @SYMTestExpectedResults Pass
       
 13181 @SYMTestType CT
       
 13182 */
       
 13183 void CCTsyCustomIPCFU::TestPowerSimOn0002L()
       
 13184 	{
       
 13185 
       
 13186 	OpenEtelServerL(EUseExtendedError);
       
 13187 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
 13188 	OpenPhoneL();
       
 13189 
       
 13190 	RMmCustomAPI customAPI;
       
 13191 	OpenCustomAPILC(customAPI, iPhone);
       
 13192 
       
 13193     TRequestStatus requestStatus;
       
 13194 
       
 13195 	TRequestStatus mockLtsyStatus;
       
 13196 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
 13197 
       
 13198  	//-------------------------------------------------------------------------
       
 13199 	// Test cancelling of RMmCustomAPI::PowerSimOn
       
 13200  	//-------------------------------------------------------------------------
       
 13201 
       
 13202     iMockLTSY.ExpectL( ECustomPowerSimOnIPC);
       
 13203     iMockLTSY.CompleteL( ECustomPowerSimOnIPC, KErrNone, 20);
       
 13204 
       
 13205     customAPI.PowerSimOn(requestStatus);
       
 13206 	
       
 13207 	customAPI.CancelAsyncRequest(ECustomPowerSimOnIPC);
       
 13208 
       
 13209 	User::WaitForRequest(requestStatus);	
       
 13210 	ASSERT_EQUALS(KErrCancel, requestStatus.Int());
       
 13211 
       
 13212 	User::WaitForRequest(mockLtsyStatus);
       
 13213 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
 13214 
       
 13215 	AssertMockLtsyStatusL();
       
 13216 
       
 13217 	CleanupStack::PopAndDestroy(2); 	
       
 13218 	
       
 13219 	}
       
 13220 
       
 13221 
       
 13222 /**
       
 13223 @SYMTestCaseID BA-CTSY-CIPC-MCPSON-0004
       
 13224 @SYMComponent  telephony_ctsy
       
 13225 @SYMTestCaseDesc Test support in CTSY for multiple client requests to RMmCustomAPI::PowerSimOn
       
 13226 @SYMTestPriority High
       
 13227 @SYMTestActions Invokes multiple client requests to RMmCustomAPI::PowerSimOn
       
 13228 @SYMTestExpectedResults Pass
       
 13229 @SYMTestType CT
       
 13230 */
       
 13231 void CCTsyCustomIPCFU::TestPowerSimOn0004L()
       
 13232 	{
       
 13233 
       
 13234 	OpenEtelServerL(EUseExtendedError);
       
 13235 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
 13236 	OpenPhoneL();
       
 13237 
       
 13238 	// Open second client
       
 13239 	RTelServer telServer2;
       
 13240 	TInt ret = telServer2.Connect();
       
 13241 	ASSERT_EQUALS(KErrNone, ret);
       
 13242 	CleanupClosePushL(telServer2);
       
 13243 
       
 13244 	RMobilePhone phone2;
       
 13245 	ret = phone2.Open(telServer2,KMmTsyPhoneName);
       
 13246 	ASSERT_EQUALS(KErrNone, ret);
       
 13247 	CleanupClosePushL(phone2);
       
 13248 
       
 13249 	RMmCustomAPI customAPI;
       
 13250 	OpenCustomAPILC(customAPI, iPhone);
       
 13251 
       
 13252 	RMmCustomAPI customAPI2;
       
 13253 	OpenCustomAPILC(customAPI2, phone2, EFalse);
       
 13254 
       
 13255     TRequestStatus requestStatus;
       
 13256     TRequestStatus requestStatus2;
       
 13257 	
       
 13258 	//-------------------------------------------------------------------------
       
 13259 	// Test A: Test multiple clients requesting RMmCustomAPI::PowerSimOn
       
 13260  	//-------------------------------------------------------------------------
       
 13261 
       
 13262     iMockLTSY.ExpectL( ECustomPowerSimOnIPC, KErrNone);
       
 13263 
       
 13264     customAPI.PowerSimOn(requestStatus);
       
 13265     customAPI2.PowerSimOn(requestStatus2);
       
 13266 
       
 13267     iMockLTSY.CompleteL( ECustomPowerSimOnIPC, KErrNone);
       
 13268     
       
 13269 	User::WaitForRequest(requestStatus);	
       
 13270 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
 13271     
       
 13272 	User::WaitForRequest(requestStatus2);	
       
 13273 	ASSERT_EQUALS(KErrServerBusy, requestStatus2.Int());
       
 13274 
       
 13275 	AssertMockLtsyStatusL();
       
 13276 
       
 13277 	CleanupStack::PopAndDestroy(5, this);
       
 13278 
       
 13279 	}
       
 13280 
       
 13281 
       
 13282 /**
       
 13283 @SYMTestCaseID BA-CTSY-CIPC-MCPSON-0005
       
 13284 @SYMComponent  telephony_ctsy
       
 13285 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::PowerSimOn with timeout
       
 13286 @SYMTestPriority High
       
 13287 @SYMTestActions Invokes RMmCustomAPI::PowerSimOn and tests for timeout
       
 13288 @SYMTestExpectedResults Pass
       
 13289 @SYMTestType CT
       
 13290 */
       
 13291 void CCTsyCustomIPCFU::TestPowerSimOn0005L()
       
 13292 	{
       
 13293 	
       
 13294 	OpenEtelServerL(EUseExtendedError);
       
 13295 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
 13296 	OpenPhoneL();
       
 13297 
       
 13298 	RMmCustomAPI customAPI;
       
 13299 	OpenCustomAPILC(customAPI, iPhone);
       
 13300 
       
 13301     TRequestStatus requestStatus;
       
 13302 
       
 13303     iMockLTSY.ExpectL( ECustomPowerSimOnIPC);
       
 13304 
       
 13305     customAPI.PowerSimOn(requestStatus);
       
 13306 	
       
 13307 	User::WaitForRequest(requestStatus);	
       
 13308 	ASSERT_EQUALS(KErrTimedOut, requestStatus.Int());
       
 13309 
       
 13310 	AssertMockLtsyStatusL();
       
 13311 
       
 13312 	CleanupStack::PopAndDestroy(2); 
       
 13313 	
       
 13314 	}
       
 13315 
       
 13316 
       
 13317 /**
       
 13318 @SYMTestCaseID BA-CTSY-CIPC-MCPSOF-0001
       
 13319 @SYMComponent  telephony_ctsy
       
 13320 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::PowerSimOff
       
 13321 @SYMTestPriority High
       
 13322 @SYMTestActions Invokes RMmCustomAPI::PowerSimOff
       
 13323 @SYMTestExpectedResults Pass
       
 13324 @SYMTestType CT
       
 13325 */
       
 13326 void CCTsyCustomIPCFU::TestPowerSimOff0001L()
       
 13327 	{
       
 13328 
       
 13329 	OpenEtelServerL(EUseExtendedError);
       
 13330 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
 13331 	OpenPhoneL();
       
 13332 
       
 13333 	RMmCustomAPI customAPI;
       
 13334 	OpenCustomAPILC(customAPI, iPhone);
       
 13335 
       
 13336     TRequestStatus requestStatus;
       
 13337 	
       
 13338  	//-------------------------------------------------------------------------
       
 13339 	// TEST A: failure to dispatch request to LTSY
       
 13340  	//-------------------------------------------------------------------------
       
 13341 
       
 13342     iMockLTSY.ExpectL( ECustomPowerSimOffIPC, KErrNotSupported);
       
 13343     
       
 13344     customAPI.PowerSimOff(requestStatus);
       
 13345 	
       
 13346 	User::WaitForRequest(requestStatus);	
       
 13347 	ASSERT_EQUALS(KErrNotSupported, requestStatus.Int());
       
 13348 
       
 13349 	AssertMockLtsyStatusL();
       
 13350 
       
 13351 	//-------------------------------------------------------------------------
       
 13352 	// TEST B: failure on completion of pending request from LTSY->CTSY
       
 13353  	//-------------------------------------------------------------------------
       
 13354 
       
 13355     iMockLTSY.ExpectL( ECustomPowerSimOffIPC);
       
 13356 
       
 13357     iMockLTSY.CompleteL( ECustomPowerSimOffIPC, KErrGeneral);
       
 13358 
       
 13359     customAPI.PowerSimOff(requestStatus);
       
 13360 	
       
 13361 	User::WaitForRequest(requestStatus);	
       
 13362 	ASSERT_EQUALS(KErrGeneral, requestStatus.Int());
       
 13363 
       
 13364 	AssertMockLtsyStatusL();
       
 13365 
       
 13366  	//-------------------------------------------------------------------------
       
 13367 	// TEST C: Successful completion request of
       
 13368 	// RMmCustomAPI::PowerSimOff when result is not cached.
       
 13369  	//-------------------------------------------------------------------------
       
 13370 
       
 13371     iMockLTSY.ExpectL( ECustomPowerSimOffIPC);
       
 13372     iMockLTSY.CompleteL( ECustomPowerSimOffIPC, KErrNone);
       
 13373 
       
 13374     customAPI.PowerSimOff(requestStatus);
       
 13375 	
       
 13376 	User::WaitForRequest(requestStatus);	
       
 13377 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
 13378 	
       
 13379 	AssertMockLtsyStatusL();
       
 13380 
       
 13381  	//-------------------------------------------------------------------------
       
 13382 	// TEST E: Unsolicited completion of RMmCustomAPI::PowerSimOff
       
 13383 	// from LTSY.
       
 13384  	//-------------------------------------------------------------------------
       
 13385 
       
 13386 	TRequestStatus mockLtsyStatus;
       
 13387 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
 13388 
       
 13389     iMockLTSY.CompleteL( ECustomPowerSimOffIPC, KErrNone);
       
 13390 
       
 13391 	User::WaitForRequest(mockLtsyStatus);
       
 13392 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
 13393 
       
 13394 	AssertMockLtsyStatusL();
       
 13395 	CleanupStack::PopAndDestroy(2, this); 
       
 13396 	
       
 13397 	}
       
 13398 
       
 13399 
       
 13400 /**
       
 13401 @SYMTestCaseID BA-CTSY-CIPC-MCPSOF-0002
       
 13402 @SYMComponent  telephony_ctsy
       
 13403 @SYMTestCaseDesc Test support in CTSY for cancelling of RMmCustomAPI::PowerSimOff
       
 13404 @SYMTestPriority High
       
 13405 @SYMTestActions Invokes cancelling of RMmCustomAPI::PowerSimOff
       
 13406 @SYMTestExpectedResults Pass
       
 13407 @SYMTestType CT
       
 13408 */
       
 13409 void CCTsyCustomIPCFU::TestPowerSimOff0002L()
       
 13410 	{
       
 13411 	
       
 13412 	OpenEtelServerL(EUseExtendedError);
       
 13413 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
 13414 	OpenPhoneL();
       
 13415 
       
 13416 	RMmCustomAPI customAPI;
       
 13417 	OpenCustomAPILC(customAPI, iPhone);
       
 13418 
       
 13419     TRequestStatus requestStatus;
       
 13420 	
       
 13421 
       
 13422 	TRequestStatus mockLtsyStatus;
       
 13423 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
 13424 
       
 13425  	//-------------------------------------------------------------------------
       
 13426 	// Test cancelling of RMmCustomAPI::PowerSimOff
       
 13427  	//-------------------------------------------------------------------------
       
 13428 
       
 13429     iMockLTSY.ExpectL( ECustomPowerSimOffIPC);
       
 13430     iMockLTSY.CompleteL( ECustomPowerSimOffIPC, KErrNone, 20);
       
 13431 
       
 13432     customAPI.PowerSimOff(requestStatus);
       
 13433 	
       
 13434 	customAPI.CancelAsyncRequest(ECustomPowerSimOffIPC);
       
 13435 
       
 13436 	User::WaitForRequest(requestStatus);	
       
 13437 	ASSERT_EQUALS(KErrCancel, requestStatus.Int());
       
 13438 
       
 13439 	User::WaitForRequest(mockLtsyStatus);
       
 13440 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
 13441 
       
 13442 	AssertMockLtsyStatusL();
       
 13443 
       
 13444 	CleanupStack::PopAndDestroy(2); 	
       
 13445 	}
       
 13446 
       
 13447 
       
 13448 
       
 13449 
       
 13450 /**
       
 13451 @SYMTestCaseID BA-CTSY-CIPC-MCPSOF-0004
       
 13452 @SYMComponent  telephony_ctsy
       
 13453 @SYMTestCaseDesc Test support in CTSY for multiple client requests to RMmCustomAPI::PowerSimOff
       
 13454 @SYMTestPriority High
       
 13455 @SYMTestActions Invokes multiple client requests to RMmCustomAPI::PowerSimOff
       
 13456 @SYMTestExpectedResults Pass
       
 13457 @SYMTestType CT
       
 13458 */
       
 13459 void CCTsyCustomIPCFU::TestPowerSimOff0004L()
       
 13460 	{
       
 13461 
       
 13462 	OpenEtelServerL(EUseExtendedError);
       
 13463 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
 13464 	OpenPhoneL();
       
 13465 
       
 13466 	// Open second client
       
 13467 	RTelServer telServer2;
       
 13468 	TInt ret = telServer2.Connect();
       
 13469 	ASSERT_EQUALS(KErrNone, ret);
       
 13470 	CleanupClosePushL(telServer2);
       
 13471 
       
 13472 	RMobilePhone phone2;
       
 13473 	ret = phone2.Open(telServer2,KMmTsyPhoneName);
       
 13474 	ASSERT_EQUALS(KErrNone, ret);
       
 13475 	CleanupClosePushL(phone2);
       
 13476 
       
 13477 	RMmCustomAPI customAPI;
       
 13478 	OpenCustomAPILC(customAPI, iPhone);
       
 13479 
       
 13480 	RMmCustomAPI customAPI2;
       
 13481 	OpenCustomAPILC(customAPI2, phone2, EFalse);
       
 13482 
       
 13483     TRequestStatus requestStatus;
       
 13484     TRequestStatus requestStatus2;
       
 13485 	
       
 13486 	//-------------------------------------------------------------------------
       
 13487 	// Test A: Test multiple clients requesting RMmCustomAPI::PowerSimOff
       
 13488  	//-------------------------------------------------------------------------
       
 13489 
       
 13490     iMockLTSY.ExpectL( ECustomPowerSimOffIPC, KErrNone);
       
 13491 
       
 13492     customAPI.PowerSimOff(requestStatus);
       
 13493     customAPI2.PowerSimOff(requestStatus2);
       
 13494 
       
 13495     iMockLTSY.CompleteL( ECustomPowerSimOffIPC, KErrNone);
       
 13496     
       
 13497 	User::WaitForRequest(requestStatus);	
       
 13498 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
 13499     
       
 13500 	User::WaitForRequest(requestStatus2);	
       
 13501 	ASSERT_EQUALS(KErrServerBusy, requestStatus2.Int());
       
 13502 
       
 13503 	AssertMockLtsyStatusL();
       
 13504 
       
 13505 	CleanupStack::PopAndDestroy(5, this);
       
 13506 	}
       
 13507 
       
 13508 
       
 13509 /**
       
 13510 @SYMTestCaseID BA-CTSY-CIPC-MCPSOF-0005
       
 13511 @SYMComponent  telephony_ctsy
       
 13512 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::PowerSimOff with timeout
       
 13513 @SYMTestPriority High
       
 13514 @SYMTestActions Invokes RMmCustomAPI::PowerSimOff and tests for timeout
       
 13515 @SYMTestExpectedResults Pass
       
 13516 @SYMTestType CT
       
 13517 */
       
 13518 void CCTsyCustomIPCFU::TestPowerSimOff0005L()
       
 13519 	{
       
 13520 
       
 13521 	OpenEtelServerL(EUseExtendedError);
       
 13522 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
 13523 	OpenPhoneL();
       
 13524 
       
 13525 	RMmCustomAPI customAPI;
       
 13526 	OpenCustomAPILC(customAPI, iPhone);
       
 13527 
       
 13528     TRequestStatus requestStatus;
       
 13529 
       
 13530     iMockLTSY.ExpectL( ECustomPowerSimOffIPC);
       
 13531 
       
 13532     customAPI.PowerSimOff(requestStatus);
       
 13533 	
       
 13534 	User::WaitForRequest(requestStatus);	
       
 13535 	ASSERT_EQUALS(KErrTimedOut, requestStatus.Int());
       
 13536 
       
 13537 	AssertMockLtsyStatusL();
       
 13538 
       
 13539 	CleanupStack::PopAndDestroy(2); 	
       
 13540 
       
 13541 	}
       
 13542 
       
 13543 
       
 13544 /**
       
 13545 @SYMTestCaseID BA-CTSY-CIPC-MCSWR-0001
       
 13546 @SYMComponent  telephony_ctsy
       
 13547 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::SimWarmReset
       
 13548 @SYMTestPriority High
       
 13549 @SYMTestActions Invokes RMmCustomAPI::SimWarmReset
       
 13550 @SYMTestExpectedResults Pass
       
 13551 @SYMTestType CT
       
 13552 */
       
 13553 void CCTsyCustomIPCFU::TestSimWarmReset0001L()
       
 13554 	{
       
 13555 
       
 13556 	OpenEtelServerL(EUseExtendedError);
       
 13557 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
 13558 	OpenPhoneL();
       
 13559 
       
 13560 	RMmCustomAPI customAPI;
       
 13561 	OpenCustomAPILC(customAPI, iPhone);
       
 13562 
       
 13563     TRequestStatus requestStatus;
       
 13564 	
       
 13565  	//-------------------------------------------------------------------------
       
 13566 	// TEST A: failure to dispatch request to LTSY
       
 13567  	//-------------------------------------------------------------------------
       
 13568 
       
 13569     iMockLTSY.ExpectL( ECustomSimWarmResetIPC, KErrNotSupported);
       
 13570     
       
 13571     customAPI.SimWarmReset(requestStatus);
       
 13572 	
       
 13573 	User::WaitForRequest(requestStatus);	
       
 13574 	ASSERT_EQUALS(KErrNotSupported, requestStatus.Int());
       
 13575 
       
 13576 	AssertMockLtsyStatusL();
       
 13577 
       
 13578 	//-------------------------------------------------------------------------
       
 13579 	// TEST B: failure on completion of pending request from LTSY->CTSY
       
 13580  	//-------------------------------------------------------------------------
       
 13581 
       
 13582     iMockLTSY.ExpectL( ECustomSimWarmResetIPC);
       
 13583 
       
 13584     iMockLTSY.CompleteL( ECustomSimWarmResetIPC, KErrGeneral);
       
 13585 
       
 13586     customAPI.SimWarmReset(requestStatus);
       
 13587 	
       
 13588 	User::WaitForRequest(requestStatus);	
       
 13589 	ASSERT_EQUALS(KErrGeneral, requestStatus.Int());
       
 13590 
       
 13591 	AssertMockLtsyStatusL();
       
 13592 
       
 13593  	//-------------------------------------------------------------------------
       
 13594 	// TEST C: Successful completion request of
       
 13595 	// RMmCustomAPI::SimWarmReset when result is not cached.
       
 13596  	//-------------------------------------------------------------------------
       
 13597 
       
 13598     iMockLTSY.ExpectL( ECustomSimWarmResetIPC);
       
 13599     iMockLTSY.CompleteL( ECustomSimWarmResetIPC, KErrNone);
       
 13600 
       
 13601     customAPI.SimWarmReset(requestStatus);
       
 13602 	
       
 13603 	User::WaitForRequest(requestStatus);	
       
 13604 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
 13605 	
       
 13606 	AssertMockLtsyStatusL();
       
 13607 
       
 13608  	//-------------------------------------------------------------------------
       
 13609 	// TEST E: Unsolicited completion of RMmCustomAPI::SimWarmReset
       
 13610 	// from LTSY.
       
 13611  	//-------------------------------------------------------------------------
       
 13612 
       
 13613 	TRequestStatus mockLtsyStatus;
       
 13614 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
 13615 
       
 13616     iMockLTSY.CompleteL( ECustomSimWarmResetIPC, KErrNone);
       
 13617 
       
 13618 	User::WaitForRequest(mockLtsyStatus);
       
 13619 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
 13620 
       
 13621 	AssertMockLtsyStatusL();
       
 13622 	CleanupStack::PopAndDestroy(2, this); 
       
 13623 	
       
 13624 	}
       
 13625 
       
 13626 
       
 13627 /**
       
 13628 @SYMTestCaseID BA-CTSY-CIPC-MCSWR-0002
       
 13629 @SYMComponent  telephony_ctsy
       
 13630 @SYMTestCaseDesc Test support in CTSY for cancelling of RMmCustomAPI::SimWarmReset
       
 13631 @SYMTestPriority High
       
 13632 @SYMTestActions Invokes cancelling of RMmCustomAPI::SimWarmReset
       
 13633 @SYMTestExpectedResults Pass
       
 13634 @SYMTestType CT
       
 13635 */
       
 13636 void CCTsyCustomIPCFU::TestSimWarmReset0002L()
       
 13637 	{
       
 13638 
       
 13639 	OpenEtelServerL(EUseExtendedError);
       
 13640 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
 13641 	OpenPhoneL();
       
 13642 
       
 13643 	RMmCustomAPI customAPI;
       
 13644 	OpenCustomAPILC(customAPI, iPhone);
       
 13645 
       
 13646     TRequestStatus requestStatus;
       
 13647 	
       
 13648 
       
 13649 	TRequestStatus mockLtsyStatus;
       
 13650 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
 13651 
       
 13652  	//-------------------------------------------------------------------------
       
 13653 	// Test cancelling of RMmCustomAPI::SimWarmReset
       
 13654  	//-------------------------------------------------------------------------
       
 13655 
       
 13656     iMockLTSY.ExpectL( ECustomSimWarmResetIPC);
       
 13657     iMockLTSY.CompleteL( ECustomSimWarmResetIPC, KErrNone, 20);
       
 13658 
       
 13659     customAPI.SimWarmReset(requestStatus);
       
 13660 	
       
 13661 	customAPI.CancelAsyncRequest(ECustomSimWarmResetIPC);
       
 13662 
       
 13663 	User::WaitForRequest(requestStatus);	
       
 13664 	ASSERT_EQUALS(KErrCancel, requestStatus.Int());
       
 13665 
       
 13666 	User::WaitForRequest(mockLtsyStatus);
       
 13667 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
 13668 
       
 13669 	AssertMockLtsyStatusL();
       
 13670 
       
 13671 	CleanupStack::PopAndDestroy(2); 
       
 13672 	
       
 13673 	}
       
 13674 
       
 13675 
       
 13676 
       
 13677 
       
 13678 /**
       
 13679 @SYMTestCaseID BA-CTSY-CIPC-MCSWR-0004
       
 13680 @SYMComponent  telephony_ctsy
       
 13681 @SYMTestCaseDesc Test support in CTSY for multiple client requests to RMmCustomAPI::SimWarmReset
       
 13682 @SYMTestPriority High
       
 13683 @SYMTestActions Invokes multiple client requests to RMmCustomAPI::SimWarmReset
       
 13684 @SYMTestExpectedResults Pass
       
 13685 @SYMTestType CT
       
 13686 */
       
 13687 void CCTsyCustomIPCFU::TestSimWarmReset0004L()
       
 13688 	{
       
 13689 
       
 13690 	OpenEtelServerL(EUseExtendedError);
       
 13691 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
 13692 	OpenPhoneL();
       
 13693 
       
 13694 	// Open second client
       
 13695 	RTelServer telServer2;
       
 13696 	TInt ret = telServer2.Connect();
       
 13697 	ASSERT_EQUALS(KErrNone, ret);
       
 13698 	CleanupClosePushL(telServer2);
       
 13699 
       
 13700 	RMobilePhone phone2;
       
 13701 	ret = phone2.Open(telServer2,KMmTsyPhoneName);
       
 13702 	ASSERT_EQUALS(KErrNone, ret);
       
 13703 	CleanupClosePushL(phone2);
       
 13704 
       
 13705 	RMmCustomAPI customAPI;
       
 13706 	OpenCustomAPILC(customAPI, iPhone);
       
 13707 
       
 13708 	RMmCustomAPI customAPI2;
       
 13709 	OpenCustomAPILC(customAPI2, phone2, EFalse);
       
 13710 
       
 13711     TRequestStatus requestStatus;
       
 13712     TRequestStatus requestStatus2;
       
 13713 	
       
 13714 	//-------------------------------------------------------------------------
       
 13715 	// Test A: Test multiple clients requesting RMmCustomAPI::SimWarmResetTR
       
 13716  	//-------------------------------------------------------------------------
       
 13717 
       
 13718     iMockLTSY.ExpectL( ECustomSimWarmResetIPC, KErrNone);
       
 13719 
       
 13720     customAPI.SimWarmReset(requestStatus);
       
 13721     customAPI2.SimWarmReset(requestStatus2);
       
 13722 
       
 13723     iMockLTSY.CompleteL( ECustomSimWarmResetIPC, KErrNone);
       
 13724     
       
 13725 	User::WaitForRequest(requestStatus);	
       
 13726 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
 13727     
       
 13728 	User::WaitForRequest(requestStatus2);	
       
 13729 	ASSERT_EQUALS(KErrServerBusy, requestStatus2.Int());
       
 13730 
       
 13731 	AssertMockLtsyStatusL();
       
 13732 
       
 13733 	CleanupStack::PopAndDestroy(5, this);
       
 13734 
       
 13735 	}
       
 13736 
       
 13737 
       
 13738 /**
       
 13739 @SYMTestCaseID BA-CTSY-CIPC-MCSWR-0005
       
 13740 @SYMComponent  telephony_ctsy
       
 13741 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::SimWarmReset with timeout
       
 13742 @SYMTestPriority High
       
 13743 @SYMTestActions Invokes RMmCustomAPI::SimWarmReset and tests for timeout
       
 13744 @SYMTestExpectedResults Pass
       
 13745 @SYMTestType CT
       
 13746 */
       
 13747 void CCTsyCustomIPCFU::TestSimWarmReset0005L()
       
 13748 	{
       
 13749 
       
 13750 	OpenEtelServerL(EUseExtendedError);
       
 13751 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
 13752 	OpenPhoneL();
       
 13753 
       
 13754 	RMmCustomAPI customAPI;
       
 13755 	OpenCustomAPILC(customAPI, iPhone);
       
 13756 
       
 13757     TRequestStatus requestStatus;
       
 13758 
       
 13759     iMockLTSY.ExpectL( ECustomSimWarmResetIPC);
       
 13760 
       
 13761     customAPI.SimWarmReset(requestStatus);
       
 13762 	
       
 13763 	User::WaitForRequest(requestStatus);	
       
 13764 	ASSERT_EQUALS(KErrTimedOut, requestStatus.Int());
       
 13765 
       
 13766 	AssertMockLtsyStatusL();
       
 13767 
       
 13768 	CleanupStack::PopAndDestroy(2); 
       
 13769 	
       
 13770 	}
       
 13771 
       
 13772 
       
 13773 
       
 13774 
       
 13775 /**
       
 13776 @SYMTestCaseID BA-CTSY-CIPC-MCGATR-0001
       
 13777 @SYMComponent  telephony_ctsy
       
 13778 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::GetATR
       
 13779 @SYMTestPriority High
       
 13780 @SYMTestActions Invokes RMmCustomAPI::GetATR
       
 13781 @SYMTestExpectedResults Pass
       
 13782 @SYMTestType CT
       
 13783 */
       
 13784 void CCTsyCustomIPCFU::TestGetATR0001L()
       
 13785 	{
       
 13786 
       
 13787 	OpenEtelServerL(EUseExtendedError);
       
 13788 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
 13789 	OpenPhoneL();
       
 13790 
       
 13791 	RMmCustomAPI customAPI;
       
 13792 	OpenCustomAPILC(customAPI, iPhone);
       
 13793 
       
 13794     TRequestStatus requestStatus;
       
 13795 	
       
 13796 	RBuf8 expData;
       
 13797 	CleanupClosePushL(expData);
       
 13798 
       
 13799 	TBuf8<32> atr;
       
 13800 	TBuf8<32> expAtr(atr);
       
 13801 	TDesC8* ptr = &expAtr;
       
 13802 
       
 13803 	TMockLtsyData1< TDesC8* > ltsyData(ptr);	    
       
 13804     ltsyData.SerialiseL(expData);       
       
 13805 	
       
 13806  	//-------------------------------------------------------------------------
       
 13807 	// TEST A: failure to dispatch request to LTSY
       
 13808  	//-------------------------------------------------------------------------
       
 13809 
       
 13810     iMockLTSY.ExpectL( ECustomGetATRIPC, expData, KErrNotSupported);
       
 13811     
       
 13812     customAPI.GetATR(requestStatus, atr);
       
 13813 	
       
 13814 	User::WaitForRequest(requestStatus);	
       
 13815 	ASSERT_EQUALS(KErrNotSupported, requestStatus.Int());
       
 13816 
       
 13817 	AssertMockLtsyStatusL();
       
 13818 
       
 13819 	//-------------------------------------------------------------------------
       
 13820 	// TEST B: failure on completion of pending request from LTSY->CTSY
       
 13821  	//-------------------------------------------------------------------------
       
 13822 
       
 13823     iMockLTSY.ExpectL( ECustomGetATRIPC, expData);
       
 13824 
       
 13825 	_LIT8(KAtr, "ATRATRATR");
       
 13826 
       
 13827     iMockLTSY.CompleteL( ECustomGetATRIPC, KErrGeneral, KAtr);
       
 13828 
       
 13829     customAPI.GetATR(requestStatus, atr);
       
 13830 	
       
 13831 	User::WaitForRequest(requestStatus);	
       
 13832 	ASSERT_EQUALS(KErrGeneral, requestStatus.Int());
       
 13833 
       
 13834 	AssertMockLtsyStatusL();
       
 13835 
       
 13836  	//-------------------------------------------------------------------------
       
 13837 	// TEST C: Successful completion request of
       
 13838 	// RMmCustomAPI::GetATR when result is not cached.
       
 13839  	//-------------------------------------------------------------------------
       
 13840 
       
 13841     iMockLTSY.ExpectL( ECustomGetATRIPC, expData);
       
 13842     iMockLTSY.CompleteL( ECustomGetATRIPC, KErrNone, KAtr);
       
 13843 
       
 13844     customAPI.GetATR(requestStatus, atr);
       
 13845 	
       
 13846 	User::WaitForRequest(requestStatus);	
       
 13847 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
 13848 	
       
 13849 	ASSERT_EQUALS(0, atr.Compare(KAtr));
       
 13850 
       
 13851 	AssertMockLtsyStatusL();
       
 13852 
       
 13853  	//-------------------------------------------------------------------------
       
 13854 	// TEST E: Unsolicited completion of RMmCustomAPI::GetATR
       
 13855 	// from LTSY.
       
 13856  	//-------------------------------------------------------------------------
       
 13857 
       
 13858 	TRequestStatus mockLtsyStatus;
       
 13859 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
 13860 
       
 13861     iMockLTSY.CompleteL( ECustomGetATRIPC, KErrNone, KAtr);
       
 13862 
       
 13863 	User::WaitForRequest(mockLtsyStatus);
       
 13864 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
 13865 
       
 13866 	AssertMockLtsyStatusL();
       
 13867 	CleanupStack::PopAndDestroy(3, this); 
       
 13868 	
       
 13869 	}
       
 13870 
       
 13871 
       
 13872 /**
       
 13873 @SYMTestCaseID BA-CTSY-CIPC-MCGATR-0002
       
 13874 @SYMComponent  telephony_ctsy
       
 13875 @SYMTestCaseDesc Test support in CTSY for cancelling of RMmCustomAPI::GetATR
       
 13876 @SYMTestPriority High
       
 13877 @SYMTestActions Invokes cancelling of RMmCustomAPI::GetATR
       
 13878 @SYMTestExpectedResults Pass
       
 13879 @SYMTestType CT
       
 13880 */
       
 13881 void CCTsyCustomIPCFU::TestGetATR0002L()
       
 13882 	{
       
 13883 
       
 13884 	OpenEtelServerL(EUseExtendedError);
       
 13885 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
 13886 	OpenPhoneL();
       
 13887 
       
 13888 	RMmCustomAPI customAPI;
       
 13889 	OpenCustomAPILC(customAPI, iPhone);
       
 13890 
       
 13891 	TRequestStatus mockLtsyStatus;
       
 13892 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
 13893 
       
 13894     TRequestStatus requestStatus;
       
 13895 	
       
 13896 	RBuf8 expData;
       
 13897 	CleanupClosePushL(expData);
       
 13898 
       
 13899 	TBuf8<32> atr;
       
 13900 	TBuf8<32> expAtr(atr);
       
 13901 	TDesC8* ptr = &expAtr;
       
 13902 
       
 13903 	TMockLtsyData1< TDesC8* > ltsyData(ptr);	    
       
 13904     ltsyData.SerialiseL(expData);       
       
 13905 	
       
 13906  	//-------------------------------------------------------------------------
       
 13907 	// Test cancelling of RMmCustomAPI::GetATR
       
 13908  	//-------------------------------------------------------------------------
       
 13909 
       
 13910     iMockLTSY.ExpectL( ECustomGetATRIPC, expData, KErrNone);
       
 13911     
       
 13912 	_LIT8(KAtr, "ATRATRATR");
       
 13913 
       
 13914     iMockLTSY.CompleteL( ECustomGetATRIPC, KErrNone, KAtr, 20);    
       
 13915     
       
 13916     customAPI.GetATR(requestStatus, atr);
       
 13917     
       
 13918     customAPI.CancelAsyncRequest(ECustomGetATRIPC);
       
 13919 	
       
 13920 	User::WaitForRequest(requestStatus);	
       
 13921 	ASSERT_EQUALS(KErrCancel, requestStatus.Int());
       
 13922  	
       
 13923 	User::WaitForRequest(mockLtsyStatus);
       
 13924 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
 13925 
       
 13926 	AssertMockLtsyStatusL();
       
 13927 		
       
 13928 	CleanupStack::PopAndDestroy(3);
       
 13929 	
       
 13930 	}
       
 13931 
       
 13932 
       
 13933 /**
       
 13934 @SYMTestCaseID BA-CTSY-CIPC-MCGATR-0003
       
 13935 @SYMComponent  telephony_ctsy
       
 13936 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::GetATR with bad parameter data
       
 13937 @SYMTestPriority High
       
 13938 @SYMTestActions Invokes RMmCustomAPI::GetATR with bad parameter data
       
 13939 @SYMTestExpectedResults Pass
       
 13940 @SYMTestType CT
       
 13941 */
       
 13942 void CCTsyCustomIPCFU::TestGetATR0003L()
       
 13943 	{
       
 13944 
       
 13945 	OpenEtelServerL(EUseExtendedError);
       
 13946 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
 13947 	OpenPhoneL();
       
 13948 
       
 13949 	RMmCustomAPI customAPI;
       
 13950 	OpenCustomAPILC(customAPI, iPhone);
       
 13951 
       
 13952     TRequestStatus requestStatus;
       
 13953 	
       
 13954 	RBuf8 expData;
       
 13955 	CleanupClosePushL(expData);
       
 13956 
       
 13957 	TBuf8<1> atr;
       
 13958 	TBuf8<1> expAtr(atr);
       
 13959 	TDesC8* ptr = &expAtr;
       
 13960 
       
 13961 	TMockLtsyData1< TDesC8* > ltsyData(ptr);	    
       
 13962     ltsyData.SerialiseL(expData);       
       
 13963 	
       
 13964     iMockLTSY.ExpectL( ECustomGetATRIPC, expData, KErrNone);
       
 13965     
       
 13966 	_LIT8(KAtr, "ATRATRATR");
       
 13967 
       
 13968     iMockLTSY.CompleteL( ECustomGetATRIPC, KErrNone, KAtr);
       
 13969     
       
 13970     customAPI.GetATR(requestStatus, atr);
       
 13971 	
       
 13972 	User::WaitForRequest(requestStatus);	
       
 13973 	ASSERT_EQUALS(KErrOverflow, requestStatus.Int());
       
 13974 
       
 13975 	AssertMockLtsyStatusL();
       
 13976 		
       
 13977 	CleanupStack::PopAndDestroy(3);
       
 13978 	
       
 13979 	}
       
 13980 
       
 13981 
       
 13982 /**
       
 13983 @SYMTestCaseID BA-CTSY-CIPC-MCGATR-0004
       
 13984 @SYMComponent  telephony_ctsy
       
 13985 @SYMTestCaseDesc Test support in CTSY for multiple client requests to RMmCustomAPI::GetATR
       
 13986 @SYMTestPriority High
       
 13987 @SYMTestActions Invokes multiple client requests to RMmCustomAPI::GetATR
       
 13988 @SYMTestExpectedResults Pass
       
 13989 @SYMTestType CT
       
 13990 */
       
 13991 void CCTsyCustomIPCFU::TestGetATR0004L()
       
 13992 	{
       
 13993 
       
 13994 	OpenEtelServerL(EUseExtendedError);
       
 13995 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
 13996 	OpenPhoneL();
       
 13997 
       
 13998 	// Open second client
       
 13999 	RTelServer telServer2;
       
 14000 	TInt ret = telServer2.Connect();
       
 14001 	ASSERT_EQUALS(KErrNone, ret);
       
 14002 	CleanupClosePushL(telServer2);
       
 14003 
       
 14004 	RMobilePhone phone2;
       
 14005 	ret = phone2.Open(telServer2,KMmTsyPhoneName);
       
 14006 	ASSERT_EQUALS(KErrNone, ret);
       
 14007 	CleanupClosePushL(phone2);
       
 14008 
       
 14009 	RMmCustomAPI customAPI;
       
 14010 	OpenCustomAPILC(customAPI, iPhone);
       
 14011 
       
 14012 	RMmCustomAPI customAPI2;
       
 14013 	OpenCustomAPILC(customAPI2, phone2, EFalse);
       
 14014 
       
 14015     TRequestStatus requestStatus;
       
 14016     TRequestStatus requestStatus2;
       
 14017 	
       
 14018 	RBuf8 expData;
       
 14019 	CleanupClosePushL(expData);
       
 14020 
       
 14021 	TBuf8<32> atr;
       
 14022 	TBuf8<32> atr2;
       
 14023 	TBuf8<32> expAtr(atr);
       
 14024 	TDesC8* ptr = &expAtr;
       
 14025 
       
 14026 	TMockLtsyData1< TDesC8* > ltsyData(ptr);	    
       
 14027     ltsyData.SerialiseL(expData);       
       
 14028 	
       
 14029 
       
 14030 	//-------------------------------------------------------------------------
       
 14031 	// Test A: Test multiple clients requesting RMmCustomAPI::GetATR
       
 14032  	//-------------------------------------------------------------------------
       
 14033 
       
 14034     iMockLTSY.ExpectL( ECustomGetATRIPC, expData, KErrNone);
       
 14035 
       
 14036     customAPI.GetATR(requestStatus, atr);
       
 14037     customAPI2.GetATR(requestStatus2, atr2);
       
 14038 
       
 14039 	_LIT8(KAtr, "ATRATRATR");
       
 14040 
       
 14041     iMockLTSY.CompleteL( ECustomGetATRIPC, KErrNone, KAtr);
       
 14042     
       
 14043 	User::WaitForRequest(requestStatus);	
       
 14044 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
 14045     
       
 14046 	User::WaitForRequest(requestStatus2);	
       
 14047 	ASSERT_EQUALS(KErrServerBusy, requestStatus2.Int());
       
 14048 
       
 14049 	AssertMockLtsyStatusL();
       
 14050 
       
 14051 	CleanupStack::PopAndDestroy(6, this);
       
 14052 
       
 14053 	}
       
 14054 
       
 14055 
       
 14056 /**
       
 14057 @SYMTestCaseID BA-CTSY-CIPC-MCGATR-0005
       
 14058 @SYMComponent  telephony_ctsy
       
 14059 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::GetATR with timeout
       
 14060 @SYMTestPriority High
       
 14061 @SYMTestActions Invokes RMmCustomAPI::GetATR and tests for timeout
       
 14062 @SYMTestExpectedResults Pass
       
 14063 @SYMTestType CT
       
 14064 */
       
 14065 void CCTsyCustomIPCFU::TestGetATR0005L()
       
 14066 	{
       
 14067 
       
 14068 	OpenEtelServerL(EUseExtendedError);
       
 14069 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
 14070 	OpenPhoneL();
       
 14071 
       
 14072 	RMmCustomAPI customAPI;
       
 14073 	OpenCustomAPILC(customAPI, iPhone);
       
 14074 
       
 14075     TRequestStatus requestStatus;
       
 14076 	
       
 14077 	RBuf8 expData;
       
 14078 	CleanupClosePushL(expData);
       
 14079 
       
 14080 	TBuf8<32> atr;
       
 14081 	TBuf8<32> expAtr(atr);
       
 14082 	TDesC8* ptr = &expAtr;
       
 14083 
       
 14084 	TMockLtsyData1< TDesC8* > ltsyData(ptr);	    
       
 14085     ltsyData.SerialiseL(expData);       
       
 14086 	
       
 14087     iMockLTSY.ExpectL( ECustomGetATRIPC, expData, KErrNone);
       
 14088     
       
 14089     customAPI.GetATR(requestStatus, atr);
       
 14090 	
       
 14091 	User::WaitForRequest(requestStatus);	
       
 14092 	ASSERT_EQUALS(KErrTimedOut, requestStatus.Int());
       
 14093 
       
 14094 	AssertMockLtsyStatusL();
       
 14095 		
       
 14096 	CleanupStack::PopAndDestroy(3);
       
 14097 	
       
 14098 	}
       
 14099 
       
 14100 
       
 14101 /**
       
 14102 @SYMTestCaseID BA-CTSY-CIPC-MCGSCRS-0001
       
 14103 @SYMComponent  telephony_ctsy
       
 14104 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::GetSimCardReaderStatus
       
 14105 @SYMTestPriority High
       
 14106 @SYMTestActions Invokes RMmCustomAPI::GetSimCardReaderStatus
       
 14107 @SYMTestExpectedResults Pass
       
 14108 @SYMTestType CT
       
 14109 */
       
 14110 void CCTsyCustomIPCFU::TestGetSimCardReaderStatus0001L()
       
 14111 	{
       
 14112 
       
 14113 	OpenEtelServerL(EUseExtendedError);
       
 14114 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
 14115 	OpenPhoneL();
       
 14116 
       
 14117 	RMmCustomAPI customAPI;
       
 14118 	OpenCustomAPILC(customAPI, iPhone);
       
 14119 
       
 14120     TRequestStatus requestStatus;
       
 14121     RMmCustomAPI::TSimCardReaderStatus status;
       
 14122     status.SetStatus(0x33);	//random
       
 14123 
       
 14124 	RBuf8 data;
       
 14125 	CleanupClosePushL(data);
       
 14126 
       
 14127 	RMmCustomAPI::TSimCardReaderStatus expStatus(status);
       
 14128 	RMmCustomAPI::TSimCardReaderStatus* expStatusPtr(&expStatus);
       
 14129 
       
 14130 	TMockLtsyData1< RMmCustomAPI::TSimCardReaderStatus* > ltsyData(expStatusPtr);	    
       
 14131     ltsyData.SerialiseL(data);       
       
 14132 	
       
 14133 	RMmCustomAPI::TSimCardReaderStatus compStatus;
       
 14134 	compStatus.SetStatus(0xFF);	// random
       
 14135 	TPckg<RMmCustomAPI::TSimCardReaderStatus> compStatusPckg(compStatus);
       
 14136 
       
 14137  	//-------------------------------------------------------------------------
       
 14138 	// TEST C: Successful completion request of
       
 14139 	// RMmCustomAPI::GetSimCardReaderStatus when result is not cached.
       
 14140  	//-------------------------------------------------------------------------
       
 14141 
       
 14142     iMockLTSY.ExpectL(ECustomGetSimCardReaderStatusIPC, data);
       
 14143     iMockLTSY.CompleteL(ECustomGetSimCardReaderStatusIPC, KErrNone, compStatusPckg);
       
 14144 	
       
 14145 	customAPI.GetSimCardReaderStatus(requestStatus, status);
       
 14146 	
       
 14147 	User::WaitForRequest(requestStatus);
       
 14148 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
 14149 
       
 14150 	ASSERT_TRUE(compStatus.GetStatus() == status.GetStatus());
       
 14151 
       
 14152 	AssertMockLtsyStatusL();
       
 14153 
       
 14154  	//-------------------------------------------------------------------------
       
 14155 	// TEST C2: RMmCustomAPI::GetSimCardReaderStatus completion with zero data
       
 14156  	//-------------------------------------------------------------------------
       
 14157 
       
 14158     status.SetStatus(0x33);	
       
 14159 
       
 14160     iMockLTSY.ExpectL(ECustomGetSimCardReaderStatusIPC, data);
       
 14161     iMockLTSY.CompleteL(ECustomGetSimCardReaderStatusIPC, KErrNone, KNullDesC8);
       
 14162 	
       
 14163 	customAPI.GetSimCardReaderStatus(requestStatus, status);
       
 14164 	
       
 14165 	User::WaitForRequest(requestStatus);
       
 14166 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
 14167 
       
 14168 	ASSERT_TRUE(0 == status.GetStatus());
       
 14169 
       
 14170 	AssertMockLtsyStatusL();
       
 14171 	
       
 14172 
       
 14173  	//-------------------------------------------------------------------------
       
 14174 	// TEST A: failure to dispatch request to LTSY
       
 14175  	//-------------------------------------------------------------------------
       
 14176 
       
 14177     expStatus = status;
       
 14178     data.Close();
       
 14179     ltsyData.SerialiseL(data);       
       
 14180 
       
 14181     iMockLTSY.ExpectL(ECustomGetSimCardReaderStatusIPC, data, KErrNotSupported);
       
 14182 
       
 14183 	customAPI.GetSimCardReaderStatus(requestStatus, status);
       
 14184 	
       
 14185 	User::WaitForRequest(requestStatus);
       
 14186 	ASSERT_EQUALS(KErrNotSupported, requestStatus.Int());
       
 14187 
       
 14188 	AssertMockLtsyStatusL();
       
 14189 
       
 14190 	//-------------------------------------------------------------------------
       
 14191 	// TEST B: failure on completion of pending request from LTSY->CTSY
       
 14192  	//-------------------------------------------------------------------------
       
 14193 
       
 14194     expStatus = status;
       
 14195     data.Close();
       
 14196     ltsyData.SerialiseL(data);       
       
 14197     
       
 14198     iMockLTSY.ExpectL(ECustomGetSimCardReaderStatusIPC, data);
       
 14199 	
       
 14200     iMockLTSY.CompleteL(ECustomGetSimCardReaderStatusIPC, KErrGeneral, compStatusPckg);
       
 14201 	
       
 14202 	customAPI.GetSimCardReaderStatus(requestStatus, status);
       
 14203 	
       
 14204 	User::WaitForRequest(requestStatus);
       
 14205 	ASSERT_EQUALS(KErrGeneral, requestStatus.Int());
       
 14206 
       
 14207 	AssertMockLtsyStatusL();
       
 14208 
       
 14209  	//-------------------------------------------------------------------------
       
 14210 	// TEST E: Unsolicited completion of RMmCustomAPI::GetSimCardReaderStatus
       
 14211 	// from LTSY.
       
 14212  	//-------------------------------------------------------------------------
       
 14213 
       
 14214 	TRequestStatus mockLtsyStatus;
       
 14215 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
 14216 
       
 14217     iMockLTSY.CompleteL(ECustomGetSimCardReaderStatusIPC, KErrNone, compStatusPckg);
       
 14218 
       
 14219 	User::WaitForRequest(mockLtsyStatus);
       
 14220 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
 14221 
       
 14222     status.SetStatus(0x33);	//random
       
 14223     expStatus = status;
       
 14224     data.Close();
       
 14225     ltsyData.SerialiseL(data);       
       
 14226     
       
 14227     iMockLTSY.ExpectL(ECustomGetSimCardReaderStatusIPC, data);
       
 14228 	
       
 14229     iMockLTSY.CompleteL(ECustomGetSimCardReaderStatusIPC, KErrGeneral, compStatusPckg);
       
 14230 	
       
 14231 	customAPI.GetSimCardReaderStatus(requestStatus, status);
       
 14232 	
       
 14233 	User::WaitForRequest(requestStatus);
       
 14234 	ASSERT_EQUALS(KErrGeneral, requestStatus.Int());
       
 14235 
       
 14236 	ASSERT_TRUE(expStatus.GetStatus() == status.GetStatus());
       
 14237 
       
 14238 	AssertMockLtsyStatusL();
       
 14239 	CleanupStack::PopAndDestroy(3, this); 
       
 14240 	}
       
 14241 
       
 14242 
       
 14243 /**
       
 14244 @SYMTestCaseID BA-CTSY-CIPC-MCGSCRS-0002
       
 14245 @SYMComponent  telephony_ctsy
       
 14246 @SYMTestCaseDesc Test support in CTSY for cancelling of RMmCustomAPI::GetSimCardReaderStatus
       
 14247 @SYMTestPriority High
       
 14248 @SYMTestActions Invokes cancelling of RMmCustomAPI::GetSimCardReaderStatus
       
 14249 @SYMTestExpectedResults Pass
       
 14250 @SYMTestType CT
       
 14251 */
       
 14252 void CCTsyCustomIPCFU::TestGetSimCardReaderStatus0002L()
       
 14253 	{
       
 14254 
       
 14255 	OpenEtelServerL(EUseExtendedError);
       
 14256 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
 14257 	OpenPhoneL();
       
 14258 
       
 14259 	RMmCustomAPI customAPI;
       
 14260 	OpenCustomAPILC(customAPI, iPhone);
       
 14261 
       
 14262     TRequestStatus requestStatus;
       
 14263     RMmCustomAPI::TSimCardReaderStatus status;
       
 14264 
       
 14265 	TRequestStatus mockLtsyStatus;
       
 14266 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
 14267 
       
 14268 	RBuf8 data;
       
 14269 	CleanupClosePushL(data);
       
 14270 
       
 14271  	//-------------------------------------------------------------------------
       
 14272 	// Test cancelling of RMmCustomAPI::GetSimCardReaderStatus
       
 14273  	//-------------------------------------------------------------------------
       
 14274  	
       
 14275 	RMmCustomAPI::TSimCardReaderStatus expStatus(status);
       
 14276 	RMmCustomAPI::TSimCardReaderStatus* expStatusPtr(&expStatus);
       
 14277 
       
 14278 	TMockLtsyData1< RMmCustomAPI::TSimCardReaderStatus* > ltsyData(expStatusPtr);	    
       
 14279     ltsyData.SerialiseL(data);       
       
 14280 	
       
 14281     iMockLTSY.ExpectL(ECustomGetSimCardReaderStatusIPC, data);
       
 14282 
       
 14283 	RMmCustomAPI::TSimCardReaderStatus compStatus;
       
 14284 	compStatus.SetStatus(0xFF);
       
 14285 	TPckg<RMmCustomAPI::TSimCardReaderStatus> compStatusPckg(compStatus);
       
 14286 	
       
 14287     iMockLTSY.CompleteL(ECustomGetSimCardReaderStatusIPC, KErrNone, compStatusPckg, 20);
       
 14288 	
       
 14289 	customAPI.GetSimCardReaderStatus(requestStatus, status);
       
 14290 	
       
 14291 	customAPI.CancelAsyncRequest(ECustomGetSimCardReaderStatusIPC);
       
 14292 
       
 14293 	User::WaitForRequest(requestStatus);
       
 14294 	ASSERT_EQUALS(KErrCancel, requestStatus.Int());
       
 14295 
       
 14296 	User::WaitForRequest(mockLtsyStatus);
       
 14297 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
 14298 
       
 14299 	AssertMockLtsyStatusL();
       
 14300 	
       
 14301 	CleanupStack::PopAndDestroy(3); 
       
 14302 	}
       
 14303 
       
 14304 
       
 14305 
       
 14306 /**
       
 14307 @SYMTestCaseID BA-CTSY-CIPC-MCGSCRS-0004
       
 14308 @SYMComponent  telephony_ctsy
       
 14309 @SYMTestCaseDesc Test support in CTSY for multiple client requests to RMmCustomAPI::GetSimCardReaderStatus
       
 14310 @SYMTestPriority High
       
 14311 @SYMTestActions Invokes multiple client requests to RMmCustomAPI::GetSimCardReaderStatus
       
 14312 @SYMTestExpectedResults Pass
       
 14313 @SYMTestType CT
       
 14314 */
       
 14315 void CCTsyCustomIPCFU::TestGetSimCardReaderStatus0004L()
       
 14316 	{
       
 14317 					
       
 14318 	OpenEtelServerL(EUseExtendedError);
       
 14319 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
 14320 	OpenPhoneL();
       
 14321 
       
 14322 	RBuf8 data;
       
 14323 	CleanupClosePushL(data);
       
 14324 
       
 14325 	// Open second client
       
 14326 	RTelServer telServer2;
       
 14327 	TInt ret = telServer2.Connect();
       
 14328 	ASSERT_EQUALS(KErrNone, ret);
       
 14329 	CleanupClosePushL(telServer2);
       
 14330 
       
 14331 	RMobilePhone phone2;
       
 14332 	ret = phone2.Open(telServer2,KMmTsyPhoneName);
       
 14333 	ASSERT_EQUALS(KErrNone, ret);
       
 14334 	CleanupClosePushL(phone2);
       
 14335 
       
 14336 	RMmCustomAPI customAPI;
       
 14337 	OpenCustomAPILC(customAPI, iPhone);
       
 14338 
       
 14339 	RMmCustomAPI customAPI2;
       
 14340 	OpenCustomAPILC(customAPI2, phone2, EFalse);
       
 14341 
       
 14342 	//-------------------------------------------------------------------------
       
 14343 	// Test A: Test multiple clients requesting RMmCustomAPI::GetSimCardReaderStatus
       
 14344  	//-------------------------------------------------------------------------
       
 14345 
       
 14346     TRequestStatus requestStatus;
       
 14347     RMmCustomAPI::TSimCardReaderStatus status;
       
 14348 
       
 14349     TRequestStatus requestStatus2;
       
 14350     RMmCustomAPI::TSimCardReaderStatus status2;
       
 14351 
       
 14352 	RMmCustomAPI::TSimCardReaderStatus expStatus(status);
       
 14353 	RMmCustomAPI::TSimCardReaderStatus* expStatusPtr(&expStatus);
       
 14354 
       
 14355 	TMockLtsyData1< RMmCustomAPI::TSimCardReaderStatus* > ltsyData(expStatusPtr);	    
       
 14356     ltsyData.SerialiseL(data);       
       
 14357 	
       
 14358     iMockLTSY.ExpectL(ECustomGetSimCardReaderStatusIPC, data);
       
 14359 
       
 14360 	customAPI.GetSimCardReaderStatus(requestStatus, status);
       
 14361 	customAPI2.GetSimCardReaderStatus(requestStatus2, status2);
       
 14362 
       
 14363 	RMmCustomAPI::TSimCardReaderStatus compStatus;
       
 14364 	compStatus.SetStatus(0xFF);
       
 14365 	TPckg<RMmCustomAPI::TSimCardReaderStatus> compStatusPckg(compStatus);
       
 14366 	
       
 14367     iMockLTSY.CompleteL(ECustomGetSimCardReaderStatusIPC, KErrNone, compStatusPckg, 20);
       
 14368 
       
 14369 	User::WaitForRequest(requestStatus);
       
 14370 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
 14371 
       
 14372 	User::WaitForRequest(requestStatus2);
       
 14373 	ASSERT_EQUALS(KErrServerBusy, requestStatus2.Int());
       
 14374 
       
 14375 	CleanupStack::PopAndDestroy(6, this);
       
 14376 
       
 14377 	}
       
 14378 
       
 14379 
       
 14380 /**
       
 14381 @SYMTestCaseID BA-CTSY-CIPC-MCGSCRS-0005
       
 14382 @SYMComponent  telephony_ctsy
       
 14383 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::GetSimCardReaderStatus with timeout
       
 14384 @SYMTestPriority High
       
 14385 @SYMTestActions Invokes RMmCustomAPI::GetSimCardReaderStatus and tests for timeout
       
 14386 @SYMTestExpectedResults Pass
       
 14387 @SYMTestType CT
       
 14388 */
       
 14389 void CCTsyCustomIPCFU::TestGetSimCardReaderStatus0005L()
       
 14390 	{
       
 14391 	
       
 14392 	OpenEtelServerL(EUseExtendedError);
       
 14393 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
 14394 	OpenPhoneL();
       
 14395 
       
 14396 	RMmCustomAPI customAPI;
       
 14397 	OpenCustomAPILC(customAPI, iPhone);
       
 14398 
       
 14399     TRequestStatus requestStatus;
       
 14400     RMmCustomAPI::TSimCardReaderStatus status;
       
 14401 
       
 14402 	RBuf8 data;
       
 14403 	CleanupClosePushL(data);
       
 14404 
       
 14405 	RMmCustomAPI::TSimCardReaderStatus expStatus(status);
       
 14406 	RMmCustomAPI::TSimCardReaderStatus* expStatusPtr(&expStatus);
       
 14407 
       
 14408 	TMockLtsyData1< RMmCustomAPI::TSimCardReaderStatus* > ltsyData(expStatusPtr);	    
       
 14409     ltsyData.SerialiseL(data);       
       
 14410 	
       
 14411     iMockLTSY.ExpectL(ECustomGetSimCardReaderStatusIPC, data);
       
 14412 
       
 14413 	customAPI.GetSimCardReaderStatus(requestStatus, status);
       
 14414 	
       
 14415 	User::WaitForRequest(requestStatus);
       
 14416 	ASSERT_EQUALS(KErrTimedOut, requestStatus.Int());
       
 14417 
       
 14418 	AssertMockLtsyStatusL();
       
 14419 	
       
 14420 	CleanupStack::PopAndDestroy(3); 
       
 14421 	
       
 14422 	}
       
 14423 
       
 14424 
       
 14425 /**
       
 14426 @SYMTestCaseID BA-CTSY-CIPC-MCNSCS-0001
       
 14427 @SYMComponent  telephony_ctsy
       
 14428 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::NotifySimCardStatus
       
 14429 @SYMTestPriority High
       
 14430 @SYMTestActions Invokes RMmCustomAPI::NotifySimCardStatus
       
 14431 @SYMTestExpectedResults Pass
       
 14432 @SYMTestType CT
       
 14433 */
       
 14434 void CCTsyCustomIPCFU::TestNotifySimCardStatus0001L()
       
 14435 	{
       
 14436 
       
 14437 	OpenEtelServerL(EUseExtendedError);
       
 14438 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
 14439 	OpenPhoneL();
       
 14440 
       
 14441 	RMmCustomAPI customAPI;
       
 14442 	OpenCustomAPILC(customAPI, iPhone);
       
 14443 
       
 14444     TRequestStatus requestStatus;
       
 14445     RMmCustomAPI::TSIMCardStatus cardStatus;
       
 14446 	
       
 14447  	//-------------------------------------------------------------------------
       
 14448 	// TEST C: Successful completion request of
       
 14449 	// RMmCustomAPI::NotifySimCardStatus when result is not cached.
       
 14450  	//-------------------------------------------------------------------------
       
 14451  	RMmCustomAPI::TSIMCardStatus compStatus(RMmCustomAPI::SimCardRemoved);
       
 14452 	TPckg<RMmCustomAPI::TSIMCardStatus> compStatusPckg(compStatus);	
       
 14453 
       
 14454     iMockLTSY.CompleteL(ECustomNotifySimCardStatusIPC, KErrNone, compStatusPckg);
       
 14455 
       
 14456 	customAPI.NotifySimCardStatus(requestStatus, cardStatus);
       
 14457 	
       
 14458 	User::WaitForRequest(requestStatus);	
       
 14459 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
 14460 	ASSERT_EQUALS(compStatus, cardStatus);
       
 14461 
       
 14462 	AssertMockLtsyStatusL();
       
 14463 
       
 14464  	//-------------------------------------------------------------------------
       
 14465 	// TEST E: Unsolicited completion of RMmCustomAPI::NotifySimCardStatus
       
 14466 	// from LTSY.
       
 14467  	//-------------------------------------------------------------------------
       
 14468 
       
 14469 	TRequestStatus mockLtsyStatus;
       
 14470 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
 14471 
       
 14472     iMockLTSY.CompleteL(ECustomNotifySimCardStatusIPC, KErrNone, compStatusPckg);
       
 14473 
       
 14474 	User::WaitForRequest(mockLtsyStatus);
       
 14475 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
 14476 
       
 14477 	AssertMockLtsyStatusL();
       
 14478 	CleanupStack::PopAndDestroy(2, this); 
       
 14479 	
       
 14480 	}
       
 14481 
       
 14482 
       
 14483 /**
       
 14484 @SYMTestCaseID BA-CTSY-CIPC-MCNSCS-0002
       
 14485 @SYMComponent  telephony_ctsy
       
 14486 @SYMTestCaseDesc Test support in CTSY for cancelling of RMmCustomAPI::NotifySimCardStatus
       
 14487 @SYMTestPriority High
       
 14488 @SYMTestActions Invokes cancelling of RMmCustomAPI::NotifySimCardStatus
       
 14489 @SYMTestExpectedResults Pass
       
 14490 @SYMTestType CT
       
 14491 */
       
 14492 void CCTsyCustomIPCFU::TestNotifySimCardStatus0002L()
       
 14493 	{
       
 14494 
       
 14495 	OpenEtelServerL(EUseExtendedError);
       
 14496 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
 14497 	OpenPhoneL();
       
 14498 
       
 14499 	RMmCustomAPI customAPI;
       
 14500 	OpenCustomAPILC(customAPI, iPhone);
       
 14501 
       
 14502     TRequestStatus requestStatus;
       
 14503     RMmCustomAPI::TSIMCardStatus cardStatus;
       
 14504 	
       
 14505 	TRequestStatus mockLtsyStatus;
       
 14506 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
 14507 
       
 14508  	//-------------------------------------------------------------------------
       
 14509 	// Test cancelling of RMmCustomAPI::NotifySimCardStatus
       
 14510  	//-------------------------------------------------------------------------
       
 14511 
       
 14512 	customAPI.NotifySimCardStatus(requestStatus, cardStatus);
       
 14513 
       
 14514  	RMmCustomAPI::TSIMCardStatus compStatus(RMmCustomAPI::SimCardRemoved);
       
 14515 	TPckg<RMmCustomAPI::TSIMCardStatus> compStatusPckg(compStatus);	
       
 14516     iMockLTSY.CompleteL(ECustomNotifySimCardStatusIPC, KErrNone, compStatusPckg, 20);
       
 14517 		
       
 14518 	customAPI.CancelAsyncRequest(ECustomNotifySimCardStatusIPC);
       
 14519 
       
 14520 	User::WaitForRequest(requestStatus);	
       
 14521 	ASSERT_EQUALS(KErrCancel, requestStatus.Int());
       
 14522 
       
 14523 	User::WaitForRequest(mockLtsyStatus);
       
 14524 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
 14525 
       
 14526 	CleanupStack::PopAndDestroy(2); 
       
 14527 	
       
 14528 	}
       
 14529 
       
 14530 /**
       
 14531 @SYMTestCaseID BA-CTSY-CIPC-MCNSCS-0004
       
 14532 @SYMComponent  telephony_ctsy
       
 14533 @SYMTestCaseDesc Test support in CTSY for multiple client requests to RMmCustomAPI::NotifySimCardStatus
       
 14534 @SYMTestPriority High
       
 14535 @SYMTestActions Invokes multiple client requests to RMmCustomAPI::NotifySimCardStatus
       
 14536 @SYMTestExpectedResults Pass
       
 14537 @SYMTestType CT
       
 14538 */
       
 14539 void CCTsyCustomIPCFU::TestNotifySimCardStatus0004L()
       
 14540 	{
       
 14541 					
       
 14542 	OpenEtelServerL(EUseExtendedError);
       
 14543 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
 14544 	OpenPhoneL();
       
 14545 
       
 14546 	RTelServer telServer2;
       
 14547 	TInt ret = telServer2.Connect();
       
 14548 	ASSERT_EQUALS(KErrNone, ret);
       
 14549 	CleanupClosePushL(telServer2);
       
 14550 
       
 14551 	RMobilePhone phone2;
       
 14552 	ret = phone2.Open(telServer2,KMmTsyPhoneName);
       
 14553 	ASSERT_EQUALS(KErrNone, ret);
       
 14554 	CleanupClosePushL(phone2);
       
 14555 
       
 14556 
       
 14557 	RMmCustomAPI customAPI;
       
 14558 	OpenCustomAPILC(customAPI, iPhone);
       
 14559 
       
 14560 	RMmCustomAPI customAPI2;
       
 14561 	OpenCustomAPILC(customAPI2, phone2, EFalse);
       
 14562 
       
 14563 	TRequestStatus requestStatus;
       
 14564 	TRequestStatus requestStatus2;
       
 14565 
       
 14566     RMmCustomAPI::TSIMCardStatus cardStatus;
       
 14567     RMmCustomAPI::TSIMCardStatus cardStatus2;
       
 14568 
       
 14569 	//-------------------------------------------------------------------------
       
 14570 	// Test A: Test multiple clients requesting RMmCustomAPI::NotifySimCardStatus
       
 14571  	//-------------------------------------------------------------------------
       
 14572 
       
 14573  	RMmCustomAPI::TSIMCardStatus compStatus(RMmCustomAPI::SimCardRemoved);
       
 14574 	TPckg<RMmCustomAPI::TSIMCardStatus> compStatusPckg(compStatus);	
       
 14575     iMockLTSY.CompleteL(ECustomNotifySimCardStatusIPC, KErrNone, compStatusPckg, 20);
       
 14576 
       
 14577 	customAPI.NotifySimCardStatus(requestStatus, cardStatus);
       
 14578     customAPI2.NotifySimCardStatus(requestStatus2, cardStatus2);
       
 14579 
       
 14580 
       
 14581 	User::WaitForRequest(requestStatus);	
       
 14582 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
 14583 	ASSERT_EQUALS(compStatus, cardStatus);
       
 14584 
       
 14585 	User::WaitForRequest(requestStatus2);	
       
 14586 	ASSERT_EQUALS(KErrNone, requestStatus2.Int());
       
 14587 	ASSERT_EQUALS(compStatus, cardStatus2);
       
 14588 
       
 14589 	AssertMockLtsyStatusL();
       
 14590 	
       
 14591     //-------------------------------------------------------------------------
       
 14592     // Test B: Test multiple clients requesting RMmCustomAPI::NotifySimCardStatus returning SimCardInserted
       
 14593     //-------------------------------------------------------------------------
       
 14594     
       
 14595     RMmCustomAPI::TSIMCardStatus compStatusB(RMmCustomAPI::SimCardInserted);
       
 14596     TPckg<RMmCustomAPI::TSIMCardStatus> compStatusPckgB(compStatusB); 
       
 14597     iMockLTSY.CompleteL(ECustomNotifySimCardStatusIPC, KErrNone, compStatusPckgB, 20);
       
 14598     
       
 14599     cardStatus  = RMmCustomAPI::SimCardUnknowError;
       
 14600     cardStatus2 = RMmCustomAPI::SimCardUnknowError;
       
 14601     customAPI.NotifySimCardStatus(requestStatus, cardStatus);
       
 14602     customAPI2.NotifySimCardStatus(requestStatus2, cardStatus2);
       
 14603    
       
 14604     
       
 14605     User::WaitForRequest(requestStatus);    
       
 14606     ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
 14607     ASSERT_EQUALS(compStatusB, cardStatus);
       
 14608     
       
 14609     User::WaitForRequest(requestStatus2);   
       
 14610     ASSERT_EQUALS(KErrNone, requestStatus2.Int());
       
 14611     ASSERT_EQUALS(compStatusB, cardStatus2);
       
 14612     
       
 14613     AssertMockLtsyStatusL();
       
 14614 	   
       
 14615 	CleanupStack::PopAndDestroy(5, this);
       
 14616 
       
 14617 	}
       
 14618 
       
 14619 
       
 14620 /**
       
 14621 @SYMTestCaseID BA-CTSY-CIPC-MCGWSAD-0001
       
 14622 @SYMComponent  telephony_ctsy
       
 14623 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::GetWlanSimAuthenticationData
       
 14624 @SYMTestPriority High
       
 14625 @SYMTestActions Invokes RMmCustomAPI::GetWlanSimAuthenticationData
       
 14626 @SYMTestExpectedResults Pass
       
 14627 @SYMTestType CT
       
 14628 */
       
 14629 void CCTsyCustomIPCFU::TestGetWlanSimAuthenticationData0001L()
       
 14630 	{
       
 14631 
       
 14632 	OpenEtelServerL(EUseExtendedError);
       
 14633 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
 14634 	OpenPhoneL();
       
 14635 
       
 14636 	RMmCustomAPI customAPI;
       
 14637 	OpenCustomAPILC(customAPI, iPhone);
       
 14638 
       
 14639 	TRequestStatus requestStatus;	
       
 14640 	
       
 14641 	// --- data for CompleteL ---
       
 14642 	RMmCustomAPI::TSimAuthenticationEapSim compSim;
       
 14643 	// get random value
       
 14644     FillRandom(compSim.iSRES);
       
 14645     FillRandom(compSim.iKC);
       
 14646 	TPckg<RMmCustomAPI::TSimAuthenticationEapSim> compSimPckg(compSim);	
       
 14647  
       
 14648 	
       
 14649  	//-------------------------------------------------------------------------
       
 14650 	// TEST A: failure to dispatch request to LTSY
       
 14651  	//-------------------------------------------------------------------------
       
 14652 	RMmCustomAPI::TSimAuthenticationEapSim sim;
       
 14653 	TPckg<RMmCustomAPI::TSimAuthenticationEapSim> simPckg(sim);
       
 14654 	
       
 14655 	// get random value
       
 14656     FillRandom(sim.iRandomParameters);
       
 14657 	
       
 14658     iMockLTSY.ExpectL(ECustomGetSimAuthenticationDataIPC, simPckg, KErrNotSupported);
       
 14659 
       
 14660 	customAPI.GetWlanSimAuthenticationData(requestStatus, simPckg);
       
 14661 	
       
 14662 	User::WaitForRequest(requestStatus);
       
 14663 	ASSERT_EQUALS(KErrNotSupported, requestStatus.Int());
       
 14664 
       
 14665 	AssertMockLtsyStatusL();
       
 14666 	
       
 14667 	//-------------------------------------------------------------------------
       
 14668 	// TEST B: failure on completion of pending request from LTSY->CTSY
       
 14669  	//-------------------------------------------------------------------------
       
 14670     FillRandom(sim.iRandomParameters);
       
 14671 	
       
 14672     iMockLTSY.ExpectL(ECustomGetSimAuthenticationDataIPC, simPckg);
       
 14673     iMockLTSY.CompleteL(ECustomGetSimAuthenticationDataIPC, KErrGeneral, compSimPckg);
       
 14674 
       
 14675 	customAPI.GetWlanSimAuthenticationData(requestStatus, simPckg);
       
 14676 	
       
 14677 	User::WaitForRequest(requestStatus);
       
 14678 	ASSERT_EQUALS(KErrGeneral, requestStatus.Int());
       
 14679 
       
 14680 	AssertMockLtsyStatusL();
       
 14681 
       
 14682  	//-------------------------------------------------------------------------
       
 14683 	// TEST C: Successful completion request of
       
 14684 	// RMmCustomAPI::GetWlanSimAuthenticationData when result is not cached.
       
 14685  	//-------------------------------------------------------------------------
       
 14686     FillRandom(sim.iRandomParameters);
       
 14687 	
       
 14688     iMockLTSY.ExpectL(ECustomGetSimAuthenticationDataIPC, simPckg);
       
 14689     iMockLTSY.CompleteL(ECustomGetSimAuthenticationDataIPC, KErrNone, compSimPckg);
       
 14690 
       
 14691 	customAPI.GetWlanSimAuthenticationData(requestStatus, simPckg);
       
 14692 	
       
 14693 	User::WaitForRequest(requestStatus);
       
 14694 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
 14695 	ASSERT_EQUALS(compSim.iSRES,sim.iSRES);
       
 14696 	ASSERT_EQUALS(compSim.iKC, sim.iKC);
       
 14697 
       
 14698 	AssertMockLtsyStatusL();	
       
 14699 	
       
 14700 	//-------------------------------------------------------------------------
       
 14701 	// TEST E: Unsolicited completion of RMmCustomAPI::GetWlanSimAuthenticationData
       
 14702 	// from LTSY.
       
 14703  	//-------------------------------------------------------------------------
       
 14704 	TRequestStatus mockLtsyStatus;
       
 14705 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
 14706 
       
 14707     iMockLTSY.CompleteL(ECustomGetSimAuthenticationDataIPC, KErrNone, compSimPckg);
       
 14708 
       
 14709 	User::WaitForRequest(mockLtsyStatus);
       
 14710 	
       
 14711 	AssertMockLtsyStatusL();	
       
 14712 	//-------------------------------------------------------------------------
       
 14713 	// Test 1 for coverage increasing	
       
 14714 	//-------------------------------------------------------------------------
       
 14715 	RMmCustomAPI::TSimAuthenticationEapAka simAka;
       
 14716 	TPckg<RMmCustomAPI::TSimAuthenticationEapAka> simAkaPckg(simAka);
       
 14717 	
       
 14718 	// get random value
       
 14719     FillRandom(simAka.iRandomParameters);
       
 14720 	
       
 14721 	// --- data for CompleteL ---
       
 14722 	RMmCustomAPI::TSimAuthenticationEapAka compSimAka;
       
 14723 	// get random value
       
 14724     FillRandom(compSimAka.iCK);
       
 14725     FillRandom(compSimAka.iIK); 
       
 14726     FillRandom(compSimAka.iAUTS);   
       
 14727 	TPckg<RMmCustomAPI::TSimAuthenticationEapAka> compSimAkaPckg(compSimAka);	
       
 14728 	
       
 14729     iMockLTSY.ExpectL(ECustomGetSimAuthenticationDataIPC, simAkaPckg);
       
 14730     iMockLTSY.CompleteL(ECustomGetSimAuthenticationDataIPC, KErrNone, compSimAkaPckg);
       
 14731 
       
 14732 	customAPI.GetWlanSimAuthenticationData(requestStatus, simAkaPckg);
       
 14733 	
       
 14734 	User::WaitForRequest(requestStatus);
       
 14735 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
 14736 	ASSERT_EQUALS(compSimAka.iCK,simAka.iCK);
       
 14737 	ASSERT_EQUALS(compSimAka.iIK, simAka.iIK);
       
 14738 	ASSERT_EQUALS(compSimAka.iRES, simAka.iRES);	
       
 14739 	AssertMockLtsyStatusL();	
       
 14740 	
       
 14741 	
       
 14742 	//-------------------------------------------------------------------------
       
 14743 	// Test 2 for coverage increasing
       
 14744 	// completion of RMmCustomAPI::GetWlanSimAuthenticationData
       
 14745 	// from LTSY with error and RMmCustomAPI::TSimAuthenticationEapAka as data
       
 14746 	//-------------------------------------------------------------------------		
       
 14747     FillRandom(simAka.iRandomParameters);
       
 14748 	
       
 14749 	iMockLTSY.ExpectL(ECustomGetSimAuthenticationDataIPC, simAkaPckg);
       
 14750     iMockLTSY.CompleteL(ECustomGetSimAuthenticationDataIPC, KErrGeneral, compSimAkaPckg);
       
 14751 
       
 14752 	customAPI.GetWlanSimAuthenticationData(requestStatus, simAkaPckg);
       
 14753 	User::WaitForRequest(requestStatus);
       
 14754 	
       
 14755 	ASSERT_EQUALS(KErrGeneral, requestStatus.Int());	
       
 14756 	ASSERT_EQUALS(compSimAka.iAUTS, simAka.iAUTS);	
       
 14757  	AssertMockLtsyStatusL();
       
 14758  	 	
       
 14759  	//-------------------------------------------------------------------------
       
 14760 	// Test 3 for coverage increasing
       
 14761 	// Unsolicited completion of RMmCustomAPI::GetWlanSimAuthenticationData
       
 14762 	// from LTSY with error
       
 14763 	//-------------------------------------------------------------------------
       
 14764 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
 14765     iMockLTSY.CompleteL(ECustomGetSimAuthenticationDataIPC, KErrGeneral, compSimPckg);
       
 14766 	User::WaitForRequest(mockLtsyStatus);
       
 14767 	
       
 14768 	AssertMockLtsyStatusL();
       
 14769 
       
 14770 
       
 14771  	//-------------------------------------------------------------------------
       
 14772 	// Test using RMmCustomAPI::TSimAuthenticationGbaBootstrap
       
 14773 	//-------------------------------------------------------------------------
       
 14774  
       
 14775 	// Data for argument
       
 14776 	RMmCustomAPI::TSimAuthenticationGbaBootstrap bootstrap;
       
 14777 	TPckg<RMmCustomAPI::TSimAuthenticationGbaBootstrap> bootstrapPckg(bootstrap);
       
 14778 		
       
 14779 	// get random values and populate the packages
       
 14780     FillRandom(bootstrap.iRandomParameters);
       
 14781     FillRandom(bootstrap.iAUTN);
       
 14782 	
       
 14783 	// Return parameters
       
 14784 	bootstrap.iRES.Fill(0, RMmCustomAPI::KMaxParametersLength);	
       
 14785 	bootstrap.iAUTS.Fill(0, RMmCustomAPI::KMaxParametersLength);
       
 14786 	
       
 14787 	// --- data for CompleteL ---
       
 14788 	RMmCustomAPI::TSimAuthenticationGbaBootstrap compBootstrap;
       
 14789 	
       
 14790 	compBootstrap.iRandomParameters = bootstrap.iRandomParameters;
       
 14791 	compBootstrap.iAUTN = bootstrap.iAUTN;
       
 14792 
       
 14793     FillRandom(compBootstrap.iRES);
       
 14794     FillRandom(compBootstrap.iAUTS);
       
 14795 	
       
 14796 	TPckg<RMmCustomAPI::TSimAuthenticationGbaBootstrap> compBootstrapPckg(compBootstrap);	
       
 14797 		
       
 14798     iMockLTSY.ExpectL(ECustomGetSimAuthenticationDataIPC, bootstrapPckg);
       
 14799     iMockLTSY.CompleteL(ECustomGetSimAuthenticationDataIPC, KErrNone, compBootstrapPckg);
       
 14800 
       
 14801 	customAPI.GetWlanSimAuthenticationData(requestStatus, bootstrapPckg);
       
 14802 	
       
 14803 	User::WaitForRequest(requestStatus);
       
 14804 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
 14805 	ASSERT_EQUALS(compBootstrap.iRandomParameters, bootstrap.iRandomParameters);
       
 14806 	ASSERT_EQUALS(compBootstrap.iAUTN, bootstrap.iAUTN);	
       
 14807 	ASSERT_EQUALS(compBootstrap.iAUTS, bootstrap.iAUTS);
       
 14808 	ASSERT_EQUALS(compBootstrap.iRES, bootstrap.iRES);	
       
 14809 	
       
 14810 	AssertMockLtsyStatusL();	
       
 14811 
       
 14812 	// completion by error value
       
 14813 
       
 14814 	iMockLTSY.ExpectL(ECustomGetSimAuthenticationDataIPC, bootstrapPckg);
       
 14815     iMockLTSY.CompleteL(ECustomGetSimAuthenticationDataIPC, KErrGeneral, compBootstrapPckg);
       
 14816 
       
 14817 	customAPI.GetWlanSimAuthenticationData(requestStatus, bootstrapPckg);
       
 14818 	User::WaitForRequest(requestStatus);
       
 14819 	ASSERT_EQUALS(KErrGeneral, requestStatus.Int());
       
 14820 	
       
 14821 	AssertMockLtsyStatusL();
       
 14822  	 	
       
 14823 
       
 14824  	//-------------------------------------------------------------------------
       
 14825 	// Test using RMmCustomAPI::TSimAuthenticationGbaBootstrapUpdate
       
 14826 	//-------------------------------------------------------------------------
       
 14827  
       
 14828 	RMmCustomAPI::TSimAuthenticationGbaBootstrapUpdate bsUpdate;
       
 14829 	TPckg<RMmCustomAPI::TSimAuthenticationGbaBootstrapUpdate> bsUpdatePckg(bsUpdate);
       
 14830 
       
 14831 	// --- data for ExpectL ---
       
 14832     FillRandom(bsUpdate.iBTid);
       
 14833     FillRandom(bsUpdate.iKeyLifeTime);
       
 14834 	bsUpdate.iRandomParameters.Fill(0, RMmCustomAPI::KMaxParametersLength);
       
 14835 	
       
 14836 	// --- data for CompleteL ---
       
 14837 	RMmCustomAPI::TSimAuthenticationGbaBootstrapUpdate compBsUpdate;
       
 14838 	compBsUpdate.iBTid = bsUpdate.iBTid;
       
 14839 	compBsUpdate.iKeyLifeTime = bsUpdate.iKeyLifeTime; 
       
 14840     FillRandom(compBsUpdate.iRandomParameters);
       
 14841 	TPckg<RMmCustomAPI::TSimAuthenticationGbaBootstrapUpdate> compBsUpdatePckg(compBsUpdate);	
       
 14842 		
       
 14843 	iMockLTSY.ExpectL(ECustomGetSimAuthenticationDataIPC, bsUpdatePckg);
       
 14844     iMockLTSY.CompleteL(ECustomGetSimAuthenticationDataIPC, KErrNone, compBsUpdatePckg);
       
 14845 
       
 14846 	customAPI.GetWlanSimAuthenticationData(requestStatus, bsUpdatePckg);
       
 14847 	
       
 14848 	User::WaitForRequest(requestStatus);
       
 14849 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
 14850 	ASSERT_EQUALS(compBsUpdate.iBTid, bsUpdate.iBTid);
       
 14851 	ASSERT_EQUALS(compBsUpdate.iKeyLifeTime, bsUpdate.iKeyLifeTime);
       
 14852 	ASSERT_EQUALS(compBsUpdate.iRandomParameters, bsUpdate.iRandomParameters);
       
 14853 
       
 14854 	AssertMockLtsyStatusL();	
       
 14855 
       
 14856  	//-------------------------------------------------------------------------
       
 14857 	// Test using RMmCustomAPI::TSimAuthenticationGbaNafDerivation
       
 14858 	//-------------------------------------------------------------------------
       
 14859  
       
 14860 	RMmCustomAPI::TSimAuthenticationGbaNafDerivation naf;
       
 14861     FillRandom(naf.iNafId);
       
 14862     FillRandom(naf.iImpi);
       
 14863 	naf.iKsExtNaf.Fill(0, RMmCustomAPI::KMaxParametersLength);
       
 14864 	TPckg<RMmCustomAPI::TSimAuthenticationGbaNafDerivation> nafPckg(naf);
       
 14865 	
       
 14866 	// --- data for CompleteL ---
       
 14867 	RMmCustomAPI::TSimAuthenticationGbaNafDerivation compNaf;
       
 14868 	// get random value
       
 14869 	compNaf.iNafId = naf.iNafId;
       
 14870 	compNaf.iImpi = naf.iImpi;
       
 14871     FillRandom(compNaf.iKsExtNaf);
       
 14872 	TPckg<RMmCustomAPI::TSimAuthenticationGbaNafDerivation> compNafPckg(compNaf);	
       
 14873 			
       
 14874     iMockLTSY.ExpectL(ECustomGetSimAuthenticationDataIPC, nafPckg);
       
 14875     iMockLTSY.CompleteL(ECustomGetSimAuthenticationDataIPC, KErrNone, compNafPckg);
       
 14876 
       
 14877 	customAPI.GetWlanSimAuthenticationData(requestStatus, nafPckg);
       
 14878 	
       
 14879 	User::WaitForRequest(requestStatus);
       
 14880 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
 14881 	ASSERT_EQUALS(compNaf.iNafId, naf.iNafId);
       
 14882 	ASSERT_EQUALS(compNaf.iImpi, naf.iImpi);
       
 14883 	ASSERT_EQUALS(compNaf.iKsExtNaf, naf.iKsExtNaf);
       
 14884 	
       
 14885 	AssertMockLtsyStatusL();	
       
 14886 
       
 14887  	//-------------------------------------------------------------------------
       
 14888 	// Test using RMmCustomAPI::TSimAuthenticationMgvMskUpdate
       
 14889 	//-------------------------------------------------------------------------
       
 14890  
       
 14891 	//Initialize the data to zero
       
 14892 	RMmCustomAPI::TSimAuthenticationMgvMskUpdate mskUpd;
       
 14893 	mskUpd.iMikey.Fill(0, RMmCustomAPI::KMaxMikeyLength);
       
 14894 	mskUpd.iBCASTManagement.Fill(0,RMmCustomAPI::KMaxParametersLength);
       
 14895 	mskUpd.iParentalRating.Fill(0,RMmCustomAPI::KMaxKeyGroupIdLength);
       
 14896 	mskUpd.iSecurityPolicyExt.Fill(0,RMmCustomAPI::KMaxParametersLength);
       
 14897 	TPckg<RMmCustomAPI::TSimAuthenticationMgvMskUpdate> mskUpdPckg(mskUpd);
       
 14898 	
       
 14899 	// --- data for CompleteL ---
       
 14900 	RMmCustomAPI::TSimAuthenticationMgvMskUpdate compMskUpd;
       
 14901 	// get random value
       
 14902     FillRandom(compMskUpd.iMikey);
       
 14903     FillRandom(compMskUpd.iBCASTManagement);
       
 14904     FillRandom(compMskUpd.iParentalRating);
       
 14905     FillRandom(compMskUpd.iSecurityPolicyExt);
       
 14906 	TPckg<RMmCustomAPI::TSimAuthenticationMgvMskUpdate> compMskUpdPckg(compMskUpd);	
       
 14907 		
       
 14908     iMockLTSY.ExpectL(ECustomGetSimAuthenticationDataIPC, mskUpdPckg);
       
 14909     iMockLTSY.CompleteL(ECustomGetSimAuthenticationDataIPC, KErrNone, compMskUpdPckg);
       
 14910 
       
 14911 	customAPI.GetWlanSimAuthenticationData(requestStatus, mskUpdPckg);
       
 14912 	
       
 14913 	User::WaitForRequest(requestStatus);
       
 14914 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
 14915 	ASSERT_EQUALS(compMskUpd.iMikey, mskUpd.iMikey);
       
 14916 	//Added for MobileTV.
       
 14917 	ASSERT_EQUALS(compMskUpd.iBCASTManagement, mskUpd.iBCASTManagement);
       
 14918 	ASSERT_EQUALS(compMskUpd.iParentalRating, mskUpd.iParentalRating);
       
 14919 	ASSERT_EQUALS(compMskUpd.iSecurityPolicyExt, mskUpd.iSecurityPolicyExt);
       
 14920 			
       
 14921 	AssertMockLtsyStatusL();	
       
 14922 
       
 14923  	//-------------------------------------------------------------------------
       
 14924 	// Test using RMmCustomAPI::TSimAuthenticationMgvMtkGeneration
       
 14925 	//-------------------------------------------------------------------------
       
 14926  
       
 14927 	RMmCustomAPI::TSimAuthenticationMgvMtkGeneration mtkGen;
       
 14928     FillRandom(mtkGen.iMikey);
       
 14929 	mtkGen.iMtkSalt.Fill(0, RMmCustomAPI::KMaxMikeyLength);
       
 14930 	mtkGen.iBCASTManagement.Fill(0,RMmCustomAPI::KMaxParametersLength);
       
 14931 	mtkGen.iParentalControl.Fill(0,RMmCustomAPI::KMaxKeyGroupIdLength);
       
 14932 	mtkGen.iTrafficEncryptionKey.Fill(0,RMmCustomAPI::KMaxParametersLength);
       
 14933 	TPckg<RMmCustomAPI::TSimAuthenticationMgvMtkGeneration> mtkGenPckg(mtkGen);
       
 14934 	
       
 14935 	
       
 14936 	// --- data for CompleteL ---
       
 14937 	RMmCustomAPI::TSimAuthenticationMgvMtkGeneration compMtkGen;	
       
 14938 	// get random value
       
 14939 	compMtkGen.iMikey = mtkGen.iMikey;
       
 14940     FillRandom(compMtkGen.iMtkSalt);
       
 14941     FillRandom(compMtkGen.iBCASTManagement);
       
 14942     FillRandom(compMtkGen.iParentalControl);
       
 14943     FillRandom(compMtkGen.iTrafficEncryptionKey);
       
 14944 	TPckg<RMmCustomAPI::TSimAuthenticationMgvMtkGeneration> compMtkGenPckg(compMtkGen);	
       
 14945 		
       
 14946     iMockLTSY.ExpectL(ECustomGetSimAuthenticationDataIPC, mtkGenPckg);
       
 14947     iMockLTSY.CompleteL(ECustomGetSimAuthenticationDataIPC, KErrNone, compMtkGenPckg);
       
 14948 
       
 14949 	customAPI.GetWlanSimAuthenticationData(requestStatus, mtkGenPckg);
       
 14950 	
       
 14951 	User::WaitForRequest(requestStatus);
       
 14952 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
 14953 	ASSERT_EQUALS(compMtkGen.iMikey, mtkGen.iMikey);
       
 14954 	ASSERT_EQUALS(compMtkGen.iMtkSalt, mtkGen.iMtkSalt);
       
 14955 	//Added for Mobile TV
       
 14956 	ASSERT_EQUALS(compMtkGen.iBCASTManagement, mtkGen.iBCASTManagement);
       
 14957 	ASSERT_EQUALS(compMtkGen.iParentalControl, mtkGen.iParentalControl);
       
 14958 	ASSERT_EQUALS(compMtkGen.iTrafficEncryptionKey, mtkGen.iTrafficEncryptionKey);
       
 14959 	
       
 14960 		
       
 14961 	AssertMockLtsyStatusL();	
       
 14962 
       
 14963  	//-------------------------------------------------------------------------
       
 14964 	// Test using RMmCustomAPI::TSimAuthenticationMgvMskDeletion
       
 14965 	//-------------------------------------------------------------------------
       
 14966  
       
 14967 	RMmCustomAPI::TSimAuthenticationMgvMskDeletion mskDel;
       
 14968     FillRandom(mskDel.iKeyDomainId);
       
 14969     FillRandom(mskDel.iKeyGroupIdPart);
       
 14970 	TPckg<RMmCustomAPI::TSimAuthenticationMgvMskDeletion> mskDelPckg(mskDel);
       
 14971 	
       
 14972 	// --- data for CompleteL ---
       
 14973 	RMmCustomAPI::TSimAuthenticationMgvMskDeletion compMskDel;
       
 14974 	compMskDel.iKeyDomainId = mskDel.iKeyDomainId;
       
 14975 	compMskDel.iKeyGroupIdPart = mskDel.iKeyGroupIdPart;
       
 14976 	TPckg<RMmCustomAPI::TSimAuthenticationMgvMskDeletion> compMskDelPckg(compMskDel);	
       
 14977 		
       
 14978     iMockLTSY.ExpectL(ECustomGetSimAuthenticationDataIPC, mskDelPckg);
       
 14979     iMockLTSY.CompleteL(ECustomGetSimAuthenticationDataIPC, KErrNone, compMskDelPckg);
       
 14980 
       
 14981 	customAPI.GetWlanSimAuthenticationData(requestStatus, mskDelPckg);
       
 14982 	
       
 14983 	User::WaitForRequest(requestStatus);
       
 14984 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
 14985 	ASSERT_EQUALS(compMskDel.iKeyDomainId, mskDel.iKeyDomainId);
       
 14986 	ASSERT_EQUALS(compMskDel.iKeyGroupIdPart, mskDel.iKeyGroupIdPart);
       
 14987 		
       
 14988 	AssertMockLtsyStatusL();
       
 14989 			 	
       
 14990 	CleanupStack::PopAndDestroy(2, this); // customAPI
       
 14991 	}
       
 14992 
       
 14993 
       
 14994 /**
       
 14995 @SYMTestCaseID BA-CTSY-CIPC-MCGWSAD-0002
       
 14996 @SYMComponent  telephony_ctsy
       
 14997 @SYMTestCaseDesc Test support in CTSY for cancelling of RMmCustomAPI::GetWlanSimAuthenticationData
       
 14998 @SYMTestPriority High
       
 14999 @SYMTestActions Invokes cancelling of RMmCustomAPI::GetWlanSimAuthenticationData
       
 15000 @SYMTestExpectedResults Pass
       
 15001 @SYMTestType CT
       
 15002 */
       
 15003 void CCTsyCustomIPCFU::TestGetWlanSimAuthenticationData0002L()
       
 15004 	{
       
 15005 	OpenEtelServerL(EUseExtendedError);
       
 15006 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
 15007 	OpenPhoneL();
       
 15008 	
       
 15009 	RMmCustomAPI customAPI;
       
 15010 	OpenCustomAPILC(customAPI, iPhone);
       
 15011 
       
 15012 	TRequestStatus requestStatus;
       
 15013 
       
 15014 	
       
 15015  	//-------------------------------------------------------------------------
       
 15016 	// Test cancelling of RMmCustomAPI::GetWlanSimAuthenticationData
       
 15017  	//------------------------------------------------------------------------- 	
       
 15018  	// data for APi
       
 15019  	RMmCustomAPI::TSimAuthenticationEapSim sim;
       
 15020 	TPckg<RMmCustomAPI::TSimAuthenticationEapSim> simPckg(sim);	
       
 15021 	// get random value
       
 15022     FillRandom(sim.iRandomParameters);
       
 15023 	
       
 15024 	// data for ExpectL
       
 15025 	RMmCustomAPI::TSimAuthenticationEapSim expSim(sim);
       
 15026 	TPckg<RMmCustomAPI::TSimAuthenticationEapSim> expSimPckg(expSim);
       
 15027 	
       
 15028 	// data for Complete
       
 15029 	RMmCustomAPI::TSimAuthenticationEapSim compSim;
       
 15030     FillRandom(compSim.iSRES);
       
 15031     FillRandom(compSim.iKC);
       
 15032 	TPckg<RMmCustomAPI::TSimAuthenticationEapSim> compSimPckg(compSim);	
       
 15033 	
       
 15034 	iMockLTSY.ExpectL(ECustomGetSimAuthenticationDataIPC, expSimPckg);		
       
 15035 	customAPI.GetWlanSimAuthenticationData(requestStatus, simPckg);
       
 15036 	
       
 15037 	customAPI.CancelAsyncRequest(ECustomGetSimAuthenticationDataIPC);	
       
 15038 	
       
 15039 		
       
 15040 	User::WaitForRequest(requestStatus);
       
 15041 	ASSERT_EQUALS(KErrCancel, requestStatus.Int());  	
       
 15042 
       
 15043 	AssertMockLtsyStatusL();	
       
 15044 	CleanupStack::PopAndDestroy(2, this); //  customAPI	
       
 15045 	}
       
 15046 
       
 15047 
       
 15048 /**
       
 15049 @SYMTestCaseID BA-CTSY-CIPC-MCGWSAD-0003
       
 15050 @SYMComponent  telephony_ctsy
       
 15051 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::GetWlanSimAuthenticationData with bad parameter data
       
 15052 @SYMTestPriority High
       
 15053 @SYMTestActions Invokes RMmCustomAPI::GetWlanSimAuthenticationData with bad parameter data
       
 15054 @SYMTestExpectedResults Pass
       
 15055 @SYMTestType CT
       
 15056 */
       
 15057 void CCTsyCustomIPCFU::TestGetWlanSimAuthenticationData0003L()
       
 15058 	{
       
 15059 
       
 15060 	OpenEtelServerL(EUseExtendedError);
       
 15061 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
 15062 	OpenPhoneL();
       
 15063 
       
 15064 	RMmCustomAPI customAPI;
       
 15065 	OpenCustomAPILC(customAPI, iPhone);
       
 15066 
       
 15067 	TRequestStatus requestStatus;
       
 15068 	
       
 15069 	TInt  wrongData (-1); // any value, but not 1 or 2
       
 15070 	TPckg<TInt> wrongDataPckg(wrongData);	
       
 15071 
       
 15072 	//-------------------------------------------------------------------------
       
 15073 	// Test wrong params, passed from LTSY to CTSY
       
 15074  	//------------------------------------------------------------------------- 	
       
 15075 	RMmCustomAPI::TSimAuthenticationEapAka simAka;
       
 15076 	TPckg<RMmCustomAPI::TSimAuthenticationEapAka> simAkaPckg(simAka);	
       
 15077 	// get random value
       
 15078     FillRandom(simAka.iRandomParameters);
       
 15079 	
       
 15080 	iMockLTSY.ExpectL(ECustomGetSimAuthenticationDataIPC, simAkaPckg);
       
 15081     iMockLTSY.CompleteL(ECustomGetSimAuthenticationDataIPC, KErrArgument, wrongDataPckg);
       
 15082 
       
 15083 	customAPI.GetWlanSimAuthenticationData(requestStatus, simAkaPckg);
       
 15084 	
       
 15085 	User::WaitForRequest(requestStatus);
       
 15086 	ASSERT_EQUALS(KErrArgument, requestStatus.Int());	
       
 15087 	
       
 15088 	AssertMockLtsyStatusL();	
       
 15089 
       
 15090 	//-------------------------------------------------------------------------
       
 15091 	// Test Try to use the same Rand twice
       
 15092  	//------------------------------------------------------------------------- 	
       
 15093 	RMmCustomAPI::TSimAuthenticationEapSim sim;
       
 15094 	TPckg<RMmCustomAPI::TSimAuthenticationEapSim> simPckg(sim);		
       
 15095 	sim.iRandomParameters.Fill(0x00, RMmCustomAPI::KMaxParametersLength);
       
 15096 	
       
 15097 	iMockLTSY.ExpectL(ECustomGetSimAuthenticationDataIPC, simPckg);
       
 15098 	// use this Rand first time 
       
 15099     customAPI.GetWlanSimAuthenticationData(requestStatus, simPckg);	
       
 15100 	User::WaitForRequest(requestStatus);
       
 15101 	// don't check requestStatus cause it depends on if  rand_db.cur exists or not
       
 15102 	
       
 15103 	// use this Rand second time 
       
 15104 	// CTSY should complete request with KErrArgument
       
 15105     customAPI.GetWlanSimAuthenticationData(requestStatus, simPckg);	
       
 15106 	User::WaitForRequest(requestStatus);
       
 15107 	ASSERT_EQUALS(KErrArgument, requestStatus.Int());		
       
 15108     AssertMockLtsyStatusL();	
       
 15109 	//-------------------------------------------------------------------------
       
 15110 	// Test wrong params, passed to API
       
 15111  	//-------------------------------------------------------------------------  	
       
 15112  	// CTSY (CustomAPI) checks whether passed parameters are wrong. 
       
 15113  	// if they are wrong than it completes request
       
 15114  	// and sends request with wrong parameter to LSTY !!!
       
 15115 
       
 15116 		
       
 15117  	customAPI.GetWlanSimAuthenticationData(requestStatus, wrongDataPckg);
       
 15118  	User::WaitForRequest(requestStatus);
       
 15119 	ASSERT_EQUALS(KErrNotSupported, requestStatus.Int());	
       
 15120 	
       
 15121 	AssertMockLtsyStatusL();
       
 15122 	
       
 15123 	// Done !
       
 15124 	CleanupStack::PopAndDestroy (2, this); //customAPI
       
 15125 	}
       
 15126 
       
 15127 
       
 15128 /**
       
 15129 @SYMTestCaseID BA-CTSY-CIPC-MCGWSAD-0004
       
 15130 @SYMComponent  telephony_ctsy
       
 15131 @SYMTestCaseDesc Test support in CTSY for multiple client requests to RMmCustomAPI::GetWlanSimAuthenticationData
       
 15132 @SYMTestPriority High
       
 15133 @SYMTestActions Invokes multiple client requests to RMmCustomAPI::GetWlanSimAuthenticationData
       
 15134 @SYMTestExpectedResults Pass
       
 15135 @SYMTestType CT
       
 15136 */
       
 15137 void CCTsyCustomIPCFU::TestGetWlanSimAuthenticationData0004L()
       
 15138 	{
       
 15139 						
       
 15140 	OpenEtelServerL(EUseExtendedError);
       
 15141 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
 15142 	OpenPhoneL();
       
 15143 
       
 15144 	// Open second client
       
 15145 	RTelServer telServer2;
       
 15146 	TInt ret = telServer2.Connect();
       
 15147 	ASSERT_EQUALS(KErrNone, ret);
       
 15148 	CleanupClosePushL(telServer2);
       
 15149 
       
 15150 	RMobilePhone phone2;
       
 15151 	ret = phone2.Open(iTelServer,KMmTsyPhoneName);
       
 15152 	ASSERT_EQUALS(KErrNone, ret);
       
 15153 	CleanupClosePushL(phone2);
       
 15154 	
       
 15155 	RMmCustomAPI customAPI;
       
 15156 	OpenCustomAPILC(customAPI, iPhone);
       
 15157 
       
 15158 	RMmCustomAPI customAPI2;
       
 15159 	OpenCustomAPILC(customAPI2, phone2, EFalse);
       
 15160 
       
 15161 	TRequestStatus requestStatus;
       
 15162 	TRequestStatus requestStatus2;
       
 15163 	
       
 15164 	// data for the first APi
       
 15165  	RMmCustomAPI::TSimAuthenticationEapAka simAka;
       
 15166 	TPckg<RMmCustomAPI::TSimAuthenticationEapAka> simPckg(simAka);	
       
 15167     FillRandom(simAka.iRandomParameters);
       
 15168 	
       
 15169 	// data for the first ExpectL
       
 15170 	RMmCustomAPI::TSimAuthenticationEapAka expSimAka(simAka);
       
 15171 	TPckg<RMmCustomAPI::TSimAuthenticationEapAka> expSimPckg(expSimAka);
       
 15172 	
       
 15173 	// data for the first Complete
       
 15174 	RMmCustomAPI::TSimAuthenticationEapAka compSimAka;
       
 15175 	TPckg<RMmCustomAPI::TSimAuthenticationEapAka> compSimPckg(compSimAka);	
       
 15176 	
       
 15177 	
       
 15178 	// data for second APi
       
 15179  	RMmCustomAPI::TSimAuthenticationEapSim sim2;
       
 15180 	TPckg<RMmCustomAPI::TSimAuthenticationEapSim> simPckg2(sim2);	
       
 15181     FillRandom(sim2.iRandomParameters);
       
 15182 	
       
 15183 	//-------------------------------------------------------------------------
       
 15184 	// Test A: Test multiple clients requesting RMmCustomAPI::GetWlanSimAuthenticationData
       
 15185  	//------------------------------------------------------------------------- 	
       
 15186  	// first request 
       
 15187  	iMockLTSY.ExpectL(ECustomGetSimAuthenticationDataIPC, expSimPckg);		
       
 15188 	iMockLTSY.CompleteL(ECustomGetSimAuthenticationDataIPC, KErrNone, compSimPckg);
       
 15189 	
       
 15190 	customAPI.GetWlanSimAuthenticationData(requestStatus, simPckg);
       
 15191 	
       
 15192 	// second request  	
       
 15193 	customAPI2.GetWlanSimAuthenticationData(requestStatus2, simPckg2);	
       
 15194 	
       
 15195 	// wait for the first answer
       
 15196 	User::WaitForRequest(requestStatus);
       
 15197 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
 15198 
       
 15199 	// wait for the second answer
       
 15200 	User::WaitForRequest(requestStatus2);
       
 15201 	ASSERT_EQUALS(KErrServerBusy, requestStatus2.Int());
       
 15202 	
       
 15203 	AssertMockLtsyStatusL();
       
 15204 	
       
 15205 	CleanupStack::PopAndDestroy(5, this);
       
 15206 	}
       
 15207 
       
 15208 
       
 15209 /**
       
 15210 @SYMTestCaseID BA-CTSY-CIPC-MCGWSAD-0005
       
 15211 @SYMComponent  telephony_ctsy
       
 15212 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::GetWlanSimAuthenticationData with timeout
       
 15213 @SYMTestPriority High
       
 15214 @SYMTestActions Invokes RMmCustomAPI::GetWlanSimAuthenticationData and tests for timeout
       
 15215 @SYMTestExpectedResults Pass
       
 15216 @SYMTestType CT
       
 15217 */
       
 15218 void CCTsyCustomIPCFU::TestGetWlanSimAuthenticationData0005L()
       
 15219 	{
       
 15220 
       
 15221 	OpenEtelServerL(EUseExtendedError);
       
 15222 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
 15223 	OpenPhoneL();
       
 15224 
       
 15225 	RMmCustomAPI customAPI;
       
 15226 	OpenCustomAPILC(customAPI, iPhone);
       
 15227 
       
 15228 	TRequestStatus requestStatus;
       
 15229 	
       
 15230 	// data for APi
       
 15231  	RMmCustomAPI::TSimAuthenticationEapSim sim;
       
 15232 	TPckg<RMmCustomAPI::TSimAuthenticationEapSim> simPckg(sim);	
       
 15233     FillRandom(sim.iRandomParameters);
       
 15234 	
       
 15235 	// data for t ExpectL
       
 15236 	RMmCustomAPI::TSimAuthenticationEapSim expSim(sim);
       
 15237 	TPckg<RMmCustomAPI::TSimAuthenticationEapSim> expSimPckg(expSim);
       
 15238 
       
 15239 	//-------------------------------------------------------------------------
       
 15240 	// Test A: Test timeout of RMmCustomAPI::GetWlanSimAuthenticationData
       
 15241  	//-------------------------------------------------------------------------
       
 15242  	iMockLTSY.ExpectL(ECustomGetSimAuthenticationDataIPC, expSimPckg);			
       
 15243 	customAPI.GetWlanSimAuthenticationData(requestStatus, simPckg);	
       
 15244 	
       
 15245 	User::WaitForRequest(requestStatus);
       
 15246 	ASSERT_EQUALS(KErrTimedOut, requestStatus.Int());
       
 15247 	
       
 15248 	AssertMockLtsyStatusL();
       
 15249 	// Done !
       
 15250 	CleanupStack::PopAndDestroy(2, this); // customAPI
       
 15251 	}
       
 15252 
       
 15253 
       
 15254 /**
       
 15255 @SYMTestCaseID BA-CTSY-CIPC-MCSSMSR-0001
       
 15256 @SYMComponent  telephony_ctsy
       
 15257 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::SetSimMessageStatusRead
       
 15258 @SYMTestPriority High
       
 15259 @SYMTestActions Invokes RMmCustomAPI::SetSimMessageStatusRead
       
 15260 @SYMTestExpectedResults Pass
       
 15261 @SYMTestType CT
       
 15262 */
       
 15263 void CCTsyCustomIPCFU::TestSetSimMessageStatusRead0001L()
       
 15264 	{
       
 15265 
       
 15266 	OpenEtelServerL(EUseExtendedError);
       
 15267 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
 15268 	OpenPhoneL();
       
 15269 
       
 15270 	RMmCustomAPI customAPI;
       
 15271 	OpenCustomAPILC(customAPI, iPhone);
       
 15272 
       
 15273 	RBuf8 data;
       
 15274 	CleanupClosePushL(data);
       
 15275 	
       
 15276 	TTime time;	
       
 15277 	time.UniversalTime();
       
 15278 	TInt timeZone(1);
       
 15279 	
       
 15280 	TTime expTime(time);	
       
 15281 	TInt expTimeZone(timeZone);
       
 15282 	
       
 15283 	TMockLtsyData2< TTime, TInt > ltsyData(expTime, expTimeZone);	    
       
 15284     ltsyData.SerialiseL(data);    	    
       
 15285 
       
 15286 	
       
 15287 	// Actually the function does not have any opportunity to return error value.
       
 15288 	// Perhaps this is a design error...
       
 15289     
       
 15290  	//-------------------------------------------------------------------------
       
 15291 	// TEST A: failure to dispatch request to LTSY
       
 15292  	//-------------------------------------------------------------------------
       
 15293     
       
 15294     iMockLTSY.ExpectL(ECustomSetSimMessageStatusReadIPC, data, KErrNotSupported);
       
 15295 	
       
 15296 	customAPI.SetSimMessageStatusRead(time, timeZone);
       
 15297 	
       
 15298 	AssertMockLtsyStatusL();
       
 15299 
       
 15300  	//-------------------------------------------------------------------------
       
 15301 	// TEST C: Successful completion request of
       
 15302 	// RMmCustomAPI::SetSimMessageStatusRead when result is not cached.
       
 15303  	//-------------------------------------------------------------------------
       
 15304 
       
 15305     iMockLTSY.ExpectL(ECustomSetSimMessageStatusReadIPC, data, KErrNone);
       
 15306 	
       
 15307 	customAPI.SetSimMessageStatusRead(time, timeZone);
       
 15308 	
       
 15309 	AssertMockLtsyStatusL();
       
 15310 
       
 15311 	CleanupStack::PopAndDestroy(3, this); 
       
 15312 	
       
 15313 	}
       
 15314 
       
 15315 /**
       
 15316 @SYMTestCaseID BA-CTSY-CIPC-MCWVHZUS-0001
       
 15317 @SYMComponent  telephony_ctsy
       
 15318 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::WriteViagHomeZoneUHZIUESettings
       
 15319 @SYMTestPriority High
       
 15320 @SYMTestActions Invokes RMmCustomAPI::WriteViagHomeZoneUHZIUESettings
       
 15321 @SYMTestExpectedResults Pass
       
 15322 @SYMTestType CT
       
 15323 */
       
 15324 void CCTsyCustomIPCFU::TestWriteViagHomeZoneUHZIUESettings0001L()
       
 15325 	{
       
 15326 
       
 15327 	OpenEtelServerL(EUseExtendedError);
       
 15328 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
 15329 	OpenPhoneL();
       
 15330 
       
 15331 	RMmCustomAPI customAPI;
       
 15332 	OpenCustomAPILC(customAPI, iPhone);
       
 15333 
       
 15334 	TRequestStatus requestStatus;
       
 15335 	RMmCustomAPI::TViagUHZIUESettings settings;
       
 15336 	
       
 15337 	settings.iSettings = 0xFF;
       
 15338 	settings.iVersion = 1;
       
 15339 	
       
 15340 	RBuf8 data;
       
 15341 	CleanupClosePushL(data);
       
 15342 
       
 15343 	RMmCustomAPI::TViagUHZIUESettings expSettings = settings;
       
 15344 
       
 15345 	
       
 15346 	TMockLtsyData1< RMmCustomAPI::TViagUHZIUESettings > ltsyData(expSettings);	    
       
 15347     ltsyData.SerialiseL(data);    	    
       
 15348     
       
 15349  	//-------------------------------------------------------------------------
       
 15350 	// TEST A: failure to dispatch request to LTSY
       
 15351  	//-------------------------------------------------------------------------
       
 15352     
       
 15353     iMockLTSY.ExpectL(EWriteViagHomeZoneUHZIUESettingsIPC, data, KErrNotSupported);
       
 15354 	
       
 15355 	customAPI.WriteViagHomeZoneUHZIUESettings(requestStatus, settings);
       
 15356 	
       
 15357 	User::WaitForRequest(requestStatus);
       
 15358 	ASSERT_EQUALS(KErrNotSupported, requestStatus.Int());
       
 15359 
       
 15360 	AssertMockLtsyStatusL();
       
 15361 
       
 15362 	//-------------------------------------------------------------------------
       
 15363 	// TEST B: failure on completion of pending request from LTSY->CTSY
       
 15364  	//-------------------------------------------------------------------------
       
 15365 
       
 15366     iMockLTSY.ExpectL(EWriteViagHomeZoneUHZIUESettingsIPC, data);
       
 15367     iMockLTSY.CompleteL(EWriteViagHomeZoneUHZIUESettingsIPC, KErrGeneral);        	
       
 15368 
       
 15369 	customAPI.WriteViagHomeZoneUHZIUESettings(requestStatus, settings);
       
 15370 	
       
 15371 	User::WaitForRequest(requestStatus);	
       
 15372 	ASSERT_EQUALS(KErrGeneral, requestStatus.Int());
       
 15373 
       
 15374 	AssertMockLtsyStatusL();
       
 15375 
       
 15376  	//-------------------------------------------------------------------------
       
 15377 	// TEST C: Successful completion request of
       
 15378 	// RMmCustomAPI::NotifyRauEvent when result is not cached.
       
 15379  	//-------------------------------------------------------------------------
       
 15380 
       
 15381     iMockLTSY.ExpectL(EWriteViagHomeZoneUHZIUESettingsIPC, data);
       
 15382     iMockLTSY.CompleteL(EWriteViagHomeZoneUHZIUESettingsIPC, KErrNone);        	
       
 15383 
       
 15384 	customAPI.WriteViagHomeZoneUHZIUESettings(requestStatus, settings);
       
 15385 	
       
 15386 	User::WaitForRequest(requestStatus);	
       
 15387 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
 15388 
       
 15389 	AssertMockLtsyStatusL();
       
 15390 
       
 15391  	//-------------------------------------------------------------------------
       
 15392 	// TEST E: Unsolicited completion of RMmCustomAPI::NotifyRauEvent
       
 15393 	// from LTSY.
       
 15394  	//-------------------------------------------------------------------------
       
 15395 
       
 15396 	TRequestStatus mockLtsyStatus;
       
 15397 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
 15398 
       
 15399     iMockLTSY.CompleteL(EWriteViagHomeZoneUHZIUESettingsIPC, KErrNone);        	
       
 15400 
       
 15401 	User::WaitForRequest(mockLtsyStatus);
       
 15402 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
 15403 
       
 15404 	AssertMockLtsyStatusL();
       
 15405 	CleanupStack::PopAndDestroy(3, this); 
       
 15406 	
       
 15407 	}
       
 15408 
       
 15409 
       
 15410 /**
       
 15411 @SYMTestCaseID BA-CTSY-CIPC-MCWVHZUS-0002
       
 15412 @SYMComponent  telephony_ctsy
       
 15413 @SYMTestCaseDesc Test support in CTSY for cancelling of RMmCustomAPI::WriteViagHomeZoneUHZIUESettings
       
 15414 @SYMTestPriority High
       
 15415 @SYMTestActions Invokes cancelling of RMmCustomAPI::WriteViagHomeZoneUHZIUESettings
       
 15416 @SYMTestExpectedResults Pass
       
 15417 @SYMTestType CT
       
 15418 */
       
 15419 void CCTsyCustomIPCFU::TestWriteViagHomeZoneUHZIUESettings0002L()
       
 15420 	{
       
 15421 
       
 15422 	OpenEtelServerL(EUseExtendedError);
       
 15423 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
 15424 	OpenPhoneL();
       
 15425 
       
 15426 	RMmCustomAPI customAPI;
       
 15427 	OpenCustomAPILC(customAPI, iPhone);
       
 15428 
       
 15429 	TRequestStatus mockLtsyStatus;
       
 15430 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
 15431 
       
 15432 
       
 15433 	TRequestStatus requestStatus;
       
 15434 	RMmCustomAPI::TViagUHZIUESettings settings;
       
 15435 	
       
 15436 	settings.iSettings = 0xFF;
       
 15437 	settings.iVersion = 1;
       
 15438 	
       
 15439 	RBuf8 data;
       
 15440 	CleanupClosePushL(data);
       
 15441 
       
 15442 	RMmCustomAPI::TViagUHZIUESettings expSettings = settings;
       
 15443 
       
 15444 	
       
 15445 	TMockLtsyData1< RMmCustomAPI::TViagUHZIUESettings > ltsyData(expSettings);	    
       
 15446     ltsyData.SerialiseL(data);    	    
       
 15447     
       
 15448  	//-------------------------------------------------------------------------
       
 15449 	// Test cancelling of RMmCustomAPI::WriteViagHomeZoneUHZIUESettings
       
 15450  	//-------------------------------------------------------------------------
       
 15451 
       
 15452     iMockLTSY.ExpectL(EWriteViagHomeZoneUHZIUESettingsIPC, data);
       
 15453     iMockLTSY.CompleteL(EWriteViagHomeZoneUHZIUESettingsIPC, KErrNone, 20);        	
       
 15454 
       
 15455 	customAPI.WriteViagHomeZoneUHZIUESettings(requestStatus, settings);
       
 15456 	
       
 15457 	customAPI.CancelAsyncRequest(EWriteViagHomeZoneUHZIUESettingsIPC);
       
 15458 	
       
 15459 	User::WaitForRequest(requestStatus);	
       
 15460 	ASSERT_EQUALS(KErrCancel, requestStatus.Int());
       
 15461 
       
 15462 	User::WaitForRequest(mockLtsyStatus);
       
 15463 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
 15464 	AssertMockLtsyStatusL();
       
 15465 	
       
 15466 	CleanupStack::PopAndDestroy(3, this); 	
       
 15467 	}
       
 15468 
       
 15469 
       
 15470 
       
 15471 /**
       
 15472 @SYMTestCaseID BA-CTSY-CIPC-MCWVHZUS-0004
       
 15473 @SYMComponent  telephony_ctsy
       
 15474 @SYMTestCaseDesc Test support in CTSY for multiple client requests to RMmCustomAPI::WriteViagHomeZoneUHZIUESettings
       
 15475 @SYMTestPriority High
       
 15476 @SYMTestActions Invokes multiple client requests to RMmCustomAPI::WriteViagHomeZoneUHZIUESettings
       
 15477 @SYMTestExpectedResults Pass
       
 15478 @SYMTestType CT
       
 15479 */
       
 15480 void CCTsyCustomIPCFU::TestWriteViagHomeZoneUHZIUESettings0004L()
       
 15481 	{
       
 15482 					
       
 15483 	OpenEtelServerL(EUseExtendedError);
       
 15484 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
 15485 	OpenPhoneL();
       
 15486 
       
 15487 	// Open second client
       
 15488 	RTelServer telServer2;
       
 15489 	TInt ret = telServer2.Connect();
       
 15490 	ASSERT_EQUALS(KErrNone, ret);
       
 15491 	CleanupClosePushL(telServer2);
       
 15492 
       
 15493 	RMobilePhone phone2;
       
 15494 	ret = phone2.Open(telServer2,KMmTsyPhoneName);
       
 15495 	ASSERT_EQUALS(KErrNone, ret);
       
 15496 	CleanupClosePushL(phone2);
       
 15497 
       
 15498 	RMmCustomAPI customAPI;
       
 15499 	OpenCustomAPILC(customAPI, iPhone);
       
 15500 
       
 15501 	RMmCustomAPI customAPI2;
       
 15502 	OpenCustomAPILC(customAPI2, phone2, EFalse);
       
 15503 
       
 15504 	RBuf8 data;
       
 15505 	CleanupClosePushL(data);
       
 15506 
       
 15507 	TRequestStatus requestStatus;
       
 15508 	TRequestStatus requestStatus2;
       
 15509 	RMmCustomAPI::TViagUHZIUESettings settings;
       
 15510 	RMmCustomAPI::TViagUHZIUESettings settings2;
       
 15511 	
       
 15512 	settings.iSettings = 0xFF;
       
 15513 	settings.iVersion = 1;
       
 15514 	
       
 15515 	RMmCustomAPI::TViagUHZIUESettings expSettings = settings;
       
 15516 
       
 15517 	
       
 15518 	TMockLtsyData1< RMmCustomAPI::TViagUHZIUESettings > ltsyData(expSettings);	    
       
 15519     ltsyData.SerialiseL(data);    	    
       
 15520 
       
 15521 	//-------------------------------------------------------------------------
       
 15522 	// Test A: Test multiple clients requesting RMmCustomAPI::WriteViagHomeZoneUHZIUESettings
       
 15523  	//-------------------------------------------------------------------------
       
 15524 
       
 15525     iMockLTSY.ExpectL(EWriteViagHomeZoneUHZIUESettingsIPC, data);
       
 15526     iMockLTSY.CompleteL(EWriteViagHomeZoneUHZIUESettingsIPC, KErrNone, 20);        	
       
 15527 
       
 15528 	customAPI.WriteViagHomeZoneUHZIUESettings(requestStatus, settings);
       
 15529 	
       
 15530 	customAPI2.WriteViagHomeZoneUHZIUESettings(requestStatus2, settings2);
       
 15531 	
       
 15532 	User::WaitForRequest(requestStatus);	
       
 15533 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
 15534 
       
 15535 	User::WaitForRequest(requestStatus2);	
       
 15536 	ASSERT_EQUALS(KErrServerBusy, requestStatus2.Int());
       
 15537 
       
 15538 	AssertMockLtsyStatusL();
       
 15539 
       
 15540 	CleanupStack::PopAndDestroy(6, this);
       
 15541 
       
 15542 	}
       
 15543 
       
 15544 
       
 15545 /**
       
 15546 @SYMTestCaseID BA-CTSY-CIPC-MCWVHZUS-0005
       
 15547 @SYMComponent  telephony_ctsy
       
 15548 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::WriteViagHomeZoneUHZIUESettings with timeout
       
 15549 @SYMTestPriority High
       
 15550 @SYMTestActions Invokes RMmCustomAPI::WriteViagHomeZoneUHZIUESettings and tests for timeout
       
 15551 @SYMTestExpectedResults Pass
       
 15552 @SYMTestType CT
       
 15553 */
       
 15554 void CCTsyCustomIPCFU::TestWriteViagHomeZoneUHZIUESettings0005L()
       
 15555 	{
       
 15556 	
       
 15557 	OpenEtelServerL(EUseExtendedError);
       
 15558 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
 15559 	OpenPhoneL();
       
 15560 
       
 15561 	RMmCustomAPI customAPI;
       
 15562 	OpenCustomAPILC(customAPI, iPhone);
       
 15563 
       
 15564 	TRequestStatus requestStatus;
       
 15565 	RMmCustomAPI::TViagUHZIUESettings settings = {0, 0};
       
 15566 	
       
 15567 	RBuf8 data;
       
 15568 	CleanupClosePushL(data);
       
 15569 
       
 15570 	RMmCustomAPI::TViagUHZIUESettings expSettings = settings;
       
 15571 
       
 15572 	
       
 15573 	TMockLtsyData1< RMmCustomAPI::TViagUHZIUESettings > ltsyData(expSettings);	    
       
 15574     ltsyData.SerialiseL(data);    	    
       
 15575     
       
 15576     iMockLTSY.ExpectL(EWriteViagHomeZoneUHZIUESettingsIPC, data);
       
 15577 
       
 15578 	customAPI.WriteViagHomeZoneUHZIUESettings(requestStatus, settings);
       
 15579 	
       
 15580 	User::WaitForRequest(requestStatus);	
       
 15581 	ASSERT_EQUALS(KErrTimedOut, requestStatus.Int());
       
 15582 
       
 15583 	AssertMockLtsyStatusL();
       
 15584 	
       
 15585 	CleanupStack::PopAndDestroy(3, this); 
       
 15586 	}
       
 15587 
       
 15588 
       
 15589 /**
       
 15590 @SYMTestCaseID BA-CTSY-CIPC-MCSAO-0001
       
 15591 @SYMComponent  telephony_ctsy
       
 15592 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::SetAlwaysOn
       
 15593 @SYMTestPriority High
       
 15594 @SYMTestActions Invokes RMmCustomAPI::SetAlwaysOn
       
 15595 @SYMTestExpectedResults Pass
       
 15596 @SYMTestType CT
       
 15597 */
       
 15598 void CCTsyCustomIPCFU::TestSetAlwaysOn0001L()
       
 15599 	{
       
 15600 
       
 15601 	OpenEtelServerL(EUseExtendedError);
       
 15602 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
 15603 	OpenPhoneL();
       
 15604 
       
 15605 	RPacketService packetService;		
       
 15606 
       
 15607 	OpenPacketServiceL(packetService);
       
 15608 	CleanupClosePushL(packetService);
       
 15609 
       
 15610 	RMmCustomAPI customAPI;
       
 15611 	OpenCustomAPILC(customAPI, iPhone);
       
 15612 
       
 15613 	RBuf8 data;
       
 15614 	CleanupClosePushL(data);
       
 15615 
       
 15616 	RBuf8 expectData;
       
 15617 	CleanupClosePushL(expectData);
       
 15618 
       
 15619 	TRequestStatus requestStatus; 
       
 15620 	RMmCustomAPI::TSetAlwaysOnMode expMode = RMmCustomAPI::EAlwaysModeBoth; 	
       
 15621 
       
 15622 	TMockLtsyData1 <RMmCustomAPI::TSetAlwaysOnMode> expData(expMode);
       
 15623 	expData.SerialiseL(expectData);
       
 15624 		
       
 15625 	RMmCustomAPI::TSetAlwaysOnMode mode = RMmCustomAPI::EAlwaysModeBoth; 	
       
 15626 	
       
 15627 	//-------------------------------------------------------------------------
       
 15628 	// TEST B: failure on completion of pending request from LTSY->CTSY
       
 15629  	//-------------------------------------------------------------------------
       
 15630 
       
 15631 	iMockLTSY.ExpectL(ECustomSetAlwaysOnMode, expectData);	
       
 15632 
       
 15633 	TInt result = 0;
       
 15634 
       
 15635 	TMockLtsyData1 <TInt> ltsyData(result);
       
 15636 	ltsyData.SerialiseL(data);
       
 15637 	
       
 15638 	iMockLTSY.CompleteL(ECustomSetAlwaysOnMode, KErrGeneral, data);
       
 15639 
       
 15640 	customAPI.SetAlwaysOn(requestStatus, mode);
       
 15641 
       
 15642 	User::WaitForRequest(requestStatus);
       
 15643 	ASSERT_EQUALS(KErrGeneral, requestStatus.Int());
       
 15644 
       
 15645 	AssertMockLtsyStatusL();
       
 15646 
       
 15647  	//-------------------------------------------------------------------------
       
 15648 	// TEST E: Unsolicited completion of RMmCustomAPI::SetAlwaysOn
       
 15649 	// from LTSY.
       
 15650  	//-------------------------------------------------------------------------
       
 15651 
       
 15652 	TRequestStatus mockLtsyStatus;
       
 15653 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
 15654 
       
 15655 	iMockLTSY.CompleteL(ECustomSetAlwaysOnMode, KErrNone, data);
       
 15656 
       
 15657 	User::WaitForRequest(mockLtsyStatus);
       
 15658 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
 15659 
       
 15660 	AssertMockLtsyStatusL();
       
 15661 
       
 15662  	//-------------------------------------------------------------------------
       
 15663 	// TEST A: failure to dispatch request to LTSY
       
 15664  	//-------------------------------------------------------------------------
       
 15665 
       
 15666 	iMockLTSY.ExpectL(ECustomSetAlwaysOnMode, expectData, KErrNotSupported);	
       
 15667 
       
 15668 	customAPI.SetAlwaysOn(requestStatus, mode);
       
 15669 
       
 15670 	User::WaitForRequest(requestStatus);
       
 15671 	ASSERT_EQUALS(KErrNotSupported, requestStatus.Int());
       
 15672 
       
 15673 	AssertMockLtsyStatusL();
       
 15674 
       
 15675  	//-------------------------------------------------------------------------
       
 15676 	// TEST C: Successful completion request of
       
 15677 	// RMmCustomAPI::SetAlwaysOn when result is not cached.
       
 15678  	//-------------------------------------------------------------------------
       
 15679 
       
 15680 	iMockLTSY.ExpectL(ECustomSetAlwaysOnMode, expectData);	
       
 15681 	iMockLTSY.CompleteL(ECustomSetAlwaysOnMode, KErrNone, data);
       
 15682 
       
 15683 	customAPI.SetAlwaysOn(requestStatus, mode);
       
 15684 
       
 15685 	User::WaitForRequest(requestStatus);
       
 15686 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
 15687 
       
 15688 	AssertMockLtsyStatusL();
       
 15689 	CleanupStack::PopAndDestroy(5, this); 
       
 15690 	
       
 15691 	}
       
 15692 
       
 15693 
       
 15694 /**
       
 15695 @SYMTestCaseID BA-CTSY-CIPC-MCSAO-0002
       
 15696 @SYMComponent  telephony_ctsy
       
 15697 @SYMTestCaseDesc Test support in CTSY for cancelling of RMmCustomAPI::SetAlwaysOn
       
 15698 @SYMTestPriority High
       
 15699 @SYMTestActions Invokes cancelling of RMmCustomAPI::SetAlwaysOn
       
 15700 @SYMTestExpectedResults Pass
       
 15701 @SYMTestType CT
       
 15702 */
       
 15703 void CCTsyCustomIPCFU::TestSetAlwaysOn0002L()
       
 15704 	{
       
 15705 
       
 15706 	OpenEtelServerL(EUseExtendedError);
       
 15707 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
 15708 	OpenPhoneL();
       
 15709 
       
 15710 	RPacketService packetService;		
       
 15711 
       
 15712 	OpenPacketServiceL(packetService);
       
 15713 	CleanupClosePushL(packetService);
       
 15714 
       
 15715 	RMmCustomAPI customAPI;
       
 15716 	OpenCustomAPILC(customAPI, iPhone);
       
 15717 
       
 15718 	RBuf8 data;
       
 15719 	CleanupClosePushL(data);
       
 15720 
       
 15721 	RBuf8 expectData;
       
 15722 	CleanupClosePushL(expectData);
       
 15723 
       
 15724 	TRequestStatus requestStatus; 
       
 15725 	RMmCustomAPI::TSetAlwaysOnMode expMode = RMmCustomAPI::EAlwaysModeBoth; 	
       
 15726 
       
 15727 	TMockLtsyData1 <RMmCustomAPI::TSetAlwaysOnMode> expData(expMode);
       
 15728 	expData.SerialiseL(expectData);
       
 15729 		
       
 15730 	RMmCustomAPI::TSetAlwaysOnMode mode = RMmCustomAPI::EAlwaysModeBoth; 	
       
 15731 	
       
 15732 	TInt result = 0;
       
 15733 
       
 15734 	TMockLtsyData1 <TInt> ltsyData(result);
       
 15735 	ltsyData.SerialiseL(data);
       
 15736 
       
 15737  	//-------------------------------------------------------------------------
       
 15738 	// Test cancelling of RMmCustomAPI::SetAlwaysOn
       
 15739  	//-------------------------------------------------------------------------
       
 15740 	iMockLTSY.ExpectL(ECustomSetAlwaysOnMode, expectData);	
       
 15741 	//iMockLTSY.CompleteL(ECustomSetAlwaysOnMode, KErrNone, data, 20);
       
 15742 
       
 15743 	customAPI.SetAlwaysOn(requestStatus, mode);
       
 15744 	
       
 15745 	customAPI.CancelAsyncRequest(ECustomSetAlwaysOnMode);
       
 15746 
       
 15747 	User::WaitForRequest(requestStatus);
       
 15748 	ASSERT_EQUALS(KErrCancel, requestStatus.Int());
       
 15749  	
       
 15750 	AssertMockLtsyStatusL();
       
 15751  	
       
 15752 	CleanupStack::PopAndDestroy(5); 
       
 15753 	
       
 15754 	}
       
 15755 
       
 15756 
       
 15757 /**
       
 15758 @SYMTestCaseID BA-CTSY-CIPC-MCSAO-0003
       
 15759 @SYMComponent  telephony_ctsy
       
 15760 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::SetAlwaysOn with bad parameter data
       
 15761 @SYMTestPriority High
       
 15762 @SYMTestActions Invokes RMmCustomAPI::SetAlwaysOn with bad parameter data
       
 15763 @SYMTestExpectedResults Pass
       
 15764 @SYMTestType CT
       
 15765 */
       
 15766 void CCTsyCustomIPCFU::TestSetAlwaysOn0003L()
       
 15767 	{
       
 15768 
       
 15769 	OpenEtelServerL(EUseExtendedError);
       
 15770 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
 15771 	OpenPhoneL();
       
 15772 
       
 15773 	RMmCustomAPI customAPI;
       
 15774 	OpenCustomAPILC(customAPI, iPhone);
       
 15775 
       
 15776 	TRequestStatus requestStatus; 
       
 15777 		
       
 15778 	RMmCustomAPI::TSetAlwaysOnMode mode = RMmCustomAPI::EAlwaysModeBoth; 	
       
 15779 	
       
 15780 	customAPI.SetAlwaysOn(requestStatus, mode);
       
 15781 	
       
 15782 	User::WaitForRequest(requestStatus);
       
 15783 	ASSERT_EQUALS(KErrGeneral, requestStatus.Int());
       
 15784 
       
 15785 	AssertMockLtsyStatusL();
       
 15786  	
       
 15787 	CleanupStack::PopAndDestroy(2); 
       
 15788 	
       
 15789 
       
 15790 	}
       
 15791 
       
 15792 
       
 15793 /**
       
 15794 @SYMTestCaseID BA-CTSY-CIPC-MCSAO-0004
       
 15795 @SYMComponent  telephony_ctsy
       
 15796 @SYMTestCaseDesc Test support in CTSY for multiple client requests to RMmCustomAPI::SetAlwaysOn
       
 15797 @SYMTestPriority High
       
 15798 @SYMTestActions Invokes multiple client requests to RMmCustomAPI::SetAlwaysOn
       
 15799 @SYMTestExpectedResults Pass
       
 15800 @SYMTestType CT
       
 15801 */
       
 15802 void CCTsyCustomIPCFU::TestSetAlwaysOn0004L()
       
 15803 	{
       
 15804 					
       
 15805 	OpenEtelServerL(EUseExtendedError);
       
 15806 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
 15807 	OpenPhoneL();
       
 15808 
       
 15809 	// Open second client
       
 15810 	RTelServer telServer2;
       
 15811 	TInt ret = telServer2.Connect();
       
 15812 	ASSERT_EQUALS(KErrNone, ret);
       
 15813 	CleanupClosePushL(telServer2);
       
 15814 
       
 15815 	RMobilePhone phone2;
       
 15816 	ret = phone2.Open(telServer2,KMmTsyPhoneName);
       
 15817 	ASSERT_EQUALS(KErrNone, ret);
       
 15818 	CleanupClosePushL(phone2);
       
 15819 
       
 15820 	RPacketService packetService;		
       
 15821 
       
 15822 	OpenPacketServiceL(packetService);
       
 15823 	CleanupClosePushL(packetService);
       
 15824 
       
 15825 	RMmCustomAPI customAPI;
       
 15826 	OpenCustomAPILC(customAPI, iPhone);
       
 15827 
       
 15828 	RMmCustomAPI customAPI2;
       
 15829 	OpenCustomAPILC(customAPI2, phone2, EFalse);
       
 15830 
       
 15831 	RBuf8 data;
       
 15832 	CleanupClosePushL(data);
       
 15833 
       
 15834 	RBuf8 expectData;
       
 15835 	CleanupClosePushL(expectData);
       
 15836 
       
 15837 	TRequestStatus requestStatus; 
       
 15838 	RMmCustomAPI::TSetAlwaysOnMode expMode = RMmCustomAPI::EAlwaysModeBoth; 	
       
 15839 
       
 15840 	TRequestStatus requestStatus2; 
       
 15841 
       
 15842 	TMockLtsyData1 <RMmCustomAPI::TSetAlwaysOnMode> expData(expMode);
       
 15843 	expData.SerialiseL(expectData);
       
 15844 		
       
 15845 	RMmCustomAPI::TSetAlwaysOnMode mode = RMmCustomAPI::EAlwaysModeBoth; 	
       
 15846 	RMmCustomAPI::TSetAlwaysOnMode mode2 = RMmCustomAPI::EAlwaysModeBoth; 	
       
 15847 	
       
 15848 	TInt result = 0;
       
 15849 
       
 15850 	TMockLtsyData1 <TInt> ltsyData(result);
       
 15851 	ltsyData.SerialiseL(data);
       
 15852 
       
 15853 	iMockLTSY.ExpectL(ECustomSetAlwaysOnMode, expectData);	
       
 15854 	iMockLTSY.CompleteL(ECustomSetAlwaysOnMode, KErrNone, data, 20);
       
 15855 
       
 15856 	customAPI.SetAlwaysOn(requestStatus, mode);
       
 15857 
       
 15858 	customAPI2.SetAlwaysOn(requestStatus2, mode2);
       
 15859 	
       
 15860 	User::WaitForRequest(requestStatus);
       
 15861 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
 15862 
       
 15863 	User::WaitForRequest(requestStatus2);
       
 15864 	ASSERT_EQUALS(KErrServerBusy, requestStatus2.Int());
       
 15865 
       
 15866 	AssertMockLtsyStatusL();
       
 15867 
       
 15868 	CleanupStack::PopAndDestroy(8, this);
       
 15869 
       
 15870 	}
       
 15871 
       
 15872 
       
 15873 /**
       
 15874 @SYMTestCaseID BA-CTSY-CIPC-MCNRE-0001
       
 15875 @SYMComponent  telephony_ctsy
       
 15876 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::NotifyRauEvent
       
 15877 @SYMTestPriority High
       
 15878 @SYMTestActions Invokes RMmCustomAPI::NotifyRauEvent
       
 15879 @SYMTestExpectedResults Pass
       
 15880 @SYMTestType CT
       
 15881 */
       
 15882 void CCTsyCustomIPCFU::TestNotifyRauEvent0001L()
       
 15883 	{
       
 15884 
       
 15885 	OpenEtelServerL(EUseExtendedError);
       
 15886 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
 15887 	OpenPhoneL();
       
 15888 
       
 15889 
       
 15890 	RMmCustomAPI customAPI;
       
 15891 	OpenCustomAPILC(customAPI, iPhone);
       
 15892 
       
 15893  	//-------------------------------------------------------------------------
       
 15894 	// TEST E: Unsolicited completion of RMmCustomAPI::NotifyRauEvent
       
 15895 	// from LTSY.
       
 15896  	//-------------------------------------------------------------------------
       
 15897 
       
 15898 	RMmCustomAPI::TRauEventStatus completeStatus(RMmCustomAPI::ERauEventResumed);
       
 15899 	TPckg<RMmCustomAPI::TRauEventStatus> completePckg(completeStatus);
       
 15900 
       
 15901 	TRequestStatus mockLtsyStatus;
       
 15902 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
 15903 
       
 15904     iMockLTSY.CompleteL(ECustomNotifyRauEventIPC, KErrNone, completePckg);        	
       
 15905 
       
 15906 	User::WaitForRequest(mockLtsyStatus);
       
 15907 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
 15908 
       
 15909 	AssertMockLtsyStatusL();
       
 15910 	
       
 15911 	//-------------------------------------------------------------------------
       
 15912 	// TEST B: failure on completion of pending request from LTSY->CTSY
       
 15913  	//-------------------------------------------------------------------------
       
 15914 
       
 15915 	TRequestStatus requestStatus;
       
 15916 	RMmCustomAPI::TRauEventStatus status(RMmCustomAPI::ERauEventActive);
       
 15917 
       
 15918 	customAPI.NotifyRauEvent(requestStatus, status);
       
 15919 	
       
 15920     iMockLTSY.CompleteL(ECustomNotifyRauEventIPC, KErrGeneral, completePckg);        	
       
 15921 
       
 15922 	User::WaitForRequest(requestStatus);	
       
 15923 	ASSERT_EQUALS(KErrGeneral, requestStatus.Int());
       
 15924 
       
 15925 	AssertMockLtsyStatusL();
       
 15926 
       
 15927  	//-------------------------------------------------------------------------
       
 15928 	// TEST C: Successful completion request of
       
 15929 	// RMmCustomAPI::NotifyRauEvent when result is not cached.
       
 15930  	//-------------------------------------------------------------------------
       
 15931 
       
 15932 	customAPI.NotifyRauEvent(requestStatus, status);
       
 15933 	
       
 15934 	completeStatus = RMmCustomAPI::ERauEventResumed;
       
 15935 
       
 15936     iMockLTSY.CompleteL(ECustomNotifyRauEventIPC, KErrNone, completePckg);        	
       
 15937 
       
 15938 	User::WaitForRequest(requestStatus);	
       
 15939 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
 15940 	ASSERT_EQUALS(completeStatus, status);
       
 15941 
       
 15942 	AssertMockLtsyStatusL();
       
 15943 	CleanupStack::PopAndDestroy(2, this); 
       
 15944 	
       
 15945 	}
       
 15946 
       
 15947 
       
 15948 /**
       
 15949 @SYMTestCaseID BA-CTSY-CIPC-MCNRE-0002
       
 15950 @SYMComponent  telephony_ctsy
       
 15951 @SYMTestCaseDesc Test support in CTSY for cancelling of RMmCustomAPI::NotifyRauEvent
       
 15952 @SYMTestPriority High
       
 15953 @SYMTestActions Invokes cancelling of RMmCustomAPI::NotifyRauEvent
       
 15954 @SYMTestExpectedResults Pass
       
 15955 @SYMTestType CT
       
 15956 */
       
 15957 void CCTsyCustomIPCFU::TestNotifyRauEvent0002L()
       
 15958 	{
       
 15959 
       
 15960 	OpenEtelServerL(EUseExtendedError);
       
 15961 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
 15962 	OpenPhoneL();
       
 15963 
       
 15964 	RMmCustomAPI customAPI;
       
 15965 	OpenCustomAPILC(customAPI, iPhone);
       
 15966 
       
 15967 	TRequestStatus mockLtsyStatus;
       
 15968 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
 15969 
       
 15970  	//-------------------------------------------------------------------------
       
 15971 	// Test cancelling of RMmCustomAPI::NotifyRauEvent
       
 15972  	//-------------------------------------------------------------------------
       
 15973 
       
 15974 	TRequestStatus requestStatus;
       
 15975 	RMmCustomAPI::TRauEventStatus status;
       
 15976 
       
 15977 	customAPI.NotifyRauEvent(requestStatus, status);
       
 15978 	
       
 15979 	customAPI.CancelAsyncRequest(ECustomNotifyRauEventIPC);
       
 15980 	
       
 15981 	RMmCustomAPI::TRauEventStatus completeStatus(RMmCustomAPI::ERauEventActive);
       
 15982 	TPckg<RMmCustomAPI::TRauEventStatus> completePckg(completeStatus);
       
 15983 	
       
 15984     iMockLTSY.CompleteL(ECustomNotifyRauEventIPC, KErrNone, completePckg);        	
       
 15985 
       
 15986 	User::WaitForRequest(mockLtsyStatus);
       
 15987 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
 15988 
       
 15989 	User::WaitForRequest(requestStatus);	
       
 15990 	ASSERT_EQUALS(KErrCancel, requestStatus.Int());
       
 15991 
       
 15992 	AssertMockLtsyStatusL();
       
 15993 
       
 15994 	CleanupStack::PopAndDestroy(2); 
       
 15995 	
       
 15996 	}
       
 15997 
       
 15998 
       
 15999 
       
 16000 
       
 16001 /**
       
 16002 @SYMTestCaseID BA-CTSY-CIPC-MCNRE-0004
       
 16003 @SYMComponent  telephony_ctsy
       
 16004 @SYMTestCaseDesc Test support in CTSY for multiple client requests to RMmCustomAPI::NotifyRauEvent
       
 16005 @SYMTestPriority High
       
 16006 @SYMTestActions Invokes multiple client requests to RMmCustomAPI::NotifyRauEvent
       
 16007 @SYMTestExpectedResults Pass
       
 16008 @SYMTestType CT
       
 16009 */
       
 16010 void CCTsyCustomIPCFU::TestNotifyRauEvent0004L()
       
 16011 	{
       
 16012 
       
 16013 	OpenEtelServerL(EUseExtendedError);
       
 16014 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
 16015 	OpenPhoneL();
       
 16016 
       
 16017 	// Open second client
       
 16018 	RTelServer telServer2;
       
 16019 	TInt ret = telServer2.Connect();
       
 16020 	ASSERT_EQUALS(KErrNone, ret);
       
 16021 	CleanupClosePushL(telServer2);
       
 16022 
       
 16023 	RMobilePhone phone2;
       
 16024 	ret = phone2.Open(telServer2,KMmTsyPhoneName);
       
 16025 	ASSERT_EQUALS(KErrNone, ret);
       
 16026 	CleanupClosePushL(phone2);
       
 16027 
       
 16028 
       
 16029 	RMmCustomAPI customAPI;
       
 16030 	OpenCustomAPILC(customAPI, iPhone);
       
 16031 
       
 16032 	RMmCustomAPI customAPI2;
       
 16033 	OpenCustomAPILC(customAPI2, phone2, EFalse);
       
 16034 
       
 16035 	TRequestStatus requestStatus;
       
 16036 	TRequestStatus requestStatus2;
       
 16037 
       
 16038 	RMmCustomAPI::TRauEventStatus status(RMmCustomAPI::ERauEventActive);
       
 16039 	RMmCustomAPI::TRauEventStatus status2(RMmCustomAPI::ERauEventActive);
       
 16040 
       
 16041 	//-------------------------------------------------------------------------
       
 16042 	// Test A: Test multiple clients requesting RMmCustomAPI::NotifyRauEvent
       
 16043  	//-------------------------------------------------------------------------
       
 16044 
       
 16045 	customAPI.NotifyRauEvent(requestStatus, status);
       
 16046 	customAPI2.NotifyRauEvent(requestStatus2, status2);
       
 16047 
       
 16048 	RMmCustomAPI::TRauEventStatus completeStatus(RMmCustomAPI::ERauEventResumed);
       
 16049 	TPckg<RMmCustomAPI::TRauEventStatus> completePckg(completeStatus);
       
 16050 	
       
 16051     iMockLTSY.CompleteL(ECustomNotifyRauEventIPC, KErrNone, completePckg);        	
       
 16052     
       
 16053 	User::WaitForRequest(requestStatus);	
       
 16054 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
 16055 	ASSERT_EQUALS(completeStatus, status);
       
 16056 	
       
 16057 	User::WaitForRequest(requestStatus2);	
       
 16058 	ASSERT_EQUALS(KErrNone, requestStatus2.Int());
       
 16059 	ASSERT_EQUALS(completeStatus, status2);
       
 16060 
       
 16061 	AssertMockLtsyStatusL();
       
 16062 
       
 16063 	CleanupStack::PopAndDestroy(5, this); 
       
 16064 
       
 16065 	}
       
 16066 
       
 16067 
       
 16068 
       
 16069 /**
       
 16070 @SYMTestCaseID BA-CTSY-CIPC-MCRHS-0001
       
 16071 @SYMComponent  telephony_ctsy
       
 16072 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::ReadHSxPAStatus
       
 16073 @SYMTestPriority High
       
 16074 @SYMTestActions Invokes RMmCustomAPI::ReadHSxPAStatus
       
 16075 @SYMTestExpectedResults Pass
       
 16076 @SYMTestType CT
       
 16077 */
       
 16078 void CCTsyCustomIPCFU::TestReadHSxPAStatus0001L()
       
 16079 	{
       
 16080 	OpenEtelServerL(EUseExtendedError);
       
 16081 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
 16082 	OpenPhoneL();
       
 16083 
       
 16084 	RMmCustomAPI customAPI;
       
 16085 	OpenCustomAPILC(customAPI, iPhone);
       
 16086 
       
 16087 	TRequestStatus requestStatus;
       
 16088 	RMmCustomAPI::THSxPAStatus paStatus(RMmCustomAPI::EHSxPADisabled);
       
 16089 
       
 16090  	//-------------------------------------------------------------------------
       
 16091 	// TEST A: failure to dispatch request to LTSY
       
 16092  	//-------------------------------------------------------------------------
       
 16093 
       
 16094     iMockLTSY.ExpectL(ECustomReadHSxPAStatusIPC, KErrNotSupported);
       
 16095 
       
 16096 	customAPI.ReadHSxPAStatus(requestStatus, paStatus);
       
 16097 	
       
 16098 	User::WaitForRequest(requestStatus);	
       
 16099 	ASSERT_EQUALS(KErrNotSupported, requestStatus.Int());
       
 16100 
       
 16101 	AssertMockLtsyStatusL();
       
 16102 
       
 16103 	//-------------------------------------------------------------------------
       
 16104 	// TEST B: failure on completion of pending request from LTSY->CTSY
       
 16105  	//-------------------------------------------------------------------------
       
 16106 
       
 16107     iMockLTSY.ExpectL(ECustomReadHSxPAStatusIPC);
       
 16108 
       
 16109 	customAPI.ReadHSxPAStatus(requestStatus, paStatus);
       
 16110 
       
 16111 	RMmCustomAPI::THSxPAStatus paStatusComplete(RMmCustomAPI::EHSxPAEnabled);
       
 16112 	TPckg<RMmCustomAPI::THSxPAStatus> paStatusCompletePckg(paStatusComplete);
       
 16113 	
       
 16114     iMockLTSY.CompleteL(ECustomReadHSxPAStatusIPC, KErrGeneral, paStatusCompletePckg);        	
       
 16115 
       
 16116 	User::WaitForRequest(requestStatus);	
       
 16117 	ASSERT_EQUALS(KErrGeneral, requestStatus.Int());
       
 16118 
       
 16119 	AssertMockLtsyStatusL();
       
 16120 
       
 16121  	//-------------------------------------------------------------------------
       
 16122 	// TEST C: Successful completion request of
       
 16123 	// RMmCustomAPI::ReadHSxPAStatus when result is not cached.
       
 16124  	//-------------------------------------------------------------------------
       
 16125 
       
 16126     iMockLTSY.ExpectL(ECustomReadHSxPAStatusIPC);
       
 16127 
       
 16128 	customAPI.ReadHSxPAStatus(requestStatus, paStatus);
       
 16129 
       
 16130     iMockLTSY.CompleteL(ECustomReadHSxPAStatusIPC, KErrNone, paStatusCompletePckg);        	
       
 16131 
       
 16132 	User::WaitForRequest(requestStatus);	
       
 16133 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
 16134 	ASSERT_EQUALS(paStatusComplete, paStatus);
       
 16135 
       
 16136 	AssertMockLtsyStatusL();
       
 16137 
       
 16138  	//-------------------------------------------------------------------------
       
 16139 	// TEST C2: read another value
       
 16140  	//-------------------------------------------------------------------------
       
 16141 
       
 16142     iMockLTSY.ExpectL(ECustomReadHSxPAStatusIPC);
       
 16143 
       
 16144 	customAPI.ReadHSxPAStatus(requestStatus, paStatus);
       
 16145 
       
 16146 	paStatusComplete = RMmCustomAPI::EHSxPADisabled;
       
 16147 
       
 16148     iMockLTSY.CompleteL(ECustomReadHSxPAStatusIPC, KErrNone, paStatusCompletePckg);        	
       
 16149 
       
 16150 	User::WaitForRequest(requestStatus);	
       
 16151 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
 16152 	ASSERT_EQUALS(paStatusComplete, paStatus);
       
 16153 
       
 16154 	AssertMockLtsyStatusL();
       
 16155 	
       
 16156  	//-------------------------------------------------------------------------
       
 16157 	// TEST E: Unsolicited completion of RMmCustomAPI::ReadHSxPAStatus
       
 16158 	// from LTSY.
       
 16159  	//-------------------------------------------------------------------------
       
 16160 
       
 16161 	TRequestStatus mockLtsyStatus;
       
 16162 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
 16163 
       
 16164     iMockLTSY.CompleteL(ECustomReadHSxPAStatusIPC, KErrNone, paStatusCompletePckg);        	
       
 16165 
       
 16166 	User::WaitForRequest(mockLtsyStatus);
       
 16167 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
 16168 
       
 16169 	AssertMockLtsyStatusL();
       
 16170 	
       
 16171 	
       
 16172 	CleanupStack::PopAndDestroy(2, this); 
       
 16173 	
       
 16174 	}
       
 16175 
       
 16176 
       
 16177 /**
       
 16178 @SYMTestCaseID BA-CTSY-CIPC-MCRHS-0002
       
 16179 @SYMComponent  telephony_ctsy
       
 16180 @SYMTestCaseDesc Test support in CTSY for cancelling of RMmCustomAPI::ReadHSxPAStatus
       
 16181 @SYMTestPriority High
       
 16182 @SYMTestActions Invokes cancelling of RMmCustomAPI::ReadHSxPAStatus
       
 16183 @SYMTestExpectedResults Pass
       
 16184 @SYMTestType CT
       
 16185 */
       
 16186 void CCTsyCustomIPCFU::TestReadHSxPAStatus0002L()
       
 16187 	{
       
 16188 
       
 16189 	OpenEtelServerL(EUseExtendedError);
       
 16190 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
 16191 	OpenPhoneL();
       
 16192 
       
 16193 	RMmCustomAPI customAPI;
       
 16194 	OpenCustomAPILC(customAPI, iPhone);
       
 16195 
       
 16196 	TRequestStatus requestStatus;
       
 16197 	RMmCustomAPI::THSxPAStatus paStatus;
       
 16198 
       
 16199 	TRequestStatus mockLtsyStatus;
       
 16200 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
 16201 
       
 16202  	//-------------------------------------------------------------------------
       
 16203 	// Test cancelling of RMmCustomAPI::ReadHSxPAStatus
       
 16204  	//-------------------------------------------------------------------------
       
 16205 
       
 16206     iMockLTSY.ExpectL(ECustomReadHSxPAStatusIPC);
       
 16207 
       
 16208 	customAPI.ReadHSxPAStatus(requestStatus, paStatus);
       
 16209 	
       
 16210 	customAPI.CancelAsyncRequest(ECustomReadHSxPAStatusIPC);
       
 16211 
       
 16212 	RMmCustomAPI::THSxPAStatus paStatusComplete(RMmCustomAPI::EHSxPAEnabled);
       
 16213 	TPckg<RMmCustomAPI::THSxPAStatus> paStatusCompletePckg(paStatusComplete);
       
 16214 	
       
 16215     iMockLTSY.CompleteL(ECustomReadHSxPAStatusIPC, KErrNone, paStatusCompletePckg);        	
       
 16216  	
       
 16217 	User::WaitForRequest(mockLtsyStatus);
       
 16218 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
 16219 	
       
 16220 	User::WaitForRequest(requestStatus);	
       
 16221 	ASSERT_EQUALS(KErrCancel, requestStatus.Int());
       
 16222 	
       
 16223 	CleanupStack::PopAndDestroy(2);
       
 16224 		
       
 16225 	}
       
 16226 
       
 16227 
       
 16228 
       
 16229 
       
 16230 /**
       
 16231 @SYMTestCaseID BA-CTSY-CIPC-MCRHS-0004
       
 16232 @SYMComponent  telephony_ctsy
       
 16233 @SYMTestCaseDesc Test support in CTSY for multiple client requests to RMmCustomAPI::ReadHSxPAStatus
       
 16234 @SYMTestPriority High
       
 16235 @SYMTestActions Invokes multiple client requests to RMmCustomAPI::ReadHSxPAStatus
       
 16236 @SYMTestExpectedResults Pass
       
 16237 @SYMTestType CT
       
 16238 */
       
 16239 void CCTsyCustomIPCFU::TestReadHSxPAStatus0004L()
       
 16240 	{
       
 16241 
       
 16242 	OpenEtelServerL(EUseExtendedError);
       
 16243 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
 16244 	OpenPhoneL();
       
 16245 
       
 16246 	RTelServer telServer2;
       
 16247 	TInt ret = telServer2.Connect();
       
 16248 	ASSERT_EQUALS(KErrNone, ret);
       
 16249 	CleanupClosePushL(telServer2);
       
 16250 
       
 16251 	RMobilePhone phone2;
       
 16252 	ret = phone2.Open(telServer2,KMmTsyPhoneName);
       
 16253 	ASSERT_EQUALS(KErrNone, ret);
       
 16254 	CleanupClosePushL(phone2);
       
 16255 
       
 16256 
       
 16257 	RMmCustomAPI customAPI;
       
 16258 	OpenCustomAPILC(customAPI, iPhone);
       
 16259 
       
 16260 	RMmCustomAPI customAPI2;
       
 16261 	OpenCustomAPILC(customAPI2, phone2, EFalse);
       
 16262 
       
 16263 	TRequestStatus requestStatus;
       
 16264 	TRequestStatus requestStatus2;
       
 16265 
       
 16266 	RMmCustomAPI::THSxPAStatus paStatus;
       
 16267 	RMmCustomAPI::THSxPAStatus paStatus2;
       
 16268 
       
 16269 	//-------------------------------------------------------------------------
       
 16270 	// Test A: Test multiple clients requesting RMmCustomAPI::ReadHSxPAStatus
       
 16271  	//-------------------------------------------------------------------------
       
 16272 
       
 16273     iMockLTSY.ExpectL(ECustomReadHSxPAStatusIPC);
       
 16274     
       
 16275 	customAPI.ReadHSxPAStatus(requestStatus, paStatus);
       
 16276 	customAPI2.ReadHSxPAStatus(requestStatus2, paStatus2);
       
 16277 
       
 16278 	RMmCustomAPI::THSxPAStatus paStatusComplete(RMmCustomAPI::EHSxPAEnabled);
       
 16279 	TPckg<RMmCustomAPI::THSxPAStatus> paStatusCompletePckg(paStatusComplete);
       
 16280 	
       
 16281     iMockLTSY.CompleteL(ECustomReadHSxPAStatusIPC, KErrNone, paStatusCompletePckg);        	
       
 16282 
       
 16283 	User::WaitForRequest(requestStatus);	
       
 16284 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
 16285 	ASSERT_EQUALS(paStatusComplete, paStatus);
       
 16286 
       
 16287 	User::WaitForRequest(requestStatus2);	
       
 16288 	ASSERT_EQUALS(KErrServerBusy, requestStatus2.Int());
       
 16289 
       
 16290 	AssertMockLtsyStatusL();
       
 16291 
       
 16292 	CleanupStack::PopAndDestroy(5, this); 
       
 16293 
       
 16294 	}
       
 16295 
       
 16296 
       
 16297 /**
       
 16298 @SYMTestCaseID BA-CTSY-CIPC-MCRHS-0005
       
 16299 @SYMComponent  telephony_ctsy
       
 16300 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::ReadHSxPAStatus with timeout
       
 16301 @SYMTestPriority High
       
 16302 @SYMTestActions Invokes RMmCustomAPI::ReadHSxPAStatus and tests for timeout
       
 16303 @SYMTestExpectedResults Pass
       
 16304 @SYMTestType CT
       
 16305 */
       
 16306 void CCTsyCustomIPCFU::TestReadHSxPAStatus0005L()
       
 16307 	{
       
 16308 
       
 16309 	OpenEtelServerL(EUseExtendedError);
       
 16310 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
 16311 	OpenPhoneL();
       
 16312 
       
 16313 	RMmCustomAPI customAPI;
       
 16314 	OpenCustomAPILC(customAPI, iPhone);
       
 16315 
       
 16316 	TRequestStatus requestStatus;
       
 16317 	RMmCustomAPI::THSxPAStatus paStatus;
       
 16318 
       
 16319     iMockLTSY.ExpectL(ECustomReadHSxPAStatusIPC);
       
 16320 
       
 16321 	customAPI.ReadHSxPAStatus(requestStatus, paStatus);
       
 16322 	 	
       
 16323 	User::WaitForRequest(requestStatus);	
       
 16324 	ASSERT_EQUALS(KErrTimedOut, requestStatus.Int());
       
 16325 	
       
 16326 	CleanupStack::PopAndDestroy(2);
       
 16327 
       
 16328 	}
       
 16329 
       
 16330 
       
 16331 /**
       
 16332 @SYMTestCaseID BA-CTSY-CIPC-MCWHS-0001
       
 16333 @SYMComponent  telephony_ctsy
       
 16334 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::WriteHSxPAStatus
       
 16335 @SYMTestPriority High
       
 16336 @SYMTestActions Invokes RMmCustomAPI::WriteHSxPAStatus
       
 16337 @SYMTestExpectedResults Pass
       
 16338 @SYMTestType CT
       
 16339 */
       
 16340 void CCTsyCustomIPCFU::TestWriteHSxPAStatus0001L()
       
 16341 	{
       
 16342 	OpenEtelServerL(EUseExtendedError);
       
 16343 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
 16344 	OpenPhoneL();
       
 16345 
       
 16346 
       
 16347 	RMmCustomAPI customAPI;
       
 16348 	OpenCustomAPILC(customAPI, iPhone);
       
 16349 
       
 16350 	RBuf8 data;
       
 16351 	CleanupClosePushL(data);
       
 16352 
       
 16353 	TRequestStatus requestStatus;
       
 16354 	RMmCustomAPI::THSxPAStatus paStatus(RMmCustomAPI::EHSxPADisabled);
       
 16355 
       
 16356    	TMockLtsyData1< RMmCustomAPI::THSxPAStatus > tsyData(paStatus);
       
 16357    	tsyData.SerialiseL(data);
       
 16358 
       
 16359  	//-------------------------------------------------------------------------
       
 16360 	// TEST A: failure to dispatch request to LTSY
       
 16361  	//-------------------------------------------------------------------------
       
 16362 
       
 16363     iMockLTSY.ExpectL(ECustomWriteHSxPAStatusIPC, data, KErrNotSupported);
       
 16364 
       
 16365 	customAPI.WriteHSxPAStatus(requestStatus, paStatus);
       
 16366 	
       
 16367 	User::WaitForRequest(requestStatus);	
       
 16368 	ASSERT_EQUALS(KErrNotSupported, requestStatus.Int());
       
 16369 
       
 16370 	AssertMockLtsyStatusL();
       
 16371 
       
 16372 	//-------------------------------------------------------------------------
       
 16373 	// TEST B: failure on completion of pending request from LTSY->CTSY
       
 16374  	//-------------------------------------------------------------------------
       
 16375 
       
 16376     iMockLTSY.ExpectL(ECustomWriteHSxPAStatusIPC, data);
       
 16377 
       
 16378 	customAPI.WriteHSxPAStatus(requestStatus, paStatus);
       
 16379 	
       
 16380     iMockLTSY.CompleteL(ECustomWriteHSxPAStatusIPC, KErrGeneral);        	
       
 16381 
       
 16382 	User::WaitForRequest(requestStatus);	
       
 16383 	ASSERT_EQUALS(KErrGeneral, requestStatus.Int());
       
 16384 
       
 16385 	AssertMockLtsyStatusL();
       
 16386 
       
 16387  	//-------------------------------------------------------------------------
       
 16388 	// TEST C: Successful completion request of
       
 16389 	// RMmCustomAPI::WriteHSxPAStatus when result is not cached.
       
 16390  	//-------------------------------------------------------------------------
       
 16391 
       
 16392     iMockLTSY.ExpectL(ECustomWriteHSxPAStatusIPC, data);        	
       
 16393 
       
 16394 	customAPI.WriteHSxPAStatus(requestStatus, paStatus);
       
 16395 	
       
 16396     iMockLTSY.CompleteL(ECustomWriteHSxPAStatusIPC, KErrNone);        	
       
 16397 
       
 16398 	User::WaitForRequest(requestStatus);	
       
 16399 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
 16400 
       
 16401 	AssertMockLtsyStatusL();
       
 16402 	
       
 16403  	//-------------------------------------------------------------------------
       
 16404 	// TEST E: Unsolicited completion of RMmCustomAPI::WriteHSxPAStatus
       
 16405 	// from LTSY.
       
 16406  	//-------------------------------------------------------------------------
       
 16407 
       
 16408 	TRequestStatus mockLtsyStatus;
       
 16409 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
 16410 
       
 16411     iMockLTSY.CompleteL(ECustomWriteHSxPAStatusIPC, KErrNone);        	
       
 16412 
       
 16413 	User::WaitForRequest(mockLtsyStatus);
       
 16414 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
 16415 
       
 16416 	AssertMockLtsyStatusL();
       
 16417 	
       
 16418 	
       
 16419 	CleanupStack::PopAndDestroy(3, this); 
       
 16420 	
       
 16421 	}
       
 16422 
       
 16423 
       
 16424 /**
       
 16425 @SYMTestCaseID BA-CTSY-CIPC-MCWHS-0002
       
 16426 @SYMComponent  telephony_ctsy
       
 16427 @SYMTestCaseDesc Test support in CTSY for cancelling of RMmCustomAPI::WriteHSxPAStatus
       
 16428 @SYMTestPriority High
       
 16429 @SYMTestActions Invokes cancelling of RMmCustomAPI::WriteHSxPAStatus
       
 16430 @SYMTestExpectedResults Pass
       
 16431 @SYMTestType CT
       
 16432 */
       
 16433 void CCTsyCustomIPCFU::TestWriteHSxPAStatus0002L()
       
 16434 	{
       
 16435 
       
 16436 	OpenEtelServerL(EUseExtendedError);
       
 16437 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
 16438 	OpenPhoneL();
       
 16439 
       
 16440 	RMmCustomAPI customAPI;
       
 16441 	OpenCustomAPILC(customAPI, iPhone);
       
 16442 
       
 16443 	RBuf8 data;
       
 16444 	CleanupClosePushL(data);
       
 16445 
       
 16446 	TRequestStatus requestStatus;
       
 16447 	RMmCustomAPI::THSxPAStatus paStatus(RMmCustomAPI::EHSxPADisabled);
       
 16448 
       
 16449    	TMockLtsyData1< RMmCustomAPI::THSxPAStatus > tsyData(paStatus);
       
 16450    	tsyData.SerialiseL(data);
       
 16451 
       
 16452 
       
 16453 	TRequestStatus mockLtsyStatus;
       
 16454 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
 16455 
       
 16456  	//-------------------------------------------------------------------------
       
 16457 	// Test cancelling of RMmCustomAPI::WriteHSxPAStatus
       
 16458  	//-------------------------------------------------------------------------
       
 16459     iMockLTSY.ExpectL(ECustomWriteHSxPAStatusIPC, data);        	
       
 16460 
       
 16461 	customAPI.WriteHSxPAStatus(requestStatus, paStatus);
       
 16462 	
       
 16463 	customAPI.CancelAsyncRequest(ECustomWriteHSxPAStatusIPC);
       
 16464 	
       
 16465     iMockLTSY.CompleteL(ECustomWriteHSxPAStatusIPC, KErrNone);        	
       
 16466 
       
 16467 	User::WaitForRequest(requestStatus);	
       
 16468 	ASSERT_EQUALS(KErrCancel, requestStatus.Int());
       
 16469 
       
 16470 	User::WaitForRequest(mockLtsyStatus);
       
 16471 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
 16472  	
       
 16473 	CleanupStack::PopAndDestroy(3);
       
 16474 	
       
 16475 	}
       
 16476 
       
 16477 
       
 16478 
       
 16479 /**
       
 16480 @SYMTestCaseID BA-CTSY-CIPC-MCWHS-0004
       
 16481 @SYMComponent  telephony_ctsy
       
 16482 @SYMTestCaseDesc Test support in CTSY for multiple client requests to RMmCustomAPI::WriteHSxPAStatus
       
 16483 @SYMTestPriority High
       
 16484 @SYMTestActions Invokes multiple client requests to RMmCustomAPI::WriteHSxPAStatus
       
 16485 @SYMTestExpectedResults Pass
       
 16486 @SYMTestType CT
       
 16487 */
       
 16488 void CCTsyCustomIPCFU::TestWriteHSxPAStatus0004L()
       
 16489 	{
       
 16490 					
       
 16491 	OpenEtelServerL(EUseExtendedError);
       
 16492 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
 16493 	OpenPhoneL();
       
 16494 
       
 16495 	// Open second client
       
 16496 	RTelServer telServer2;
       
 16497 	TInt ret = telServer2.Connect();
       
 16498 	ASSERT_EQUALS(KErrNone, ret);
       
 16499 	CleanupClosePushL(telServer2);
       
 16500 
       
 16501 	RMobilePhone phone2;
       
 16502 	ret = phone2.Open(telServer2,KMmTsyPhoneName);
       
 16503 	ASSERT_EQUALS(KErrNone, ret);
       
 16504 	CleanupClosePushL(phone2);
       
 16505 
       
 16506 	RBuf8 data;
       
 16507 	CleanupClosePushL(data);
       
 16508 
       
 16509 
       
 16510 	RMmCustomAPI customAPI;
       
 16511 	OpenCustomAPILC(customAPI, iPhone);
       
 16512 
       
 16513 	RMmCustomAPI customAPI2;
       
 16514 	CleanupClosePushL(customAPI2);
       
 16515 	customAPI2.Open(phone2);	
       
 16516 
       
 16517 	TRequestStatus requestStatus;
       
 16518 	TRequestStatus requestStatus2;
       
 16519 
       
 16520 	RMmCustomAPI::THSxPAStatus paStatus(RMmCustomAPI::EHSxPADisabled);
       
 16521 
       
 16522    	TMockLtsyData1< RMmCustomAPI::THSxPAStatus > tsyData(paStatus);
       
 16523    	tsyData.SerialiseL(data);
       
 16524 
       
 16525 	RMmCustomAPI::THSxPAStatus paStatus2(RMmCustomAPI::EHSxPAEnabled);
       
 16526 
       
 16527 	//-------------------------------------------------------------------------
       
 16528 	// Test A: Test multiple clients requesting RMmCustomAPI::WriteHSxPAStatus
       
 16529  	//-------------------------------------------------------------------------
       
 16530 	
       
 16531     iMockLTSY.ExpectL(ECustomWriteHSxPAStatusIPC, data);        	
       
 16532 
       
 16533 	customAPI.WriteHSxPAStatus(requestStatus, paStatus);
       
 16534 	customAPI2.WriteHSxPAStatus(requestStatus2, paStatus2);
       
 16535 	
       
 16536     iMockLTSY.CompleteL(ECustomWriteHSxPAStatusIPC, KErrNone);        	
       
 16537 
       
 16538 	User::WaitForRequest(requestStatus);	
       
 16539 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
 16540 
       
 16541 	User::WaitForRequest(requestStatus2);	
       
 16542 	ASSERT_EQUALS(KErrServerBusy, requestStatus2.Int());
       
 16543 
       
 16544 	AssertMockLtsyStatusL();
       
 16545 
       
 16546 	CleanupStack::PopAndDestroy(6, this); 
       
 16547 
       
 16548 	}
       
 16549 
       
 16550 
       
 16551 /**
       
 16552 @SYMTestCaseID BA-CTSY-CIPC-MCWHS-0005
       
 16553 @SYMComponent  telephony_ctsy
       
 16554 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::WriteHSxPAStatus with timeout
       
 16555 @SYMTestPriority High
       
 16556 @SYMTestActions Invokes RMmCustomAPI::WriteHSxPAStatus and tests for timeout
       
 16557 @SYMTestExpectedResults Pass
       
 16558 @SYMTestType CT
       
 16559 */
       
 16560 void CCTsyCustomIPCFU::TestWriteHSxPAStatus0005L()
       
 16561 	{
       
 16562 
       
 16563 	OpenEtelServerL(EUseExtendedError);
       
 16564 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
 16565 	OpenPhoneL();
       
 16566 
       
 16567 	RMmCustomAPI customAPI;
       
 16568 	OpenCustomAPILC(customAPI, iPhone);
       
 16569 
       
 16570 	RBuf8 data;
       
 16571 	CleanupClosePushL(data);
       
 16572 
       
 16573 	TRequestStatus requestStatus;
       
 16574 	RMmCustomAPI::THSxPAStatus paStatus(RMmCustomAPI::EHSxPADisabled);
       
 16575 
       
 16576    	TMockLtsyData1< RMmCustomAPI::THSxPAStatus > tsyData(paStatus);
       
 16577    	tsyData.SerialiseL(data);
       
 16578 
       
 16579     iMockLTSY.ExpectL(ECustomWriteHSxPAStatusIPC, data);        	
       
 16580 
       
 16581 	customAPI.WriteHSxPAStatus(requestStatus, paStatus);
       
 16582 	
       
 16583 	User::WaitForRequest(requestStatus);	
       
 16584 	ASSERT_EQUALS(KErrTimedOut, requestStatus.Int());
       
 16585 
       
 16586 	AssertMockLtsyStatusL();
       
 16587  	
       
 16588 	CleanupStack::PopAndDestroy(3);
       
 16589 	
       
 16590 
       
 16591 	}
       
 16592 
       
 16593 
       
 16594 /**
       
 16595 @SYMTestCaseID BA-CTSY-CIPC-MCNHS-0001
       
 16596 @SYMComponent  telephony_ctsy
       
 16597 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::NotifyHSxPAStatus
       
 16598 @SYMTestPriority High
       
 16599 @SYMTestActions Invokes RMmCustomAPI::NotifyHSxPAStatus
       
 16600 @SYMTestExpectedResults Pass
       
 16601 @SYMTestType CT
       
 16602 */
       
 16603 void CCTsyCustomIPCFU::TestNotifyHSxPAStatus0001L()
       
 16604 	{
       
 16605 
       
 16606 	OpenEtelServerL(EUseExtendedError);
       
 16607 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
 16608 	OpenPhoneL();
       
 16609 
       
 16610 
       
 16611 	RMmCustomAPI customAPI;
       
 16612 	OpenCustomAPILC(customAPI, iPhone);
       
 16613 
       
 16614  	//-------------------------------------------------------------------------
       
 16615 	// TEST E: Unsolicited completion of RMmCustomAPI::NotifyHSxPAStatus
       
 16616 	// from LTSY.
       
 16617  	//-------------------------------------------------------------------------
       
 16618 
       
 16619 	RMmCustomAPI::THSxPAStatus paCompleteStatus(RMmCustomAPI::EHSxPAEnabled);
       
 16620 	TPckg<RMmCustomAPI::THSxPAStatus> completePckg(paCompleteStatus);
       
 16621 
       
 16622 	TRequestStatus mockLtsyStatus;
       
 16623 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
 16624 
       
 16625     iMockLTSY.CompleteL(ECustomNotifyHSxPAStatusIPC, KErrNone, completePckg);        	
       
 16626 
       
 16627 	User::WaitForRequest(mockLtsyStatus);
       
 16628 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
 16629 
       
 16630 	AssertMockLtsyStatusL();
       
 16631 	
       
 16632 	//-------------------------------------------------------------------------
       
 16633 	// TEST B: failure on completion of pending request from LTSY->CTSY
       
 16634  	//-------------------------------------------------------------------------
       
 16635 
       
 16636 	TRequestStatus requestStatus;
       
 16637 	RMmCustomAPI::THSxPAStatus paStatus(RMmCustomAPI::EHSxPADisabled);
       
 16638 
       
 16639 	customAPI.NotifyHSxPAStatus(requestStatus, paStatus);
       
 16640 	
       
 16641     iMockLTSY.CompleteL(ECustomNotifyHSxPAStatusIPC, KErrGeneral, completePckg);        	
       
 16642 
       
 16643 	User::WaitForRequest(requestStatus);	
       
 16644 	ASSERT_EQUALS(KErrGeneral, requestStatus.Int());
       
 16645 
       
 16646 	AssertMockLtsyStatusL();
       
 16647 
       
 16648  	//-------------------------------------------------------------------------
       
 16649 	// TEST C: Successful completion request of
       
 16650 	// RMmCustomAPI::NotifyHSxPAStatus when result is not cached.
       
 16651  	//-------------------------------------------------------------------------
       
 16652 
       
 16653 	customAPI.NotifyHSxPAStatus(requestStatus, paStatus);
       
 16654 	
       
 16655 	paCompleteStatus = RMmCustomAPI::EHSxPAEnabled;
       
 16656 
       
 16657     iMockLTSY.CompleteL(ECustomNotifyHSxPAStatusIPC, KErrNone, completePckg);        	
       
 16658 
       
 16659 	User::WaitForRequest(requestStatus);	
       
 16660 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
 16661 	ASSERT_EQUALS(paCompleteStatus, paStatus);
       
 16662 
       
 16663 	AssertMockLtsyStatusL();
       
 16664 	CleanupStack::PopAndDestroy(2, this); 
       
 16665 	
       
 16666 	}
       
 16667 
       
 16668 
       
 16669 /**
       
 16670 @SYMTestCaseID BA-CTSY-CIPC-MCNHS-0002
       
 16671 @SYMComponent  telephony_ctsy
       
 16672 @SYMTestCaseDesc Test support in CTSY for cancelling of RMmCustomAPI::NotifyHSxPAStatus
       
 16673 @SYMTestPriority High
       
 16674 @SYMTestActions Invokes cancelling of RMmCustomAPI::NotifyHSxPAStatus
       
 16675 @SYMTestExpectedResults Pass
       
 16676 @SYMTestType CT
       
 16677 */
       
 16678 void CCTsyCustomIPCFU::TestNotifyHSxPAStatus0002L()
       
 16679 	{
       
 16680 
       
 16681 	OpenEtelServerL(EUseExtendedError);
       
 16682 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
 16683 	OpenPhoneL();
       
 16684 
       
 16685 	RMmCustomAPI customAPI;
       
 16686 	OpenCustomAPILC(customAPI, iPhone);
       
 16687 
       
 16688 	TRequestStatus mockLtsyStatus;
       
 16689 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
 16690 
       
 16691  	//-------------------------------------------------------------------------
       
 16692 	// Test cancelling of RMmCustomAPI::NotifyHSxPAStatus
       
 16693  	//-------------------------------------------------------------------------
       
 16694 
       
 16695 	TRequestStatus requestStatus;
       
 16696 	RMmCustomAPI::THSxPAStatus paStatus;
       
 16697 
       
 16698 	customAPI.NotifyHSxPAStatus(requestStatus, paStatus);
       
 16699 	
       
 16700 	customAPI.CancelAsyncRequest(ECustomNotifyHSxPAStatusIPC);
       
 16701 	
       
 16702 	RMmCustomAPI::THSxPAStatus paCompleteStatus(RMmCustomAPI::EHSxPADisabled);
       
 16703 	TPckg<RMmCustomAPI::THSxPAStatus> completePckg(paCompleteStatus);
       
 16704 	
       
 16705     iMockLTSY.CompleteL(ECustomNotifyHSxPAStatusIPC, KErrNone, completePckg);        	
       
 16706 
       
 16707 	User::WaitForRequest(mockLtsyStatus);
       
 16708 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
 16709 
       
 16710 	User::WaitForRequest(requestStatus);	
       
 16711 	ASSERT_EQUALS(KErrCancel, requestStatus.Int());
       
 16712 
       
 16713 	AssertMockLtsyStatusL();
       
 16714 
       
 16715 	CleanupStack::PopAndDestroy(2); 
       
 16716 	
       
 16717 	}
       
 16718 
       
 16719 
       
 16720 
       
 16721 
       
 16722 /**
       
 16723 @SYMTestCaseID BA-CTSY-CIPC-MCNHS-0004
       
 16724 @SYMComponent  telephony_ctsy
       
 16725 @SYMTestCaseDesc Test support in CTSY for multiple client requests to RMmCustomAPI::NotifyHSxPAStatus
       
 16726 @SYMTestPriority High
       
 16727 @SYMTestActions Invokes multiple client requests to RMmCustomAPI::NotifyHSxPAStatus
       
 16728 @SYMTestExpectedResults Pass
       
 16729 @SYMTestType CT
       
 16730 */
       
 16731 void CCTsyCustomIPCFU::TestNotifyHSxPAStatus0004L()
       
 16732 	{
       
 16733 
       
 16734 	OpenEtelServerL(EUseExtendedError);
       
 16735 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
 16736 	OpenPhoneL();
       
 16737 
       
 16738 	// Open second client
       
 16739 	RTelServer telServer2;
       
 16740 	TInt ret = telServer2.Connect();
       
 16741 	ASSERT_EQUALS(KErrNone, ret);
       
 16742 	CleanupClosePushL(telServer2);
       
 16743 
       
 16744 	RMobilePhone phone2;
       
 16745 	ret = phone2.Open(telServer2,KMmTsyPhoneName);
       
 16746 	ASSERT_EQUALS(KErrNone, ret);
       
 16747 	CleanupClosePushL(phone2);
       
 16748 
       
 16749 
       
 16750 	RMmCustomAPI customAPI;
       
 16751 	OpenCustomAPILC(customAPI, iPhone);
       
 16752 
       
 16753 	RMmCustomAPI customAPI2;
       
 16754 	CleanupClosePushL(customAPI2);
       
 16755 	customAPI2.Open(phone2);	
       
 16756 
       
 16757 	TRequestStatus requestStatus;
       
 16758 	TRequestStatus requestStatus2;
       
 16759 
       
 16760 	RMmCustomAPI::THSxPAStatus paStatus(RMmCustomAPI::EHSxPADisabled);
       
 16761 	RMmCustomAPI::THSxPAStatus paStatus2(RMmCustomAPI::EHSxPADisabled);
       
 16762 
       
 16763 	//-------------------------------------------------------------------------
       
 16764 	// Test A: Test multiple clients requesting RMmCustomAPI::NotifyHSxPAStatus
       
 16765  	//-------------------------------------------------------------------------
       
 16766 
       
 16767 	customAPI.NotifyHSxPAStatus(requestStatus, paStatus);
       
 16768 	customAPI2.NotifyHSxPAStatus(requestStatus2, paStatus2);
       
 16769 
       
 16770 	RMmCustomAPI::THSxPAStatus paCompleteStatus(RMmCustomAPI::EHSxPAEnabled);
       
 16771 	TPckg<RMmCustomAPI::THSxPAStatus> completePckg(paCompleteStatus);
       
 16772 	
       
 16773     iMockLTSY.CompleteL(ECustomNotifyHSxPAStatusIPC, KErrNone, completePckg);        	
       
 16774     
       
 16775 	User::WaitForRequest(requestStatus);	
       
 16776 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
 16777 	ASSERT_EQUALS(paCompleteStatus, paStatus);
       
 16778 	
       
 16779 	User::WaitForRequest(requestStatus2);	
       
 16780 	ASSERT_EQUALS(KErrNone, requestStatus2.Int());
       
 16781 	ASSERT_EQUALS(paCompleteStatus, paStatus2);
       
 16782 
       
 16783 	AssertMockLtsyStatusL();
       
 16784 
       
 16785 	CleanupStack::PopAndDestroy(5, this); 
       
 16786 
       
 16787 	}
       
 16788 
       
 16789 /**
       
 16790 @SYMTestCaseID BA-CTSY-CIPC-MCGICFIS-0001
       
 16791 @SYMComponent  telephony_ctsy
       
 16792 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::GetIccCallForwardingIndicatorStatus
       
 16793 @SYMTestPriority High
       
 16794 @SYMTestActions Invokes RMmCustomAPI::GetIccCallForwardingIndicatorStatus
       
 16795 @SYMTestExpectedResults Pass
       
 16796 @SYMTestType CT
       
 16797 */
       
 16798 void CCTsyCustomIPCFU::TestGetIccCallForwardingIndicatorStatus0001L()
       
 16799 	{
       
 16800 
       
 16801 	OpenEtelServerL(EUseExtendedError);
       
 16802 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
 16803 	OpenPhoneL();
       
 16804 
       
 16805 	RMmCustomAPI customAPI;
       
 16806 	OpenCustomAPILC(customAPI, iPhone);
       
 16807 
       
 16808 	TRequestStatus requestStatus;
       
 16809 
       
 16810 	RMmCustomAPI::TCFIndicators indi;
       
 16811 	RMmCustomAPI::TCFIndicatorsPckg indiPckg(indi);	
       
 16812 	
       
 16813 	//-------------------------------------------------------------------------
       
 16814 	// TEST B: failure on completion of pending request from LTSY->CTSY
       
 16815  	//-------------------------------------------------------------------------
       
 16816 
       
 16817 	iMockLTSY.ExpectL(ECustomGetIccCallForwardingStatusIPC);    
       
 16818 
       
 16819 	customAPI.GetIccCallForwardingIndicatorStatus(requestStatus, indiPckg);
       
 16820 
       
 16821 	RMmCustomAPI::TCFIndicators indiComplete;
       
 16822 	RMmCustomAPI::TCFIndicatorsPckg indiCompletePckg(indiComplete);	
       
 16823 
       
 16824 	_LIT(KNumber, "123456789");
       
 16825     indiComplete.iIndicator = 0xFF;
       
 16826     indiComplete.iCFNumber.iTypeOfNumber = RMobilePhone::EInternationalNumber;    
       
 16827     indiComplete.iCFNumber.iNumberPlan = RMobilePhone::EIsdnNumberPlan;
       
 16828     indiComplete.iCFNumber.iTelNumber = KNumber;
       
 16829 
       
 16830     iMockLTSY.CompleteL(ECustomGetIccCallForwardingStatusIPC, KErrGeneral, indiCompletePckg);        	
       
 16831 
       
 16832 	User::WaitForRequest(requestStatus);	
       
 16833 	ASSERT_EQUALS(KErrGeneral, requestStatus.Int());
       
 16834 	
       
 16835 	AssertMockLtsyStatusL();
       
 16836 
       
 16837  	//-------------------------------------------------------------------------
       
 16838 	// TEST C: Successful completion request of
       
 16839 	// RMmCustomAPI::GetIccCallForwardingIndicatorStatus when result is not cached.
       
 16840  	//-------------------------------------------------------------------------
       
 16841 
       
 16842 	iMockLTSY.ExpectL(ECustomGetIccCallForwardingStatusIPC);    
       
 16843 
       
 16844 	customAPI.GetIccCallForwardingIndicatorStatus(requestStatus, indiPckg);
       
 16845 
       
 16846     iMockLTSY.CompleteL(ECustomGetIccCallForwardingStatusIPC, KErrNone, indiCompletePckg);        	
       
 16847 
       
 16848 	User::WaitForRequest(requestStatus);	
       
 16849 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
 16850 	
       
 16851 	ASSERT_EQUALS(indiComplete.iIndicator, indi.iIndicator);
       
 16852 	ASSERT_EQUALS(indiComplete.iCFNumber.iTypeOfNumber, indi.iCFNumber.iTypeOfNumber);
       
 16853 	ASSERT_EQUALS(indiComplete.iCFNumber.iNumberPlan, indi.iCFNumber.iNumberPlan);
       
 16854 	ASSERT_EQUALS(0, indi.iCFNumber.iTelNumber.Compare(indiComplete.iCFNumber.iTelNumber));		
       
 16855 	
       
 16856 	AssertMockLtsyStatusL();
       
 16857 
       
 16858  	//-------------------------------------------------------------------------
       
 16859 	// TEST E: Unsolicited completion of RMmCustomAPI::GetIccCallForwardingIndicatorStatus
       
 16860 	// from LTSY.
       
 16861  	//-------------------------------------------------------------------------
       
 16862 
       
 16863 	TRequestStatus mockLtsyStatus;
       
 16864 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
 16865 
       
 16866 	// here iGetIccCfStatusBootUp is true and error is set
       
 16867     iMockLTSY.CompleteL(ECustomGetIccCallForwardingStatusIPC, KErrGeneral, indiCompletePckg);        	
       
 16868 
       
 16869 	User::WaitForRequest(mockLtsyStatus);
       
 16870 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
 16871 
       
 16872 
       
 16873 	// TEST E2: Unsolicited completion of RMmCustomAPI::GetIccCallForwardingIndicatorStatus
       
 16874 	// from LTSY.
       
 16875 	
       
 16876 	// here iGetIccCfStatusBootUp is true and no error 
       
 16877 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
 16878 
       
 16879     iMockLTSY.CompleteL(ECustomGetIccCallForwardingStatusIPC, KErrNone, indiCompletePckg);        	
       
 16880 
       
 16881 	User::WaitForRequest(mockLtsyStatus);
       
 16882 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
 16883 
       
 16884 	// TEST E3: Unsolicited completion of RMmCustomAPI::GetIccCallForwardingIndicatorStatus
       
 16885 	// from LTSY.
       
 16886 	
       
 16887 	// here iGetIccCfStatusBootUp is false
       
 16888 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
 16889 
       
 16890     iMockLTSY.CompleteL(ECustomGetIccCallForwardingStatusIPC, KErrNone, indiCompletePckg);        	
       
 16891 
       
 16892 	User::WaitForRequest(mockLtsyStatus);
       
 16893 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
 16894 
       
 16895 
       
 16896  	//-------------------------------------------------------------------------
       
 16897 	// TEST A: failure to dispatch request to LTSY
       
 16898  	//-------------------------------------------------------------------------
       
 16899 	
       
 16900     iMockLTSY.ExpectL(ECustomGetIccCallForwardingStatusIPC, KErrNotSupported);        	
       
 16901 
       
 16902 	customAPI.GetIccCallForwardingIndicatorStatus(requestStatus, indiPckg);
       
 16903 
       
 16904 	User::WaitForRequest(requestStatus);	
       
 16905 	ASSERT_EQUALS(KErrNotSupported, requestStatus.Int());
       
 16906 	
       
 16907 
       
 16908 	AssertMockLtsyStatusL();
       
 16909 	CleanupStack::PopAndDestroy(2, this);
       
 16910 	
       
 16911 	}
       
 16912 
       
 16913 
       
 16914 /**
       
 16915 @SYMTestCaseID BA-CTSY-CIPC-MCGICFIS-0002
       
 16916 @SYMComponent  telephony_ctsy
       
 16917 @SYMTestCaseDesc Test support in CTSY for cancelling of RMmCustomAPI::GetIccCallForwardingIndicatorStatus
       
 16918 @SYMTestPriority High
       
 16919 @SYMTestActions Invokes cancelling of RMmCustomAPI::GetIccCallForwardingIndicatorStatus
       
 16920 @SYMTestExpectedResults Pass
       
 16921 @SYMTestType CT
       
 16922 */
       
 16923 void CCTsyCustomIPCFU::TestGetIccCallForwardingIndicatorStatus0002L()
       
 16924 	{
       
 16925 
       
 16926 	OpenEtelServerL(EUseExtendedError);
       
 16927 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
 16928 	OpenPhoneL();
       
 16929 
       
 16930 	RMmCustomAPI customAPI;
       
 16931 	OpenCustomAPILC(customAPI, iPhone);
       
 16932 
       
 16933     // This completes request made when customAPI is opened
       
 16934 	RMmCustomAPI::TCFIndicators indiComplete;
       
 16935 	RMmCustomAPI::TCFIndicatorsPckg indiCompletePckg(indiComplete);	
       
 16936     iMockLTSY.CompleteL(ECustomGetIccCallForwardingStatusIPC, KErrNone, indiCompletePckg); 
       
 16937 
       
 16938 	TRequestStatus requestStatus;
       
 16939 
       
 16940 	RMmCustomAPI::TCFIndicators indi;
       
 16941 	RMmCustomAPI::TCFIndicatorsPckg indiPckg(indi);	
       
 16942 
       
 16943 	TRequestStatus mockLtsyStatus;
       
 16944 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
 16945 
       
 16946  	//-------------------------------------------------------------------------
       
 16947 	// Test cancelling of RMmCustomAPI::GetIccCallForwardingIndicatorStatus
       
 16948  	//-------------------------------------------------------------------------
       
 16949 
       
 16950 	iMockLTSY.ExpectL(ECustomGetIccCallForwardingStatusIPC);    
       
 16951 
       
 16952 	customAPI.GetIccCallForwardingIndicatorStatus(requestStatus, indiPckg);
       
 16953 
       
 16954 	customAPI.CancelAsyncRequest(ECustomGetIccCallForwardingStatusIPC);
       
 16955 
       
 16956     iMockLTSY.CompleteL(ECustomGetIccCallForwardingStatusIPC, KErrNone, indiCompletePckg);        	
       
 16957 
       
 16958 	User::WaitForRequest(requestStatus);	
       
 16959 	ASSERT_EQUALS(KErrCancel, requestStatus.Int());
       
 16960     
       
 16961 	User::WaitForRequest(mockLtsyStatus);
       
 16962 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
 16963 	
       
 16964 	AssertMockLtsyStatusL();
       
 16965 	
       
 16966 	CleanupStack::PopAndDestroy(2); 
       
 16967 	
       
 16968 	}
       
 16969 
       
 16970 
       
 16971 /**
       
 16972 @SYMTestCaseID BA-CTSY-CIPC-MCGICFIS-0003
       
 16973 @SYMComponent  telephony_ctsy
       
 16974 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::GetIccCallForwardingIndicatorStatus with bad parameter data
       
 16975 @SYMTestPriority High
       
 16976 @SYMTestActions Invokes RMmCustomAPI::GetIccCallForwardingIndicatorStatus with bad parameter data
       
 16977 @SYMTestExpectedResults Pass
       
 16978 @SYMTestType CT
       
 16979 */
       
 16980 void CCTsyCustomIPCFU::TestGetIccCallForwardingIndicatorStatus0003L()
       
 16981 	{
       
 16982 
       
 16983 	OpenEtelServerL(EUseExtendedError);
       
 16984 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
 16985 	OpenPhoneL();
       
 16986 
       
 16987 	RMmCustomAPI customAPI;
       
 16988 	OpenCustomAPILC(customAPI, iPhone);
       
 16989 
       
 16990 
       
 16991 	//-------------------------------------------------------------------------
       
 16992 	// Test B: Test passing wrong descriptor size to parameter in
       
 16993 	// RMmCustomAPI::GetIccCallForwardingIndicatorStatus
       
 16994  	//-------------------------------------------------------------------------
       
 16995 
       
 16996 	TRequestStatus requestStatus;
       
 16997 
       
 16998 	TBuf8<1> littleBuf;
       
 16999 
       
 17000 	customAPI.GetIccCallForwardingIndicatorStatus(requestStatus, littleBuf);
       
 17001 
       
 17002 	RMmCustomAPI::TCFIndicators indiComplete;
       
 17003 	RMmCustomAPI::TCFIndicatorsPckg indiCompletePckg(indiComplete);	
       
 17004 
       
 17005 	User::WaitForRequest(requestStatus);	
       
 17006 	ASSERT_EQUALS(KErrArgument, requestStatus.Int());
       
 17007 
       
 17008 	AssertMockLtsyStatusL();
       
 17009 
       
 17010 	CleanupStack::PopAndDestroy(2, this);
       
 17011 
       
 17012 	}
       
 17013 
       
 17014 
       
 17015 /**
       
 17016 @SYMTestCaseID BA-CTSY-CIPC-MCGICFIS-0004
       
 17017 @SYMComponent  telephony_ctsy
       
 17018 @SYMTestCaseDesc Test support in CTSY for multiple client requests to RMmCustomAPI::GetIccCallForwardingIndicatorStatus
       
 17019 @SYMTestPriority High
       
 17020 @SYMTestActions Invokes multiple client requests to RMmCustomAPI::GetIccCallForwardingIndicatorStatus
       
 17021 @SYMTestExpectedResults Pass
       
 17022 @SYMTestType CT
       
 17023 */
       
 17024 void CCTsyCustomIPCFU::TestGetIccCallForwardingIndicatorStatus0004L()
       
 17025 	{
       
 17026 
       
 17027 	OpenEtelServerL(EUseExtendedError);
       
 17028 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
 17029 	OpenPhoneL();
       
 17030 
       
 17031 	// Open second client
       
 17032 	RTelServer telServer2;
       
 17033 	TInt ret = telServer2.Connect();
       
 17034 	ASSERT_EQUALS(KErrNone, ret);
       
 17035 	CleanupClosePushL(telServer2);
       
 17036 
       
 17037 	RMobilePhone phone2;
       
 17038 	ret = phone2.Open(telServer2,KMmTsyPhoneName);
       
 17039 	ASSERT_EQUALS(KErrNone, ret);
       
 17040 	CleanupClosePushL(phone2);
       
 17041 
       
 17042 
       
 17043 	RMmCustomAPI customAPI;
       
 17044 	OpenCustomAPILC(customAPI, iPhone);
       
 17045 
       
 17046 	RMmCustomAPI customAPI2;
       
 17047 	CleanupClosePushL(customAPI2);
       
 17048 	customAPI2.Open(phone2);	
       
 17049 
       
 17050 	TRequestStatus requestStatus;
       
 17051 	TRequestStatus requestStatus2;
       
 17052 
       
 17053 	RMmCustomAPI::TCFIndicators indi;
       
 17054 	RMmCustomAPI::TCFIndicatorsPckg indiPckg(indi);	
       
 17055 
       
 17056 	RMmCustomAPI::TCFIndicators indi2;
       
 17057 	RMmCustomAPI::TCFIndicatorsPckg indiPckg2(indi2);	
       
 17058 
       
 17059 	//-------------------------------------------------------------------------
       
 17060 	// Test A: Test multiple clients requesting RMmCustomAPI::GetIccCallForwardingIndicatorStatus
       
 17061  	//-------------------------------------------------------------------------
       
 17062  	
       
 17063 	iMockLTSY.ExpectL(ECustomGetIccCallForwardingStatusIPC);    
       
 17064 
       
 17065 	customAPI.GetIccCallForwardingIndicatorStatus(requestStatus, indiPckg);
       
 17066 	customAPI2.GetIccCallForwardingIndicatorStatus(requestStatus2, indiPckg2);
       
 17067 
       
 17068 	RMmCustomAPI::TCFIndicators indiComplete;
       
 17069 	RMmCustomAPI::TCFIndicatorsPckg indiCompletePckg(indiComplete);	
       
 17070 
       
 17071     iMockLTSY.CompleteL(ECustomGetIccCallForwardingStatusIPC, KErrNone, indiCompletePckg);        	
       
 17072 
       
 17073 	User::WaitForRequest(requestStatus);	
       
 17074 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
 17075 
       
 17076 	User::WaitForRequest(requestStatus2);	
       
 17077 	ASSERT_EQUALS(KErrServerBusy, requestStatus2.Int());
       
 17078 
       
 17079 	AssertMockLtsyStatusL();	
       
 17080 
       
 17081 	CleanupStack::PopAndDestroy(5, this); 
       
 17082 	}
       
 17083 
       
 17084 
       
 17085 /**
       
 17086 @SYMTestCaseID BA-CTSY-CIPC-MCGICFIS-0005
       
 17087 @SYMComponent  telephony_ctsy
       
 17088 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::GetIccCallForwardingIndicatorStatus with timeout
       
 17089 @SYMTestPriority High
       
 17090 @SYMTestActions Invokes RMmCustomAPI::GetIccCallForwardingIndicatorStatus and tests for timeout
       
 17091 @SYMTestExpectedResults Pass
       
 17092 @SYMTestType CT
       
 17093 */
       
 17094 void CCTsyCustomIPCFU::TestGetIccCallForwardingIndicatorStatus0005L()
       
 17095 	{
       
 17096 
       
 17097 	OpenEtelServerL(EUseExtendedError);
       
 17098 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
 17099 	OpenPhoneL();
       
 17100 
       
 17101 	RMmCustomAPI customAPI;
       
 17102 	OpenCustomAPILC(customAPI, iPhone);
       
 17103 
       
 17104 	TRequestStatus requestStatus;
       
 17105 
       
 17106 	RMmCustomAPI::TCFIndicators indi;
       
 17107 	RMmCustomAPI::TCFIndicatorsPckg indiPckg(indi);	
       
 17108 	
       
 17109 	iMockLTSY.ExpectL(ECustomGetIccCallForwardingStatusIPC);    
       
 17110 
       
 17111 	customAPI.GetIccCallForwardingIndicatorStatus(requestStatus, indiPckg);
       
 17112 
       
 17113 	User::WaitForRequest(requestStatus);	
       
 17114 	ASSERT_EQUALS(KErrTimedOut, requestStatus.Int());
       
 17115 
       
 17116 	AssertMockLtsyStatusL();
       
 17117 
       
 17118 	CleanupStack::PopAndDestroy(2, this);   // customAPI, this
       
 17119 
       
 17120 	}
       
 17121 
       
 17122 
       
 17123 /**
       
 17124 @SYMTestCaseID BA-CTSY-CIPC-MCNICFSC-0001
       
 17125 @SYMComponent  telephony_ctsy
       
 17126 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::NotifyIccCallForwardingStatusChange
       
 17127 @SYMTestPriority High
       
 17128 @SYMTestActions Invokes RMmCustomAPI::NotifyIccCallForwardingStatusChange
       
 17129 @SYMTestExpectedResults Pass
       
 17130 @SYMTestType CT
       
 17131 */
       
 17132 void CCTsyCustomIPCFU::TestNotifyIccCallForwardingStatusChange0001L()
       
 17133 	{
       
 17134 
       
 17135 	OpenEtelServerL(EUseExtendedError);
       
 17136 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
 17137 	OpenPhoneL();
       
 17138 
       
 17139 	RMmCustomAPI customAPI;
       
 17140 	OpenCustomAPILC(customAPI, iPhone);
       
 17141 
       
 17142 	TRequestStatus requestStatus;
       
 17143 
       
 17144 	RMmCustomAPI::TCFIndicators indi;
       
 17145 	RMmCustomAPI::TCFIndicatorsPckg indiPckg(indi);	
       
 17146 	
       
 17147 	//-------------------------------------------------------------------------
       
 17148 	// TEST B: failure on completion of pending request from LTSY->CTSY
       
 17149  	//-------------------------------------------------------------------------
       
 17150 
       
 17151 	customAPI.NotifyIccCallForwardingStatusChange(requestStatus, indiPckg);
       
 17152 
       
 17153 	RMmCustomAPI::TCFIndicators indiComplete;
       
 17154 	RMmCustomAPI::TCFIndicatorsPckg indiCompletePckg(indiComplete);	
       
 17155 
       
 17156 
       
 17157     indiComplete.iIndicator = 0xFF;
       
 17158 
       
 17159     iMockLTSY.CompleteL(ECustomNotifyIccCallForwardingStatusChangeIPC, KErrGeneral, indiCompletePckg);        	
       
 17160 
       
 17161 	User::WaitForRequest(requestStatus);	
       
 17162 	ASSERT_EQUALS(KErrGeneral, requestStatus.Int());
       
 17163 	
       
 17164 	AssertMockLtsyStatusL();	
       
 17165 
       
 17166  	//-------------------------------------------------------------------------
       
 17167 	// TEST C: Successful completion request of
       
 17168 	// RMmCustomAPI::NotifyIccCallForwardingStatusChange when result is not cached.
       
 17169  	//-------------------------------------------------------------------------
       
 17170 
       
 17171 	customAPI.NotifyIccCallForwardingStatusChange(requestStatus, indiPckg);
       
 17172 
       
 17173 	_LIT(KNumber, "123456789");
       
 17174     indiComplete.iIndicator = 0x00;
       
 17175     indiComplete.iCFNumber.iTypeOfNumber = RMobilePhone::EInternationalNumber;    
       
 17176     indiComplete.iCFNumber.iNumberPlan = RMobilePhone::EIsdnNumberPlan;
       
 17177     indiComplete.iCFNumber.iTelNumber = KNumber;
       
 17178 
       
 17179     iMockLTSY.CompleteL(ECustomNotifyIccCallForwardingStatusChangeIPC, KErrNone, indiCompletePckg);        	
       
 17180 
       
 17181 	User::WaitForRequest(requestStatus);	
       
 17182 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
 17183 	
       
 17184 	ASSERT_EQUALS(indiComplete.iIndicator, indi.iIndicator);
       
 17185 	ASSERT_EQUALS(indiComplete.iCFNumber.iTypeOfNumber, indi.iCFNumber.iTypeOfNumber);
       
 17186 	ASSERT_EQUALS(indiComplete.iCFNumber.iNumberPlan, indi.iCFNumber.iNumberPlan);
       
 17187 	ASSERT_EQUALS(0, indi.iCFNumber.iTelNumber.Compare(indiComplete.iCFNumber.iTelNumber));		
       
 17188 	
       
 17189 	AssertMockLtsyStatusL();	
       
 17190 
       
 17191  	//-------------------------------------------------------------------------
       
 17192 	// TEST E: Unsolicited completion of RMmCustomAPI::NotifyIccCallForwardingStatusChange
       
 17193 	// from LTSY.
       
 17194  	//-------------------------------------------------------------------------
       
 17195 
       
 17196 	TRequestStatus mockLtsyStatus;
       
 17197 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
 17198 
       
 17199     indiComplete.iIndicator = 0xFF;
       
 17200     
       
 17201     iMockLTSY.CompleteL(ECustomNotifyIccCallForwardingStatusChangeIPC, KErrNone, indiCompletePckg);        	
       
 17202 
       
 17203 	User::WaitForRequest(mockLtsyStatus);
       
 17204 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
 17205 
       
 17206 	AssertMockLtsyStatusL();
       
 17207 	CleanupStack::PopAndDestroy(2, this);
       
 17208 	
       
 17209 	}
       
 17210 
       
 17211 
       
 17212 /**
       
 17213 @SYMTestCaseID BA-CTSY-CIPC-MCNICFSC-0002
       
 17214 @SYMComponent  telephony_ctsy
       
 17215 @SYMTestCaseDesc Test support in CTSY for cancelling of RMmCustomAPI::NotifyIccCallForwardingStatusChange
       
 17216 @SYMTestPriority High
       
 17217 @SYMTestActions Invokes cancelling of RMmCustomAPI::NotifyIccCallForwardingStatusChange
       
 17218 @SYMTestExpectedResults Pass
       
 17219 @SYMTestType CT
       
 17220 */
       
 17221 void CCTsyCustomIPCFU::TestNotifyIccCallForwardingStatusChange0002L()
       
 17222 	{
       
 17223 
       
 17224 	OpenEtelServerL(EUseExtendedError);
       
 17225 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
 17226 	OpenPhoneL();
       
 17227 
       
 17228 	RMmCustomAPI customAPI;
       
 17229 	OpenCustomAPILC(customAPI, iPhone);
       
 17230 
       
 17231 	TRequestStatus mockLtsyStatus;
       
 17232 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
 17233 
       
 17234 	TRequestStatus requestStatus;
       
 17235 
       
 17236 	RMmCustomAPI::TCFIndicators indi;
       
 17237 	RMmCustomAPI::TCFIndicatorsPckg indiPckg(indi);	
       
 17238 	
       
 17239  	//-------------------------------------------------------------------------
       
 17240 	// Test cancelling of RMmCustomAPI::NotifyIccCallForwardingStatusChange
       
 17241  	//-------------------------------------------------------------------------
       
 17242 	customAPI.NotifyIccCallForwardingStatusChange(requestStatus, indiPckg);
       
 17243 	
       
 17244 	customAPI.CancelAsyncRequest(ECustomNotifyIccCallForwardingStatusChangeIPC);
       
 17245 
       
 17246 	RMmCustomAPI::TCFIndicators indiComplete;
       
 17247 	RMmCustomAPI::TCFIndicatorsPckg indiCompletePckg(indiComplete);	
       
 17248 
       
 17249     indiComplete.iIndicator = 0xFF;
       
 17250 
       
 17251     iMockLTSY.CompleteL(ECustomNotifyIccCallForwardingStatusChangeIPC, KErrNone, indiCompletePckg);        	
       
 17252 
       
 17253 	User::WaitForRequest(mockLtsyStatus);
       
 17254 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
 17255 
       
 17256 	User::WaitForRequest(requestStatus);
       
 17257 	ASSERT_EQUALS(KErrCancel, requestStatus.Int());	
       
 17258 	
       
 17259 	AssertMockLtsyStatusL();	
       
 17260 	
       
 17261 	CleanupStack::PopAndDestroy(2); 
       
 17262 	
       
 17263 	}
       
 17264 
       
 17265 
       
 17266 /**
       
 17267 @SYMTestCaseID BA-CTSY-CIPC-MCNICFSC-0003
       
 17268 @SYMComponent  telephony_ctsy
       
 17269 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::NotifyIccCallForwardingStatusChange with bad parameter data
       
 17270 @SYMTestPriority High
       
 17271 @SYMTestActions Invokes RMmCustomAPI::NotifyIccCallForwardingStatusChange with bad parameter data
       
 17272 @SYMTestExpectedResults Pass
       
 17273 @SYMTestType CT
       
 17274 */
       
 17275 void CCTsyCustomIPCFU::TestNotifyIccCallForwardingStatusChange0003L()
       
 17276 	{
       
 17277 
       
 17278 	OpenEtelServerL(EUseExtendedError);
       
 17279 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
 17280 	OpenPhoneL();
       
 17281 
       
 17282 	RMmCustomAPI customAPI;
       
 17283 	OpenCustomAPILC(customAPI, iPhone);
       
 17284 
       
 17285 	//-------------------------------------------------------------------------
       
 17286 	// Test B: Test passing wrong descriptor size to parameter in
       
 17287 	// RMmCustomAPI::NotifyIccCallForwardingStatusChange
       
 17288  	//-------------------------------------------------------------------------
       
 17289 	TRequestStatus requestStatus;
       
 17290 
       
 17291 	TBuf8<1> littleBuf;
       
 17292 	
       
 17293 	customAPI.NotifyIccCallForwardingStatusChange(requestStatus, littleBuf);
       
 17294 
       
 17295 	RMmCustomAPI::TCFIndicators indiComplete;
       
 17296 	RMmCustomAPI::TCFIndicatorsPckg indiCompletePckg(indiComplete);	
       
 17297 
       
 17298     indiComplete.iIndicator = 0xFF;
       
 17299 
       
 17300     iMockLTSY.CompleteL(ECustomNotifyIccCallForwardingStatusChangeIPC, KErrNone, indiCompletePckg);
       
 17301     
       
 17302 	User::WaitForRequest(requestStatus);	
       
 17303 	ASSERT_EQUALS(KErrArgument, requestStatus.Int());
       
 17304 
       
 17305 	AssertMockLtsyStatusL();
       
 17306 	
       
 17307 	CleanupStack::PopAndDestroy(2, this); 
       
 17308 
       
 17309 	}
       
 17310 
       
 17311 
       
 17312 /**
       
 17313 @SYMTestCaseID BA-CTSY-CIPC-MCNICFSC-0004
       
 17314 @SYMComponent  telephony_ctsy
       
 17315 @SYMTestCaseDesc Test support in CTSY for multiple client requests to RMmCustomAPI::NotifyIccCallForwardingStatusChange
       
 17316 @SYMTestPriority High
       
 17317 @SYMTestActions Invokes multiple client requests to RMmCustomAPI::NotifyIccCallForwardingStatusChange
       
 17318 @SYMTestExpectedResults Pass
       
 17319 @SYMTestType CT
       
 17320 */
       
 17321 void CCTsyCustomIPCFU::TestNotifyIccCallForwardingStatusChange0004L()
       
 17322 	{
       
 17323 					
       
 17324 	OpenEtelServerL(EUseExtendedError);
       
 17325 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
 17326 	OpenPhoneL();
       
 17327 
       
 17328 	// Open second client
       
 17329 	RTelServer telServer2;
       
 17330 	TInt ret = telServer2.Connect();
       
 17331 	ASSERT_EQUALS(KErrNone, ret);
       
 17332 	CleanupClosePushL(telServer2);
       
 17333 
       
 17334 	RMobilePhone phone2;
       
 17335 	ret = phone2.Open(telServer2,KMmTsyPhoneName);
       
 17336 	ASSERT_EQUALS(KErrNone, ret);
       
 17337 	CleanupClosePushL(phone2);
       
 17338 
       
 17339 
       
 17340 	RMmCustomAPI customAPI;
       
 17341 	OpenCustomAPILC(customAPI, iPhone);
       
 17342 
       
 17343 	RMmCustomAPI customAPI2;
       
 17344 	OpenCustomAPILC(customAPI2, phone2, EFalse);
       
 17345 
       
 17346 	TRequestStatus requestStatus;
       
 17347 	TRequestStatus requestStatus2;
       
 17348 
       
 17349 	RMmCustomAPI::TCFIndicators indi;
       
 17350 	RMmCustomAPI::TCFIndicatorsPckg indiPckg(indi);	
       
 17351 
       
 17352 	RMmCustomAPI::TCFIndicators indi2;
       
 17353 	RMmCustomAPI::TCFIndicatorsPckg indiPckg2(indi2);	
       
 17354 	
       
 17355 	//-------------------------------------------------------------------------
       
 17356 	// Test A: Test multiple clients requesting RMmCustomAPI::NotifyIccCallForwardingStatusChange
       
 17357  	//-------------------------------------------------------------------------
       
 17358 	customAPI.NotifyIccCallForwardingStatusChange(requestStatus, indiPckg);
       
 17359 	customAPI2.NotifyIccCallForwardingStatusChange(requestStatus2, indiPckg2);
       
 17360 
       
 17361 	RMmCustomAPI::TCFIndicators indiComplete;
       
 17362 	RMmCustomAPI::TCFIndicatorsPckg indiCompletePckg(indiComplete);	
       
 17363 
       
 17364 	_LIT(KNumber, "123456789");
       
 17365 
       
 17366     indiComplete.iIndicator = 0xFF;
       
 17367     indiComplete.iCFNumber.iTypeOfNumber = RMobilePhone::EInternationalNumber;    
       
 17368     indiComplete.iCFNumber.iNumberPlan = RMobilePhone::EIsdnNumberPlan;
       
 17369     indiComplete.iCFNumber.iTelNumber = KNumber;
       
 17370 
       
 17371     iMockLTSY.CompleteL(ECustomNotifyIccCallForwardingStatusChangeIPC, KErrNone, indiCompletePckg);        	
       
 17372 
       
 17373 	User::WaitForRequest(requestStatus);	
       
 17374 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
 17375 
       
 17376 	ASSERT_EQUALS(indiComplete.iIndicator, indi.iIndicator);
       
 17377 	ASSERT_EQUALS(indiComplete.iCFNumber.iTypeOfNumber, indi.iCFNumber.iTypeOfNumber);
       
 17378 	ASSERT_EQUALS(indiComplete.iCFNumber.iNumberPlan, indi.iCFNumber.iNumberPlan);
       
 17379 	ASSERT_EQUALS(0, indi.iCFNumber.iTelNumber.Compare(indiComplete.iCFNumber.iTelNumber));		
       
 17380 
       
 17381 	User::WaitForRequest(requestStatus2);	
       
 17382 	ASSERT_EQUALS(KErrNone, requestStatus2.Int());
       
 17383 
       
 17384 	ASSERT_EQUALS(indiComplete.iIndicator, indi2.iIndicator);
       
 17385 	ASSERT_EQUALS(indiComplete.iCFNumber.iTypeOfNumber, indi2.iCFNumber.iTypeOfNumber);
       
 17386 	ASSERT_EQUALS(indiComplete.iCFNumber.iNumberPlan, indi2.iCFNumber.iNumberPlan);
       
 17387 	ASSERT_EQUALS(0, indi2.iCFNumber.iTelNumber.Compare(indiComplete.iCFNumber.iTelNumber));		
       
 17388 	
       
 17389 	AssertMockLtsyStatusL();	
       
 17390 
       
 17391 	CleanupStack::PopAndDestroy(5, this); 
       
 17392 
       
 17393 	}
       
 17394 
       
 17395 
       
 17396 /**
       
 17397 @SYMTestCaseID BA-CTSY-CIPC-MCGCI2-0001
       
 17398 @SYMComponent telephony_ctsy
       
 17399 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::GetCellInfo
       
 17400 @SYMTestPriority High
       
 17401 @SYMTestActions Invokes RMmCustomAPI::GetCellInfo
       
 17402 @SYMTestExpectedResults Pass
       
 17403 @SYMTestType CT
       
 17404 */
       
 17405 
       
 17406 void CCTsyCustomIPCFU::TestGetCellInfo0001L()
       
 17407 	{
       
 17408 
       
 17409 	OpenEtelServerL(EUseExtendedError);
       
 17410 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
 17411 	OpenPhoneL();
       
 17412 
       
 17413 	RMmCustomAPI customAPI;
       
 17414 	OpenCustomAPILC(customAPI, iPhone);
       
 17415 
       
 17416 	TRequestStatus requestStatus;
       
 17417 	RMmCustomAPI::TMmCellInfo* cellInfo = new(ELeave) RMmCustomAPI::TMmCellInfo;
       
 17418     CleanupStack::PushL(cellInfo);
       
 17419 	
       
 17420 	RMmCustomAPI::TMmCellInfoPckg cellInfoPckg(*cellInfo);
       
 17421 
       
 17422 	RMmCustomAPI::TMmCellInfo* cell = new(ELeave) RMmCustomAPI::TMmCellInfo;
       
 17423     CleanupStack::PushL(cell);
       
 17424 	RMmCustomAPI::TMmCellInfoPckg cellPckg(*cell);
       
 17425 	
       
 17426 	
       
 17427  	//-------------------------------------------------------------------------
       
 17428 	// TEST A: failure to dispatch request to LTSY
       
 17429  	//-------------------------------------------------------------------------
       
 17430 
       
 17431     iMockLTSY.ExpectL(ECustomGetCellInfoIPC, KErrNotSupported);        	
       
 17432 
       
 17433 	customAPI.GetCellInfo(requestStatus, cellInfoPckg);
       
 17434 
       
 17435 	User::WaitForRequest(requestStatus);
       
 17436 	
       
 17437 	ASSERT_EQUALS(KErrNotSupported, requestStatus.Int());
       
 17438 	
       
 17439 	AssertMockLtsyStatusL();
       
 17440 	
       
 17441 	//-------------------------------------------------------------------------
       
 17442 	// TEST B: failure on completion of pending request from LTSY->CTSY
       
 17443  	//-------------------------------------------------------------------------
       
 17444 
       
 17445     iMockLTSY.ExpectL(ECustomGetCellInfoIPC);        	
       
 17446 
       
 17447 	customAPI.GetCellInfo(requestStatus, cellInfoPckg);
       
 17448 
       
 17449 	iMockLTSY.CompleteL(ECustomGetCellInfoIPC, KErrGeneral, cellPckg);
       
 17450 
       
 17451 	User::WaitForRequest(requestStatus);
       
 17452 	
       
 17453 	ASSERT_EQUALS(KErrGeneral, requestStatus.Int());
       
 17454 
       
 17455 	AssertMockLtsyStatusL();
       
 17456 
       
 17457  	//-------------------------------------------------------------------------
       
 17458 	// TEST C: Successful completion request of
       
 17459 	// RMmCustomAPI::GetCellInfo when result is not cached.
       
 17460  	//-------------------------------------------------------------------------
       
 17461 
       
 17462     iMockLTSY.ExpectL(ECustomGetCellInfoIPC);        	
       
 17463 
       
 17464 	customAPI.GetCellInfo(requestStatus, cellInfoPckg);
       
 17465 
       
 17466 	FillWithRandomData(*cell);	
       
 17467 	
       
 17468 	iMockLTSY.CompleteL(ECustomGetCellInfoIPC, KErrNone, cellPckg);
       
 17469 
       
 17470 	User::WaitForRequest(requestStatus);
       
 17471 
       
 17472 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
 17473 	ASSERT_TRUE( TComparator<RMmCustomAPI::TMmCellInfo>::IsEqual(*cell, *cellInfo) );
       
 17474 	
       
 17475 	AssertMockLtsyStatusL();
       
 17476 
       
 17477  	//-------------------------------------------------------------------------
       
 17478 	// TEST E: Unsolicited completion of RMmCustomAPI::GetCellInfo
       
 17479 	// from LTSY.
       
 17480  	//-------------------------------------------------------------------------
       
 17481 
       
 17482 	TRequestStatus mockLtsyStatus;
       
 17483 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
 17484 
       
 17485 	iMockLTSY.CompleteL(ECustomGetCellInfoIPC, KErrNone, cellPckg);
       
 17486 
       
 17487 	User::WaitForRequest(mockLtsyStatus);
       
 17488 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
 17489 
       
 17490 	AssertMockLtsyStatusL();
       
 17491 	CleanupStack::PopAndDestroy(4, this); 
       
 17492 	
       
 17493 	}
       
 17494 
       
 17495 
       
 17496 
       
 17497 /**
       
 17498 @SYMTestCaseID BA-CTSY-CIPC-MCGCI2-0002
       
 17499 @SYMComponent  telephony_ctsy
       
 17500 @SYMTestCaseDesc Test support in CTSY for cancelling of RMmCustomAPI::GetCellInfo
       
 17501 @SYMTestPriority High
       
 17502 @SYMTestActions Invokes cancelling of RMmCustomAPI::GetCellInfo
       
 17503 @SYMTestExpectedResults Pass
       
 17504 @SYMTestType CT
       
 17505 */
       
 17506 void CCTsyCustomIPCFU::TestGetCellInfo0002L()
       
 17507 	{
       
 17508 
       
 17509 	OpenEtelServerL(EUseExtendedError);
       
 17510 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
 17511 	OpenPhoneL();
       
 17512 
       
 17513 	RMmCustomAPI customAPI;
       
 17514 	OpenCustomAPILC(customAPI, iPhone);
       
 17515 
       
 17516  	//-------------------------------------------------------------------------
       
 17517 	// Test cancelling of RMmCustomAPI::GetCellInfo
       
 17518  	//-------------------------------------------------------------------------
       
 17519 
       
 17520 	TRequestStatus requestStatus;
       
 17521 	RMmCustomAPI::TMmCellInfo* cellInfo = new(ELeave) RMmCustomAPI::TMmCellInfo;
       
 17522     CleanupStack::PushL(cellInfo);
       
 17523 	RMmCustomAPI::TMmCellInfoPckg cellInfoPckg(*cellInfo);
       
 17524 
       
 17525 	RMmCustomAPI::TMmCellInfo* cell = new(ELeave) RMmCustomAPI::TMmCellInfo;
       
 17526     CleanupStack::PushL(cell);
       
 17527 	RMmCustomAPI::TMmCellInfoPckg cellPckg(*cell);	
       
 17528 	
       
 17529     iMockLTSY.ExpectL(ECustomGetCellInfoIPC);        	
       
 17530 
       
 17531 	customAPI.GetCellInfo(requestStatus, cellInfoPckg);
       
 17532 
       
 17533 	customAPI.CancelAsyncRequest(ECustomGetCellInfoIPC);
       
 17534 
       
 17535 	TRequestStatus mockLtsyStatus;
       
 17536 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
 17537 
       
 17538 	iMockLTSY.CompleteL(ECustomGetCellInfoIPC, KErrNone, cellPckg);
       
 17539 		
       
 17540 	User::WaitForRequest(mockLtsyStatus);
       
 17541 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());	
       
 17542 			
       
 17543 	User::WaitForRequest(requestStatus);
       
 17544 	ASSERT_EQUALS(KErrCancel, requestStatus.Int());	
       
 17545 
       
 17546 	AssertMockLtsyStatusL();
       
 17547 
       
 17548 	CleanupStack::PopAndDestroy(4); 
       
 17549 	
       
 17550 	}
       
 17551 
       
 17552 
       
 17553 /**
       
 17554 @SYMTestCaseID BA-CTSY-CIPC-MCGCI2-0003
       
 17555 @SYMComponent  telephony_ctsy
       
 17556 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::GetCellInfo with bad parameter data
       
 17557 @SYMTestPriority High
       
 17558 @SYMTestActions Invokes RMmCustomAPI::GetCellInfo with bad parameter data
       
 17559 @SYMTestExpectedResults Pass
       
 17560 @SYMTestType CT
       
 17561 */
       
 17562 void CCTsyCustomIPCFU::TestGetCellInfo0003L()
       
 17563 	{
       
 17564 
       
 17565 	OpenEtelServerL(EUseExtendedError);
       
 17566 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
 17567 	OpenPhoneL();
       
 17568 
       
 17569 	RMmCustomAPI customAPI;
       
 17570 	OpenCustomAPILC(customAPI, iPhone);
       
 17571 
       
 17572 	//-------------------------------------------------------------------------
       
 17573 	// Test B: Test passing wrong descriptor size to parameter in
       
 17574 	// RMmCustomAPI::GetCellInfo
       
 17575  	//-------------------------------------------------------------------------
       
 17576 	TRequestStatus requestStatus;
       
 17577 	TBuf8<1> littleBuf;
       
 17578 
       
 17579 	customAPI.GetCellInfo(requestStatus, littleBuf);
       
 17580 	
       
 17581 	User::WaitForRequest(requestStatus);
       
 17582 	ASSERT_EQUALS(KErrArgument, requestStatus.Int());	
       
 17583 	AssertMockLtsyStatusL();
       
 17584 
       
 17585 	CleanupStack::PopAndDestroy(2, this);   // customAPI, this
       
 17586 
       
 17587 	}
       
 17588 
       
 17589 
       
 17590 /**
       
 17591 @SYMTestCaseID BA-CTSY-CIPC-MCGCI2-0004
       
 17592 @SYMComponent  telephony_ctsy
       
 17593 @SYMTestCaseDesc Test support in CTSY for multiple client requests to RMmCustomAPI::GetCellInfo
       
 17594 @SYMTestPriority High
       
 17595 @SYMTestActions Invokes multiple client requests to RMmCustomAPI::GetCellInfo
       
 17596 @SYMTestExpectedResults Pass
       
 17597 @SYMTestType CT
       
 17598 */
       
 17599 void CCTsyCustomIPCFU::TestGetCellInfo0004L()
       
 17600 	{
       
 17601 	
       
 17602 	OpenEtelServerL(EUseExtendedError);
       
 17603 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
 17604 	OpenPhoneL();
       
 17605 
       
 17606 	// Open second client
       
 17607 	RTelServer telServer2;
       
 17608 	TInt ret = telServer2.Connect();
       
 17609 	ASSERT_EQUALS(KErrNone, ret);
       
 17610 	CleanupClosePushL(telServer2);
       
 17611 
       
 17612 	RMobilePhone phone2;
       
 17613 	ret = phone2.Open(telServer2,KMmTsyPhoneName);
       
 17614 	ASSERT_EQUALS(KErrNone, ret);
       
 17615 	CleanupClosePushL(phone2);
       
 17616 
       
 17617 
       
 17618 	RMmCustomAPI customAPI;
       
 17619 	OpenCustomAPILC(customAPI, iPhone);
       
 17620 
       
 17621 	RMmCustomAPI customAPI2;
       
 17622 	OpenCustomAPILC(customAPI2, phone2, EFalse);
       
 17623 
       
 17624 	TRequestStatus requestStatus;
       
 17625 	TRequestStatus requestStatus2;
       
 17626 	RMmCustomAPI::TMmCellInfo* cellInfo = new(ELeave) RMmCustomAPI::TMmCellInfo;
       
 17627     CleanupStack::PushL(cellInfo);
       
 17628 	RMmCustomAPI::TMmCellInfoPckg cellInfoPckg(*cellInfo);
       
 17629 	RMmCustomAPI::TMmCellInfo* cellInfo2 = new(ELeave) RMmCustomAPI::TMmCellInfo;
       
 17630     CleanupStack::PushL(cellInfo2);
       
 17631 	RMmCustomAPI::TMmCellInfoPckg cellInfoPckg2(*cellInfo2);
       
 17632 	
       
 17633     iMockLTSY.ExpectL(ECustomGetCellInfoIPC);        		
       
 17634 
       
 17635 	customAPI.GetCellInfo(requestStatus, cellInfoPckg);
       
 17636 	customAPI2.GetCellInfo(requestStatus2, cellInfoPckg2);
       
 17637 	
       
 17638 	RMmCustomAPI::TMmCellInfo* cell = new(ELeave) RMmCustomAPI::TMmCellInfo;
       
 17639     CleanupStack::PushL(cell);
       
 17640 	RMmCustomAPI::TMmCellInfoPckg cellPckg(*cell);
       
 17641 
       
 17642 	iMockLTSY.CompleteL(ECustomGetCellInfoIPC, KErrNone, cellPckg);
       
 17643 
       
 17644 	User::WaitForRequest(requestStatus);
       
 17645 	ASSERT_EQUALS(KErrNone, requestStatus.Int());	
       
 17646 
       
 17647 	User::WaitForRequest(requestStatus2);
       
 17648 	ASSERT_EQUALS(KErrServerBusy, requestStatus2.Int());	
       
 17649 
       
 17650 	AssertMockLtsyStatusL();
       
 17651 
       
 17652 	CleanupStack::PopAndDestroy(8, this);
       
 17653 	}
       
 17654 
       
 17655 
       
 17656 /**
       
 17657 @SYMTestCaseID BA-CTSY-CIPC-MCGCI2-0005
       
 17658 @SYMComponent  telephony_ctsy
       
 17659 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::GetCellInfo with timeout
       
 17660 @SYMTestPriority High
       
 17661 @SYMTestActions Invokes RMmCustomAPI::GetCellInfo and tests for timeout
       
 17662 @SYMTestExpectedResults Pass
       
 17663 @SYMTestType CT
       
 17664 */
       
 17665 void CCTsyCustomIPCFU::TestGetCellInfo0005L()
       
 17666 	{
       
 17667 
       
 17668 	OpenEtelServerL(EUseExtendedError);
       
 17669 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
 17670 	OpenPhoneL();
       
 17671 
       
 17672 	RMmCustomAPI customAPI;
       
 17673 	OpenCustomAPILC(customAPI, iPhone);
       
 17674 
       
 17675 	TRequestStatus requestStatus;
       
 17676 	RMmCustomAPI::TMmCellInfo* cellInfo = new(ELeave) RMmCustomAPI::TMmCellInfo;
       
 17677     CleanupStack::PushL(cellInfo);
       
 17678 	RMmCustomAPI::TMmCellInfoPckg cellInfoPckg(*cellInfo);
       
 17679 	
       
 17680     iMockLTSY.ExpectL(ECustomGetCellInfoIPC);        	
       
 17681 
       
 17682 	customAPI.GetCellInfo(requestStatus, cellInfoPckg);
       
 17683 	
       
 17684 	User::WaitForRequest(requestStatus);
       
 17685 	ASSERT_EQUALS(KErrTimedOut, requestStatus.Int());	
       
 17686 		
       
 17687 	AssertMockLtsyStatusL();
       
 17688 		
       
 17689 	CleanupStack::PopAndDestroy(3); 
       
 17690 	}
       
 17691 
       
 17692 
       
 17693 
       
 17694 void CCTsyCustomIPCFU::FillWithRandomData( RMmCustomAPI::TMmCellInfo &aCell, TInt aRnd) const
       
 17695 	{
       
 17696 	
       
 17697     aCell.iMode = RMmCustomAPI::TMmCellInfo::EGSM;
       
 17698     aCell.iGsmCellInfo.iTA = 100;
       
 17699     for( TInt i = 0; i <KMaxNmrAmount; i++ )
       
 17700         {
       
 17701         aCell.iGsmCellInfo.iNmr[i].iARFCN = 3 * i + aRnd;
       
 17702         aCell.iGsmCellInfo.iNmr[i].iBSIC = 3 * i + 1 + aRnd;
       
 17703         aCell.iGsmCellInfo.iNmr[i].iRxLEV = 3 * i + 2 + aRnd;
       
 17704         }
       
 17705 
       
 17706     aCell.iWcdmaCellInfo.iFrequencyInfo.iFddUL = 1 + aRnd;
       
 17707     aCell.iWcdmaCellInfo.iFrequencyInfo.iFddDL = 2 + aRnd;
       
 17708     aCell.iWcdmaCellInfo.iFrequencyInfo.iTddNt = 3 + aRnd;
       
 17709     aCell.iWcdmaCellInfo.iPrimaryScrambilingCode = 4 + aRnd;
       
 17710 
       
 17711     for( TInt j = 0; j <KMaxNetworkMeasureReports; j++ )
       
 17712         {
       
 17713         aCell.iWcdmaCellInfo.iNwkMeasureReport[j].iCarrierRSSI = 5 + aRnd;
       
 17714 
       
 17715         for( TInt k = 0; k <KMaxCellMeasuredResults; k++ )
       
 17716             {
       
 17717             aCell.iWcdmaCellInfo.iNwkMeasureReport[j].iCellMeasuredResult[k].iCID = k + aRnd;
       
 17718             aCell.iWcdmaCellInfo.iNwkMeasureReport[j].iCellMeasuredResult[k].iFddInfo.iPrimaryCPICH = k + aRnd;
       
 17719             aCell.iWcdmaCellInfo.iNwkMeasureReport[j].iCellMeasuredResult[k].iFddInfo.iCpichEcN0 = k + aRnd;
       
 17720             aCell.iWcdmaCellInfo.iNwkMeasureReport[j].iCellMeasuredResult[k].iFddInfo.iCpichRscp = k + aRnd;
       
 17721             aCell.iWcdmaCellInfo.iNwkMeasureReport[j].iCellMeasuredResult[k].iFddInfo.iPathloss = k + aRnd;
       
 17722             aCell.iWcdmaCellInfo.iNwkMeasureReport[j].iCellMeasuredResult[k].iTddInfo.iCellParamID = k + aRnd;
       
 17723             aCell.iWcdmaCellInfo.iNwkMeasureReport[j].iCellMeasuredResult[k].iTddInfo.iProposedTGSN = k + aRnd;
       
 17724             aCell.iWcdmaCellInfo.iNwkMeasureReport[j].iCellMeasuredResult[k].iTddInfo.iPrimaryCcpchRscp = k + aRnd;
       
 17725             aCell.iWcdmaCellInfo.iNwkMeasureReport[j].iCellMeasuredResult[k].iTddInfo.iPathloss = k + aRnd;
       
 17726             for( TInt l = 0; l <KMaxTimeSlotIscpAmount; l++ )
       
 17727                 {
       
 17728                 aCell.iWcdmaCellInfo.iNwkMeasureReport[j].iCellMeasuredResult[k].iTddInfo.iTimeslotISCP[l] = l + aRnd;
       
 17729                 }
       
 17730             }
       
 17731         }	
       
 17732 	}
       
 17733 
       
 17734 /**
       
 17735 @SYMTestCaseID BA-CTSY-CIPC-MCNCIC2-0001
       
 17736 @SYMComponent  telephony_ctsy
       
 17737 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::NotifyCellInfoChange
       
 17738 @SYMTestPriority High
       
 17739 @SYMTestActions Invokes RMmCustomAPI::NotifyCellInfoChange
       
 17740 @SYMTestExpectedResults Pass
       
 17741 @SYMTestType CT
       
 17742 */
       
 17743 void CCTsyCustomIPCFU::TestNotifyCellInfoChange0001L()
       
 17744 	{
       
 17745  
       
 17746 	OpenEtelServerL(EUseExtendedError);
       
 17747 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
 17748 	OpenPhoneL();
       
 17749 
       
 17750 	RMmCustomAPI customAPI;
       
 17751 	OpenCustomAPILC(customAPI, iPhone);
       
 17752 
       
 17753 
       
 17754 	RMmCustomAPI::TMmCellInfo* cell = new(ELeave) RMmCustomAPI::TMmCellInfo;
       
 17755     CleanupStack::PushL(cell);
       
 17756 	RMmCustomAPI::TMmCellInfoPckg cellPckg(*cell);
       
 17757 
       
 17758 	// RMmCustomAPI::TMmCellInfo initialization with random data
       
 17759     FillWithRandomData(*cell);
       
 17760 
       
 17761  	//-------------------------------------------------------------------------
       
 17762 	// TEST E: Unsolicited completion of RMmCustomAPI::NotifyCellInfoChange
       
 17763 	// from LTSY.
       
 17764  	//-------------------------------------------------------------------------
       
 17765 
       
 17766 	TRequestStatus mockLtsyStatus;
       
 17767 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
 17768 
       
 17769 	iMockLTSY.CompleteL(ECustomNotifyCellInfoChangeIPC, KErrNone, cellPckg);
       
 17770 
       
 17771 	User::WaitForRequest(mockLtsyStatus);
       
 17772 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());	
       
 17773 
       
 17774 	AssertMockLtsyStatusL();
       
 17775 	
       
 17776 	//-------------------------------------------------------------------------
       
 17777 	// TEST B: failure on completion of pending request from LTSY->CTSY
       
 17778  	//-------------------------------------------------------------------------
       
 17779 
       
 17780 	TRequestStatus requestStatus;
       
 17781 	RMmCustomAPI::TMmCellInfo* cellInfo = new(ELeave) RMmCustomAPI::TMmCellInfo;
       
 17782     CleanupStack::PushL(cellInfo);
       
 17783 	RMmCustomAPI::TMmCellInfoPckg cellInfoPckg(*cellInfo);
       
 17784 	
       
 17785 	customAPI.NotifyCellInfoChange(requestStatus, cellInfoPckg);
       
 17786 
       
 17787 	iMockLTSY.CompleteL(ECustomNotifyCellInfoChangeIPC, KErrGeneral, cellPckg);
       
 17788 	
       
 17789 	User::WaitForRequest(requestStatus);
       
 17790 	ASSERT_EQUALS(KErrGeneral, requestStatus.Int());	
       
 17791 
       
 17792 	AssertMockLtsyStatusL();
       
 17793 
       
 17794  	//-------------------------------------------------------------------------
       
 17795 	// TEST C: Successful completion request of
       
 17796 	// RMmCustomAPI::NotifyCellInfoChange when result is not cached.
       
 17797  	//-------------------------------------------------------------------------
       
 17798 
       
 17799 	customAPI.NotifyCellInfoChange(requestStatus, cellInfoPckg);
       
 17800 
       
 17801 	iMockLTSY.CompleteL(ECustomNotifyCellInfoChangeIPC, KErrNone, cellPckg);
       
 17802 	
       
 17803 	User::WaitForRequest(requestStatus);
       
 17804 	ASSERT_EQUALS(KErrNone, requestStatus.Int());	
       
 17805 	ASSERT_TRUE( TComparator<RMmCustomAPI::TMmCellInfo>::IsEqual(*cell, *cellInfo) );
       
 17806 
       
 17807 	AssertMockLtsyStatusL();
       
 17808 	CleanupStack::PopAndDestroy(4, this); 
       
 17809 	
       
 17810 	}
       
 17811 
       
 17812 
       
 17813 /**
       
 17814 @SYMTestCaseID BA-CTSY-CIPC-MCNCIC2-0002
       
 17815 @SYMComponent  telephony_ctsy
       
 17816 @SYMTestCaseDesc Test support in CTSY for cancelling of RMmCustomAPI::NotifyCellInfoChange
       
 17817 @SYMTestPriority High
       
 17818 @SYMTestActions Invokes cancelling of RMmCustomAPI::NotifyCellInfoChange
       
 17819 @SYMTestExpectedResults Pass
       
 17820 @SYMTestType CT
       
 17821 */
       
 17822 void CCTsyCustomIPCFU::TestNotifyCellInfoChange0002L()
       
 17823 	{
       
 17824 
       
 17825 	OpenEtelServerL(EUseExtendedError);
       
 17826 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
 17827 	OpenPhoneL();
       
 17828 
       
 17829 	RMmCustomAPI customAPI;
       
 17830 	OpenCustomAPILC(customAPI, iPhone);
       
 17831 
       
 17832 	TRequestStatus mockLtsyStatus;
       
 17833 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
 17834 
       
 17835  	//-------------------------------------------------------------------------
       
 17836 	// Test cancelling of RMmCustomAPI::NotifyCellInfoChange
       
 17837  	//-------------------------------------------------------------------------
       
 17838 
       
 17839 	TRequestStatus requestStatus;
       
 17840 	RMmCustomAPI::TMmCellInfo* cellInfo = new(ELeave) RMmCustomAPI::TMmCellInfo;
       
 17841     CleanupStack::PushL(cellInfo);
       
 17842 	RMmCustomAPI::TMmCellInfoPckg cellInfoPckg(*cellInfo);
       
 17843 	
       
 17844 	customAPI.NotifyCellInfoChange(requestStatus, cellInfoPckg);
       
 17845 	
       
 17846 	customAPI.CancelAsyncRequest(ECustomNotifyCellInfoChangeIPC);
       
 17847 	
       
 17848 	RMmCustomAPI::TMmCellInfo* cell = new(ELeave) RMmCustomAPI::TMmCellInfo;
       
 17849     CleanupStack::PushL(cell);
       
 17850 	RMmCustomAPI::TMmCellInfoPckg cellPckg(*cell);	
       
 17851 
       
 17852 	iMockLTSY.CompleteL(ECustomNotifyCellInfoChangeIPC, KErrNone, cellPckg, 10);
       
 17853 	
       
 17854 	User::WaitForRequest(requestStatus);
       
 17855 	ASSERT_EQUALS(KErrCancel, requestStatus.Int());	
       
 17856  	
       
 17857 	User::WaitForRequest(mockLtsyStatus);
       
 17858 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());	
       
 17859 	
       
 17860 	AssertMockLtsyStatusL();
       
 17861 	
       
 17862 	CleanupStack::PopAndDestroy(4); 
       
 17863 	
       
 17864 	}
       
 17865 
       
 17866 
       
 17867 /**
       
 17868 @SYMTestCaseID BA-CTSY-CIPC-MCNCIC2-0003
       
 17869 @SYMComponent  telephony_ctsy
       
 17870 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::NotifyCellInfoChange with bad parameter data
       
 17871 @SYMTestPriority High
       
 17872 @SYMTestActions Invokes RMmCustomAPI::NotifyCellInfoChange with bad parameter data
       
 17873 @SYMTestExpectedResults Pass
       
 17874 @SYMTestType CT
       
 17875 */
       
 17876 void CCTsyCustomIPCFU::TestNotifyCellInfoChange0003L()
       
 17877 	{
       
 17878 
       
 17879 	OpenEtelServerL(EUseExtendedError);
       
 17880 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
 17881 	OpenPhoneL();
       
 17882 
       
 17883 	RMmCustomAPI customAPI;
       
 17884 	OpenCustomAPILC(customAPI, iPhone);
       
 17885 
       
 17886 	//-------------------------------------------------------------------------
       
 17887 	// Test B: Test passing wrong descriptor size to parameter in
       
 17888 	// RMmCustomAPI::NotifyCellInfoChange
       
 17889  	//-------------------------------------------------------------------------
       
 17890 	TRequestStatus requestStatus;
       
 17891 	TBuf8<1> littleBuf;
       
 17892 	
       
 17893 	customAPI.NotifyCellInfoChange(requestStatus, littleBuf);
       
 17894 	User::WaitForRequest(requestStatus);
       
 17895 	ASSERT_EQUALS(KErrArgument, requestStatus.Int());	
       
 17896 	AssertMockLtsyStatusL();
       
 17897 
       
 17898 	CleanupStack::PopAndDestroy(2, this);    // customAPI, this
       
 17899 
       
 17900 	}
       
 17901 
       
 17902 
       
 17903 /**
       
 17904 @SYMTestCaseID BA-CTSY-CIPC-MCNCIC2-0004
       
 17905 @SYMComponent  telephony_ctsy
       
 17906 @SYMTestCaseDesc Test support in CTSY for multiple client requests to RMmCustomAPI::NotifyCellInfoChange
       
 17907 @SYMTestPriority High
       
 17908 @SYMTestActions Invokes multiple client requests to RMmCustomAPI::NotifyCellInfoChange
       
 17909 @SYMTestExpectedResults Pass
       
 17910 @SYMTestType CT
       
 17911 */
       
 17912 void CCTsyCustomIPCFU::TestNotifyCellInfoChange0004L()
       
 17913 	{
       
 17914 					
       
 17915 	OpenEtelServerL(EUseExtendedError);
       
 17916 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
 17917 	OpenPhoneL();
       
 17918 
       
 17919 	// Open second client
       
 17920 	RTelServer telServer2;
       
 17921 	TInt ret = telServer2.Connect();
       
 17922 	ASSERT_EQUALS(KErrNone, ret);
       
 17923 	CleanupClosePushL(telServer2);
       
 17924 
       
 17925 	RMobilePhone phone2;
       
 17926 	ret = phone2.Open(telServer2,KMmTsyPhoneName);
       
 17927 	ASSERT_EQUALS(KErrNone, ret);
       
 17928 	CleanupClosePushL(phone2);
       
 17929 
       
 17930 
       
 17931 	RMmCustomAPI customAPI;
       
 17932 	OpenCustomAPILC(customAPI, iPhone);
       
 17933 
       
 17934 	RMmCustomAPI customAPI2;
       
 17935 	OpenCustomAPILC(customAPI2, phone2, EFalse);
       
 17936 
       
 17937 	TRequestStatus requestStatus;
       
 17938 	TRequestStatus requestStatus2;
       
 17939 	RMmCustomAPI::TMmCellInfo* cellInfo = new(ELeave) RMmCustomAPI::TMmCellInfo;
       
 17940     CleanupStack::PushL(cellInfo);
       
 17941 	RMmCustomAPI::TMmCellInfoPckg cellInfoPckg(*cellInfo);
       
 17942 	RMmCustomAPI::TMmCellInfo* cellInfo2 = new(ELeave) RMmCustomAPI::TMmCellInfo;
       
 17943     CleanupStack::PushL(cellInfo2);
       
 17944 	RMmCustomAPI::TMmCellInfoPckg cellInfoPckg2(*cellInfo2);
       
 17945 	
       
 17946 	customAPI.NotifyCellInfoChange(requestStatus, cellInfoPckg);
       
 17947 	customAPI2.NotifyCellInfoChange(requestStatus2, cellInfoPckg2);
       
 17948 	
       
 17949 	RMmCustomAPI::TMmCellInfo* cell = new(ELeave) RMmCustomAPI::TMmCellInfo;
       
 17950     CleanupStack::PushL(cell);
       
 17951 	RMmCustomAPI::TMmCellInfoPckg cellPckg(*cell);
       
 17952 
       
 17953 	FillWithRandomData(*cell);
       
 17954 
       
 17955 	iMockLTSY.CompleteL(ECustomNotifyCellInfoChangeIPC, KErrNone, cellPckg);
       
 17956 
       
 17957 	User::WaitForRequest(requestStatus);
       
 17958 	ASSERT_EQUALS(KErrNone, requestStatus.Int());	
       
 17959 	ASSERT_TRUE( TComparator<RMmCustomAPI::TMmCellInfo>::IsEqual(*cell, *cellInfo) );
       
 17960 
       
 17961 	User::WaitForRequest(requestStatus2);
       
 17962 	ASSERT_EQUALS(KErrNone, requestStatus2.Int());	
       
 17963 	ASSERT_TRUE( TComparator<RMmCustomAPI::TMmCellInfo>::IsEqual(*cell, *cellInfo2) );
       
 17964 
       
 17965 	AssertMockLtsyStatusL();
       
 17966 	
       
 17967 	CleanupStack::PopAndDestroy(8, this);
       
 17968 
       
 17969 	}
       
 17970 
       
 17971 /**
       
 17972 @SYMTestCaseID BA-CTSY-CIPC-MCGSNB-0001
       
 17973 @SYMComponent telephony_ctsy
       
 17974 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::GetSystemNetworkBand
       
 17975 @SYMTestPriority High
       
 17976 @SYMTestActions Invokes RMmCustomAPI::GetSystemNetworkBand
       
 17977 @SYMTestExpectedResults Pass
       
 17978 @SYMTestType CT
       
 17979 */
       
 17980 
       
 17981 void CCTsyCustomIPCFU::TestGetSystemNetworkBand0001L()
       
 17982 	{
       
 17983 	
       
 17984 	OpenEtelServerL(EUseExtendedError);
       
 17985 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
 17986 	OpenPhoneL();
       
 17987 
       
 17988 	RBuf8 completeData;
       
 17989 	CleanupClosePushL(completeData);
       
 17990 
       
 17991 	RMmCustomAPI customAPI;
       
 17992 	OpenCustomAPILC(customAPI, iPhone);
       
 17993 
       
 17994     TRequestStatus requestStatus;
       
 17995     RMmCustomAPI::TBandSelection band;
       
 17996     RMmCustomAPI::TNetworkModeCaps mode;
       
 17997      	
       
 17998  	//-------------------------------------------------------------------------
       
 17999 	// TEST A: failure to dispatch request to LTSY
       
 18000  	//-------------------------------------------------------------------------
       
 18001 
       
 18002     iMockLTSY.ExpectL( ECustomGetBandSelectionIPC, KErrNotSupported);
       
 18003     
       
 18004     customAPI.GetSystemNetworkBand(requestStatus, band, mode);
       
 18005 	
       
 18006 	User::WaitForRequest(requestStatus);	
       
 18007 	ASSERT_EQUALS(KErrNotSupported, requestStatus.Int());
       
 18008 
       
 18009 	AssertMockLtsyStatusL();
       
 18010 
       
 18011 	//-------------------------------------------------------------------------
       
 18012 	// TEST B: failure on completion of pending request from LTSY->CTSY
       
 18013  	//-------------------------------------------------------------------------
       
 18014 
       
 18015     iMockLTSY.ExpectL( ECustomGetBandSelectionIPC);
       
 18016 		
       
 18017     RMmCustomAPI::TBandSelection compBand = RMmCustomAPI::ENetworkBandUmts850;
       
 18018     RMmCustomAPI::TNetworkModeCaps compMode = RMmCustomAPI::KCapsNetworkModeGsm;
       
 18019 	
       
 18020 	TMockLtsyData2 <RMmCustomAPI::TBandSelection, RMmCustomAPI::TNetworkModeCaps> 
       
 18021 															ltsyData(compBand, compMode);
       
 18022 	ltsyData.SerialiseL(completeData);	
       
 18023 	
       
 18024 	iMockLTSY.CompleteL(ECustomGetBandSelectionIPC, KErrGeneral, completeData);
       
 18025 
       
 18026     customAPI.GetSystemNetworkBand(requestStatus, band, mode);
       
 18027 	
       
 18028 	User::WaitForRequest(requestStatus);	
       
 18029 	ASSERT_EQUALS(KErrGeneral, requestStatus.Int());
       
 18030 
       
 18031 	AssertMockLtsyStatusL();
       
 18032 
       
 18033  	//-------------------------------------------------------------------------
       
 18034 	// TEST C: Successful completion request of
       
 18035 	// RMmCustomAPI::GetSystemNetworkBand when result is not cached.
       
 18036  	//-------------------------------------------------------------------------
       
 18037 
       
 18038     iMockLTSY.ExpectL( ECustomGetBandSelectionIPC);
       
 18039     iMockLTSY.CompleteL( ECustomGetBandSelectionIPC, KErrNone, completeData);
       
 18040 
       
 18041     customAPI.GetSystemNetworkBand(requestStatus, band, mode);
       
 18042 	
       
 18043 	User::WaitForRequest(requestStatus);	
       
 18044 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
 18045 
       
 18046 	ASSERT_TRUE(compBand == band);
       
 18047 	ASSERT_TRUE(compMode == mode);
       
 18048 	
       
 18049 	AssertMockLtsyStatusL();
       
 18050 
       
 18051  	//-------------------------------------------------------------------------
       
 18052 	// TEST E: Unsolicited completion of RMmCustomAPI::GetSystemNetworkBand
       
 18053 	// from LTSY.
       
 18054  	//-------------------------------------------------------------------------
       
 18055 
       
 18056 	TRequestStatus mockLtsyStatus;
       
 18057 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
 18058 
       
 18059     iMockLTSY.CompleteL( ECustomGetBandSelectionIPC, KErrNone, completeData);
       
 18060 
       
 18061 	User::WaitForRequest(mockLtsyStatus);
       
 18062 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
 18063 
       
 18064 	AssertMockLtsyStatusL();
       
 18065 	CleanupStack::PopAndDestroy(3, this); // customAPI, completeData, this
       
 18066 		
       
 18067 	}
       
 18068 
       
 18069 
       
 18070 /**
       
 18071 @SYMTestCaseID BA-CTSY-CIPC-MCGSNB-0002
       
 18072 @SYMComponent  telephony_ctsy
       
 18073 @SYMTestCaseDesc Test support in CTSY for cancelling of RMmCustomAPI::GetSystemNetworkBand
       
 18074 @SYMTestPriority High
       
 18075 @SYMTestActions Invokes cancelling of RMmCustomAPI::GetSystemNetworkBand
       
 18076 @SYMTestExpectedResults Pass
       
 18077 @SYMTestType CT
       
 18078 */
       
 18079 void CCTsyCustomIPCFU::TestGetSystemNetworkBand0002L()
       
 18080 	{
       
 18081 
       
 18082 	OpenEtelServerL(EUseExtendedError);
       
 18083 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
 18084 	OpenPhoneL();
       
 18085 
       
 18086 	RBuf8 completeData;
       
 18087 	CleanupClosePushL(completeData);
       
 18088 
       
 18089 	RMmCustomAPI customAPI;
       
 18090 	OpenCustomAPILC(customAPI, iPhone);
       
 18091 
       
 18092     TRequestStatus requestStatus;
       
 18093     RMmCustomAPI::TBandSelection band;
       
 18094     RMmCustomAPI::TNetworkModeCaps mode;
       
 18095 
       
 18096 
       
 18097  	//-------------------------------------------------------------------------
       
 18098 	// Test cancelling of RMmCustomAPI::GetSystemNetworkBand
       
 18099  	//-------------------------------------------------------------------------
       
 18100 
       
 18101     iMockLTSY.ExpectL( ECustomGetBandSelectionIPC);
       
 18102     
       
 18103 
       
 18104     RMmCustomAPI::TBandSelection compBand = RMmCustomAPI::ENetworkBandUmts850;
       
 18105     RMmCustomAPI::TNetworkModeCaps compMode = RMmCustomAPI::KCapsNetworkModeGsm;
       
 18106 	
       
 18107 	TMockLtsyData2 <RMmCustomAPI::TBandSelection, RMmCustomAPI::TNetworkModeCaps> 
       
 18108 															ltsyData(compBand, compMode);
       
 18109 	ltsyData.SerialiseL(completeData);	
       
 18110 	
       
 18111     customAPI.GetSystemNetworkBand(requestStatus, band, mode);
       
 18112 	
       
 18113 	customAPI.CancelAsyncRequest(ECustomGetBandSelectionIPC);
       
 18114 
       
 18115 	User::WaitForRequest(requestStatus);	
       
 18116 	ASSERT_EQUALS(KErrCancel, requestStatus.Int());
       
 18117 
       
 18118 	TRequestStatus mockLtsyStatus;
       
 18119 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
 18120 
       
 18121     iMockLTSY.CompleteL( ECustomGetBandSelectionIPC, KErrNone, completeData);
       
 18122 
       
 18123 	User::WaitForRequest(mockLtsyStatus);
       
 18124 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
 18125 
       
 18126 	AssertMockLtsyStatusL();
       
 18127 
       
 18128 	CleanupStack::PopAndDestroy(3); // customAPI, completeData, this
       
 18129 		
       
 18130 	}
       
 18131 
       
 18132 
       
 18133 /**
       
 18134 @SYMTestCaseID BA-CTSY-CIPC-MCGSNB-0004
       
 18135 @SYMComponent  telephony_ctsy
       
 18136 @SYMTestCaseDesc Test support in CTSY for multiple client requests to RMmCustomAPI::GetSystemNetworkBand
       
 18137 @SYMTestPriority High
       
 18138 @SYMTestActions Invokes multiple client requests to RMmCustomAPI::GetSystemNetworkBand
       
 18139 @SYMTestExpectedResults Pass
       
 18140 @SYMTestType CT
       
 18141 */
       
 18142 void CCTsyCustomIPCFU::TestGetSystemNetworkBand0004L()
       
 18143 	{
       
 18144 	
       
 18145 	OpenEtelServerL(EUseExtendedError);
       
 18146 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
 18147 	OpenPhoneL();
       
 18148 
       
 18149 	// Open second client
       
 18150 	RTelServer telServer2;
       
 18151 	TInt ret = telServer2.Connect();
       
 18152 	ASSERT_EQUALS(KErrNone, ret);
       
 18153 	CleanupClosePushL(telServer2);
       
 18154 
       
 18155 	RMobilePhone phone2;
       
 18156 	ret = phone2.Open(telServer2,KMmTsyPhoneName);
       
 18157 	ASSERT_EQUALS(KErrNone, ret);
       
 18158 	CleanupClosePushL(phone2);
       
 18159 
       
 18160 	RBuf8 completeData;
       
 18161 	CleanupClosePushL(completeData);
       
 18162 
       
 18163 	RMmCustomAPI customAPI;
       
 18164 	OpenCustomAPILC(customAPI, iPhone);
       
 18165 
       
 18166 	RMmCustomAPI customAPI2;
       
 18167 	OpenCustomAPILC(customAPI2, phone2, EFalse);
       
 18168 
       
 18169     TRequestStatus requestStatus;
       
 18170     TRequestStatus requestStatus2;
       
 18171 
       
 18172     RMmCustomAPI::TBandSelection band;
       
 18173     RMmCustomAPI::TNetworkModeCaps mode;
       
 18174 
       
 18175     RMmCustomAPI::TBandSelection band2;
       
 18176     RMmCustomAPI::TNetworkModeCaps mode2;
       
 18177 	
       
 18178 	//-------------------------------------------------------------------------
       
 18179 	// Test A: Test multiple clients requesting RMmCustomAPI::GetSystemNetworkBand
       
 18180  	//-------------------------------------------------------------------------
       
 18181 
       
 18182     RMmCustomAPI::TBandSelection compBand = RMmCustomAPI::ENetworkBandUmts850;
       
 18183     RMmCustomAPI::TNetworkModeCaps compMode = RMmCustomAPI::KCapsNetworkModeGsm;
       
 18184 	
       
 18185 	TMockLtsyData2 <RMmCustomAPI::TBandSelection, RMmCustomAPI::TNetworkModeCaps> 
       
 18186 															ltsyData(compBand, compMode);
       
 18187 	ltsyData.SerialiseL(completeData);	
       
 18188 
       
 18189     iMockLTSY.ExpectL( ECustomGetBandSelectionIPC);
       
 18190     iMockLTSY.CompleteL( ECustomGetBandSelectionIPC, KErrNone, completeData, 20);
       
 18191 
       
 18192     customAPI.GetSystemNetworkBand(requestStatus, band, mode);
       
 18193 
       
 18194     customAPI2.GetSystemNetworkBand(requestStatus2, band2, mode2);
       
 18195     
       
 18196 	User::WaitForRequest(requestStatus);	
       
 18197 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
 18198     
       
 18199 	ASSERT_TRUE(compBand == band);
       
 18200 	ASSERT_TRUE(compMode == mode);
       
 18201 		    
       
 18202 	User::WaitForRequest(requestStatus2);	
       
 18203 	ASSERT_EQUALS(KErrServerBusy, requestStatus2.Int());
       
 18204 	
       
 18205 	AssertMockLtsyStatusL();
       
 18206 
       
 18207 	CleanupStack::PopAndDestroy(6, this);
       
 18208 	
       
 18209 	}
       
 18210 	
       
 18211 
       
 18212 /**
       
 18213 @SYMTestCaseID BA-CTSY-CIPC-MCGSNB-0005
       
 18214 @SYMComponent  telephony_ctsy
       
 18215 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::GetSystemNetworkBand with timeout
       
 18216 @SYMTestPriority High
       
 18217 @SYMTestActions Invokes RMmCustomAPI::GetSystemNetworkBand and tests for timeout
       
 18218 @SYMTestExpectedResults Pass
       
 18219 @SYMTestType CT
       
 18220 */
       
 18221 void CCTsyCustomIPCFU::TestGetSystemNetworkBand0005L()
       
 18222 	{
       
 18223 
       
 18224 	OpenEtelServerL(EUseExtendedError);
       
 18225 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
 18226 	OpenPhoneL();
       
 18227 
       
 18228 	RMmCustomAPI customAPI;
       
 18229 	OpenCustomAPILC(customAPI, iPhone);
       
 18230 
       
 18231     TRequestStatus requestStatus;
       
 18232     RMmCustomAPI::TBandSelection band;
       
 18233     RMmCustomAPI::TNetworkModeCaps mode;
       
 18234 
       
 18235     iMockLTSY.ExpectL( ECustomGetBandSelectionIPC);
       
 18236     
       
 18237     customAPI.GetSystemNetworkBand(requestStatus, band, mode);
       
 18238 	User::WaitForRequest(requestStatus);	
       
 18239 	ASSERT_EQUALS(KErrTimedOut, requestStatus.Int());
       
 18240 
       
 18241 	AssertMockLtsyStatusL();
       
 18242 
       
 18243 	CleanupStack::PopAndDestroy(2); // customAPI, this
       
 18244 	
       
 18245 	}
       
 18246 
       
 18247 
       
 18248 
       
 18249 
       
 18250 /**
       
 18251 @SYMTestCaseID BA-CTSY-CIPC-MCSSNB-0001
       
 18252 @SYMComponent telephony_ctsy
       
 18253 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::SetSystemNetworkBand
       
 18254 @SYMTestPriority High
       
 18255 @SYMTestActions Invokes RMmCustomAPI::SetSystemNetworkBand
       
 18256 @SYMTestExpectedResults Pass
       
 18257 @SYMTestType CT
       
 18258 */
       
 18259 
       
 18260 void CCTsyCustomIPCFU::TestSetSystemNetworkBand0001L()
       
 18261 	{
       
 18262 		
       
 18263 	OpenEtelServerL(EUseExtendedError);
       
 18264 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
 18265 	OpenPhoneL();
       
 18266 
       
 18267 	RBuf8 data;
       
 18268 	CleanupClosePushL(data);
       
 18269 
       
 18270 	RMmCustomAPI customAPI;
       
 18271 	OpenCustomAPILC(customAPI, iPhone);
       
 18272 
       
 18273     TRequestStatus requestStatus;
       
 18274 
       
 18275     RMmCustomAPI::TBandSelection band = RMmCustomAPI::ENetworkBandUmts850;
       
 18276     RMmCustomAPI::TNetworkModeCaps mode = RMmCustomAPI::KCapsNetworkModeGsm;
       
 18277 	
       
 18278 	TMockLtsyData2 <RMmCustomAPI::TBandSelection, RMmCustomAPI::TNetworkModeCaps> 
       
 18279 															ltsyData(band, mode);
       
 18280 	ltsyData.SerialiseL(data);	
       
 18281      	
       
 18282  	//-------------------------------------------------------------------------
       
 18283 	// TEST A: failure to dispatch request to LTSY
       
 18284  	//-------------------------------------------------------------------------
       
 18285 
       
 18286     iMockLTSY.ExpectL( ECustomSetBandSelectionIPC, data, KErrNotSupported);
       
 18287     
       
 18288     customAPI.SetSystemNetworkBand(requestStatus, band, mode);
       
 18289 	
       
 18290 	User::WaitForRequest(requestStatus);	
       
 18291 	ASSERT_EQUALS(KErrNotSupported, requestStatus.Int());
       
 18292 
       
 18293 	AssertMockLtsyStatusL();
       
 18294 
       
 18295 	//-------------------------------------------------------------------------
       
 18296 	// TEST B: failure on completion of pending request from LTSY->CTSY
       
 18297  	//-------------------------------------------------------------------------
       
 18298 
       
 18299     iMockLTSY.ExpectL( ECustomSetBandSelectionIPC, data);
       
 18300 		
       
 18301 	iMockLTSY.CompleteL(ECustomSetBandSelectionIPC, KErrGeneral);
       
 18302 
       
 18303     customAPI.SetSystemNetworkBand(requestStatus, band, mode);
       
 18304 	
       
 18305 	User::WaitForRequest(requestStatus);	
       
 18306 	ASSERT_EQUALS(KErrGeneral, requestStatus.Int());
       
 18307 
       
 18308 	AssertMockLtsyStatusL();
       
 18309 
       
 18310  	//-------------------------------------------------------------------------
       
 18311 	// TEST C: Successful completion request of
       
 18312 	// RMmCustomAPI::SetSystemNetworkBand when result is not cached.
       
 18313  	//-------------------------------------------------------------------------
       
 18314 
       
 18315     iMockLTSY.ExpectL( ECustomSetBandSelectionIPC, data);
       
 18316     iMockLTSY.CompleteL( ECustomSetBandSelectionIPC, KErrNone);
       
 18317 
       
 18318     customAPI.SetSystemNetworkBand(requestStatus, band, mode);
       
 18319 	
       
 18320 	User::WaitForRequest(requestStatus);	
       
 18321 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
 18322 
       
 18323 	AssertMockLtsyStatusL();
       
 18324 
       
 18325  	//-------------------------------------------------------------------------
       
 18326 	// TEST E: Unsolicited completion of RMmCustomAPI::SetSystemNetworkBand
       
 18327 	// from LTSY.
       
 18328  	//-------------------------------------------------------------------------
       
 18329 
       
 18330 	TRequestStatus mockLtsyStatus;
       
 18331 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
 18332 
       
 18333     iMockLTSY.CompleteL( ECustomSetBandSelectionIPC, KErrNone);
       
 18334 
       
 18335 	User::WaitForRequest(mockLtsyStatus);
       
 18336 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
 18337 
       
 18338 	AssertMockLtsyStatusL();
       
 18339 	CleanupStack::PopAndDestroy(3, this); 			
       
 18340 	}
       
 18341 
       
 18342 
       
 18343 /**
       
 18344 @SYMTestCaseID BA-CTSY-CIPC-MCSSNB-0002
       
 18345 @SYMComponent  telephony_ctsy
       
 18346 @SYMTestCaseDesc Test support in CTSY for cancelling of RMmCustomAPI::SetSystemNetworkBand
       
 18347 @SYMTestPriority High
       
 18348 @SYMTestActions Invokes cancelling of RMmCustomAPI::SetSystemNetworkBand
       
 18349 @SYMTestExpectedResults Pass
       
 18350 @SYMTestType CT
       
 18351 */
       
 18352 void CCTsyCustomIPCFU::TestSetSystemNetworkBand0002L()
       
 18353 	{
       
 18354 	//Test works on 9.6 but causes this step and rest of the suite to fail     
       
 18355 	//ASSERT_TRUE(EFalse);
       
 18356 	OpenEtelServerL(EUseExtendedError);
       
 18357 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
 18358 	OpenPhoneL();
       
 18359 
       
 18360 	RBuf8 data;
       
 18361 	CleanupClosePushL(data);
       
 18362 
       
 18363 	RMmCustomAPI customAPI;
       
 18364 	OpenCustomAPILC(customAPI, iPhone);
       
 18365 
       
 18366     TRequestStatus requestStatus;
       
 18367     RMmCustomAPI::TBandSelection band = RMmCustomAPI::ENetworkBandUmts850;
       
 18368     RMmCustomAPI::TNetworkModeCaps mode = RMmCustomAPI::KCapsNetworkModeGsm;
       
 18369 	
       
 18370 	TMockLtsyData2 <RMmCustomAPI::TBandSelection, RMmCustomAPI::TNetworkModeCaps> 
       
 18371 															ltsyData(band, mode);
       
 18372 	ltsyData.SerialiseL(data);	
       
 18373 
       
 18374 	TRequestStatus mockLtsyStatus;
       
 18375 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
 18376 
       
 18377  	//-------------------------------------------------------------------------
       
 18378 	// Test cancelling of RMmCustomAPI::SetSystemNetworkBand
       
 18379  	//-------------------------------------------------------------------------
       
 18380 
       
 18381     iMockLTSY.ExpectL( ECustomSetBandSelectionIPC, data);
       
 18382     iMockLTSY.CompleteL( ECustomSetBandSelectionIPC, KErrNone);
       
 18383     
       
 18384     customAPI.SetSystemNetworkBand(requestStatus, band, mode);
       
 18385 	
       
 18386 	customAPI.CancelAsyncRequest(ECustomSetBandSelectionIPC);
       
 18387 
       
 18388 	User::WaitForRequest(requestStatus);	
       
 18389 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
 18390 
       
 18391 	AssertMockLtsyStatusL();
       
 18392 
       
 18393 	CleanupStack::PopAndDestroy(3); 		
       
 18394 	}
       
 18395 
       
 18396 
       
 18397 /**
       
 18398 @SYMTestCaseID BA-CTSY-CIPC-MCSSNB-0004
       
 18399 @SYMComponent  telephony_ctsy
       
 18400 @SYMTestCaseDesc Test support in CTSY for multiple client requests to RMmCustomAPI::SetSystemNetworkBand
       
 18401 @SYMTestPriority High
       
 18402 @SYMTestActions Invokes multiple client requests to RMmCustomAPI::SetSystemNetworkBand
       
 18403 @SYMTestExpectedResults Pass
       
 18404 @SYMTestType CT
       
 18405 */
       
 18406 void CCTsyCustomIPCFU::TestSetSystemNetworkBand0004L()
       
 18407 	{
       
 18408 	OpenEtelServerL(EUseExtendedError);
       
 18409 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
 18410 	OpenPhoneL();
       
 18411 
       
 18412 	// Open second client
       
 18413 	RTelServer telServer2;
       
 18414 	TInt ret = telServer2.Connect();
       
 18415 	ASSERT_EQUALS(KErrNone, ret);
       
 18416 	CleanupClosePushL(telServer2);
       
 18417 
       
 18418 	RMobilePhone phone2;
       
 18419 	ret = phone2.Open(telServer2,KMmTsyPhoneName);
       
 18420 	ASSERT_EQUALS(KErrNone, ret);
       
 18421 	CleanupClosePushL(phone2);
       
 18422 
       
 18423 	RBuf8 data;
       
 18424 	CleanupClosePushL(data);
       
 18425 
       
 18426 	RMmCustomAPI customAPI;
       
 18427 	OpenCustomAPILC(customAPI, iPhone);
       
 18428 
       
 18429 	RMmCustomAPI customAPI2;
       
 18430 	OpenCustomAPILC(customAPI2, phone2, EFalse);
       
 18431 
       
 18432     TRequestStatus requestStatus;
       
 18433     TRequestStatus requestStatus2;
       
 18434 
       
 18435     RMmCustomAPI::TBandSelection band = RMmCustomAPI::ENetworkBandUmts850;
       
 18436     RMmCustomAPI::TNetworkModeCaps mode = RMmCustomAPI::KCapsNetworkModeGsm;
       
 18437 	
       
 18438 	TMockLtsyData2 <RMmCustomAPI::TBandSelection, RMmCustomAPI::TNetworkModeCaps> 
       
 18439 															ltsyData(band, mode);
       
 18440 	ltsyData.SerialiseL(data);	
       
 18441 
       
 18442     RMmCustomAPI::TBandSelection band2 = RMmCustomAPI::ENetworkBandUmts850;
       
 18443     RMmCustomAPI::TNetworkModeCaps mode2 = RMmCustomAPI::KCapsNetworkModeGsm;
       
 18444 	
       
 18445 	//-------------------------------------------------------------------------
       
 18446 	// Test A: Test multiple clients requesting RMmCustomAPI::GetSystemNetworkBand
       
 18447  	//-------------------------------------------------------------------------
       
 18448 
       
 18449     iMockLTSY.ExpectL( ECustomSetBandSelectionIPC, data);
       
 18450     iMockLTSY.CompleteL( ECustomSetBandSelectionIPC, KErrNone);
       
 18451 
       
 18452     customAPI.SetSystemNetworkBand(requestStatus, band, mode);
       
 18453 
       
 18454     customAPI2.SetSystemNetworkBand(requestStatus2, band2, mode2);
       
 18455     
       
 18456 	User::WaitForRequest(requestStatus);	
       
 18457 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
 18458     
       
 18459 	User::WaitForRequest(requestStatus2);	
       
 18460 	ASSERT_EQUALS(KErrServerBusy, requestStatus2.Int());
       
 18461 	
       
 18462 	AssertMockLtsyStatusL();
       
 18463 
       
 18464 	CleanupStack::PopAndDestroy(6, this);	
       
 18465 	}
       
 18466 	
       
 18467 
       
 18468 /**
       
 18469 @SYMTestCaseID BA-CTSY-CIPC-MCSSNB-0005
       
 18470 @SYMComponent  telephony_ctsy
       
 18471 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::SetSystemNetworkBand with timeout
       
 18472 @SYMTestPriority High
       
 18473 @SYMTestActions Invokes RMmCustomAPI::SetSystemNetworkBand and tests for timeout
       
 18474 @SYMTestExpectedResults Pass
       
 18475 @SYMTestType CT
       
 18476 */
       
 18477 void CCTsyCustomIPCFU::TestSetSystemNetworkBand0005L()
       
 18478 	{
       
 18479 
       
 18480 	OpenEtelServerL(EUseExtendedError);
       
 18481 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
 18482 	OpenPhoneL();
       
 18483 
       
 18484 	RBuf8 data;
       
 18485 	CleanupClosePushL(data);
       
 18486 
       
 18487 	RMmCustomAPI customAPI;
       
 18488 	OpenCustomAPILC(customAPI, iPhone);
       
 18489 
       
 18490     TRequestStatus requestStatus;
       
 18491     RMmCustomAPI::TBandSelection band = RMmCustomAPI::ENetworkBandUmts850;
       
 18492     RMmCustomAPI::TNetworkModeCaps mode = RMmCustomAPI::KCapsNetworkModeGsm;
       
 18493 	
       
 18494 	TMockLtsyData2 <RMmCustomAPI::TBandSelection, RMmCustomAPI::TNetworkModeCaps> 
       
 18495 															ltsyData(band, mode);
       
 18496 	ltsyData.SerialiseL(data);	
       
 18497 
       
 18498     iMockLTSY.ExpectL( ECustomSetBandSelectionIPC, data);
       
 18499     
       
 18500     customAPI.SetSystemNetworkBand(requestStatus, band, mode);
       
 18501 
       
 18502 	ERR_PRINTF2(_L("<font color=Orange>$CTSYKnownFailure: defect id = %d</font>"), 407702);
       
 18503 	// RMmCustomAPI::SetSystemNetworkBand is not completed by timeout.
       
 18504 	
       
 18505 	User::WaitForRequest(requestStatus);	
       
 18506 	ASSERT_EQUALS(KErrTimedOut, requestStatus.Int());
       
 18507 
       
 18508 	AssertMockLtsyStatusL();
       
 18509 
       
 18510 	CleanupStack::PopAndDestroy(3); 	
       
 18511 		
       
 18512 	}
       
 18513 
       
 18514 
       
 18515 
       
 18516 /**
       
 18517 @SYMTestCaseID BA-CTSY-CIPC-USS-0001
       
 18518 @SYMComponent  telephony_ctsy
       
 18519 @SYMTestCaseDesc Test support in CTSY for RMmCustomAPI::GetUSIMServiceSupport
       
 18520 @SYMTestPriority High
       
 18521 @SYMTestActions Invokes RMmCustomAPI::GetUSIMServiceSupport
       
 18522 @SYMTestExpectedResults Pass
       
 18523 @SYMTestType CT
       
 18524 */
       
 18525 void CCTsyCustomIPCFU::TestGetUSIMServiceSupport0001L()
       
 18526 	{
       
 18527 	//Setup
       
 18528 	OpenEtelServerL(EUseExtendedError);
       
 18529 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
 18530 	OpenPhoneL();
       
 18531 	RMmCustomAPI customAPI;
       
 18532 	OpenCustomAPILC(customAPI, iPhone);
       
 18533 	//End Setup
       
 18534 		
       
 18535 	// Start	
       
 18536 	
       
 18537 	//-------------------------------------------------------------------------
       
 18538 	// TEST A: failure to dispatch request to LTSY
       
 18539 	//-------------------------------------------------------------------------
       
 18540 
       
 18541 	TInt appNum = 68;		// fill expected appNumber
       
 18542     TPckg<TInt> appNumPckg(appNum);
       
 18543 	iMockLTSY.ExpectL( ECustomGetServiceTableSupportbyApplicationIPC, appNumPckg, KErrNotSupported);
       
 18544 
       
 18545 	TRequestStatus requestStatus;
       
 18546 	RMmCustomAPI::TAppSupport usimSupport;
       
 18547 	usimSupport.iAppNum=appNum;
       
 18548 	usimSupport.iSupported=ETrue;
       
 18549 	customAPI.GetUSIMServiceSupport(requestStatus, usimSupport);
       
 18550 		
       
 18551 	User::WaitForRequest(requestStatus);	
       
 18552 	ASSERT_EQUALS(KErrNotSupported, requestStatus.Int());
       
 18553 
       
 18554 	AssertMockLtsyStatusL();	
       
 18555 	
       
 18556 	// Successful call
       
 18557 	// Expect and Complete Calls
       
 18558 
       
 18559 	iMockLTSY.ExpectL( ECustomGetServiceTableSupportbyApplicationIPC, appNumPckg);
       
 18560 	
       
 18561     RMmCustomAPI::TAppSupport compData;
       
 18562 	compData.iAppNum = 68;		// fill 
       
 18563 	compData.iSupported = EFalse; //app is not supported
       
 18564     TPckg<RMmCustomAPI::TAppSupport> compPckg(compData);
       
 18565 	iMockLTSY.CompleteL( ECustomGetServiceTableSupportbyApplicationIPC, KErrNone, compPckg);
       
 18566 	
       
 18567 	//Call API
       
 18568 	customAPI.GetUSIMServiceSupport(requestStatus, usimSupport);
       
 18569 	User::WaitForRequest(requestStatus);
       
 18570 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
 18571 	ASSERT_EQUALS(68, usimSupport.iAppNum);
       
 18572 	ASSERT_TRUE(EFalse == usimSupport.iSupported);
       
 18573 	AssertMockLtsyStatusL();		
       
 18574 
       
 18575 	//Not Supported
       
 18576 	// Expect and Complete Calls
       
 18577 	iMockLTSY.ExpectL( ECustomGetServiceTableSupportbyApplicationIPC, appNumPckg);
       
 18578 	iMockLTSY.CompleteL( ECustomGetServiceTableSupportbyApplicationIPC, KErrNotSupported, compPckg);
       
 18579 
       
 18580 	customAPI.GetUSIMServiceSupport(requestStatus, usimSupport);
       
 18581 	User::WaitForRequest(requestStatus);
       
 18582 	ASSERT_EQUALS(KErrNotSupported, requestStatus.Int());
       
 18583 	AssertMockLtsyStatusL();
       
 18584 	
       
 18585 	//KErrGeneral
       
 18586 	// Expect and Complete Calls
       
 18587 	iMockLTSY.ExpectL( ECustomGetServiceTableSupportbyApplicationIPC, appNumPckg);
       
 18588 	iMockLTSY.CompleteL( ECustomGetServiceTableSupportbyApplicationIPC, KErrGeneral, compPckg);
       
 18589 
       
 18590 	customAPI.GetUSIMServiceSupport(requestStatus, usimSupport);
       
 18591 	User::WaitForRequest(requestStatus);
       
 18592 	ASSERT_EQUALS(KErrGeneral, requestStatus.Int());
       
 18593 	AssertMockLtsyStatusL();
       
 18594 	
       
 18595 	//End
       
 18596 	CleanupStack::PopAndDestroy(2); 		//this, customAPI
       
 18597 	}
       
 18598 
       
 18599 /**
       
 18600 @SYMTestCaseID BA-CTSY-CIPC-USS-0002
       
 18601 @SYMComponent  telephony_ctsy
       
 18602 @SYMTestCaseDesc Test cancel of RMmCustomAPI::GetUSIMServiceSupport
       
 18603 @SYMTestPriority High
       
 18604 @SYMTestActions Invokes RMmCustomAPI::GetUSIMServiceSupport
       
 18605 @SYMTestExpectedResults Pass
       
 18606 @SYMTestType CT
       
 18607 */
       
 18608 void CCTsyCustomIPCFU::TestGetUSIMServiceSupport0002L()
       
 18609 	{
       
 18610 	//Setup
       
 18611 	OpenEtelServerL(EUseExtendedError);
       
 18612 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
 18613 	OpenPhoneL();
       
 18614 	RMmCustomAPI customAPI;
       
 18615 	OpenCustomAPILC(customAPI, iPhone);
       
 18616 	//End Setup
       
 18617 		
       
 18618 	// Start	
       
 18619 	// Successful call
       
 18620 	// Expect and Complete Calls
       
 18621     TInt appNum = 68;		// fill expected appNumber 
       
 18622     TPckg<TInt> appNumPckg(appNum);
       
 18623 	iMockLTSY.ExpectL( ECustomGetServiceTableSupportbyApplicationIPC, appNumPckg);
       
 18624 	
       
 18625 	//Call API
       
 18626 	TRequestStatus requestStatus;
       
 18627 	RMmCustomAPI::TAppSupport usimSupport;
       
 18628 	usimSupport.iAppNum=appNum;
       
 18629 	usimSupport.iSupported=ETrue;
       
 18630 	customAPI.GetUSIMServiceSupport(requestStatus, usimSupport);
       
 18631 
       
 18632 	customAPI.CancelAsyncRequest(ECustomGetServiceTableSupportbyApplicationIPC);
       
 18633 	User::WaitForRequest(requestStatus);
       
 18634 	ASSERT_EQUALS(KErrCancel, requestStatus.Int());
       
 18635 
       
 18636 	//End
       
 18637 	AssertMockLtsyStatusL();
       
 18638 	CleanupStack::PopAndDestroy(2); 		//this, customAPI
       
 18639 	}
       
 18640 
       
 18641 /**
       
 18642 @SYMTestCaseID BA-CTSY-CIPC-USS-0003
       
 18643 @SYMComponent  telephony_ctsy
       
 18644 @SYMTestCaseDesc Test cancel of RMmCustomAPI::GetUSIMServiceSupport
       
 18645 @SYMTestPriority High
       
 18646 @SYMTestActions Invokes RMmCustomAPI::GetUSIMServiceSupport
       
 18647 @SYMTestExpectedResults Pass
       
 18648 @SYMTestType CT
       
 18649 */
       
 18650 void CCTsyCustomIPCFU::TestGetUSIMServiceSupport0003L()
       
 18651 	{
       
 18652 	//Setup
       
 18653 	OpenEtelServerL(EUseExtendedError);
       
 18654 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
 18655 	OpenPhoneL();
       
 18656 	RMmCustomAPI customAPI;
       
 18657 	OpenCustomAPILC(customAPI, iPhone);
       
 18658 	//End Setup
       
 18659 
       
 18660 	// Start	
       
 18661 	// Pass negative appNum
       
 18662 	// Expect and Complete Calls
       
 18663     TInt appNum = -5;		 
       
 18664     TPckg<TInt> appNumPckg(appNum);
       
 18665 	iMockLTSY.ExpectL( ECustomGetServiceTableSupportbyApplicationIPC, appNumPckg);
       
 18666 	
       
 18667     RMmCustomAPI::TAppSupport compData;
       
 18668 	compData.iAppNum = -5;		// fill 
       
 18669 	compData.iSupported = EFalse; //app is not supported
       
 18670     TPckg<RMmCustomAPI::TAppSupport> compPckg(compData);
       
 18671 	iMockLTSY.CompleteL( ECustomGetServiceTableSupportbyApplicationIPC, KErrNotFound, compPckg);
       
 18672 
       
 18673 	
       
 18674 	//Call API
       
 18675 	TRequestStatus requestStatus;
       
 18676 	RMmCustomAPI::TAppSupport usimSupport;
       
 18677 	usimSupport.iAppNum=-5;
       
 18678 	usimSupport.iSupported=ETrue;
       
 18679 	customAPI.GetUSIMServiceSupport(requestStatus, usimSupport);
       
 18680 	User::WaitForRequest(requestStatus);
       
 18681 	
       
 18682 	ASSERT_EQUALS(KErrNotFound, requestStatus.Int());
       
 18683 
       
 18684 	AssertMockLtsyStatusL();
       
 18685 	
       
 18686 	//End
       
 18687 	CleanupStack::PopAndDestroy(2); 		//this, customAPI
       
 18688 	}
       
 18689 
       
 18690 /**
       
 18691 @SYMTestCaseID BA-CTSY-CIPC-USS-0004
       
 18692 @SYMComponent  telephony_ctsy
       
 18693 @SYMTestCaseDesc Test multiple client requests to RMmCustomAPI::GetUSIMServiceSupport
       
 18694 @SYMTestPriority High
       
 18695 @SYMTestActions Invokes RMmCustomAPI::GetUSIMServiceSupport
       
 18696 @SYMTestExpectedResults Pass
       
 18697 @SYMTestType CT
       
 18698 */
       
 18699 void CCTsyCustomIPCFU::TestGetUSIMServiceSupport0004L()
       
 18700 	{
       
 18701 	//Setup
       
 18702 	OpenEtelServerL(EUseExtendedError);
       
 18703 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
 18704 	OpenPhoneL();
       
 18705 
       
 18706 	// Open second client
       
 18707 	RTelServer telServer2;
       
 18708 	TInt ret = telServer2.Connect();
       
 18709 	ASSERT_EQUALS(KErrNone, ret);
       
 18710 	CleanupClosePushL(telServer2);
       
 18711 
       
 18712 	RMobilePhone phone2;
       
 18713 	ret = phone2.Open(telServer2,KMmTsyPhoneName);
       
 18714 	ASSERT_EQUALS(KErrNone, ret);
       
 18715 	CleanupClosePushL(phone2);
       
 18716 	
       
 18717 	RMmCustomAPI customAPI;
       
 18718 	OpenCustomAPILC(customAPI, iPhone);
       
 18719 	RMmCustomAPI customAPI2;
       
 18720 	OpenCustomAPILC(customAPI2, phone2, EFalse);
       
 18721 	//End Setup
       
 18722 
       
 18723 	// Start
       
 18724 	// 1st Client Request
       
 18725 	TInt appNum = 68;		// fill expected appNumber
       
 18726     TPckg<TInt> appNumPckg(appNum);
       
 18727 	iMockLTSY.ExpectL( ECustomGetServiceTableSupportbyApplicationIPC, appNumPckg, KErrNone);
       
 18728 
       
 18729     RMmCustomAPI::TAppSupport compData;
       
 18730 	compData.iAppNum = 68;		// fill 
       
 18731 	compData.iSupported = ETrue; //app is not supported
       
 18732     TPckg<RMmCustomAPI::TAppSupport> compPckg(compData);
       
 18733 	
       
 18734 	TRequestStatus requestStatus;
       
 18735 	RMmCustomAPI::TAppSupport usimSupport;
       
 18736 	usimSupport.iAppNum=appNum;
       
 18737 	usimSupport.iSupported=EFalse;
       
 18738 	iMockLTSY.CompleteL( ECustomGetServiceTableSupportbyApplicationIPC, KErrNone, compPckg);
       
 18739 	
       
 18740 	// 2nd Client Request
       
 18741 	TInt appNum2 = 67;		// fill expected appNumber
       
 18742 	TRequestStatus requestStatus2;
       
 18743 	RMmCustomAPI::TAppSupport usimSupport2;
       
 18744 	usimSupport2.iAppNum=appNum2;
       
 18745 	usimSupport2.iSupported=EFalse;
       
 18746 	
       
 18747 	customAPI.GetUSIMServiceSupport(requestStatus, usimSupport);
       
 18748 	customAPI2.GetUSIMServiceSupport(requestStatus2, usimSupport2);
       
 18749 
       
 18750 	User::WaitForRequest(requestStatus);
       
 18751 	User::WaitForRequest(requestStatus2);
       
 18752 	
       
 18753 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
 18754 	ASSERT_EQUALS(KErrServerBusy, requestStatus2.Int());
       
 18755 
       
 18756 	AssertMockLtsyStatusL();	
       
 18757 	
       
 18758 	//End
       
 18759 	CleanupStack::PopAndDestroy(5); 		//this, telserver2, phone2, customAPI, customAPI2
       
 18760 	}
       
 18761 
       
 18762 
       
 18763 /**
       
 18764 @SYMTestCaseID BA-CTSY-CIPC-USS-0005
       
 18765 @SYMComponent  telephony_ctsy
       
 18766 @SYMTestCaseDesc Test timeout for request RMmCustomAPI::GetUSIMServiceSupport
       
 18767 @SYMTestPriority High
       
 18768 @SYMTestActions Invokes RMmCustomAPI::GetUSIMServiceSupport
       
 18769 @SYMTestExpectedResults Pass
       
 18770 @SYMTestType CT
       
 18771 */
       
 18772 void CCTsyCustomIPCFU::TestGetUSIMServiceSupport0005L()
       
 18773 	{
       
 18774 	//Setup
       
 18775 	OpenEtelServerL(EUseExtendedError);
       
 18776 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
 18777 	OpenPhoneL();
       
 18778 	RMmCustomAPI customAPI;
       
 18779 	OpenCustomAPILC(customAPI, iPhone);
       
 18780 	//End Setup
       
 18781 		
       
 18782 	// Start	
       
 18783 	TInt appNum = 68;		// fill expected appNumber
       
 18784     TPckg<TInt> appNumPckg(appNum);
       
 18785 	iMockLTSY.ExpectL( ECustomGetServiceTableSupportbyApplicationIPC, appNumPckg, KErrNone);
       
 18786 
       
 18787 	TRequestStatus requestStatus;
       
 18788 	RMmCustomAPI::TAppSupport usimSupport;
       
 18789 	usimSupport.iAppNum=appNum;
       
 18790 	usimSupport.iSupported=ETrue;
       
 18791 	customAPI.GetUSIMServiceSupport(requestStatus, usimSupport);
       
 18792 		
       
 18793 	User::WaitForRequest(requestStatus);	
       
 18794 	ASSERT_EQUALS(KErrTimedOut, requestStatus.Int());
       
 18795 
       
 18796 	AssertMockLtsyStatusL();	
       
 18797 	
       
 18798 	//End
       
 18799 	CleanupStack::PopAndDestroy(2); 		//this, customAPI
       
 18800 	}
       
 18801 
       
 18802 // Helper methods
       
 18803 void CCTsyCustomIPCFU::OpenCustomAPILC(RMmCustomAPI& aCustomAPI, RMobilePhone& aPhone, TBool aExpectNeeded)
       
 18804 	{
       
 18805 	RBuf8 data;
       
 18806 	CleanupClosePushL(data);
       
 18807 	
       
 18808 	if(aExpectNeeded)
       
 18809 		{			
       
 18810 		iMockLTSY.ExpectL(ECustomGetIccCallForwardingStatusIPC);
       
 18811 				
       
 18812 		RMmCustomAPI::TViagCacheRecordId currentlyRetrievedCache;
       
 18813 		currentlyRetrievedCache.iCacheId	= 1;
       
 18814 		currentlyRetrievedCache.iRecordId	= 0;		
       
 18815 		TMockLtsyData1 <RMmCustomAPI::TViagCacheRecordId> ltsyData(currentlyRetrievedCache);
       
 18816 		ltsyData.SerialiseL(data);			
       
 18817 		iMockLTSY.ExpectL(EReadViagHomeZoneCacheIPC, data);		
       
 18818 		}
       
 18819 
       
 18820 	TInt errorCode = aCustomAPI.Open(aPhone);
       
 18821 	ASSERT_EQUALS(KErrNone, errorCode);
       
 18822 	CleanupStack::PopAndDestroy (&data);
       
 18823 	CleanupClosePushL(aCustomAPI);
       
 18824 
       
 18825 	}
       
 18826 
       
 18827 void CCTsyCustomIPCFU::OpenCustomAPILC(RMmCustomAPI& aCustomAPI)
       
 18828 	{
       
 18829 	OpenCustomAPILC(aCustomAPI,iPhone);
       
 18830 	}
       
 18831 
       
 18832 
       
 18833 void CCTsyCustomIPCFU::OpenLineLC(RLine& aLine, RPhone& aPhone, const TDesC& aName)
       
 18834 	{
       
 18835 	
       
 18836 	TInt res = aLine.Open(aPhone, aName);
       
 18837 	ASSERT_EQUALS(KErrNone, res);
       
 18838 	CleanupClosePushL(aLine);
       
 18839 	AssertMockLtsyStatusL();
       
 18840 	
       
 18841 	}
       
 18842 	
       
 18843 	
       
 18844 void CCTsyCustomIPCFU::CreateAndOpenIncomingCalLC(RLine &aLine, 
       
 18845 														RCall &aCall,
       
 18846 														TName& aCallName,
       
 18847 														const TDesC& aLineName,
       
 18848 														const TInt aCallId,
       
 18849 														RMobileCall::TMobileCallStatus aMobileCallStatus,
       
 18850 														RMobilePhone::TMobileService aMobileService
       
 18851 														)
       
 18852 	{
       
 18853 	TInt ret = CreateIncomingCallL(aLine, aCallId, aLineName, aCallName, 
       
 18854 	                               aMobileService, aMobileCallStatus);	
       
 18855 	ASSERT_EQUALS(KErrNone, ret);
       
 18856 		
       
 18857     ret = aCall.OpenExistingCall(aLine, aCallName);
       
 18858     ASSERT_EQUALS(KErrNone, ret);
       
 18859 	CleanupClosePushL(aCall);
       
 18860 	}
       
 18861 
       
 18862 /**
       
 18863  * The purpose of this function is to invoke RMmCustomAPI::Open
       
 18864  * _before_ EMmTsyBootNotifySimStatusReadyIPC CTSY event is triggered and thus
       
 18865  * let the Viag Home Zome Cache to be initialized. 
       
 18866  */
       
 18867 void CCTsyCustomIPCFU::OpenPhoneAndCustomAPILC(RMmCustomAPI& aCustomAPI)
       
 18868 	{
       
 18869     CleanupClosePushL(aCustomAPI);
       
 18870 	TInt err = iPhone.Open(iTelServer,KMmTsyPhoneName);
       
 18871 	ASSERT_EQUALS(KErrNone, err);
       
 18872 
       
 18873 	err=iMockLTSY.Connect();
       
 18874 	ASSERT_EQUALS(KErrNone, err);
       
 18875 
       
 18876     RBuf8 data;
       
 18877     data.CleanupClosePushL();
       
 18878     RMmCustomAPI::TViagCacheRecordId currentlyRetrievedCache;
       
 18879     currentlyRetrievedCache.iCacheId    = 1;
       
 18880     currentlyRetrievedCache.iRecordId   = 0;        
       
 18881     TMockLtsyData1 <RMmCustomAPI::TViagCacheRecordId> ltsyData(currentlyRetrievedCache);
       
 18882 
       
 18883     
       
 18884     // 2-nd & all further EReadViagHomeZoneCacheIPC
       
 18885      for(TInt c = KViagHomeZoneCacheIdMin; c <= KViagHomeZoneCacheIdMax; c++)
       
 18886          {
       
 18887          for(TInt r = KViagHomeZoneCacheRecordIdMin; r <= KViagHomeZoneCacheRecordIdMax; r++)
       
 18888              {
       
 18889              MockPrimeEReadViagHomeZoneCacheIPCL(c,r);
       
 18890              }
       
 18891          }
       
 18892 
       
 18893     TRequestStatus mockLtsyStatus;
       
 18894 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
 18895 
       
 18896 	//************************************************************
       
 18897 	//* Invoke RMmCustomAPI::Open prior to triggering any further 
       
 18898 	//* CTSY events including EMmTsyBootNotifySimStatusReadyIPC
       
 18899 	//************************************************************
       
 18900 	err = aCustomAPI.Open(iPhone);
       
 18901 	ASSERT_EQUALS(KErrNone, err);
       
 18902 
       
 18903 	// EMmTsyBootNotifyModemStatusReadyIPC
       
 18904 	iMockLTSY.CompleteL(EMmTsyBootNotifyModemStatusReadyIPC,KErrNone);
       
 18905 
       
 18906 	// EMobilePhoneGetNetworkRegistrationStatus
       
 18907 	iMockLTSY.ExpectL(EMobilePhoneGetNetworkRegistrationStatus);
       
 18908 	iMockLTSY.CompleteL(EMobilePhoneGetNetworkRegistrationStatus,KErrNone,0);
       
 18909 
       
 18910 	// EMmTsyBootNotifySimStatusReadyIPC
       
 18911 	iMockLTSY.ExpectL(EMmTsyBootNotifySimStatusReadyIPC);
       
 18912 	iMockLTSY.CompleteL(EMmTsyBootNotifySimStatusReadyIPC,KErrNone,0);
       
 18913 
       
 18914 	
       
 18915 	// EMobilePhoneGetHomeNetwork
       
 18916 	RMobilePhone::TMobilePhoneNetworkInfoV5 homeNetwork;
       
 18917 	homeNetwork.iMode = RMobilePhone::ENetworkModeWcdma;
       
 18918 	homeNetwork.iStatus = RMobilePhone::ENetworkStatusCurrent;
       
 18919 	homeNetwork.iBandInfo = RMobilePhone::EBandUnknown;
       
 18920 	homeNetwork.iCountryCode = _L("234");
       
 18921 	homeNetwork.iCdmaSID = _L("");
       
 18922 	homeNetwork.iAnalogSID = _L("");
       
 18923 	homeNetwork.iNetworkId = _L("23499");
       
 18924 	homeNetwork.iDisplayTag = _L("symbian");
       
 18925 	homeNetwork.iShortName = _L("symbian");
       
 18926 	homeNetwork.iLongName = _L("symbian mobile");
       
 18927 	homeNetwork.iAccess = RMobilePhone::ENetworkAccessUtran;
       
 18928 	homeNetwork.iEgprsAvailableIndicator = ETrue;
       
 18929 	homeNetwork.iHsdpaAvailableIndicator = ETrue;
       
 18930 	TMockLtsyData1<RMobilePhone::TMobilePhoneNetworkInfoV5> homeNetworkData(homeNetwork);
       
 18931 	homeNetworkData.SerialiseL(data);
       
 18932 	iMockLTSY.ExpectL(EMobilePhoneGetHomeNetwork);
       
 18933 	iMockLTSY.CompleteL(EMobilePhoneGetHomeNetwork,KErrNone,data,0);
       
 18934 
       
 18935 	// EMmTsyPhoneGetPin1DisableSupportedIPC
       
 18936 	TBool pin1DisableSupport = ETrue;
       
 18937 	TMockLtsyData1<TBool> pin1DisableSupportData(pin1DisableSupport);
       
 18938 	data.Close();
       
 18939 	pin1DisableSupportData.SerialiseL(data);
       
 18940  	iMockLTSY.ExpectL(EMmTsyPhoneGetPin1DisableSupportedIPC);
       
 18941 	iMockLTSY.CompleteL(EMmTsyPhoneGetPin1DisableSupportedIPC,KErrNone,data,0);
       
 18942 
       
 18943 	// EMmTsySimRefreshRegisterIPC
       
 18944 	iMockLTSY.ExpectL(EMmTsySimRefreshRegisterIPC);
       
 18945 	iMockLTSY.CompleteL(EMmTsySimRefreshRegisterIPC, KErrGeneral, 0);		
       
 18946 
       
 18947 	// EMobilePhoneGetServiceTable
       
 18948 	RMobilePhone::TMobilePhoneServiceTable serviceTable = RMobilePhone::ESIMServiceTable;
       
 18949 	TMockLtsyData1<RMobilePhone::TMobilePhoneServiceTable> serviceTableData(serviceTable);
       
 18950 	data.Close();
       
 18951 	serviceTableData.SerialiseL(data);
       
 18952 	iMockLTSY.ExpectL(EMobilePhoneGetServiceTable, data);
       
 18953 	RMobilePhone::TMobilePhoneServiceTableV1 serviceTableResult;
       
 18954 	serviceTableResult.iServices1To8  = 0xFF;
       
 18955 	serviceTableResult.iServices9To16 = 0xFF;
       
 18956 	serviceTableResult.iServices17To24= 0xFF;
       
 18957 	serviceTableResult.iServices25To32= 0xFF;
       
 18958 	serviceTableResult.iServices33To40= 0xFF;
       
 18959 	serviceTableResult.iServices41To48= 0xFF;
       
 18960 	serviceTableResult.iServices49To56= 0xFF;
       
 18961 	TMockLtsyData1<RMobilePhone::TMobilePhoneServiceTableV1> serviceTableResultData(serviceTableResult);
       
 18962 	data.Close();
       
 18963 	serviceTableResultData.SerialiseL(data);
       
 18964 	iMockLTSY.CompleteL(EMobilePhoneGetServiceTable,KErrNone,data,0);
       
 18965 	
       
 18966 	// EMobilePhoneGetALSLine
       
 18967 	RMobilePhone::TMobilePhoneALSLine alsLine = RMobilePhone::EAlternateLinePrimary;
       
 18968 	TMockLtsyData1<RMobilePhone::TMobilePhoneALSLine> alsLineData(alsLine);
       
 18969 	data.Close();
       
 18970 	alsLineData.SerialiseL(data);
       
 18971 	iMockLTSY.ExpectL(EMobilePhoneGetALSLine);
       
 18972 	iMockLTSY.CompleteL(EMobilePhoneGetALSLine,KErrNone,data,0);
       
 18973 
       
 18974 	// ECustomGetIccCallForwardingStatusIPC
       
 18975 	iMockLTSY.ExpectL(ECustomGetIccCallForwardingStatusIPC);    
       
 18976 
       
 18977 	// EMobilePhoneGetIccMessageWaitingIndicators
       
 18978 	RMobilePhone::TMobilePhoneMessageWaitingV1 expectedMessageIndicators;
       
 18979 	TMockLtsyData1<RMobilePhone::TMobilePhoneMessageWaitingV1>
       
 18980 	                                indicatorsData(expectedMessageIndicators);
       
 18981 	data.Close();
       
 18982 	indicatorsData.SerialiseL(data); 
       
 18983 	iMockLTSY.ExpectL(EMobilePhoneGetIccMessageWaitingIndicators);
       
 18984 	iMockLTSY.CompleteL(EMobilePhoneGetIccMessageWaitingIndicators, KErrNone, data);
       
 18985 
       
 18986     iMockLTSY.ExpectL(ECustomCheckAlsPpSupportIPC);
       
 18987     iMockLTSY.ExpectL(EMobilePhoneGetCustomerServiceProfile);
       
 18988 	// 2-nd & all further EReadViagHomeZoneCacheIPC
       
 18989 	for(TInt c = KViagHomeZoneCacheIdMin; c <= KViagHomeZoneCacheIdMax; c++)
       
 18990 		{
       
 18991 		for(TInt r = KViagHomeZoneCacheRecordIdMin; r <= KViagHomeZoneCacheRecordIdMax; r++)
       
 18992 			{
       
 18993 			MockPrimeEReadViagHomeZoneCacheIPCL(c,r);
       
 18994 			}
       
 18995 		}
       
 18996 	
       
 18997 
       
 18998 	User::WaitForRequest(mockLtsyStatus);
       
 18999 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
 19000 	
       
 19001 	CleanupStack::PopAndDestroy(1,&data);
       
 19002 	}
       
 19003 
       
 19004 void CCTsyCustomIPCFU::MockPrimeEReadViagHomeZoneCacheIPCL(TInt aCacheId,TInt aRecordId,TBool aDoComplete, TBool aDoExpect)
       
 19005 	{
       
 19006 	RBuf8 data;
       
 19007 	data.CleanupClosePushL();
       
 19008 
       
 19009 	RMmCustomAPI::TViagCacheRecordId id;
       
 19010 	id.iCacheId  = aCacheId;
       
 19011 	id.iRecordId = aRecordId;
       
 19012 	if(aDoExpect)
       
 19013 	    {
       
 19014         TMockLtsyData1<RMmCustomAPI::TViagCacheRecordId> idData(id);
       
 19015         idData.SerialiseL(data);
       
 19016         iMockLTSY.ExpectL(EReadViagHomeZoneCacheIPC,data);
       
 19017 	    }
       
 19018 
       
 19019 	if(aDoComplete)
       
 19020 		{
       
 19021 		RMmCustomAPI::TViagCacheRecordContent& content = 
       
 19022 			iViagHomeZoneCache[aCacheId - KViagHomeZoneCacheIdMin][aRecordId - KViagHomeZoneCacheRecordIdMin];
       
 19023 
       
 19024 		content.iCellId = 1000 + aCacheId;
       
 19025 		content.iLac =2000 + aRecordId;
       
 19026 
       
 19027 		TMockLtsyData1<RMmCustomAPI::TViagCacheRecordContent> contentData(content);
       
 19028 		data.Close();
       
 19029 		contentData.SerialiseL(data);
       
 19030 		iMockLTSY.CompleteL(EReadViagHomeZoneCacheIPC,KErrNone,data,0);
       
 19031 		}
       
 19032 
       
 19033 	CleanupStack::PopAndDestroy(1,&data);
       
 19034 	}
       
 19035 
       
 19036 void CCTsyCustomIPCFU::AuxReadViagHomeZoneParamsL()
       
 19037 	{
       
 19038 
       
 19039 	OpenEtelServerL(EUseExtendedError);
       
 19040 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
 19041 	OpenPhoneL();
       
 19042 
       
 19043 	RMmCustomAPI customAPI;
       
 19044 	OpenCustomAPILC(customAPI, iPhone);
       
 19045 
       
 19046 	RBuf8 completeData;
       
 19047 	CleanupClosePushL(completeData);
       
 19048 
       
 19049 	TRequestStatus requestStatus;
       
 19050 	TRequestStatus mockLtsyStatus;
       
 19051 
       
 19052 	RMmCustomAPI::TViagElement element;
       
 19053 	_LIT(KScp, "Lenin lives!");
       
 19054 	_LIT(KSmsC, "revolution");
       
 19055 
       
 19056 	// Variables for call ReadViagHomeZoneParams.
       
 19057 	RMmCustomAPI::TViagParams param;
       
 19058 	RMmCustomAPI::TViagElements* elems = NULL;
       
 19059 	
       
 19060 	elems = new (ELeave) RMmCustomAPI::TViagElements( RMmCustomAPI::KViagElementCount );
       
 19061 	CleanupStack::PushL(elems);
       
 19062 	
       
 19063 	for (TInt i = 0; i < RMmCustomAPI::KViagElementCount; i++)
       
 19064 		{			
       
 19065 		elems->AppendL(element);
       
 19066 		}
       
 19067 
       
 19068 	// Variables for call CompleteL.
       
 19069 	RMmCustomAPI::TViagParams completeParam;
       
 19070 	completeParam.iScp = KScp;
       
 19071 	completeParam.iSmsC = KSmsC;
       
 19072 	completeParam.iSubscribedZoneAndVersion = 17;
       
 19073 
       
 19074 	RMmCustomAPI::TViagElements* completeElems;
       
 19075 	
       
 19076 	FillWithRandomDataLC(completeElems);
       
 19077 
       
 19078 	TMockLtsyData2<RMmCustomAPI::TViagParams, RMmCustomAPI::TViagElements*> 
       
 19079 		mockData2(completeParam, completeElems);
       
 19080 
       
 19081  	//-------------------------------------------------------------------------
       
 19082 	// TEST A: failure to dispatch request to LTSY
       
 19083  	//-------------------------------------------------------------------------
       
 19084 
       
 19085 	iMockLTSY.ExpectL(EReadViagHomeZoneParamsIPC, KErrNotSupported);
       
 19086 	customAPI.ReadViagHomeZoneParams(requestStatus, param, *elems);
       
 19087 
       
 19088 	User::WaitForRequest(requestStatus);
       
 19089 	AssertMockLtsyStatusL();
       
 19090 	ASSERT_EQUALS(KErrNotSupported, requestStatus.Int());
       
 19091 
       
 19092 	//-------------------------------------------------------------------------
       
 19093 	// TEST B: failure on completion of pending request from LTSY->CTSY
       
 19094  	//-------------------------------------------------------------------------
       
 19095 
       
 19096 	iMockLTSY.ExpectL(EReadViagHomeZoneParamsIPC);
       
 19097 	mockData2.SerialiseL(completeData);
       
 19098 	iMockLTSY.CompleteL(EReadViagHomeZoneParamsIPC, KErrGeneral, completeData);
       
 19099 	customAPI.ReadViagHomeZoneParams(requestStatus, param, *elems);
       
 19100 
       
 19101 	User::WaitForRequest(requestStatus);
       
 19102 	AssertMockLtsyStatusL();
       
 19103 	ASSERT_EQUALS(KErrGeneral, requestStatus.Int());
       
 19104 
       
 19105  	//-------------------------------------------------------------------------
       
 19106 	// TEST C: Successful completion request of
       
 19107 	// RMmCustomAPI::ReadViagHomeZoneParams when result is not cached.
       
 19108  	//-------------------------------------------------------------------------
       
 19109 
       
 19110 	iMockLTSY.ExpectL(EReadViagHomeZoneParamsIPC);
       
 19111 	iMockLTSY.CompleteL(EReadViagHomeZoneParamsIPC, KErrNone, completeData);
       
 19112 	customAPI.ReadViagHomeZoneParams(requestStatus, param, *elems);
       
 19113 
       
 19114 	User::WaitForRequest(requestStatus);
       
 19115 	AssertMockLtsyStatusL();
       
 19116 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
 19117 
       
 19118 	ASSERT_EQUALS(0, completeParam.iScp.Compare(param.iScp));
       
 19119 	ASSERT_EQUALS(0, completeParam.iSmsC.Compare(param.iSmsC));
       
 19120 	ASSERT_EQUALS(completeParam.iSubscribedZoneAndVersion, param.iSubscribedZoneAndVersion);
       
 19121 
       
 19122 	for (TInt i = 0; i < RMmCustomAPI::KViagElementCount; i++)
       
 19123 		{
       
 19124 		ASSERT_EQUALS(completeElems->At(i).iActiveFlag         , elems->At(i).iActiveFlag         );
       
 19125 		ASSERT_EQUALS(completeElems->At(i).iCoordinates.iR2    , elems->At(i).iCoordinates.iR2    );
       
 19126 		ASSERT_EQUALS(completeElems->At(i).iCoordinates.iX     , elems->At(i).iCoordinates.iX     );
       
 19127 		ASSERT_EQUALS(completeElems->At(i).iCoordinates.iY     , elems->At(i).iCoordinates.iY     );
       
 19128 		ASSERT_EQUALS(completeElems->At(i).iCoordinates.iZoneId, elems->At(i).iCoordinates.iZoneId);
       
 19129 		ASSERT_EQUALS(0, completeElems->At(i).iName.Compare(elems->At(i).iName));
       
 19130 		}
       
 19131 
       
 19132  	//-------------------------------------------------------------------------
       
 19133 	// TEST E: Unsolicited completion of RMmCustomAPI::ReadViagHomeZoneParams
       
 19134 	// from LTSY.
       
 19135  	//-------------------------------------------------------------------------
       
 19136 
       
 19137 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
 19138 	iMockLTSY.CompleteL(EReadViagHomeZoneParamsIPC, KErrNone, completeData);
       
 19139 	User::WaitForRequest(mockLtsyStatus);
       
 19140 	AssertMockLtsyStatusL();
       
 19141 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());	
       
 19142 
       
 19143 	CleanupStack::PopAndDestroy(5, this); 
       
 19144 	
       
 19145 	}
       
 19146 
       
 19147 void CCTsyCustomIPCFU::AuxReadViagHomeZoneParamsForIncreasingCoverageL()
       
 19148 	{
       
 19149 	
       
 19150 	OpenEtelServerL(EUseExtendedError);
       
 19151 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
 19152 	
       
 19153 	TInt err = iPhone.Open(iTelServer, KMmTsyPhoneName);
       
 19154 	ASSERT_EQUALS(KErrNone, err);
       
 19155 	
       
 19156 	err=iMockLTSY.Connect();
       
 19157 	ASSERT_EQUALS(KErrNone, err);
       
 19158 
       
 19159 	RBuf8 data;
       
 19160 	CleanupClosePushL(data);
       
 19161 	
       
 19162 	RMmCustomAPI::TViagCacheRecordId currentlyRetrievedCache;
       
 19163 	currentlyRetrievedCache.iCacheId	= 1;
       
 19164 	currentlyRetrievedCache.iRecordId	= 0;		
       
 19165 	TMockLtsyData1 <RMmCustomAPI::TViagCacheRecordId> ltsyData(currentlyRetrievedCache);
       
 19166 	ltsyData.SerialiseL(data);			
       
 19167 	iMockLTSY.ExpectL(EReadViagHomeZoneCacheIPC, data);		
       
 19168 
       
 19169 	RMmCustomAPI customAPI;
       
 19170 	TInt errorCode = customAPI.Open(iPhone);
       
 19171 	ASSERT_EQUALS(KErrNone, errorCode);
       
 19172 	CleanupStack::PopAndDestroy (&data);
       
 19173 	CleanupClosePushL(customAPI);
       
 19174 
       
 19175 	RBuf8 completeData;
       
 19176 	CleanupClosePushL(completeData);
       
 19177 
       
 19178 	RBuf8 expectData;
       
 19179 	CleanupClosePushL(expectData);
       
 19180 	
       
 19181 	TRequestStatus requestStatus;
       
 19182 
       
 19183 	RMmCustomAPI::TViagElement element;
       
 19184 	_LIT(KScp, "Lenin lives!");
       
 19185 	_LIT(KSmsC, "revolution");
       
 19186 
       
 19187 	// Variables for call ReadViagHomeZoneParams.
       
 19188 	RMmCustomAPI::TViagParams param;
       
 19189 	RMmCustomAPI::TViagElements* elems = NULL;
       
 19190 	
       
 19191 	elems = new (ELeave) RMmCustomAPI::TViagElements( RMmCustomAPI::KViagElementCount );
       
 19192 	CleanupStack::PushL(elems);
       
 19193 	
       
 19194 	for (TInt i = 0; i < RMmCustomAPI::KViagElementCount; i++)
       
 19195 		{			
       
 19196 		elems->AppendL(element);
       
 19197 		}
       
 19198 
       
 19199 	// Variables for call CompleteL.
       
 19200 	RMmCustomAPI::TViagParams completeParam;
       
 19201 	completeParam.iScp = KScp;
       
 19202 	completeParam.iSmsC = KSmsC;
       
 19203 	completeParam.iSubscribedZoneAndVersion = 17;
       
 19204 
       
 19205 	RMmCustomAPI::TViagElements* completeElems;
       
 19206 	
       
 19207 	FillWithRandomDataLC(completeElems);
       
 19208 
       
 19209 	TMockLtsyData2<RMmCustomAPI::TViagParams, RMmCustomAPI::TViagElements*> 
       
 19210 		mockData2(completeParam, completeElems);
       
 19211 
       
 19212  	//-------------------------------------------------------------------------
       
 19213 
       
 19214 	customAPI.ReadViagHomeZoneParams(requestStatus, param, *elems);
       
 19215 
       
 19216  	//-------------------------------------------------------------------------
       
 19217 	// There are preparations for call of function CheckViagHomezoneParamsL(). 
       
 19218 	TRequestStatus mockLtsyStatus;
       
 19219 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
 19220 	
       
 19221 	// EMobilePhoneGetNetworkRegistrationStatus
       
 19222 	iMockLTSY.CompleteL(EMmTsyBootNotifySimStatusReadyIPC,KErrNone,0);
       
 19223 	
       
 19224 	// EMobilePhoneGetHomeNetwork
       
 19225 	iMockLTSY.ExpectL(EMobilePhoneGetHomeNetwork);
       
 19226 	RMobilePhone::TMobilePhoneNetworkInfoV5 homeNetwork;
       
 19227 	homeNetwork.iMode = RMobilePhone::ENetworkModeWcdma;
       
 19228 	homeNetwork.iStatus = RMobilePhone::ENetworkStatusCurrent;
       
 19229 	homeNetwork.iBandInfo = RMobilePhone::EBandUnknown;
       
 19230 	homeNetwork.iCountryCode = _L("234");
       
 19231 	homeNetwork.iCdmaSID = _L("");
       
 19232 	homeNetwork.iAnalogSID = _L("");
       
 19233 	homeNetwork.iNetworkId = _L("23499");
       
 19234 	homeNetwork.iDisplayTag = _L("symbian");
       
 19235 	homeNetwork.iShortName = _L("symbian");
       
 19236 	homeNetwork.iLongName = _L("symbian mobile");
       
 19237 	homeNetwork.iAccess = RMobilePhone::ENetworkAccessUtran;
       
 19238 	homeNetwork.iEgprsAvailableIndicator = ETrue;
       
 19239 	homeNetwork.iHsdpaAvailableIndicator = ETrue;
       
 19240 	TMockLtsyData1<RMobilePhone::TMobilePhoneNetworkInfoV5> homeNetworkData(homeNetwork);
       
 19241 	completeData.Close();
       
 19242 	homeNetworkData.SerialiseL(completeData);
       
 19243 	iMockLTSY.CompleteL(EMobilePhoneGetHomeNetwork,KErrNone,completeData,0);
       
 19244 
       
 19245 	// EMmTsyPhoneGetPin1DisableSupportedIPC
       
 19246  	iMockLTSY.ExpectL(EMmTsyPhoneGetPin1DisableSupportedIPC);
       
 19247 	TBool pin1DisableSupport = ETrue;
       
 19248 	TMockLtsyData1<TBool> pin1DisableSupportData(pin1DisableSupport);
       
 19249 	completeData.Close();
       
 19250 	pin1DisableSupportData.SerialiseL(completeData);
       
 19251 	iMockLTSY.CompleteL(EMmTsyPhoneGetPin1DisableSupportedIPC,KErrNone,completeData,0);
       
 19252 
       
 19253 	// EMmTsySimRefreshRegisterIPC
       
 19254 	iMockLTSY.ExpectL(EMmTsySimRefreshRegisterIPC);
       
 19255 	iMockLTSY.CompleteL(EMmTsySimRefreshRegisterIPC, KErrGeneral, 0);		
       
 19256 
       
 19257 	// EMobilePhoneGetServiceTable
       
 19258 	RMobilePhone::TMobilePhoneServiceTable serviceTable = RMobilePhone::ESIMServiceTable;
       
 19259 	TMockLtsyData1<RMobilePhone::TMobilePhoneServiceTable> serviceTableData(serviceTable);
       
 19260 	expectData.Close();
       
 19261 	serviceTableData.SerialiseL(expectData);
       
 19262 	iMockLTSY.ExpectL(EMobilePhoneGetServiceTable, expectData);
       
 19263 	RMobilePhone::TMobilePhoneServiceTableV1 serviceTableResult;
       
 19264 	serviceTableResult.iServices1To8  = 0xFF;
       
 19265 	serviceTableResult.iServices9To16 = 0xFF;
       
 19266 	serviceTableResult.iServices17To24= 0xFF;
       
 19267 	serviceTableResult.iServices25To32= 0xFF;
       
 19268 	serviceTableResult.iServices33To40= 0xFF;
       
 19269 	serviceTableResult.iServices41To48= 0xFF;
       
 19270 	serviceTableResult.iServices49To56= 0xFF;
       
 19271 	TMockLtsyData1<RMobilePhone::TMobilePhoneServiceTableV1> serviceTableResultData(serviceTableResult);
       
 19272 	completeData.Close();
       
 19273 	serviceTableResultData.SerialiseL(completeData);
       
 19274 	iMockLTSY.CompleteL(EMobilePhoneGetServiceTable,KErrNone,completeData,0);
       
 19275 	
       
 19276 	// EMobilePhoneGetALSLine
       
 19277 	iMockLTSY.ExpectL(EMobilePhoneGetALSLine);
       
 19278 	RMobilePhone::TMobilePhoneALSLine alsLine = RMobilePhone::EAlternateLinePrimary;
       
 19279 	TMockLtsyData1<RMobilePhone::TMobilePhoneALSLine> alsLineData(alsLine);
       
 19280 	completeData.Close();
       
 19281 	alsLineData.SerialiseL(completeData);
       
 19282 	iMockLTSY.CompleteL(EMobilePhoneGetALSLine,KErrNone,completeData,0);
       
 19283 	
       
 19284 	// ECustomGetIccCallForwardingStatusIPC
       
 19285 	iMockLTSY.ExpectL(ECustomGetIccCallForwardingStatusIPC);    
       
 19286 	
       
 19287 	// EMobilePhoneGetIccMessageWaitingIndicators
       
 19288 	iMockLTSY.ExpectL(EMobilePhoneGetIccMessageWaitingIndicators);
       
 19289 	RMobilePhone::TMobilePhoneMessageWaitingV1 expectedMessageIndicators;
       
 19290 	TMockLtsyData1<RMobilePhone::TMobilePhoneMessageWaitingV1>
       
 19291 	                                indicatorsData(expectedMessageIndicators);
       
 19292     completeData.Close();
       
 19293     indicatorsData.SerialiseL(completeData); 
       
 19294 	iMockLTSY.CompleteL(EMobilePhoneGetIccMessageWaitingIndicators, KErrNone, completeData);
       
 19295 	
       
 19296 	// EReadViagHomeZoneParamsIPC
       
 19297 	completeData.Close();
       
 19298 	mockData2.SerialiseL(completeData);
       
 19299 	iMockLTSY.CompleteL(EReadViagHomeZoneParamsIPC, KErrNone, completeData);
       
 19300 	
       
 19301 	iMockLTSY.ExpectL(ECustomCheckAlsPpSupportIPC);
       
 19302 	iMockLTSY.ExpectL(EMobilePhoneGetCustomerServiceProfile);
       
 19303  	iMockLTSY.ExpectL(EReadViagHomeZoneParamsIPC);
       
 19304 	
       
 19305  	// N.B. EReadViagHomeZoneParamsIPC is not expected at this point because there is an ongoing caching started by customAPI.Open() above.
       
 19306 	
       
 19307 	User::WaitForRequest(mockLtsyStatus);
       
 19308 	AssertMockLtsyStatusL();
       
 19309 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
 19310  	//-------------------------------------------------------------------------
       
 19311 	
       
 19312 	User::WaitForRequest(requestStatus);
       
 19313 	AssertMockLtsyStatusL();
       
 19314 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
 19315 
       
 19316 	ASSERT_EQUALS(0, completeParam.iScp.Compare(param.iScp));
       
 19317 	ASSERT_EQUALS(0, completeParam.iSmsC.Compare(param.iSmsC));
       
 19318 	ASSERT_EQUALS(completeParam.iSubscribedZoneAndVersion, param.iSubscribedZoneAndVersion);
       
 19319 
       
 19320 	for (TInt i = 0; i < RMmCustomAPI::KViagElementCount; i++)
       
 19321 		{
       
 19322 		ASSERT_EQUALS(completeElems->At(i).iActiveFlag         , elems->At(i).iActiveFlag         );
       
 19323 		ASSERT_EQUALS(completeElems->At(i).iCoordinates.iR2    , elems->At(i).iCoordinates.iR2    );
       
 19324 		ASSERT_EQUALS(completeElems->At(i).iCoordinates.iX     , elems->At(i).iCoordinates.iX     );
       
 19325 		ASSERT_EQUALS(completeElems->At(i).iCoordinates.iY     , elems->At(i).iCoordinates.iY     );
       
 19326 		ASSERT_EQUALS(completeElems->At(i).iCoordinates.iZoneId, elems->At(i).iCoordinates.iZoneId);
       
 19327 		ASSERT_EQUALS(0, completeElems->At(i).iName.Compare(elems->At(i).iName));
       
 19328 		}
       
 19329 	
       
 19330 	CleanupStack::PopAndDestroy(6, this); 
       
 19331 	
       
 19332 	}
       
 19333 
       
 19334 void CCTsyCustomIPCFU::OpenPhoneBookStoreWithSIMRefreshL(RMobilePhoneBookStore &aStore, TName &aName, RMobilePhone &aPhone, TInt aSimError)
       
 19335     {
       
 19336 
       
 19337     RBuf8 data;
       
 19338     CleanupClosePushL(data);
       
 19339     
       
 19340     RBuf8 data2;
       
 19341     CleanupClosePushL(data2);
       
 19342     
       
 19343 
       
 19344     TRequestStatus mockLtsyStatus;
       
 19345     iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
 19346 
       
 19347     //EMmTsyPhoneBookStoreInitIPC
       
 19348     TMockLtsyPhoneBookData0 storeInitData(aName);
       
 19349     storeInitData.SerialiseL(data);
       
 19350     
       
 19351     iMockLTSY.ExpectL(EMmTsyPhoneBookStoreInitIPC, data);   
       
 19352 
       
 19353     _LIT8(KImsi,"01234567890123");
       
 19354     TUint16 files = 2;
       
 19355     TPckg<TUint16> filesData(files);
       
 19356     iMockLTSY.CompleteL(EMmTsySimRefreshNowIPC, aSimError, filesData);
       
 19357     iMockLTSY.ExpectL(EMobilePhoneGetSubscriberId);
       
 19358     iMockLTSY.CompleteL(EMobilePhoneGetSubscriberId, KErrNone, KImsi);
       
 19359 
       
 19360     CStorageInfoData storageData;
       
 19361 
       
 19362     SetStorageInfoData(storageData);
       
 19363         
       
 19364     TMockLtsyPhoneBookData1< CStorageInfoData > retStoreInitC(aName, storageData); 
       
 19365     retStoreInitC.SerialiseL(data2);
       
 19366     
       
 19367     iMockLTSY.CompleteL(EMmTsyPhoneBookStoreInitIPC, KErrNone, data2, 0);
       
 19368 
       
 19369     //EMmTsyPhoneBookStoreCacheIPC
       
 19370     CArrayPtrSeg<CPhoneBookStoreEntry>* cache = new(ELeave) CArrayPtrSeg<CPhoneBookStoreEntry>( 1 );
       
 19371     CleanupStack::PushL(cache);
       
 19372     
       
 19373     TMockLtsyPhoneBookData1<CArrayPtrSeg<CPhoneBookStoreEntry>*> storeCacheData(aName, cache);
       
 19374     data2.Close();
       
 19375     storeCacheData.SerialiseL(data2);    
       
 19376     data.Close();
       
 19377     storeInitData.SerialiseL(data);
       
 19378     
       
 19379                   
       
 19380     iMockLTSY.ExpectL(EMmTsyPhoneBookStoreCacheIPC, data);
       
 19381     iMockLTSY.CompleteL(EMmTsyPhoneBookStoreCacheIPC, aSimError, data2, 0);
       
 19382     
       
 19383     //Open
       
 19384     TInt ret = aStore.Open(aPhone, aName);
       
 19385     ASSERT_EQUALS(KErrNone, ret);           
       
 19386 
       
 19387     User::WaitForRequest(mockLtsyStatus);           
       
 19388     ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());  
       
 19389     AssertMockLtsyStatusL();
       
 19390 
       
 19391     CleanupStack::PopAndDestroy(3); //data, data2, cache
       
 19392 
       
 19393     }
       
 19394 
       
 19395 
       
 19396 void CCTsyCustomIPCFU::FillRandom(TDes8 &aBuff)
       
 19397     {
       
 19398     TUint length = aBuff.MaxLength();
       
 19399     aBuff.SetLength(0);
       
 19400     for (TUint i = 0; i < length; ++i)
       
 19401         {
       
 19402         TUint8 rand = (TUint8) Math::Random();
       
 19403         aBuff.Append(rand);
       
 19404         }
       
 19405     }
       
 19406 
       
 19407 
       
 19408 
       
 19409 
       
 19410