author | Oscar Gonzalez <oscar.1.gonzalez@nokia.com> |
Wed, 02 Jun 2010 16:33:50 +0100 | |
branch | opencode |
changeset 32 | 58332560b319 |
parent 24 | 6638e7f4bd8f |
permissions | -rw-r--r-- |
24 | 1 |
// Copyright (c) 2008-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 CallControlMultipartyControl in the Common TSY. |
|
15 |
// |
|
16 |
||
17 |
||
18 |
||
19 |
/** |
|
20 |
@file |
|
21 |
*/ |
|
22 |
||
23 |
#include "cctsycallcontrolmultipartyfu.h" |
|
24 |
#include "mockltsyindicatorids.h" |
|
25 |
||
26 |
#include <etel.h> |
|
27 |
#include <etelmm.h> |
|
28 |
#include <et_clsvr.h> |
|
29 |
#include <ctsy/mmtsy_names.h> |
|
30 |
#include <ctsy/serviceapi/mmtsy_ipcdefs.h> |
|
31 |
#include <test/tmockltsydata.h> |
|
32 |
#include <ctsy/serviceapi/gsmerror.h> |
|
33 |
#include <ctsy/ltsy/mltsydispatchcallcontrolmultipartyinterface.h> |
|
34 |
#include <ctsy/ltsy/mltsydispatchcallcontrolinterface.h> |
|
35 |
||
36 |
CTestSuite* CCTsyCallControlMultipartyFU::CreateSuiteL(const TDesC& aName) |
|
37 |
{ |
|
38 |
SUB_SUITE; |
|
39 |
||
40 |
//add use-case tests |
|
41 |
ADD_TEST_STEP_ISO_CPP(CCTsyCallControlMultipartyFU, TestUseCase0001L); |
|
42 |
ADD_TEST_STEP_ISO_CPP(CCTsyCallControlMultipartyFU, TestUseCase0002L); |
|
43 |
ADD_TEST_STEP_ISO_CPP(CCTsyCallControlMultipartyFU, TestUseCase0003L); |
|
44 |
ADD_TEST_STEP_ISO_CPP(CCTsyCallControlMultipartyFU, TestUseCase0004L); |
|
45 |
ADD_TEST_STEP_ISO_CPP(CCTsyCallControlMultipartyFU, TestUseCase0005L); |
|
46 |
ADD_TEST_STEP_ISO_CPP(CCTsyCallControlMultipartyFU, TestUseCase0006L); |
|
47 |
ADD_TEST_STEP_ISO_CPP(CCTsyCallControlMultipartyFU, TestUseCase0007L); |
|
48 |
ADD_TEST_STEP_ISO_CPP(CCTsyCallControlMultipartyFU, TestUseCase0008L); |
|
49 |
ADD_TEST_STEP_ISO_CPP(CCTsyCallControlMultipartyFU, TestUseCase0009L); |
|
50 |
ADD_TEST_STEP_ISO_CPP(CCTsyCallControlMultipartyFU, TestUseCase0010L); |
|
51 |
ADD_TEST_STEP_ISO_CPP(CCTsyCallControlMultipartyFU, TestUseCase0011L); |
|
52 |
||
53 |
//add other unit tests |
|
54 |
ADD_TEST_STEP_ISO_CPP(CCTsyCallControlMultipartyFU, TestUnit0001L); |
|
55 |
||
56 |
END_SUITE; |
|
57 |
} |
|
58 |
||
59 |
||
60 |
// |
|
61 |
// Use-case tests |
|
62 |
// |
|
63 |
||
64 |
/** |
|
65 |
@SYMTestCaseID BA-CTSYD-DIS-CALLCONTROLMULTIPARTY-UC0001 |
|
66 |
@SYMComponent telephony_ctsy |
|
67 |
@SYMTestCaseDesc Test support in CTSY for creating a multiparty conference call |
|
68 |
@SYMTestPriority High |
|
69 |
@SYMTestActions Invokes dialling two calls and creating a conference call |
|
70 |
@SYMTestExpectedResults Pass |
|
71 |
@SYMTestType CT |
|
72 |
*/ |
|
73 |
void CCTsyCallControlMultipartyFU::TestUseCase0001L() |
|
74 |
{ |
|
75 |
OpenEtelServerL(EUseExtendedError); |
|
76 |
CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
|
77 |
OpenPhoneL(); |
|
78 |
||
79 |
TInt callId1 = 1; |
|
80 |
TInt callId2 = 2; |
|
81 |
RMobilePhone::TMobileService mobileService = RMobilePhone::EVoiceService; |
|
82 |
DriverCreateConferenceCallL(mobileService, callId1, callId2); |
|
83 |
||
84 |
RBuf8 data; |
|
85 |
CleanupClosePushL(data); |
|
86 |
||
87 |
RArray<TInt> callIds; |
|
88 |
CleanupClosePushL( callIds ); |
|
89 |
callIds.AppendL( callId1 ); |
|
90 |
callIds.AppendL( callId2 ); |
|
91 |
||
92 |
TMockLtsyData1<RArray<TInt> > ltsyData(callIds); |
|
93 |
ltsyData.SerialiseL(data); |
|
94 |
||
95 |
iMockLTSY.ExpectL(MLtsyDispatchCallControlMultipartyConferenceHangUp::KLtsyDispatchCallControlMultipartyConferenceHangUpApiId, data); |
|
96 |
iMockLTSY.CompleteL(MLtsyDispatchCallControlMultipartyConferenceHangUp::KLtsyDispatchCallControlMultipartyConferenceHangUpApiId, KErrNone); |
|
97 |
||
98 |
DriverCompleteSuccessfulHangUpNotificationsL(callId1, EFalse, KErrGsmCCNormalCallClearing, EFalse); |
|
99 |
DriverCompleteSuccessfulHangUpNotificationsL(callId2, EFalse, KErrGsmCCNormalCallClearing); |
|
100 |
||
101 |
// Client side test |
|
102 |
||
103 |
RMobileLine mobileLine; |
|
104 |
CleanupClosePushL(mobileLine); |
|
105 |
RMobileCall mobileCall; |
|
106 |
CleanupClosePushL(mobileCall); |
|
107 |
||
108 |
RMobileLine mobileLine2; |
|
109 |
CleanupClosePushL(mobileLine2); |
|
110 |
RMobileCall mobileCall2; |
|
111 |
CleanupClosePushL(mobileCall2); |
|
112 |
||
113 |
ClientDialAndHoldFirstCallDialSecondCallL(mobileService, mobileCall, mobileLine, |
|
114 |
mobileCall2, mobileLine2); |
|
115 |
||
116 |
RMobileConferenceCall confCall; |
|
117 |
CleanupClosePushL(confCall); |
|
118 |
||
119 |
ClientCreateConferenceCallL(confCall); |
|
120 |
||
121 |
TRequestStatus notifyConfStatus; |
|
122 |
RMobileConferenceCall::TMobileConferenceStatus confStatus; |
|
123 |
confCall.NotifyConferenceStatusChange(notifyConfStatus, confStatus); |
|
124 |
||
125 |
RMobileConferenceCall::TMobileConferenceEvent confEvent; |
|
126 |
TName callName; |
|
127 |
TRequestStatus notifyConfEventStatus; |
|
128 |
confCall.NotifyConferenceEvent(notifyConfEventStatus, confEvent, callName); |
|
129 |
||
130 |
TRequestStatus hangupStatus; |
|
131 |
confCall.HangUp(hangupStatus); |
|
132 |
||
133 |
User::WaitForRequest(notifyConfEventStatus); |
|
134 |
ASSERT_EQUALS(KErrNone, notifyConfEventStatus.Int()); |
|
135 |
ASSERT_EQUALS(RMobileConferenceCall::EConferenceCallRemoved, confEvent); |
|
136 |
confCall.NotifyConferenceEvent(notifyConfEventStatus, confEvent, callName); |
|
137 |
||
138 |
User::WaitForRequest(notifyConfEventStatus); |
|
139 |
ASSERT_EQUALS(KErrNone, notifyConfEventStatus.Int()); |
|
140 |
ASSERT_EQUALS(RMobileConferenceCall::EConferenceCallRemoved, confEvent); |
|
141 |
||
142 |
User::WaitForRequest(notifyConfStatus); |
|
143 |
ASSERT_EQUALS(KErrNone, notifyConfStatus.Int()); |
|
144 |
ASSERT_EQUALS(RMobileConferenceCall::EConferenceIdle, confStatus); |
|
145 |
||
146 |
User::WaitForRequest(hangupStatus); |
|
147 |
ASSERT_EQUALS(KErrNone, hangupStatus.Int()); |
|
148 |
||
32
58332560b319
Bring opencode branch up-to-date with latest cellularsrv changes
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents:
24
diff
changeset
|
149 |
// NOTE: Adopting User::After(50000) in here is because of test harness failure in the SMP (naviengine). |
58332560b319
Bring opencode branch up-to-date with latest cellularsrv changes
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents:
24
diff
changeset
|
150 |
// The ETel server is closing a tel object by an Active Object (CAsyncOneShot), there can be out of ordered closes in SMP. |
58332560b319
Bring opencode branch up-to-date with latest cellularsrv changes
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents:
24
diff
changeset
|
151 |
// Since the MockLtsy is expecting exact order of test procedure, this can be regarded as an error but it is not a part of intended testing. |
58332560b319
Bring opencode branch up-to-date with latest cellularsrv changes
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents:
24
diff
changeset
|
152 |
// Therefore this waiting function calls are required to close the tel objects in perfect order. |
24 | 153 |
confCall.Close(); |
154 |
User::After(50000); |
|
155 |
mobileCall.Close(); |
|
156 |
User::After(50000); |
|
157 |
mobileCall2.Close(); |
|
158 |
User::After(50000); |
|
159 |
||
160 |
AssertMockLtsyStatusL(); |
|
161 |
CleanupStack::PopAndDestroy(8, this); |
|
162 |
} // CCTsyCallControlMultipartyFU::TestUseCase0001L |
|
163 |
||
164 |
/** |
|
165 |
@SYMTestCaseID BA-CTSYD-DIS-CALLCONTROLMULTIPARTY-UC0002 |
|
166 |
@SYMComponent telephony_ctsy |
|
167 |
@SYMTestCaseDesc Test support in CTSY for failure to create a conference call |
|
168 |
@SYMTestPriority High |
|
169 |
@SYMTestActions Invokes dialling two calls and attempting to create a conference call |
|
170 |
@SYMTestExpectedResults Pass |
|
171 |
@SYMTestType CT |
|
172 |
*/ |
|
173 |
void CCTsyCallControlMultipartyFU::TestUseCase0002L() |
|
174 |
{ |
|
175 |
OpenEtelServerL(EUseExtendedError); |
|
176 |
CleanupStack::PushL(TCleanupItem(Cleanup, this)); |
|
177 |
OpenPhoneL(); |
|
178 |
||
179 |
RBuf8 data; |
|
180 |
CleanupClosePushL(data); |
|
181 |
||
182 |
TInt callId1 = 1; |
|
183 |
TInt callId2 = 2; |
|
184 |
RMobilePhone::TMobileService mobileService = RMobilePhone::EVoiceService; |
|
185 |
DriverDialAndHoldFirstCallDialSecondCallL(mobileService, callId1, callId2); |
|
186 |
TMockLtsyData2<TInt, TInt> createConfData(callId1, callId2); |
|
187 |
createConfData.SerialiseL(data); |
|
188 |
iMockLTSY.ExpectL(MLtsyDispatchCallControlMultipartyCreateConference::KLtsyDispatchCallControlMultipartyCreateConferenceApiId, data); |
|
189 |
||
190 |
iMockLTSY.CompleteL(MLtsyDispatchCallControlMultipartyCreateConference::KLtsyDispatchCallControlMultipartyCreateConferenceApiId, KErrGeneral); |
|
191 |
||
192 |
TInt hangUpCause = KErrGsmCCNormalCallClearing; // Hang up cause for normal hang up |
|
193 |
TMockLtsyData2<TInt, TInt> mockData1(callId1, hangUpCause); |
|
194 |
data.Close(); |
|
195 |
mockData1.SerialiseL(data); |
|
196 |
iMockLTSY.ExpectL(MLtsyDispatchCallControlHangUp::KLtsyDispatchCallControlHangUpApiId, data); |
|
197 |
||
198 |
TMockLtsyData2<TInt, TInt> mockData2(callId2, hangUpCause); |
|
199 |
data.Close(); |
|
200 |
mockData2.SerialiseL(data); |
|
201 |
iMockLTSY.ExpectL(MLtsyDispatchCallControlHangUp::KLtsyDispatchCallControlHangUpApiId, data); |
|
202 |
||
203 |
// Client side test |
|
204 |
||
205 |
RMobileLine mobileLine; |
|
206 |
CleanupClosePushL(mobileLine); |
|
207 |
RMobileCall mobileCall; |
|
208 |
CleanupClosePushL(mobileCall); |
|
209 |
||
210 |
RMobileLine mobileLine2; |
|
211 |
CleanupClosePushL(mobileLine2); |
|
212 |
RMobileCall mobileCall2; |
|
213 |
CleanupClosePushL(mobileCall2); |
|
214 |
||
215 |
ClientDialAndHoldFirstCallDialSecondCallL(mobileService, mobileCall, mobileLine, |
|
216 |
mobileCall2, mobileLine2); |
|
217 |
||
218 |
RMobileConferenceCall confCall; |
|
219 |
CleanupClosePushL(confCall); |
|
220 |
ASSERT_EQUALS(KErrNone, confCall.Open(iPhone)); |
|
221 |
||
222 |
TRequestStatus createConfStatus; |
|
223 |
confCall.CreateConference(createConfStatus); |
|
224 |
User::WaitForRequest(createConfStatus); |
|
225 |
ASSERT_EQUALS(KErrGeneral, createConfStatus.Int()); |
|
226 |
||
227 |
// Both calls should still be in their original state (call 1 - held, call 2 - connected) |
|
228 |
RMobileCall::TMobileCallStatus callStatus; |
|
229 |
ASSERT_EQUALS(KErrNone, mobileCall.GetMobileCallStatus(callStatus)); |
|
230 |
ASSERT_EQUALS(RMobileCall::EStatusHold, callStatus); |
|
231 |
ASSERT_EQUALS(KErrNone, mobileCall2.GetMobileCallStatus(callStatus)); |
|
232 |
ASSERT_EQUALS(RMobileCall::EStatusConnected, callStatus); |
|
233 |
||
32
58332560b319
Bring opencode branch up-to-date with latest cellularsrv changes
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents:
24
diff
changeset
|
234 |
// NOTE: Adopting User::After(50000) in here is because of test harness failure in the SMP (naviengine). |
58332560b319
Bring opencode branch up-to-date with latest cellularsrv changes
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents:
24
diff
changeset
|
235 |
// The ETel server is closing a tel object by an Active Object (CAsyncOneShot), there can be out of ordered closes in SMP. |
58332560b319
Bring opencode branch up-to-date with latest cellularsrv changes
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents:
24
diff
changeset
|
236 |
// Since the MockLtsy is expecting exact order of test procedure, this can be regarded as an error but it is not a part of intended testing. |
58332560b319
Bring opencode branch up-to-date with latest cellularsrv changes
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents:
24
diff
changeset
|
237 |
// Therefore this waiting function calls are required to close the tel objects in perfect order. |
24 | 238 |
confCall.Close(); |
239 |
User::After(50000); |
|
240 |
mobileCall.Close(); |
|
241 |
User::After(50000); |
|
242 |
mobileCall2.Close(); |
|
243 |
User::After(50000); |
|
244 |
||
245 |
AssertMockLtsyStatusL(); |
|
246 |
CleanupStack::PopAndDestroy(7, this); |
|
247 |
} // CCTsyCallControlMultipartyFU::TestUseCase0002L |
|
248 |
||
249 |
/** |
|
250 |
@SYMTestCaseID BA-CTSYD-DIS-CALLCONTROLMULTIPARTY-UC0003 |
|
251 |
@SYMComponent telephony_ctsy |
|
252 |
@SYMTestCaseDesc Test support in CTSY for failure to hang up a conference call |
|
253 |
@SYMTestPriority High |
|
254 |
@SYMTestActions Invokes RMobileConferenceCall::HangUp |
|
255 |
@SYMTestExpectedResults Pass |
|
256 |
@SYMTestType CT |
|
257 |
*/ |
|
258 |
void CCTsyCallControlMultipartyFU::TestUseCase0003L() |
|
259 |
{ |
|
260 |
OpenEtelServerL(EUseExtendedError); |
|
261 |
CleanupStack::PushL(TCleanupItem(Cleanup, this)); |
|
262 |
OpenPhoneL(); |
|
263 |
||
264 |
RBuf8 data; |
|
265 |
CleanupClosePushL(data); |
|
266 |
||
267 |
TInt callId1 = 1; |
|
268 |
TInt callId2 = 2; |
|
269 |
RMobilePhone::TMobileService mobileService = RMobilePhone::EVoiceService; |
|
270 |
DriverCreateConferenceCallL(mobileService, callId1, callId2); |
|
271 |
||
272 |
RArray<TInt> callIds; |
|
273 |
CleanupClosePushL( callIds ); |
|
274 |
callIds.AppendL( callId1 ); |
|
275 |
callIds.AppendL( callId2 ); |
|
276 |
||
277 |
TMockLtsyData1<RArray<TInt> > ltsyData(callIds); |
|
278 |
ltsyData.SerialiseL(data); |
|
279 |
||
280 |
iMockLTSY.ExpectL(MLtsyDispatchCallControlMultipartyConferenceHangUp::KLtsyDispatchCallControlMultipartyConferenceHangUpApiId, data); |
|
281 |
iMockLTSY.CompleteL(MLtsyDispatchCallControlMultipartyConferenceHangUp::KLtsyDispatchCallControlMultipartyConferenceHangUpApiId, KErrGeneral); |
|
282 |
||
283 |
// Clean up when subsessions are closed |
|
284 |
DriverCloseTwoRemotePartyConferenceAndCallSubsessionsL(callId1, callId2, callIds); |
|
285 |
||
286 |
// Client side test |
|
287 |
||
288 |
RMobileLine mobileLine; |
|
289 |
CleanupClosePushL(mobileLine); |
|
290 |
RMobileCall mobileCall; |
|
291 |
CleanupClosePushL(mobileCall); |
|
292 |
||
293 |
RMobileLine mobileLine2; |
|
294 |
CleanupClosePushL(mobileLine2); |
|
295 |
RMobileCall mobileCall2; |
|
296 |
CleanupClosePushL(mobileCall2); |
|
297 |
||
298 |
ClientDialAndHoldFirstCallDialSecondCallL(mobileService, mobileCall, mobileLine, |
|
299 |
mobileCall2, mobileLine2); |
|
300 |
||
301 |
RMobileConferenceCall confCall; |
|
302 |
CleanupClosePushL(confCall); |
|
303 |
||
304 |
ClientCreateConferenceCallL(confCall); |
|
305 |
||
306 |
TRequestStatus hangupStatus; |
|
307 |
confCall.HangUp(hangupStatus); |
|
308 |
User::WaitForRequest(hangupStatus); |
|
309 |
ASSERT_EQUALS(KErrGeneral, hangupStatus.Int()); |
|
310 |
||
311 |
// Boths calls should still be connected |
|
312 |
RMobileCall::TMobileCallStatus callStatus; |
|
313 |
ASSERT_EQUALS(KErrNone, mobileCall.GetMobileCallStatus(callStatus)); |
|
314 |
ASSERT_EQUALS(RMobileCall::EStatusConnected, callStatus); |
|
315 |
ASSERT_EQUALS(KErrNone, mobileCall2.GetMobileCallStatus(callStatus)); |
|
316 |
ASSERT_EQUALS(RMobileCall::EStatusConnected, callStatus); |
|
317 |
||
32
58332560b319
Bring opencode branch up-to-date with latest cellularsrv changes
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents:
24
diff
changeset
|
318 |
// NOTE: Adopting User::After(50000) in here is because of test harness failure in the SMP (naviengine). |
58332560b319
Bring opencode branch up-to-date with latest cellularsrv changes
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents:
24
diff
changeset
|
319 |
// The ETel server is closing a tel object by an Active Object (CAsyncOneShot), there can be out of ordered closes in SMP. |
58332560b319
Bring opencode branch up-to-date with latest cellularsrv changes
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents:
24
diff
changeset
|
320 |
// Since the MockLtsy is expecting exact order of test procedure, this can be regarded as an error but it is not a part of intended testing. |
58332560b319
Bring opencode branch up-to-date with latest cellularsrv changes
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents:
24
diff
changeset
|
321 |
// Therefore this waiting function calls are required to close the tel objects in perfect order. |
24 | 322 |
confCall.Close(); |
323 |
User::After(50000); |
|
324 |
mobileCall.Close(); |
|
325 |
User::After(50000); |
|
326 |
mobileCall2.Close(); |
|
327 |
User::After(50000); |
|
328 |
||
329 |
AssertMockLtsyStatusL(); |
|
330 |
CleanupStack::PopAndDestroy(8, this); |
|
331 |
} // CCTsyCallControlMultipartyFU::TestUseCase0003L |
|
332 |
||
333 |
/** |
|
334 |
@SYMTestCaseID BA-CTSYD-DIS-CALLCONTROLMULTIPARTY-UC0004 |
|
335 |
@SYMComponent telephony_ctsy |
|
336 |
@SYMTestCaseDesc Test support in CTSY for hang up of remote party in conference call |
|
337 |
@SYMTestPriority High |
|
338 |
@SYMTestActions Invokes creation of a 2 remote party conference call with one party hanging up therefore terminating the conference. |
|
339 |
@SYMTestExpectedResults Pass |
|
340 |
@SYMTestType CT |
|
341 |
*/ |
|
342 |
void CCTsyCallControlMultipartyFU::TestUseCase0004L() |
|
343 |
{ |
|
344 |
OpenEtelServerL(EUseExtendedError); |
|
345 |
CleanupStack::PushL(TCleanupItem(Cleanup, this)); |
|
346 |
OpenPhoneL(); |
|
347 |
||
348 |
RBuf8 data; |
|
349 |
CleanupClosePushL(data); |
|
350 |
||
351 |
TInt callId1 = 1; |
|
352 |
TInt callId2 = 2; |
|
353 |
RMobilePhone::TMobileService mobileService = RMobilePhone::EVoiceService; |
|
354 |
DriverCreateConferenceCallL(mobileService, callId1, callId2); |
|
355 |
||
356 |
TInt delayBeforeRemotePartyHangsUp = 5; |
|
357 |
DriverCompleteSuccessfulHangUpNotificationsL(callId1, EFalse, KErrGsmCCNormalCallClearing, EFalse, delayBeforeRemotePartyHangsUp); |
|
358 |
||
359 |
TInt hangUpCause = KErrGsmCCNormalCallClearing; // Hang up cause for normal hang up |
|
360 |
TMockLtsyData2<TInt, TInt> mockData2(callId2, hangUpCause); |
|
361 |
data.Close(); |
|
362 |
mockData2.SerialiseL(data); |
|
363 |
iMockLTSY.ExpectL(MLtsyDispatchCallControlHangUp::KLtsyDispatchCallControlHangUpApiId, data); |
|
364 |
||
365 |
// Client side test |
|
366 |
||
367 |
RMobileLine mobileLine; |
|
368 |
CleanupClosePushL(mobileLine); |
|
369 |
RMobileCall mobileCall; |
|
370 |
CleanupClosePushL(mobileCall); |
|
371 |
||
372 |
RMobileLine mobileLine2; |
|
373 |
CleanupClosePushL(mobileLine2); |
|
374 |
RMobileCall mobileCall2; |
|
375 |
CleanupClosePushL(mobileCall2); |
|
376 |
||
377 |
ClientDialAndHoldFirstCallDialSecondCallL(mobileService, mobileCall, mobileLine, |
|
378 |
mobileCall2, mobileLine2); |
|
379 |
||
380 |
RMobileConferenceCall confCall; |
|
381 |
CleanupClosePushL(confCall); |
|
382 |
||
383 |
ClientCreateConferenceCallL(confCall); |
|
384 |
||
385 |
TRequestStatus notifyConfStatus; |
|
386 |
RMobileConferenceCall::TMobileConferenceStatus confStatus; |
|
387 |
confCall.NotifyConferenceStatusChange(notifyConfStatus, confStatus); |
|
388 |
||
389 |
RMobileConferenceCall::TMobileConferenceEvent confEvent; |
|
390 |
TName callName; |
|
391 |
TRequestStatus notifyConfEventStatus; |
|
392 |
confCall.NotifyConferenceEvent(notifyConfEventStatus, confEvent, callName); |
|
393 |
||
394 |
// MockSY should complete queued the hang up call status change notifications now |
|
395 |
// If it doesn't, delay to simulate this above needs to be increased. |
|
396 |
||
397 |
User::WaitForRequest(notifyConfEventStatus); |
|
398 |
ASSERT_EQUALS(KErrNone, notifyConfEventStatus.Int()); |
|
399 |
ASSERT_EQUALS(RMobileConferenceCall::EConferenceCallRemoved, confEvent); |
|
400 |
confCall.NotifyConferenceEvent(notifyConfEventStatus, confEvent, callName); |
|
401 |
||
402 |
User::WaitForRequest(notifyConfEventStatus); |
|
403 |
ASSERT_EQUALS(KErrNone, notifyConfEventStatus.Int()); |
|
404 |
ASSERT_EQUALS(RMobileConferenceCall::EConferenceCallRemoved, confEvent); |
|
405 |
||
406 |
User::WaitForRequest(notifyConfStatus); |
|
407 |
ASSERT_EQUALS(KErrNone, notifyConfStatus.Int()); |
|
408 |
ASSERT_EQUALS(RMobileConferenceCall::EConferenceIdle, confStatus); |
|
409 |
||
32
58332560b319
Bring opencode branch up-to-date with latest cellularsrv changes
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents:
24
diff
changeset
|
410 |
// NOTE: Adopting User::After(50000) in here is because of test harness failure in the SMP (naviengine). |
58332560b319
Bring opencode branch up-to-date with latest cellularsrv changes
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents:
24
diff
changeset
|
411 |
// The ETel server is closing a tel object by an Active Object (CAsyncOneShot), there can be out of ordered closes in SMP. |
58332560b319
Bring opencode branch up-to-date with latest cellularsrv changes
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents:
24
diff
changeset
|
412 |
// Since the MockLtsy is expecting exact order of test procedure, this can be regarded as an error but it is not a part of intended testing. |
58332560b319
Bring opencode branch up-to-date with latest cellularsrv changes
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents:
24
diff
changeset
|
413 |
// Therefore this waiting function calls are required to close the tel objects in perfect order. |
24 | 414 |
confCall.Close(); |
415 |
User::After(50000); |
|
416 |
mobileCall.Close(); |
|
417 |
User::After(50000); |
|
418 |
mobileCall2.Close(); |
|
419 |
User::After(50000); |
|
420 |
||
421 |
AssertMockLtsyStatusL(); |
|
422 |
CleanupStack::PopAndDestroy(7, this); |
|
423 |
} // CCTsyCallControlMultipartyFU::TestUseCase0004L |
|
424 |
||
425 |
||
426 |
/** |
|
427 |
@SYMTestCaseID BA-CTSYD-DIS-CALLCONTROLMULTIPARTY-UC0005 |
|
428 |
@SYMComponent telephony_ctsy |
|
429 |
@SYMTestCaseDesc Test support in CTSY for swapping a conference call |
|
430 |
@SYMTestPriority High |
|
431 |
@SYMTestActions Invokes RMobileConferenceCall::Swap and RMobileConferenceCall::AddCall |
|
432 |
@SYMTestExpectedResults Pass |
|
433 |
@SYMTestType CT |
|
434 |
*/ |
|
435 |
void CCTsyCallControlMultipartyFU::TestUseCase0005L() |
|
436 |
{ |
|
437 |
OpenEtelServerL(EUseExtendedError); |
|
438 |
CleanupStack::PushL(TCleanupItem(Cleanup, this)); |
|
439 |
OpenPhoneL(); |
|
440 |
||
441 |
RBuf8 data; |
|
442 |
CleanupClosePushL(data); |
|
443 |
||
444 |
// This use case demonstrates swapping of conference calls. |
|
445 |
// It does the following: |
|
446 |
// - Set up a conference call with two remote parties |
|
447 |
// - Swap the conference call (when it is the only active call) |
|
448 |
// - The conference call goes on hold |
|
449 |
// - Dial a third call and add it to the conference |
|
450 |
// - The conference gets connected again with all three calls being a part of it |
|
451 |
// - Swap the conference call to put it back on hold |
|
452 |
// - Dial a fourth call |
|
453 |
// - Swap the conference call making it active and the fourth call on hold |
|
454 |
// - Close down |
|
455 |
||
456 |
TInt callId1 = 1; |
|
457 |
TInt callId2 = 2; |
|
458 |
TInt callId3 = 3; |
|
459 |
RMobilePhone::TMobileService mobileService = RMobilePhone::EVoiceService; |
|
460 |
DriverCreateConferenceWithThreeRemotePartiesL(mobileService, callId1, callId2, callId3); |
|
461 |
||
462 |
// Swapping conference call when there is no held call is the same as |
|
463 |
// holding the conference call |
|
464 |
DriverHoldCallL(callId1, KErrNone); |
|
465 |
||
466 |
// Other calls in the conference all go on hold too |
|
467 |
RMobileCall::TMobileCallStatus callStatus = RMobileCall::EStatusHold; |
|
468 |
TMockLtsyCallData1<RMobileCall::TMobileCallStatus> mockCallData6( |
|
469 |
callId2, RMobilePhone::EServiceUnspecified, callStatus); |
|
470 |
data.Close(); |
|
471 |
mockCallData6.SerialiseL(data); |
|
472 |
iMockLTSY.CompleteL(KMockLtsyDispatchCallControlNotifyCallStatusChangeIndId, KErrNone, data); |
|
473 |
||
474 |
TMockLtsyCallData1<RMobileCall::TMobileCallStatus> mockCallData7( |
|
475 |
callId3, RMobilePhone::EServiceUnspecified, callStatus); |
|
476 |
data.Close(); |
|
477 |
mockCallData7.SerialiseL(data); |
|
478 |
iMockLTSY.CompleteL(KMockLtsyDispatchCallControlNotifyCallStatusChangeIndId, KErrNone, data); |
|
479 |
||
480 |
TInt callId4 = 4; |
|
481 |
DriverDialCallL(callId4, mobileService); |
|
482 |
||
483 |
TMockLtsyData2<TInt, TInt> mockCallData12(callId1, callId4); |
|
484 |
data.Close(); |
|
485 |
mockCallData12.SerialiseL(data); |
|
486 |
iMockLTSY.ExpectL(MLtsyDispatchCallControlMultipartyConferenceSwap::KLtsyDispatchCallControlMultipartyConferenceSwapApiId, data); |
|
487 |
||
488 |
iMockLTSY.CompleteL(MLtsyDispatchCallControlMultipartyConferenceSwap::KLtsyDispatchCallControlMultipartyConferenceSwapApiId, KErrNone); |
|
489 |
||
490 |
// Call 4 goes on hold, the other three which are part of the conference become connected |
|
491 |
callStatus = RMobileCall::EStatusHold; |
|
492 |
TMockLtsyCallData1<RMobileCall::TMobileCallStatus> mockCallData8( |
|
493 |
callId4, RMobilePhone::EServiceUnspecified, callStatus); |
|
494 |
data.Close(); |
|
495 |
mockCallData8.SerialiseL(data); |
|
496 |
iMockLTSY.CompleteL(KMockLtsyDispatchCallControlNotifyCallStatusChangeIndId, KErrNone, data); |
|
497 |
||
498 |
callStatus = RMobileCall::EStatusConnected; |
|
499 |
TMockLtsyCallData1<RMobileCall::TMobileCallStatus> mockCallData9( |
|
500 |
callId1, RMobilePhone::EServiceUnspecified, callStatus); |
|
501 |
data.Close(); |
|
502 |
mockCallData9.SerialiseL(data); |
|
503 |
iMockLTSY.CompleteL(KMockLtsyDispatchCallControlNotifyCallStatusChangeIndId, KErrNone, data); |
|
504 |
||
505 |
callStatus = RMobileCall::EStatusConnected; |
|
506 |
TMockLtsyCallData1<RMobileCall::TMobileCallStatus> mockCallData10( |
|
507 |
callId2, RMobilePhone::EServiceUnspecified, callStatus); |
|
508 |
data.Close(); |
|
509 |
mockCallData10.SerialiseL(data); |
|
510 |
iMockLTSY.CompleteL(KMockLtsyDispatchCallControlNotifyCallStatusChangeIndId, KErrNone, data); |
|
511 |
||
512 |
callStatus = RMobileCall::EStatusConnected; |
|
513 |
TMockLtsyCallData1<RMobileCall::TMobileCallStatus> mockCallData11( |
|
514 |
callId3, RMobilePhone::EServiceUnspecified, callStatus); |
|
515 |
data.Close(); |
|
516 |
mockCallData11.SerialiseL(data); |
|
517 |
iMockLTSY.CompleteL(KMockLtsyDispatchCallControlNotifyCallStatusChangeIndId, KErrNone, data); |
|
518 |
||
519 |
RArray<TInt> callIds; |
|
520 |
CleanupClosePushL( callIds ); |
|
521 |
callIds.AppendL( callId1 ); |
|
522 |
callIds.AppendL( callId2 ); |
|
523 |
callIds.AppendL( callId3 ); |
|
524 |
||
525 |
TMockLtsyData1<RArray<TInt> > ltsyData(callIds); |
|
526 |
data.Close(); |
|
527 |
ltsyData.SerialiseL(data); |
|
528 |
||
529 |
// Tidy up at the end of the test |
|
530 |
iMockLTSY.ExpectL(MLtsyDispatchCallControlMultipartyConferenceHangUp::KLtsyDispatchCallControlMultipartyConferenceHangUpApiId, data); |
|
531 |
iMockLTSY.CompleteL(MLtsyDispatchCallControlMultipartyConferenceHangUp::KLtsyDispatchCallControlMultipartyConferenceHangUpApiId, KErrNone); |
|
532 |
||
533 |
DriverCompleteSuccessfulHangUpNotificationsL(callId1, EFalse, KErrGsmCCNormalCallClearing, EFalse); |
|
534 |
DriverCompleteSuccessfulHangUpNotificationsL(callId2, EFalse, KErrGsmCCNormalCallClearing, EFalse); |
|
535 |
DriverCompleteSuccessfulHangUpNotificationsL(callId3, EFalse, KErrGsmCCNormalCallClearing, EFalse); |
|
536 |
||
537 |
DriverCompleteSuccessfulHangUpNotificationsL(callId4, EFalse, KErrGsmCCNormalCallClearing, ETrue); |
|
538 |
||
539 |
// Client side test |
|
540 |
||
541 |
RMobileLine mobileLine; |
|
542 |
CleanupClosePushL(mobileLine); |
|
543 |
RMobileCall mobileCall; |
|
544 |
CleanupClosePushL(mobileCall); |
|
545 |
||
546 |
RMobileLine mobileLine2; |
|
547 |
CleanupClosePushL(mobileLine2); |
|
548 |
RMobileCall mobileCall2; |
|
549 |
CleanupClosePushL(mobileCall2); |
|
550 |
||
551 |
RMobileConferenceCall confCall; |
|
552 |
CleanupClosePushL(confCall); |
|
553 |
||
554 |
RMobileLine mobileLine3; |
|
555 |
CleanupClosePushL(mobileLine3); |
|
556 |
RMobileCall mobileCall3; |
|
557 |
CleanupClosePushL(mobileCall3); |
|
558 |
||
559 |
ClientCreateConferenceCallWithThreeRemotePartiesL(mobileService, mobileCall, |
|
560 |
mobileLine, mobileCall2, mobileLine2, mobileCall3, mobileLine3, confCall); |
|
561 |
||
562 |
ClientSwapConferenceCallL(confCall, RMobileConferenceCall::EConferenceSwapped, |
|
563 |
RMobileConferenceCall::EConferenceHold); |
|
564 |
||
565 |
RMobileLine mobileLine4; |
|
566 |
CleanupClosePushL(mobileLine4); |
|
567 |
RMobileCall mobileCall4; |
|
568 |
CleanupClosePushL(mobileCall4); |
|
569 |
||
570 |
ClientDialCallL(mobileLine4, mobileCall4, mobileService); |
|
571 |
||
572 |
ClientSwapConferenceCallL(confCall, RMobileConferenceCall::EConferenceSwapped, |
|
573 |
RMobileConferenceCall::EConferenceActive); |
|
574 |
||
575 |
// Call 4 should now be held |
|
576 |
ASSERT_EQUALS(KErrNone, mobileCall4.GetMobileCallStatus(callStatus)); |
|
577 |
ASSERT_EQUALS(RMobileCall::EStatusHold, callStatus); |
|
578 |
||
579 |
// Tidy up at the end of the test |
|
580 |
TRequestStatus hangupStatus; |
|
581 |
confCall.HangUp(hangupStatus); |
|
582 |
User::WaitForRequest(hangupStatus); |
|
583 |
ASSERT_EQUALS(KErrNone, hangupStatus.Int()); |
|
584 |
||
585 |
AssertMockLtsyStatusL(); |
|
586 |
CleanupStack::PopAndDestroy(12, this); |
|
587 |
} // CCTsyCallControlMultipartyFU::TestUseCase0005L |
|
588 |
||
589 |
||
590 |
/** |
|
591 |
@SYMTestCaseID BA-CTSYD-DIS-CALLCONTROLMULTIPARTY-UC0006 |
|
592 |
@SYMComponent telephony_ctsy |
|
593 |
@SYMTestCaseDesc Test support in CTSY for failure to swap a conference call |
|
594 |
@SYMTestPriority High |
|
595 |
@SYMTestActions Invokes RMobileConferenceCall::Swap |
|
596 |
@SYMTestExpectedResults Pass |
|
597 |
@SYMTestType CT |
|
598 |
*/ |
|
599 |
void CCTsyCallControlMultipartyFU::TestUseCase0006L() |
|
600 |
{ |
|
601 |
OpenEtelServerL(EUseExtendedError); |
|
602 |
CleanupStack::PushL(TCleanupItem(Cleanup, this)); |
|
603 |
OpenPhoneL(); |
|
604 |
||
605 |
RBuf8 data; |
|
606 |
CleanupClosePushL(data); |
|
607 |
||
608 |
TInt callId1 = 1; |
|
609 |
TInt callId2 = 2; |
|
610 |
RMobilePhone::TMobileService mobileService = RMobilePhone::EVoiceService; |
|
611 |
DriverCreateConferenceCallAndHoldItL(mobileService, callId1, callId2); |
|
612 |
||
613 |
TInt callId3 = 3; |
|
614 |
DriverDialCallL(callId3, mobileService); |
|
615 |
||
616 |
TMockLtsyData2<TInt, TInt> mockCallData12(callId1, callId3); |
|
617 |
data.Close(); |
|
618 |
mockCallData12.SerialiseL(data); |
|
619 |
iMockLTSY.ExpectL(MLtsyDispatchCallControlMultipartyConferenceSwap::KLtsyDispatchCallControlMultipartyConferenceSwapApiId, data); |
|
620 |
||
621 |
iMockLTSY.CompleteL(MLtsyDispatchCallControlMultipartyConferenceSwap::KLtsyDispatchCallControlMultipartyConferenceSwapApiId, KErrGeneral); |
|
622 |
||
623 |
RArray<TInt> callIds; |
|
624 |
CleanupClosePushL( callIds ); |
|
625 |
callIds.AppendL( callId1 ); |
|
626 |
callIds.AppendL( callId2 ); |
|
627 |
||
628 |
DriverCloseThreeRemotePartyConferenceAndCallSubsessionsL(callId1, callId2, callId3, callIds); |
|
629 |
||
630 |
// Client side test |
|
631 |
||
632 |
RMobileLine mobileLine; |
|
633 |
CleanupClosePushL(mobileLine); |
|
634 |
RMobileCall mobileCall; |
|
635 |
CleanupClosePushL(mobileCall); |
|
636 |
||
637 |
RMobileLine mobileLine2; |
|
638 |
CleanupClosePushL(mobileLine2); |
|
639 |
RMobileCall mobileCall2; |
|
640 |
CleanupClosePushL(mobileCall2); |
|
641 |
||
642 |
RMobileConferenceCall confCall; |
|
643 |
CleanupClosePushL(confCall); |
|
644 |
||
645 |
ClientCreateConferenceCallAndHoldItL(mobileService, mobileCall, |
|
646 |
mobileLine, mobileCall2, mobileLine2, confCall); |
|
647 |
||
648 |
// Dial a new call and attempt to swap the conference with it |
|
649 |
RMobileLine mobileLine3; |
|
650 |
CleanupClosePushL(mobileLine3); |
|
651 |
RMobileCall mobileCall3; |
|
652 |
CleanupClosePushL(mobileCall3); |
|
653 |
||
654 |
ClientDialCallL(mobileLine3, mobileCall3, mobileService); |
|
655 |
||
656 |
TRequestStatus swapStatus; |
|
657 |
confCall.Swap(swapStatus); |
|
658 |
User::WaitForRequest(swapStatus); |
|
659 |
ASSERT_EQUALS(KErrGeneral, swapStatus.Int()); |
|
660 |
||
661 |
RMobileConferenceCall::TMobileConferenceStatus confStatus; |
|
662 |
ASSERT_EQUALS(KErrNone, confCall.GetConferenceStatus(confStatus)); |
|
663 |
ASSERT_EQUALS(RMobileConferenceCall::EConferenceHold, confStatus); |
|
664 |
||
32
58332560b319
Bring opencode branch up-to-date with latest cellularsrv changes
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents:
24
diff
changeset
|
665 |
// NOTE: Adopting User::After(50000) in here is because of test harness failure in the SMP (naviengine). |
58332560b319
Bring opencode branch up-to-date with latest cellularsrv changes
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents:
24
diff
changeset
|
666 |
// The ETel server is closing a tel object by an Active Object (CAsyncOneShot), there can be out of ordered closes in SMP. |
58332560b319
Bring opencode branch up-to-date with latest cellularsrv changes
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents:
24
diff
changeset
|
667 |
// Since the MockLtsy is expecting exact order of test procedure, this can be regarded as an error but it is not a part of intended testing. |
58332560b319
Bring opencode branch up-to-date with latest cellularsrv changes
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents:
24
diff
changeset
|
668 |
// Therefore this waiting function calls are required to close the tel objects in perfect order. |
24 | 669 |
confCall.Close(); |
670 |
User::After(50000); |
|
671 |
mobileCall.Close(); |
|
672 |
User::After(50000); |
|
673 |
mobileCall2.Close(); |
|
674 |
User::After(50000); |
|
675 |
mobileCall3.Close(); |
|
676 |
User::After(50000); |
|
677 |
||
678 |
AssertMockLtsyStatusL(); |
|
679 |
CleanupStack::PopAndDestroy(10, this); |
|
680 |
} // CCTsyCallControlMultipartyFU::TestUseCase0006L |
|
681 |
||
682 |
||
683 |
/** |
|
684 |
@SYMTestCaseID BA-CTSYD-DIS-CALLCONTROLMULTIPARTY-UC0007 |
|
685 |
@SYMComponent telephony_ctsy |
|
686 |
@SYMTestCaseDesc Test support in CTSY for failure to add a call to the conference |
|
687 |
@SYMTestPriority High |
|
688 |
@SYMTestActions Invokes RMobileConferenceCall::AddCall |
|
689 |
@SYMTestExpectedResults Pass |
|
690 |
@SYMTestType CT |
|
691 |
*/ |
|
692 |
void CCTsyCallControlMultipartyFU::TestUseCase0007L() |
|
693 |
{ |
|
694 |
OpenEtelServerL(EUseExtendedError); |
|
695 |
CleanupStack::PushL(TCleanupItem(Cleanup, this)); |
|
696 |
OpenPhoneL(); |
|
697 |
||
698 |
RBuf8 data; |
|
699 |
CleanupClosePushL(data); |
|
700 |
||
701 |
TInt callId1 = 1; |
|
702 |
TInt callId2 = 2; |
|
703 |
RMobilePhone::TMobileService mobileService = RMobilePhone::EVoiceService; |
|
704 |
DriverCreateConferenceCallAndHoldItL(mobileService, callId1, callId2); |
|
705 |
||
706 |
TInt callId3 = 3; |
|
707 |
DriverDialCallL(callId3, mobileService); |
|
708 |
||
709 |
TMockLtsyData2<TInt, TInt> mockData(callId3, callId1); |
|
710 |
data.Close(); |
|
711 |
mockData.SerialiseL(data); |
|
712 |
iMockLTSY.ExpectL(MLtsyDispatchCallControlMultipartyConferenceAddCall::KLtsyDispatchCallControlMultipartyConferenceAddCallApiId, data); |
|
713 |
||
714 |
iMockLTSY.CompleteL(MLtsyDispatchCallControlMultipartyConferenceAddCall::KLtsyDispatchCallControlMultipartyConferenceAddCallApiId, KErrGeneral); |
|
715 |
||
716 |
// Tidy up at end of test |
|
717 |
||
718 |
RArray<TInt> callIds; |
|
719 |
CleanupClosePushL( callIds ); |
|
720 |
callIds.AppendL( callId1 ); |
|
721 |
callIds.AppendL( callId2 ); |
|
722 |
||
723 |
DriverCloseThreeRemotePartyConferenceAndCallSubsessionsL(callId1, callId2, callId3, callIds); |
|
724 |
||
725 |
// Client side test |
|
726 |
||
727 |
RMobileLine mobileLine; |
|
728 |
CleanupClosePushL(mobileLine); |
|
729 |
RMobileCall mobileCall; |
|
730 |
CleanupClosePushL(mobileCall); |
|
731 |
||
732 |
RMobileLine mobileLine2; |
|
733 |
CleanupClosePushL(mobileLine2); |
|
734 |
RMobileCall mobileCall2; |
|
735 |
CleanupClosePushL(mobileCall2); |
|
736 |
||
737 |
ClientDialAndHoldFirstCallDialSecondCallL(mobileService, mobileCall, mobileLine, |
|
738 |
mobileCall2, mobileLine2); |
|
739 |
||
740 |
RMobileConferenceCall confCall; |
|
741 |
CleanupClosePushL(confCall); |
|
742 |
||
743 |
ClientCreateConferenceCallL(confCall); |
|
744 |
||
745 |
ClientSwapConferenceCallL(confCall, RMobileConferenceCall::EConferenceSwapped, |
|
746 |
RMobileConferenceCall::EConferenceHold); |
|
747 |
||
748 |
// Dial a new call and attempt to add it to the conference |
|
749 |
RMobileLine mobileLine3; |
|
750 |
CleanupClosePushL(mobileLine3); |
|
751 |
RMobileCall mobileCall3; |
|
752 |
CleanupClosePushL(mobileCall3); |
|
753 |
||
754 |
ClientDialCallL(mobileLine3, mobileCall3, mobileService); |
|
755 |
||
756 |
RMobileCall::TMobileCallInfoV1 callInfo; |
|
757 |
RMobileCall::TMobileCallInfoV1Pckg callInfoPckg(callInfo); |
|
758 |
ASSERT_EQUALS(KErrNone, mobileCall3.GetMobileCallInfo(callInfoPckg)); |
|
759 |
||
760 |
TRequestStatus addCallStatus; |
|
761 |
confCall.AddCall(addCallStatus, callInfo.iCallName); |
|
762 |
User::WaitForRequest(addCallStatus); |
|
763 |
ASSERT_EQUALS(KErrGeneral, addCallStatus.Int()); |
|
764 |
||
32
58332560b319
Bring opencode branch up-to-date with latest cellularsrv changes
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents:
24
diff
changeset
|
765 |
// NOTE: Adopting User::After(50000) in here is because of test harness failure in the SMP (naviengine). |
58332560b319
Bring opencode branch up-to-date with latest cellularsrv changes
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents:
24
diff
changeset
|
766 |
// The ETel server is closing a tel object by an Active Object (CAsyncOneShot), there can be out of ordered closes in SMP. |
58332560b319
Bring opencode branch up-to-date with latest cellularsrv changes
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents:
24
diff
changeset
|
767 |
// Since the MockLtsy is expecting exact order of test procedure, this can be regarded as an error but it is not a part of intended testing. |
58332560b319
Bring opencode branch up-to-date with latest cellularsrv changes
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents:
24
diff
changeset
|
768 |
// Therefore this waiting function calls are required to close the tel objects in perfect order. |
24 | 769 |
confCall.Close(); |
770 |
User::After(50000); |
|
771 |
mobileCall.Close(); |
|
772 |
User::After(50000); |
|
773 |
mobileCall2.Close(); |
|
774 |
User::After(50000); |
|
775 |
mobileCall3.Close(); |
|
776 |
User::After(50000); |
|
777 |
||
778 |
AssertMockLtsyStatusL(); |
|
779 |
CleanupStack::PopAndDestroy(10, this); |
|
780 |
} // CCTsyCallControlMultipartyFU::TestUseCase0007L |
|
781 |
||
782 |
/** |
|
783 |
@SYMTestCaseID BA-CTSYD-DIS-CALLCONTROLMULTIPARTY-UC0008 |
|
784 |
@SYMComponent telephony_ctsy |
|
785 |
@SYMTestCaseDesc Test support in CTSY for going one to one in a conference call with two remote parties |
|
786 |
@SYMTestPriority High |
|
787 |
@SYMTestActions Invokes RMobileCall::GoOneToOne |
|
788 |
@SYMTestExpectedResults Pass |
|
789 |
@SYMTestType CT |
|
790 |
*/ |
|
791 |
void CCTsyCallControlMultipartyFU::TestUseCase0008L() |
|
792 |
{ |
|
793 |
OpenEtelServerL(EUseExtendedError); |
|
794 |
CleanupStack::PushL(TCleanupItem(Cleanup, this)); |
|
795 |
OpenPhoneL(); |
|
796 |
||
797 |
RBuf8 data; |
|
798 |
CleanupClosePushL(data); |
|
799 |
||
800 |
TInt callId1 = 1; |
|
801 |
TInt callId2 = 2; |
|
802 |
RMobilePhone::TMobileService mobileService = RMobilePhone::EVoiceService; |
|
803 |
DriverCreateConferenceCallL(mobileService, callId1, callId2); |
|
804 |
||
805 |
TMockLtsyData1<TInt> oneToOneData(callId2); |
|
806 |
oneToOneData.SerialiseL(data); |
|
807 |
iMockLTSY.ExpectL(MLtsyDispatchCallControlMultipartyConferenceGoOneToOne::KLtsyDispatchCallControlMultipartyConferenceGoOneToOneApiId, data); |
|
808 |
||
809 |
TMockLtsyData1<TInt> oneToOneMockData(callId2); |
|
810 |
data.Close(); |
|
811 |
oneToOneMockData.SerialiseL(data); |
|
812 |
iMockLTSY.CompleteL(MLtsyDispatchCallControlMultipartyConferenceGoOneToOne::KLtsyDispatchCallControlMultipartyConferenceGoOneToOneApiId, KErrNone, data); |
|
813 |
||
814 |
// Call 2 is connected and call 1 goes on hold |
|
815 |
RMobileCall::TMobileCallStatus callStatus = RMobileCall::EStatusHold; |
|
816 |
TMockLtsyCallData1<RMobileCall::TMobileCallStatus> mockCallData( |
|
817 |
callId1, RMobilePhone::EServiceUnspecified, callStatus); |
|
818 |
data.Close(); |
|
819 |
mockCallData.SerialiseL(data); |
|
820 |
iMockLTSY.CompleteL(KMockLtsyDispatchCallControlNotifyCallStatusChangeIndId, KErrNone, data); |
|
821 |
||
822 |
callStatus = RMobileCall::EStatusConnected; |
|
823 |
TMockLtsyCallData1<RMobileCall::TMobileCallStatus> mockCallData2( |
|
824 |
callId2, RMobilePhone::EServiceUnspecified, callStatus); |
|
825 |
data.Close(); |
|
826 |
mockCallData2.SerialiseL(data); |
|
827 |
iMockLTSY.CompleteL(KMockLtsyDispatchCallControlNotifyCallStatusChangeIndId, KErrNone, data); |
|
828 |
||
829 |
TInt hangUpCause = KErrGsmCCNormalCallClearing; // Hang up cause for normal hang up |
|
830 |
TMockLtsyData2<TInt, TInt> mockData2(callId1, hangUpCause); |
|
831 |
data.Close(); |
|
832 |
mockData2.SerialiseL(data); |
|
833 |
iMockLTSY.ExpectL(MLtsyDispatchCallControlHangUp::KLtsyDispatchCallControlHangUpApiId, data); |
|
834 |
||
835 |
TMockLtsyData2<TInt, TInt> mockData3(callId2, hangUpCause); |
|
836 |
data.Close(); |
|
837 |
mockData3.SerialiseL(data); |
|
838 |
iMockLTSY.ExpectL(MLtsyDispatchCallControlHangUp::KLtsyDispatchCallControlHangUpApiId, data); |
|
839 |
||
840 |
// Client side test |
|
841 |
||
842 |
RMobileLine mobileLine; |
|
843 |
CleanupClosePushL(mobileLine); |
|
844 |
RMobileCall mobileCall; |
|
845 |
CleanupClosePushL(mobileCall); |
|
846 |
||
847 |
RMobileLine mobileLine2; |
|
848 |
CleanupClosePushL(mobileLine2); |
|
849 |
RMobileCall mobileCall2; |
|
850 |
CleanupClosePushL(mobileCall2); |
|
851 |
||
852 |
ClientDialAndHoldFirstCallDialSecondCallL(mobileService, mobileCall, mobileLine, |
|
853 |
mobileCall2, mobileLine2); |
|
854 |
||
855 |
RMobileConferenceCall confCall; |
|
856 |
CleanupClosePushL(confCall); |
|
857 |
||
858 |
ClientCreateConferenceCallL(confCall); |
|
859 |
||
860 |
RMobileConferenceCall::TMobileConferenceEvent confEvent; |
|
861 |
TName callName; |
|
862 |
TRequestStatus notifyConfEventStatus; |
|
863 |
confCall.NotifyConferenceEvent(notifyConfEventStatus, confEvent, callName); |
|
864 |
||
865 |
TRequestStatus confCallReqStatus; |
|
866 |
RMobileConferenceCall::TMobileConferenceStatus confStatus; |
|
867 |
confCall.NotifyConferenceStatusChange(confCallReqStatus, confStatus); |
|
868 |
||
869 |
TRequestStatus oneToOneStatus; |
|
870 |
mobileCall2.GoOneToOne(oneToOneStatus); |
|
871 |
User::WaitForRequest(oneToOneStatus); |
|
872 |
ASSERT_EQUALS(KErrNone, oneToOneStatus.Int()); |
|
873 |
||
874 |
User::WaitForRequest(confCallReqStatus); |
|
875 |
ASSERT_EQUALS(KErrNone, confCallReqStatus.Int()); |
|
876 |
ASSERT_EQUALS(RMobileConferenceCall::EConferenceIdle, confStatus); |
|
877 |
||
878 |
User::WaitForRequest(notifyConfEventStatus); |
|
879 |
ASSERT_EQUALS(KErrNone, notifyConfEventStatus.Int()); |
|
880 |
ASSERT_EQUALS(RMobileConferenceCall::EConferenceCallRemoved, confEvent); |
|
881 |
confCall.NotifyConferenceEvent(notifyConfEventStatus, confEvent, callName); |
|
882 |
||
883 |
User::WaitForRequest(notifyConfEventStatus); |
|
884 |
ASSERT_EQUALS(KErrNone, notifyConfEventStatus.Int()); |
|
885 |
ASSERT_EQUALS(RMobileConferenceCall::EConferenceCallRemoved, confEvent); |
|
886 |
confCall.NotifyConferenceEvent(notifyConfEventStatus, confEvent, callName); |
|
887 |
||
888 |
User::WaitForRequest(notifyConfEventStatus); |
|
889 |
ASSERT_EQUALS(KErrNone, notifyConfEventStatus.Int()); |
|
890 |
ASSERT_EQUALS(RMobileConferenceCall::EConferenceSplit, confEvent); |
|
891 |
||
892 |
ASSERT_EQUALS(KErrNone, mobileCall.GetMobileCallStatus(callStatus)); |
|
893 |
ASSERT_EQUALS(RMobileCall::EStatusHold, callStatus); |
|
894 |
ASSERT_EQUALS(KErrNone, mobileCall2.GetMobileCallStatus(callStatus)); |
|
895 |
ASSERT_EQUALS(RMobileCall::EStatusConnected, callStatus); |
|
896 |
||
32
58332560b319
Bring opencode branch up-to-date with latest cellularsrv changes
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents:
24
diff
changeset
|
897 |
// NOTE: Adopting User::After(50000) in here is because of test harness failure in the SMP (naviengine). |
58332560b319
Bring opencode branch up-to-date with latest cellularsrv changes
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents:
24
diff
changeset
|
898 |
// The ETel server is closing a tel object by an Active Object (CAsyncOneShot), there can be out of ordered closes in SMP. |
58332560b319
Bring opencode branch up-to-date with latest cellularsrv changes
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents:
24
diff
changeset
|
899 |
// Since the MockLtsy is expecting exact order of test procedure, this can be regarded as an error but it is not a part of intended testing. |
58332560b319
Bring opencode branch up-to-date with latest cellularsrv changes
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents:
24
diff
changeset
|
900 |
// Therefore this waiting function calls are required to close the tel objects in perfect order. |
24 | 901 |
mobileCall.Close(); |
902 |
User::After(50000); |
|
903 |
mobileCall2.Close(); |
|
904 |
User::After(50000); |
|
905 |
||
906 |
AssertMockLtsyStatusL(); |
|
907 |
CleanupStack::PopAndDestroy(7, this); |
|
908 |
} // CCTsyCallControlMultipartyFU::TestUseCase0008L |
|
909 |
||
910 |
/** |
|
911 |
@SYMTestCaseID BA-CTSYD-DIS-CALLCONTROLMULTIPARTY-UC0009 |
|
912 |
@SYMComponent telephony_ctsy |
|
913 |
@SYMTestCaseDesc Test support in CTSY for going one to one in a conference call with three remote parties |
|
914 |
@SYMTestPriority High |
|
915 |
@SYMTestActions Invokes RMobileCall::GoOneToOne |
|
916 |
@SYMTestExpectedResults Pass |
|
917 |
@SYMTestType CT |
|
918 |
*/ |
|
919 |
void CCTsyCallControlMultipartyFU::TestUseCase0009L() |
|
920 |
{ |
|
921 |
OpenEtelServerL(EUseExtendedError); |
|
922 |
CleanupStack::PushL(TCleanupItem(Cleanup, this)); |
|
923 |
OpenPhoneL(); |
|
924 |
||
925 |
RBuf8 data; |
|
926 |
CleanupClosePushL(data); |
|
927 |
||
928 |
TInt callId1 = 1; |
|
929 |
TInt callId2 = 2; |
|
930 |
TInt callId3 = 3; |
|
931 |
RMobilePhone::TMobileService mobileService = RMobilePhone::EVoiceService; |
|
932 |
DriverCreateConferenceWithThreeRemotePartiesL(mobileService, callId1, callId2, callId3); |
|
933 |
||
934 |
TMockLtsyData1<TInt> oneToOneData(callId2); |
|
935 |
oneToOneData.SerialiseL(data); |
|
936 |
iMockLTSY.ExpectL(MLtsyDispatchCallControlMultipartyConferenceGoOneToOne::KLtsyDispatchCallControlMultipartyConferenceGoOneToOneApiId, data); |
|
937 |
||
938 |
TMockLtsyData1<TInt> oneToOneMockData(callId2); |
|
939 |
data.Close(); |
|
940 |
oneToOneMockData.SerialiseL(data); |
|
941 |
iMockLTSY.CompleteL(MLtsyDispatchCallControlMultipartyConferenceGoOneToOne::KLtsyDispatchCallControlMultipartyConferenceGoOneToOneApiId, KErrNone, data); |
|
942 |
||
943 |
// Call 2 is connected and call 1, 3 go on hold |
|
944 |
RMobileCall::TMobileCallStatus callStatus = RMobileCall::EStatusHold; |
|
945 |
TMockLtsyCallData1<RMobileCall::TMobileCallStatus> mockCallData( |
|
946 |
callId1, RMobilePhone::EServiceUnspecified, callStatus); |
|
947 |
data.Close(); |
|
948 |
mockCallData.SerialiseL(data); |
|
949 |
iMockLTSY.CompleteL(KMockLtsyDispatchCallControlNotifyCallStatusChangeIndId, KErrNone, data); |
|
950 |
||
951 |
TMockLtsyCallData1<RMobileCall::TMobileCallStatus> mockCallData2( |
|
952 |
callId3, RMobilePhone::EServiceUnspecified, callStatus); |
|
953 |
data.Close(); |
|
954 |
mockCallData2.SerialiseL(data); |
|
955 |
iMockLTSY.CompleteL(KMockLtsyDispatchCallControlNotifyCallStatusChangeIndId, KErrNone, data); |
|
956 |
||
957 |
callStatus = RMobileCall::EStatusConnected; |
|
958 |
TMockLtsyCallData1<RMobileCall::TMobileCallStatus> mockCallData3( |
|
959 |
callId2, RMobilePhone::EServiceUnspecified, callStatus); |
|
960 |
data.Close(); |
|
961 |
mockCallData3.SerialiseL(data); |
|
962 |
iMockLTSY.CompleteL(KMockLtsyDispatchCallControlNotifyCallStatusChangeIndId, KErrNone, data); |
|
963 |
||
964 |
// Tidy up at end of test |
|
965 |
TInt hangUpCause = KErrGsmCCNormalCallClearing; // Hang up cause for normal hang up |
|
966 |
TMockLtsyData2<TInt, TInt> mockData1(callId1, hangUpCause); |
|
967 |
data.Close(); |
|
968 |
mockData1.SerialiseL(data); |
|
969 |
iMockLTSY.ExpectL(MLtsyDispatchCallControlHangUp::KLtsyDispatchCallControlHangUpApiId, data); |
|
970 |
||
971 |
TMockLtsyData2<TInt, TInt> mockData2(callId2, hangUpCause); |
|
972 |
data.Close(); |
|
973 |
mockData2.SerialiseL(data); |
|
974 |
iMockLTSY.ExpectL(MLtsyDispatchCallControlHangUp::KLtsyDispatchCallControlHangUpApiId, data); |
|
975 |
||
976 |
TMockLtsyData2<TInt, TInt> mockData3(callId3, hangUpCause); |
|
977 |
data.Close(); |
|
978 |
mockData3.SerialiseL(data); |
|
979 |
iMockLTSY.ExpectL(MLtsyDispatchCallControlHangUp::KLtsyDispatchCallControlHangUpApiId, data); |
|
980 |
||
981 |
RArray<TInt> callIds; |
|
982 |
CleanupClosePushL( callIds ); // Empty call ids list since we remove the conference call after calls have hung up. |
|
983 |
||
984 |
TMockLtsyData1<RArray<TInt> > ltsyData((RArray<TInt>&) callIds); |
|
985 |
ltsyData.SerialiseL(data); |
|
986 |
||
987 |
// Clean up when subsessions are closed (conference call only, no longer contains any calls) |
|
988 |
iMockLTSY.ExpectL(MLtsyDispatchCallControlMultipartyConferenceHangUp::KLtsyDispatchCallControlMultipartyConferenceHangUpApiId, data); |
|
989 |
||
990 |
// Client Side Test |
|
991 |
||
992 |
RMobileLine mobileLine; |
|
993 |
CleanupClosePushL(mobileLine); |
|
994 |
RMobileCall mobileCall; |
|
995 |
CleanupClosePushL(mobileCall); |
|
996 |
||
997 |
RMobileLine mobileLine2; |
|
998 |
CleanupClosePushL(mobileLine2); |
|
999 |
RMobileCall mobileCall2; |
|
1000 |
CleanupClosePushL(mobileCall2); |
|
1001 |
||
1002 |
RMobileConferenceCall confCall; |
|
1003 |
CleanupClosePushL(confCall); |
|
1004 |
||
1005 |
RMobileLine mobileLine3; |
|
1006 |
CleanupClosePushL(mobileLine3); |
|
1007 |
RMobileCall mobileCall3; |
|
1008 |
CleanupClosePushL(mobileCall3); |
|
1009 |
||
1010 |
ClientCreateConferenceCallWithThreeRemotePartiesL(mobileService, mobileCall, |
|
1011 |
mobileLine, mobileCall2, mobileLine2, mobileCall3, mobileLine3, confCall); |
|
1012 |
||
1013 |
RMobileConferenceCall::TMobileConferenceEvent confEvent; |
|
1014 |
TName callName; |
|
1015 |
TRequestStatus notifyConfEventStatus; |
|
1016 |
confCall.NotifyConferenceEvent(notifyConfEventStatus, confEvent, callName); |
|
1017 |
||
1018 |
TRequestStatus confCallReqStatus; |
|
1019 |
RMobileConferenceCall::TMobileConferenceStatus confStatus; |
|
1020 |
confCall.NotifyConferenceStatusChange(confCallReqStatus, confStatus); |
|
1021 |
||
1022 |
TRequestStatus oneToOneStatus; |
|
1023 |
mobileCall2.GoOneToOne(oneToOneStatus); |
|
1024 |
User::WaitForRequest(oneToOneStatus); |
|
1025 |
ASSERT_EQUALS(KErrNone, oneToOneStatus.Int()); |
|
1026 |
||
1027 |
User::WaitForRequest(notifyConfEventStatus); |
|
1028 |
ASSERT_EQUALS(KErrNone, notifyConfEventStatus.Int()); |
|
1029 |
ASSERT_EQUALS(RMobileConferenceCall::EConferenceCallRemoved, confEvent); |
|
1030 |
confCall.NotifyConferenceEvent(notifyConfEventStatus, confEvent, callName); |
|
1031 |
||
1032 |
User::WaitForRequest(notifyConfEventStatus); |
|
1033 |
ASSERT_EQUALS(KErrNone, notifyConfEventStatus.Int()); |
|
1034 |
ASSERT_EQUALS(RMobileConferenceCall::EConferenceSplit, confEvent); |
|
1035 |
||
1036 |
ASSERT_EQUALS(KErrNone, mobileCall.GetMobileCallStatus(callStatus)); |
|
1037 |
ASSERT_EQUALS(RMobileCall::EStatusHold, callStatus); |
|
1038 |
ASSERT_EQUALS(KErrNone, mobileCall2.GetMobileCallStatus(callStatus)); |
|
1039 |
ASSERT_EQUALS(RMobileCall::EStatusConnected, callStatus); |
|
1040 |
ASSERT_EQUALS(KErrNone, mobileCall3.GetMobileCallStatus(callStatus)); |
|
1041 |
ASSERT_EQUALS(RMobileCall::EStatusHold, callStatus); |
|
1042 |
||
32
58332560b319
Bring opencode branch up-to-date with latest cellularsrv changes
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents:
24
diff
changeset
|
1043 |
// NOTE: Adopting User::After(50000) in here is because of test harness failure in the SMP (naviengine). |
58332560b319
Bring opencode branch up-to-date with latest cellularsrv changes
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents:
24
diff
changeset
|
1044 |
// The ETel server is closing a tel object by an Active Object (CAsyncOneShot), there can be out of ordered closes in SMP. |
58332560b319
Bring opencode branch up-to-date with latest cellularsrv changes
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents:
24
diff
changeset
|
1045 |
// Since the MockLtsy is expecting exact order of test procedure, this can be regarded as an error but it is not a part of intended testing. |
58332560b319
Bring opencode branch up-to-date with latest cellularsrv changes
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents:
24
diff
changeset
|
1046 |
// Therefore this waiting function calls are required to close the tel objects in perfect order. |
24 | 1047 |
mobileCall.Close(); |
1048 |
User::After(50000); |
|
1049 |
mobileCall2.Close(); |
|
1050 |
User::After(50000); |
|
1051 |
mobileCall3.Close(); |
|
1052 |
User::After(50000); |
|
1053 |
confCall.Close(); |
|
1054 |
User::After(50000); |
|
1055 |
||
1056 |
AssertMockLtsyStatusL(); |
|
1057 |
CleanupStack::PopAndDestroy(10, this); |
|
1058 |
} // CCTsyCallControlMultipartyFU::TestUseCase0009L |
|
1059 |
||
1060 |
/** |
|
1061 |
@SYMTestCaseID BA-CTSYD-DIS-CALLCONTROLMULTIPARTY-UC0010 |
|
1062 |
@SYMComponent telephony_ctsy |
|
1063 |
@SYMTestCaseDesc Test support in CTSY for failing to go one-to-one with a call in a conference |
|
1064 |
@SYMTestPriority High |
|
1065 |
@SYMTestActions Invokes RMobileConferenceCall::GoOneToOne |
|
1066 |
@SYMTestExpectedResults Pass |
|
1067 |
@SYMTestType CT |
|
1068 |
*/ |
|
1069 |
void CCTsyCallControlMultipartyFU::TestUseCase0010L() |
|
1070 |
{ |
|
1071 |
OpenEtelServerL(EUseExtendedError); |
|
1072 |
CleanupStack::PushL(TCleanupItem(Cleanup, this)); |
|
1073 |
OpenPhoneL(); |
|
1074 |
||
1075 |
RBuf8 data; |
|
1076 |
CleanupClosePushL(data); |
|
1077 |
||
1078 |
TInt callId1 = 1; |
|
1079 |
TInt callId2 = 2; |
|
1080 |
RMobilePhone::TMobileService mobileService = RMobilePhone::EVoiceService; |
|
1081 |
DriverCreateConferenceCallL(mobileService, callId1, callId2); |
|
1082 |
||
1083 |
TMockLtsyData1<TInt> oneToOneData(callId2); |
|
1084 |
oneToOneData.SerialiseL(data); |
|
1085 |
iMockLTSY.ExpectL(MLtsyDispatchCallControlMultipartyConferenceGoOneToOne::KLtsyDispatchCallControlMultipartyConferenceGoOneToOneApiId, data); |
|
1086 |
||
1087 |
TMockLtsyData1<TInt> oneToOneMockData(callId2); |
|
1088 |
data.Close(); |
|
1089 |
oneToOneMockData.SerialiseL(data); |
|
1090 |
iMockLTSY.CompleteL(MLtsyDispatchCallControlMultipartyConferenceGoOneToOne::KLtsyDispatchCallControlMultipartyConferenceGoOneToOneApiId, KErrGeneral, data); |
|
1091 |
||
1092 |
RArray<TInt> callIds; |
|
1093 |
CleanupClosePushL( callIds ); |
|
1094 |
callIds.AppendL( callId1 ); |
|
1095 |
callIds.AppendL( callId2 ); |
|
1096 |
||
1097 |
TMockLtsyData1<RArray<TInt> > ltsyData(callIds); |
|
1098 |
data.Close(); |
|
1099 |
ltsyData.SerialiseL(data); |
|
1100 |
||
1101 |
iMockLTSY.ExpectL(MLtsyDispatchCallControlMultipartyConferenceHangUp::KLtsyDispatchCallControlMultipartyConferenceHangUpApiId, data); |
|
1102 |
iMockLTSY.CompleteL(MLtsyDispatchCallControlMultipartyConferenceHangUp::KLtsyDispatchCallControlMultipartyConferenceHangUpApiId, KErrNone); |
|
1103 |
||
1104 |
DriverCompleteSuccessfulHangUpNotificationsL(callId1, EFalse, KErrGsmCCNormalCallClearing, EFalse); |
|
1105 |
DriverCompleteSuccessfulHangUpNotificationsL(callId2, EFalse, KErrGsmCCNormalCallClearing, ETrue); |
|
1106 |
||
1107 |
// Client Side Test |
|
1108 |
||
1109 |
RMobileLine mobileLine; |
|
1110 |
CleanupClosePushL(mobileLine); |
|
1111 |
RMobileCall mobileCall; |
|
1112 |
CleanupClosePushL(mobileCall); |
|
1113 |
||
1114 |
RMobileLine mobileLine2; |
|
1115 |
CleanupClosePushL(mobileLine2); |
|
1116 |
RMobileCall mobileCall2; |
|
1117 |
CleanupClosePushL(mobileCall2); |
|
1118 |
||
1119 |
ClientDialAndHoldFirstCallDialSecondCallL(mobileService, mobileCall, mobileLine, |
|
1120 |
mobileCall2, mobileLine2); |
|
1121 |
||
1122 |
RMobileConferenceCall confCall; |
|
1123 |
CleanupClosePushL(confCall); |
|
1124 |
||
1125 |
ClientCreateConferenceCallL(confCall); |
|
1126 |
||
1127 |
TRequestStatus oneToOneStatus; |
|
1128 |
mobileCall2.GoOneToOne(oneToOneStatus); |
|
1129 |
User::WaitForRequest(oneToOneStatus); |
|
1130 |
ASSERT_EQUALS(KErrGeneral, oneToOneStatus.Int()); |
|
1131 |
||
1132 |
TInt numCalls; |
|
1133 |
ASSERT_EQUALS(KErrNone, confCall.EnumerateCalls(numCalls)); |
|
1134 |
ASSERT_EQUALS(2, numCalls); |
|
1135 |
||
1136 |
TRequestStatus hangupStatus; |
|
1137 |
confCall.HangUp(hangupStatus); |
|
1138 |
User::WaitForRequest(hangupStatus); |
|
1139 |
ASSERT_EQUALS(KErrNone, hangupStatus.Int()); |
|
1140 |
||
1141 |
AssertMockLtsyStatusL(); |
|
1142 |
CleanupStack::PopAndDestroy(8, this); |
|
1143 |
} // CCTsyCallControlMultipartyFU::TestUseCase0010L |
|
1144 |
||
1145 |
/** |
|
1146 |
@SYMTestCaseID BA-CTSYD-DIS-CALLCONTROLMULTIPARTY-UC0011 |
|
1147 |
@SYMComponent telephony_ctsy |
|
1148 |
@SYMTestCaseDesc Test support in CTSY for sending DTMF through a conference call |
|
1149 |
@SYMTestPriority High |
|
1150 |
@SYMTestActions Invokes RMobilePhone::SendDTMFTones |
|
1151 |
@SYMTestExpectedResults Pass |
|
1152 |
@SYMTestType CT |
|
1153 |
*/ |
|
1154 |
void CCTsyCallControlMultipartyFU::TestUseCase0011L() |
|
1155 |
{ |
|
1156 |
OpenEtelServerL(EUseExtendedError); |
|
1157 |
CleanupStack::PushL(TCleanupItem(Cleanup, this)); |
|
1158 |
OpenPhoneL(); |
|
1159 |
||
1160 |
RBuf8 data; |
|
1161 |
CleanupClosePushL(data); |
|
1162 |
||
1163 |
TInt callId1 = 1; |
|
1164 |
TInt callId2 = 2; |
|
1165 |
TInt callId3 = 3; |
|
1166 |
RMobilePhone::TMobileService mobileService = RMobilePhone::EVoiceService; |
|
1167 |
DriverCreateConferenceWithThreeRemotePartiesL(mobileService, callId1, callId2, callId3); |
|
1168 |
||
1169 |
// When DTMF digits are sent and the active call is a conference call, the call ID |
|
1170 |
// of one of the calls taking part in the conference is sent to the LTSY. |
|
1171 |
TBuf<5> tones = _L("A123B"); |
|
1172 |
data.Close(); |
|
1173 |
TMockLtsyData2<TInt, TBuf<5> > toneLtsyData(callId1, tones); |
|
1174 |
toneLtsyData.SerialiseL(data); |
|
1175 |
iMockLTSY.ExpectL(MLtsyDispatchCallControlSendDtmfTones::KLtsyDispatchCallControlSendDtmfTonesApiId, data, KErrNone); |
|
1176 |
iMockLTSY.CompleteL(MLtsyDispatchCallControlSendDtmfTones::KLtsyDispatchCallControlSendDtmfTonesApiId, KErrNone); |
|
1177 |
||
1178 |
RArray<TInt> callIds; |
|
1179 |
CleanupClosePushL( callIds ); |
|
1180 |
callIds.AppendL( callId1 ); |
|
1181 |
callIds.AppendL( callId2 ); |
|
1182 |
callIds.AppendL( callId3 ); |
|
1183 |
||
1184 |
// Tidy up at end of test |
|
1185 |
DriverCloseThreeRemotePartyConferenceAndCallSubsessionsL(callId1, callId2, callId3, callIds); |
|
1186 |
||
1187 |
// Client Side Test |
|
1188 |
||
1189 |
RMobileLine mobileLine; |
|
1190 |
CleanupClosePushL(mobileLine); |
|
1191 |
RMobileCall mobileCall; |
|
1192 |
CleanupClosePushL(mobileCall); |
|
1193 |
||
1194 |
RMobileLine mobileLine2; |
|
1195 |
CleanupClosePushL(mobileLine2); |
|
1196 |
RMobileCall mobileCall2; |
|
1197 |
CleanupClosePushL(mobileCall2); |
|
1198 |
||
1199 |
RMobileConferenceCall confCall; |
|
1200 |
CleanupClosePushL(confCall); |
|
1201 |
||
1202 |
RMobileLine mobileLine3; |
|
1203 |
CleanupClosePushL(mobileLine3); |
|
1204 |
RMobileCall mobileCall3; |
|
1205 |
CleanupClosePushL(mobileCall3); |
|
1206 |
||
1207 |
ClientCreateConferenceCallWithThreeRemotePartiesL(mobileService, mobileCall, |
|
1208 |
mobileLine, mobileCall2, mobileLine2, mobileCall3, mobileLine3, confCall); |
|
1209 |
||
1210 |
TRequestStatus sendStatus; |
|
1211 |
iPhone.SendDTMFTones(sendStatus, tones); |
|
1212 |
User::WaitForRequest(sendStatus); |
|
1213 |
ASSERT_EQUALS(KErrNone, sendStatus.Int()); |
|
1214 |
||
32
58332560b319
Bring opencode branch up-to-date with latest cellularsrv changes
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents:
24
diff
changeset
|
1215 |
// NOTE: Adopting User::After(50000) in here is because of test harness failure in the SMP (naviengine). |
58332560b319
Bring opencode branch up-to-date with latest cellularsrv changes
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents:
24
diff
changeset
|
1216 |
// The ETel server is closing a tel object by an Active Object (CAsyncOneShot), there can be out of ordered closes in SMP. |
58332560b319
Bring opencode branch up-to-date with latest cellularsrv changes
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents:
24
diff
changeset
|
1217 |
// Since the MockLtsy is expecting exact order of test procedure, this can be regarded as an error but it is not a part of intended testing. |
58332560b319
Bring opencode branch up-to-date with latest cellularsrv changes
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents:
24
diff
changeset
|
1218 |
// Therefore this waiting function calls are required to close the tel objects in perfect order. |
24 | 1219 |
confCall.Close(); |
1220 |
User::After(50000); |
|
1221 |
mobileCall.Close(); |
|
1222 |
User::After(50000); |
|
1223 |
mobileCall2.Close(); |
|
1224 |
User::After(50000); |
|
1225 |
mobileCall3.Close(); |
|
1226 |
User::After(50000); |
|
1227 |
||
1228 |
AssertMockLtsyStatusL(); |
|
1229 |
CleanupStack::PopAndDestroy(10, this); |
|
1230 |
} // CCTsyCallControlMultipartyFU::TestUseCase0011L |
|
1231 |
||
1232 |
||
1233 |
// |
|
1234 |
// Other unit tests |
|
1235 |
// |
|
1236 |
||
1237 |
/** |
|
1238 |
@SYMTestCaseID BA-CTSYD-DIS-CALLCONTROLMULTIPARTY-UN0001 |
|
1239 |
@SYMComponent telephony_ctsy |
|
1240 |
@SYMTestCaseDesc Test support in CTSY for RMobileConferenceCall::CreateConference |
|
1241 |
@SYMTestPriority High |
|
1242 |
@SYMTestActions Invokes RMobileConferenceCall::CreateConference |
|
1243 |
@SYMTestExpectedResults Pass |
|
1244 |
@SYMTestType UT |
|
1245 |
*/ |
|
1246 |
void CCTsyCallControlMultipartyFU::TestUnit0001L() |
|
1247 |
{ |
|
1248 |
OpenEtelServerL(EUseExtendedError); |
|
1249 |
CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
|
1250 |
OpenPhoneL(); |
|
1251 |
||
1252 |
RBuf8 data; |
|
1253 |
CleanupClosePushL(data); |
|
1254 |
||
1255 |
// Set up correct conditions to be able to create a conference |
|
1256 |
TInt callId1 = 1; |
|
1257 |
TInt callId2 = 2; |
|
1258 |
RMobilePhone::TMobileService mobileService = RMobilePhone::EVoiceService; |
|
1259 |
DriverDialAndHoldFirstCallDialSecondCallL(mobileService, callId1, callId2); |
|
1260 |
||
1261 |
RMobileLine mobileLine; |
|
1262 |
CleanupClosePushL(mobileLine); |
|
1263 |
RMobileCall mobileCall; |
|
1264 |
CleanupClosePushL(mobileCall); |
|
1265 |
||
1266 |
RMobileLine mobileLine2; |
|
1267 |
CleanupClosePushL(mobileLine2); |
|
1268 |
RMobileCall mobileCall2; |
|
1269 |
CleanupClosePushL(mobileCall2); |
|
1270 |
||
1271 |
ClientDialAndHoldFirstCallDialSecondCallL(mobileService, mobileCall, mobileLine, |
|
1272 |
mobileCall2, mobileLine2); |
|
1273 |
||
1274 |
RMobileConferenceCall confCall; |
|
1275 |
CleanupClosePushL(confCall); |
|
1276 |
ASSERT_EQUALS(KErrNone, confCall.Open(iPhone)); |
|
1277 |
||
1278 |
//------------------------------------------------------------------------- |
|
1279 |
// TEST A: failure to dispatch request to LTSY |
|
1280 |
//------------------------------------------------------------------------- |
|
1281 |
||
1282 |
TMockLtsyData2<TInt, TInt> createConfData(callId1, callId2); |
|
1283 |
createConfData.SerialiseL(data); |
|
1284 |
iMockLTSY.ExpectL(MLtsyDispatchCallControlMultipartyCreateConference::KLtsyDispatchCallControlMultipartyCreateConferenceApiId, data, KErrGeneral); |
|
1285 |
||
1286 |
TRequestStatus createConfStatus; |
|
1287 |
confCall.CreateConference(createConfStatus); |
|
1288 |
User::WaitForRequest(createConfStatus); |
|
1289 |
ASSERT_EQUALS(KErrGeneral, createConfStatus.Int()); |
|
1290 |
||
1291 |
//------------------------------------------------------------------------- |
|
1292 |
// TEST B: failure on completion of pending request from LTSY->CTSY |
|
1293 |
//------------------------------------------------------------------------- |
|
1294 |
||
1295 |
iMockLTSY.ExpectL(MLtsyDispatchCallControlMultipartyCreateConference::KLtsyDispatchCallControlMultipartyCreateConferenceApiId, data); |
|
1296 |
iMockLTSY.CompleteL(MLtsyDispatchCallControlMultipartyCreateConference::KLtsyDispatchCallControlMultipartyCreateConferenceApiId, KErrGeneral); |
|
1297 |
||
1298 |
confCall.CreateConference(createConfStatus); |
|
1299 |
User::WaitForRequest(createConfStatus); |
|
1300 |
ASSERT_EQUALS(KErrGeneral, createConfStatus.Int()); |
|
1301 |
||
1302 |
//------------------------------------------------------------------------- |
|
1303 |
// TEST C: Successful completion request of |
|
1304 |
// RMobileConferenceCall::CreateConference() when result is not cached. |
|
1305 |
//------------------------------------------------------------------------- |
|
1306 |
||
1307 |
iMockLTSY.ExpectL(MLtsyDispatchCallControlMultipartyCreateConference::KLtsyDispatchCallControlMultipartyCreateConferenceApiId, data); |
|
1308 |
||
1309 |
RMobileCall::TMobileCallStatus callStatus = RMobileCall::EStatusConnected; |
|
1310 |
TMockLtsyCallData1<RMobileCall::TMobileCallStatus> mockCallData( |
|
1311 |
callId1, RMobilePhone::EServiceUnspecified, callStatus); |
|
1312 |
data.Close(); |
|
1313 |
mockCallData.SerialiseL(data); |
|
1314 |
iMockLTSY.CompleteL(KMockLtsyDispatchCallControlNotifyCallStatusChangeIndId, KErrNone, data); |
|
1315 |
||
1316 |
TMockLtsyCallData1<RMobileCall::TMobileCallStatus> mockCallData2( |
|
1317 |
callId2, RMobilePhone::EServiceUnspecified, callStatus); |
|
1318 |
data.Close(); |
|
1319 |
mockCallData2.SerialiseL(data); |
|
1320 |
iMockLTSY.CompleteL(KMockLtsyDispatchCallControlNotifyCallStatusChangeIndId, KErrNone, data); |
|
1321 |
||
1322 |
confCall.CreateConference(createConfStatus); |
|
1323 |
User::WaitForRequest(createConfStatus); |
|
1324 |
ASSERT_EQUALS(KErrNone, createConfStatus.Int()); |
|
1325 |
||
1326 |
//------------------------------------------------------------------------- |
|
1327 |
// TEST E: Unsolicited completion of RMobileConferenceCall::CreateConference() |
|
1328 |
// from LTSY. |
|
1329 |
//------------------------------------------------------------------------- |
|
1330 |
||
1331 |
TRequestStatus terminatedStatus; |
|
1332 |
iMockLTSY.NotifyTerminated(terminatedStatus); |
|
1333 |
||
1334 |
iMockLTSY.CompleteL(MLtsyDispatchCallControlMultipartyCreateConference::KLtsyDispatchCallControlMultipartyCreateConferenceApiId, KErrNone); |
|
1335 |
||
1336 |
User::WaitForRequest(terminatedStatus); |
|
1337 |
||
1338 |
RArray<TInt> callIds; |
|
1339 |
CleanupClosePushL( callIds ); |
|
1340 |
callIds.AppendL( callId1 ); |
|
1341 |
callIds.AppendL( callId2 ); |
|
1342 |
||
1343 |
// Clean up when subsessions are closed |
|
1344 |
DriverCloseTwoRemotePartyConferenceAndCallSubsessionsL(callId1, callId2, callIds); |
|
1345 |
||
32
58332560b319
Bring opencode branch up-to-date with latest cellularsrv changes
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents:
24
diff
changeset
|
1346 |
// NOTE: Adopting User::After(50000) in here is because of test harness failure in the SMP (naviengine). |
58332560b319
Bring opencode branch up-to-date with latest cellularsrv changes
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents:
24
diff
changeset
|
1347 |
// The ETel server is closing a tel object by an Active Object (CAsyncOneShot), there can be out of ordered closes in SMP. |
58332560b319
Bring opencode branch up-to-date with latest cellularsrv changes
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents:
24
diff
changeset
|
1348 |
// Since the MockLtsy is expecting exact order of test procedure, this can be regarded as an error but it is not a part of intended testing. |
58332560b319
Bring opencode branch up-to-date with latest cellularsrv changes
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents:
24
diff
changeset
|
1349 |
// Therefore this waiting function calls are required to close the tel objects in perfect order. |
24 | 1350 |
confCall.Close(); |
1351 |
User::After(50000); |
|
1352 |
mobileCall.Close(); |
|
1353 |
User::After(50000); |
|
1354 |
mobileCall2.Close(); |
|
1355 |
User::After(50000); |
|
1356 |
||
1357 |
AssertMockLtsyStatusL(); |
|
1358 |
CleanupStack::PopAndDestroy(8, this); |
|
1359 |
} // CCTsyCallControlMultipartyFU::TestUnit0001L |
|
1360 |
||
1361 |
||
1362 |
// |
|
1363 |
// Helper functions |
|
1364 |
// |
|
1365 |
||
1366 |
void CCTsyCallControlMultipartyFU::DriverCreateConferenceCallL(RMobilePhone::TMobileService aMobileService, TInt aCallId1, TInt aCallId2) |
|
1367 |
{ |
|
1368 |
RBuf8 data; |
|
1369 |
CleanupClosePushL(data); |
|
1370 |
||
1371 |
DriverDialAndHoldFirstCallDialSecondCallL(aMobileService, aCallId1, aCallId2); |
|
1372 |
||
1373 |
TMockLtsyData2<TInt, TInt> createConfData(aCallId1, aCallId2); |
|
1374 |
createConfData.SerialiseL(data); |
|
1375 |
iMockLTSY.ExpectL(MLtsyDispatchCallControlMultipartyCreateConference::KLtsyDispatchCallControlMultipartyCreateConferenceApiId, data); |
|
1376 |
||
1377 |
RMobileCall::TMobileCallStatus callStatus = RMobileCall::EStatusConnected; |
|
1378 |
TMockLtsyCallData1<RMobileCall::TMobileCallStatus> mockCallData( |
|
1379 |
aCallId1, RMobilePhone::EServiceUnspecified, callStatus); |
|
1380 |
data.Close(); |
|
1381 |
mockCallData.SerialiseL(data); |
|
1382 |
iMockLTSY.CompleteL(KMockLtsyDispatchCallControlNotifyCallStatusChangeIndId, KErrNone, data); |
|
1383 |
||
1384 |
TMockLtsyCallData1<RMobileCall::TMobileCallStatus> mockCallData2( |
|
1385 |
aCallId2, RMobilePhone::EServiceUnspecified, callStatus); |
|
1386 |
data.Close(); |
|
1387 |
mockCallData2.SerialiseL(data); |
|
1388 |
iMockLTSY.CompleteL(KMockLtsyDispatchCallControlNotifyCallStatusChangeIndId, KErrNone, data); |
|
1389 |
||
1390 |
CleanupStack::PopAndDestroy(1, &data); |
|
1391 |
} // CCTsyCallControlMultipartyFU::DriverCreateConferenceCallL |
|
1392 |
||
1393 |
void CCTsyCallControlMultipartyFU::DriverCreateConferenceCallAndHoldItL( |
|
1394 |
RMobilePhone::TMobileService aMobileService, TInt aCallId1, TInt aCallId2) |
|
1395 |
{ |
|
1396 |
RBuf8 data; |
|
1397 |
CleanupClosePushL(data); |
|
1398 |
||
1399 |
DriverCreateConferenceCallL(aMobileService, aCallId1, aCallId2); |
|
1400 |
||
1401 |
// Swapping a conference call when there isn't another call causes hold |
|
1402 |
// IPC to go to the dispatcher. |
|
1403 |
DriverHoldCallL(aCallId1, KErrNone); |
|
1404 |
||
1405 |
// Call 2 which is part of the conference will go on hold |
|
1406 |
RMobileCall::TMobileCallStatus callStatus = RMobileCall::EStatusHold; |
|
1407 |
TMockLtsyCallData1<RMobileCall::TMobileCallStatus> mockCallData( |
|
1408 |
aCallId2, RMobilePhone::EServiceUnspecified, callStatus); |
|
1409 |
data.Close(); |
|
1410 |
mockCallData.SerialiseL(data); |
|
1411 |
iMockLTSY.CompleteL(KMockLtsyDispatchCallControlNotifyCallStatusChangeIndId, KErrNone, data); |
|
1412 |
||
1413 |
CleanupStack::PopAndDestroy(1, &data); |
|
1414 |
} // CCTsyCallControlMultipartyFU::DriverCreateConferenceCallAndHoldItL |
|
1415 |
||
1416 |
void CCTsyCallControlMultipartyFU::DriverCreateConferenceWithThreeRemotePartiesL( |
|
1417 |
RMobilePhone::TMobileService aMobileService, TInt aCallId1, TInt aCallId2, TInt aCallId3) |
|
1418 |
{ |
|
1419 |
RBuf8 data; |
|
1420 |
CleanupClosePushL(data); |
|
1421 |
||
1422 |
DriverCreateConferenceCallL(aMobileService, aCallId1, aCallId2); |
|
1423 |
||
1424 |
// Swapping a conference call when there isn't another call causes hold |
|
1425 |
// IPC to go to the dispatcher. |
|
1426 |
DriverHoldCallL(aCallId1, KErrNone); |
|
1427 |
||
1428 |
// Call 2 which is part of the conference will go on hold |
|
1429 |
RMobileCall::TMobileCallStatus callStatus = RMobileCall::EStatusHold; |
|
1430 |
TMockLtsyCallData1<RMobileCall::TMobileCallStatus> mockCallData( |
|
1431 |
aCallId2, RMobilePhone::EServiceUnspecified, callStatus); |
|
1432 |
data.Close(); |
|
1433 |
mockCallData.SerialiseL(data); |
|
1434 |
iMockLTSY.CompleteL(KMockLtsyDispatchCallControlNotifyCallStatusChangeIndId, KErrNone, data); |
|
1435 |
||
1436 |
DriverDialCallL(aCallId3, aMobileService); |
|
1437 |
||
1438 |
TMockLtsyData2<TInt, TInt> mockData(aCallId3, aCallId1); |
|
1439 |
data.Close(); |
|
1440 |
mockData.SerialiseL(data); |
|
1441 |
iMockLTSY.ExpectL(MLtsyDispatchCallControlMultipartyConferenceAddCall::KLtsyDispatchCallControlMultipartyConferenceAddCallApiId, data); |
|
1442 |
||
1443 |
iMockLTSY.CompleteL(MLtsyDispatchCallControlMultipartyConferenceAddCall::KLtsyDispatchCallControlMultipartyConferenceAddCallApiId, KErrNone); |
|
1444 |
||
1445 |
// When a call is added to the conference, all the calls end up connected |
|
1446 |
callStatus = RMobileCall::EStatusConnected; |
|
1447 |
TMockLtsyCallData1<RMobileCall::TMobileCallStatus> mockCallData3( |
|
1448 |
aCallId1, RMobilePhone::EServiceUnspecified, callStatus); |
|
1449 |
data.Close(); |
|
1450 |
mockCallData3.SerialiseL(data); |
|
1451 |
iMockLTSY.CompleteL(KMockLtsyDispatchCallControlNotifyCallStatusChangeIndId, KErrNone, data); |
|
1452 |
||
1453 |
TMockLtsyCallData1<RMobileCall::TMobileCallStatus> mockCallData4( |
|
1454 |
aCallId2, RMobilePhone::EServiceUnspecified, callStatus); |
|
1455 |
data.Close(); |
|
1456 |
mockCallData4.SerialiseL(data); |
|
1457 |
iMockLTSY.CompleteL(KMockLtsyDispatchCallControlNotifyCallStatusChangeIndId, KErrNone, data); |
|
1458 |
||
1459 |
TMockLtsyCallData1<RMobileCall::TMobileCallStatus> mockCallData5( |
|
1460 |
aCallId3, RMobilePhone::EServiceUnspecified, callStatus); |
|
1461 |
data.Close(); |
|
1462 |
mockCallData5.SerialiseL(data); |
|
1463 |
iMockLTSY.CompleteL(KMockLtsyDispatchCallControlNotifyCallStatusChangeIndId, KErrNone, data); |
|
1464 |
||
1465 |
CleanupStack::PopAndDestroy(1, &data); |
|
1466 |
} // CCTsyCallControlMultipartyFU::DriverCreateConferenceWithThreeRemotePartiesL |
|
1467 |
||
1468 |
void CCTsyCallControlMultipartyFU::DriverCloseTwoRemotePartyConferenceAndCallSubsessionsL(TInt aCallId1, TInt aCallId2, const RArray<TInt>& aCallIds) |
|
1469 |
{ |
|
1470 |
RBuf8 data; |
|
1471 |
CleanupClosePushL(data); |
|
1472 |
||
1473 |
TMockLtsyData1<RArray<TInt> > ltsyData((RArray<TInt>&) aCallIds); |
|
1474 |
ltsyData.SerialiseL(data); |
|
1475 |
||
1476 |
// Clean up when subsessions are closed (conference call and the two calls in the conference) |
|
1477 |
iMockLTSY.ExpectL(MLtsyDispatchCallControlMultipartyConferenceHangUp::KLtsyDispatchCallControlMultipartyConferenceHangUpApiId, data); |
|
1478 |
||
1479 |
TInt hangUpCause = KErrGsmCCNormalCallClearing; // Hang up cause for normal hang up |
|
1480 |
TMockLtsyData2<TInt, TInt> mockData1(aCallId1, hangUpCause); |
|
1481 |
data.Close(); |
|
1482 |
mockData1.SerialiseL(data); |
|
1483 |
iMockLTSY.ExpectL(MLtsyDispatchCallControlHangUp::KLtsyDispatchCallControlHangUpApiId, data); |
|
1484 |
||
1485 |
TMockLtsyData2<TInt, TInt> mockData2(aCallId2, hangUpCause); |
|
1486 |
data.Close(); |
|
1487 |
mockData2.SerialiseL(data); |
|
1488 |
iMockLTSY.ExpectL(MLtsyDispatchCallControlHangUp::KLtsyDispatchCallControlHangUpApiId, data); |
|
1489 |
||
1490 |
CleanupStack::PopAndDestroy(1, &data); |
|
1491 |
} // CCTsyCallControlMultipartyFU::DriverCloseConferenceAndCallSubsessionsL |
|
1492 |
||
1493 |
void CCTsyCallControlMultipartyFU::DriverCloseThreeRemotePartyConferenceAndCallSubsessionsL(TInt aCallId1, TInt aCallId2, TInt aCallId3, const RArray<TInt>& aCallIds) |
|
1494 |
{ |
|
1495 |
RBuf8 data; |
|
1496 |
CleanupClosePushL(data); |
|
1497 |
||
1498 |
DriverCloseTwoRemotePartyConferenceAndCallSubsessionsL(aCallId1, aCallId2, aCallIds); |
|
1499 |
||
1500 |
TInt hangUpCause = KErrGsmCCNormalCallClearing; // Hang up cause for normal hang up |
|
1501 |
TMockLtsyData2<TInt, TInt> mockData2(aCallId3, hangUpCause); |
|
1502 |
data.Close(); |
|
1503 |
mockData2.SerialiseL(data); |
|
1504 |
iMockLTSY.ExpectL(MLtsyDispatchCallControlHangUp::KLtsyDispatchCallControlHangUpApiId, data); |
|
1505 |
||
1506 |
CleanupStack::PopAndDestroy(1, &data); |
|
1507 |
} // CCTsyCallControlMultipartyFU::DriverCloseThreeRemotePartyConferenceAndCallSubsessionsL |
|
1508 |
||
1509 |
void CCTsyCallControlMultipartyFU::ClientCreateConferenceCallL(RMobileConferenceCall& aConfCall) |
|
1510 |
{ |
|
1511 |
ASSERT_EQUALS(KErrNone, aConfCall.Open(iPhone)); |
|
1512 |
||
1513 |
RMobileConferenceCall::TMobileConferenceEvent confEvent; |
|
1514 |
TName callName; |
|
1515 |
TRequestStatus notifyConfEventStatus; |
|
1516 |
aConfCall.NotifyConferenceEvent(notifyConfEventStatus, confEvent, callName); |
|
1517 |
||
1518 |
TRequestStatus notifyConfStatus; |
|
1519 |
RMobileConferenceCall::TMobileConferenceStatus confStatus; |
|
1520 |
aConfCall.NotifyConferenceStatusChange(notifyConfStatus, confStatus); |
|
1521 |
||
1522 |
TRequestStatus createConfStatus; |
|
1523 |
aConfCall.CreateConference(createConfStatus); |
|
1524 |
||
1525 |
User::WaitForRequest(notifyConfEventStatus); |
|
1526 |
ASSERT_EQUALS(KErrNone, notifyConfEventStatus.Int()); |
|
1527 |
ASSERT_EQUALS(RMobileConferenceCall::EConferenceCallAdded, confEvent); // Call 1 when call status change notification completes |
|
1528 |
aConfCall.NotifyConferenceEvent(notifyConfEventStatus, confEvent, callName); |
|
1529 |
||
1530 |
User::WaitForRequest(notifyConfEventStatus); |
|
1531 |
ASSERT_EQUALS(KErrNone, notifyConfEventStatus.Int()); // Call 2 added when call status change notification completes |
|
1532 |
ASSERT_EQUALS(RMobileConferenceCall::EConferenceCallAdded, confEvent); |
|
1533 |
aConfCall.NotifyConferenceEvent(notifyConfEventStatus, confEvent, callName); |
|
1534 |
||
1535 |
User::WaitForRequest(notifyConfEventStatus); |
|
1536 |
ASSERT_EQUALS(KErrNone, notifyConfEventStatus.Int()); |
|
1537 |
ASSERT_EQUALS(RMobileConferenceCall::EConferenceBuilt, confEvent); |
|
1538 |
||
1539 |
User::WaitForRequest(notifyConfStatus); |
|
1540 |
ASSERT_EQUALS(KErrNone, notifyConfStatus.Int()); |
|
1541 |
ASSERT_EQUALS(RMobileConferenceCall::EConferenceActive, confStatus); |
|
1542 |
||
1543 |
User::WaitForRequest(createConfStatus); |
|
1544 |
ASSERT_EQUALS(KErrNone, createConfStatus.Int()); |
|
1545 |
} // CCTsyCallControlMultipartyFU::ClientCreateConferenceCallL |
|
1546 |
||
1547 |
void CCTsyCallControlMultipartyFU::ClientSwapConferenceCallL(RMobileConferenceCall& aConfCall, |
|
1548 |
RMobileConferenceCall::TMobileConferenceEvent aExpectedConfEvent, RMobileConferenceCall::TMobileConferenceStatus aExpectedConfStatus) |
|
1549 |
{ |
|
1550 |
TRequestStatus notifyConfStatus; |
|
1551 |
RMobileConferenceCall::TMobileConferenceStatus confStatus; |
|
1552 |
aConfCall.NotifyConferenceStatusChange(notifyConfStatus, confStatus); |
|
1553 |
||
1554 |
RMobileConferenceCall::TMobileConferenceEvent confEvent; |
|
1555 |
TName callName; |
|
1556 |
TRequestStatus notifyConfEventStatus; |
|
1557 |
aConfCall.NotifyConferenceEvent(notifyConfEventStatus, confEvent, callName); |
|
1558 |
||
1559 |
TRequestStatus swapStatus; |
|
1560 |
aConfCall.Swap(swapStatus); |
|
1561 |
User::WaitForRequest(swapStatus); |
|
1562 |
ASSERT_EQUALS(KErrNone, swapStatus.Int()); |
|
1563 |
||
1564 |
User::WaitForRequest(notifyConfEventStatus); |
|
1565 |
ASSERT_EQUALS(KErrNone, notifyConfEventStatus.Int()); |
|
1566 |
ASSERT_EQUALS(aExpectedConfEvent, confEvent); |
|
1567 |
||
1568 |
User::WaitForRequest(notifyConfStatus); |
|
1569 |
ASSERT_EQUALS(KErrNone, notifyConfStatus.Int()); |
|
1570 |
ASSERT_EQUALS(aExpectedConfStatus, confStatus); |
|
1571 |
} // CCTsyCallControlMultipartyFU::ClientSwapConferenceCallL |
|
1572 |
||
1573 |
void CCTsyCallControlMultipartyFU::ClientCreateConferenceCallAndHoldItL( |
|
1574 |
RMobilePhone::TMobileService aMobileService, RMobileCall& aMobileCall, |
|
1575 |
RMobileLine& aMobileLine, RMobileCall& aMobileCall2, RMobileLine& aMobileLine2, |
|
1576 |
RMobileConferenceCall& aConfCall) |
|
1577 |
{ |
|
1578 |
ClientDialAndHoldFirstCallDialSecondCallL(aMobileService, aMobileCall, aMobileLine, aMobileCall2, aMobileLine2); |
|
1579 |
ClientCreateConferenceCallL(aConfCall); |
|
1580 |
ClientSwapConferenceCallL(aConfCall, RMobileConferenceCall::EConferenceSwapped, RMobileConferenceCall::EConferenceHold); |
|
1581 |
} // CCTsyCallControlMultipartyFU::ClientCreateConferenceCallAndHoldItL |
|
1582 |
||
1583 |
void CCTsyCallControlMultipartyFU::ClientCreateConferenceCallWithThreeRemotePartiesL( |
|
1584 |
RMobilePhone::TMobileService aMobileService, RMobileCall& aMobileCall, |
|
1585 |
RMobileLine& aMobileLine, RMobileCall& aMobileCall2, RMobileLine& aMobileLine2, |
|
1586 |
RMobileCall& aMobileCall3, RMobileLine& aMobileLine3, |
|
1587 |
RMobileConferenceCall& aConfCall) |
|
1588 |
{ |
|
1589 |
ClientCreateConferenceCallAndHoldItL(aMobileService, aMobileCall, |
|
1590 |
aMobileLine, aMobileCall2, aMobileLine2, aConfCall); |
|
1591 |
||
1592 |
// Dial a new call and add it to the conference |
|
1593 |
ClientDialCallL(aMobileLine3, aMobileCall3, aMobileService); |
|
1594 |
||
1595 |
RMobileCall::TMobileCallInfoV1 callInfo; |
|
1596 |
RMobileCall::TMobileCallInfoV1Pckg callInfoPckg(callInfo); |
|
1597 |
ASSERT_EQUALS(KErrNone, aMobileCall3.GetMobileCallInfo(callInfoPckg)); |
|
1598 |
||
1599 |
TRequestStatus addCallStatus; |
|
1600 |
aConfCall.AddCall(addCallStatus, callInfo.iCallName); |
|
1601 |
User::WaitForRequest(addCallStatus); |
|
1602 |
ASSERT_EQUALS(KErrNone, addCallStatus.Int()); |
|
1603 |
||
1604 |
TRequestStatus notifyConfStatus; |
|
1605 |
RMobileConferenceCall::TMobileConferenceStatus confStatus; |
|
1606 |
aConfCall.NotifyConferenceStatusChange(notifyConfStatus, confStatus); |
|
1607 |
||
1608 |
RMobileConferenceCall::TMobileConferenceEvent confEvent; |
|
1609 |
TName callName; |
|
1610 |
TRequestStatus notifyConfEventStatus; |
|
1611 |
aConfCall.NotifyConferenceEvent(notifyConfEventStatus, confEvent, callName); |
|
1612 |
||
1613 |
User::WaitForRequest(notifyConfEventStatus); |
|
1614 |
ASSERT_EQUALS(KErrNone, notifyConfEventStatus.Int()); |
|
1615 |
ASSERT_EQUALS(RMobileConferenceCall::EConferenceCallAdded, confEvent); |
|
1616 |
||
1617 |
User::WaitForRequest(notifyConfStatus); |
|
1618 |
ASSERT_EQUALS(KErrNone, notifyConfStatus.Int()); |
|
1619 |
ASSERT_EQUALS(RMobileConferenceCall::EConferenceActive, confStatus); |
|
1620 |
||
1621 |
TInt numCalls; |
|
1622 |
ASSERT_EQUALS(KErrNone, aConfCall.EnumerateCalls(numCalls)); |
|
1623 |
ASSERT_EQUALS(3, numCalls); |
|
1624 |
} // CCTsyCallControlMultipartyFU::ClientCreateConferenceCallWithThreeRemotePartiesL |
|
1625 |
||
1626 |
||
1627 |