telephonyserverplugins/common_tsy/test/component/src/cctsydtmffu.cpp
changeset 0 3553901f7fa8
child 24 6638e7f4bd8f
equal deleted inserted replaced
-1:000000000000 0:3553901f7fa8
       
     1 // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // The TEFUnit test suite for DTMF in the Common TSY.
       
    15 // 
       
    16 //
       
    17 
       
    18 /**
       
    19  @file 
       
    20 */
       
    21 
       
    22 #include "cctsydtmffu.h"
       
    23 #include <etel.h>
       
    24 #include <etelmm.h>
       
    25 #include <et_clsvr.h>
       
    26 #include <ctsy/mmtsy_names.h>
       
    27 #include <ctsy/serviceapi/mmtsy_ipcdefs.h>
       
    28 #include "tmockltsydata.h"
       
    29 #include <ctsy/serviceapi/gsmerror.h>
       
    30 
       
    31 
       
    32 CTestSuite* CCTsyDTMFFU::CreateSuiteL(const TDesC& aName)
       
    33 	{
       
    34 	SUB_SUITE;
       
    35 
       
    36 	ADD_TEST_STEP_ISO_CPP(CCTsyDTMFFU, TestGetDTMFCaps0001L);
       
    37 	ADD_TEST_STEP_ISO_CPP(CCTsyDTMFFU, TestGetDTMFCaps0006L);
       
    38 	ADD_TEST_STEP_ISO_CPP(CCTsyDTMFFU, TestGetDTMFCaps00011L);
       
    39 	ADD_TEST_STEP_ISO_CPP(CCTsyDTMFFU, TestStopDTMFTone0001L);
       
    40 	ADD_TEST_STEP_ISO_CPP(CCTsyDTMFFU, TestReadDTMFTones0001L);
       
    41 	ADD_TEST_STEP_ISO_CPP(CCTsyDTMFFU, TestSendDTMFTones0001L);
       
    42 	ADD_TEST_STEP_ISO_CPP(CCTsyDTMFFU, TestSendDTMFTones0002L);
       
    43 	ADD_TEST_STEP_ISO_CPP(CCTsyDTMFFU, TestSendDTMFTones0003L);
       
    44 	ADD_TEST_STEP_ISO_CPP(CCTsyDTMFFU, TestSendDTMFTones0004L);
       
    45 	ADD_TEST_STEP_ISO_CPP(CCTsyDTMFFU, TestSendDTMFTones0005L);
       
    46 	ADD_TEST_STEP_ISO_CPP(CCTsyDTMFFU, TestStartDTMFTone0001L);
       
    47 	ADD_TEST_STEP_ISO_CPP(CCTsyDTMFFU, TestNotifyDTMFEvent0001L);
       
    48 	ADD_TEST_STEP_ISO_CPP(CCTsyDTMFFU, TestNotifyDTMFCapsChange0001L);
       
    49 	ADD_TEST_STEP_ISO_CPP(CCTsyDTMFFU, TestNotifyDTMFCapsChange0002L);
       
    50 	ADD_TEST_STEP_ISO_CPP(CCTsyDTMFFU, TestNotifyDTMFCapsChange0004L);
       
    51 	ADD_TEST_STEP_ISO_CPP(CCTsyDTMFFU, TestNotifyStopInDTMFString0001L);
       
    52 	ADD_TEST_STEP_ISO_CPP(CCTsyDTMFFU, TestNotifyStopInDTMFString0002L);
       
    53 	ADD_TEST_STEP_ISO_CPP(CCTsyDTMFFU, TestNotifyStopInDTMFString0004L);
       
    54 	ADD_TEST_STEP_ISO_CPP(CCTsyDTMFFU, TestContinueDTMFStringSending0001L);
       
    55 	ADD_TEST_STEP_ISO_CPP(CCTsyDTMFFU, TestContinueDTMFStringSending0005L);
       
    56 
       
    57 	END_SUITE;
       
    58 	}
       
    59 
       
    60 
       
    61 //
       
    62 // Actual test cases
       
    63 //
       
    64 
       
    65 
       
    66 void CCTsyDTMFFU::AuxTestGetDTMFCaps0001L(
       
    67 		RMobilePhone::TMobileService aMobileService,
       
    68 		const TDesC& aLineName,
       
    69 		TUint32 aExpCaps)
       
    70 	{
       
    71 	
       
    72 	OpenEtelServerL(EUseExtendedError);
       
    73 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
    74 	OpenPhoneL();
       
    75 
       
    76  	//-------------------------------------------------------------------------
       
    77 	// TEST: Successful completion request of
       
    78 	// RMobilePhone::GetDTMFCaps when there is no calls.
       
    79  	//-------------------------------------------------------------------------
       
    80 
       
    81 	TUint32 caps(0);
       
    82 	TInt ret = iPhone.GetDTMFCaps(caps);
       
    83 	ASSERT_EQUALS(KErrNone, ret);
       
    84 	AssertMockLtsyStatusL();
       
    85 	TUint32 expCapsNoCalls(0);
       
    86 	ASSERT_EQUALS(expCapsNoCalls, caps);
       
    87 
       
    88  	//-------------------------------------------------------------------------
       
    89 	// TEST: Successful completion request of
       
    90 	// RMobilePhone::GetDTMFCaps when there is a call.
       
    91  	//-------------------------------------------------------------------------
       
    92 
       
    93 	// invoke call info change
       
    94 	RLine line;
       
    95 	OpenLineLC(line, aLineName);
       
    96 
       
    97 	RCall call;
       
    98 	OpenIncomingCallLC(line, call, 1, aMobileService, RMobileCall::EStatusConnected);
       
    99 
       
   100 	// request execute and check results
       
   101 	ret = iPhone.GetDTMFCaps(caps);
       
   102 	ASSERT_EQUALS(KErrNone, ret);
       
   103 	ASSERT_EQUALS(aExpCaps, caps);
       
   104 	AssertMockLtsyStatusL();
       
   105 
       
   106 	CleanupStack::PopAndDestroy(3, this); // call, line, this
       
   107 
       
   108 	}
       
   109 
       
   110 
       
   111 /**
       
   112 @SYMTestCaseID BA-CTSY-DTMF-MGDC-0001
       
   113 @SYMComponent  telephony_ctsy
       
   114 @SYMTestCaseDesc Test support in CTSY for RMobilePhone::GetDTMFCaps for voice calls
       
   115 @SYMTestPriority High
       
   116 @SYMTestActions Invokes RMobilePhone::GetDTMFCaps for voice calls
       
   117 @SYMTestExpectedResults Pass
       
   118 @SYMTestType CT
       
   119 */
       
   120 void CCTsyDTMFFU::TestGetDTMFCaps0001L()
       
   121 	{
       
   122 
       
   123 	TUint32 expCaps = 
       
   124 			RMobilePhone::KCapsSendDTMFString |
       
   125 			RMobilePhone::KCapsSendDTMFSingleTone;
       
   126 
       
   127 	AuxTestGetDTMFCaps0001L(RMobilePhone::EVoiceService, KMmTsyVoice1LineName, expCaps);
       
   128 
       
   129 	// test for voice call from auxilliary voice line
       
   130 	// returned caps are wrong
       
   131 	AuxTestGetDTMFCaps0001L(RMobilePhone::EAuxVoiceService, KMmTsyVoice2LineName, expCaps);
       
   132 	
       
   133 	}
       
   134 
       
   135 
       
   136 /**
       
   137 @SYMTestCaseID BA-CTSY-DTMF-MGDC-0006
       
   138 @SYMComponent  telephony_ctsy
       
   139 @SYMTestCaseDesc Test support in CTSY for RMobilePhone::GetDTMFCaps for data calls
       
   140 @SYMTestPriority High
       
   141 @SYMTestActions Invokes RMobilePhone::GetDTMFCaps for data calls
       
   142 @SYMTestExpectedResults Pass
       
   143 @SYMTestType CT
       
   144 */
       
   145 void CCTsyDTMFFU::TestGetDTMFCaps0006L()
       
   146 	{
       
   147 
       
   148 	TUint32 expCaps(0);
       
   149 	AuxTestGetDTMFCaps0001L(RMobilePhone::ECircuitDataService, KMmTsyDataLineName, expCaps);
       
   150 	
       
   151 	}
       
   152 
       
   153 
       
   154 /**
       
   155 @SYMTestCaseID BA-CTSY-DTMF-MGDC-00011
       
   156 @SYMComponent  telephony_ctsy
       
   157 @SYMTestCaseDesc Test support in CTSY for RMobilePhone::GetDTMFCaps for fax calls
       
   158 @SYMTestPriority High
       
   159 @SYMTestActions Invokes RMobilePhone::GetDTMFCaps for fax calls
       
   160 @SYMTestExpectedResults Pass
       
   161 @SYMTestType CT
       
   162 */
       
   163 void CCTsyDTMFFU::TestGetDTMFCaps00011L()
       
   164 	{
       
   165 
       
   166 	TUint32 expCaps(0);
       
   167 	AuxTestGetDTMFCaps0001L(RMobilePhone::EFaxService, KMmTsyFaxLineName, expCaps);
       
   168 	
       
   169 	}
       
   170 
       
   171 
       
   172 /**
       
   173 @SYMTestCaseID BA-CTSY-DTMF-MSTPDT-0001
       
   174 @SYMComponent  telephony_ctsy
       
   175 @SYMTestCaseDesc Test support in CTSY for RMobilePhone::StopDTMFTone
       
   176 @SYMTestPriority High
       
   177 @SYMTestActions Invokes RMobilePhone::StopDTMFTone
       
   178 @SYMTestExpectedResults Pass
       
   179 @SYMTestType CT
       
   180 */
       
   181 void CCTsyDTMFFU::TestStopDTMFTone0001L()
       
   182 	{
       
   183 
       
   184 	OpenEtelServerL(EUseExtendedError);
       
   185 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
   186 	OpenPhoneL();
       
   187 
       
   188 	RBuf8 data;
       
   189 	CleanupClosePushL(data);
       
   190 
       
   191 	RLine line;
       
   192 	OpenLineLC(line, KMmTsyVoice1LineName);
       
   193 
       
   194 	RCall call;
       
   195 	OpenIncomingCallLC(line, call, 1, RMobilePhone::EVoiceService, RMobileCall::EStatusConnected);
       
   196 	
       
   197 	// start dtmf tone
       
   198 	TChar tone('*');
       
   199 	TMockLtsyData1<TChar> toneLtsyData( tone );
       
   200 	toneLtsyData.SerialiseL(data);
       
   201 	iMockLTSY.ExpectL(EMobilePhoneStartDTMFTone, data);
       
   202 	TInt err = iPhone.StartDTMFTone(tone);
       
   203 	ASSERT_EQUALS(KErrNone, err);
       
   204 	AssertMockLtsyStatusL();
       
   205 
       
   206 	//-------------------------------------------------------------------------
       
   207 	// TEST A: failure to dispatch request to LTSY
       
   208  	//-------------------------------------------------------------------------
       
   209 
       
   210 	iMockLTSY.ExpectL(EMobilePhoneStopDTMFTone, KErrNotSupported);
       
   211 
       
   212 	err = iPhone.StopDTMFTone();
       
   213 	ASSERT_EQUALS(KErrNotSupported, err);
       
   214 	AssertMockLtsyStatusL();
       
   215 
       
   216  	//-------------------------------------------------------------------------
       
   217 	// TEST C: Successful completion request of
       
   218 	// RMobilePhone::StopDTMFTone when result is not cached.
       
   219  	//-------------------------------------------------------------------------
       
   220 
       
   221 	iMockLTSY.ExpectL(EMobilePhoneStopDTMFTone);
       
   222 
       
   223 	err = iPhone.StopDTMFTone();
       
   224 	ASSERT_EQUALS(KErrNone, err);
       
   225 	AssertMockLtsyStatusL();
       
   226 
       
   227  	//-------------------------------------------------------------------------
       
   228 	// TEST E: Unsolicited completion of RMobilePhone::StopDTMFTone
       
   229 	// from LTSY.
       
   230  	//-------------------------------------------------------------------------
       
   231 
       
   232 	TRequestStatus mockLtsyStatus;
       
   233 	iMockLTSY.NotifyTerminated(mockLtsyStatus);	
       
   234 	//send completion
       
   235 	iMockLTSY.CompleteL(EMobilePhoneStopDTMFTone, KErrNone);
       
   236 	// wait for completion
       
   237 	User::WaitForRequest(mockLtsyStatus);
       
   238 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
   239 	AssertMockLtsyStatusL();
       
   240 
       
   241 	CleanupStack::PopAndDestroy(4, this); // call, line, data, this
       
   242 	
       
   243 	}
       
   244 
       
   245 
       
   246 /**
       
   247 @SYMTestCaseID BA-CTSY-DTMF-MRDT-0001
       
   248 @SYMComponent  telephony_ctsy
       
   249 @SYMTestCaseDesc Test support in CTSY for RMobilePhone::ReadDTMFTones
       
   250 @SYMTestPriority High
       
   251 @SYMTestActions Invokes RMobilePhone::ReadDTMFTones
       
   252 @SYMTestExpectedResults Pass
       
   253 @SYMTestType CT
       
   254 */
       
   255 void CCTsyDTMFFU::TestReadDTMFTones0001L()
       
   256 	{
       
   257 
       
   258 	OpenEtelServerL(EUseExtendedError);
       
   259 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
   260 	OpenPhoneL();
       
   261 
       
   262 	RLine line;
       
   263 	OpenLineLC(line, KMmTsyVoice1LineName);
       
   264 
       
   265 	RCall call;
       
   266 	OpenIncomingCallLC(line, call, 1, RMobilePhone::EVoiceService, RMobileCall::EStatusConnected);
       
   267 
       
   268 	TRequestStatus reqStatus;
       
   269 	TBuf<1> buf;
       
   270 	iPhone.ReadDTMFTones(reqStatus, buf);
       
   271 	User::WaitForRequest(reqStatus);
       
   272 	ASSERT_EQUALS(KErrNotSupported, reqStatus.Int());
       
   273 
       
   274 	AssertMockLtsyStatusL();
       
   275 	CleanupStack::PopAndDestroy(3, this); // call, line, this
       
   276 	
       
   277 	}
       
   278 
       
   279 
       
   280 /**
       
   281 @SYMTestCaseID BA-CTSY-DTMF-MSDT-0001
       
   282 @SYMComponent  telephony_ctsy
       
   283 @SYMTestCaseDesc Test support in CTSY for RMobilePhone::SendDTMFTones
       
   284 @SYMTestPriority High
       
   285 @SYMTestActions Invokes RMobilePhone::SendDTMFTones
       
   286 @SYMTestExpectedResults Pass
       
   287 @SYMTestType CT
       
   288 */
       
   289 void CCTsyDTMFFU::TestSendDTMFTones0001L()
       
   290 	{
       
   291 
       
   292 	OpenEtelServerL(EUseExtendedError);
       
   293 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
   294 	OpenPhoneL();
       
   295 
       
   296 	RBuf8 data;
       
   297 	CleanupClosePushL(data);
       
   298 
       
   299 	//-------------------------------------------------------------------------
       
   300 	// TEST: failure to dispatch request to CTSY
       
   301 	// when there is no voice calls in the active and connected state
       
   302  	//-------------------------------------------------------------------------
       
   303 
       
   304 	TInfoName tones(_L("*102#"));
       
   305 	TRequestStatus reqStatus;
       
   306 	iPhone.SendDTMFTones(reqStatus, tones);
       
   307 	User::WaitForRequest(reqStatus);
       
   308 	ASSERT_EQUALS(KErrEtelCallNotActive, reqStatus.Int());
       
   309 	AssertMockLtsyStatusL();
       
   310 
       
   311 	//-------------------------------------------------------------------------
       
   312 	// TEST A: failure to dispatch request to LTSY
       
   313  	//-------------------------------------------------------------------------
       
   314 
       
   315 	RLine line;
       
   316 	OpenLineLC(line, KMmTsyVoice1LineName);
       
   317 
       
   318 	RCall call;
       
   319 	OpenIncomingCallLC(line, call, 1, RMobilePhone::EVoiceService, RMobileCall::EStatusConnected);
       
   320 
       
   321 	TMockLtsyData1<TInfoName> tonesLtsyData( tones );
       
   322 	tonesLtsyData.SerialiseL(data);
       
   323 	iMockLTSY.ExpectL(EMobilePhoneSendDTMFTones, data, KErrNotSupported);
       
   324 
       
   325 	iPhone.SendDTMFTones(reqStatus, tones);
       
   326 	User::WaitForRequest(reqStatus);
       
   327 	ASSERT_EQUALS(KErrNotSupported, reqStatus.Int());
       
   328 	AssertMockLtsyStatusL();
       
   329 
       
   330 	//-------------------------------------------------------------------------
       
   331 	// TEST B: failure on completion of pending request from LTSY->CTSY
       
   332  	//-------------------------------------------------------------------------
       
   333 
       
   334 	iMockLTSY.ExpectL(EMobilePhoneSendDTMFTones, data);
       
   335 	iMockLTSY.CompleteL(EMobilePhoneSendDTMFTones, KErrGeneral);
       
   336 	iPhone.SendDTMFTones(reqStatus, tones);
       
   337 	User::WaitForRequest(reqStatus);
       
   338 	ASSERT_EQUALS(KErrGeneral, reqStatus.Int());
       
   339 	AssertMockLtsyStatusL();
       
   340 
       
   341  	//-------------------------------------------------------------------------
       
   342 	// TEST C: Successful completion request of
       
   343 	// RMobilePhone::SendDTMFTones when result is not cached.
       
   344  	//-------------------------------------------------------------------------
       
   345 
       
   346 	iMockLTSY.ExpectL(EMobilePhoneSendDTMFTones, data);
       
   347 	iMockLTSY.CompleteL(EMobilePhoneSendDTMFTones, KErrNone);
       
   348 	iPhone.SendDTMFTones(reqStatus, tones);
       
   349 	User::WaitForRequest(reqStatus);
       
   350 	ASSERT_EQUALS(KErrNone, reqStatus.Int());
       
   351 	AssertMockLtsyStatusL();
       
   352 	
       
   353  	//-------------------------------------------------------------------------
       
   354 	// TEST E: Unsolicited completion of RMobilePhone::SendDTMFTones
       
   355 	// from LTSY.
       
   356  	//-------------------------------------------------------------------------
       
   357 
       
   358 	TRequestStatus mockLtsyStatus;
       
   359 	iMockLTSY.NotifyTerminated(mockLtsyStatus);	
       
   360 	//send completion
       
   361 	iMockLTSY.CompleteL(EMobilePhoneSendDTMFTones, KErrNone);
       
   362 	// wait for completion
       
   363 	User::WaitForRequest(mockLtsyStatus);
       
   364 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
   365 	AssertMockLtsyStatusL();
       
   366 
       
   367 	CleanupStack::PopAndDestroy(4, this); // call, line, data, this
       
   368 	
       
   369 	}
       
   370 
       
   371 
       
   372 /**
       
   373 @SYMTestCaseID BA-CTSY-DTMF-MSDT-0002
       
   374 @SYMComponent  telephony_ctsy
       
   375 @SYMTestCaseDesc Test support in CTSY for cancelling of RMobilePhone::SendDTMFTones
       
   376 @SYMTestPriority High
       
   377 @SYMTestActions Invokes cancelling of RMobilePhone::SendDTMFTones
       
   378 @SYMTestExpectedResults Pass
       
   379 @SYMTestType CT
       
   380 */
       
   381 void CCTsyDTMFFU::TestSendDTMFTones0002L()
       
   382 	{
       
   383 
       
   384 	OpenEtelServerL(EUseExtendedError);
       
   385 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
   386 	OpenPhoneL();
       
   387 
       
   388 	RBuf8 data;
       
   389 	CleanupClosePushL(data);
       
   390 
       
   391 	RLine line;
       
   392 	OpenLineLC(line, KMmTsyVoice1LineName);
       
   393 
       
   394 	RCall call;
       
   395 	OpenIncomingCallLC(line, call, 1, RMobilePhone::EVoiceService, RMobileCall::EStatusConnected);
       
   396 
       
   397 	TRequestStatus mockLtsyStatus;
       
   398 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
   399 
       
   400 	//-------------------------------------------------------------------------
       
   401 	// failure to dispatch cancelling request to LTSY
       
   402  	//-------------------------------------------------------------------------
       
   403  	
       
   404 	TInfoName tones(_L("*102#"));
       
   405 	TMockLtsyData1<TInfoName> tonesLtsyData( tones );
       
   406 	tonesLtsyData.SerialiseL(data);
       
   407 	iMockLTSY.ExpectL(EMobilePhoneSendDTMFTones, data);
       
   408 	iMockLTSY.CompleteL(EMobilePhoneSendDTMFTones, KErrNone, 10);
       
   409 
       
   410 	TRequestStatus reqStatus;
       
   411 	iPhone.SendDTMFTones(reqStatus, tones);
       
   412 
       
   413 	iMockLTSY.ExpectL(EMobilePhoneSendDTMFTonesCancel, KErrNotSupported);
       
   414 
       
   415 	iPhone.CancelAsyncRequest(EMobilePhoneSendDTMFTones);
       
   416 
       
   417 	// request completes as there has not been the cancel
       
   418 	User::WaitForRequest(reqStatus);
       
   419 	ASSERT_EQUALS(KErrNone, reqStatus.Int());
       
   420 
       
   421 	// Wait for completion of iMockLTSY.NotifyTerminated
       
   422 	User::WaitForRequest(mockLtsyStatus);
       
   423 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
   424 	AssertMockLtsyStatusL();
       
   425 
       
   426  	//-------------------------------------------------------------------------
       
   427 	// failure on completion cancelling request
       
   428  	//-------------------------------------------------------------------------
       
   429  	
       
   430 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
   431 
       
   432 	iMockLTSY.ExpectL(EMobilePhoneSendDTMFTones, data);
       
   433 
       
   434 	iPhone.SendDTMFTones(reqStatus, tones);
       
   435 
       
   436 	iMockLTSY.ExpectL(EMobilePhoneSendDTMFTonesCancel, KErrNone);
       
   437 	iMockLTSY.CompleteL(EMobilePhoneSendDTMFTonesCancel, KErrGeneral);
       
   438 	iPhone.CancelAsyncRequest(EMobilePhoneSendDTMFTones);
       
   439 
       
   440 	User::WaitForRequest(reqStatus);
       
   441 	ASSERT_EQUALS(KErrCancel, reqStatus.Int());
       
   442 
       
   443 	// Wait for completion of iMockLTSY.NotifyTerminated
       
   444 	User::WaitForRequest(mockLtsyStatus);
       
   445 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
   446 	AssertMockLtsyStatusL();
       
   447 
       
   448  	//-------------------------------------------------------------------------
       
   449 	// successful cancelling
       
   450  	//-------------------------------------------------------------------------
       
   451  	
       
   452 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
   453 
       
   454 	iMockLTSY.ExpectL(EMobilePhoneSendDTMFTones, data);
       
   455 
       
   456 	iPhone.SendDTMFTones(reqStatus, tones);
       
   457 
       
   458 	iMockLTSY.ExpectL(EMobilePhoneSendDTMFTonesCancel);
       
   459 	iMockLTSY.CompleteL(EMobilePhoneSendDTMFTonesCancel, KErrNone);
       
   460 	iPhone.CancelAsyncRequest(EMobilePhoneSendDTMFTones);
       
   461 
       
   462 	// the cancel was done
       
   463 	User::WaitForRequest(reqStatus);
       
   464 	ASSERT_EQUALS(KErrCancel, reqStatus.Int());
       
   465 
       
   466 	// Wait for completion of iMockLTSY.NotifyTerminated
       
   467 	User::WaitForRequest(mockLtsyStatus);
       
   468 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
   469 	AssertMockLtsyStatusL();
       
   470 
       
   471  	//-------------------------------------------------------------------------
       
   472 	// Unsolicited completion of RMobilePhone::SendDTMFTones cancelling from LTSY.
       
   473  	//-------------------------------------------------------------------------
       
   474 
       
   475 	iMockLTSY.NotifyTerminated(mockLtsyStatus);	
       
   476 	//send completion
       
   477 	iMockLTSY.CompleteL(EMobilePhoneSendDTMFTonesCancel, KErrNone);
       
   478 	// wait for completion
       
   479 	User::WaitForRequest(mockLtsyStatus);
       
   480 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
   481 	AssertMockLtsyStatusL();
       
   482 
       
   483 	CleanupStack::PopAndDestroy(4, this); // call, line, data, this
       
   484 	
       
   485 	}
       
   486 
       
   487 
       
   488 /**
       
   489 @SYMTestCaseID BA-CTSY-DTMF-MSDT-0003
       
   490 @SYMComponent  telephony_ctsy
       
   491 @SYMTestCaseDesc Test support in CTSY for RMobilePhone::SendDTMFTones with bad parameter data
       
   492 @SYMTestPriority High
       
   493 @SYMTestActions Invokes RMobilePhone::SendDTMFTones with bad parameter data
       
   494 @SYMTestExpectedResults Pass
       
   495 @SYMTestType CT
       
   496 */
       
   497 void CCTsyDTMFFU::TestSendDTMFTones0003L()
       
   498 	{
       
   499 
       
   500 	OpenEtelServerL(EUseExtendedError);
       
   501 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
   502 	OpenPhoneL();
       
   503 
       
   504 	RLine line;
       
   505 	OpenLineLC(line, KMmTsyVoice1LineName);
       
   506 
       
   507 	RCall call;
       
   508 	OpenIncomingCallLC(line, call, 1, RMobilePhone::EVoiceService, RMobileCall::EStatusConnected);
       
   509 
       
   510 	//-------------------------------------------------------------------------
       
   511 	// Test B: Test passing wrong descriptor size to parameter in
       
   512 	// RMobilePhone::SendDTMFTones
       
   513  	//-------------------------------------------------------------------------
       
   514 
       
   515 	// passing of empty DTMF tones
       
   516 	TRequestStatus reqStatus;
       
   517 	iPhone.SendDTMFTones(reqStatus, KNullDesC);
       
   518 	User::WaitForRequest(reqStatus);
       
   519 	ASSERT_EQUALS(KErrArgument, reqStatus.Int());
       
   520 	AssertMockLtsyStatusL();
       
   521 
       
   522 	// passing of too long DTMF tones
       
   523 	TBuf< KDtmfStringMaxLength + 1 > tooLongTones;
       
   524 	tooLongTones.SetMax();
       
   525 	iPhone.SendDTMFTones(reqStatus, tooLongTones);
       
   526 	User::WaitForRequest(reqStatus);
       
   527 	ASSERT_EQUALS(KErrArgument, reqStatus.Int());
       
   528 	AssertMockLtsyStatusL();
       
   529 	
       
   530 	CleanupStack::PopAndDestroy(3, this); // call,line, this
       
   531 	
       
   532 	}
       
   533 
       
   534 
       
   535 /**
       
   536 @SYMTestCaseID BA-CTSY-DTMF-MSDT-0004
       
   537 @SYMComponent  telephony_ctsy
       
   538 @SYMTestCaseDesc Test support in CTSY for multiple client requests to RMobilePhone::SendDTMFTones
       
   539 @SYMTestPriority High
       
   540 @SYMTestActions Invokes multiple client requests to RMobilePhone::SendDTMFTones
       
   541 @SYMTestExpectedResults Pass
       
   542 @SYMTestType CT
       
   543 */
       
   544 void CCTsyDTMFFU::TestSendDTMFTones0004L()
       
   545 	{
       
   546 
       
   547 	OpenEtelServerL(EUseExtendedError);
       
   548 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
   549 	OpenPhoneL();
       
   550 
       
   551 	RBuf8 data;
       
   552 	CleanupClosePushL(data);
       
   553 
       
   554 	RLine line;
       
   555 	OpenLineLC(line, KMmTsyVoice1LineName);
       
   556 
       
   557 	RCall call;
       
   558 	OpenIncomingCallLC(line, call, 1, RMobilePhone::EVoiceService, RMobileCall::EStatusConnected);
       
   559 
       
   560 	// Open second client
       
   561 	RTelServer telServer2;
       
   562 	TInt ret = telServer2.Connect();
       
   563 	ASSERT_EQUALS(KErrNone, ret);
       
   564 	CleanupClosePushL(telServer2);
       
   565 
       
   566 	RMobilePhone phone2;
       
   567 	ret = phone2.Open(telServer2,KMmTsyPhoneName);
       
   568 	ASSERT_EQUALS(KErrNone, ret);
       
   569 	CleanupClosePushL(phone2);
       
   570 
       
   571 	RLine line2;
       
   572 	OpenLineLC(line2, KMmTsyVoice1LineName);
       
   573 
       
   574 	RCall call2;
       
   575 	OpenIncomingCallLC(line2, call2, 2, RMobilePhone::EVoiceService, RMobileCall::EStatusConnected);
       
   576 
       
   577 	//-------------------------------------------------------------------------
       
   578 	// Test A: Test multiple clients requesting RMobilePhone::SendDTMFTones
       
   579  	//-------------------------------------------------------------------------
       
   580 
       
   581 	// setting and execute 1st request
       
   582 	TInfoName tones(_L("*102#"));
       
   583 	TMockLtsyData1<TInfoName> tonesLtsyData( tones );
       
   584 	tonesLtsyData.SerialiseL(data);
       
   585 	iMockLTSY.ExpectL(EMobilePhoneSendDTMFTones, data);
       
   586 	iMockLTSY.CompleteL(EMobilePhoneSendDTMFTones, KErrNone);
       
   587 	TRequestStatus reqStatus;
       
   588 	iPhone.SendDTMFTones(reqStatus, tones);
       
   589 
       
   590 	// setting and execute 2nd request
       
   591 	TBuf<10> tones2(_L("*105#"));
       
   592 	TRequestStatus reqStatus2;
       
   593 	phone2.SendDTMFTones(reqStatus2, tones2);
       
   594 
       
   595 	// completion and check results
       
   596 	User::WaitForRequest(reqStatus);
       
   597 	ASSERT_EQUALS(KErrNone, reqStatus.Int());
       
   598 
       
   599 	User::WaitForRequest(reqStatus2);
       
   600 	ASSERT_EQUALS(KErrServerBusy, reqStatus2.Int());
       
   601 
       
   602 	AssertMockLtsyStatusL();
       
   603 	CleanupStack::PopAndDestroy(8, this); // call2, line2, phone2, telServer2, call, line, data, this
       
   604 
       
   605 	}
       
   606 
       
   607 
       
   608 /**
       
   609 @SYMTestCaseID BA-CTSY-DTMF-MSDT-0005
       
   610 @SYMComponent  telephony_ctsy
       
   611 @SYMTestCaseDesc Test support in CTSY for RMobilePhone::SendDTMFTones with timeout
       
   612 @SYMTestPriority High
       
   613 @SYMTestActions Invokes RMobilePhone::SendDTMFTones and tests for timeout
       
   614 @SYMTestExpectedResults Pass
       
   615 @SYMTestType CT
       
   616 */
       
   617 void CCTsyDTMFFU::TestSendDTMFTones0005L()
       
   618 	{
       
   619 
       
   620 	OpenEtelServerL(EUseExtendedError);
       
   621 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
   622 	OpenPhoneL();
       
   623 
       
   624 	RBuf8 data;
       
   625 	CleanupClosePushL(data);
       
   626 
       
   627 	RLine line;
       
   628 	OpenLineLC(line, KMmTsyVoice1LineName);
       
   629 
       
   630 	RCall call;
       
   631 	OpenIncomingCallLC(line, call, 1, RMobilePhone::EVoiceService, RMobileCall::EStatusConnected);
       
   632 
       
   633 	//-------------------------------------------------------------------------
       
   634 	// Test A: Test timeout of RMobilePhone::SendDTMFTones
       
   635  	//-------------------------------------------------------------------------
       
   636 
       
   637 	TInfoName tones(_L("*102#"));
       
   638 	TMockLtsyData1<TInfoName> tonesLtsyData( tones );
       
   639 	tonesLtsyData.SerialiseL(data);
       
   640 	iMockLTSY.ExpectL(EMobilePhoneSendDTMFTones, data);
       
   641 
       
   642 	TRequestStatus reqStatus;
       
   643 	iPhone.SendDTMFTones(reqStatus, tones);
       
   644 	User::WaitForRequest(reqStatus);
       
   645 	ASSERT_EQUALS(KErrTimedOut, reqStatus.Int());
       
   646 	AssertMockLtsyStatusL();
       
   647 
       
   648  	//-------------------------------------------------------------------------
       
   649 	// Increase coverage: case cancelling
       
   650  	//-------------------------------------------------------------------------
       
   651 
       
   652 	iMockLTSY.ExpectL(EMobilePhoneSendDTMFTones, data);
       
   653 	iPhone.SendDTMFTones(reqStatus, tones);
       
   654 
       
   655 	iMockLTSY.ExpectL(EMobilePhoneSendDTMFTonesCancel);
       
   656 	iPhone.CancelAsyncRequest(EMobilePhoneSendDTMFTones);
       
   657 
       
   658 	User::WaitForRequest(reqStatus);
       
   659 	ASSERT_EQUALS(KErrTimedOut, reqStatus.Int());
       
   660 	AssertMockLtsyStatusL();
       
   661 
       
   662 	CleanupStack::PopAndDestroy(4, this); // call, line, data, this
       
   663 
       
   664 	}
       
   665 
       
   666 
       
   667 /**
       
   668 @SYMTestCaseID BA-CTSY-DTMF-MSTDT-0001
       
   669 @SYMComponent  telephony_ctsy
       
   670 @SYMTestCaseDesc Test support in CTSY for RMobilePhone::StartDTMFTone
       
   671 @SYMTestPriority High
       
   672 @SYMTestActions Invokes RMobilePhone::StartDTMFTone
       
   673 @SYMTestExpectedResults Pass
       
   674 @SYMTestType CT
       
   675 */
       
   676 void CCTsyDTMFFU::TestStartDTMFTone0001L()
       
   677 	{
       
   678 
       
   679 	OpenEtelServerL(EUseExtendedError);
       
   680 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
   681 	OpenPhoneL();
       
   682 
       
   683 	RBuf8 data;
       
   684 	CleanupClosePushL(data);
       
   685 	
       
   686 	RLine line;
       
   687 	OpenLineLC(line, KMmTsyVoice1LineName);
       
   688 
       
   689 	RCall call;
       
   690 	OpenIncomingCallLC(line, call, 1, RMobilePhone::EVoiceService, RMobileCall::EStatusConnected);
       
   691 
       
   692 	//-------------------------------------------------------------------------
       
   693 	// TEST A: failure to dispatch request to LTSY
       
   694  	//-------------------------------------------------------------------------
       
   695 
       
   696 	TChar tone('*');
       
   697 	TMockLtsyData1<TChar> toneLtsyData( tone );
       
   698 	toneLtsyData.SerialiseL(data);
       
   699 	iMockLTSY.ExpectL(EMobilePhoneStartDTMFTone, data, KErrNotSupported);
       
   700 	TInt err = iPhone.StartDTMFTone(tone);
       
   701 	ASSERT_EQUALS(KErrNotSupported, err);
       
   702 
       
   703  	//-------------------------------------------------------------------------
       
   704 	// TEST C: Successful completion request of
       
   705 	// RMobilePhone::StartDTMFTone when result is not cached.
       
   706  	//-------------------------------------------------------------------------
       
   707 
       
   708 	iMockLTSY.ExpectL(EMobilePhoneStartDTMFTone, data);
       
   709 	err = iPhone.StartDTMFTone(tone);
       
   710 	ASSERT_EQUALS(KErrNone, err);
       
   711 
       
   712 	AssertMockLtsyStatusL();
       
   713 	CleanupStack::PopAndDestroy(4, this); // call, line, data, this
       
   714 	
       
   715 	}
       
   716 
       
   717 
       
   718 /**
       
   719 @SYMTestCaseID BA-CTSY-DTMF-MNDE-0001
       
   720 @SYMComponent  telephony_ctsy
       
   721 @SYMTestCaseDesc Test support in CTSY for RMobilePhone::NotifyDTMFEvent
       
   722 @SYMTestPriority High
       
   723 @SYMTestActions Invokes RMobilePhone::NotifyDTMFEvent
       
   724 @SYMTestExpectedResults Pass
       
   725 @SYMTestType CT
       
   726 */
       
   727 void CCTsyDTMFFU::TestNotifyDTMFEvent0001L()
       
   728 	{
       
   729 
       
   730 	OpenEtelServerL(EUseExtendedError);
       
   731 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
   732 	OpenPhoneL();
       
   733 
       
   734 	RLine line;
       
   735 	OpenLineLC(line, KMmTsyVoice1LineName);
       
   736 
       
   737 	RCall call;
       
   738 	OpenIncomingCallLC(line, call, 1, RMobilePhone::EVoiceService, RMobileCall::EStatusConnected);
       
   739 
       
   740 	RBuf8 data;
       
   741 	
       
   742 	RMobilePhone::TMobilePhoneDTMFEvent event(RMobilePhone::EStopDtmfTone);	
       
   743 	RMobilePhone::TMobilePhoneDTMFEvent startEvent(RMobilePhone::EStartDtmfTone);	
       
   744 	TRequestStatus reqStatus;
       
   745 	
       
   746     TMockLtsyData1< RMobilePhone::TMobilePhoneDTMFEvent > toneEvent( startEvent );
       
   747     toneEvent.SerialiseL(data);
       
   748 
       
   749 	//-------------------------------------------------------------------------
       
   750 	// TEST A: Test API NotifyDTMFEvent
       
   751  	//-------------------------------------------------------------------------
       
   752 
       
   753 	iPhone.NotifyDTMFEvent(reqStatus, event);
       
   754 	iMockLTSY.CompleteL(EMobilePhoneNotifyDTMFEvent, KErrNone, data);
       
   755 	
       
   756 	User::WaitForRequest(reqStatus);
       
   757 	ASSERT_EQUALS(KErrNone, reqStatus.Int());  
       
   758 	ASSERT_EQUALS(RMobilePhone::EStartDtmfTone, event);
       
   759 
       
   760 	//-------------------------------------------------------------------------
       
   761 	// TEST B: Test Cancelling a previous request NotifyDTMFEvent
       
   762  	//-------------------------------------------------------------------------
       
   763 	iPhone.NotifyDTMFEvent(reqStatus, event);
       
   764 
       
   765 	iPhone.CancelAsyncRequest(EMobilePhoneNotifyDTMFEvent);
       
   766 	User::WaitForRequest(reqStatus);
       
   767 	ASSERT_EQUALS(KErrCancel, reqStatus.Int());	
       
   768 		
       
   769 	//-------------------------------------------------------------------------
       
   770 	// TEST C: Negative test NotifyDTMFEvent
       
   771 	// Test when client has not requested to be notified.
       
   772 	// Should not fall over.
       
   773  	//-------------------------------------------------------------------------
       
   774 	
       
   775 	iMockLTSY.CompleteL(EMobilePhoneNotifyDTMFEvent, KErrNone, data);
       
   776 
       
   777 	CleanupStack::PopAndDestroy(3, this); // call, line, this	
       
   778 	}
       
   779 
       
   780 
       
   781 	
       
   782 	
       
   783 /**
       
   784 @SYMTestCaseID BA-CTSY-DTMF-MNDCC-0001
       
   785 @SYMComponent  telephony_ctsy
       
   786 @SYMTestCaseDesc Test support in CTSY for RMobilePhone::NotifyDTMFCapsChange
       
   787 @SYMTestPriority High
       
   788 @SYMTestActions Invokes RMobilePhone::NotifyDTMFCapsChange
       
   789 @SYMTestExpectedResults Pass
       
   790 @SYMTestType CT
       
   791 */
       
   792 void CCTsyDTMFFU::TestNotifyDTMFCapsChange0001L()
       
   793 	{
       
   794 
       
   795 	OpenEtelServerL(EUseExtendedError);
       
   796 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
   797 	OpenPhoneL();
       
   798 
       
   799  	//-------------------------------------------------------------------------
       
   800 	// TEST C: Successful completion request of
       
   801 	// RMobilePhone::NotifyDTMFCapsChange when result is not cached.
       
   802  	//-------------------------------------------------------------------------
       
   803 
       
   804 	TRequestStatus reqStatus;
       
   805 	TUint32 caps(0);
       
   806 	iPhone.NotifyDTMFCapsChange(reqStatus, caps);
       
   807 
       
   808 	// invoke call info change
       
   809 	RLine line;
       
   810 	OpenLineLC(line, KMmTsyVoice1LineName);
       
   811 
       
   812 	RCall call;
       
   813 	OpenIncomingCallLC(line, call, 1, RMobilePhone::EVoiceService, RMobileCall::EStatusConnected);
       
   814 
       
   815 	// wait for completion NotifyIndicatorChange request
       
   816 	User::WaitForRequest(reqStatus);
       
   817 	ASSERT_EQUALS(KErrNone, reqStatus.Int());
       
   818 	TUint32 expCaps = RMobilePhone::KCapsSendDTMFString | 
       
   819 	                  RMobilePhone::KCapsSendDTMFSingleTone;
       
   820 	ASSERT_EQUALS(expCaps, caps);
       
   821 
       
   822 	AssertMockLtsyStatusL();
       
   823 	CleanupStack::PopAndDestroy(3, this); // call, line, this
       
   824 	
       
   825 	}
       
   826 
       
   827 
       
   828 /**
       
   829 @SYMTestCaseID BA-CTSY-DTMF-MNDCC-0002
       
   830 @SYMComponent  telephony_ctsy
       
   831 @SYMTestCaseDesc Test support in CTSY for cancelling of RMobilePhone::NotifyDTMFCapsChange
       
   832 @SYMTestPriority High
       
   833 @SYMTestActions Invokes cancelling of RMobilePhone::NotifyDTMFCapsChange
       
   834 @SYMTestExpectedResults Pass
       
   835 @SYMTestType CT
       
   836 */
       
   837 void CCTsyDTMFFU::TestNotifyDTMFCapsChange0002L()
       
   838 	{
       
   839 
       
   840 	OpenEtelServerL(EUseExtendedError);
       
   841 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
   842 	OpenPhoneL();
       
   843 
       
   844 	//-------------------------------------------------------------------------
       
   845 	// Test cancelling of RMobilePhone::NotifyDTMFCapsChange
       
   846  	//-------------------------------------------------------------------------
       
   847  	
       
   848 	TRequestStatus reqStatus;
       
   849 	TUint32 caps(0);
       
   850 	iPhone.NotifyDTMFCapsChange(reqStatus, caps);
       
   851 
       
   852 	iPhone.CancelAsyncRequest(EMobilePhoneNotifyDTMFCapsChange);
       
   853 
       
   854 	User::WaitForRequest(reqStatus);
       
   855 	ASSERT_EQUALS(KErrCancel, reqStatus.Int());
       
   856 
       
   857 	CleanupStack::PopAndDestroy(this);
       
   858 	
       
   859 	}
       
   860 
       
   861 
       
   862 /**
       
   863 @SYMTestCaseID BA-CTSY-DTMF-MNDCC-0004
       
   864 @SYMComponent  telephony_ctsy
       
   865 @SYMTestCaseDesc Test support in CTSY for multiple client requests to RMobilePhone::NotifyDTMFCapsChange
       
   866 @SYMTestPriority High
       
   867 @SYMTestActions Invokes multiple client requests to RMobilePhone::NotifyDTMFCapsChange
       
   868 @SYMTestExpectedResults Pass
       
   869 @SYMTestType CT
       
   870 */
       
   871 void CCTsyDTMFFU::TestNotifyDTMFCapsChange0004L()
       
   872 	{
       
   873 
       
   874 	OpenEtelServerL(EUseExtendedError);
       
   875 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
   876 	OpenPhoneL();
       
   877 
       
   878 	// Open second client
       
   879 	RTelServer telServer2;
       
   880 	TInt ret = telServer2.Connect();
       
   881 	ASSERT_EQUALS(KErrNone, ret);
       
   882 	CleanupClosePushL(telServer2);
       
   883 
       
   884 	RMobilePhone phone2;
       
   885 	ret = phone2.Open(telServer2,KMmTsyPhoneName);
       
   886 	ASSERT_EQUALS(KErrNone, ret);
       
   887 	CleanupClosePushL(phone2);
       
   888 
       
   889 	//-------------------------------------------------------------------------
       
   890 	// Test A: Test multiple clients requesting RMobilePhone::NotifyDTMFCapsChange
       
   891  	//-------------------------------------------------------------------------
       
   892 
       
   893 	TRequestStatus reqStatus;
       
   894 	TUint32 caps(0);
       
   895 	iPhone.NotifyDTMFCapsChange(reqStatus, caps);
       
   896 
       
   897 	TRequestStatus reqStatus2;
       
   898 	TUint32 caps2(0);
       
   899 	phone2.NotifyDTMFCapsChange(reqStatus2, caps2);
       
   900 
       
   901 	// invoke call info change
       
   902 	RLine line;
       
   903 	OpenLineLC(line, KMmTsyVoice1LineName);
       
   904 
       
   905 	RCall call;
       
   906 	OpenIncomingCallLC(line, call, 1, RMobilePhone::EVoiceService, RMobileCall::EStatusConnected);
       
   907 
       
   908 	// wait for completion NotifyIndicatorChange request
       
   909 	User::WaitForRequest(reqStatus);
       
   910 	ASSERT_EQUALS(KErrNone, reqStatus.Int());
       
   911 	TUint32 expCaps = RMobilePhone::KCapsSendDTMFString | 
       
   912 	                  RMobilePhone::KCapsSendDTMFSingleTone;
       
   913 	ASSERT_EQUALS(expCaps, caps);
       
   914 
       
   915 	User::WaitForRequest(reqStatus2);
       
   916 	ASSERT_EQUALS(KErrNone, reqStatus2.Int());
       
   917 	ASSERT_EQUALS(expCaps, caps2);
       
   918 
       
   919 	CleanupStack::PopAndDestroy(2); // line, call
       
   920 	CleanupStack::PopAndDestroy(3, this); // phone2, telServer2, this
       
   921 
       
   922 	}
       
   923 
       
   924 
       
   925 /**
       
   926 @SYMTestCaseID BA-CTSY-DTMF-MNSDS-0001
       
   927 @SYMComponent  telephony_ctsy
       
   928 @SYMTestCaseDesc Test support in CTSY for RMobilePhone::NotifyStopInDTMFString
       
   929 @SYMTestPriority High
       
   930 @SYMTestActions Invokes RMobilePhone::NotifyStopInDTMFString
       
   931 @SYMTestExpectedResults Pass
       
   932 @SYMTestType CT
       
   933 */
       
   934 void CCTsyDTMFFU::TestNotifyStopInDTMFString0001L()
       
   935 	{
       
   936 
       
   937 	OpenEtelServerL(EUseExtendedError);
       
   938 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
   939 	OpenPhoneL();
       
   940 
       
   941 	RBuf8 data;
       
   942 	CleanupClosePushL(data);
       
   943 	
       
   944 	RLine line;
       
   945 	OpenLineLC(line, KMmTsyVoice1LineName);
       
   946 
       
   947 	RCall call;
       
   948 	OpenIncomingCallLC(line, call, 1, RMobilePhone::EVoiceService, RMobileCall::EStatusConnected);
       
   949 
       
   950 	//-------------------------------------------------------------------------
       
   951 	// TEST C: Successful completion request of
       
   952 	// RMobilePhone::NotifyStopInDTMFString when result is not cached.
       
   953  	//-------------------------------------------------------------------------
       
   954 
       
   955 	// execute request
       
   956 	TRequestStatus reqStatus;
       
   957 	iPhone.NotifyStopInDTMFString(reqStatus);
       
   958 
       
   959 	// send dtmf tones request and invoke notify complete
       
   960 	TInfoName tones(_L("45w123"));
       
   961 	TMockLtsyData1<TInfoName> tonesLtsyData( tones );
       
   962 	tonesLtsyData.SerialiseL(data);
       
   963 	iMockLTSY.ExpectL(EMobilePhoneSendDTMFTones, data);
       
   964 
       
   965 	tones.Copy(_L("123"));
       
   966 	data.Close();
       
   967 	tonesLtsyData.SerialiseL(data);
       
   968 	iMockLTSY.CompleteL(EMobilePhoneNotifyStopInDTMFString, KErrNone, data);
       
   969 	
       
   970 	TRequestStatus sendDtmfStatus;
       
   971 	tones.Copy(_L("45w123"));
       
   972 	iPhone.SendDTMFTones(sendDtmfStatus, tones);
       
   973 
       
   974 	// wait for completion notify request
       
   975 	User::WaitForRequest(reqStatus);
       
   976 	ASSERT_EQUALS(KErrNone, reqStatus.Int());
       
   977 	AssertMockLtsyStatusL();
       
   978 
       
   979 	// abortion of send Dtmf request
       
   980 	TInt err = iPhone.ContinueDTMFStringSending(EFalse);
       
   981 	ASSERT_EQUALS(KErrNone, err);
       
   982 	
       
   983 	User::WaitForRequest(sendDtmfStatus);
       
   984 	ASSERT_EQUALS(KErrAbort, sendDtmfStatus.Int());
       
   985 
       
   986 	//-------------------------------------------------------------------------
       
   987 	// TEST E: Unsolicited completion of RMobilePhone::NotifyStopInDTMFString
       
   988 	// from LTSY.
       
   989  	//-------------------------------------------------------------------------
       
   990 
       
   991 	TRequestStatus mockLtsyStatus;
       
   992 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
   993 	tones.Copy(_L("456"));
       
   994 	data.Close();
       
   995 	tonesLtsyData.SerialiseL(data);
       
   996 	iMockLTSY.CompleteL(EMobilePhoneNotifyStopInDTMFString, KErrNone, data);
       
   997 	User::WaitForRequest(mockLtsyStatus);
       
   998 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
   999 	AssertMockLtsyStatusL();
       
  1000 
       
  1001 	CleanupStack::PopAndDestroy(4, this); // call, line, data, this
       
  1002 	
       
  1003 	}
       
  1004 
       
  1005 
       
  1006 /**
       
  1007 @SYMTestCaseID BA-CTSY-DTMF-MNSDS-0002
       
  1008 @SYMComponent  telephony_ctsy
       
  1009 @SYMTestCaseDesc Test support in CTSY for cancelling of RMobilePhone::NotifyStopInDTMFString
       
  1010 @SYMTestPriority High
       
  1011 @SYMTestActions Invokes cancelling of RMobilePhone::NotifyStopInDTMFString
       
  1012 @SYMTestExpectedResults Pass
       
  1013 @SYMTestType CT
       
  1014 */
       
  1015 void CCTsyDTMFFU::TestNotifyStopInDTMFString0002L()
       
  1016 	{
       
  1017 
       
  1018 	OpenEtelServerL(EUseExtendedError);
       
  1019 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  1020 	OpenPhoneL();
       
  1021 
       
  1022 	RBuf8 data;
       
  1023 	CleanupClosePushL(data);
       
  1024 
       
  1025 	RLine line;
       
  1026 	OpenLineLC(line, KMmTsyVoice1LineName);
       
  1027 
       
  1028 	RCall call;
       
  1029 	OpenIncomingCallLC(line, call, 1, RMobilePhone::EVoiceService, RMobileCall::EStatusConnected);
       
  1030 
       
  1031 	TRequestStatus mockLtsyStatus;
       
  1032 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
  1033 
       
  1034  	//-------------------------------------------------------------------------
       
  1035 	// Test cancelling of RMobilePhone::NotifyStopInDTMFString
       
  1036  	//-------------------------------------------------------------------------
       
  1037  	
       
  1038 	// execute request
       
  1039 	TRequestStatus reqStatus;
       
  1040 	iPhone.NotifyStopInDTMFString(reqStatus);
       
  1041 	
       
  1042 	// send dtmf tones request
       
  1043 	TInfoName tones(_L("45w123"));
       
  1044 	TMockLtsyData1<TInfoName> tonesLtsyData( tones );
       
  1045 	tonesLtsyData.SerialiseL(data);
       
  1046 	iMockLTSY.ExpectL(EMobilePhoneSendDTMFTones, data);
       
  1047 
       
  1048 	// notify completion
       
  1049 	tones.Copy(_L("123"));
       
  1050 	data.Close();
       
  1051 	tonesLtsyData.SerialiseL(data);
       
  1052 	iMockLTSY.CompleteL(EMobilePhoneNotifyStopInDTMFString, KErrNone, data, 10);
       
  1053 
       
  1054 	TRequestStatus sendDtmfStatus;
       
  1055 	tones.Copy(_L("45w123"));
       
  1056 	iPhone.SendDTMFTones(sendDtmfStatus, tones);
       
  1057 
       
  1058 	iPhone.CancelAsyncRequest(EMobilePhoneNotifyStopInDTMFString);
       
  1059 
       
  1060 	// wait for completion
       
  1061 	User::WaitForRequest(reqStatus);
       
  1062 	ASSERT_EQUALS(KErrCancel, reqStatus.Int());
       
  1063 
       
  1064 	// Wait for completion of iMockLTSY.NotifyTerminated
       
  1065 	User::WaitForRequest(mockLtsyStatus);
       
  1066 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
  1067 	AssertMockLtsyStatusL();
       
  1068 
       
  1069 	User::WaitForRequest(sendDtmfStatus);
       
  1070 	ASSERT_EQUALS(KErrTimedOut, sendDtmfStatus.Int());
       
  1071 
       
  1072 	CleanupStack::PopAndDestroy(4); // call, line, data, this
       
  1073 	
       
  1074 	}
       
  1075 
       
  1076 
       
  1077 /**
       
  1078 @SYMTestCaseID BA-CTSY-DTMF-MNSDS-0004
       
  1079 @SYMComponent  telephony_ctsy
       
  1080 @SYMTestCaseDesc Test support in CTSY for multiple client requests to RMobilePhone::NotifyStopInDTMFString
       
  1081 @SYMTestPriority High
       
  1082 @SYMTestActions Invokes multiple client requests to RMobilePhone::NotifyStopInDTMFString
       
  1083 @SYMTestExpectedResults Pass
       
  1084 @SYMTestType CT
       
  1085 */
       
  1086 void CCTsyDTMFFU::TestNotifyStopInDTMFString0004L()
       
  1087 	{
       
  1088 
       
  1089 	OpenEtelServerL(EUseExtendedError);
       
  1090 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  1091 	OpenPhoneL();
       
  1092 
       
  1093 	RBuf8 data;
       
  1094 	CleanupClosePushL(data);
       
  1095 
       
  1096 	RLine line;
       
  1097 	OpenLineLC(line, KMmTsyVoice1LineName);
       
  1098 
       
  1099 	RCall call;
       
  1100 	OpenIncomingCallLC(line, call, 1, RMobilePhone::EVoiceService, RMobileCall::EStatusConnected);
       
  1101 
       
  1102 	// Open second client
       
  1103 	RTelServer telServer2;
       
  1104 	TInt ret = telServer2.Connect();
       
  1105 	ASSERT_EQUALS(KErrNone, ret);
       
  1106 	CleanupClosePushL(telServer2);
       
  1107 
       
  1108 	RMobilePhone phone2;
       
  1109 	ret = phone2.Open(telServer2, KMmTsyPhoneName);
       
  1110 	ASSERT_EQUALS(KErrNone, ret);
       
  1111 	CleanupClosePushL(phone2);
       
  1112 
       
  1113 	//-------------------------------------------------------------------------
       
  1114 	// Test A: Test multiple clients requesting RMobilePhone::NotifyStopInDTMFString
       
  1115  	//-------------------------------------------------------------------------
       
  1116 
       
  1117 	// execute requests
       
  1118 	TRequestStatus reqStatus;
       
  1119 	iPhone.NotifyStopInDTMFString(reqStatus);
       
  1120 	
       
  1121 	TRequestStatus reqStatus2;
       
  1122 	phone2.NotifyStopInDTMFString(reqStatus2);
       
  1123 	
       
  1124 	// send dtmf tones request and invoke notify complete
       
  1125 	TInfoName tones(_L("45w123"));
       
  1126 	TMockLtsyData1<TInfoName> tonesLtsyData( tones );
       
  1127 	tonesLtsyData.SerialiseL(data);
       
  1128 	iMockLTSY.ExpectL(EMobilePhoneSendDTMFTones, data);
       
  1129 
       
  1130 	tones.Copy(_L("123"));
       
  1131 	data.Close();
       
  1132 	tonesLtsyData.SerialiseL(data);
       
  1133 	iMockLTSY.CompleteL(EMobilePhoneNotifyStopInDTMFString, KErrNone, data);
       
  1134 
       
  1135 	TRequestStatus sendDtmfStatus;
       
  1136 	tones.Copy(_L("45w123"));
       
  1137 	iPhone.SendDTMFTones(sendDtmfStatus, tones);
       
  1138 
       
  1139 	// wait for notify requests completion
       
  1140 	User::WaitForRequest(reqStatus);
       
  1141 	ASSERT_EQUALS(KErrNone, reqStatus.Int());
       
  1142 	AssertMockLtsyStatusL();
       
  1143 
       
  1144 	User::WaitForRequest(reqStatus2);
       
  1145 	ASSERT_EQUALS(KErrNone, reqStatus2.Int());
       
  1146 
       
  1147 	// abortion of send Dtmf request
       
  1148 	TInt err = iPhone.ContinueDTMFStringSending(EFalse);
       
  1149 	ASSERT_EQUALS(KErrNone, err);
       
  1150 	
       
  1151 	User::WaitForRequest(sendDtmfStatus);
       
  1152 	ASSERT_EQUALS(KErrAbort, sendDtmfStatus.Int());
       
  1153 
       
  1154 	CleanupStack::PopAndDestroy(6, this); // call, line, phone2, telServer2, data, this
       
  1155 
       
  1156 	}
       
  1157 
       
  1158 
       
  1159 /**
       
  1160 @SYMTestCaseID BA-CTSY-DTMF-MCDSS-0001
       
  1161 @SYMComponent  telephony_ctsy
       
  1162 @SYMTestCaseDesc Test support in CTSY for RMobilePhone::ContinueDTMFStringSending
       
  1163 @SYMTestPriority High
       
  1164 @SYMTestActions Invokes RMobilePhone::ContinueDTMFStringSending
       
  1165 @SYMTestExpectedResults Pass
       
  1166 @SYMTestType CT
       
  1167 */
       
  1168 void CCTsyDTMFFU::TestContinueDTMFStringSending0001L()
       
  1169 	{
       
  1170 
       
  1171 	OpenEtelServerL(EUseExtendedError);
       
  1172 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  1173 	OpenPhoneL();
       
  1174 
       
  1175 	RBuf8 data;
       
  1176 	CleanupClosePushL(data);
       
  1177 
       
  1178 	RLine line;
       
  1179 	OpenLineLC(line, KMmTsyVoice1LineName);
       
  1180 
       
  1181 	RCall call;
       
  1182 	OpenIncomingCallLC(line, call, 1, RMobilePhone::EVoiceService, RMobileCall::EStatusConnected);
       
  1183 
       
  1184 	//-------------------------------------------------------------------------
       
  1185 	// TEST A: failure to dispatch request to LTSY
       
  1186  	//-------------------------------------------------------------------------
       
  1187 
       
  1188 	// notify stop in dtmf string request
       
  1189 	TRequestStatus mockLtsyStatus;
       
  1190 	iPhone.NotifyStopInDTMFString(mockLtsyStatus);
       
  1191 
       
  1192 	// setting expected data for send dtmf tones request
       
  1193 	TInfoName tones(_L("45w123"));
       
  1194 	TMockLtsyData1<TInfoName> tonesLtsyData( tones );
       
  1195 	tonesLtsyData.SerialiseL(data);
       
  1196 	iMockLTSY.ExpectL(EMobilePhoneSendDTMFTones, data);
       
  1197 
       
  1198 	// setting data for notify stop in dtmf string
       
  1199 	TInfoName stopTones(_L("123"));
       
  1200 	TMockLtsyData1<TInfoName> stopLtsyData( stopTones );
       
  1201 	data.Close();
       
  1202 	stopLtsyData.SerialiseL(data);
       
  1203 	iMockLTSY.CompleteL(EMobilePhoneNotifyStopInDTMFString, KErrNone, data);
       
  1204 	
       
  1205 	// send dtmf tones
       
  1206 	TRequestStatus reqStatus;
       
  1207 	iPhone.SendDTMFTones(reqStatus, tones);
       
  1208 
       
  1209 	// wait for stop in dtmf string
       
  1210 	User::WaitForRequest(mockLtsyStatus);
       
  1211 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
  1212 	
       
  1213 	// setting expected data for ContinueDTMFStringSending request
       
  1214 	data.Close();
       
  1215 	stopLtsyData.SerialiseL(data);
       
  1216 	iMockLTSY.ExpectL(EMobilePhoneContinueDTMFStringSending, data, KErrNotSupported);
       
  1217 	
       
  1218 	// ContinueDTMFStringSending request
       
  1219 	TInt err = iPhone.ContinueDTMFStringSending(ETrue);
       
  1220 	ASSERT_EQUALS(KErrNotSupported, err);
       
  1221 
       
  1222 	// SendDTMFTones request completion
       
  1223 	User::WaitForRequest(reqStatus);
       
  1224 	ASSERT_EQUALS(KErrNotSupported, reqStatus.Int());
       
  1225 
       
  1226 	AssertMockLtsyStatusL();
       
  1227 
       
  1228  	//-------------------------------------------------------------------------
       
  1229 	// TEST C: Successful completion request of
       
  1230 	// RMobilePhone::ContinueDTMFStringSending when result is not cached.
       
  1231  	//-------------------------------------------------------------------------
       
  1232 
       
  1233 	// notify stop in dtmf string request
       
  1234 	iPhone.NotifyStopInDTMFString(mockLtsyStatus);
       
  1235 
       
  1236 	// send dtmf tones request
       
  1237 	data.Close();
       
  1238 	tonesLtsyData.SerialiseL(data);
       
  1239 	iMockLTSY.ExpectL(EMobilePhoneSendDTMFTones, data);
       
  1240 	data.Close();
       
  1241 	stopLtsyData.SerialiseL(data);
       
  1242 	iMockLTSY.CompleteL(EMobilePhoneNotifyStopInDTMFString, KErrNone, data);
       
  1243 	iPhone.SendDTMFTones(reqStatus, tones);
       
  1244 
       
  1245 	// wait for stop in dtmf string
       
  1246 	User::WaitForRequest(mockLtsyStatus);
       
  1247 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
  1248 	
       
  1249 	// ContinueDTMFStringSending request
       
  1250 	data.Close();
       
  1251 	stopLtsyData.SerialiseL(data);
       
  1252 	iMockLTSY.ExpectL(EMobilePhoneContinueDTMFStringSending, data);
       
  1253 	err = iPhone.ContinueDTMFStringSending(ETrue);
       
  1254 	ASSERT_EQUALS(KErrNone, err);
       
  1255 
       
  1256 	// invoke SendDTMFTones request completion
       
  1257 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
  1258 	iMockLTSY.CompleteL(EMobilePhoneSendDTMFTones, KErrNone);
       
  1259 	User::WaitForRequest(mockLtsyStatus);
       
  1260 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
  1261 
       
  1262 	// SendDTMFTones request completion
       
  1263 	User::WaitForRequest(reqStatus);
       
  1264 	ASSERT_EQUALS(KErrNone, reqStatus.Int());
       
  1265 	
       
  1266 	AssertMockLtsyStatusL();
       
  1267 
       
  1268  	//-------------------------------------------------------------------------
       
  1269 	// TEST: completion request when parameter is EFalse
       
  1270  	//-------------------------------------------------------------------------
       
  1271 
       
  1272 	// notify stop in dtmf string request
       
  1273 	iPhone.NotifyStopInDTMFString(mockLtsyStatus);
       
  1274 
       
  1275 	// send dtmf tones request
       
  1276 	data.Close();
       
  1277 	tonesLtsyData.SerialiseL(data);
       
  1278 	iMockLTSY.ExpectL(EMobilePhoneSendDTMFTones, data);
       
  1279 	data.Close();
       
  1280 	stopLtsyData.SerialiseL(data);
       
  1281 	iMockLTSY.CompleteL(EMobilePhoneNotifyStopInDTMFString, KErrNone, data);
       
  1282 	iPhone.SendDTMFTones(reqStatus, tones);
       
  1283 
       
  1284 	// wait for stop in dtmf string
       
  1285 	User::WaitForRequest(mockLtsyStatus);
       
  1286 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
  1287 	
       
  1288 	// ContinueDTMFStringSending request
       
  1289 	err = iPhone.ContinueDTMFStringSending(EFalse);
       
  1290 	ASSERT_EQUALS(KErrNone, err);
       
  1291 
       
  1292 	// SendDTMFTones request completion
       
  1293 	User::WaitForRequest(reqStatus);
       
  1294 	ASSERT_EQUALS(KErrAbort, reqStatus.Int());
       
  1295 
       
  1296 	AssertMockLtsyStatusL();
       
  1297 
       
  1298  	//-------------------------------------------------------------------------
       
  1299 	// TEST: completion request when continue tones is empty
       
  1300  	//-------------------------------------------------------------------------
       
  1301 
       
  1302 	// notify stop in dtmf string request
       
  1303 	iPhone.NotifyStopInDTMFString(mockLtsyStatus);
       
  1304 
       
  1305 	// send dtmf tones request
       
  1306 	data.Close();
       
  1307 	tonesLtsyData.SerialiseL(data);
       
  1308 	iMockLTSY.ExpectL(EMobilePhoneSendDTMFTones, data);
       
  1309 	stopTones.Copy(KNullDesC);
       
  1310 	data.Close();
       
  1311 	stopLtsyData.SerialiseL(data);
       
  1312 	iMockLTSY.CompleteL(EMobilePhoneNotifyStopInDTMFString, KErrNone, data);
       
  1313 	iPhone.SendDTMFTones(reqStatus, tones);
       
  1314 
       
  1315 	// wait for stop in dtmf string
       
  1316 	User::WaitForRequest(mockLtsyStatus);
       
  1317 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
  1318 	
       
  1319 	// ContinueDTMFStringSending request
       
  1320 	err = iPhone.ContinueDTMFStringSending(ETrue);
       
  1321 	ASSERT_EQUALS(KErrNone, err);
       
  1322 
       
  1323 	// SendDTMFTones request completion
       
  1324 	User::WaitForRequest(reqStatus);
       
  1325 	ASSERT_EQUALS(KErrNone, reqStatus.Int());
       
  1326 
       
  1327 	AssertMockLtsyStatusL();
       
  1328 
       
  1329  	//-------------------------------------------------------------------------
       
  1330 	// TEST: completion request when continue tones is null
       
  1331  	//-------------------------------------------------------------------------
       
  1332 
       
  1333 	// notify stop in dtmf string request
       
  1334 	iPhone.NotifyStopInDTMFString(mockLtsyStatus);
       
  1335 
       
  1336 	// send dtmf tones request
       
  1337 	data.Close();
       
  1338 	tonesLtsyData.SerialiseL(data);
       
  1339 	iMockLTSY.ExpectL(EMobilePhoneSendDTMFTones, data);
       
  1340 	// pack special constant _L("null")
       
  1341 	// for recognize null pointer packing test case in CMockPhoneMessHandler::Complete
       
  1342 	stopTones.Copy(_L("null"));
       
  1343 	data.Close();
       
  1344 	stopLtsyData.SerialiseL(data);
       
  1345 	iMockLTSY.CompleteL(EMobilePhoneNotifyStopInDTMFString, KErrNone, data);
       
  1346 	iPhone.SendDTMFTones(reqStatus, tones);
       
  1347 
       
  1348 	// wait for stop in dtmf string
       
  1349 	User::WaitForRequest(mockLtsyStatus);
       
  1350 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
  1351 	
       
  1352 	// ContinueDTMFStringSending request
       
  1353 	err = iPhone.ContinueDTMFStringSending(ETrue);
       
  1354 	ASSERT_EQUALS(KErrNone, err);
       
  1355 
       
  1356 	// SendDTMFTones request completion
       
  1357 	User::WaitForRequest(reqStatus);
       
  1358 	ASSERT_EQUALS(KErrNone, reqStatus.Int());
       
  1359 
       
  1360 	AssertMockLtsyStatusL();
       
  1361 
       
  1362  	//-------------------------------------------------------------------------
       
  1363 	// TEST: completion request when DTMF sending not going on
       
  1364  	//-------------------------------------------------------------------------
       
  1365 
       
  1366 	// ContinueDTMFStringSending request
       
  1367 	err = iPhone.ContinueDTMFStringSending(ETrue);
       
  1368 	ASSERT_EQUALS(KErrNotReady, err);
       
  1369 
       
  1370 	AssertMockLtsyStatusL();
       
  1371 
       
  1372 	CleanupStack::PopAndDestroy(4, this); // line, call, data, this
       
  1373 	
       
  1374 	}
       
  1375 
       
  1376 
       
  1377 /**
       
  1378 @SYMTestCaseID BA-CTSY-DTMF-MCDSS-0005
       
  1379 @SYMComponent  telephony_ctsy
       
  1380 @SYMTestCaseDesc Test support in CTSY for RMobilePhone::ContinueDTMFStringSending with timeout
       
  1381 @SYMTestPriority High
       
  1382 @SYMTestActions Invokes RMobilePhone::ContinueDTMFStringSending and tests for timeout
       
  1383 @SYMTestExpectedResults Pass
       
  1384 @SYMTestType CT
       
  1385 */
       
  1386 void CCTsyDTMFFU::TestContinueDTMFStringSending0005L()
       
  1387 	{
       
  1388 
       
  1389 	OpenEtelServerL(EUseExtendedError);
       
  1390 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  1391 	OpenPhoneL();
       
  1392 
       
  1393 	RBuf8 data;
       
  1394 	CleanupClosePushL(data);
       
  1395 
       
  1396 	RLine line;
       
  1397 	OpenLineLC(line, KMmTsyVoice1LineName);
       
  1398 
       
  1399 	RCall call;
       
  1400 	OpenIncomingCallLC(line, call, 1, RMobilePhone::EVoiceService, RMobileCall::EStatusConnected);
       
  1401 
       
  1402 	//-------------------------------------------------------------------------
       
  1403 	// Test A: Test timeout of RMobilePhone::ContinueDTMFStringSending
       
  1404  	//-------------------------------------------------------------------------
       
  1405 
       
  1406 	// notify stop in dtmf string request
       
  1407 	TRequestStatus mockLtsyStatus;
       
  1408 	iPhone.NotifyStopInDTMFString(mockLtsyStatus);
       
  1409 
       
  1410 	// setting expected data for send dtmf tones request
       
  1411 	TInfoName tones(_L("43w123"));
       
  1412 	TMockLtsyData1<TInfoName> tonesLtsyData( tones );
       
  1413 	tonesLtsyData.SerialiseL(data);
       
  1414 	iMockLTSY.ExpectL(EMobilePhoneSendDTMFTones, data);
       
  1415 
       
  1416 	// setting data for notify stop in dtmf string
       
  1417 	TInfoName stopTones(_L("123"));
       
  1418 	TMockLtsyData1<TInfoName> stopLtsyData( stopTones );
       
  1419 	data.Close();
       
  1420 	stopLtsyData.SerialiseL(data);
       
  1421 	iMockLTSY.CompleteL(EMobilePhoneNotifyStopInDTMFString, KErrNone, data);
       
  1422 	
       
  1423 	// send dtmf tones
       
  1424 	TRequestStatus reqStatus;
       
  1425 	iPhone.SendDTMFTones(reqStatus, tones);
       
  1426 
       
  1427 	// wait for stop in dtmf string
       
  1428 	User::WaitForRequest(mockLtsyStatus);
       
  1429 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
  1430 	
       
  1431 	// setting expected data for ContinueDTMFStringSending request
       
  1432 	data.Close();
       
  1433 	stopLtsyData.SerialiseL(data);
       
  1434 	iMockLTSY.ExpectL(EMobilePhoneContinueDTMFStringSending, data);
       
  1435 	
       
  1436 	// ContinueDTMFStringSending request
       
  1437 	TInt err = iPhone.ContinueDTMFStringSending(ETrue);
       
  1438 	ASSERT_EQUALS(KErrNone, err);
       
  1439 
       
  1440 	// SendDTMFTones request completion
       
  1441 	User::WaitForRequest(reqStatus);
       
  1442 	ASSERT_EQUALS(KErrTimedOut, reqStatus.Int());
       
  1443 
       
  1444 	AssertMockLtsyStatusL();
       
  1445 
       
  1446 	CleanupStack::PopAndDestroy(4, this); // call, line, data, this
       
  1447 
       
  1448 	}