telephonyserverplugins/common_tsy/test/component/src/cctsyconferencecallcontrolfu.cpp
changeset 0 3553901f7fa8
child 14 7ef16719d8cb
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 ConferenceCallControl in the Common TSY.
       
    15 // 
       
    16 //
       
    17 
       
    18 /**
       
    19  @file 
       
    20 */
       
    21 
       
    22 #include "cctsyconferencecallcontrolfu.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 #include "cmmconferencecalltsy.h"
       
    31 #include <sys/unistd.h>
       
    32 #include <etelmmerr.h>
       
    33 
       
    34 CTestSuite* CCTsyConferenceCallControlFU::CreateSuiteL(const TDesC& aName)
       
    35 	{
       
    36 	SUB_SUITE;
       
    37 
       
    38 	ADD_TEST_STEP_ISO_CPP(CCTsyConferenceCallControlFU, TestGoOneToOne0001L);
       
    39 	ADD_TEST_STEP_ISO_CPP(CCTsyConferenceCallControlFU, TestGoOneToOne0002L);
       
    40 	ADD_TEST_STEP_ISO_CPP(CCTsyConferenceCallControlFU, TestGoOneToOne0004L);
       
    41 	ADD_TEST_STEP_ISO_CPP(CCTsyConferenceCallControlFU, TestGoOneToOne0005L);
       
    42 	ADD_TEST_STEP_ISO_CPP(CCTsyConferenceCallControlFU, TestGoOneToOne0006L);
       
    43 	ADD_TEST_STEP_ISO_CPP(CCTsyConferenceCallControlFU, TestGoOneToOne00011L);
       
    44 	ADD_TEST_STEP_ISO_CPP(CCTsyConferenceCallControlFU, TestEnumerateCalls0001L);
       
    45 	ADD_TEST_STEP_ISO_CPP(CCTsyConferenceCallControlFU, TestCreateConference0001L);
       
    46 	ADD_TEST_STEP_ISO_CPP(CCTsyConferenceCallControlFU, TestCreateConference0002L);
       
    47 	ADD_TEST_STEP_ISO_CPP(CCTsyConferenceCallControlFU, TestCreateConference0004L);
       
    48 	ADD_TEST_STEP_ISO_CPP(CCTsyConferenceCallControlFU, TestCreateConference0005L);
       
    49 	ADD_TEST_STEP_ISO_CPP(CCTsyConferenceCallControlFU, TestBreakDownConference0001aL);
       
    50 	ADD_TEST_STEP_ISO_CPP(CCTsyConferenceCallControlFU, TestBreakDownConference0001bL);
       
    51 	ADD_TEST_STEP_ISO_CPP(CCTsyConferenceCallControlFU, TestBreakDownConference0001cL);
       
    52 	ADD_TEST_STEP_ISO_CPP(CCTsyConferenceCallControlFU, TestGhostConference0001L);
       
    53 	ADD_TEST_STEP_ISO_CPP(CCTsyConferenceCallControlFU, TestNotifyCapsChange0001L);
       
    54 	ADD_TEST_STEP_ISO_CPP(CCTsyConferenceCallControlFU, TestNotifyCapsChange0002L);
       
    55 	ADD_TEST_STEP_ISO_CPP(CCTsyConferenceCallControlFU, TestNotifyCapsChange0004L);
       
    56 	ADD_TEST_STEP_ISO_CPP(CCTsyConferenceCallControlFU, TestGetConferenceStatus0001L);
       
    57 	ADD_TEST_STEP_ISO_CPP(CCTsyConferenceCallControlFU, TestNotifyConferenceEvent0001L);
       
    58 	ADD_TEST_STEP_ISO_CPP(CCTsyConferenceCallControlFU, TestNotifyConferenceEvent0002L);
       
    59 	ADD_TEST_STEP_ISO_CPP(CCTsyConferenceCallControlFU, TestNotifyConferenceEvent0004L);
       
    60 	ADD_TEST_STEP_ISO_CPP(CCTsyConferenceCallControlFU, TestNotifyConferenceStatusChange0001L);
       
    61 	ADD_TEST_STEP_ISO_CPP(CCTsyConferenceCallControlFU, TestNotifyConferenceStatusChange0002L);
       
    62 	ADD_TEST_STEP_ISO_CPP(CCTsyConferenceCallControlFU, TestNotifyConferenceStatusChange0004L);
       
    63 	ADD_TEST_STEP_ISO_CPP(CCTsyConferenceCallControlFU, TestSwap0001L);
       
    64 	ADD_TEST_STEP_ISO_CPP(CCTsyConferenceCallControlFU, TestSwap0002L);
       
    65 	ADD_TEST_STEP_ISO_CPP(CCTsyConferenceCallControlFU, TestSwap0004L);
       
    66 	ADD_TEST_STEP_ISO_CPP(CCTsyConferenceCallControlFU, TestSwap0005L);
       
    67 	ADD_TEST_STEP_ISO_CPP(CCTsyConferenceCallControlFU, TestHangUp0001L);
       
    68 	ADD_TEST_STEP_ISO_CPP(CCTsyConferenceCallControlFU, TestHangUp0001bL);
       
    69 	ADD_TEST_STEP_ISO_CPP(CCTsyConferenceCallControlFU, TestHangUp0002L);
       
    70 	ADD_TEST_STEP_ISO_CPP(CCTsyConferenceCallControlFU, TestHangUp0004L);
       
    71 	ADD_TEST_STEP_ISO_CPP(CCTsyConferenceCallControlFU, TestHangUp0005L);
       
    72 	ADD_TEST_STEP_ISO_CPP(CCTsyConferenceCallControlFU, TestAddCall0001L);
       
    73 	ADD_TEST_STEP_ISO_CPP(CCTsyConferenceCallControlFU, TestAddCall0002L);
       
    74 	ADD_TEST_STEP_ISO_CPP(CCTsyConferenceCallControlFU, TestAddCall0003L);
       
    75 	ADD_TEST_STEP_ISO_CPP(CCTsyConferenceCallControlFU, TestAddCall0004L);
       
    76 	ADD_TEST_STEP_ISO_CPP(CCTsyConferenceCallControlFU, TestAddCall0005L);
       
    77 	ADD_TEST_STEP_ISO_CPP(CCTsyConferenceCallControlFU, TestGetCaps0001L);
       
    78 	ADD_TEST_STEP_ISO_CPP(CCTsyConferenceCallControlFU, TestGetMobileCallInfo0001L);
       
    79 	ADD_TEST_STEP_ISO_CPP(CCTsyConferenceCallControlFU, TestGetMobileCallInfo0003L);
       
    80 
       
    81 	END_SUITE;
       
    82 	}
       
    83 
       
    84 
       
    85 //
       
    86 // Actual test cases
       
    87 //
       
    88 
       
    89 
       
    90 /**
       
    91 @SYMTestCaseID BA-CTSY-CONC-CGOTO-0001
       
    92 @SYMComponent  telephony_ctsy
       
    93 @SYMTestCaseDesc Test support in CTSY for RMobileCall::GoOneToOne for voice calls
       
    94 @SYMTestPriority High
       
    95 @SYMTestActions Invokes RMobileCall::GoOneToOne for voice calls
       
    96 @SYMTestExpectedResults Pass
       
    97 @SYMTestType CT
       
    98 */
       
    99 void CCTsyConferenceCallControlFU::TestGoOneToOne0001L()
       
   100 	{
       
   101 
       
   102 	OpenEtelServerL(EUseExtendedError);
       
   103 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
   104 	OpenPhoneL();
       
   105 
       
   106 	RBuf8 data;
       
   107 	CleanupClosePushL(data);
       
   108 	
       
   109 	RArray<TInt> callsInConference;
       
   110 	CleanupClosePushL(callsInConference);
       
   111 	
       
   112 	// open new line for calls
       
   113 	RLine line;
       
   114 	OpenLineLC(line, KMmTsyVoice2LineName);
       
   115 	
       
   116 	// open 3d call
       
   117 	RMobileCall call3;
       
   118 	OpenNewCallLC(call3, line);
       
   119 	
       
   120 	//-------------------------------------------------------------------------
       
   121 	// TEST: send request when there is no conference
       
   122  	//-------------------------------------------------------------------------
       
   123 	
       
   124 	TRequestStatus reqStatus;
       
   125 	call3.GoOneToOne(reqStatus);
       
   126 	User::WaitForRequest(reqStatus);
       
   127 	ASSERT_EQUALS(KErrNotSupported, reqStatus.Int());
       
   128 	AssertMockLtsyStatusL();
       
   129 
       
   130 	//-------------------------------------------------------------------------
       
   131 	// TEST: send request when conference is not active
       
   132  	//-------------------------------------------------------------------------
       
   133 	
       
   134 	// open conference object
       
   135 	RMobileConferenceCall conferenceCall;
       
   136 	OpenConferenceLC(conferenceCall, iPhone);
       
   137 
       
   138 	// test
       
   139 	call3.GoOneToOne(reqStatus);
       
   140 	User::WaitForRequest(reqStatus);
       
   141 	ASSERT_EQUALS(KErrNotSupported, reqStatus.Int());
       
   142 	AssertMockLtsyStatusL();
       
   143 
       
   144 	//-------------------------------------------------------------------------
       
   145 	// TEST: send request for call that is not in conference (different call mode)
       
   146  	//-------------------------------------------------------------------------
       
   147 
       
   148 	RLine line2;
       
   149 	RCall call;
       
   150 	RCall call2;
       
   151 	_LIT(KPhoneNumber1, "1357924680");   	
       
   152 	_LIT(KPhoneNumber2, "1234567890");   	
       
   153 	CreateConferenceLC(iPhone, conferenceCall, line2, call, 1, KPhoneNumber1, call2, 2, KPhoneNumber2);
       
   154 	callsInConference.AppendL(1); // call1
       
   155 	callsInConference.AppendL(2); // call2
       
   156 	
       
   157 	// dial 3rd call (status idle)
       
   158 	_LIT(KPhoneNumber3, "1632960000");
       
   159 	DialL(call3, 3, RMobilePhone::EAuxVoiceService, KPhoneNumber3);
       
   160 
       
   161 	// test
       
   162 	call3.GoOneToOne(reqStatus);
       
   163 	User::WaitForRequest(reqStatus);
       
   164 	ASSERT_EQUALS(KErrNotSupported, reqStatus.Int());
       
   165 	AssertMockLtsyStatusL();
       
   166 
       
   167 	//-----------------------------------------------------------------------------------
       
   168 	// TEST: send request for call that is not in conference (call mode is EVoiceService)
       
   169 	//-----------------------------------------------------------------------------------
       
   170 	call3.Close();
       
   171 	ChangeCallStatusL(1, RMobileCall::EStatusHold);
       
   172 	ChangeCallStatusL(2, RMobileCall::EStatusHold);
       
   173 		
       
   174     TName callName3;
       
   175 	OpenNewCallLC(call3, line2, &callName3);
       
   176 	CleanupStack::Pop(&call3); // call3 has already been put into the cleanup stack.
       
   177 	DialL(call3, 3, RMobilePhone::EVoiceService, KPhoneNumber3);
       
   178 	ChangeCallStatusL(3, RMobileCall::EStatusConnecting);
       
   179 	ChangeCallStatusL(3, RMobileCall::EStatusConnected);
       
   180 
       
   181 	// test
       
   182 	call3.GoOneToOne(reqStatus);
       
   183 	User::WaitForRequest(reqStatus);
       
   184 	ASSERT_EQUALS(KErrNotSupported, reqStatus.Int());
       
   185 	AssertMockLtsyStatusL();
       
   186 	
       
   187 	// add call3 to conference
       
   188 	AddCallL(conferenceCall, 3, callName3, callsInConference);	
       
   189 	callsInConference.AppendL(3);  // call3	
       
   190 	
       
   191 	//-----------------------------------------------------------------------------------
       
   192 	// TEST: place call on hold after requesting go one-to-one
       
   193 	//-----------------------------------------------------------------------------------
       
   194 	// test
       
   195 	TMockLtsyCallData0 emptyCallData3(3, RMobilePhone::EVoiceService);
       
   196 	emptyCallData3.SerialiseL(data);
       
   197 	iMockLTSY.ExpectL(EMobileCallGoOneToOne, data);
       
   198 	call3.GoOneToOne(reqStatus);
       
   199 	ChangeCallStatusL(3, RMobileCall::EStatusHold);
       
   200 	User::WaitForRequest(reqStatus);
       
   201 	ASSERT_EQUALS(KErrNotReady, reqStatus.Int());
       
   202 	AssertMockLtsyStatusL();
       
   203 
       
   204 	//-------------------------------------------------------------------------
       
   205 	// TEST: send request for call that is not in conference (status hold)
       
   206  	//-------------------------------------------------------------------------
       
   207 	
       
   208 	// open 4th call
       
   209 	RMobileCall call4;
       
   210 	TName callName4;
       
   211 	OpenNewCallLC(call4, line2, &callName4);
       
   212 
       
   213 	// dial 4th call (status hold)
       
   214 	_LIT(KPhoneNumber4, "1472583690");
       
   215 	DialL(call4, 4, RMobilePhone::EVoiceService, KPhoneNumber4);
       
   216 	
       
   217 	// first put the conference call (call1, call2 and call3) on hold
       
   218 	ChangeCallStatusInOrderL(1, 3, RMobileCall::EStatusHold);
       
   219 	
       
   220     ChangeCallStatusL(4, RMobileCall::EStatusConnecting);
       
   221     ChangeCallStatusL(4, RMobileCall::EStatusConnected);    
       
   222 	
       
   223 	// test
       
   224 	call4.GoOneToOne(reqStatus);
       
   225 	User::WaitForRequest(reqStatus);
       
   226 	ASSERT_EQUALS(KErrNotSupported, reqStatus.Int());
       
   227 	AssertMockLtsyStatusL();
       
   228 
       
   229 	//-------------------------------------------------------------------------
       
   230 	// TEST A: failure to dispatch request to LTSY
       
   231  	//-------------------------------------------------------------------------
       
   232 	
       
   233 	// add call4 to conference
       
   234 	AddCallL(conferenceCall, 4, callName4, callsInConference);
       
   235 	callsInConference.AppendL(4); // call4
       
   236 	// add call5 to conference
       
   237 	RMobileCall call5;
       
   238 	_LIT(KPhoneNumber5, "9999999990");
       
   239 	MakeCallAndAddToConferenceLC(call5, line2, conferenceCall, 5, KPhoneNumber5, callsInConference); 
       
   240 	callsInConference.AppendL(5); // call5
       
   241 	// test
       
   242 	TMockLtsyCallData0 emptyCallData4(4, RMobilePhone::EVoiceService);
       
   243 	emptyCallData4.SerialiseL(data);
       
   244 	iMockLTSY.ExpectL(EMobileCallGoOneToOne, data, KErrNotSupported);
       
   245 	
       
   246 	call4.GoOneToOne(reqStatus);
       
   247 	User::WaitForRequest(reqStatus);
       
   248 	ASSERT_EQUALS(KErrNotSupported, reqStatus.Int());
       
   249 	AssertMockLtsyStatusL();
       
   250 
       
   251  	//-------------------------------------------------------------------------
       
   252 	// TEST C: Successful completion request of
       
   253 	// RMobileCall::GoOneToOne.
       
   254  	//-------------------------------------------------------------------------
       
   255 
       
   256 	iMockLTSY.ExpectL(EMobileCallGoOneToOne, data);
       
   257 	call4.GoOneToOne(reqStatus);
       
   258 	
       
   259 	ChangeCallStatusL(1, RMobileCall::EStatusHold);
       
   260 	ChangeCallStatusL(2, RMobileCall::EStatusHold);
       
   261 	ChangeCallStatusL(3, RMobileCall::EStatusHold);
       
   262 	ChangeCallStatusL(5, RMobileCall::EStatusHold);
       
   263 
       
   264 	User::WaitForRequest(reqStatus);
       
   265 	ASSERT_EQUALS(KErrNone, reqStatus.Int());
       
   266 	AssertMockLtsyStatusL();
       
   267 
       
   268 	//-------------------------------------------------------------------------
       
   269 	// TEST E: Unsolicited completion of RMobileCall::GoOneToOne
       
   270 	// from LTSY.
       
   271  	//-------------------------------------------------------------------------
       
   272 
       
   273 	TRequestStatus mockLtsyStatus;
       
   274 	iMockLTSY.NotifyTerminated(mockLtsyStatus);	
       
   275 	//send completion
       
   276 	iMockLTSY.CompleteL(EMobileCallGoOneToOne, KErrNone, data);
       
   277 	// wait for completion
       
   278 	User::WaitForRequest(mockLtsyStatus);
       
   279     ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
   280 	AssertMockLtsyStatusL();
       
   281 
       
   282 	//-------------------------------------------------------------------------
       
   283 	// TEST: increase coverage
       
   284  	//-------------------------------------------------------------------------
       
   285 
       
   286 	// make conference active (add 4th call to the hold conference)
       
   287 	AddCallL(conferenceCall, 4, callName4, callsInConference);
       
   288 
       
   289     // test
       
   290     data.Close();
       
   291 	emptyCallData4.SerialiseL(data);
       
   292 	iMockLTSY.ExpectL(EMobileCallGoOneToOne, data);
       
   293 	call4.GoOneToOne(reqStatus);
       
   294 	
       
   295     ChangeCallStatusL(5, RMobileCall::EStatusHold);
       
   296     ChangeCallStatusL(1, RMobileCall::EStatusHold);
       
   297     ChangeCallStatusL(3, RMobileCall::EStatusHold);
       
   298     ASSERT_EQUALS(KRequestPending, reqStatus.Int());
       
   299     ChangeCallStatusL(2, RMobileCall::EStatusHold);	
       
   300     
       
   301 	User::WaitForRequest(reqStatus);
       
   302 	ASSERT_EQUALS(KErrNone, reqStatus.Int());
       
   303 	AssertMockLtsyStatusL();
       
   304 	
       
   305 	//-------------------------------------------------------------------------
       
   306 	// TEST: increase coverage
       
   307  	//-------------------------------------------------------------------------
       
   308 
       
   309     // make conference active (add 4th call to the hold conference)
       
   310     AddCallL(conferenceCall, 4, callName4, callsInConference);
       
   311     
       
   312     // test
       
   313     data.Close();
       
   314     TMockLtsyCallData0 emptyCallData5(5, RMobilePhone::EVoiceService);
       
   315     emptyCallData5.SerialiseL(data);
       
   316     iMockLTSY.ExpectL(EMobileCallGoOneToOne, data);
       
   317     call5.GoOneToOne(reqStatus);
       
   318     
       
   319     // test
       
   320 	ChangeCallStatusL(5, RMobileCall::EStatusDisconnecting);
       
   321 	
       
   322     // GoOneToOne failed because call5 is disconnecting
       
   323 	iMockLTSY.NotifyTerminated(mockLtsyStatus);	
       
   324 	iMockLTSY.CompleteL(EMobileCallGoOneToOne, KErrGeneral, data);
       
   325 	User::WaitForRequest(mockLtsyStatus);
       
   326 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
   327 		
       
   328 	// call5 is in idle state
       
   329 	ChangeCallStatusL(5, RMobileCall::EStatusIdle);	
       
   330 
       
   331 	ChangeCallStatusL(3, RMobileCall::EStatusHold);
       
   332 	ChangeCallStatusL(1, RMobileCall::EStatusHold);
       
   333 	ChangeCallStatusL(2, RMobileCall::EStatusHold);
       
   334 	ChangeCallStatusL(4, RMobileCall::EStatusHold);
       
   335 
       
   336 	User::WaitForRequest(reqStatus);
       
   337 	ASSERT_EQUALS(KErrGeneral, reqStatus.Int());
       
   338 	AssertMockLtsyStatusL();
       
   339 
       
   340     // close call5 object
       
   341 	CleanupStack::PopAndDestroy(&call5);
       
   342 
       
   343 	
       
   344 	//-------------------------------------------------------------------------
       
   345 	// TEST B: failure on completion of pending request from LTSY->CTSY
       
   346  	//-------------------------------------------------------------------------
       
   347 
       
   348 	// swap conference to active
       
   349 	data.Close();
       
   350 	TMockLtsyCallData0 emptyCallData1(1, RMobilePhone::EVoiceService);
       
   351 	emptyCallData1.SerialiseL(data);
       
   352 	iMockLTSY.ExpectL(EMobileCallResume, data);
       
   353 	conferenceCall.Swap(reqStatus);
       
   354 
       
   355     ChangeCallStatusL(3, RMobileCall::EStatusConnected);
       
   356 	ChangeCallStatusL(1, RMobileCall::EStatusConnected);
       
   357 	ChangeCallStatusL(2, RMobileCall::EStatusConnected);
       
   358 	ChangeCallStatusL(4, RMobileCall::EStatusConnected);
       
   359 
       
   360 	User::WaitForRequest(reqStatus);
       
   361 	ASSERT_EQUALS(KErrNone, reqStatus.Int());
       
   362 	AssertMockLtsyStatusL();
       
   363 	
       
   364 	// test
       
   365 	data.Close();
       
   366 	emptyCallData4.SerialiseL(data);
       
   367 	iMockLTSY.ExpectL(EMobileCallGoOneToOne, data);
       
   368 	iMockLTSY.CompleteL(EMobileCallGoOneToOne, KErrGeneral, data);
       
   369 	
       
   370 	call4.GoOneToOne(reqStatus);
       
   371 	User::WaitForRequest(reqStatus);
       
   372 	ASSERT_EQUALS(KErrGeneral, reqStatus.Int());
       
   373 	AssertMockLtsyStatusL();
       
   374 	
       
   375 	ChangeCallStatusL(1, RMobileCall::EStatusHold);
       
   376 	ChangeCallStatusL(2, RMobileCall::EStatusHold);
       
   377 	ChangeCallStatusL(4, RMobileCall::EStatusHold);
       
   378 
       
   379 	RMobileCall::TMobileCallCapsV1 caps;
       
   380 	RMobileCall::TMobileCallCapsV1Pckg capsDes(caps);
       
   381 	TInt res = call4.GetMobileCallCaps(capsDes);
       
   382 	ASSERT_EQUALS(KErrNone, res);
       
   383 
       
   384     //GoOneToOne operation is not be supported for call4. This is because
       
   385     //call4 is already in connected state and other calls are in hold state.
       
   386     TUint32 oneToOneNotSupported = 0;
       
   387     ASSERT_EQUALS(oneToOneNotSupported, caps.iCallControlCaps & RMobileCall::KCapsOneToOne);
       
   388 	
       
   389 	AssertMockLtsyStatusL();
       
   390 	CleanupStack::PopAndDestroy(10, this); // call4, call2, call, line2, conferenceCall, call3, line, callsInConference, data, this
       
   391 
       
   392 	
       
   393 	}
       
   394 
       
   395 
       
   396 /**
       
   397 @SYMTestCaseID BA-CTSY-CONC-CGOTO-0002
       
   398 @SYMComponent  telephony_ctsy
       
   399 @SYMTestCaseDesc Test support in CTSY for cancelling of RMobileCall::GoOneToOne for voice calls
       
   400 @SYMTestPriority High
       
   401 @SYMTestActions Invokes cancelling of RMobileCall::GoOneToOne for voice calls
       
   402 @SYMTestExpectedResults Pass
       
   403 @SYMTestType CT
       
   404 */
       
   405 void CCTsyConferenceCallControlFU::TestGoOneToOne0002L()
       
   406 	{
       
   407 
       
   408 	OpenEtelServerL(EUseExtendedError);
       
   409 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
   410 	OpenPhoneL();
       
   411 
       
   412 	RBuf8 data;
       
   413 	CleanupClosePushL(data);
       
   414 
       
   415 	// open conference object
       
   416 	RMobileConferenceCall conferenceCall;
       
   417 	OpenConferenceLC(conferenceCall, iPhone);
       
   418 
       
   419 	RLine line;
       
   420 	RMobileCall call;
       
   421 	RCall call2;
       
   422 	_LIT(KPhoneNumber1, "1357924680");   	
       
   423 	_LIT(KPhoneNumber2, "1234567890");   	
       
   424 	CreateConferenceLC(iPhone, conferenceCall, line, call, 1, KPhoneNumber1, call2, 2, KPhoneNumber2);
       
   425 
       
   426 	// open 3rd call for coverage
       
   427 	RCall call3;
       
   428 	OpenNewCallLC(call3, line);
       
   429 	_LIT(KPhoneNumber3, "3333333330");   	
       
   430 	DialL(call3, 3, RMobilePhone::EVoiceService, KPhoneNumber3);
       
   431 	ChangeCallStatusL(3, RMobileCall::EStatusDialling);
       
   432 	
       
   433 	//-------------------------------------------------------------------------
       
   434 	// Test cancelling of RMobileCall::GoOneToOne
       
   435  	//-------------------------------------------------------------------------
       
   436  	
       
   437 	RMobilePhone::TMobileService mobileService = RMobilePhone::EVoiceService;
       
   438 	TMockLtsyCallData0 emptyCallData1(1, mobileService);
       
   439 	emptyCallData1.SerialiseL(data);
       
   440 	iMockLTSY.ExpectL(EMobileCallGoOneToOne, data);
       
   441 	
       
   442 	// post request
       
   443 	TRequestStatus reqStatus;
       
   444 	call.GoOneToOne(reqStatus);
       
   445 	
       
   446 	// cancel
       
   447 	call.CancelAsyncRequest(EMobileCallGoOneToOne);
       
   448 	
       
   449 	// invoke request completion from mockLtsy
       
   450 	ChangeCallStatusL(2, RMobileCall::EStatusHold);
       
   451 	
       
   452 	User::WaitForRequest(reqStatus);
       
   453 	// CTSY has no cancel for this ipc, so request completes with KErrNone
       
   454 	ASSERT_EQUALS(KErrNone, reqStatus.Int());
       
   455 
       
   456 	AssertMockLtsyStatusL();
       
   457 	CleanupStack::PopAndDestroy(7, this); // call3, call2, call, line, conferenceCall, data, this
       
   458 	
       
   459 	}
       
   460 
       
   461 
       
   462 /**
       
   463 @SYMTestCaseID BA-CTSY-CONC-CGOTO-0004
       
   464 @SYMComponent  telephony_ctsy
       
   465 @SYMTestCaseDesc Test support in CTSY for multiple client requests to RMobileCall::GoOneToOne for voice calls
       
   466 @SYMTestPriority High
       
   467 @SYMTestActions Invokes multiple client requests to RMobileCall::GoOneToOne for voice calls
       
   468 @SYMTestExpectedResults Pass
       
   469 @SYMTestType CT
       
   470 */
       
   471 void CCTsyConferenceCallControlFU::TestGoOneToOne0004L()
       
   472 	{
       
   473 
       
   474 	OpenEtelServerL(EUseExtendedError);
       
   475 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
   476 	OpenPhoneL();
       
   477 
       
   478 	RBuf8 data;
       
   479 	CleanupClosePushL(data);
       
   480 	
       
   481 	RArray<TInt> callsInConference;
       
   482 	CleanupClosePushL(callsInConference);
       
   483 		
       
   484 	RMobileConferenceCall conferenceCall;
       
   485 	OpenConferenceLC(conferenceCall, iPhone);
       
   486 
       
   487 	RLine line;
       
   488 	RMobileCall call;
       
   489 	RCall call2;
       
   490 	_LIT(KPhoneNumber1, "1357924680");   	
       
   491 	_LIT(KPhoneNumber2, "1234567890");   	
       
   492 	CreateConferenceLC(iPhone, conferenceCall, line, call, 1, KPhoneNumber1, call2, 2, KPhoneNumber2);
       
   493 	callsInConference.AppendL(1); // call1
       
   494 	callsInConference.AppendL(2); // call2
       
   495 	
       
   496 	// Open second client
       
   497 	RTelServer telServer2;
       
   498 	TInt ret = telServer2.Connect();
       
   499 	ASSERT_EQUALS(KErrNone, ret);
       
   500 	CleanupClosePushL(telServer2);
       
   501 
       
   502 	RMobilePhone phone2;
       
   503 	ret = phone2.Open(telServer2, KMmTsyPhoneName);
       
   504 	ASSERT_EQUALS(KErrNone, ret);
       
   505 	CleanupClosePushL(phone2);
       
   506 
       
   507 	RMobileConferenceCall conferenceCall2;
       
   508 	OpenConferenceLC(conferenceCall2, phone2);
       
   509 
       
   510 	// add 3rd call to conference from 2nd client
       
   511 	RLine line2;
       
   512 	TInt res = line2.Open(phone2, KMmTsyVoice1LineName);
       
   513 	ASSERT_EQUALS(KErrNone, res);
       
   514 	CleanupClosePushL(line);
       
   515 
       
   516 	RMobileCall call3;
       
   517 	_LIT(KPhoneNumber3, "1632960000");
       
   518 	MakeCallAndAddToConferenceLC(call3, line2, conferenceCall2, 3, KPhoneNumber3, callsInConference);
       
   519 	callsInConference.AppendL(3); // call3
       
   520 	//-------------------------------------------------------------------------
       
   521 	// Test A: Test multiple clients requesting RMobileCall::GoOneToOne
       
   522  	//-------------------------------------------------------------------------
       
   523 
       
   524 	// post 1st request
       
   525 	TMockLtsyCallData0 emptyCallData1(1, RMobilePhone::EVoiceService);
       
   526 	emptyCallData1.SerialiseL(data);
       
   527 	iMockLTSY.ExpectL(EMobileCallGoOneToOne, data);
       
   528 	TRequestStatus reqStatus;
       
   529 	call.GoOneToOne(reqStatus);
       
   530 	// check that EMobileCallGoOneToOne ipc request is passed to ltsy
       
   531 	AssertMockLtsyStatusL();
       
   532 
       
   533 	// post 2nd request
       
   534 	TRequestStatus reqStatus2;
       
   535 	call3.GoOneToOne(reqStatus2);
       
   536 	// check that request is not passed to ltsy
       
   537 	AssertMockLtsyStatusL();
       
   538 
       
   539 	// notify CTSY about changes in calls' statuses from mockLtsy
       
   540 	ChangeCallStatusL(2, RMobileCall::EStatusHold);
       
   541 	ChangeCallStatusL(3, RMobileCall::EStatusHold);
       
   542 
       
   543 	// check results
       
   544 	User::WaitForRequest(reqStatus);
       
   545 	ASSERT_EQUALS(KErrNone, reqStatus.Int());
       
   546 
       
   547 	User::WaitForRequest(reqStatus2);
       
   548 	ASSERT_EQUALS(KErrNotSupported, reqStatus2.Int());
       
   549 	AssertMockLtsyStatusL();
       
   550 
       
   551 	CleanupStack::PopAndDestroy(12, this); // call3, line2, conferenceCall2, phone2, telServer2, call2, call, line, conferenceCall, callsInConference, data, this
       
   552 
       
   553 	}
       
   554 
       
   555 
       
   556 /**
       
   557 @SYMTestCaseID BA-CTSY-CONC-CGOTO-0005
       
   558 @SYMComponent  telephony_ctsy
       
   559 @SYMTestCaseDesc Test support in CTSY for RMobileCall::GoOneToOne with timeout for voice calls
       
   560 @SYMTestPriority High
       
   561 @SYMTestActions Invokes RMobileCall::GoOneToOne and tests for timeout for voice calls
       
   562 @SYMTestExpectedResults Pass
       
   563 @SYMTestType CT
       
   564 */
       
   565 void CCTsyConferenceCallControlFU::TestGoOneToOne0005L()
       
   566 	{
       
   567 
       
   568 	OpenEtelServerL(EUseExtendedError);
       
   569 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
   570 	OpenPhoneL();
       
   571 
       
   572 	RBuf8 data;
       
   573 	CleanupClosePushL(data);
       
   574 
       
   575 	// open conference object
       
   576 	RMobileConferenceCall conferenceCall;
       
   577 	OpenConferenceLC(conferenceCall, iPhone);
       
   578 
       
   579 	RLine line;
       
   580 	RMobileCall call;
       
   581 	RCall call2;
       
   582 	_LIT(KPhoneNumber1, "1357924680");   	
       
   583 	_LIT(KPhoneNumber2, "1234567890");   	
       
   584 	CreateConferenceLC(iPhone, conferenceCall, line, call, 1, KPhoneNumber1, call2, 2, KPhoneNumber2);
       
   585 
       
   586 	//-------------------------------------------------------------------------
       
   587 	// Test A: Test timeout of RMobileCall::GoOneToOne
       
   588  	//-------------------------------------------------------------------------
       
   589 
       
   590 	RMobilePhone::TMobileService mobileService = RMobilePhone::EVoiceService;
       
   591 	TMockLtsyCallData0 emptyCallData1(1, mobileService);
       
   592 	emptyCallData1.SerialiseL(data);
       
   593 	iMockLTSY.ExpectL(EMobileCallGoOneToOne, data);
       
   594 	
       
   595 	TRequestStatus reqStatus;
       
   596 	call.GoOneToOne(reqStatus);
       
   597 	User::WaitForRequest(reqStatus);
       
   598 	ASSERT_EQUALS(KErrTimedOut, reqStatus.Int());
       
   599 
       
   600 	AssertMockLtsyStatusL();
       
   601 	CleanupStack::PopAndDestroy(6, this); // call2, call, line, conferenceCall, data, this
       
   602 
       
   603 	}
       
   604 
       
   605 
       
   606 /**
       
   607 @SYMTestCaseID BA-CTSY-CONC-CGOTO-0006
       
   608 @SYMComponent  telephony_ctsy
       
   609 @SYMTestCaseDesc Test support in CTSY for RMobileCall::GoOneToOne for data calls
       
   610 @SYMTestPriority High
       
   611 @SYMTestActions Invokes RMobileCall::GoOneToOne for data calls
       
   612 @SYMTestExpectedResults Pass
       
   613 @SYMTestType CT
       
   614 */
       
   615 void CCTsyConferenceCallControlFU::TestGoOneToOne0006L()
       
   616 	{
       
   617 
       
   618 	OpenEtelServerL(EUseExtendedError);
       
   619 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
   620 	OpenPhoneL();
       
   621 
       
   622 	// open new line for calls
       
   623 	RLine line;
       
   624 	TInt res = line.Open(iPhone, KMmTsyDataLineName);
       
   625 	ASSERT_EQUALS(KErrNone, res);
       
   626 	CleanupClosePushL(line);
       
   627 	
       
   628 	// open call
       
   629 	RMobileCall call;
       
   630 	res = call.OpenNewCall(line);
       
   631 	ASSERT_EQUALS(KErrNone, res);
       
   632 	CleanupClosePushL(call);
       
   633 
       
   634  	//-------------------------------------------------------------------------
       
   635 	// TEST C: Successful completion request of
       
   636 	// RMobileCall::GoOneToOne when result is not cached.
       
   637  	//-------------------------------------------------------------------------
       
   638 
       
   639 	TRequestStatus reqStatus;
       
   640 	call.GoOneToOne(reqStatus);
       
   641 	User::WaitForRequest(reqStatus);
       
   642 	ASSERT_EQUALS(KErrNotSupported, reqStatus.Int());
       
   643 	AssertMockLtsyStatusL();
       
   644 
       
   645 	CleanupStack::PopAndDestroy(3, this); // call, line, this
       
   646 	
       
   647 	}
       
   648 
       
   649 
       
   650 /**
       
   651 @SYMTestCaseID BA-CTSY-CONC-CGOTO-00011
       
   652 @SYMComponent  telephony_ctsy
       
   653 @SYMTestCaseDesc Test support in CTSY for RMobileCall::GoOneToOne for fax calls
       
   654 @SYMTestPriority High
       
   655 @SYMTestActions Invokes RMobileCall::GoOneToOne for fax calls
       
   656 @SYMTestExpectedResults Pass
       
   657 @SYMTestType CT
       
   658 */
       
   659 void CCTsyConferenceCallControlFU::TestGoOneToOne00011L()
       
   660 	{
       
   661 
       
   662 	OpenEtelServerL(EUseExtendedError);
       
   663 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
   664 	OpenPhoneL();
       
   665 
       
   666 	// open new line for calls
       
   667 	RLine line;
       
   668 	TInt res = line.Open(iPhone, KMmTsyFaxLineName);
       
   669 	ASSERT_EQUALS(KErrNone, res);
       
   670 	CleanupClosePushL(line);
       
   671 	
       
   672 	// open call
       
   673 	RMobileCall call;
       
   674 	res = call.OpenNewCall(line);
       
   675 	ASSERT_EQUALS(KErrNone, res);
       
   676 	CleanupClosePushL(call);
       
   677 
       
   678  	//-------------------------------------------------------------------------
       
   679 	// TEST C: Successful completion request of
       
   680 	// RMobileCall::GoOneToOne when result is not cached.
       
   681  	//-------------------------------------------------------------------------
       
   682 
       
   683 	TRequestStatus reqStatus;
       
   684 	call.GoOneToOne(reqStatus);
       
   685 	User::WaitForRequest(reqStatus);
       
   686 	ASSERT_EQUALS(KErrNotSupported, reqStatus.Int());
       
   687 
       
   688 	AssertMockLtsyStatusL();
       
   689 	CleanupStack::PopAndDestroy(3, this); // call, line, this
       
   690 	
       
   691 	}
       
   692 
       
   693 
       
   694 /**
       
   695 @SYMTestCaseID BA-CTSY-CONC-COEC-0001
       
   696 @SYMComponent  telephony_ctsy
       
   697 @SYMTestCaseDesc Test support in CTSY for RMobileConferenceCall::EnumerateCalls
       
   698 @SYMTestPriority High
       
   699 @SYMTestActions Invokes RMobileConferenceCall::EnumerateCalls
       
   700 @SYMTestExpectedResults Pass
       
   701 @SYMTestType CT
       
   702 */
       
   703 void CCTsyConferenceCallControlFU::TestEnumerateCalls0001L()
       
   704 	{
       
   705 
       
   706 	OpenEtelServerL(EUseExtendedError);
       
   707 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
   708 	OpenPhoneL();
       
   709 
       
   710 	RMobileConferenceCall conferenceCall;
       
   711 	OpenConferenceLC(conferenceCall, iPhone);
       
   712 	
       
   713 	RArray<TInt> callsInConference;
       
   714 	CleanupClosePushL(callsInConference);
       
   715  	
       
   716  	//-------------------------------------------------------------------------
       
   717 	// TEST C: Successful completion request of
       
   718 	// RMobileConferenceCall::EnumerateCalls when result is not cached.
       
   719  	//-------------------------------------------------------------------------
       
   720 
       
   721 	TInt count;
       
   722 	TInt res = conferenceCall.EnumerateCalls(count);
       
   723 	ASSERT_EQUALS(KErrNone, res);
       
   724 	ASSERT_EQUALS(0, count);
       
   725 	AssertMockLtsyStatusL();
       
   726 
       
   727 	// create conference
       
   728 	RLine line;
       
   729 	RCall call;
       
   730 	RCall call2;
       
   731 	_LIT(KPhoneNumber1, "1357924680");   	
       
   732 	_LIT(KPhoneNumber2, "1234567890");   	
       
   733 	CreateConferenceLC(iPhone, conferenceCall, line, call, 1, KPhoneNumber1, call2, 2, KPhoneNumber2);
       
   734 	callsInConference.AppendL(1); // call1
       
   735 	callsInConference.AppendL(2); // call2
       
   736 	
       
   737 	// calls enumeration request again
       
   738 	res = conferenceCall.EnumerateCalls(count);
       
   739 	ASSERT_EQUALS(KErrNone, res);
       
   740 	ASSERT_EQUALS(2, count);
       
   741 	AssertMockLtsyStatusL();
       
   742 
       
   743 	// add call to conference
       
   744 	RCall call3;
       
   745 	_LIT(KPhoneNumber3, "3333333330");
       
   746 	MakeCallAndAddToConferenceLC(call3, line, conferenceCall, 3, KPhoneNumber3, callsInConference);
       
   747 	callsInConference.AppendL(3); // call3
       
   748 	
       
   749 	// calls enumeration request again
       
   750 	res = conferenceCall.EnumerateCalls(count);
       
   751 	ASSERT_EQUALS(KErrNone, res);
       
   752 	ASSERT_EQUALS(3, count);
       
   753 	AssertMockLtsyStatusL();
       
   754 
       
   755 	CleanupStack::PopAndDestroy(7, this); // call3, call2, call, line, callsInConference, conferenceCall, this
       
   756 	
       
   757 	}
       
   758 
       
   759 
       
   760 /**
       
   761 @SYMTestCaseID BA-CTSY-CONC-COCC-0001
       
   762 @SYMComponent  telephony_ctsy
       
   763 @SYMTestCaseDesc Test support in CTSY for RMobileConferenceCall::CreateConference
       
   764 @SYMTestPriority High
       
   765 @SYMTestActions Invokes RMobileConferenceCall::CreateConference
       
   766 @SYMTestExpectedResults Pass
       
   767 @SYMTestType CT
       
   768 */
       
   769 void CCTsyConferenceCallControlFU::TestCreateConference0001L()
       
   770 	{
       
   771 
       
   772 	OpenEtelServerL(EUseExtendedError);
       
   773 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
   774 	OpenPhoneL();
       
   775 
       
   776 	RMobileConferenceCall conferenceCall;
       
   777 	OpenConferenceLC(conferenceCall, iPhone);
       
   778  	
       
   779  	//-------------------------------------------------------------------------
       
   780 	// TEST A: failure to dispatch request to LTSY
       
   781  	//-------------------------------------------------------------------------
       
   782 
       
   783 	iMockLTSY.ExpectL(EMobileConferenceCallCreateConference, KErrNotSupported);
       
   784 
       
   785 	TRequestStatus reqStatus;
       
   786 	conferenceCall.CreateConference(reqStatus);
       
   787 	User::WaitForRequest(reqStatus);
       
   788 	ASSERT_EQUALS(KErrNotSupported, reqStatus.Int());
       
   789 	AssertMockLtsyStatusL();
       
   790 
       
   791 	//-------------------------------------------------------------------------
       
   792 	// TEST B: failure on completion of pending request from LTSY->CTSY
       
   793  	//-------------------------------------------------------------------------
       
   794 
       
   795 	iMockLTSY.ExpectL(EMobileConferenceCallCreateConference);
       
   796 	iMockLTSY.CompleteL(EMobileConferenceCallCreateConference, KErrGeneral);
       
   797 
       
   798 	conferenceCall.CreateConference(reqStatus);
       
   799 	User::WaitForRequest(reqStatus);
       
   800 	ASSERT_EQUALS(KErrGeneral, reqStatus.Int());
       
   801 	AssertMockLtsyStatusL();
       
   802 
       
   803  	//-------------------------------------------------------------------------
       
   804 	// TEST C: Successful completion request of
       
   805 	// RMobileConferenceCall::CreateConference.
       
   806  	//-------------------------------------------------------------------------
       
   807 
       
   808 	RLine line;
       
   809 	RCall call;
       
   810 	RCall call2;
       
   811 	_LIT(KPhoneNumber1, "1357924680");
       
   812 	_LIT(KPhoneNumber2, "1234567890");
       
   813 	CreateConferenceLC(iPhone, conferenceCall, line, call, 1, KPhoneNumber1, call2, 2, KPhoneNumber2);
       
   814 
       
   815  	//-------------------------------------------------------------------------
       
   816 	// TEST E: Unsolicited completion of RMobileConferenceCall::CreateConference
       
   817 	// from LTSY.
       
   818  	//-------------------------------------------------------------------------
       
   819 
       
   820 	TRequestStatus mockLtsyStatus;
       
   821 	iMockLTSY.NotifyTerminated(mockLtsyStatus);	
       
   822 	//send completion
       
   823 	iMockLTSY.CompleteL(EMobileConferenceCallCreateConference, KErrNone);
       
   824 	// wait for completion
       
   825 	User::WaitForRequest(mockLtsyStatus);
       
   826     ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
   827 	AssertMockLtsyStatusL();
       
   828 
       
   829 	CleanupStack::PopAndDestroy(5, this); // call2, call, line, conferenceCall, this
       
   830 	
       
   831 	}
       
   832 
       
   833 
       
   834 /**
       
   835 @SYMTestCaseID BA-CTSY-CONC-COCC-0002
       
   836 @SYMComponent  telephony_ctsy
       
   837 @SYMTestCaseDesc Test support in CTSY for cancelling of RMobileConferenceCall::CreateConference
       
   838 @SYMTestPriority High
       
   839 @SYMTestActions Invokes cancelling of RMobileConferenceCall::CreateConference
       
   840 @SYMTestExpectedResults Pass
       
   841 @SYMTestType CT
       
   842 */
       
   843 void CCTsyConferenceCallControlFU::TestCreateConference0002L()
       
   844 	{
       
   845 
       
   846 	OpenEtelServerL(EUseExtendedError);
       
   847 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
   848 	OpenPhoneL();
       
   849 
       
   850 	TRequestStatus mockLtsyStatus;
       
   851 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
   852 
       
   853 	RMobileConferenceCall conferenceCall;
       
   854 	OpenConferenceLC(conferenceCall, iPhone);
       
   855 
       
   856  	//-------------------------------------------------------------------------
       
   857 	// Test cancelling of RMobileConferenceCall::CreateConference
       
   858  	//-------------------------------------------------------------------------
       
   859  	
       
   860 	iMockLTSY.ExpectL(EMobileConferenceCallCreateConference);
       
   861 	iMockLTSY.CompleteL(EMobileConferenceCallCreateConference, KErrNone, 2);
       
   862 
       
   863 	TRequestStatus reqStatus;
       
   864 	conferenceCall.CreateConference(reqStatus);
       
   865 
       
   866 	conferenceCall.CancelAsyncRequest(EMobileConferenceCallCreateConference);
       
   867 	
       
   868 	User::WaitForRequest(reqStatus);
       
   869 	// CTSY has no cancel for this ipc, so request completes with KErrNone
       
   870 	ASSERT_EQUALS(KErrNone, reqStatus.Int());
       
   871 
       
   872 	// Wait for completion of iMockLTSY.NotifyTerminated
       
   873 	User::WaitForRequest(mockLtsyStatus);
       
   874     ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
   875 	AssertMockLtsyStatusL();
       
   876 	CleanupStack::PopAndDestroy(2, this); // conferenceCall, this
       
   877 	
       
   878 	}
       
   879 
       
   880 
       
   881 /**
       
   882 @SYMTestCaseID BA-CTSY-CONC-COCC-0004
       
   883 @SYMComponent  telephony_ctsy
       
   884 @SYMTestCaseDesc Test support in CTSY for multiple client requests to RMobileConferenceCall::CreateConference
       
   885 @SYMTestPriority High
       
   886 @SYMTestActions Invokes multiple client requests to RMobileConferenceCall::CreateConference
       
   887 @SYMTestExpectedResults Pass
       
   888 @SYMTestType CT
       
   889 */
       
   890 void CCTsyConferenceCallControlFU::TestCreateConference0004L()
       
   891 	{
       
   892 
       
   893 	OpenEtelServerL(EUseExtendedError);
       
   894 	CleanupStack::PushL(TCleanupItem(Cleanup, this));
       
   895 	OpenPhoneL();
       
   896 
       
   897 	RMobileConferenceCall conferenceCall;
       
   898 	OpenConferenceLC(conferenceCall, iPhone);
       
   899 
       
   900 	// open new line for calls
       
   901 	RLine line;
       
   902 	OpenLineLC(line);
       
   903 
       
   904 	// open first call
       
   905 	RCall call;
       
   906 	OpenNewCallLC(call, line);
       
   907 
       
   908 	// dial first call (make them hold)
       
   909 	_LIT(KPhoneNumber1, "1357924680");
       
   910 	DialL(call, 1, RMobilePhone::EVoiceService, KPhoneNumber1);
       
   911 	ChangeCallStatusL(1, RMobileCall::EStatusHold);
       
   912 
       
   913 	// open second call
       
   914 	RCall call2;
       
   915 	OpenNewCallLC(call2, line);
       
   916 
       
   917 	// dial second call (make them connected)
       
   918 	_LIT(KPhoneNumber2, "1234567890");
       
   919 	DialL(call2, 2, RMobilePhone::EVoiceService, KPhoneNumber2);
       
   920 	ChangeCallStatusL(2, RMobileCall::EStatusConnected);
       
   921 
       
   922 	// --------------------Open second client------------------
       
   923 	RTelServer telServer2;
       
   924 	TInt ret = telServer2.Connect();
       
   925 	ASSERT_EQUALS(KErrNone, ret);
       
   926 	CleanupClosePushL(telServer2);
       
   927 
       
   928 	RMobilePhone phone2;
       
   929 	ret = phone2.Open(telServer2, KMmTsyPhoneName);
       
   930 	ASSERT_EQUALS(KErrNone, ret);
       
   931 	CleanupClosePushL(phone2);
       
   932 
       
   933 	RMobileConferenceCall conferenceCall2;
       
   934 	OpenConferenceLC(conferenceCall2, phone2);
       
   935 
       
   936 	//-------------------------------------------------------------------------
       
   937 	// Test A: Test multiple clients requesting RMobileConferenceCall::CreateConference
       
   938 	//-------------------------------------------------------------------------
       
   939 
       
   940 	// first request
       
   941 	iMockLTSY.ExpectL(EMobileConferenceCallCreateConference);
       
   942 	TRequestStatus reqStatus;
       
   943 	conferenceCall.CreateConference(reqStatus);
       
   944 	AssertMockLtsyStatusL();
       
   945 
       
   946 	// second request
       
   947 	TRequestStatus reqStatus2;
       
   948 	conferenceCall2.CreateConference(reqStatus2);
       
   949 	AssertMockLtsyStatusL();
       
   950 
       
   951 	// connect first call from mockLtsy
       
   952 	ChangeCallStatusL(1, RMobileCall::EStatusConnected);
       
   953 	// refresh second call status from mockLtsy
       
   954 	ChangeCallStatusL(2, RMobileCall::EStatusConnected);
       
   955 
       
   956 	// check results
       
   957 	User::WaitForRequest(reqStatus);
       
   958 	ASSERT_EQUALS(KErrNone, reqStatus.Int());
       
   959 
       
   960 	User::WaitForRequest(reqStatus2);
       
   961 	ASSERT_EQUALS(KErrNotReady, reqStatus2.Int());
       
   962 
       
   963 	AssertMockLtsyStatusL();
       
   964 	CleanupStack::PopAndDestroy(8, this); // conferenceCall2, phone2, telServer2, call2, call, line, conferenceCall, this
       
   965 
       
   966 	}
       
   967 
       
   968 
       
   969 /**
       
   970 @SYMTestCaseID BA-CTSY-CONC-COCC-0005
       
   971 @SYMComponent  telephony_ctsy
       
   972 @SYMTestCaseDesc Test support in CTSY for RMobileConferenceCall::CreateConference with timeout
       
   973 @SYMTestPriority High
       
   974 @SYMTestActions Invokes RMobileConferenceCall::CreateConference and tests for timeout
       
   975 @SYMTestExpectedResults Pass
       
   976 @SYMTestType CT
       
   977 */
       
   978 void CCTsyConferenceCallControlFU::TestCreateConference0005L()
       
   979 	{
       
   980 
       
   981 	OpenEtelServerL(EUseExtendedError);
       
   982 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
   983 	OpenPhoneL();
       
   984 
       
   985 	RMobileConferenceCall conferenceCall;
       
   986 	OpenConferenceLC(conferenceCall, iPhone);
       
   987 
       
   988 	//-------------------------------------------------------------------------
       
   989 	// Test A: Test timeout of RMobileConferenceCall::CreateConference
       
   990  	//-------------------------------------------------------------------------
       
   991 
       
   992 	iMockLTSY.ExpectL(EMobileConferenceCallCreateConference, KErrNone);
       
   993 
       
   994 	TRequestStatus reqStatus;
       
   995 	conferenceCall.CreateConference(reqStatus);
       
   996 	User::WaitForRequest(reqStatus);
       
   997 	ASSERT_EQUALS(KErrTimedOut, reqStatus.Int());
       
   998 	AssertMockLtsyStatusL();
       
   999 
       
  1000 	CleanupStack::PopAndDestroy(2, this); // conferenceCall, this
       
  1001 
       
  1002 	}
       
  1003 
       
  1004 
       
  1005 /**
       
  1006 @SYMTestCaseID BA-CTSY-CONC-COBDC-0001a
       
  1007 @SYMComponent  telephony_ctsy
       
  1008 @SYMTestCaseDesc Test support in CTSY for break down conference from LTSY for active conference
       
  1009 @SYMTestPriority High
       
  1010 @SYMTestActions Invokes break down conference from LTSY for active conference
       
  1011 @SYMTestExpectedResults Pass
       
  1012 @SYMTestType CT
       
  1013 */
       
  1014 void CCTsyConferenceCallControlFU::TestBreakDownConference0001aL()
       
  1015 	{
       
  1016 
       
  1017 	OpenEtelServerL(EUseExtendedError);
       
  1018 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  1019 	OpenPhoneL();
       
  1020 
       
  1021 	// open conference object
       
  1022 	RMobileConferenceCall conferenceCall;
       
  1023 	OpenConferenceLC(conferenceCall, iPhone);
       
  1024 	
       
  1025 	// open line for calls
       
  1026 	RLine line;
       
  1027 	OpenLineLC(line);
       
  1028 
       
  1029 	// open first call
       
  1030 	RCall call;
       
  1031 	TName callName;
       
  1032 	OpenNewCallLC(call, line, &callName);
       
  1033 	// dial first call (status connected)
       
  1034 	_LIT(KPhoneNumber1, "1357924680");
       
  1035 	DialL(call, 1, RMobilePhone::EVoiceService, KPhoneNumber1);
       
  1036 	ChangeCallStatusL(1, RMobileCall::EStatusConnected);
       
  1037 	
       
  1038 	// create conference
       
  1039 	iMockLTSY.ExpectL(EMobileConferenceCallCreateConference);
       
  1040 	TRequestStatus reqStatus;
       
  1041 	conferenceCall.CreateConference(reqStatus);
       
  1042 	
       
  1043 	// update first call status
       
  1044 	ChangeCallStatusL(1, RMobileCall::EStatusConnected);
       
  1045 
       
  1046 	// open and connect second call exactly here for increase coverage
       
  1047 	RCall call2;
       
  1048 	OpenNewCallLC(call2, line);
       
  1049 	_LIT(KPhoneNumber2, "1234567890");
       
  1050 	DialL(call2, 2, RMobilePhone::EVoiceService, KPhoneNumber2);
       
  1051 	ChangeCallStatusL(2, RMobileCall::EStatusConnected);
       
  1052 	
       
  1053 	// conference is created here
       
  1054 	User::WaitForRequest(reqStatus);
       
  1055 	ASSERT_EQUALS(KErrNone, reqStatus.Int());
       
  1056 	AssertMockLtsyStatusL();
       
  1057 
       
  1058 	//--------------------------------
       
  1059 	// TEST: Test support in CTSY for break down conference 
       
  1060 	// from LTSY for active conference
       
  1061 	//--------------------------------
       
  1062 	
       
  1063 	TRequestStatus statChangeStatus;
       
  1064 	RMobileConferenceCall::TMobileConferenceStatus status;
       
  1065 	conferenceCall.NotifyConferenceStatusChange(statChangeStatus, status);
       
  1066 
       
  1067 	TRequestStatus notifyEventStatus;
       
  1068 	RMobileConferenceCall::TMobileConferenceEvent event;
       
  1069 	TName notifyCallName;
       
  1070 	conferenceCall.NotifyConferenceEvent(notifyEventStatus, event, notifyCallName);
       
  1071 	
       
  1072 	ChangeCallStatusL(1, RMobileCall::EStatusIdle);
       
  1073 	
       
  1074 	// notify requests complete here (actual test)
       
  1075 	User::WaitForRequest(notifyEventStatus);
       
  1076 	ASSERT_EQUALS(KErrNone, notifyEventStatus.Int());
       
  1077 	ASSERT_EQUALS(callName, notifyCallName);
       
  1078 	ASSERT_EQUALS(RMobileConferenceCall::EConferenceCallRemoved, event);
       
  1079 
       
  1080 	User::WaitForRequest(statChangeStatus);
       
  1081 	ASSERT_EQUALS(KErrNone, statChangeStatus.Int());
       
  1082 	ASSERT_EQUALS(RMobileConferenceCall::EConferenceIdle, status);
       
  1083 	
       
  1084 	AssertMockLtsyStatusL();
       
  1085 	CleanupStack::PopAndDestroy(5, this); // call2, call, line, conferenceCall, this
       
  1086 
       
  1087 	}
       
  1088 
       
  1089 
       
  1090 /**
       
  1091 @SYMTestCaseID BA-CTSY-CONC-COBDC-0001b
       
  1092 @SYMComponent  telephony_ctsy
       
  1093 @SYMTestCaseDesc Test support in CTSY for break down conference from LTSY for hold conference
       
  1094 @SYMTestPriority High
       
  1095 @SYMTestActions Invokes break down conference from LTSY for hold conference
       
  1096 @SYMTestExpectedResults Pass
       
  1097 @SYMTestType CT
       
  1098 */
       
  1099 void CCTsyConferenceCallControlFU::TestBreakDownConference0001bL()
       
  1100 	{
       
  1101 
       
  1102 	OpenEtelServerL(EUseExtendedError);
       
  1103 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  1104 	OpenPhoneL();
       
  1105 
       
  1106 	RBuf8 data;
       
  1107 	CleanupClosePushL(data);
       
  1108 
       
  1109 	// open conference object
       
  1110 	RMobileConferenceCall conferenceCall;
       
  1111 	OpenConferenceLC(conferenceCall, iPhone);
       
  1112 	
       
  1113 	// open line for calls
       
  1114 	RLine line;
       
  1115 	OpenLineLC(line);
       
  1116 
       
  1117 	// open first call
       
  1118 	RCall call;
       
  1119 	TName callName;
       
  1120 	OpenNewCallLC(call, line, &callName);
       
  1121 
       
  1122 	// dial first call (status hold)
       
  1123 	_LIT(KPhoneNumber1, "1357924680");
       
  1124 	DialL(call, 1, RMobilePhone::EVoiceService, KPhoneNumber1);
       
  1125 	ChangeCallStatusL(1, RMobileCall::EStatusHold);
       
  1126 	
       
  1127 	// open call, dial (status connected) and make them idle for coverage
       
  1128 	// (conference caps changes back to zero)
       
  1129 	RCall someCall;
       
  1130 	OpenNewCallLC(someCall, line);
       
  1131 	_LIT(KSomePhoneNumber, "1632960000");
       
  1132 	DialL(someCall, 8, RMobilePhone::EVoiceService, KSomePhoneNumber);
       
  1133 	ChangeCallStatusL(8, RMobileCall::EStatusConnected);// here conf.caps become KCapsCreate
       
  1134 	ChangeCallStatusL(8, RMobileCall::EStatusIdle);// zero conf.caps
       
  1135 
       
  1136 	// open second call
       
  1137 	RCall call2;
       
  1138 	OpenNewCallLC(call2, line);
       
  1139 	// dial second call (status connected)
       
  1140 	_LIT(KPhoneNumber2, "1234567890");
       
  1141 	DialL(call2, 2, RMobilePhone::EVoiceService, KPhoneNumber2);
       
  1142 	ChangeCallStatusL(2, RMobileCall::EStatusConnected);
       
  1143 
       
  1144 	// create conference
       
  1145 	iMockLTSY.ExpectL(EMobileConferenceCallCreateConference);
       
  1146 	TRequestStatus reqStatus;
       
  1147 	conferenceCall.CreateConference(reqStatus);
       
  1148 	
       
  1149 	// connect first call
       
  1150 	ChangeCallStatusL(1, RMobileCall::EStatusConnected);
       
  1151 	// update second call status
       
  1152 	ChangeCallStatusL(2, RMobileCall::EStatusConnected);
       
  1153 
       
  1154 	// conference is created here
       
  1155 	User::WaitForRequest(reqStatus);
       
  1156 	ASSERT_EQUALS(KErrNone, reqStatus.Int());
       
  1157 	AssertMockLtsyStatusL();
       
  1158 
       
  1159 	// swap conference
       
  1160 	RMobilePhone::TMobileService mobileService = RMobilePhone::EVoiceService;
       
  1161 	TMockLtsyCallData0 emptyCallData1(1, mobileService);
       
  1162 	emptyCallData1.SerialiseL(data);
       
  1163 	iMockLTSY.ExpectL(EMobileCallHold, data);
       
  1164 	conferenceCall.Swap(reqStatus);
       
  1165 	// if swap request did not pass to Ltsy the following assert will fail the test
       
  1166 	AssertMockLtsyStatusL();
       
  1167 
       
  1168 	// set calls 1 and 2 on hold from MockLtsy
       
  1169 	ChangeCallStatusL(1, RMobileCall::EStatusHold);
       
  1170 	ChangeCallStatusL(2, RMobileCall::EStatusHold);
       
  1171 
       
  1172 	// CTSY completes swap request here
       
  1173 	User::WaitForRequest(reqStatus);
       
  1174 	ASSERT_EQUALS(KErrNone, reqStatus.Int());
       
  1175 
       
  1176 	//--------------------------------
       
  1177 	// TEST: Test support in CTSY for break down conference 
       
  1178 	// from LTSY for hold conference
       
  1179 	//--------------------------------
       
  1180 	
       
  1181 	TRequestStatus statChangeStatus;
       
  1182 	RMobileConferenceCall::TMobileConferenceStatus status;
       
  1183 	conferenceCall.NotifyConferenceStatusChange(statChangeStatus, status);
       
  1184 
       
  1185 	TRequestStatus notifyEventStatus;
       
  1186 	RMobileConferenceCall::TMobileConferenceEvent event;
       
  1187 	TName notifyCallName;
       
  1188 	conferenceCall.NotifyConferenceEvent(notifyEventStatus, event, notifyCallName);
       
  1189 	
       
  1190 	ChangeCallStatusL(1, RMobileCall::EStatusIdle);
       
  1191 	
       
  1192 	// notify requests complete here (actual test)
       
  1193 	User::WaitForRequest(notifyEventStatus);
       
  1194 	ASSERT_EQUALS(KErrNone, notifyEventStatus.Int());
       
  1195 	ASSERT_EQUALS(callName, notifyCallName);
       
  1196 	ASSERT_EQUALS(RMobileConferenceCall::EConferenceCallRemoved, event);
       
  1197 
       
  1198 	User::WaitForRequest(statChangeStatus);
       
  1199 	ASSERT_EQUALS(KErrNone, statChangeStatus.Int());
       
  1200 	ASSERT_EQUALS(RMobileConferenceCall::EConferenceIdle, status);
       
  1201 
       
  1202 	AssertMockLtsyStatusL();
       
  1203 	CleanupStack::PopAndDestroy(7, this); // call2, someCall, call, line, conferenceCall, data, this
       
  1204 
       
  1205 	}
       
  1206 
       
  1207 
       
  1208 /**
       
  1209 @SYMTestCaseID BA-CTSY-CONC-COBDC-0001c
       
  1210 @SYMComponent  telephony_ctsy
       
  1211 @SYMTestCaseDesc Test support in CTSY for break down conference from LTSY for active conference with hold call
       
  1212 @SYMTestPriority High
       
  1213 @SYMTestActions Invokes break down conference from LTSY for active conference with hold call
       
  1214 @SYMTestExpectedResults Pass
       
  1215 @SYMTestType CT
       
  1216 */
       
  1217 void CCTsyConferenceCallControlFU::TestBreakDownConference0001cL()
       
  1218 	{
       
  1219 
       
  1220 	OpenEtelServerL(EUseExtendedError);
       
  1221 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  1222 	OpenPhoneL();
       
  1223 
       
  1224 	// open conference object
       
  1225 	RMobileConferenceCall conferenceCall;
       
  1226 	OpenConferenceLC(conferenceCall, iPhone);
       
  1227 	
       
  1228 	// open line for calls
       
  1229 	RLine line;
       
  1230 	OpenLineLC(line);
       
  1231 
       
  1232 	// open first call
       
  1233 	RCall call;
       
  1234 	TName callName;
       
  1235 	OpenNewCallLC(call, line, &callName);
       
  1236 	// dial first call (status connected)
       
  1237 	_LIT(KPhoneNumber1, "1357924680");
       
  1238 	DialL(call, 1, RMobilePhone::EVoiceService, KPhoneNumber1);
       
  1239 	ChangeCallStatusL(1, RMobileCall::EStatusConnected);
       
  1240 	
       
  1241 	// create conference
       
  1242 	iMockLTSY.ExpectL(EMobileConferenceCallCreateConference);
       
  1243 	TRequestStatus reqStatus;
       
  1244 	conferenceCall.CreateConference(reqStatus);
       
  1245 	
       
  1246 	// update first call status
       
  1247 	ChangeCallStatusL(1, RMobileCall::EStatusConnected);
       
  1248 
       
  1249 	// open and connect second call exactly here for increase coverage
       
  1250 	RCall call2;
       
  1251 	OpenNewCallLC(call2, line);
       
  1252 	_LIT(KPhoneNumber2, "1234567890");
       
  1253 	DialL(call2, 2, RMobilePhone::EVoiceService, KPhoneNumber2);
       
  1254 	ChangeCallStatusL(2, RMobileCall::EStatusConnected);
       
  1255 	
       
  1256 	// conference is created here
       
  1257 	User::WaitForRequest(reqStatus);
       
  1258 	ASSERT_EQUALS(KErrNone, reqStatus.Int());
       
  1259 	AssertMockLtsyStatusL();
       
  1260 
       
  1261 	// create hold call for coverage
       
  1262 	RCall call3;
       
  1263 	OpenNewCallLC(call3, line);
       
  1264 	_LIT(KPhoneNumber3, "3333333330");
       
  1265 	DialL(call3, 3, RMobilePhone::EVoiceService, KPhoneNumber3);
       
  1266 	ChangeCallStatusL(3, RMobileCall::EStatusHold);
       
  1267 
       
  1268 	//--------------------------------
       
  1269 	// TEST: Test support in CTSY for break down conference 
       
  1270 	// from LTSY for active conference with hold call
       
  1271 	//--------------------------------
       
  1272 	
       
  1273 	TRequestStatus statChangeStatus;
       
  1274 	RMobileConferenceCall::TMobileConferenceStatus status;
       
  1275 	conferenceCall.NotifyConferenceStatusChange(statChangeStatus, status);
       
  1276 
       
  1277 	TRequestStatus notifyEventStatus;
       
  1278 	RMobileConferenceCall::TMobileConferenceEvent event;
       
  1279 	TName notifyCallName;
       
  1280 	conferenceCall.NotifyConferenceEvent(notifyEventStatus, event, notifyCallName);
       
  1281 	
       
  1282 	ChangeCallStatusL(1, RMobileCall::EStatusIdle);
       
  1283 	
       
  1284 	// notify request completes here (actual test)
       
  1285 	User::WaitForRequest(notifyEventStatus);
       
  1286 	ASSERT_EQUALS(KErrNone, notifyEventStatus.Int());
       
  1287 	ASSERT_EQUALS(callName, notifyCallName);
       
  1288 	ASSERT_EQUALS(RMobileConferenceCall::EConferenceCallRemoved, event);
       
  1289 
       
  1290 	User::WaitForRequest(statChangeStatus);
       
  1291 	ASSERT_EQUALS(KErrNone, statChangeStatus.Int());
       
  1292 	ASSERT_EQUALS(RMobileConferenceCall::EConferenceIdle, status);
       
  1293 
       
  1294 	AssertMockLtsyStatusL();
       
  1295 	CleanupStack::PopAndDestroy(6, this); // call3, call2, call, line, conferenceCall, this
       
  1296 
       
  1297 	}
       
  1298 
       
  1299 
       
  1300 /**
       
  1301 @SYMTestCaseID BA-CTSY-CONC-COGCO-0001
       
  1302 @SYMComponent  telephony_ctsy
       
  1303 @SYMTestCaseDesc Test support in CTSY for ghost operations from LTSY with conference
       
  1304 @SYMTestPriority High
       
  1305 @SYMTestActions Invokes ghost operations from LTSY with conference
       
  1306 @SYMTestExpectedResults Pass
       
  1307 @SYMTestType CT
       
  1308 */
       
  1309 void CCTsyConferenceCallControlFU::TestGhostConference0001L()
       
  1310 	{
       
  1311 
       
  1312 	OpenEtelServerL(EUseExtendedError);
       
  1313 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  1314 	OpenPhoneL();
       
  1315 
       
  1316 	RBuf8 data;
       
  1317 	CleanupClosePushL(data);
       
  1318 
       
  1319 	// open conference object
       
  1320 	RMobileConferenceCall conferenceCall;
       
  1321 	OpenConferenceLC(conferenceCall, iPhone);
       
  1322 	
       
  1323 	// open line for calls
       
  1324 	RLine line;
       
  1325 	OpenLineLC(line);
       
  1326 
       
  1327 	// open first call
       
  1328 	RMobileCall call;
       
  1329 	TName callName;
       
  1330 	OpenNewCallLC(call, line, &callName);
       
  1331 
       
  1332 	// dial first call (status hold)
       
  1333 	_LIT(KPhoneNumber1, "1357924680");
       
  1334 	DialL(call, 1, RMobilePhone::EVoiceService, KPhoneNumber1);
       
  1335 	ChangeCallStatusL(1, RMobileCall::EStatusHold);
       
  1336 	
       
  1337 	// open second call
       
  1338 	RCall call2;
       
  1339 	TName callName2;
       
  1340 	OpenNewCallLC(call2, line, &callName2);
       
  1341 
       
  1342 	// dial second call (status connected)
       
  1343 	_LIT(KPhoneNumber2, "1234567890");
       
  1344 	DialL(call2, 2, RMobilePhone::EVoiceService, KPhoneNumber2);
       
  1345 	ChangeCallStatusL(2, RMobileCall::EStatusConnected);
       
  1346 
       
  1347 	AssertMockLtsyStatusL();
       
  1348 
       
  1349 	// The following tests are to cover CMmConferenceCallGsmWcdmaExt::CompleteNotifyConferenceEvent()
       
  1350 	
       
  1351 	//--------------------------------
       
  1352 	// TEST: Test support in CTSY for ghost conference creation from LTSY
       
  1353 	// in case when conference is creating through Etel too (just for increase coverage)
       
  1354 	//--------------------------------
       
  1355 	
       
  1356 	// send request through Etel
       
  1357 	iMockLTSY.ExpectL(EMobileConferenceCallCreateConference);
       
  1358 	TRequestStatus reqStatus;
       
  1359 	conferenceCall.CreateConference(reqStatus);
       
  1360 
       
  1361 	// failing attempt to invoke starting of ghost conference creation
       
  1362 	// (covering code)
       
  1363 	TRequestStatus mockLtsyStatus;
       
  1364 	iMockLTSY.NotifyTerminated(mockLtsyStatus);	
       
  1365 	TInt completeConfEvent = RMobileConferenceCall::EConferenceBuilt;
       
  1366 	RMobilePhone::TMobileService mobileService = RMobilePhone::EVoiceService;
       
  1367 	TMockLtsyCallData1<TInt> completeGhostOperationData(1, mobileService, completeConfEvent);
       
  1368 	completeGhostOperationData.SerialiseL(data);
       
  1369 	iMockLTSY.CompleteL(EMobileConferenceCallNotifyConferenceEvent, KErrNone, data);
       
  1370 	User::WaitForRequest(mockLtsyStatus);
       
  1371     ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
  1372 	
       
  1373     // then fail no more necessary etel request
       
  1374 	iMockLTSY.NotifyTerminated(mockLtsyStatus);	
       
  1375 	iMockLTSY.CompleteL(EMobileConferenceCallCreateConference, KErrGeneral);
       
  1376 	User::WaitForRequest(mockLtsyStatus);
       
  1377     ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
  1378 
       
  1379 	User::WaitForRequest(reqStatus);
       
  1380 	ASSERT_EQUALS(KErrGeneral, reqStatus.Int());
       
  1381 	AssertMockLtsyStatusL();
       
  1382 	
       
  1383 	//--------------------------------
       
  1384 	// TEST: Test support in CTSY for ghost add call to conference operation from LTSY
       
  1385 	// over ghost add call to conference operation
       
  1386 	// when conference is idle
       
  1387 	//--------------------------------
       
  1388 
       
  1389 	// failing attempt to invoke starting of ghost add call to conference operation
       
  1390 	// (covering code)
       
  1391 	iMockLTSY.NotifyTerminated(mockLtsyStatus);	
       
  1392 	data.Close();
       
  1393 	completeConfEvent = RMobileConferenceCall::EConferenceCallAdded;
       
  1394 	completeGhostOperationData.SerialiseL(data);
       
  1395 	iMockLTSY.CompleteL(EMobileConferenceCallNotifyConferenceEvent, KErrNone, data);
       
  1396 	User::WaitForRequest(mockLtsyStatus);
       
  1397     ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
  1398 
       
  1399 	//--------------------------------
       
  1400 	// TEST: Test support in CTSY for ghost swap operation from LTSY
       
  1401 	// when conference is idle
       
  1402 	//--------------------------------
       
  1403 
       
  1404 	// failing attempt to invoke starting of ghost swap conference operation
       
  1405 	// (covering code)
       
  1406 	iMockLTSY.NotifyTerminated(mockLtsyStatus);	
       
  1407 	data.Close();
       
  1408 	completeConfEvent = RMobileConferenceCall::EConferenceSwapped;
       
  1409 	completeGhostOperationData.SerialiseL(data);
       
  1410 	iMockLTSY.CompleteL(EMobileConferenceCallNotifyConferenceEvent, KErrNone, data);
       
  1411 	User::WaitForRequest(mockLtsyStatus);
       
  1412     ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
  1413 
       
  1414 	//--------------------------------
       
  1415 	// TEST: Test support in CTSY for ghost conference creation from LTSY 
       
  1416 	//--------------------------------
       
  1417 	
       
  1418 	// post conference status change notify request
       
  1419 	TRequestStatus statusChangeStatus;
       
  1420 	RMobileConferenceCall::TMobileConferenceStatus mobileConfStatus;
       
  1421 	conferenceCall.NotifyConferenceStatusChange(statusChangeStatus, mobileConfStatus);
       
  1422 
       
  1423 	// post conference event notify request
       
  1424 	TRequestStatus confEventStatus;
       
  1425 	RMobileConferenceCall::TMobileConferenceEvent event;
       
  1426 	TName notifyCallName;
       
  1427 	conferenceCall.NotifyConferenceEvent(confEventStatus, event, notifyCallName);
       
  1428 	
       
  1429 	// invoke starting of ghost conference creation
       
  1430 	// (covering code)
       
  1431 	iMockLTSY.NotifyTerminated(mockLtsyStatus);	
       
  1432 	data.Close();
       
  1433 	completeConfEvent = RMobileConferenceCall::EConferenceBuilt;
       
  1434 	completeGhostOperationData.SerialiseL(data);
       
  1435 	iMockLTSY.CompleteL(EMobileConferenceCallNotifyConferenceEvent, KErrNone, data);
       
  1436 	User::WaitForRequest(mockLtsyStatus);
       
  1437     ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
  1438 
       
  1439 	// connect first call
       
  1440 	ChangeCallStatusL(1, RMobileCall::EStatusConnected);
       
  1441 
       
  1442 	// notify conference event completes here (intermediate test)
       
  1443 	User::WaitForRequest(confEventStatus);
       
  1444 	ASSERT_EQUALS(KErrNone, confEventStatus.Int());
       
  1445 	ASSERT_EQUALS(callName, notifyCallName);
       
  1446 	ASSERT_EQUALS(RMobileConferenceCall::EConferenceCallAdded, event);
       
  1447 	// repost conference event notify request
       
  1448 	conferenceCall.NotifyConferenceEvent(confEventStatus, event, notifyCallName);
       
  1449 
       
  1450 	// update second call status
       
  1451 	ChangeCallStatusL(2, RMobileCall::EStatusConnected);
       
  1452 
       
  1453 	// notify conference event completes here (intermediate test)
       
  1454 	User::WaitForRequest(confEventStatus);
       
  1455 	ASSERT_EQUALS(KErrNone, confEventStatus.Int());
       
  1456 	ASSERT_EQUALS(callName2, notifyCallName);
       
  1457 	ASSERT_EQUALS(RMobileConferenceCall::EConferenceCallAdded, event);
       
  1458 
       
  1459 	// here completes ghost conference creation
       
  1460 	// notify conference status change completes here (actual test)
       
  1461 	User::WaitForRequest(statusChangeStatus);
       
  1462 	ASSERT_EQUALS(KErrNone, statusChangeStatus.Int());
       
  1463 	ASSERT_EQUALS(RMobileConferenceCall::EConferenceActive, mobileConfStatus);
       
  1464 
       
  1465 	AssertMockLtsyStatusL();
       
  1466 
       
  1467 	//--------------------------------
       
  1468 	// TEST: Test support in CTSY for ghost add call to conference operation from LTSY
       
  1469 	// over ghost build conference operation
       
  1470 	// when call is adding through Etel (just for increase coverage)
       
  1471 	//--------------------------------
       
  1472 
       
  1473 	// open 3rd call
       
  1474 	RCall call3;
       
  1475 	TName callName3;
       
  1476 	OpenNewCallLC(call3, line, &callName3);
       
  1477 
       
  1478 	// dial 3rd call (status hold)
       
  1479 	_LIT(KPhoneNumber3, "3333333330");
       
  1480 	DialL(call3, 3, RMobilePhone::EVoiceService, KPhoneNumber3);
       
  1481 	// First put the conference call (call1 and call2) on hold
       
  1482 	ChangeCallStatusInOrderL(1, 2, RMobileCall::EStatusHold);
       
  1483 	// Then change the status of call3 in correct order so that right capabilities can be assigned
       
  1484 	ConnectAndPutCallOnHoldInRightOrderL(3);
       
  1485 	
       
  1486 	// send add call request through Etel
       
  1487 	TMockLtsyCallData0 emptyCallDataServiceUnspecified3(3, RMobilePhone::EServiceUnspecified);
       
  1488 	data.Close();
       
  1489 	emptyCallDataServiceUnspecified3.SerialiseL(data);
       
  1490 	iMockLTSY.ExpectL(EMobileConferenceCallAddCall, data);
       
  1491 	conferenceCall.AddCall(reqStatus, callName3);
       
  1492 
       
  1493 	// failing attempt to invoke starting of ghost add call operation
       
  1494 	// (covering code)
       
  1495 	iMockLTSY.NotifyTerminated(mockLtsyStatus);	
       
  1496 	data.Close();
       
  1497 	completeGhostOperationData.SerialiseL(data);
       
  1498 	iMockLTSY.CompleteL(EMobileConferenceCallNotifyConferenceEvent, KErrNone, data);
       
  1499 	User::WaitForRequest(mockLtsyStatus);
       
  1500     ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
  1501 	
       
  1502     // then fail no more necessary etel request
       
  1503 	iMockLTSY.NotifyTerminated(mockLtsyStatus);	
       
  1504 	iMockLTSY.CompleteL(EMobileConferenceCallAddCall, KErrGeneral);
       
  1505 	User::WaitForRequest(mockLtsyStatus);
       
  1506     ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
  1507 
       
  1508 	User::WaitForRequest(reqStatus);
       
  1509 	ASSERT_EQUALS(KErrGeneral, reqStatus.Int());
       
  1510 	AssertMockLtsyStatusL();
       
  1511 	
       
  1512 	//--------------------------------
       
  1513 	// TEST: Test support in CTSY for ghost add call to conference operation from LTSY
       
  1514 	// over ghost build conference operation
       
  1515 	//--------------------------------
       
  1516 	
       
  1517 	// post conference event notify request
       
  1518 	conferenceCall.NotifyConferenceEvent(confEventStatus, event, notifyCallName);
       
  1519 	
       
  1520 	// invoke starting of ghost add call to conference operation
       
  1521 	// (covering code)
       
  1522 	iMockLTSY.NotifyTerminated(mockLtsyStatus);	
       
  1523 	iMockLTSY.CompleteL(EMobileConferenceCallNotifyConferenceEvent, KErrNone, data);
       
  1524 	User::WaitForRequest(mockLtsyStatus);
       
  1525     ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
  1526 
       
  1527     // connect conference calls
       
  1528 	ChangeCallStatusInOrderL(1, 2, RMobileCall::EStatusConnected);
       
  1529 	// connect 3rd call
       
  1530 	ChangeCallStatusL(3, RMobileCall::EStatusConnected);
       
  1531 	
       
  1532 	// notify conference event completes here (actual test)
       
  1533 	User::WaitForRequest(confEventStatus);
       
  1534 	ASSERT_EQUALS(KErrNone, confEventStatus.Int());
       
  1535 	ASSERT_EQUALS(callName3, notifyCallName);
       
  1536 	ASSERT_EQUALS(RMobileConferenceCall::EConferenceCallAdded, event);
       
  1537 
       
  1538 	AssertMockLtsyStatusL();
       
  1539 
       
  1540 	//--------------------------------
       
  1541 	// TEST: Test support in CTSY for ghost add call to conference operation from LTSY
       
  1542 	// over ghost add call to conference operation
       
  1543 	// when call is adding through Etel (just for increase coverage)
       
  1544 	//--------------------------------
       
  1545 
       
  1546 	// open 4th call
       
  1547 	RCall call4;
       
  1548 	TName callName4;
       
  1549 	OpenNewCallLC(call4, line, &callName4);
       
  1550 
       
  1551 	// dial 4th call (status hold)
       
  1552 	_LIT(KPhoneNumber4, "4444444440");
       
  1553 	DialL(call4, 4, RMobilePhone::EVoiceService, KPhoneNumber4);
       
  1554 	// put the conference call (call1, call2 and call3) on hold
       
  1555 	ChangeCallStatusInOrderL(1, 3, RMobileCall::EStatusHold);
       
  1556 	ConnectAndPutCallOnHoldInRightOrderL(4);
       
  1557 
       
  1558 	// send add call request through Etel
       
  1559 	TMockLtsyCallData0 emptyCallDataServiceUnspecified4(4, RMobilePhone::EServiceUnspecified);
       
  1560 	data.Close();
       
  1561 	emptyCallDataServiceUnspecified4.SerialiseL(data);
       
  1562 	iMockLTSY.ExpectL(EMobileConferenceCallAddCall, data);
       
  1563 	conferenceCall.AddCall(reqStatus, callName4);
       
  1564 
       
  1565 	// failing attempt to invoke starting of ghost add call operation
       
  1566 	// (covering code)
       
  1567 	iMockLTSY.NotifyTerminated(mockLtsyStatus);	
       
  1568 	data.Close();
       
  1569 	completeConfEvent = RMobileConferenceCall::EConferenceCallAdded;
       
  1570 	completeGhostOperationData.SerialiseL(data);
       
  1571 	iMockLTSY.CompleteL(EMobileConferenceCallNotifyConferenceEvent, KErrNone, data);
       
  1572 	User::WaitForRequest(mockLtsyStatus);
       
  1573     ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
  1574 	
       
  1575     // then fail no more necessary etel request
       
  1576 	iMockLTSY.NotifyTerminated(mockLtsyStatus);	
       
  1577 	iMockLTSY.CompleteL(EMobileConferenceCallAddCall, KErrGeneral);
       
  1578 	User::WaitForRequest(mockLtsyStatus);
       
  1579     ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
  1580 
       
  1581 	User::WaitForRequest(reqStatus);
       
  1582 	ASSERT_EQUALS(KErrGeneral, reqStatus.Int());
       
  1583 	AssertMockLtsyStatusL();
       
  1584 	
       
  1585 	//--------------------------------
       
  1586 	// TEST: Test support in CTSY for ghost add call to conference operation from LTSY
       
  1587 	// over ghost add call to conference operation
       
  1588 	//--------------------------------
       
  1589 
       
  1590 	// post conference event notify request
       
  1591 	conferenceCall.NotifyConferenceEvent(confEventStatus, event, notifyCallName);
       
  1592 	
       
  1593 	// invoke starting of ghost add call to conference operation
       
  1594 	// (covering code)
       
  1595 	iMockLTSY.NotifyTerminated(mockLtsyStatus);	
       
  1596 	iMockLTSY.CompleteL(EMobileConferenceCallNotifyConferenceEvent, KErrNone, data);
       
  1597 	User::WaitForRequest(mockLtsyStatus);
       
  1598     ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
  1599     
       
  1600     // make the conference(call1, call2 and call3) call active
       
  1601     ChangeCallStatusInOrderL(1, 3, RMobileCall::EStatusConnected);
       
  1602 	// connect 4th call
       
  1603 	ChangeCallStatusL(4, RMobileCall::EStatusConnected);
       
  1604 	
       
  1605 	// notify conference event completes here (actual test)
       
  1606 	User::WaitForRequest(confEventStatus);
       
  1607 	ASSERT_EQUALS(KErrNone, confEventStatus.Int());
       
  1608 	ASSERT_EQUALS(callName4, notifyCallName);
       
  1609 	ASSERT_EQUALS(RMobileConferenceCall::EConferenceCallAdded, event);
       
  1610 
       
  1611 	AssertMockLtsyStatusL();
       
  1612 
       
  1613 	//--------------------------------
       
  1614 	// TEST: Test support in CTSY for ghost GoOneToOne operation from LTSY
       
  1615 	// when GoOneToOne is called through Etel (just for increase coverage)
       
  1616 	//--------------------------------
       
  1617 
       
  1618 	// call GoOneToOne through Etel
       
  1619 	TMockLtsyCallData0 emptyCallData1(1, mobileService);
       
  1620 	data.Close();
       
  1621 	emptyCallData1.SerialiseL(data);
       
  1622 	iMockLTSY.ExpectL(EMobileCallGoOneToOne, data);
       
  1623 	call.GoOneToOne(reqStatus);
       
  1624 
       
  1625 	// failing attempt to invoke starting of ghost go one to one operation
       
  1626 	// (covering code)
       
  1627 	iMockLTSY.NotifyTerminated(mockLtsyStatus);	
       
  1628 	data.Close();
       
  1629 	completeConfEvent = RMobileConferenceCall::EConferenceSplit;
       
  1630 	completeGhostOperationData.SerialiseL(data);
       
  1631 	iMockLTSY.CompleteL(EMobileConferenceCallNotifyConferenceEvent, KErrNone, data);
       
  1632 	User::WaitForRequest(mockLtsyStatus);
       
  1633     ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
  1634 
       
  1635     // then fail no more necessary etel request
       
  1636 	iMockLTSY.NotifyTerminated(mockLtsyStatus);	
       
  1637 	data.Close();
       
  1638 	emptyCallData1.SerialiseL(data);
       
  1639 	iMockLTSY.CompleteL(EMobileCallGoOneToOne, KErrGeneral, data);
       
  1640 	User::WaitForRequest(mockLtsyStatus);
       
  1641     ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
  1642 	
       
  1643 	User::WaitForRequest(reqStatus);
       
  1644 	ASSERT_EQUALS(KErrGeneral, reqStatus.Int());
       
  1645 	AssertMockLtsyStatusL();
       
  1646 	
       
  1647 	//--------------------------------
       
  1648 	// TEST: Test support in CTSY for ghost GoOneToOne operation from LTSY
       
  1649 	//--------------------------------
       
  1650 
       
  1651 	// post conference status change notify request
       
  1652 	do
       
  1653 		{
       
  1654 		conferenceCall.NotifyConferenceStatusChange(statusChangeStatus, mobileConfStatus);
       
  1655 		}
       
  1656 	while ( statusChangeStatus.Int() != KRequestPending );
       
  1657 
       
  1658 	// post conference event notify request
       
  1659 	conferenceCall.NotifyConferenceEvent(confEventStatus, event, notifyCallName);
       
  1660 
       
  1661 	// invoke starting of ghost go one to one operation
       
  1662 	// (covering code)
       
  1663 	iMockLTSY.NotifyTerminated(mockLtsyStatus);	
       
  1664 	data.Close();
       
  1665 	completeGhostOperationData.SerialiseL(data);
       
  1666 	iMockLTSY.CompleteL(EMobileConferenceCallNotifyConferenceEvent, KErrNone, data);
       
  1667 	User::WaitForRequest(mockLtsyStatus);
       
  1668     ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
  1669 	
       
  1670 	// make 1st call the only connected call
       
  1671 	ChangeCallStatusL(2, RMobileCall::EStatusHold);
       
  1672 	ChangeCallStatusL(3, RMobileCall::EStatusHold);
       
  1673 	ChangeCallStatusL(4, RMobileCall::EStatusHold);
       
  1674 	
       
  1675 	// notify conference event completes here (actual test)
       
  1676 	User::WaitForRequest(confEventStatus);
       
  1677 	ASSERT_EQUALS(KErrNone, confEventStatus.Int());
       
  1678 	ASSERT_EQUALS(callName, notifyCallName);
       
  1679 	ASSERT_EQUALS(RMobileConferenceCall::EConferenceCallRemoved, event);
       
  1680 	// notify conference status change completes here (actual test)
       
  1681 	User::WaitForRequest(statusChangeStatus);
       
  1682 	ASSERT_EQUALS(KErrNone, statusChangeStatus.Int());
       
  1683 	ASSERT_EQUALS(RMobileConferenceCall::EConferenceHold, mobileConfStatus);
       
  1684 
       
  1685 	// repost conference event notify request
       
  1686 	conferenceCall.NotifyConferenceEvent(confEventStatus, event, notifyCallName);
       
  1687 	// notify conference event completes here (actual test)
       
  1688 	User::WaitForRequest(confEventStatus);
       
  1689 	ASSERT_EQUALS(KErrNone, confEventStatus.Int());
       
  1690 	ASSERT_EQUALS(callName, notifyCallName);
       
  1691 	ASSERT_EQUALS(RMobileConferenceCall::EConferenceSplit, event);
       
  1692 
       
  1693 	AssertMockLtsyStatusL();
       
  1694 
       
  1695 	//--------------------------------
       
  1696 	// TEST: Test support in CTSY for ghost swap operation from LTSY
       
  1697 	// when swap is called through Etel (just for increase coverage)
       
  1698 	//--------------------------------
       
  1699 
       
  1700 	// call Swap through Etel
       
  1701 	iMockLTSY.ExpectL(EMobileConferenceCallSwap);
       
  1702 	conferenceCall.Swap(reqStatus);
       
  1703 	
       
  1704 	// failing attempt to invoke starting of ghost swap conference operation
       
  1705 	// (covering code)
       
  1706 	iMockLTSY.NotifyTerminated(mockLtsyStatus);	
       
  1707 	data.Close();
       
  1708 	completeConfEvent = RMobileConferenceCall::EConferenceSwapped;
       
  1709 	completeGhostOperationData.SerialiseL(data);
       
  1710 	iMockLTSY.CompleteL(EMobileConferenceCallNotifyConferenceEvent, KErrNone, data);
       
  1711 	User::WaitForRequest(mockLtsyStatus);
       
  1712     ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
  1713 	
       
  1714     // then fail no more necessary etel request
       
  1715 	iMockLTSY.NotifyTerminated(mockLtsyStatus);	
       
  1716 	iMockLTSY.CompleteL(EMobileConferenceCallSwap, KErrGeneral);
       
  1717 	User::WaitForRequest(mockLtsyStatus);
       
  1718     ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
  1719 	
       
  1720 	User::WaitForRequest(reqStatus);
       
  1721 	ASSERT_EQUALS(KErrGeneral, reqStatus.Int());
       
  1722 	AssertMockLtsyStatusL();
       
  1723 
       
  1724 	//--------------------------------
       
  1725 	// TEST: Test support in CTSY for ghost swap operation from LTSY
       
  1726 	// when conference is hold
       
  1727 	//--------------------------------
       
  1728 
       
  1729 	// post conference status change notify request
       
  1730 	conferenceCall.NotifyConferenceStatusChange(statusChangeStatus, mobileConfStatus);
       
  1731 
       
  1732 	// invoke starting of ghost swap conference operation
       
  1733 	// (covering code)
       
  1734 	iMockLTSY.NotifyTerminated(mockLtsyStatus);	
       
  1735 	iMockLTSY.CompleteL(EMobileConferenceCallNotifyConferenceEvent, KErrNone, data);
       
  1736 	User::WaitForRequest(mockLtsyStatus);
       
  1737     ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
  1738 	
       
  1739 	// make 1st call the only hold call
       
  1740 	ChangeCallStatusL(1, RMobileCall::EStatusHold);
       
  1741 	ChangeCallStatusL(2, RMobileCall::EStatusConnected);
       
  1742 	ChangeCallStatusL(3, RMobileCall::EStatusConnected);
       
  1743 	ChangeCallStatusL(4, RMobileCall::EStatusConnected);
       
  1744 	
       
  1745 	// notify conference status change completes here (actual test)
       
  1746 	User::WaitForRequest(statusChangeStatus);
       
  1747 	ASSERT_EQUALS(KErrNone, statusChangeStatus.Int());
       
  1748 	ASSERT_EQUALS(RMobileConferenceCall::EConferenceActive, mobileConfStatus);
       
  1749 
       
  1750 	AssertMockLtsyStatusL();
       
  1751 
       
  1752 	//--------------------------------
       
  1753 	// TEST: Test support in CTSY for ghost swap operation from LTSY
       
  1754 	// when conference is active
       
  1755 	//--------------------------------
       
  1756 
       
  1757 	// post conference status change notify request
       
  1758 	conferenceCall.NotifyConferenceStatusChange(statusChangeStatus, mobileConfStatus);
       
  1759 
       
  1760 	// invoke starting of ghost swap conference operation
       
  1761 	// (covering code)
       
  1762 	iMockLTSY.NotifyTerminated(mockLtsyStatus);	
       
  1763 	iMockLTSY.CompleteL(EMobileConferenceCallNotifyConferenceEvent, KErrNone, data);
       
  1764 	User::WaitForRequest(mockLtsyStatus);
       
  1765     ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
  1766 	
       
  1767 	// make 1st call the only connected call
       
  1768 	ChangeCallStatusL(1, RMobileCall::EStatusConnected);
       
  1769 	ChangeCallStatusL(2, RMobileCall::EStatusHold);
       
  1770 	ChangeCallStatusL(3, RMobileCall::EStatusHold);
       
  1771 	ChangeCallStatusL(4, RMobileCall::EStatusHold);
       
  1772 	
       
  1773 	// notify conference status change completes here (actual test)
       
  1774 	User::WaitForRequest(statusChangeStatus);
       
  1775 	ASSERT_EQUALS(KErrNone, statusChangeStatus.Int());
       
  1776 	ASSERT_EQUALS(RMobileConferenceCall::EConferenceHold, mobileConfStatus);
       
  1777 
       
  1778 	AssertMockLtsyStatusL();
       
  1779 	CleanupStack::PopAndDestroy(8, this); // call4, call3, call2, call, line, conferenceCall, data, this
       
  1780 
       
  1781 	}
       
  1782 
       
  1783 
       
  1784 /**
       
  1785 @SYMTestCaseID BA-CTSY-CONC-CONCC-0001
       
  1786 @SYMComponent  telephony_ctsy
       
  1787 @SYMTestCaseDesc Test support in CTSY for RMobileConferenceCall::NotifyCapsChange
       
  1788 @SYMTestPriority High
       
  1789 @SYMTestActions Invokes RMobileConferenceCall::NotifyCapsChange
       
  1790 @SYMTestExpectedResults Pass
       
  1791 @SYMTestType CT
       
  1792 */
       
  1793 void CCTsyConferenceCallControlFU::TestNotifyCapsChange0001L()
       
  1794 	{
       
  1795 
       
  1796 	OpenEtelServerL(EUseExtendedError);
       
  1797 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  1798 	OpenPhoneL();
       
  1799 
       
  1800 	RMobileConferenceCall conferenceCall;
       
  1801 	OpenConferenceLC(conferenceCall, iPhone);
       
  1802 	
       
  1803  	//-------------------------------------------------------------------------
       
  1804 	// TEST C: Successful completion request of
       
  1805 	// RMobileConferenceCall::NotifyCapsChange.
       
  1806  	//-------------------------------------------------------------------------
       
  1807 
       
  1808 	// post request
       
  1809 	TRequestStatus notifyStatus;
       
  1810 	TUint32 caps;
       
  1811 	conferenceCall.NotifyCapsChange(notifyStatus, caps);
       
  1812 
       
  1813 	// open new line for calls
       
  1814 	RLine line;
       
  1815 	OpenLineLC(line);
       
  1816 
       
  1817 	// open first call
       
  1818 	RCall call;
       
  1819 	OpenNewCallLC(call, line);
       
  1820 
       
  1821 	// dial first call (status hold)
       
  1822 	_LIT(KPhoneNumber1, "1357924680");
       
  1823 	DialL(call, 1, RMobilePhone::EVoiceService, KPhoneNumber1);
       
  1824 	ChangeCallStatusL(1, RMobileCall::EStatusHold);
       
  1825 
       
  1826 	// open second call
       
  1827 	RCall call2;
       
  1828 	OpenNewCallLC(call2, line);
       
  1829 
       
  1830 	// dial second call (status connected)
       
  1831 	_LIT(KPhoneNumber2, "1234567890");
       
  1832 	DialL(call2, 2, RMobilePhone::EVoiceService, KPhoneNumber2);
       
  1833 	ChangeCallStatusL(2, RMobileCall::EStatusConnected);
       
  1834 	
       
  1835 	// completion of notify request (actual test)
       
  1836 	User::WaitForRequest(notifyStatus);
       
  1837 	ASSERT_EQUALS(KErrNone, notifyStatus.Int());
       
  1838 	ASSERT_EQUALS(static_cast<TUint32>(RMobileConferenceCall::KCapsCreate), caps);
       
  1839 	AssertMockLtsyStatusL();
       
  1840 
       
  1841 	//-------------------------------------------------------------------------
       
  1842 	// TEST: Increase coverage (lets create conference)
       
  1843  	//-------------------------------------------------------------------------
       
  1844 
       
  1845 	// repost request
       
  1846 	conferenceCall.NotifyCapsChange(notifyStatus, caps);
       
  1847 
       
  1848 	// create conference
       
  1849 	iMockLTSY.ExpectL(EMobileConferenceCallCreateConference);
       
  1850 	TRequestStatus reqStatus;
       
  1851 	conferenceCall.CreateConference(reqStatus);
       
  1852 
       
  1853 	// make first call connected
       
  1854 	ChangeCallStatusL(1, RMobileCall::EStatusConnected);
       
  1855 	// update second call status (connected)
       
  1856 	ChangeCallStatusL(2, RMobileCall::EStatusConnected);
       
  1857 
       
  1858 	// conference is created
       
  1859 	User::WaitForRequest(reqStatus);
       
  1860 	ASSERT_EQUALS(KErrNone, reqStatus.Int());
       
  1861 	AssertMockLtsyStatusL();
       
  1862 	
       
  1863 	// completion of notify request (actual test)
       
  1864 	User::WaitForRequest(notifyStatus);
       
  1865 	ASSERT_EQUALS(KErrNone, notifyStatus.Int());
       
  1866 	ASSERT_EQUALS(static_cast<TUint32>(RMobileConferenceCall::KCapsHangUp |
       
  1867 	                                   RMobileConferenceCall::KCapsSwap), caps);
       
  1868 	
       
  1869 	//-------------------------------------------------------------------------
       
  1870 	// TEST: Increase coverage (lets hangup conference)
       
  1871  	//-------------------------------------------------------------------------
       
  1872 
       
  1873 	// repost request
       
  1874 	conferenceCall.NotifyCapsChange(notifyStatus, caps);
       
  1875 
       
  1876 	// hangup conference
       
  1877 	iMockLTSY.ExpectL(EMobileConferenceCallHangUp);
       
  1878 	conferenceCall.HangUp(reqStatus);
       
  1879 
       
  1880 	ChangeCallStatusL(1, RMobileCall::EStatusIdle);
       
  1881 	ChangeCallStatusL(2, RMobileCall::EStatusIdle);
       
  1882 
       
  1883 	User::WaitForRequest(reqStatus);
       
  1884 	ASSERT_EQUALS(KErrNone, reqStatus.Int());
       
  1885 	AssertMockLtsyStatusL();
       
  1886 
       
  1887 	// completion of notify request (actual test)
       
  1888 	User::WaitForRequest(notifyStatus);
       
  1889 	ASSERT_EQUALS(KErrNone, notifyStatus.Int());
       
  1890 	ASSERT_EQUALS(static_cast<TUint32>(0), caps);
       
  1891 	AssertMockLtsyStatusL();
       
  1892 
       
  1893 	CleanupStack::PopAndDestroy(5, this); // call2, call, line, conferenceCall, this
       
  1894 	
       
  1895 	}
       
  1896 
       
  1897 
       
  1898 /**
       
  1899 @SYMTestCaseID BA-CTSY-CONC-CONCC-0002
       
  1900 @SYMComponent  telephony_ctsy
       
  1901 @SYMTestCaseDesc Test support in CTSY for cancelling of RMobileConferenceCall::NotifyCapsChange
       
  1902 @SYMTestPriority High
       
  1903 @SYMTestActions Invokes cancelling of RMobileConferenceCall::NotifyCapsChange
       
  1904 @SYMTestExpectedResults Pass
       
  1905 @SYMTestType CT
       
  1906 */
       
  1907 void CCTsyConferenceCallControlFU::TestNotifyCapsChange0002L()
       
  1908 	{
       
  1909 
       
  1910 	OpenEtelServerL(EUseExtendedError);
       
  1911 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  1912 	OpenPhoneL();
       
  1913 
       
  1914 	RMobileConferenceCall conferenceCall;
       
  1915 	OpenConferenceLC(conferenceCall, iPhone);
       
  1916 	
       
  1917 	//-------------------------------------------------------------------------
       
  1918 	// Test cancelling of RMobileConferenceCall::NotifyCapsChange
       
  1919  	//-------------------------------------------------------------------------
       
  1920  	
       
  1921 	// post request
       
  1922 	TRequestStatus notifyStatus;
       
  1923 	TUint32 caps;
       
  1924 	conferenceCall.NotifyCapsChange(notifyStatus, caps);
       
  1925 
       
  1926 	// cancel
       
  1927 	conferenceCall.CancelAsyncRequest(EMobileConferenceCallNotifyCapsChange);
       
  1928 
       
  1929 	// completion of notify request 
       
  1930 	User::WaitForRequest(notifyStatus);
       
  1931 	ASSERT_EQUALS(KErrCancel, notifyStatus.Int());
       
  1932 
       
  1933 	AssertMockLtsyStatusL();
       
  1934 	CleanupStack::PopAndDestroy(2); // conferenceCall, this
       
  1935 	
       
  1936 	}
       
  1937 
       
  1938 
       
  1939 /**
       
  1940 @SYMTestCaseID BA-CTSY-CONC-CONCC-0004
       
  1941 @SYMComponent  telephony_ctsy
       
  1942 @SYMTestCaseDesc Test support in CTSY for multiple client requests to RMobileConferenceCall::NotifyCapsChange
       
  1943 @SYMTestPriority High
       
  1944 @SYMTestActions Invokes multiple client requests to RMobileConferenceCall::NotifyCapsChange
       
  1945 @SYMTestExpectedResults Pass
       
  1946 @SYMTestType CT
       
  1947 */
       
  1948 void CCTsyConferenceCallControlFU::TestNotifyCapsChange0004L()
       
  1949 	{
       
  1950 
       
  1951 	OpenEtelServerL(EUseExtendedError);
       
  1952 	CleanupStack::PushL(TCleanupItem(Cleanup, this));
       
  1953 	OpenPhoneL();
       
  1954 
       
  1955 	RMobileConferenceCall conferenceCall;
       
  1956 	OpenConferenceLC(conferenceCall, iPhone);
       
  1957 
       
  1958 	// Open second client
       
  1959 	RTelServer telServer2;
       
  1960 	TInt ret = telServer2.Connect();
       
  1961 	ASSERT_EQUALS(KErrNone, ret);
       
  1962 	CleanupClosePushL(telServer2);
       
  1963 
       
  1964 	RMobilePhone phone2;
       
  1965 	ret = phone2.Open(telServer2, KMmTsyPhoneName);
       
  1966 	ASSERT_EQUALS(KErrNone, ret);
       
  1967 	CleanupClosePushL(phone2);
       
  1968 
       
  1969 	RMobileConferenceCall conferenceCall2;
       
  1970 	OpenConferenceLC(conferenceCall2, phone2);
       
  1971 
       
  1972 	//-------------------------------------------------------------------------
       
  1973 	// Test A: Test multiple clients requesting RMobileConferenceCall::NotifyCapsChange
       
  1974  	//-------------------------------------------------------------------------
       
  1975 
       
  1976 	// post request
       
  1977 	TRequestStatus notifyStatus;
       
  1978 	TUint32 caps;
       
  1979 	conferenceCall.NotifyCapsChange(notifyStatus, caps);
       
  1980 
       
  1981 	TRequestStatus notifyStatus2;
       
  1982 	TUint32 caps2;
       
  1983 	conferenceCall2.NotifyCapsChange(notifyStatus2, caps2);
       
  1984 
       
  1985 	RLine line;
       
  1986 	RCall call;
       
  1987 	RCall call2;
       
  1988 	_LIT(KPhoneNumber1, "1357924680");   	
       
  1989 	_LIT(KPhoneNumber2, "1234567890");   	
       
  1990 	CreateConferenceLC(iPhone, conferenceCall, line, call, 1, KPhoneNumber1, call2, 2, KPhoneNumber2);
       
  1991 
       
  1992 	// completion of 1st notify request
       
  1993 	User::WaitForRequest(notifyStatus);
       
  1994 	// completion of 2nd notify request
       
  1995 	User::WaitForRequest(notifyStatus2);
       
  1996 
       
  1997 	// check results
       
  1998 	ASSERT_EQUALS(KErrNone, notifyStatus.Int());
       
  1999 	ASSERT_EQUALS(static_cast<TUint32>(RMobileConferenceCall::KCapsCreate), caps);
       
  2000 
       
  2001 	ASSERT_EQUALS(KErrNone, notifyStatus2.Int());
       
  2002 	ASSERT_EQUALS(static_cast<TUint32>(RMobileConferenceCall::KCapsCreate), caps2);
       
  2003 	AssertMockLtsyStatusL();
       
  2004 
       
  2005 	CleanupStack::PopAndDestroy(8, this); // call2, call, line, conferenceCall2, phone2, telServer2, conferenceCall, this
       
  2006 
       
  2007 	}
       
  2008 
       
  2009 
       
  2010 /**
       
  2011 @SYMTestCaseID BA-CTSY-CONC-COGCS-0001
       
  2012 @SYMComponent  telephony_ctsy
       
  2013 @SYMTestCaseDesc Test support in CTSY for RMobileConferenceCall::GetConferenceStatus
       
  2014 @SYMTestPriority High
       
  2015 @SYMTestActions Invokes RMobileConferenceCall::GetConferenceStatus
       
  2016 @SYMTestExpectedResults Pass
       
  2017 @SYMTestType CT
       
  2018 */
       
  2019 void CCTsyConferenceCallControlFU::TestGetConferenceStatus0001L()
       
  2020 	{
       
  2021 
       
  2022 	OpenEtelServerL(EUseExtendedError);
       
  2023 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  2024 	OpenPhoneL();
       
  2025 
       
  2026 	RBuf8 data;
       
  2027 	CleanupClosePushL(data);
       
  2028 
       
  2029 	RMobileConferenceCall conferenceCall;
       
  2030 	OpenConferenceLC(conferenceCall, iPhone);
       
  2031 	
       
  2032  	//-------------------------------------------------------------------------
       
  2033 	// TEST C: Successful completion request of
       
  2034 	// RMobileConferenceCall::GetConferenceStatus.
       
  2035  	//-------------------------------------------------------------------------
       
  2036 
       
  2037 	RMobileConferenceCall::TMobileConferenceStatus status;
       
  2038 	TInt res = conferenceCall.GetConferenceStatus(status);
       
  2039 	ASSERT_EQUALS(KErrNone, res);
       
  2040 	ASSERT_EQUALS(RMobileConferenceCall::EConferenceIdle, status);
       
  2041 	AssertMockLtsyStatusL();
       
  2042 
       
  2043  	//-------------------------------------------------------------------------
       
  2044 	// TEST: Successful completion request of
       
  2045 	// RMobileConferenceCall::GetConferenceStatus with other Caps value.
       
  2046  	//-------------------------------------------------------------------------
       
  2047 
       
  2048 	// invoke conference status change
       
  2049 	RLine line;
       
  2050 	RCall call;
       
  2051 	RCall call2;
       
  2052 	_LIT(KPhoneNumber1, "1357924680");   	
       
  2053 	_LIT(KPhoneNumber2, "1234567890");   	
       
  2054 	CreateConferenceLC(iPhone, conferenceCall, line, call, 1, KPhoneNumber1, call2, 2, KPhoneNumber2);
       
  2055 
       
  2056 	// test
       
  2057 	res = conferenceCall.GetConferenceStatus(status);
       
  2058 	ASSERT_EQUALS(KErrNone, res);
       
  2059 	ASSERT_EQUALS(RMobileConferenceCall::EConferenceActive, status);
       
  2060 	AssertMockLtsyStatusL();
       
  2061 
       
  2062 	// invoke conference status change (swap conference)
       
  2063 	TMockLtsyCallData0 emptyCallData(1, RMobilePhone::EVoiceService);
       
  2064 	emptyCallData.SerialiseL(data);
       
  2065 	iMockLTSY.ExpectL(EMobileCallHold, data);
       
  2066 	TRequestStatus reqStatus;
       
  2067 	conferenceCall.Swap(reqStatus);
       
  2068 	ChangeCallStatusL(1, RMobileCall::EStatusHold);
       
  2069 	ChangeCallStatusL(2, RMobileCall::EStatusHold);
       
  2070 	User::WaitForRequest(reqStatus);
       
  2071 	ASSERT_EQUALS(KErrNone, reqStatus.Int());
       
  2072 	AssertMockLtsyStatusL();
       
  2073 
       
  2074 	// test again
       
  2075 	res = conferenceCall.GetConferenceStatus(status);
       
  2076 	ASSERT_EQUALS(KErrNone, res);
       
  2077 	ASSERT_EQUALS(RMobileConferenceCall::EConferenceHold, status);
       
  2078 	AssertMockLtsyStatusL();
       
  2079 
       
  2080 	CleanupStack::PopAndDestroy(6, this); // call2, call, line, conferenceCall, data, this
       
  2081 	
       
  2082 	}
       
  2083 
       
  2084 
       
  2085 /**
       
  2086 @SYMTestCaseID BA-CTSY-CONC-CONCE-0001
       
  2087 @SYMComponent  telephony_ctsy
       
  2088 @SYMTestCaseDesc Test support in CTSY for RMobileConferenceCall::NotifyConferenceEvent
       
  2089 @SYMTestPriority High
       
  2090 @SYMTestActions Invokes RMobileConferenceCall::NotifyConferenceEvent
       
  2091 @SYMTestExpectedResults Pass
       
  2092 @SYMTestType CT
       
  2093 */
       
  2094 void CCTsyConferenceCallControlFU::TestNotifyConferenceEvent0001L()
       
  2095 	{
       
  2096 
       
  2097 	OpenEtelServerL(EUseExtendedError);
       
  2098 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  2099 	OpenPhoneL();
       
  2100 
       
  2101 	RMobileConferenceCall conferenceCall;
       
  2102 	OpenConferenceLC(conferenceCall, iPhone);
       
  2103 
       
  2104 	//-------------------------------------------------------------------------
       
  2105 	// TEST C: Successful completion request of
       
  2106 	// RMobileConferenceCall::NotifyConferenceEvent.
       
  2107  	//-------------------------------------------------------------------------
       
  2108 
       
  2109 	// post request
       
  2110 	TRequestStatus notifyStatus;
       
  2111 	RMobileConferenceCall::TMobileConferenceEvent event;
       
  2112 	TName notifyCallName;
       
  2113 	conferenceCall.NotifyConferenceEvent(notifyStatus, event, notifyCallName);
       
  2114 
       
  2115 	// open new line for calls
       
  2116 	RLine line;
       
  2117 	OpenLineLC(line);
       
  2118 
       
  2119 	// open first call
       
  2120 	RCall call;
       
  2121 	TName callName;
       
  2122 	OpenNewCallLC(call, line, &callName);
       
  2123 
       
  2124 	// dial first call (status hold)
       
  2125 	_LIT(KPhoneNumber1, "1357924680");
       
  2126 	DialL(call, 1, RMobilePhone::EVoiceService, KPhoneNumber1);
       
  2127 	ChangeCallStatusL(1, RMobileCall::EStatusHold);
       
  2128 
       
  2129 	// open second call
       
  2130 	RCall call2;
       
  2131 	TName callName2;
       
  2132 	OpenNewCallLC(call2, line, &callName2);
       
  2133 
       
  2134 	// dial second call (status connected)
       
  2135 	_LIT(KPhoneNumber2, "1234567890");
       
  2136 	DialL(call2, 2, RMobilePhone::EVoiceService, KPhoneNumber2);
       
  2137 	ChangeCallStatusL(2, RMobileCall::EStatusConnected);
       
  2138 
       
  2139 	// create conference
       
  2140 	iMockLTSY.ExpectL(EMobileConferenceCallCreateConference);
       
  2141 	TRequestStatus reqStatus;
       
  2142 	conferenceCall.CreateConference(reqStatus);
       
  2143 
       
  2144 	// make first call connected
       
  2145 	ChangeCallStatusL(1, RMobileCall::EStatusConnected);
       
  2146 
       
  2147 	// notify request completes here (actual test)
       
  2148 	User::WaitForRequest(notifyStatus);
       
  2149 	ASSERT_EQUALS(KErrNone, notifyStatus.Int());
       
  2150 	ASSERT_EQUALS(callName, notifyCallName);
       
  2151 	ASSERT_EQUALS(RMobileConferenceCall::EConferenceCallAdded, event);
       
  2152 
       
  2153 	//-------------------------------------------------------------------------
       
  2154 	// TEST: Increase coverage (conference creation continues)
       
  2155  	//-------------------------------------------------------------------------
       
  2156 	
       
  2157 	// repost tested request
       
  2158 	conferenceCall.NotifyConferenceEvent(notifyStatus, event, notifyCallName);
       
  2159 
       
  2160 	// update second call status (connected)
       
  2161 	ChangeCallStatusL(2, RMobileCall::EStatusConnected);
       
  2162 
       
  2163 	// notify request completes here (actual test)
       
  2164 	User::WaitForRequest(notifyStatus);
       
  2165 	ASSERT_EQUALS(KErrNone, notifyStatus.Int());
       
  2166 	ASSERT_EQUALS(callName2, notifyCallName);
       
  2167 	ASSERT_EQUALS(RMobileConferenceCall::EConferenceCallAdded, event);
       
  2168 
       
  2169 	//-------------------------------------------------------------------------
       
  2170 	// TEST: Increase coverage (conference creation continues)
       
  2171  	//-------------------------------------------------------------------------
       
  2172 
       
  2173 	// repost tested request
       
  2174 	conferenceCall.NotifyConferenceEvent(notifyStatus, event, notifyCallName);
       
  2175 
       
  2176 	// conference creation request completes here
       
  2177 	User::WaitForRequest(reqStatus);
       
  2178 	ASSERT_EQUALS(KErrNone, reqStatus.Int());
       
  2179 	AssertMockLtsyStatusL();
       
  2180 
       
  2181 	// notify request completes here (actual test)
       
  2182 	User::WaitForRequest(notifyStatus);
       
  2183 	ASSERT_EQUALS(KErrNone, notifyStatus.Int());
       
  2184 	TName callsInConference;
       
  2185 	callsInConference.Zero ();
       
  2186 	callsInConference.Append (callName2);
       
  2187 	callsInConference.Append (KDelimiter);
       
  2188 	callsInConference.Append (callName);
       
  2189 	ASSERT_EQUALS(callsInConference, notifyCallName);
       
  2190 	ASSERT_EQUALS(RMobileConferenceCall::EConferenceBuilt, event);
       
  2191 
       
  2192 	//-------------------------------------------------------------------------
       
  2193 	// TEST: Increase coverage (lets hangup conference)
       
  2194  	//-------------------------------------------------------------------------
       
  2195 
       
  2196 	// repost tested request
       
  2197 	conferenceCall.NotifyConferenceEvent(notifyStatus, event, notifyCallName);
       
  2198 
       
  2199 	// hangup conference
       
  2200 	iMockLTSY.ExpectL(EMobileConferenceCallHangUp);
       
  2201 	conferenceCall.HangUp(reqStatus);
       
  2202 
       
  2203 	// make 1st call idle
       
  2204 	ChangeCallStatusL(1, RMobileCall::EStatusIdle);
       
  2205 
       
  2206 	// notify request completes here (actual test)
       
  2207 	User::WaitForRequest(notifyStatus);
       
  2208 	ASSERT_EQUALS(KErrNone, notifyStatus.Int());
       
  2209 	ASSERT_EQUALS(callName, notifyCallName);
       
  2210 	ASSERT_EQUALS(RMobileConferenceCall::EConferenceCallRemoved, event);
       
  2211 
       
  2212 	//-------------------------------------------------------------------------
       
  2213 	// TEST: Increase coverage (conference hangup continues)
       
  2214  	//-------------------------------------------------------------------------
       
  2215 
       
  2216 	// repost tested request
       
  2217 	conferenceCall.NotifyConferenceEvent(notifyStatus, event, notifyCallName);
       
  2218 
       
  2219 	// make 2nd call idle
       
  2220 	ChangeCallStatusL(2, RMobileCall::EStatusIdle);
       
  2221 
       
  2222 	// notify request completes here (actual test)
       
  2223 	User::WaitForRequest(notifyStatus);
       
  2224 	ASSERT_EQUALS(KErrNone, notifyStatus.Int());
       
  2225 	ASSERT_EQUALS(callName2, notifyCallName);
       
  2226 	ASSERT_EQUALS(RMobileConferenceCall::EConferenceCallRemoved, event);
       
  2227 
       
  2228 	// here completes hangup request
       
  2229 	User::WaitForRequest(reqStatus);
       
  2230 	ASSERT_EQUALS(KErrNone, reqStatus.Int());
       
  2231 
       
  2232 	AssertMockLtsyStatusL();
       
  2233 	CleanupStack::PopAndDestroy(5, this); // call2, call, line, conferenceCall, this
       
  2234 	
       
  2235 	}
       
  2236 
       
  2237 
       
  2238 /**
       
  2239 @SYMTestCaseID BA-CTSY-CONC-CONCE-0002
       
  2240 @SYMComponent  telephony_ctsy
       
  2241 @SYMTestCaseDesc Test support in CTSY for cancelling of RMobileConferenceCall::NotifyConferenceEvent
       
  2242 @SYMTestPriority High
       
  2243 @SYMTestActions Invokes cancelling of RMobileConferenceCall::NotifyConferenceEvent
       
  2244 @SYMTestExpectedResults Pass
       
  2245 @SYMTestType CT
       
  2246 */
       
  2247 void CCTsyConferenceCallControlFU::TestNotifyConferenceEvent0002L()
       
  2248 	{
       
  2249 
       
  2250 	OpenEtelServerL(EUseExtendedError);
       
  2251 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  2252 	OpenPhoneL();
       
  2253 
       
  2254 	RMobileConferenceCall conferenceCall;
       
  2255 	OpenConferenceLC(conferenceCall, iPhone);
       
  2256 
       
  2257  	//-------------------------------------------------------------------------
       
  2258 	// Test cancelling of RMobileConferenceCall::NotifyConferenceEvent
       
  2259  	//-------------------------------------------------------------------------
       
  2260  	
       
  2261 	TRequestStatus reqStatus;
       
  2262 	RMobileConferenceCall::TMobileConferenceEvent event;
       
  2263 	TName callName;
       
  2264 	conferenceCall.NotifyConferenceEvent(reqStatus, event, callName);
       
  2265 
       
  2266 	conferenceCall.CancelAsyncRequest(EMobileConferenceCallNotifyConferenceEvent);
       
  2267 
       
  2268 	User::WaitForRequest(reqStatus);
       
  2269 	ASSERT_EQUALS(KErrCancel, reqStatus.Int());
       
  2270 	AssertMockLtsyStatusL();
       
  2271 
       
  2272 	CleanupStack::PopAndDestroy(2); // conferenceCall, this
       
  2273 	
       
  2274 	}
       
  2275 
       
  2276 
       
  2277 /**
       
  2278 @SYMTestCaseID BA-CTSY-CONC-CONCE-0004
       
  2279 @SYMComponent  telephony_ctsy
       
  2280 @SYMTestCaseDesc Test support in CTSY for multiple client requests to RMobileConferenceCall::NotifyConferenceEvent
       
  2281 @SYMTestPriority High
       
  2282 @SYMTestActions Invokes multiple client requests to RMobileConferenceCall::NotifyConferenceEvent
       
  2283 @SYMTestExpectedResults Pass
       
  2284 @SYMTestType CT
       
  2285 */
       
  2286 void CCTsyConferenceCallControlFU::TestNotifyConferenceEvent0004L()
       
  2287 	{
       
  2288 
       
  2289 	OpenEtelServerL(EUseExtendedError);
       
  2290 	CleanupStack::PushL(TCleanupItem(Cleanup, this));
       
  2291 	OpenPhoneL();
       
  2292 
       
  2293 	RMobileConferenceCall conferenceCall;
       
  2294 	OpenConferenceLC(conferenceCall, iPhone);
       
  2295 
       
  2296 	// Open second client
       
  2297 	RTelServer telServer2;
       
  2298 	TInt ret = telServer2.Connect();
       
  2299 	ASSERT_EQUALS(KErrNone, ret);
       
  2300 	CleanupClosePushL(telServer2);
       
  2301 
       
  2302 	RMobilePhone phone2;
       
  2303 	ret = phone2.Open(telServer2, KMmTsyPhoneName);
       
  2304 	ASSERT_EQUALS(KErrNone, ret);
       
  2305 	CleanupClosePushL(phone2);
       
  2306 
       
  2307 	RMobileConferenceCall conferenceCall2;
       
  2308 	OpenConferenceLC(conferenceCall2, phone2);
       
  2309 
       
  2310 	//-------------------------------------------------------------------------
       
  2311 	// Test A: Test multiple clients requesting RMobileConferenceCall::NotifyConferenceEvent
       
  2312  	//-------------------------------------------------------------------------
       
  2313 
       
  2314 	// post request
       
  2315 	TRequestStatus notifyStatus;
       
  2316 	RMobileConferenceCall::TMobileConferenceEvent event;
       
  2317 	TName notifyCallName;
       
  2318 	conferenceCall.NotifyConferenceEvent(notifyStatus, event, notifyCallName);
       
  2319 
       
  2320 	TRequestStatus notifyStatus2;
       
  2321 	RMobileConferenceCall::TMobileConferenceEvent event2;
       
  2322 	TName notifyCallName2;
       
  2323 	conferenceCall2.NotifyConferenceEvent(notifyStatus2, event2, notifyCallName2);
       
  2324 
       
  2325 	// open new line for calls
       
  2326 	RLine line;
       
  2327 	OpenLineLC(line);
       
  2328 
       
  2329 	// open first call
       
  2330 	RCall call;
       
  2331 	TName callName;
       
  2332 	OpenNewCallLC(call, line, &callName);
       
  2333 
       
  2334 	// dial first call (status hold)
       
  2335 	_LIT(KPhoneNumber1, "1357924680");
       
  2336 	DialL(call, 1, RMobilePhone::EVoiceService, KPhoneNumber1);
       
  2337 	ChangeCallStatusL(1, RMobileCall::EStatusHold);
       
  2338 
       
  2339 	// open second call
       
  2340 	RCall call2;
       
  2341 	TName callName2;
       
  2342 	OpenNewCallLC(call2, line, &callName2);
       
  2343 
       
  2344 	// dial second call (status connected)
       
  2345 	_LIT(KPhoneNumber2, "1234567890");
       
  2346 	DialL(call2, 2, RMobilePhone::EVoiceService, KPhoneNumber2);
       
  2347 	ChangeCallStatusL(2, RMobileCall::EStatusConnected);
       
  2348 
       
  2349 	// create conference
       
  2350 	iMockLTSY.ExpectL(EMobileConferenceCallCreateConference);
       
  2351 	TRequestStatus reqStatus;
       
  2352 	conferenceCall.CreateConference(reqStatus);
       
  2353 
       
  2354 	// make first call connected
       
  2355 	ChangeCallStatusL(1, RMobileCall::EStatusConnected);
       
  2356 
       
  2357 	// notify request completes here (actual test)
       
  2358 	User::WaitForRequest(notifyStatus);
       
  2359 	ASSERT_EQUALS(KErrNone, notifyStatus.Int());
       
  2360 	ASSERT_EQUALS(callName, notifyCallName);
       
  2361 	ASSERT_EQUALS(RMobileConferenceCall::EConferenceCallAdded, event);
       
  2362 
       
  2363 	User::WaitForRequest(notifyStatus2);
       
  2364 	ASSERT_EQUALS(KErrNone, notifyStatus2.Int());
       
  2365 	ASSERT_EQUALS(callName, notifyCallName2);
       
  2366 	ASSERT_EQUALS(RMobileConferenceCall::EConferenceCallAdded, event2);
       
  2367 	AssertMockLtsyStatusL();
       
  2368 
       
  2369 	//-------------------------------------------------------------------------
       
  2370 	// TEST: Increase coverage (conference creation continues)
       
  2371  	//-------------------------------------------------------------------------
       
  2372 
       
  2373 	// repost tested request
       
  2374 	conferenceCall.NotifyConferenceEvent(notifyStatus, event, notifyCallName);
       
  2375 	conferenceCall2.NotifyConferenceEvent(notifyStatus2, event2, notifyCallName2);
       
  2376 
       
  2377 	// update second call status (connected)
       
  2378 	ChangeCallStatusL(2, RMobileCall::EStatusConnected);
       
  2379 
       
  2380 	// notify request completes here (actual test)
       
  2381 	User::WaitForRequest(notifyStatus);
       
  2382 	ASSERT_EQUALS(KErrNone, notifyStatus.Int());
       
  2383 	ASSERT_EQUALS(callName2, notifyCallName);
       
  2384 	ASSERT_EQUALS(RMobileConferenceCall::EConferenceCallAdded, event);
       
  2385 
       
  2386 	User::WaitForRequest(notifyStatus2);
       
  2387 	ASSERT_EQUALS(KErrNone, notifyStatus2.Int());
       
  2388 	ASSERT_EQUALS(callName2, notifyCallName2);
       
  2389 	ASSERT_EQUALS(RMobileConferenceCall::EConferenceCallAdded, event2);
       
  2390 	AssertMockLtsyStatusL();
       
  2391 
       
  2392 	// conference creation request completes here
       
  2393 	User::WaitForRequest(reqStatus);
       
  2394 	ASSERT_EQUALS(KErrNone, reqStatus.Int());
       
  2395 	AssertMockLtsyStatusL();
       
  2396 
       
  2397 	CleanupStack::PopAndDestroy(8, this); // call2, call, line, conferenceCall2, phone2, telServer2, conferenceCall, this
       
  2398 
       
  2399 	}
       
  2400 
       
  2401 
       
  2402 /**
       
  2403 @SYMTestCaseID BA-CTSY-CONC-CONCSC-0001
       
  2404 @SYMComponent  telephony_ctsy
       
  2405 @SYMTestCaseDesc Test support in CTSY for RMobileConferenceCall::NotifyConferenceStatusChange
       
  2406 @SYMTestPriority High
       
  2407 @SYMTestActions Invokes RMobileConferenceCall::NotifyConferenceStatusChange
       
  2408 @SYMTestExpectedResults Pass
       
  2409 @SYMTestType CT
       
  2410 */
       
  2411 void CCTsyConferenceCallControlFU::TestNotifyConferenceStatusChange0001L()
       
  2412 	{
       
  2413 
       
  2414 	OpenEtelServerL(EUseExtendedError);
       
  2415 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  2416 	OpenPhoneL();
       
  2417 
       
  2418 	RMobileConferenceCall conferenceCall;
       
  2419 	OpenConferenceLC(conferenceCall, iPhone);
       
  2420 	
       
  2421  	//-------------------------------------------------------------------------
       
  2422 	// TEST C: Successful completion request of
       
  2423 	// RMobileConferenceCall::NotifyConferenceStatusChange.
       
  2424  	//-------------------------------------------------------------------------
       
  2425 
       
  2426 	// post request
       
  2427 	TRequestStatus notifyStatus;
       
  2428 	RMobileConferenceCall::TMobileConferenceStatus status;
       
  2429 	conferenceCall.NotifyConferenceStatusChange(notifyStatus, status);
       
  2430 
       
  2431 	// invoke conference status change
       
  2432 	RLine line;
       
  2433 	RCall call;
       
  2434 	RCall call2;
       
  2435 	_LIT(KPhoneNumber1, "1357924680");   	
       
  2436 	_LIT(KPhoneNumber2, "1234567890");   	
       
  2437 	CreateConferenceLC(iPhone, conferenceCall, line, call, 1, KPhoneNumber1, call2, 2, KPhoneNumber2);
       
  2438 
       
  2439 	// completion of notify request
       
  2440 	User::WaitForRequest(notifyStatus);
       
  2441 	ASSERT_EQUALS(KErrNone, notifyStatus.Int());
       
  2442 	ASSERT_EQUALS(RMobileConferenceCall::EConferenceActive, status);
       
  2443 	AssertMockLtsyStatusL();
       
  2444 
       
  2445  	//-------------------------------------------------------------------------
       
  2446 	// TEST: Successful completion request of
       
  2447 	// RMobileConferenceCall::NotifyConferenceStatusChange with other Caps value.
       
  2448  	//-------------------------------------------------------------------------
       
  2449 
       
  2450 	// post request
       
  2451 	conferenceCall.NotifyConferenceStatusChange(notifyStatus, status);
       
  2452 
       
  2453 	// hangup conference
       
  2454 	iMockLTSY.ExpectL(EMobileConferenceCallHangUp);
       
  2455 	TRequestStatus reqStatus;
       
  2456 	conferenceCall.HangUp(reqStatus);
       
  2457 	ChangeCallStatusL(1, RMobileCall::EStatusIdle);
       
  2458 	ChangeCallStatusL(2, RMobileCall::EStatusIdle);
       
  2459 	User::WaitForRequest(reqStatus);
       
  2460 	ASSERT_EQUALS(KErrNone, reqStatus.Int());
       
  2461 
       
  2462 	// completion of notify request (actual test)
       
  2463 	User::WaitForRequest(notifyStatus);
       
  2464 	ASSERT_EQUALS(KErrNone, notifyStatus.Int());
       
  2465 	ASSERT_EQUALS(RMobileConferenceCall::EConferenceIdle, status);
       
  2466 	AssertMockLtsyStatusL();
       
  2467 	
       
  2468 	CleanupStack::PopAndDestroy(5, this); // call2, call, line, conferenceCall, this
       
  2469 	
       
  2470 	}
       
  2471 
       
  2472 
       
  2473 /**
       
  2474 @SYMTestCaseID BA-CTSY-CONC-CONCSC-0002
       
  2475 @SYMComponent  telephony_ctsy
       
  2476 @SYMTestCaseDesc Test support in CTSY for cancelling of RMobileConferenceCall::NotifyConferenceStatusChange
       
  2477 @SYMTestPriority High
       
  2478 @SYMTestActions Invokes cancelling of RMobileConferenceCall::NotifyConferenceStatusChange
       
  2479 @SYMTestExpectedResults Pass
       
  2480 @SYMTestType CT
       
  2481 */
       
  2482 void CCTsyConferenceCallControlFU::TestNotifyConferenceStatusChange0002L()
       
  2483 	{
       
  2484 
       
  2485 	OpenEtelServerL(EUseExtendedError);
       
  2486 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  2487 	OpenPhoneL();
       
  2488 
       
  2489 	RMobileConferenceCall conferenceCall;
       
  2490 	OpenConferenceLC(conferenceCall, iPhone);
       
  2491 	
       
  2492  	//-------------------------------------------------------------------------
       
  2493 	// Test cancelling of RMobileConferenceCall::NotifyConferenceStatusChange
       
  2494  	//-------------------------------------------------------------------------
       
  2495  	
       
  2496 	TRequestStatus notifyStatus;
       
  2497 	RMobileConferenceCall::TMobileConferenceStatus status;
       
  2498 	conferenceCall.NotifyConferenceStatusChange(notifyStatus, status);
       
  2499 
       
  2500 	conferenceCall.CancelAsyncRequest(EMobileConferenceCallNotifyConferenceStatusChange);
       
  2501 
       
  2502 	User::WaitForRequest(notifyStatus);
       
  2503 	ASSERT_EQUALS(KErrCancel, notifyStatus.Int());
       
  2504 	AssertMockLtsyStatusL();
       
  2505 
       
  2506 	CleanupStack::PopAndDestroy(2); // conferenceCall, this
       
  2507 	
       
  2508 	}
       
  2509 
       
  2510 
       
  2511 /**
       
  2512 @SYMTestCaseID BA-CTSY-CONC-CONCSC-0004
       
  2513 @SYMComponent  telephony_ctsy
       
  2514 @SYMTestCaseDesc Test support in CTSY for multiple client requests to RMobileConferenceCall::NotifyConferenceStatusChange
       
  2515 @SYMTestPriority High
       
  2516 @SYMTestActions Invokes multiple client requests to RMobileConferenceCall::NotifyConferenceStatusChange
       
  2517 @SYMTestExpectedResults Pass
       
  2518 @SYMTestType CT
       
  2519 */
       
  2520 void CCTsyConferenceCallControlFU::TestNotifyConferenceStatusChange0004L()
       
  2521 	{
       
  2522 
       
  2523 	OpenEtelServerL(EUseExtendedError);
       
  2524 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  2525 	OpenPhoneL();
       
  2526 
       
  2527 	RMobileConferenceCall conferenceCall;
       
  2528 	OpenConferenceLC(conferenceCall, iPhone);
       
  2529 
       
  2530 	// Open second client
       
  2531 	RTelServer telServer2;
       
  2532 	TInt ret = telServer2.Connect();
       
  2533 	ASSERT_EQUALS(KErrNone, ret);
       
  2534 	CleanupClosePushL(telServer2);
       
  2535 
       
  2536 	RMobilePhone phone2;
       
  2537 	ret = phone2.Open(iTelServer,KMmTsyPhoneName);
       
  2538 	ASSERT_EQUALS(KErrNone, ret);
       
  2539 	CleanupClosePushL(phone2);
       
  2540 
       
  2541 	RMobileConferenceCall conferenceCall2;
       
  2542 	OpenConferenceLC(conferenceCall2, phone2);
       
  2543 	
       
  2544 	//-------------------------------------------------------------------------
       
  2545 	// Test A: Test multiple clients requesting RMobileConferenceCall::NotifyConferenceStatusChange
       
  2546  	//-------------------------------------------------------------------------
       
  2547 
       
  2548 	// post request
       
  2549 	TRequestStatus notifyStatus;
       
  2550 	RMobileConferenceCall::TMobileConferenceStatus status;
       
  2551 	conferenceCall.NotifyConferenceStatusChange(notifyStatus, status);
       
  2552 
       
  2553 	// post request
       
  2554 	TRequestStatus notifyStatus2;
       
  2555 	RMobileConferenceCall::TMobileConferenceStatus status2;
       
  2556 	conferenceCall2.NotifyConferenceStatusChange(notifyStatus2, status2);
       
  2557 
       
  2558 	// invoke conference status change
       
  2559 	RLine line;
       
  2560 	RCall call;
       
  2561 	RCall call2;
       
  2562 	_LIT(KPhoneNumber1, "1357924680");   	
       
  2563 	_LIT(KPhoneNumber2, "1234567890");   	
       
  2564 	CreateConferenceLC(iPhone, conferenceCall, line, call, 1, KPhoneNumber1, call2, 2, KPhoneNumber2);
       
  2565 
       
  2566 	// completion of notify request
       
  2567 	User::WaitForRequest(notifyStatus);
       
  2568 	ASSERT_EQUALS(KErrNone, notifyStatus.Int());
       
  2569 	ASSERT_EQUALS(RMobileConferenceCall::EConferenceActive, status);
       
  2570 
       
  2571 	User::WaitForRequest(notifyStatus2);
       
  2572 	ASSERT_EQUALS(KErrNone, notifyStatus2.Int());
       
  2573 	ASSERT_EQUALS(RMobileConferenceCall::EConferenceActive, status2);
       
  2574 	
       
  2575 	AssertMockLtsyStatusL();
       
  2576 
       
  2577 	CleanupStack::PopAndDestroy(8, this); // call2, call, line, conferenceCall2, phone2, telServer2, conferenceCall, this
       
  2578 
       
  2579 	}
       
  2580 
       
  2581 
       
  2582 /**
       
  2583 @SYMTestCaseID BA-CTSY-CONC-COS-0001
       
  2584 @SYMComponent  telephony_ctsy
       
  2585 @SYMTestCaseDesc Test support in CTSY for RMobileConferenceCall::Swap
       
  2586 @SYMTestPriority High
       
  2587 @SYMTestActions Invokes RMobileConferenceCall::Swap
       
  2588 @SYMTestExpectedResults Pass
       
  2589 @SYMTestType CT
       
  2590 */
       
  2591 void CCTsyConferenceCallControlFU::TestSwap0001L()
       
  2592 	{
       
  2593 
       
  2594 	OpenEtelServerL(EUseExtendedError);
       
  2595 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  2596 	OpenPhoneL();
       
  2597 
       
  2598 	RBuf8 data;
       
  2599 	CleanupClosePushL(data);
       
  2600 
       
  2601 	RMobileConferenceCall conferenceCall;
       
  2602 	OpenConferenceLC(conferenceCall, iPhone);
       
  2603 	
       
  2604 	//-------------------------------------------------------------------------
       
  2605 	// TEST: failure to swap not created conference call
       
  2606  	//-------------------------------------------------------------------------
       
  2607 	
       
  2608 	TRequestStatus reqStatus;
       
  2609 	conferenceCall.Swap(reqStatus);
       
  2610 	User::WaitForRequest(reqStatus);
       
  2611 	ASSERT_EQUALS(KErrNotReady, reqStatus.Int());
       
  2612 	AssertMockLtsyStatusL();
       
  2613 
       
  2614 	//-------------------------------------------------------------------------
       
  2615 	// TEST A1: failure to dispatch request to LTSY
       
  2616 	// when conference is active and no hold calls.
       
  2617  	//-------------------------------------------------------------------------
       
  2618 
       
  2619 	RLine line;
       
  2620 	RCall call;
       
  2621 	RCall call2;
       
  2622 	_LIT(KPhoneNumber1, "1357924680");   	
       
  2623 	_LIT(KPhoneNumber2, "1234567890");   	
       
  2624 	CreateConferenceLC(iPhone, conferenceCall, line, call, 1, KPhoneNumber1, call2, 2, KPhoneNumber2);
       
  2625 
       
  2626 	RMobilePhone::TMobileService mobileService = RMobilePhone::EVoiceService;
       
  2627 	TMockLtsyCallData0 emptyCallData1(1, mobileService);
       
  2628 	emptyCallData1.SerialiseL(data);
       
  2629 	iMockLTSY.ExpectL(EMobileCallHold, data, KErrNotSupported);
       
  2630 
       
  2631 	conferenceCall.Swap(reqStatus);
       
  2632 	User::WaitForRequest(reqStatus);
       
  2633 	ASSERT_EQUALS(KErrNotSupported, reqStatus.Int());
       
  2634 	AssertMockLtsyStatusL();
       
  2635 
       
  2636 	//-------------------------------------------------------------------------
       
  2637 	// TEST B1: failure on completion of pending request from LTSY->CTSY
       
  2638 	// when conference is active and no hold calls.
       
  2639  	//-------------------------------------------------------------------------
       
  2640 
       
  2641 	iMockLTSY.ExpectL(EMobileCallHold, data);
       
  2642 
       
  2643 	iMockLTSY.CompleteL(EMobileConferenceCallSwap, KErrGeneral);
       
  2644 
       
  2645 	conferenceCall.Swap(reqStatus);
       
  2646 	User::WaitForRequest(reqStatus);
       
  2647 	ASSERT_EQUALS(KErrGeneral, reqStatus.Int());
       
  2648 	AssertMockLtsyStatusL();
       
  2649 
       
  2650  	//-------------------------------------------------------------------------
       
  2651 	// TEST C1: Successful completion request of
       
  2652 	// RMobileConferenceCall::Swap
       
  2653 	// when conference is active and no hold calls.
       
  2654  	//-------------------------------------------------------------------------
       
  2655 
       
  2656 	iMockLTSY.ExpectL(EMobileCallHold, data);
       
  2657 	conferenceCall.Swap(reqStatus);
       
  2658 
       
  2659 	ChangeCallStatusL(1, RMobileCall::EStatusHold);
       
  2660 	ChangeCallStatusL(2, RMobileCall::EStatusHold);
       
  2661 
       
  2662 	User::WaitForRequest(reqStatus);
       
  2663 	ASSERT_EQUALS(KErrNone, reqStatus.Int());
       
  2664 	AssertMockLtsyStatusL();
       
  2665 
       
  2666 	//-------------------------------------------------------------------------
       
  2667 	// TEST A2: failure to dispatch request to LTSY
       
  2668 	// when conference is hold and no active calls.
       
  2669  	//-------------------------------------------------------------------------
       
  2670 
       
  2671 	iMockLTSY.ExpectL(EMobileCallResume, data, KErrNotSupported);
       
  2672 	conferenceCall.Swap(reqStatus);
       
  2673 	User::WaitForRequest(reqStatus);
       
  2674 	ASSERT_EQUALS(KErrNotSupported, reqStatus.Int());
       
  2675 	AssertMockLtsyStatusL();
       
  2676 
       
  2677 	//-------------------------------------------------------------------------
       
  2678 	// TEST B2: failure on completion of pending request from LTSY->CTSY
       
  2679 	// when conference is hold and no active calls.
       
  2680  	//-------------------------------------------------------------------------
       
  2681 
       
  2682 	iMockLTSY.ExpectL(EMobileCallResume, data);
       
  2683 	iMockLTSY.CompleteL(EMobileConferenceCallSwap, KErrGeneral);
       
  2684 	conferenceCall.Swap(reqStatus);
       
  2685 	User::WaitForRequest(reqStatus);
       
  2686 	ASSERT_EQUALS(KErrGeneral, reqStatus.Int());
       
  2687 	AssertMockLtsyStatusL();
       
  2688 
       
  2689  	//-------------------------------------------------------------------------
       
  2690 	// TEST C2: Successful completion request of
       
  2691 	// RMobileConferenceCall::Swap
       
  2692 	// when conference is hold and no active calls.
       
  2693  	//-------------------------------------------------------------------------
       
  2694 
       
  2695 	iMockLTSY.ExpectL(EMobileCallResume, data);
       
  2696 	conferenceCall.Swap(reqStatus);
       
  2697 
       
  2698 	ChangeCallStatusL(1, RMobileCall::EStatusConnected);
       
  2699 	ChangeCallStatusL(2, RMobileCall::EStatusConnected);
       
  2700 
       
  2701 	User::WaitForRequest(reqStatus);
       
  2702 	ASSERT_EQUALS(KErrNone, reqStatus.Int());
       
  2703 	AssertMockLtsyStatusL();
       
  2704 
       
  2705 	//-------------------------------------------------------------------------
       
  2706 	// TEST A3: failure to dispatch request to LTSY
       
  2707 	// when conference is active and there is a hold call.
       
  2708  	//-------------------------------------------------------------------------
       
  2709 
       
  2710 	// dial 3rd call (status hold)
       
  2711 	RCall call3;
       
  2712 	OpenNewCallLC(call3, line);
       
  2713 	_LIT(KPhoneNumber3, "3333333330");   	
       
  2714 	DialL(call3, 3, RMobilePhone::EVoiceService, KPhoneNumber3);
       
  2715 	ChangeCallStatusL(3, RMobileCall::EStatusHold);
       
  2716 
       
  2717 	// open 4th call for increase coverage objectives 
       
  2718 	RCall call4;
       
  2719 	OpenNewCallLC(call4, line);
       
  2720 
       
  2721 	// test
       
  2722 	iMockLTSY.ExpectL(EMobileConferenceCallSwap, KErrNotSupported);
       
  2723 
       
  2724 	conferenceCall.Swap(reqStatus);
       
  2725 	User::WaitForRequest(reqStatus);
       
  2726 	ASSERT_EQUALS(KErrNotSupported, reqStatus.Int());
       
  2727 	AssertMockLtsyStatusL();
       
  2728 
       
  2729 	//-------------------------------------------------------------------------
       
  2730 	// TEST B3: failure on completion of pending request from LTSY->CTSY
       
  2731 	// when conference is active and there is a hold call.
       
  2732  	//-------------------------------------------------------------------------
       
  2733 
       
  2734 	iMockLTSY.ExpectL(EMobileConferenceCallSwap);
       
  2735 	iMockLTSY.CompleteL(EMobileConferenceCallSwap, KErrGeneral);
       
  2736 
       
  2737 	conferenceCall.Swap(reqStatus);
       
  2738 	User::WaitForRequest(reqStatus);
       
  2739 	ASSERT_EQUALS(KErrGeneral, reqStatus.Int());
       
  2740 	AssertMockLtsyStatusL();
       
  2741 
       
  2742  	//-------------------------------------------------------------------------
       
  2743 	// TEST C3: Successful completion request of
       
  2744 	// RMobileConferenceCall::Swap
       
  2745 	// when conference is active and there is a hold call.
       
  2746  	//-------------------------------------------------------------------------
       
  2747 
       
  2748 	iMockLTSY.ExpectL(EMobileConferenceCallSwap);
       
  2749 	conferenceCall.Swap(reqStatus);
       
  2750 
       
  2751 	ChangeCallStatusL(1, RMobileCall::EStatusHold);
       
  2752 	ChangeCallStatusL(2, RMobileCall::EStatusHold);
       
  2753 	ChangeCallStatusL(3, RMobileCall::EStatusConnected);
       
  2754 
       
  2755 	User::WaitForRequest(reqStatus);
       
  2756 	ASSERT_EQUALS(KErrNone, reqStatus.Int());
       
  2757 	AssertMockLtsyStatusL();
       
  2758 
       
  2759 	//-------------------------------------------------------------------------
       
  2760 	// TEST A4: failure to dispatch request to LTSY
       
  2761 	// when conference is hold and there is an active call.
       
  2762  	//-------------------------------------------------------------------------
       
  2763 	
       
  2764 	iMockLTSY.ExpectL(EMobileConferenceCallSwap, KErrNotSupported);
       
  2765 
       
  2766 	conferenceCall.Swap(reqStatus);
       
  2767 	User::WaitForRequest(reqStatus);
       
  2768 	ASSERT_EQUALS(KErrNotSupported, reqStatus.Int());
       
  2769 	AssertMockLtsyStatusL();
       
  2770 
       
  2771 	//-------------------------------------------------------------------------
       
  2772 	// TEST B4: failure on completion of pending request from LTSY->CTSY
       
  2773 	// when conference is hold and there is an active call.
       
  2774  	//-------------------------------------------------------------------------
       
  2775 
       
  2776 	iMockLTSY.ExpectL(EMobileConferenceCallSwap);
       
  2777 	iMockLTSY.CompleteL(EMobileConferenceCallSwap, KErrGeneral);
       
  2778 
       
  2779 	conferenceCall.Swap(reqStatus);
       
  2780 	User::WaitForRequest(reqStatus);
       
  2781 	ASSERT_EQUALS(KErrGeneral, reqStatus.Int());
       
  2782 	AssertMockLtsyStatusL();
       
  2783 
       
  2784  	//-------------------------------------------------------------------------
       
  2785 	// TEST C4: Successful completion request of
       
  2786 	// RMobileConferenceCall::Swap
       
  2787 	// when conference is hold and there is an active call.
       
  2788  	//-------------------------------------------------------------------------
       
  2789 
       
  2790 	iMockLTSY.ExpectL(EMobileConferenceCallSwap);
       
  2791 	conferenceCall.Swap(reqStatus);
       
  2792 
       
  2793 	ChangeCallStatusL(3, RMobileCall::EStatusHold);
       
  2794 	ChangeCallStatusL(1, RMobileCall::EStatusConnected);
       
  2795 	ChangeCallStatusL(2, RMobileCall::EStatusConnected);
       
  2796 
       
  2797 	User::WaitForRequest(reqStatus);
       
  2798 	ASSERT_EQUALS(KErrNone, reqStatus.Int());
       
  2799 	AssertMockLtsyStatusL();
       
  2800 
       
  2801  	//-------------------------------------------------------------------------
       
  2802 	// TEST E: Unsolicited completion of RMobileConferenceCall::Swap
       
  2803 	// from LTSY.
       
  2804  	//-------------------------------------------------------------------------
       
  2805 
       
  2806 	TRequestStatus mockLtsyStatus;
       
  2807 	iMockLTSY.NotifyTerminated(mockLtsyStatus);	
       
  2808 	iMockLTSY.CompleteL(EMobileConferenceCallSwap, KErrNone);
       
  2809 	User::WaitForRequest(mockLtsyStatus);
       
  2810     ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
  2811 	AssertMockLtsyStatusL();
       
  2812 
       
  2813  	//-------------------------------------------------------------------------
       
  2814 	// TEST C3-2: Successful completion request of
       
  2815 	// RMobileConferenceCall::Swap
       
  2816 	// when conference is active and there is a hold call.
       
  2817 	// This time hold call become idle
       
  2818  	//-------------------------------------------------------------------------
       
  2819 
       
  2820 	iMockLTSY.ExpectL(EMobileConferenceCallSwap);
       
  2821 	conferenceCall.Swap(reqStatus);
       
  2822 
       
  2823 	ChangeCallStatusL(1, RMobileCall::EStatusHold);
       
  2824 	ChangeCallStatusL(2, RMobileCall::EStatusHold);
       
  2825 	ChangeCallStatusL(3, RMobileCall::EStatusIdle);
       
  2826 
       
  2827 	User::WaitForRequest(reqStatus);
       
  2828 	ASSERT_EQUALS(KErrNone, reqStatus.Int());
       
  2829 	AssertMockLtsyStatusL();
       
  2830 
       
  2831  	//-------------------------------------------------------------------------
       
  2832 	// TEST: swap conference without swap request and without ghost swap operation  
       
  2833 	// increase coverage
       
  2834  	//-------------------------------------------------------------------------
       
  2835 
       
  2836 	TRequestStatus statChangeStatus;
       
  2837 	RMobileConferenceCall::TMobileConferenceStatus status;
       
  2838 	conferenceCall.NotifyConferenceStatusChange(statChangeStatus, status);
       
  2839 
       
  2840 	ChangeCallStatusL(1, RMobileCall::EStatusConnected);
       
  2841 	ChangeCallStatusL(2, RMobileCall::EStatusConnected); // conference become active
       
  2842 
       
  2843 	// completion of notify request
       
  2844 	User::WaitForRequest(statChangeStatus);
       
  2845 	ASSERT_EQUALS(KErrNone, statChangeStatus.Int());
       
  2846 	ASSERT_EQUALS(RMobileConferenceCall::EConferenceActive, status);
       
  2847 	AssertMockLtsyStatusL();
       
  2848 
       
  2849  	//-------------------------------------------------------------------------
       
  2850 	// TEST: swap conference without swap request and without ghost swap operation  
       
  2851 	// this time conference is active
       
  2852 	// increase coverage
       
  2853  	//-------------------------------------------------------------------------
       
  2854 
       
  2855 	conferenceCall.NotifyConferenceStatusChange(statChangeStatus, status);
       
  2856 
       
  2857 	ChangeCallStatusL(1, RMobileCall::EStatusHold);
       
  2858 	ChangeCallStatusL(2, RMobileCall::EStatusHold); // conference become hold 
       
  2859 
       
  2860 	// completion of notify request
       
  2861 	User::WaitForRequest(statChangeStatus);
       
  2862 	ASSERT_EQUALS(KErrNone, statChangeStatus.Int());
       
  2863 	ASSERT_EQUALS(RMobileConferenceCall::EConferenceHold, status);
       
  2864 	AssertMockLtsyStatusL();
       
  2865 
       
  2866 	//-------------------------------------------------------------------------
       
  2867 	// TEST: make conference idle when there is requested a swap  
       
  2868  	//-------------------------------------------------------------------------
       
  2869 
       
  2870 	conferenceCall.NotifyConferenceStatusChange(statChangeStatus, status);
       
  2871 
       
  2872 	data.Close();
       
  2873 	emptyCallData1.SerialiseL(data);
       
  2874 	iMockLTSY.ExpectL(EMobileCallResume, data);
       
  2875 	conferenceCall.Swap(reqStatus);
       
  2876 	ChangeCallStatusL(1, RMobileCall::EStatusIdle);
       
  2877 
       
  2878 	// completion of notify request
       
  2879 	User::WaitForRequest(statChangeStatus);
       
  2880 	ASSERT_EQUALS(KErrNone, statChangeStatus.Int());
       
  2881 	ASSERT_EQUALS(RMobileConferenceCall::EConferenceIdle, status);
       
  2882 
       
  2883 	// swap request completes with error
       
  2884 	User::WaitForRequest(reqStatus);
       
  2885 	ASSERT_EQUALS(KErrMMEtelCallTerminated, reqStatus.Int());
       
  2886 	AssertMockLtsyStatusL();
       
  2887 
       
  2888 	CleanupStack::PopAndDestroy(8, this); // call4, call3, call2, call, line, conferenceCall, data, this
       
  2889 	
       
  2890 	}
       
  2891 
       
  2892 
       
  2893 /**
       
  2894 @SYMTestCaseID BA-CTSY-CONC-COS-0002
       
  2895 @SYMComponent  telephony_ctsy
       
  2896 @SYMTestCaseDesc Test support in CTSY for cancelling of RMobileConferenceCall::Swap
       
  2897 @SYMTestPriority High
       
  2898 @SYMTestActions Invokes cancelling of RMobileConferenceCall::Swap
       
  2899 @SYMTestExpectedResults Pass
       
  2900 @SYMTestType CT
       
  2901 */
       
  2902 void CCTsyConferenceCallControlFU::TestSwap0002L()
       
  2903 	{
       
  2904 
       
  2905 	OpenEtelServerL(EUseExtendedError);
       
  2906 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  2907 	OpenPhoneL();
       
  2908 
       
  2909 	RBuf8 data;
       
  2910 	CleanupClosePushL(data);
       
  2911 
       
  2912 	RMobileConferenceCall conferenceCall;
       
  2913 	OpenConferenceLC(conferenceCall, iPhone);
       
  2914 	
       
  2915 	RLine line;
       
  2916 	RCall call;
       
  2917 	RCall call2;
       
  2918 	_LIT(KPhoneNumber1, "1357924680");   	
       
  2919 	_LIT(KPhoneNumber2, "1234567890");   	
       
  2920 	CreateConferenceLC(iPhone, conferenceCall, line, call, 1, KPhoneNumber1, call2, 2, KPhoneNumber2);
       
  2921 
       
  2922 	//-------------------------------------------------------------------------
       
  2923 	// Test cancelling of RMobileConferenceCall::Swap
       
  2924  	//-------------------------------------------------------------------------
       
  2925 
       
  2926 	RMobilePhone::TMobileService mobileService = RMobilePhone::EVoiceService;
       
  2927 	TMockLtsyCallData0 emptyCallData1(1, mobileService);
       
  2928 	emptyCallData1.SerialiseL(data);
       
  2929 	iMockLTSY.ExpectL(EMobileCallHold, data);
       
  2930 
       
  2931 	// post request
       
  2932 	TRequestStatus reqStatus;
       
  2933 	conferenceCall.Swap(reqStatus);
       
  2934 
       
  2935 	// cancel
       
  2936 	conferenceCall.CancelAsyncRequest(EMobileConferenceCallSwap);
       
  2937 
       
  2938 	// invoke request completion from mockLtsy
       
  2939 	ChangeCallStatusL(1, RMobileCall::EStatusHold);
       
  2940 	ChangeCallStatusL(2, RMobileCall::EStatusHold);
       
  2941 
       
  2942 	User::WaitForRequest(reqStatus);
       
  2943 	// CTSY has no cancel for this ipc, so request completes with KErrNone
       
  2944 	ASSERT_EQUALS(KErrNone, reqStatus.Int());
       
  2945 	AssertMockLtsyStatusL();
       
  2946 
       
  2947 	CleanupStack::PopAndDestroy(6, this); // call2, call, line, conferenceCall, data, this
       
  2948 	
       
  2949 	}
       
  2950 
       
  2951 
       
  2952 /**
       
  2953 @SYMTestCaseID BA-CTSY-CONC-COS-0004
       
  2954 @SYMComponent  telephony_ctsy
       
  2955 @SYMTestCaseDesc Test support in CTSY for multiple client requests to RMobileConferenceCall::Swap
       
  2956 @SYMTestPriority High
       
  2957 @SYMTestActions Invokes multiple client requests to RMobileConferenceCall::Swap
       
  2958 @SYMTestExpectedResults Pass
       
  2959 @SYMTestType CT
       
  2960 */
       
  2961 void CCTsyConferenceCallControlFU::TestSwap0004L()
       
  2962 	{
       
  2963 					
       
  2964 	OpenEtelServerL(EUseExtendedError);
       
  2965 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  2966 	OpenPhoneL();
       
  2967 
       
  2968 	RBuf8 data;
       
  2969 	CleanupClosePushL(data);
       
  2970 
       
  2971 	RMobileConferenceCall conferenceCall;
       
  2972 	OpenConferenceLC(conferenceCall, iPhone);
       
  2973 	
       
  2974 	RLine line;
       
  2975 	RCall call;
       
  2976 	RCall call2;
       
  2977 	_LIT(KPhoneNumber1, "1357924680");   	
       
  2978 	_LIT(KPhoneNumber2, "1234567890");   	
       
  2979 	CreateConferenceLC(iPhone, conferenceCall, line, call, 1, KPhoneNumber1, call2, 2, KPhoneNumber2);
       
  2980 
       
  2981 	// Open second client
       
  2982 	RTelServer telServer2;
       
  2983 	TInt ret = telServer2.Connect();
       
  2984 	ASSERT_EQUALS(KErrNone, ret);
       
  2985 	CleanupClosePushL(telServer2);
       
  2986 
       
  2987 	RMobilePhone phone2;
       
  2988 	ret = phone2.Open(telServer2, KMmTsyPhoneName);
       
  2989 	ASSERT_EQUALS(KErrNone, ret);
       
  2990 	CleanupClosePushL(phone2);
       
  2991 
       
  2992 	RMobileConferenceCall conferenceCall2;
       
  2993 	OpenConferenceLC(conferenceCall2, phone2);
       
  2994 	
       
  2995 	//-------------------------------------------------------------------------
       
  2996 	// Test A: Test multiple clients requesting RMobileConferenceCall::Swap
       
  2997  	//-------------------------------------------------------------------------
       
  2998 
       
  2999 	// prepare and post 1st request
       
  3000 	RMobilePhone::TMobileService mobileService = RMobilePhone::EVoiceService;
       
  3001 	TMockLtsyCallData0 emptyCallData1(1, mobileService);
       
  3002 	emptyCallData1.SerialiseL(data);
       
  3003 	iMockLTSY.ExpectL(EMobileCallHold, data);
       
  3004 
       
  3005 	// set calls on hold when request passes to Ltsy after delay
       
  3006 	data.Close();
       
  3007 	RMobileCall::TMobileCallStatus callStatus = RMobileCall::EStatusHold;
       
  3008 	TMockLtsyCallData1<RMobileCall::TMobileCallStatus> completeCallStatusData1(1, mobileService, callStatus);
       
  3009 	completeCallStatusData1.SerialiseL(data);
       
  3010 	iMockLTSY.CompleteL(EMobileCallNotifyMobileCallStatusChange, KErrNone, data, 10);
       
  3011 
       
  3012 	data.Close();
       
  3013 	TMockLtsyCallData1<RMobileCall::TMobileCallStatus> completeCallStatusData2(2, mobileService, callStatus);
       
  3014 	completeCallStatusData2.SerialiseL(data);
       
  3015 	iMockLTSY.CompleteL(EMobileCallNotifyMobileCallStatusChange, KErrNone, data, 10);
       
  3016 
       
  3017 	TRequestStatus reqStatus;
       
  3018 	conferenceCall.Swap(reqStatus);
       
  3019 	
       
  3020 	// prepare and post 2nd request
       
  3021 	data.Close();
       
  3022 	emptyCallData1.SerialiseL(data);
       
  3023 	iMockLTSY.ExpectL(EMobileCallResume, data);
       
  3024 
       
  3025 	// connect calls when request passes to Ltsy after delay
       
  3026 	data.Close();
       
  3027 	callStatus = RMobileCall::EStatusConnected;
       
  3028 	completeCallStatusData1.SerialiseL(data);
       
  3029 	iMockLTSY.CompleteL(EMobileCallNotifyMobileCallStatusChange, KErrNone, data, 10);
       
  3030 
       
  3031 	data.Close();
       
  3032 	completeCallStatusData2.SerialiseL(data);
       
  3033 	iMockLTSY.CompleteL(EMobileCallNotifyMobileCallStatusChange, KErrNone, data, 10);
       
  3034 
       
  3035 	TRequestStatus reqStatus2;
       
  3036 	conferenceCall2.Swap(reqStatus2);
       
  3037 
       
  3038 	// check results
       
  3039 	User::WaitForRequest(reqStatus);
       
  3040 	ASSERT_EQUALS(KErrNone, reqStatus.Int());
       
  3041 
       
  3042 	User::WaitForRequest(reqStatus2);
       
  3043 	ASSERT_EQUALS(KErrNone, reqStatus2.Int());
       
  3044 
       
  3045 	AssertMockLtsyStatusL();
       
  3046 
       
  3047 	CleanupStack::PopAndDestroy(9, this); // conferenceCall2, phone2, telServer2, call2, call, line, conferenceCall, data, this
       
  3048 
       
  3049 	}
       
  3050 
       
  3051 
       
  3052 /**
       
  3053 @SYMTestCaseID BA-CTSY-CONC-COS-0005
       
  3054 @SYMComponent  telephony_ctsy
       
  3055 @SYMTestCaseDesc Test support in CTSY for RMobileConferenceCall::Swap with timeout
       
  3056 @SYMTestPriority High
       
  3057 @SYMTestActions Invokes RMobileConferenceCall::Swap and tests for timeout
       
  3058 @SYMTestExpectedResults Pass
       
  3059 @SYMTestType CT
       
  3060 */
       
  3061 void CCTsyConferenceCallControlFU::TestSwap0005L()
       
  3062 	{
       
  3063 
       
  3064 	OpenEtelServerL(EUseExtendedError);
       
  3065 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  3066 	OpenPhoneL();
       
  3067 
       
  3068 	RBuf8 data;
       
  3069 	CleanupClosePushL(data);
       
  3070 
       
  3071 	RMobileConferenceCall conferenceCall;
       
  3072 	OpenConferenceLC(conferenceCall, iPhone);
       
  3073 	
       
  3074 	RLine line;
       
  3075 	RCall call;
       
  3076 	RCall call2;
       
  3077 	_LIT(KPhoneNumber1, "1357924680");   	
       
  3078 	_LIT(KPhoneNumber2, "1234567890");   	
       
  3079 	CreateConferenceLC(iPhone, conferenceCall, line, call, 1, KPhoneNumber1, call2, 2, KPhoneNumber2);
       
  3080 	
       
  3081 	//-------------------------------------------------------------------------
       
  3082 	// Test A: Test timeout of RMobileConferenceCall::Swap
       
  3083  	//-------------------------------------------------------------------------
       
  3084 
       
  3085 	TMockLtsyCallData0 emptyCallData1(1, RMobilePhone::EVoiceService);
       
  3086 	emptyCallData1.SerialiseL(data);
       
  3087 	iMockLTSY.ExpectL(EMobileCallHold, data);
       
  3088 
       
  3089 	TRequestStatus reqStatus;
       
  3090 	conferenceCall.Swap(reqStatus);
       
  3091 	User::WaitForRequest(reqStatus);
       
  3092 	ASSERT_EQUALS(KErrTimedOut, reqStatus.Int());
       
  3093 	AssertMockLtsyStatusL();
       
  3094 
       
  3095 	CleanupStack::PopAndDestroy(6, this); // call2, call, line, conferenceCall, data, this
       
  3096 
       
  3097 	}
       
  3098 
       
  3099 
       
  3100 /**
       
  3101 @SYMTestCaseID BA-CTSY-CONC-COHU-0001
       
  3102 @SYMComponent  telephony_ctsy
       
  3103 @SYMTestCaseDesc Test support in CTSY for RMobileConferenceCall::HangUp
       
  3104 @SYMTestPriority High
       
  3105 @SYMTestActions Invokes RMobileConferenceCall::HangUp
       
  3106 @SYMTestExpectedResults Pass
       
  3107 @SYMTestType CT
       
  3108 */
       
  3109 void CCTsyConferenceCallControlFU::TestHangUp0001L()
       
  3110 	{
       
  3111 
       
  3112 	OpenEtelServerL(EUseExtendedError);
       
  3113 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  3114 	OpenPhoneL();
       
  3115 
       
  3116 	// open conference object
       
  3117 	RMobileConferenceCall conferenceCall;
       
  3118 	OpenConferenceLC(conferenceCall, iPhone);
       
  3119 	
       
  3120 	RArray<TInt> callsInConference;
       
  3121 	CleanupClosePushL(callsInConference);
       
  3122 	
       
  3123 	//-------------------------------------------------------------------------
       
  3124 	// TEST: failure to hangup not created conference call
       
  3125  	//-------------------------------------------------------------------------
       
  3126 	
       
  3127 	TRequestStatus reqStatus;
       
  3128 	conferenceCall.HangUp(reqStatus);
       
  3129 	User::WaitForRequest(reqStatus);
       
  3130 	ASSERT_EQUALS(KErrAccessDenied, reqStatus.Int());
       
  3131 	AssertMockLtsyStatusL();
       
  3132 
       
  3133  	//-------------------------------------------------------------------------
       
  3134 	// TEST A: failure to dispatch request to LTSY
       
  3135  	//-------------------------------------------------------------------------
       
  3136 
       
  3137 	RLine line;
       
  3138 	RCall call;
       
  3139 	RCall call2;
       
  3140 	_LIT(KPhoneNumber1, "1357924680");   	
       
  3141 	_LIT(KPhoneNumber2, "1234567890");   	
       
  3142 	CreateConferenceLC(iPhone, conferenceCall, line, call, 1, KPhoneNumber1, call2, 2, KPhoneNumber2);
       
  3143 	callsInConference.AppendL(1); // call1
       
  3144 	callsInConference.AppendL(2); // call2
       
  3145 	
       
  3146 	iMockLTSY.ExpectL(EMobileConferenceCallHangUp, KErrNotSupported);
       
  3147 
       
  3148 	conferenceCall.HangUp(reqStatus);
       
  3149 	User::WaitForRequest(reqStatus);
       
  3150 	ASSERT_EQUALS(KErrNotSupported, reqStatus.Int());
       
  3151 	AssertMockLtsyStatusL();
       
  3152 
       
  3153 	//-------------------------------------------------------------------------
       
  3154 	// TEST B: failure on completion of pending request from LTSY->CTSY
       
  3155  	//-------------------------------------------------------------------------
       
  3156 
       
  3157 	iMockLTSY.ExpectL(EMobileConferenceCallHangUp);
       
  3158 	iMockLTSY.CompleteL(EMobileConferenceCallHangUp, KErrGeneral);
       
  3159 
       
  3160 	conferenceCall.HangUp(reqStatus);
       
  3161 	User::WaitForRequest(reqStatus);
       
  3162 	ASSERT_EQUALS(KErrGeneral, reqStatus.Int());
       
  3163 	AssertMockLtsyStatusL();
       
  3164 
       
  3165  	//-------------------------------------------------------------------------
       
  3166 	// TEST C: Successful completion request of
       
  3167 	// RMobileConferenceCall::CreateConference.
       
  3168  	//-------------------------------------------------------------------------
       
  3169 
       
  3170 	// add more calls to conference for coverage
       
  3171 	RCall call3;
       
  3172 	_LIT(KPhoneNumber3, "3333333330");
       
  3173 	MakeCallAndAddToConferenceLC(call3, line, conferenceCall, 3, KPhoneNumber3, callsInConference); 
       
  3174 	callsInConference.AppendL(3); // call3
       
  3175 	
       
  3176 	RCall call4;
       
  3177 	_LIT(KPhoneNumber4, "4444444440");   	
       
  3178 	MakeCallAndAddToConferenceLC(call4, line, conferenceCall, 4, KPhoneNumber4, callsInConference); 
       
  3179 	callsInConference.AppendL(4); // call4
       
  3180 	
       
  3181 	RCall call5;
       
  3182 	_LIT(KPhoneNumber5, "5555555550");   	
       
  3183 	MakeCallAndAddToConferenceLC(call5, line, conferenceCall, 5, KPhoneNumber5, callsInConference); 
       
  3184 	callsInConference.AppendL(5); // call5
       
  3185 	
       
  3186 	// create a hold call out of the conference
       
  3187 	RCall call6;
       
  3188 	OpenNewCallLC(call6, line);
       
  3189 	_LIT(KPhoneNumber6, "6666666660");   	
       
  3190 	DialL(call6, 6, RMobilePhone::EVoiceService, KPhoneNumber6);
       
  3191 	// Put the conference call (call1, call2, call3, call4 and call5) on hold
       
  3192 	ChangeCallStatusInOrderL(1, 5, RMobileCall::EStatusHold);
       
  3193 	// Connect call6 in right order
       
  3194 	ConnectAndPutCallOnHoldInRightOrderL(6);
       
  3195 
       
  3196 	// now test begins
       
  3197 	iMockLTSY.ExpectL(EMobileConferenceCallHangUp);
       
  3198 	conferenceCall.HangUp(reqStatus);
       
  3199 
       
  3200 	ChangeCallStatusL(1, RMobileCall::EStatusDisconnecting); // just for coverage
       
  3201 	ChangeCallStatusL(1, RMobileCall::EStatusIdle);
       
  3202 	ChangeCallStatusL(2, RMobileCall::EStatusIdle);
       
  3203 	ChangeCallStatusL(3, RMobileCall::EStatusIdle);
       
  3204 	ChangeCallStatusL(4, RMobileCall::EStatusIdle);
       
  3205 	ChangeCallStatusL(5, RMobileCall::EStatusIdle);
       
  3206 
       
  3207 	// hangup completes here
       
  3208 	User::WaitForRequest(reqStatus);
       
  3209 	ASSERT_EQUALS(KErrNone, reqStatus.Int());
       
  3210 	AssertMockLtsyStatusL();
       
  3211 
       
  3212  	//-------------------------------------------------------------------------
       
  3213 	// TEST E: Unsolicited completion of RMobileConferenceCall::CreateConference
       
  3214 	// from LTSY.
       
  3215  	//-------------------------------------------------------------------------
       
  3216 
       
  3217 	TRequestStatus mockLtsyStatus;
       
  3218 	iMockLTSY.NotifyTerminated(mockLtsyStatus);	
       
  3219 	// send completion
       
  3220 	iMockLTSY.CompleteL(EMobileConferenceCallHangUp, KErrNone);
       
  3221 	// wait for completion
       
  3222 	User::WaitForRequest(mockLtsyStatus);
       
  3223 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
  3224 	AssertMockLtsyStatusL();
       
  3225 
       
  3226 	
       
  3227     //
       
  3228     // Added for DEF139341 (Unexpected error note pops up after creating emergency call)
       
  3229     // Tests that CTSY treats KErrGsmReleaseByUser as a normal return code, not as an error
       
  3230     // (the client request should complete with KErrNone).
       
  3231     //
       
  3232 
       
  3233    // open conference object
       
  3234     RMobileConferenceCall conferenceCall2;
       
  3235     OpenConferenceLC(conferenceCall2, iPhone);
       
  3236     
       
  3237     RArray<TInt> callsInConference2;
       
  3238     CleanupClosePushL(callsInConference2);
       
  3239     
       
  3240     RLine line2;
       
  3241     RCall call21;
       
  3242     RCall call22;
       
  3243     CreateConferenceLC(iPhone, conferenceCall2, line2, call21, 21, KPhoneNumber1, call22, 22, KPhoneNumber2);
       
  3244     callsInConference2.AppendL(21);
       
  3245     callsInConference2.AppendL(22);
       
  3246     
       
  3247     iMockLTSY.ExpectL(EMobileConferenceCallHangUp);
       
  3248     iMockLTSY.CompleteL(EMobileConferenceCallHangUp, KErrGsmReleaseByUser);
       
  3249     conferenceCall2.HangUp(reqStatus);
       
  3250     User::WaitForRequest(reqStatus);
       
  3251     ASSERT_EQUALS(KErrNone, reqStatus.Int());
       
  3252     AssertMockLtsyStatusL();
       
  3253     
       
  3254 	
       
  3255 	CleanupStack::PopAndDestroy(15, this); // call22, call21, line2, callsInConference2, conferenceCall2, call6, call5, call4, call3, call2, call, line, callsInConference, conferenceCall, this
       
  3256 	
       
  3257 	}
       
  3258 
       
  3259 /**
       
  3260 @SYMTestCaseID BA-CTSY-CONC-COHU-0001b
       
  3261 @SYMComponent  telephony_ctsy
       
  3262 @SYMTestCaseDesc Test support in CTSY for events related to RMobileConferenceCall::HangUp
       
  3263 @SYMTestPriority High
       
  3264 @SYMTestActions Invokes RMobileConferenceCall::HangUp. Checks events are triggered correctly. 
       
  3265 @SYMTestExpectedResults Pass
       
  3266 @SYMTestType CT
       
  3267 */
       
  3268 void CCTsyConferenceCallControlFU::TestHangUp0001bL()
       
  3269 	{
       
  3270 
       
  3271 	OpenEtelServerL(EUseExtendedError);
       
  3272 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  3273 	OpenPhoneL();
       
  3274 
       
  3275 	// open conference object
       
  3276 	RMobileConferenceCall conferenceCall;
       
  3277 	OpenConferenceLC(conferenceCall, iPhone);
       
  3278 	RLine line;
       
  3279 	TRequestStatus reqStatus;
       
  3280 	TRequestStatus hangupStatus;
       
  3281 	RMobileConferenceCall::TMobileConferenceEvent whatStatus;
       
  3282 	TName callName;
       
  3283 	RCall::TCallInfo callInfo;
       
  3284 
       
  3285 	// add calls to conference
       
  3286 	RCall call1;
       
  3287 	_LIT(KPhoneNumber1, "1111111110");
       
  3288 	RCall call2;
       
  3289 	_LIT(KPhoneNumber2, "22222222220");   	
       
  3290 	CreateConferenceLC(iPhone, conferenceCall, line, call1, 1, KPhoneNumber1, call2, 2, KPhoneNumber2);
       
  3291 	// now test begins
       
  3292 	iMockLTSY.ExpectL(EMobileConferenceCallHangUp);
       
  3293 	conferenceCall.NotifyConferenceEvent(hangupStatus, whatStatus, callName);
       
  3294 	conferenceCall.HangUp(reqStatus);
       
  3295 	ChangeCallStatusL(1, RMobileCall::EStatusIdle);
       
  3296 	ChangeCallStatusL(2, RMobileCall::EStatusIdle);
       
  3297 
       
  3298 	// hangup completes here
       
  3299 	User::WaitForRequest(reqStatus);
       
  3300 	ASSERT_EQUALS(KErrNone, reqStatus.Int());
       
  3301 	
       
  3302 	//Three Events are to be expected. One EConferenceCallRemoved for each call 
       
  3303 	//in the conference and one EConferenceTerminated.
       
  3304 	User::WaitForRequest(hangupStatus);
       
  3305 	ASSERT_EQUALS(RMobileConferenceCall::EConferenceCallRemoved, whatStatus);
       
  3306 	call1.GetInfo(callInfo);
       
  3307 	ASSERT_EQUALS(callInfo.iCallName, callName);
       
  3308 	
       
  3309 	conferenceCall.NotifyConferenceEvent(hangupStatus, whatStatus, callName);
       
  3310 	User::WaitForRequest(hangupStatus);
       
  3311 	ASSERT_EQUALS(RMobileConferenceCall::EConferenceCallRemoved, whatStatus);
       
  3312 	call2.GetInfo(callInfo);
       
  3313 	ASSERT_EQUALS(callInfo.iCallName, callName);
       
  3314 	
       
  3315 	conferenceCall.NotifyConferenceEvent(hangupStatus, whatStatus, callName);
       
  3316 	User::WaitForRequest(hangupStatus);
       
  3317 	ASSERT_EQUALS(RMobileConferenceCall::EConferenceTerminated, whatStatus);
       
  3318 	
       
  3319 	AssertMockLtsyStatusL();
       
  3320 
       
  3321 	CleanupStack::PopAndDestroy(5, this); // call2, call1, line, conferenceCall, this
       
  3322 	
       
  3323 	}
       
  3324 
       
  3325 
       
  3326 /**
       
  3327 @SYMTestCaseID BA-CTSY-CONC-COHU-0002
       
  3328 @SYMComponent  telephony_ctsy
       
  3329 @SYMTestCaseDesc Test support in CTSY for cancelling of RMobileConferenceCall::HangUp
       
  3330 @SYMTestPriority High
       
  3331 @SYMTestActions Invokes cancelling of RMobileConferenceCall::HangUp
       
  3332 @SYMTestExpectedResults Pass
       
  3333 @SYMTestType CT
       
  3334 */
       
  3335 void CCTsyConferenceCallControlFU::TestHangUp0002L()
       
  3336 	{
       
  3337 
       
  3338 	OpenEtelServerL(EUseExtendedError);
       
  3339 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  3340 	OpenPhoneL();
       
  3341 
       
  3342 	RBuf8 data;
       
  3343 	CleanupClosePushL(data);
       
  3344 	
       
  3345 	RArray<TInt> callsInConference;
       
  3346 	CleanupClosePushL(callsInConference);
       
  3347 	
       
  3348 	// open conference object
       
  3349 	RMobileConferenceCall conferenceCall;
       
  3350 	OpenConferenceLC(conferenceCall, iPhone);
       
  3351 	
       
  3352 	RLine line;
       
  3353 	RCall call;
       
  3354 	RCall call2;
       
  3355 	_LIT(KPhoneNumber1, "1357924680");
       
  3356 	_LIT(KPhoneNumber2, "1234567890");
       
  3357 	CreateConferenceLC(iPhone, conferenceCall, line, call, 1, KPhoneNumber1, call2, 2, KPhoneNumber2);
       
  3358 	callsInConference.AppendL(1); // call1
       
  3359 	callsInConference.AppendL(2); // call2
       
  3360 	
       
  3361 	// add more calls to conference for coverage issues
       
  3362 	RCall call3;
       
  3363 	_LIT(KPhoneNumber3, "3333333330");
       
  3364 	MakeCallAndAddToConferenceLC(call3, line, conferenceCall, 3, KPhoneNumber3, callsInConference); 
       
  3365 	callsInConference.AppendL(3); // call3
       
  3366 	
       
  3367 	RCall call4;
       
  3368 	_LIT(KPhoneNumber4, "4444444440");
       
  3369 	MakeCallAndAddToConferenceLC(call4, line, conferenceCall, 4, KPhoneNumber4, callsInConference); 
       
  3370 	callsInConference.AppendL(4); // call4
       
  3371 	
       
  3372 	RCall call5;
       
  3373 	_LIT(KPhoneNumber5, "5555555550");
       
  3374 	MakeCallAndAddToConferenceLC(call5, line, conferenceCall, 5, KPhoneNumber5, callsInConference); 
       
  3375 	callsInConference.AppendL(5); // call5
       
  3376 	
       
  3377 	// swap conference for coverage
       
  3378 	RMobilePhone::TMobileService mobileService = RMobilePhone::EVoiceService;
       
  3379 	TMockLtsyCallData0 emptyCallData1(1, mobileService);
       
  3380 	emptyCallData1.SerialiseL(data);
       
  3381 	iMockLTSY.ExpectL(EMobileCallHold, data);
       
  3382 	TRequestStatus reqStatus;
       
  3383 	conferenceCall.Swap(reqStatus);
       
  3384 
       
  3385 	ChangeCallStatusL(1, RMobileCall::EStatusHold);
       
  3386 	ChangeCallStatusL(2, RMobileCall::EStatusHold);
       
  3387 	ChangeCallStatusL(3, RMobileCall::EStatusHold);
       
  3388 	ChangeCallStatusL(4, RMobileCall::EStatusHold);
       
  3389 	ChangeCallStatusL(5, RMobileCall::EStatusHold);
       
  3390 
       
  3391 	// swap completes here
       
  3392 	User::WaitForRequest(reqStatus);
       
  3393 	ASSERT_EQUALS(KErrNone, reqStatus.Int());
       
  3394 	AssertMockLtsyStatusL();
       
  3395 
       
  3396 	//-------------------------------------------------------------------------
       
  3397 	// Test cancelling of RMobileConferenceCall::HangUp
       
  3398  	//-------------------------------------------------------------------------
       
  3399  	
       
  3400 	// send request
       
  3401 	iMockLTSY.ExpectL(EMobileConferenceCallHangUp);
       
  3402 	conferenceCall.HangUp(reqStatus);
       
  3403 	
       
  3404 	// cancel
       
  3405 	conferenceCall.CancelAsyncRequest(EMobileConferenceCallHangUp);
       
  3406 
       
  3407 	// mockLtsy completes request
       
  3408 	ChangeCallStatusL(1, RMobileCall::EStatusIdle);
       
  3409 	ChangeCallStatusL(2, RMobileCall::EStatusIdle);
       
  3410 	ChangeCallStatusL(3, RMobileCall::EStatusIdle);
       
  3411 	ChangeCallStatusL(4, RMobileCall::EStatusIdle);
       
  3412 	
       
  3413 	//Change call5 status to idle
       
  3414 	RMobileCall::TMobileCallStatus callStatus5 = RMobileCall::EStatusIdle;
       
  3415 	RMobilePhone::TMobileService mobileService5 = RMobilePhone::EVoiceService;
       
  3416 	TMockLtsyCallData1<RMobileCall::TMobileCallStatus> mockData5(5, mobileService5, callStatus5);
       
  3417 	data.Close();
       
  3418 	mockData5.SerialiseL(data);   
       
  3419 	TRequestStatus mockLtsyStatus;
       
  3420 	iMockLTSY.NotifyTerminated(mockLtsyStatus);      
       
  3421 	iMockLTSY.CompleteL(EMobileCallNotifyMobileCallStatusChange, KErrNone, data);
       
  3422 	    
       
  3423 	// when call becomes idle, remaining duration of the call is added to life time param in LTSY:		
       
  3424 	TUint32 duration = 5;	// this is a dummy value, which won't be checked by mocksy engine
       
  3425 	TMockLtsyData1<TUint32> ltsyData( duration );
       
  3426 	data.Close();
       
  3427 	ltsyData.SerialiseL(data);	
       
  3428 	iMockLTSY.ExpectL(EMmTsyUpdateLifeTimeIPC, data);	            
       
  3429 	    
       
  3430 	User::WaitForRequest(mockLtsyStatus); 	
       
  3431 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());   	
       
  3432 
       
  3433 	// hangup completes here
       
  3434 	User::WaitForRequest(reqStatus);
       
  3435 	// CTSY has no cancel for this ipc, so request completes with KErrNone
       
  3436 	ASSERT_EQUALS(KErrNone, reqStatus.Int());
       
  3437 
       
  3438 	AssertMockLtsyStatusL();
       
  3439 	CleanupStack::PopAndDestroy(10, this); // call5, call4, call3, call2, call, line, callsInConference, conferenceCall, data, this
       
  3440 	
       
  3441 	}
       
  3442 
       
  3443 
       
  3444 /**
       
  3445 @SYMTestCaseID BA-CTSY-CONC-COHU-0004
       
  3446 @SYMComponent  telephony_ctsy
       
  3447 @SYMTestCaseDesc Test support in CTSY for multiple client requests to RMobileConferenceCall::HangUp
       
  3448 @SYMTestPriority High
       
  3449 @SYMTestActions Invokes multiple client requests to RMobileConferenceCall::HangUp
       
  3450 @SYMTestExpectedResults Pass
       
  3451 @SYMTestType CT
       
  3452 */
       
  3453 void CCTsyConferenceCallControlFU::TestHangUp0004L()
       
  3454 	{
       
  3455 
       
  3456 	OpenEtelServerL(EUseExtendedError);
       
  3457 	CleanupStack::PushL(TCleanupItem(Cleanup, this));
       
  3458 	OpenPhoneL();
       
  3459 
       
  3460 	RBuf8 data;
       
  3461 	CleanupClosePushL(data);
       
  3462 
       
  3463 	// open conference object
       
  3464 	RMobileConferenceCall conferenceCall;
       
  3465 	OpenConferenceLC(conferenceCall, iPhone);
       
  3466 	
       
  3467 	RLine line;
       
  3468 	RCall call;
       
  3469 	RCall call2;
       
  3470 	_LIT(KPhoneNumber1, "1357924680");   	
       
  3471 	_LIT(KPhoneNumber2, "1234567890");   	
       
  3472 	CreateConferenceLC(iPhone, conferenceCall, line, call, 1, KPhoneNumber1, call2, 2, KPhoneNumber2);
       
  3473 
       
  3474 	// Open second client
       
  3475 	RTelServer telServer2;
       
  3476 	TInt res = telServer2.Connect();
       
  3477 	ASSERT_EQUALS(KErrNone, res);
       
  3478 	CleanupClosePushL(telServer2);
       
  3479 
       
  3480 	RMobilePhone phone2;
       
  3481 	res = phone2.Open(telServer2, KMmTsyPhoneName);
       
  3482 	ASSERT_EQUALS(KErrNone, res);
       
  3483 	CleanupClosePushL(phone2);
       
  3484 
       
  3485 	// open conference object
       
  3486 	RMobileConferenceCall conferenceCall2;
       
  3487 	OpenConferenceLC(conferenceCall2, phone2);
       
  3488 
       
  3489 	TRequestStatus reqStatus;
       
  3490 	TRequestStatus reqStatus2;
       
  3491 	
       
  3492 	//-------------------------------------------------------------------------
       
  3493 	// Test A: Test multiple clients requesting RMobileConferenceCall::HangUp
       
  3494  	//-------------------------------------------------------------------------
       
  3495 
       
  3496 	// prepare and send 1st request
       
  3497 	iMockLTSY.ExpectL(EMobileConferenceCallHangUp);
       
  3498 
       
  3499 	// complete request from mockLtsy when request passes to ltsy with delay
       
  3500 	RMobileCall::TMobileCallStatus callStatus = RMobileCall::EStatusIdle;
       
  3501 	RMobilePhone::TMobileService mobileService = RMobilePhone::EVoiceService;
       
  3502 	TMockLtsyCallData1<RMobileCall::TMobileCallStatus> completeCallStatusData1(1, mobileService, callStatus);
       
  3503 	completeCallStatusData1.SerialiseL(data);
       
  3504 	iMockLTSY.CompleteL(EMobileCallNotifyMobileCallStatusChange, KErrNone, data, 10);
       
  3505 
       
  3506 	data.Close();
       
  3507 	TMockLtsyCallData1<RMobileCall::TMobileCallStatus> completeCallStatusData2(2, mobileService, callStatus);
       
  3508 	completeCallStatusData2.SerialiseL(data);
       
  3509 	iMockLTSY.CompleteL(EMobileCallNotifyMobileCallStatusChange, KErrNone, data, 10);
       
  3510 
       
  3511 	conferenceCall.HangUp(reqStatus);
       
  3512 	
       
  3513 	// send 2nd request
       
  3514 	conferenceCall2.HangUp(reqStatus2);
       
  3515 
       
  3516 	// check results
       
  3517 	User::WaitForRequest(reqStatus);
       
  3518 	ASSERT_EQUALS(KErrNone, reqStatus.Int());
       
  3519 
       
  3520 	User::WaitForRequest(reqStatus2);
       
  3521 	ASSERT_EQUALS(KErrServerBusy, reqStatus2.Int());
       
  3522 	AssertMockLtsyStatusL();
       
  3523 	
       
  3524 	CleanupStack::PopAndDestroy(9, this); // conferenceCall2, phone2, telServer2, call2, call, line, conferenceCall, data, this
       
  3525 
       
  3526 	}
       
  3527 
       
  3528 
       
  3529 /**
       
  3530 @SYMTestCaseID BA-CTSY-CONC-COHU-0005
       
  3531 @SYMComponent  telephony_ctsy
       
  3532 @SYMTestCaseDesc Test support in CTSY for RMobileConferenceCall::HangUp with timeout
       
  3533 @SYMTestPriority High
       
  3534 @SYMTestActions Invokes RMobileConferenceCall::HangUp and tests for timeout
       
  3535 @SYMTestExpectedResults Pass
       
  3536 @SYMTestType CT
       
  3537 */
       
  3538 void CCTsyConferenceCallControlFU::TestHangUp0005L()
       
  3539 	{
       
  3540 
       
  3541 	OpenEtelServerL(EUseExtendedError);
       
  3542 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  3543 	OpenPhoneL();
       
  3544 
       
  3545 	// open conference object
       
  3546 	RMobileConferenceCall conferenceCall;
       
  3547 	OpenConferenceLC(conferenceCall, iPhone);
       
  3548 	
       
  3549 	RLine line;
       
  3550 	RCall call;
       
  3551 	RCall call2;
       
  3552 	_LIT(KPhoneNumber1, "1357924680");   	
       
  3553 	_LIT(KPhoneNumber2, "1234567890");   	
       
  3554 	CreateConferenceLC(iPhone, conferenceCall, line, call, 1, KPhoneNumber1, call2, 2, KPhoneNumber2);
       
  3555 
       
  3556 	//-------------------------------------------------------------------------
       
  3557 	// Test A: Test timeout of RMobileConferenceCall::HangUp
       
  3558  	//-------------------------------------------------------------------------
       
  3559 
       
  3560 	iMockLTSY.ExpectL(EMobileConferenceCallHangUp);
       
  3561 
       
  3562 	TRequestStatus reqStatus;
       
  3563 	conferenceCall.HangUp(reqStatus);
       
  3564 	User::WaitForRequest(reqStatus);
       
  3565 	ASSERT_EQUALS(KErrTimedOut, reqStatus.Int());
       
  3566 	AssertMockLtsyStatusL();
       
  3567 
       
  3568 	CleanupStack::PopAndDestroy(5, this); // call2, call, line, conferenceCall, this
       
  3569 
       
  3570 	}
       
  3571 
       
  3572 
       
  3573 /**
       
  3574 @SYMTestCaseID BA-CTSY-CONC-COAC-0001
       
  3575 @SYMComponent  telephony_ctsy
       
  3576 @SYMTestCaseDesc Test support in CTSY for RMobileConferenceCall::AddCall
       
  3577 @SYMTestPriority High
       
  3578 @SYMTestActions Invokes RMobileConferenceCall::AddCall
       
  3579 @SYMTestExpectedResults Pass
       
  3580 @SYMTestType CT
       
  3581 */
       
  3582 void CCTsyConferenceCallControlFU::TestAddCall0001L()
       
  3583 	{
       
  3584 
       
  3585 	OpenEtelServerL(EUseExtendedError);
       
  3586 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  3587 	OpenPhoneL();
       
  3588 
       
  3589 	RBuf8 data;
       
  3590 	CleanupClosePushL(data);
       
  3591 	
       
  3592 	RArray<TInt> callsInConference;
       
  3593 	CleanupClosePushL(callsInConference);
       
  3594 	
       
  3595 	// open conference object
       
  3596 	RMobileConferenceCall conferenceCall;
       
  3597 	OpenConferenceLC(conferenceCall,iPhone);
       
  3598 	
       
  3599 	// open line for calls
       
  3600 	RLine line;
       
  3601 	OpenLineLC(line);
       
  3602 
       
  3603 	// open first call
       
  3604 	RCall call;
       
  3605 	OpenNewCallLC(call, line);
       
  3606 	// dial first call (status hold)
       
  3607 	_LIT(KPhoneNumber1, "1357924680");   	
       
  3608 	DialL(call, 1, RMobilePhone::EVoiceService, KPhoneNumber1);
       
  3609 	ChangeCallStatusL(1, RMobileCall::EStatusHold);
       
  3610 	
       
  3611 	// create a call to add to the conference
       
  3612 	RCall call3;
       
  3613 	TName callName3;
       
  3614 	OpenNewCallLC(call3, line, &callName3);
       
  3615 	
       
  3616 	// create a hold call out of the conference (just for increase coverage)
       
  3617 	RCall call4;
       
  3618 	TName callName4;
       
  3619 	OpenNewCallLC(call4, line, &callName4);
       
  3620 	_LIT(KPhoneNumber4, "4444444440");   	
       
  3621 	DialL(call4, 4, RMobilePhone::EVoiceService, KPhoneNumber4);
       
  3622 	ChangeCallStatusL(4, RMobileCall::EStatusHold);
       
  3623 	
       
  3624 	// open second call
       
  3625 	RMobileCall call2;
       
  3626 	TName callName2;
       
  3627 	OpenNewCallLC(call2, line, &callName2);
       
  3628 	// dial second call (status connected)
       
  3629 	_LIT(KPhoneNumber2, "1234567890");   	
       
  3630 	DialL(call2, 2, RMobilePhone::EVoiceService, KPhoneNumber2);
       
  3631 	ChangeCallStatusL(2, RMobileCall::EStatusConnected);
       
  3632 
       
  3633 	//-------------------------------------------------------------------------
       
  3634 	// TEST: add idle call
       
  3635  	//-------------------------------------------------------------------------
       
  3636 
       
  3637 	TRequestStatus reqStatus;
       
  3638 	conferenceCall.AddCall(reqStatus, callName3);
       
  3639 	User::WaitForRequest(reqStatus);
       
  3640 	ASSERT_EQUALS(KErrArgument, reqStatus.Int());
       
  3641 	AssertMockLtsyStatusL();
       
  3642 
       
  3643 	//-------------------------------------------------------------------------
       
  3644 	// TEST: add call when conference is idle
       
  3645  	//-------------------------------------------------------------------------
       
  3646 
       
  3647 	// dial call3 (status hold)
       
  3648 	_LIT(KPhoneNumber3, "3333333330");   	
       
  3649 	DialL(call3, 3, RMobilePhone::EVoiceService, KPhoneNumber3);
       
  3650 	ConnectAndPutCallOnHoldInRightOrderL(3);
       
  3651 
       
  3652 	// test
       
  3653 	conferenceCall.AddCall(reqStatus, callName3);
       
  3654 	User::WaitForRequest(reqStatus);
       
  3655 	ASSERT_EQUALS(KErrArgument, reqStatus.Int());
       
  3656 	AssertMockLtsyStatusL();
       
  3657 
       
  3658 	//-------------------------------------------------------------------------
       
  3659 	// TEST A: failure to dispatch request to LTSY
       
  3660  	//-------------------------------------------------------------------------
       
  3661 
       
  3662 	// create conference
       
  3663 	iMockLTSY.ExpectL(EMobileConferenceCallCreateConference);
       
  3664 	conferenceCall.CreateConference(reqStatus);
       
  3665 	
       
  3666 	// connect first call
       
  3667 	ChangeCallStatusL(1, RMobileCall::EStatusConnected);
       
  3668 	// update second call status
       
  3669 	ChangeCallStatusL(2, RMobileCall::EStatusConnected);
       
  3670 
       
  3671 	// conference is created here
       
  3672 	User::WaitForRequest(reqStatus);
       
  3673 	ASSERT_EQUALS(KErrNone, reqStatus.Int());
       
  3674 	AssertMockLtsyStatusL();
       
  3675 
       
  3676 	// test
       
  3677 	TMockLtsyCallData0 emptyCallDataServiceUnspecified3(3, RMobilePhone::EServiceUnspecified);
       
  3678 	emptyCallDataServiceUnspecified3.SerialiseL(data);
       
  3679 	iMockLTSY.ExpectL(EMobileConferenceCallAddCall, data, KErrNotSupported);
       
  3680 
       
  3681 	conferenceCall.AddCall(reqStatus, callName3);
       
  3682 	User::WaitForRequest(reqStatus);
       
  3683 	ASSERT_EQUALS(KErrNotSupported, reqStatus.Int());
       
  3684 	AssertMockLtsyStatusL();
       
  3685 
       
  3686 	//-------------------------------------------------------------------------
       
  3687 	// TEST B: failure on completion of pending request from LTSY->CTSY
       
  3688  	//-------------------------------------------------------------------------
       
  3689 
       
  3690 	iMockLTSY.ExpectL(EMobileConferenceCallAddCall, data);
       
  3691 	iMockLTSY.CompleteL(EMobileConferenceCallAddCall, KErrGeneral);
       
  3692 
       
  3693 	conferenceCall.AddCall(reqStatus, callName3);
       
  3694 
       
  3695 	User::WaitForRequest(reqStatus);
       
  3696 	ASSERT_EQUALS(KErrGeneral, reqStatus.Int());
       
  3697 	AssertMockLtsyStatusL();
       
  3698 
       
  3699  	//-------------------------------------------------------------------------
       
  3700 	// TEST C: Successful completion request of
       
  3701 	// RMobileConferenceCall::AddCall.
       
  3702  	//-------------------------------------------------------------------------
       
  3703 
       
  3704 	iMockLTSY.ExpectL(EMobileConferenceCallAddCall, data);
       
  3705     conferenceCall.AddCall(reqStatus, callName3);
       
  3706 
       
  3707     RMobileCall::TMobileCallEvent completeEvent(RMobileCall::ERemoteTerminated);
       
  3708 	RMobilePhone::TMobileService mobileService = RMobilePhone::EVoiceService;
       
  3709 	TMockLtsyCallData1<RMobileCall::TMobileCallEvent> callEventData(2, mobileService, completeEvent);
       
  3710 	
       
  3711     // this call event completion is just for increase coverage
       
  3712     TRequestStatus mockLtsyStatus;
       
  3713     iMockLTSY.NotifyTerminated(mockLtsyStatus);	
       
  3714     data.Close();
       
  3715     callEventData.SerialiseL(data);
       
  3716     iMockLTSY.CompleteL(EMobileCallNotifyCallEvent, KErrNone, data);
       
  3717 	User::WaitForRequest(mockLtsyStatus);
       
  3718     ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
  3719 
       
  3720     // this complete is just for increase coverage
       
  3721     ChangeCallStatusL(2, RMobileCall::EStatusIdle);
       
  3722 
       
  3723     // this complete is just for increase coverage
       
  3724 	ChangeCallStatusL(4, RMobileCall::EStatusIdle);
       
  3725 
       
  3726 	// this complete is just for increase coverage
       
  3727 	ChangeCallStatusL(3, RMobileCall::EStatusHold);
       
  3728 
       
  3729 	ChangeCallStatusL(3, RMobileCall::EStatusConnected);
       
  3730 
       
  3731 	// now only call1 and call3 are in conference
       
  3732 	callsInConference.AppendL(1); // call1
       
  3733 	callsInConference.AppendL(3); // call3
       
  3734 	
       
  3735 	// add call request completes here
       
  3736 	User::WaitForRequest(reqStatus);
       
  3737 	ASSERT_EQUALS(KErrNone, reqStatus.Int());
       
  3738 	AssertMockLtsyStatusL();
       
  3739 
       
  3740 	TInt count;
       
  3741 	TInt res = conferenceCall.EnumerateCalls(count);
       
  3742 	ASSERT_EQUALS(KErrNone, res);
       
  3743 	ASSERT_EQUALS(2, count);
       
  3744 	AssertMockLtsyStatusL();
       
  3745 
       
  3746 	//-------------------------------------------------------------------------
       
  3747 	// TEST E: Unsolicited completion of RMobileConferenceCall::AddCall
       
  3748 	// from LTSY.
       
  3749  	//-------------------------------------------------------------------------
       
  3750 
       
  3751 	iMockLTSY.NotifyTerminated(mockLtsyStatus);	
       
  3752 	iMockLTSY.CompleteL(EMobileConferenceCallAddCall, KErrNone);
       
  3753 	User::WaitForRequest(mockLtsyStatus);
       
  3754     ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
  3755 	AssertMockLtsyStatusL();
       
  3756 	
       
  3757     //-------------------------------------------------------------------------
       
  3758     // TEST F: Tests that a call that connect without connecting can be added to a conference.
       
  3759     //-------------------------------------------------------------------------
       
  3760     RCall callOnlyConnect; 
       
  3761     TName callNameOnlyConnect;
       
  3762     _LIT(KPhoneNumberOnlyConnect, "8888888881");
       
  3763     ChangeConferenceCallStatusL(callsInConference, RMobileCall::EStatusHold);
       
  3764     
       
  3765     // Then open the call and dial
       
  3766     OpenNewCallLC(callOnlyConnect, line, &callNameOnlyConnect);
       
  3767     DialL(callOnlyConnect, 9, RMobilePhone::EVoiceService, KPhoneNumberOnlyConnect);
       
  3768     // Apply only connected status changes
       
  3769     ChangeCallStatusL(9, RMobileCall::EStatusConnected);
       
  3770 
       
  3771     data.Close();
       
  3772     TMockLtsyCallData0 emptyCallDataServiceUnspecified9(9, RMobilePhone::EServiceUnspecified);
       
  3773     emptyCallDataServiceUnspecified9.SerialiseL(data);
       
  3774     iMockLTSY.ExpectL(EMobileConferenceCallAddCall, data, KErrNone);
       
  3775     iMockLTSY.CompleteL(EMobileConferenceCallAddCall, KErrNone);
       
  3776 
       
  3777     // Try to add the call to the conference. 
       
  3778     conferenceCall.AddCall(reqStatus, callNameOnlyConnect);
       
  3779     User::WaitForRequest(reqStatus);
       
  3780     TInt ttt = reqStatus.Int();
       
  3781     ASSERT_EQUALS(KErrNone, reqStatus.Int());
       
  3782     ChangeConferenceCallStatusL(callsInConference, RMobileCall::EStatusConnected);
       
  3783     
       
  3784     AddCallL(conferenceCall, 9, callNameOnlyConnect, callsInConference);
       
  3785     callsInConference.Append(9);
       
  3786     
       
  3787 	//-------------------------------------------------------------------------
       
  3788 	// TEST G: Tests that a call with lack of KCapsJoin capability cannot be added to a conference.
       
  3789 	//-------------------------------------------------------------------------
       
  3790 	// call2 doesn't have join capability since it is in idle mode.
       
  3791 	conferenceCall.AddCall(reqStatus, callName2);
       
  3792 	User::WaitForRequest(reqStatus);
       
  3793 	ASSERT_EQUALS(KErrArgument, reqStatus.Int());
       
  3794 		
       
  3795 	// KCapsJoin capability is not assigned to a new call if 5 calls are present in an ongoing conference.
       
  3796 	RCall call6; // 4th call in the conference
       
  3797 	_LIT(KPhoneNumber6, "6666666660");
       
  3798 	MakeCallAndAddToConferenceLC(call6, line, conferenceCall, 6, KPhoneNumber6, callsInConference);
       
  3799 	callsInConference.AppendL(6); // call6
       
  3800 	
       
  3801 	RCall call7; // 5th call in the conference
       
  3802 	_LIT(KPhoneNumber7, "7777777770");
       
  3803 	MakeCallAndAddToConferenceLC(call7, line, conferenceCall, 7, KPhoneNumber7, callsInConference);
       
  3804 	callsInConference.AppendL(7); // call7
       
  3805 	
       
  3806 	RCall call8; // 6th call in the conference
       
  3807 	TName callName8;
       
  3808 	_LIT(KPhoneNumber8, "8888888880");
       
  3809 	// First put the conference call on hold
       
  3810 	ChangeConferenceCallStatusL(callsInConference, RMobileCall::EStatusHold);
       
  3811 	// Then open the call and dial
       
  3812 	OpenNewCallLC(call8, line, &callName8);
       
  3813 	DialL(call8, 8, RMobilePhone::EVoiceService, KPhoneNumber8);
       
  3814 	// Apply all expected status changes so that capabilities can be assigned correctly
       
  3815 	ChangeCallStatusL(8, RMobileCall::EStatusConnecting);
       
  3816 	ChangeCallStatusL(8, RMobileCall::EStatusConnected);
       
  3817 	
       
  3818 	// Try to add the 6th call to the conference. This operations should fail with KErrArgument as a conference can have maximum 5 members.
       
  3819 	conferenceCall.AddCall(reqStatus, callName8);
       
  3820 	User::WaitForRequest(reqStatus);
       
  3821 	ASSERT_EQUALS(KErrMMEtelMaxReached, reqStatus.Int());
       
  3822 	
       
  3823 	AssertMockLtsyStatusL();
       
  3824 	
       
  3825 	CleanupStack::PopAndDestroy(13, this); // call8, call7, call6, callOnlyConnect, call4, call3, call2, call, line, conferenceCall, callsInConference, data, this
       
  3826 	
       
  3827 	}
       
  3828 
       
  3829 
       
  3830 /**
       
  3831 @SYMTestCaseID BA-CTSY-CONC-COAC-0002
       
  3832 @SYMComponent  telephony_ctsy
       
  3833 @SYMTestCaseDesc Test support in CTSY for cancelling of RMobileConferenceCall::AddCall
       
  3834 @SYMTestPriority High
       
  3835 @SYMTestActions Invokes cancelling of RMobileConferenceCall::AddCall
       
  3836 @SYMTestExpectedResults Pass
       
  3837 @SYMTestType CT
       
  3838 */
       
  3839 void CCTsyConferenceCallControlFU::TestAddCall0002L()
       
  3840 	{
       
  3841 
       
  3842 	OpenEtelServerL(EUseExtendedError);
       
  3843 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  3844 	OpenPhoneL();
       
  3845 
       
  3846 	RBuf8 data;
       
  3847 	CleanupClosePushL(data);
       
  3848 
       
  3849 	// open conference object
       
  3850 	RMobileConferenceCall conferenceCall;
       
  3851 	OpenConferenceLC(conferenceCall, iPhone);
       
  3852 	
       
  3853 	RLine line;
       
  3854 	RCall call;
       
  3855 	RCall call2;
       
  3856 	_LIT(KPhoneNumber1, "1357924680");   	
       
  3857 	_LIT(KPhoneNumber2, "1234567890");   	
       
  3858 	CreateConferenceLC(iPhone, conferenceCall, line, call, 1, KPhoneNumber1, call2, 2, KPhoneNumber2);
       
  3859 
       
  3860 	// open 3rd call
       
  3861 	RCall call3;
       
  3862 	TName callName3;
       
  3863 	OpenNewCallLC(call3, line, &callName3);
       
  3864 
       
  3865 	// dial 3rd call (status hold)
       
  3866 	_LIT(KPhoneNumber3, "1632960000");
       
  3867 	DialL(call3, 3, RMobilePhone::EVoiceService, KPhoneNumber3);
       
  3868 	// put the conference call on hold
       
  3869 	ChangeCallStatusInOrderL(1, 2, RMobileCall::EStatusHold);
       
  3870 	ConnectAndPutCallOnHoldInRightOrderL(3);
       
  3871 	// make the conference call active
       
  3872 	ChangeCallStatusInOrderL(1, 2, RMobileCall::EStatusConnected);
       
  3873 
       
  3874 	//-------------------------------------------------------------------------
       
  3875 	// Test cancelling of RMobileConferenceCall::AddCall
       
  3876  	//-------------------------------------------------------------------------
       
  3877  	
       
  3878 	// send request
       
  3879 	TMockLtsyCallData0 emptyCallDataServiceUnspecified3(3, RMobilePhone::EServiceUnspecified);
       
  3880 	emptyCallDataServiceUnspecified3.SerialiseL(data);
       
  3881 	iMockLTSY.ExpectL(EMobileConferenceCallAddCall, data);
       
  3882 	TRequestStatus reqStatus;
       
  3883 	conferenceCall.AddCall(reqStatus, callName3);
       
  3884 	
       
  3885 	// cancel
       
  3886 	conferenceCall.CancelAsyncRequest(EMobileConferenceCallAddCall);
       
  3887 
       
  3888 	// mockLtsy completes request
       
  3889 	ChangeCallStatusL(3, RMobileCall::EStatusConnected);
       
  3890 
       
  3891 	// check results
       
  3892 	User::WaitForRequest(reqStatus);
       
  3893 	// there is no cancel for this ipc in ctsy
       
  3894 	// so status is KErrNone
       
  3895 	ASSERT_EQUALS(KErrNone, reqStatus.Int());
       
  3896 
       
  3897 	AssertMockLtsyStatusL();
       
  3898 	CleanupStack::PopAndDestroy(7, this); // call3, call2, call, line, conferenceCall, data, this
       
  3899 	
       
  3900 	}
       
  3901 
       
  3902 
       
  3903 /**
       
  3904 @SYMTestCaseID BA-CTSY-CONC-COAC-0003
       
  3905 @SYMComponent  telephony_ctsy
       
  3906 @SYMTestCaseDesc Test support in CTSY for RMobileConferenceCall::AddCall with bad parameter data
       
  3907 @SYMTestPriority High
       
  3908 @SYMTestActions Invokes RMobileConferenceCall::AddCall with bad parameter data
       
  3909 @SYMTestExpectedResults Pass
       
  3910 @SYMTestType CT
       
  3911 */
       
  3912 void CCTsyConferenceCallControlFU::TestAddCall0003L()
       
  3913 	{
       
  3914 
       
  3915 	OpenEtelServerL(EUseExtendedError);
       
  3916 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  3917 	OpenPhoneL();
       
  3918 
       
  3919 	RMobileConferenceCall conferenceCall;
       
  3920 	OpenConferenceLC(conferenceCall, iPhone);
       
  3921 
       
  3922 	//-------------------------------------------------------------------------
       
  3923 	// Test C: Test passing out of bounds parameters to
       
  3924 	// RMobileConferenceCall::AddCall
       
  3925  	//-------------------------------------------------------------------------
       
  3926 
       
  3927 	TName name(KNullDesC);
       
  3928 	
       
  3929 	TRequestStatus reqStatus;
       
  3930 	conferenceCall.AddCall(reqStatus, name);
       
  3931 
       
  3932 	User::WaitForRequest(reqStatus);
       
  3933 	ASSERT_EQUALS(KErrArgument, reqStatus.Int());
       
  3934 	AssertMockLtsyStatusL();
       
  3935 
       
  3936 	CleanupStack::PopAndDestroy(2, this); // conferenceCall, this
       
  3937 
       
  3938 	}
       
  3939 
       
  3940 
       
  3941 /**
       
  3942 @SYMTestCaseID BA-CTSY-CONC-COAC-0004
       
  3943 @SYMComponent  telephony_ctsy
       
  3944 @SYMTestCaseDesc Test support in CTSY for multiple client requests to RMobileConferenceCall::AddCall
       
  3945 @SYMTestPriority High
       
  3946 @SYMTestActions Invokes multiple client requests to RMobileConferenceCall::AddCall
       
  3947 @SYMTestExpectedResults Pass
       
  3948 @SYMTestType CT
       
  3949 */
       
  3950 void CCTsyConferenceCallControlFU::TestAddCall0004L()
       
  3951 	{
       
  3952 
       
  3953 	OpenEtelServerL(EUseExtendedError);
       
  3954 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  3955 	OpenPhoneL();
       
  3956 
       
  3957 	RBuf8 data;
       
  3958 	CleanupClosePushL(data);
       
  3959 
       
  3960 	// open conference object
       
  3961 	RMobileConferenceCall conferenceCall;
       
  3962 	OpenConferenceLC(conferenceCall, iPhone);
       
  3963 
       
  3964 	RLine line;
       
  3965 	RCall call;
       
  3966 	RCall call2;
       
  3967 	_LIT(KPhoneNumber1, "1357924680");   	
       
  3968 	_LIT(KPhoneNumber2, "1234567890");   	
       
  3969 	CreateConferenceLC(iPhone, conferenceCall, line, call, 1, KPhoneNumber1, call2, 2, KPhoneNumber2);
       
  3970 	
       
  3971 	// open 3rd call
       
  3972 	RCall call3;
       
  3973 	TName callName3;
       
  3974 	OpenNewCallLC(call3, line, &callName3);
       
  3975 
       
  3976 	// dial 3rd call (status hold)
       
  3977 	_LIT(KPhoneNumber3, "1632960000");
       
  3978 	DialL(call3, 3, RMobilePhone::EVoiceService, KPhoneNumber3);
       
  3979 	// put the conference call on hold
       
  3980 	ChangeCallStatusInOrderL(1, 2, RMobileCall::EStatusHold);
       
  3981 	ConnectAndPutCallOnHoldInRightOrderL(3);
       
  3982 	// make the conference call active
       
  3983 	ChangeCallStatusInOrderL(1, 2, RMobileCall::EStatusConnected);
       
  3984 	
       
  3985 	// ------------------- Open second client ------------------------
       
  3986 	RTelServer telServer2;
       
  3987 	TInt ret = telServer2.Connect();
       
  3988 	ASSERT_EQUALS(KErrNone, ret);
       
  3989 	CleanupClosePushL(telServer2);
       
  3990 
       
  3991 	RMobilePhone phone2;
       
  3992 	ret = phone2.Open(telServer2, KMmTsyPhoneName);
       
  3993 	ASSERT_EQUALS(KErrNone, ret);
       
  3994 	CleanupClosePushL(phone2);
       
  3995 
       
  3996 	// open new line for calls
       
  3997 	RLine secLine;
       
  3998 	TInt res = secLine.Open(phone2, KMmTsyVoice1LineName);
       
  3999 	ASSERT_EQUALS(KErrNone, res);
       
  4000 	CleanupClosePushL(secLine);
       
  4001 	
       
  4002 	// open call
       
  4003 	RCall secCall;
       
  4004 	TName secCallName;
       
  4005 	OpenNewCallLC(secCall, secLine, &secCallName);
       
  4006 
       
  4007 	// dial call
       
  4008 	_LIT(KSecPhoneNumber1, "1632960000");
       
  4009 	DialL(secCall, 4, RMobilePhone::EVoiceService, KSecPhoneNumber1);
       
  4010 	ChangeCallStatusL(4, RMobileCall::EStatusConnecting);
       
  4011 	ChangeCallStatusL(4, RMobileCall::EStatusConnected);
       
  4012 
       
  4013 	// open conference object
       
  4014 	RMobileConferenceCall secConferenceCall;
       
  4015 	OpenConferenceLC(secConferenceCall, phone2);
       
  4016 	
       
  4017 	//-------------------------------------------------------------------------
       
  4018 	// Test A: Test multiple clients requesting RMobileConferenceCall::AddCall
       
  4019  	//-------------------------------------------------------------------------
       
  4020 
       
  4021 	// first request
       
  4022 	TMockLtsyCallData0 emptyCallDataServiceUnspecified3(3, RMobilePhone::EServiceUnspecified);
       
  4023 	emptyCallDataServiceUnspecified3.SerialiseL(data);
       
  4024 	iMockLTSY.ExpectL(EMobileConferenceCallAddCall, data);
       
  4025 
       
  4026 	data.Close();
       
  4027 	RMobileCall::TMobileCallStatus callStatus = RMobileCall::EStatusConnected;
       
  4028 	TMockLtsyCallData1<RMobileCall::TMobileCallStatus> completeCallStatusData3(3, RMobilePhone::EVoiceService, callStatus);
       
  4029 	completeCallStatusData3.SerialiseL(data);
       
  4030 	iMockLTSY.CompleteL(EMobileCallNotifyMobileCallStatusChange, KErrNone, data, 10);
       
  4031 
       
  4032 	TRequestStatus reqStatus;
       
  4033 	conferenceCall.AddCall(reqStatus, callName3);
       
  4034 
       
  4035 	// second request
       
  4036 	TMockLtsyCallData0 emptyCallDataServiceUnspecified4(4, RMobilePhone::EServiceUnspecified);
       
  4037 	data.Close();
       
  4038 	emptyCallDataServiceUnspecified4.SerialiseL(data);
       
  4039 	iMockLTSY.ExpectL(EMobileConferenceCallAddCall, data);
       
  4040 
       
  4041 	data.Close();
       
  4042 	RMobileCall::TMobileCallStatus secCallStatus = RMobileCall::EStatusConnected;
       
  4043 	TMockLtsyCallData1<RMobileCall::TMobileCallStatus> secCompleteCallStatusData1(4, RMobilePhone::EVoiceService, secCallStatus);
       
  4044 	secCompleteCallStatusData1.SerialiseL(data);
       
  4045 	iMockLTSY.CompleteL(EMobileCallNotifyMobileCallStatusChange, KErrNone, data, 10);
       
  4046 
       
  4047 	TRequestStatus secReqStatus;
       
  4048 	secConferenceCall.AddCall(secReqStatus, secCallName);
       
  4049 
       
  4050 	// check results
       
  4051 	User::WaitForRequest(reqStatus);
       
  4052 	ASSERT_EQUALS(KErrNone, reqStatus.Int());
       
  4053 
       
  4054 	User::WaitForRequest(secReqStatus);
       
  4055 	ASSERT_EQUALS(KErrNone, secReqStatus.Int());
       
  4056 
       
  4057 	AssertMockLtsyStatusL();
       
  4058 
       
  4059 	CleanupStack::PopAndDestroy(12, this); // secConferenceCall, secCall, secLine, phone2, telServer2, call3, call2, call, line, conferenceCall, data, this
       
  4060 
       
  4061 	}
       
  4062 
       
  4063 
       
  4064 /**
       
  4065 @SYMTestCaseID BA-CTSY-CONC-COAC-0005
       
  4066 @SYMComponent  telephony_ctsy
       
  4067 @SYMTestCaseDesc Test support in CTSY for RMobileConferenceCall::AddCall with timeout
       
  4068 @SYMTestPriority High
       
  4069 @SYMTestActions Invokes RMobileConferenceCall::AddCall and tests for timeout
       
  4070 @SYMTestExpectedResults Pass
       
  4071 @SYMTestType CT
       
  4072 */
       
  4073 void CCTsyConferenceCallControlFU::TestAddCall0005L()
       
  4074 	{
       
  4075 
       
  4076 	OpenEtelServerL(EUseExtendedError);
       
  4077 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  4078 	OpenPhoneL();
       
  4079 
       
  4080 	RBuf8 data;
       
  4081 	CleanupClosePushL(data);
       
  4082 
       
  4083 	// open conference object
       
  4084 	RMobileConferenceCall conferenceCall;
       
  4085 	OpenConferenceLC(conferenceCall, iPhone);
       
  4086 
       
  4087 	RLine line;
       
  4088 	RCall call;
       
  4089 	RCall call2;
       
  4090 	_LIT(KPhoneNumber1, "1357924680");   	
       
  4091 	_LIT(KPhoneNumber2, "1234567890");   	
       
  4092 	CreateConferenceLC(iPhone, conferenceCall, line, call, 1, KPhoneNumber1, call2, 2, KPhoneNumber2);
       
  4093 
       
  4094 	// open 3rd call
       
  4095 	RCall call3;
       
  4096 	TName callName3;
       
  4097 	OpenNewCallLC(call3, line, &callName3);
       
  4098 
       
  4099 	// dial 3rd call (status hold)
       
  4100 	_LIT(KPhoneNumber3, "1632960000");
       
  4101 	DialL(call3, 3, RMobilePhone::EVoiceService, KPhoneNumber3);
       
  4102 	// put the conference call on hold
       
  4103 	ChangeCallStatusInOrderL(1, 2, RMobileCall::EStatusHold);
       
  4104 	ConnectAndPutCallOnHoldInRightOrderL(3);
       
  4105 	// make the conference call active
       
  4106 	ChangeCallStatusInOrderL(1, 2, RMobileCall::EStatusConnected);
       
  4107 
       
  4108 	//-------------------------------------------------------------------------
       
  4109 	// Test A: Test timeout of RMobileConferenceCall::AddCall
       
  4110  	//-------------------------------------------------------------------------
       
  4111 
       
  4112 	TMockLtsyCallData0 emptyCallDataServiceUnspecified3(3, RMobilePhone::EServiceUnspecified);
       
  4113 	emptyCallDataServiceUnspecified3.SerialiseL(data);
       
  4114 	iMockLTSY.ExpectL(EMobileConferenceCallAddCall, data);
       
  4115 
       
  4116 	TRequestStatus reqStatus;
       
  4117 	conferenceCall.AddCall(reqStatus, callName3);
       
  4118 
       
  4119 	User::WaitForRequest(reqStatus);
       
  4120 	ASSERT_EQUALS(KErrTimedOut, reqStatus.Int());
       
  4121 	AssertMockLtsyStatusL();
       
  4122 
       
  4123 	CleanupStack::PopAndDestroy(7, this); // call3, call2, call, line, conferenceCall, data, this
       
  4124 
       
  4125 	}
       
  4126 
       
  4127 
       
  4128 /**
       
  4129 @SYMTestCaseID BA-CTSY-CONC-COGC-0001
       
  4130 @SYMComponent  telephony_ctsy
       
  4131 @SYMTestCaseDesc Test support in CTSY for RMobileConferenceCall::GetCaps
       
  4132 @SYMTestPriority High
       
  4133 @SYMTestActions Invokes RMobileConferenceCall::GetCaps
       
  4134 @SYMTestExpectedResults Pass
       
  4135 @SYMTestType CT
       
  4136 */
       
  4137 void CCTsyConferenceCallControlFU::TestGetCaps0001L()
       
  4138 	{
       
  4139 
       
  4140 	OpenEtelServerL(EUseExtendedError);
       
  4141 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  4142 	OpenPhoneL();
       
  4143 
       
  4144 	RMobileConferenceCall conferenceCall;
       
  4145 	OpenConferenceLC(conferenceCall, iPhone);
       
  4146 	
       
  4147  	//-------------------------------------------------------------------------
       
  4148 	// TEST C: Successful completion request of
       
  4149 	// RMobileConferenceCall::GetCaps.
       
  4150  	//-------------------------------------------------------------------------
       
  4151 
       
  4152 	TUint32 caps;
       
  4153 	TInt res = conferenceCall.GetCaps(caps);
       
  4154 	ASSERT_EQUALS(KErrNone, res);
       
  4155 	ASSERT_EQUALS(static_cast<TUint32>(0), caps);
       
  4156 
       
  4157  	//-------------------------------------------------------------------------
       
  4158 	// TEST: Successful completion request of
       
  4159 	// RMobileConferenceCall::GetCaps with other Caps value.
       
  4160  	//-------------------------------------------------------------------------
       
  4161 
       
  4162 	RLine line;
       
  4163 	RCall call;
       
  4164 	RCall call2;
       
  4165 	_LIT(KPhoneNumber1, "1357924680");   	
       
  4166 	_LIT(KPhoneNumber2, "1234567890");   	
       
  4167 	CreateConferenceLC(iPhone, conferenceCall, line, call, 1, KPhoneNumber1, call2, 2, KPhoneNumber2);
       
  4168 
       
  4169 	res = conferenceCall.GetCaps(caps);
       
  4170 	ASSERT_EQUALS(KErrNone, res);
       
  4171 	ASSERT_EQUALS(static_cast<TUint32>(RMobileConferenceCall::KCapsSwap |
       
  4172             RMobileConferenceCall::KCapsHangUp), caps);
       
  4173 
       
  4174 	AssertMockLtsyStatusL();
       
  4175 	CleanupStack::PopAndDestroy(5, this); // call2, call, line, conferenceCall, this
       
  4176 	
       
  4177 	}
       
  4178 
       
  4179 
       
  4180 /**
       
  4181 @SYMTestCaseID BA-CTSY-CONC-CGMCI-0001
       
  4182 @SYMComponent  telephony_ctsy
       
  4183 @SYMTestCaseDesc Test support in CTSY for RMobileConferenceCall::GetMobileCallInfo
       
  4184 @SYMTestPriority High
       
  4185 @SYMTestActions Invokes RMobileConferenceCall::GetMobileCallInfo
       
  4186 @SYMTestExpectedResults Pass
       
  4187 @SYMTestType CT
       
  4188 */
       
  4189 void CCTsyConferenceCallControlFU::TestGetMobileCallInfo0001L()
       
  4190 	{
       
  4191 
       
  4192 	OpenEtelServerL(EUseExtendedError);
       
  4193 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  4194 	OpenPhoneL();
       
  4195 
       
  4196 	RMobileConferenceCall conferenceCall;
       
  4197 	OpenConferenceLC(conferenceCall, iPhone);
       
  4198 	
       
  4199 	//-------------------------------------------------------------------------
       
  4200 	// TEST: Send request of RMobileConferenceCall::GetMobileCallInfo
       
  4201 	// when conference is idle
       
  4202  	//-------------------------------------------------------------------------
       
  4203 	
       
  4204 	RMobileCall::TMobileCallInfoV1 info; 
       
  4205 	RMobileCall::TMobileCallInfoV1Pckg infoPckg(info); 
       
  4206 	TInt res = conferenceCall.GetMobileCallInfo(0, infoPckg);
       
  4207 	ASSERT_EQUALS(KErrNotReady, res);
       
  4208 	
       
  4209 	//-------------------------------------------------------------------------
       
  4210 	// TEST C1: Successful completion request of
       
  4211 	// RMobileConferenceCall::GetMobileCallInfo
       
  4212 	// when conference is active
       
  4213  	//-------------------------------------------------------------------------
       
  4214 
       
  4215 	// create conference
       
  4216 	RLine line;
       
  4217 	OpenLineLC(line);
       
  4218 
       
  4219 	// open first call
       
  4220 	RCall call;
       
  4221 	TName callName1;
       
  4222 	OpenNewCallLC(call, line, &callName1);
       
  4223 	// dial first call (status hold)
       
  4224 	_LIT(KPhoneNumber1, "1357924680");   	
       
  4225 	DialL(call, 1, RMobilePhone::EVoiceService, KPhoneNumber1);
       
  4226 	ChangeCallStatusL(1, RMobileCall::EStatusHold);
       
  4227 
       
  4228 	// create a hold call out of the conference (just for increase coverage)
       
  4229 	RCall call3;
       
  4230 	OpenNewCallLC(call3, line);
       
  4231 	_LIT(KPhoneNumber3, "3333333330");   	
       
  4232 	DialL(call3, 3, RMobilePhone::EVoiceService, KPhoneNumber3);
       
  4233 	ChangeCallStatusL(3, RMobileCall::EStatusHold);
       
  4234 	
       
  4235 	// open second call
       
  4236 	RCall call2;
       
  4237 	TName callName2;
       
  4238 	OpenNewCallLC(call2, line, &callName2);
       
  4239 	// dial second call (status connected)
       
  4240 	_LIT(KPhoneNumber2, "1234567890");   	
       
  4241 	DialL(call2, 2, RMobilePhone::EVoiceService, KPhoneNumber2);
       
  4242 	ChangeCallStatusL(2, RMobileCall::EStatusConnected);
       
  4243 
       
  4244 	// create conference
       
  4245 	iMockLTSY.ExpectL(EMobileConferenceCallCreateConference);
       
  4246 	TRequestStatus reqStatus;
       
  4247 	conferenceCall.CreateConference(reqStatus);
       
  4248 	
       
  4249 	// connect first call
       
  4250 	ChangeCallStatusL(1, RMobileCall::EStatusConnected);
       
  4251 	// update second call status
       
  4252 	ChangeCallStatusL(2, RMobileCall::EStatusConnected);
       
  4253 
       
  4254 	// conference is created here
       
  4255 	User::WaitForRequest(reqStatus);
       
  4256 	ASSERT_EQUALS(KErrNone, reqStatus.Int());
       
  4257 
       
  4258 	AssertMockLtsyStatusL();
       
  4259 	
       
  4260 	sleep(2);
       
  4261 	
       
  4262 	// test (get info for 2nd call (index = 1))
       
  4263 	res = conferenceCall.GetMobileCallInfo(1, infoPckg);
       
  4264 	ASSERT_EQUALS(KErrNone, res);
       
  4265     ASSERT_EQUALS(static_cast<TUint32>(RMobileCall::KCallStartTime | 
       
  4266 	                                   RMobileCall::KCallDuration | 
       
  4267 	                                   RMobileCall::KCallId | 
       
  4268 	                                   RMobileCall::KCallExitCode | 
       
  4269 	                                   RMobileCall::KCallEmergency |
       
  4270 	                                   RMobileCall::KCallRemoteParty |
       
  4271 	                                   RMobileCall::KCallDialledParty |
       
  4272 	                                   RMobileCall::KCallAlternating), info.iValid);
       
  4273     ASSERT_EQUALS(callName2, info.iCallName);
       
  4274     ASSERT_TRUE( 0 == KMmTsyVoice1LineName().Compare(info.iLineName) );
       
  4275     ASSERT_EQUALS(RMobileCall::EStatusConnected, info.iStatus);
       
  4276     const TDateTime KZeroTime(0,TMonth(0),0,0,0,0,0);
       
  4277     ASSERT_EQUALS(0, memcmp( &info.iStartTime, &KZeroTime, sizeof(KZeroTime)));
       
  4278     ASSERT_TRUE( TTimeIntervalSeconds(0) == info.iDuration );
       
  4279     ASSERT_EQUALS(2, info.iCallId);
       
  4280     ASSERT_EQUALS(0, info.iExitCode);
       
  4281     ASSERT_EQUALS(0, info.iEmergency);
       
  4282     ASSERT_EQUALS(RMobilePhone::EAlternatingModeUnspecified, info.iAlternatingCall);
       
  4283     ASSERT_EQUALS(RMobileCall::ERemoteIdentityUnknown, info.iRemoteParty.iRemoteIdStatus);
       
  4284     ASSERT_EQUALS(RMobileCall::EMobileOriginated, info.iRemoteParty.iDirection);
       
  4285     ASSERT_EQUALS(RMobilePhone::EUnknownNumber, info.iRemoteParty.iRemoteNumber.iTypeOfNumber);
       
  4286     ASSERT_EQUALS(RMobilePhone::EUnknownNumberingPlan, info.iRemoteParty.iRemoteNumber.iNumberPlan);
       
  4287     ASSERT_EQUALS(0, info.iRemoteParty.iRemoteNumber.iTelNumber.Size());
       
  4288     ASSERT_EQUALS(0, info.iRemoteParty.iCallingName.Size());
       
  4289     ASSERT_EQUALS(RMobilePhone::EUnknownNumber, info.iDialledParty.iTypeOfNumber);
       
  4290     ASSERT_EQUALS(RMobilePhone::EUnknownNumberingPlan, info.iDialledParty.iNumberPlan);
       
  4291     ASSERT_TRUE( 0 == KPhoneNumber2().Compare(info.iDialledParty.iTelNumber) );
       
  4292     ASSERT_EQUALS(RMobilePhone::EVoiceService, info.iService);
       
  4293 	AssertMockLtsyStatusL();
       
  4294 
       
  4295     //-------------------------------------------------------------------------
       
  4296 	// TEST C2: Successful completion request of
       
  4297 	// RMobileConferenceCall::GetMobileCallInfo
       
  4298 	// when conference is hold
       
  4299 	//-------------------------------------------------------------------------
       
  4300 
       
  4301 	// swap conference 
       
  4302 	iMockLTSY.ExpectL(EMobileConferenceCallSwap);
       
  4303 	conferenceCall.Swap(reqStatus);
       
  4304 
       
  4305 	ChangeCallStatusL(3, RMobileCall::EStatusConnected);
       
  4306 	ChangeCallStatusL(1, RMobileCall::EStatusHold);
       
  4307 	ChangeCallStatusL(2, RMobileCall::EStatusHold);
       
  4308 	
       
  4309 	User::WaitForRequest(reqStatus);
       
  4310 	ASSERT_EQUALS(KErrNone, reqStatus.Int());
       
  4311 	AssertMockLtsyStatusL();
       
  4312 	
       
  4313 	// test (get info for 1st call (index = 0))
       
  4314 	res = conferenceCall.GetMobileCallInfo(0, infoPckg);
       
  4315 	ASSERT_EQUALS(KErrNone, res);
       
  4316     ASSERT_EQUALS(static_cast<TUint32>(RMobileCall::KCallStartTime | 
       
  4317 	                                   RMobileCall::KCallDuration | 
       
  4318 	                                   RMobileCall::KCallId | 
       
  4319 	                                   RMobileCall::KCallExitCode | 
       
  4320 	                                   RMobileCall::KCallEmergency |
       
  4321 	                                   RMobileCall::KCallRemoteParty |
       
  4322 	                                   RMobileCall::KCallDialledParty |
       
  4323 	                                   RMobileCall::KCallAlternating), info.iValid);
       
  4324     ASSERT_EQUALS(callName1, info.iCallName);
       
  4325     ASSERT_TRUE( 0 == KMmTsyVoice1LineName().Compare(info.iLineName) );
       
  4326     ASSERT_EQUALS(RMobileCall::EStatusHold, info.iStatus);
       
  4327     ASSERT_EQUALS(0, memcmp( &info.iStartTime, &KZeroTime, sizeof(KZeroTime)));
       
  4328     ASSERT_TRUE( TTimeIntervalSeconds(0) == info.iDuration );
       
  4329     ASSERT_EQUALS(1, info.iCallId);
       
  4330     ASSERT_EQUALS(0, info.iExitCode);
       
  4331     ASSERT_EQUALS(0, info.iEmergency);
       
  4332     ASSERT_EQUALS(RMobilePhone::EAlternatingModeUnspecified, info.iAlternatingCall);
       
  4333     ASSERT_EQUALS(RMobileCall::ERemoteIdentityUnknown, info.iRemoteParty.iRemoteIdStatus);
       
  4334     ASSERT_EQUALS(RMobileCall::EMobileOriginated, info.iRemoteParty.iDirection);
       
  4335     ASSERT_EQUALS(RMobilePhone::EUnknownNumber, info.iRemoteParty.iRemoteNumber.iTypeOfNumber);
       
  4336     ASSERT_EQUALS(RMobilePhone::EUnknownNumberingPlan, info.iRemoteParty.iRemoteNumber.iNumberPlan);
       
  4337     ASSERT_EQUALS(0, info.iRemoteParty.iRemoteNumber.iTelNumber.Size());
       
  4338     ASSERT_EQUALS(0, info.iRemoteParty.iCallingName.Size());
       
  4339     ASSERT_EQUALS(RMobilePhone::EUnknownNumber, info.iDialledParty.iTypeOfNumber);
       
  4340     ASSERT_EQUALS(RMobilePhone::EUnknownNumberingPlan, info.iDialledParty.iNumberPlan);
       
  4341     ASSERT_TRUE( 0 == KPhoneNumber1().Compare(info.iDialledParty.iTelNumber) );
       
  4342     ASSERT_EQUALS(RMobilePhone::EVoiceService, info.iService);
       
  4343 
       
  4344 	AssertMockLtsyStatusL();
       
  4345 	CleanupStack::PopAndDestroy(6, this); // call2, call3, call, line, conferenceCall, this
       
  4346 	}
       
  4347 
       
  4348 
       
  4349 /**
       
  4350 @SYMTestCaseID BA-CTSY-CONC-CGMCI-0003
       
  4351 @SYMComponent  telephony_ctsy
       
  4352 @SYMTestCaseDesc Test support in CTSY for RMobileConferenceCall::GetMobileCallInfo with bad parameter data
       
  4353 @SYMTestPriority High
       
  4354 @SYMTestActions Invokes RMobileConferenceCall::GetMobileCallInfo with bad parameter data
       
  4355 @SYMTestExpectedResults Pass
       
  4356 @SYMTestType CT
       
  4357 */
       
  4358 void CCTsyConferenceCallControlFU::TestGetMobileCallInfo0003L()
       
  4359 	{
       
  4360 
       
  4361 	OpenEtelServerL(EUseExtendedError);
       
  4362 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  4363 	OpenPhoneL();
       
  4364 
       
  4365 	RMobileConferenceCall conferenceCall;
       
  4366 	OpenConferenceLC(conferenceCall, iPhone);
       
  4367 
       
  4368 	// create conference
       
  4369 	RLine line;
       
  4370 	RCall call;
       
  4371 	RCall call2;
       
  4372 	_LIT(KPhoneNumber1, "1357924680");
       
  4373 	_LIT(KPhoneNumber2, "1234567890");
       
  4374 	CreateConferenceLC(iPhone, conferenceCall, line, call, 1, KPhoneNumber1, call2, 2, KPhoneNumber2);
       
  4375 
       
  4376 	//-------------------------------------------------------------------------
       
  4377 	// Test C: Test passing out of bounds parameters to
       
  4378 	// RMobileConferenceCall::GetMobileCallInfo
       
  4379  	//-------------------------------------------------------------------------
       
  4380 
       
  4381 	RMobileCall::TMobileCallInfoV1 info; 
       
  4382 	RMobileCall::TMobileCallInfoV1Pckg infoPckg(info); 
       
  4383 	TInt res = conferenceCall.GetMobileCallInfo(2, infoPckg); //wrong index
       
  4384 	ASSERT_EQUALS(KErrNotFound, res);
       
  4385 	AssertMockLtsyStatusL();
       
  4386 
       
  4387 	//-------------------------------------------------------------------------
       
  4388 	// Test B: Test passing wrong descriptor size to parameter in
       
  4389 	// RMobileConferenceCall::GetMobileCallInfo
       
  4390  	//-------------------------------------------------------------------------
       
  4391 
       
  4392 	ERR_PRINTF2(_L("<font color=Orange>$CTSYKnownFailure: defect id = %d</font>"), 201701);	
       
  4393     ASSERT_TRUE(EFalse);
       
  4394 
       
  4395 	TBuf8<1> smallSizeBuf;
       
  4396 	res = conferenceCall.GetMobileCallInfo(0, smallSizeBuf);
       
  4397     ASSERT_TRUE(KErrNone != res);
       
  4398 	AssertMockLtsyStatusL();
       
  4399 
       
  4400 	CleanupStack::PopAndDestroy(5, this); // call2, call, line, conferenceCall, this
       
  4401 
       
  4402 	}
       
  4403 
       
  4404 
       
  4405 void CCTsyConferenceCallControlFU::CreateConferenceLC(RPhone& aPhone,
       
  4406 		RMobileConferenceCall& aConferenceCall,
       
  4407 		RLine& aLine,
       
  4408 		RCall& aCall,
       
  4409 		TInt aCallId1,
       
  4410 		const TDesC &aTelNumber1,
       
  4411 		RCall& aCall2,
       
  4412 		TInt aCallId2,
       
  4413 		const TDesC &aTelNumber2)
       
  4414 	{
       
  4415 
       
  4416 	TInt errorCode = aLine.Open(aPhone, KMmTsyVoice1LineName);
       
  4417 	ASSERT_EQUALS(KErrNone, errorCode)
       
  4418 	CleanupClosePushL(aLine);
       
  4419 
       
  4420 	// open first call
       
  4421 	OpenNewCallLC(aCall, aLine);
       
  4422 
       
  4423 	// dial first call (status hold)
       
  4424 	DialL(aCall, aCallId1, RMobilePhone::EVoiceService, aTelNumber1);
       
  4425 	ChangeCallStatusL(aCallId1, RMobileCall::EStatusHold);
       
  4426 	
       
  4427 	// open second call
       
  4428 	OpenNewCallLC(aCall2, aLine);
       
  4429 
       
  4430 	// dial second call (status connected)
       
  4431 	DialL(aCall2, aCallId2, RMobilePhone::EVoiceService, aTelNumber2);
       
  4432 	ChangeCallStatusL(aCallId2, RMobileCall::EStatusConnected);
       
  4433 
       
  4434 	// create conference
       
  4435 	iMockLTSY.ExpectL(EMobileConferenceCallCreateConference);
       
  4436 	TRequestStatus reqStatus;
       
  4437 	aConferenceCall.CreateConference(reqStatus);
       
  4438 	
       
  4439 	// connect first call
       
  4440 	ChangeCallStatusL(aCallId1, RMobileCall::EStatusConnected);
       
  4441 	// update second call status
       
  4442 	ChangeCallStatusL(aCallId2, RMobileCall::EStatusConnected);
       
  4443 
       
  4444 	// conference is created here
       
  4445 	User::WaitForRequest(reqStatus);
       
  4446 	ASSERT_EQUALS(KErrNone, reqStatus.Int());
       
  4447 
       
  4448 	AssertMockLtsyStatusL();
       
  4449 
       
  4450 	}
       
  4451 
       
  4452 void CCTsyConferenceCallControlFU::OpenConferenceLC(RMobileConferenceCall& aConferenceCall, RMobilePhone& aPhone)
       
  4453 	{
       
  4454 	TInt res = aConferenceCall.Open(aPhone);
       
  4455 	ASSERT_EQUALS(KErrNone, res);
       
  4456 	CleanupClosePushL(aConferenceCall);
       
  4457 	}
       
  4458 
       
  4459 void CCTsyConferenceCallControlFU::OpenLineLC(RLine& aLine, const TDesC& aName)
       
  4460 	{
       
  4461 	CCtsyComponentTestBase::OpenLineLC(aLine, aName);
       
  4462 	}
       
  4463 
       
  4464 void CCTsyConferenceCallControlFU::OpenNewCallLC(RCall& aCall, RLine& aLine, TDes* aCallName)
       
  4465 	{
       
  4466 	TInt res;
       
  4467 	if (aCallName)
       
  4468 		{
       
  4469 		res = aCall.OpenNewCall(aLine, *aCallName);
       
  4470 		}
       
  4471 	else
       
  4472 		{
       
  4473 		res = aCall.OpenNewCall(aLine);
       
  4474 		}
       
  4475 	ASSERT_EQUALS(KErrNone, res);
       
  4476 	CleanupClosePushL(aCall);
       
  4477 	}
       
  4478 
       
  4479 void CCTsyConferenceCallControlFU::ChangeConferenceCallStatusL(const RArray<TInt>& aCallsInConference, RMobileCall::TMobileCallStatus aCallStatus)
       
  4480 	{
       
  4481 	TInt count = aCallsInConference.Count();
       
  4482 	
       
  4483 	for(TInt i=0; i<count; ++i)
       
  4484 		{
       
  4485 		ChangeCallStatusL(aCallsInConference[i], aCallStatus);
       
  4486 		}
       
  4487 	}
       
  4488 
       
  4489 void CCTsyConferenceCallControlFU::MakeCallAndAddToConferenceLC(
       
  4490 		RCall& aCall,
       
  4491 		RLine& aLine,
       
  4492 		RMobileConferenceCall& aConferenceCall,
       
  4493 		TInt aCallId,
       
  4494 		const TDesC &aTelNumber,
       
  4495 		const RArray<TInt>& aCallsInConference)
       
  4496 	{
       
  4497 	// First put the conference call on hold
       
  4498 	ChangeConferenceCallStatusL(aCallsInConference, RMobileCall::EStatusHold);
       
  4499 
       
  4500 	TName callName;
       
  4501 	OpenNewCallLC(aCall, aLine, &callName);
       
  4502 	DialL(aCall, aCallId, RMobilePhone::EVoiceService, aTelNumber);
       
  4503 	// Apply all expected status changes so that capabilities can be assigned correctly
       
  4504 	ChangeCallStatusL(aCallId, RMobileCall::EStatusConnecting);
       
  4505 	ChangeCallStatusL(aCallId, RMobileCall::EStatusConnected);
       
  4506 	AddCallL(aConferenceCall, aCallId, callName, aCallsInConference);
       
  4507 	}
       
  4508 
       
  4509 void CCTsyConferenceCallControlFU::ChangeCallStatusL(TInt aCallId,
       
  4510 		RMobileCall::TMobileCallStatus aCallStatus)
       
  4511 	{
       
  4512 	CCtsyComponentTestBase::ChangeCallStatusL(aCallId, RMobilePhone::EVoiceService, aCallStatus);
       
  4513 	}
       
  4514 
       
  4515 void CCTsyConferenceCallControlFU::ChangeCallStatusInOrderL(TInt aStartCallId, TInt aEndCallId, RMobileCall::TMobileCallStatus aCallStatus)
       
  4516 	{
       
  4517 	for(TInt i=aStartCallId; i<=aEndCallId; ++i)
       
  4518 		{
       
  4519 		ChangeCallStatusL(i, aCallStatus);
       
  4520 		}
       
  4521 	}
       
  4522 
       
  4523 void CCTsyConferenceCallControlFU::ConnectAndPutCallOnHoldInRightOrderL(TInt aCallId)
       
  4524 	{
       
  4525 	// a call cannot go from Idle state to Hold state directly
       
  4526 	// change the status of call in order below so that right capabilities can be assigned
       
  4527 	ChangeCallStatusL(aCallId, RMobileCall::EStatusConnecting);
       
  4528 	ChangeCallStatusL(aCallId, RMobileCall::EStatusConnected);
       
  4529 	ChangeCallStatusL(aCallId, RMobileCall::EStatusHold);
       
  4530 	}
       
  4531 
       
  4532 void CCTsyConferenceCallControlFU::AddCallL(RMobileConferenceCall& aConferenceCall,
       
  4533 	                                        TInt aCallId,
       
  4534 	                                        const TName& aCallName,
       
  4535 	                                        const RArray<TInt>& aCallsInConference)
       
  4536 	{
       
  4537 
       
  4538 	// prepare add call request
       
  4539 	RBuf8 data;
       
  4540 	data.CleanupClosePushL();
       
  4541 
       
  4542 	TMockLtsyCallData0 emptyCallDataServiceUnspecified(aCallId, RMobilePhone::EServiceUnspecified);
       
  4543 	emptyCallDataServiceUnspecified.SerialiseL(data);
       
  4544 	iMockLTSY.ExpectL(EMobileConferenceCallAddCall, data);
       
  4545 
       
  4546 	CleanupStack::PopAndDestroy(&data);
       
  4547 
       
  4548 	// send request
       
  4549 	TRequestStatus reqStatus;
       
  4550 	aConferenceCall.AddCall(reqStatus, aCallName);
       
  4551 	
       
  4552 	// First make the conference call active
       
  4553 	ChangeConferenceCallStatusL(aCallsInConference, RMobileCall::EStatusConnected);
       
  4554 	
       
  4555 	// request is now completed
       
  4556 	User::WaitForRequest(reqStatus);
       
  4557 	ASSERT_EQUALS(KErrNone, reqStatus.Int());
       
  4558 
       
  4559 	AssertMockLtsyStatusL();
       
  4560 
       
  4561 	}