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 CallControlControl in the Common TSY.
|
|
15 |
//
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
#include "cctsycallcontrolfu.h"
|
|
20 |
#include "isvao.h"
|
|
21 |
|
|
22 |
#include <etel.h>
|
|
23 |
#include <etelmm.h>
|
|
24 |
#include <et_clsvr.h>
|
|
25 |
#include <ctsy/mmtsy_names.h>
|
|
26 |
#include <ctsy/serviceapi/mmtsy_ipcdefs.h>
|
|
27 |
#include <test/tmockltsydata.h>
|
|
28 |
#include <ctsy/ltsy/mltsydispatchcallcontrolinterface.h>
|
|
29 |
#include "testconstants.h"
|
|
30 |
|
|
31 |
#include "mockltsyindicatorids.h"
|
|
32 |
#include <sacls.h> // For phone power P&S key needed by Etel3rdParty testing
|
|
33 |
#include <e32property.h>
|
|
34 |
#include <ctsy/rmmcustomapi.h>
|
|
35 |
#include <centralrepository.h>
|
|
36 |
|
|
37 |
CTestSuite* CCTsyCallControlFU::CreateSuiteL(const TDesC& aName)
|
|
38 |
{
|
|
39 |
SUB_SUITE;
|
|
40 |
|
|
41 |
// Add use-case tests
|
|
42 |
ADD_TEST_STEP_ISO_CPP(CCTsyCallControlFU, TestUseCase0001L);
|
|
43 |
ADD_TEST_STEP_ISO_CPP(CCTsyCallControlFU, TestUseCase0002L);
|
|
44 |
ADD_TEST_STEP_ISO_CPP(CCTsyCallControlFU, TestUseCase0003L);
|
|
45 |
ADD_TEST_STEP_ISO_CPP(CCTsyCallControlFU, TestUseCase0004L);
|
|
46 |
ADD_TEST_STEP_ISO_CPP(CCTsyCallControlFU, TestUseCase0005L);
|
|
47 |
ADD_TEST_STEP_ISO_CPP(CCTsyCallControlFU, TestUseCase0006L);
|
|
48 |
ADD_TEST_STEP_ISO_CPP(CCTsyCallControlFU, TestUseCase0007L);
|
|
49 |
ADD_TEST_STEP_ISO_CPP(CCTsyCallControlFU, TestUseCase0008L);
|
|
50 |
ADD_TEST_STEP_ISO_CPP(CCTsyCallControlFU, TestUseCase0009L);
|
|
51 |
ADD_TEST_STEP_ISO_CPP(CCTsyCallControlFU, TestUseCase0010L);
|
|
52 |
ADD_TEST_STEP_ISO_CPP(CCTsyCallControlFU, TestUseCase0011L);
|
|
53 |
ADD_TEST_STEP_ISO_CPP(CCTsyCallControlFU, TestUseCase0012L);
|
|
54 |
ADD_TEST_STEP_ISO_CPP(CCTsyCallControlFU, TestUseCase0013L);
|
|
55 |
ADD_TEST_STEP_ISO_CPP(CCTsyCallControlFU, TestUseCase0014L);
|
|
56 |
ADD_TEST_STEP_ISO_CPP(CCTsyCallControlFU, TestUseCase0015L);
|
|
57 |
ADD_TEST_STEP_ISO_CPP(CCTsyCallControlFU, TestUseCase0016L);
|
|
58 |
ADD_TEST_STEP_ISO_CPP(CCTsyCallControlFU, TestUseCase0017L);
|
|
59 |
ADD_TEST_STEP_ISO_CPP(CCTsyCallControlFU, TestUseCase0018L);
|
|
60 |
ADD_TEST_STEP_ISO_CPP(CCTsyCallControlFU, TestUseCase0019L);
|
|
61 |
ADD_TEST_STEP_ISO_CPP(CCTsyCallControlFU, TestUseCase0020L);
|
|
62 |
ADD_TEST_STEP_ISO_CPP(CCTsyCallControlFU, TestUseCase0021L);
|
|
63 |
ADD_TEST_STEP_ISO_CPP(CCTsyCallControlFU, TestUseCase0022L);
|
|
64 |
ADD_TEST_STEP_ISO_CPP(CCTsyCallControlFU, TestUseCase0023L);
|
|
65 |
ADD_TEST_STEP_ISO_CPP(CCTsyCallControlFU, TestUseCase0024L);
|
|
66 |
ADD_TEST_STEP_ISO_CPP(CCTsyCallControlFU, TestUseCase0025L);
|
|
67 |
|
|
68 |
// Add other unit tests
|
|
69 |
ADD_TEST_STEP_ISO_CPP(CCTsyCallControlFU, TestUnit0001L);
|
|
70 |
ADD_TEST_STEP_ISO_CPP(CCTsyCallControlFU, TestUnit0002L);
|
|
71 |
ADD_TEST_STEP_ISO_CPP(CCTsyCallControlFU, TestUnit0003L);
|
|
72 |
ADD_TEST_STEP_ISO_CPP(CCTsyCallControlFU, TestUnit0004L);
|
|
73 |
ADD_TEST_STEP_ISO_CPP(CCTsyCallControlFU, TestUnit0005L);
|
|
74 |
ADD_TEST_STEP_ISO_CPP(CCTsyCallControlFU, TestUnit0006L);
|
|
75 |
ADD_TEST_STEP_ISO_CPP(CCTsyCallControlFU, TestUnit0007L);
|
|
76 |
ADD_TEST_STEP_ISO_CPP(CCTsyCallControlFU, TestUnit0008L);
|
|
77 |
ADD_TEST_STEP_ISO_CPP(CCTsyCallControlFU, TestUnit0009L);
|
|
78 |
ADD_TEST_STEP_ISO_CPP(CCTsyCallControlFU, TestUnit0010L);
|
|
79 |
ADD_TEST_STEP_ISO_CPP(CCTsyCallControlFU, TestUnit0011L);
|
|
80 |
ADD_TEST_STEP_ISO_CPP(CCTsyCallControlFU, TestUnit0012L);
|
|
81 |
ADD_TEST_STEP_ISO_CPP(CCTsyCallControlFU, TestUnit0013L);
|
|
82 |
ADD_TEST_STEP_ISO_CPP(CCTsyCallControlFU, TestUnit0014L);
|
|
83 |
ADD_TEST_STEP_ISO_CPP(CCTsyCallControlFU, TestUnit0015L);
|
|
84 |
ADD_TEST_STEP_ISO_CPP(CCTsyCallControlFU, TestUnit0016L);
|
|
85 |
ADD_TEST_STEP_ISO_CPP(CCTsyCallControlFU, TestUnit0017L);
|
|
86 |
ADD_TEST_STEP_ISO_CPP(CCTsyCallControlFU, TestUnit0018L);
|
|
87 |
ADD_TEST_STEP_ISO_CPP(CCTsyCallControlFU, TestUnit0019L);
|
|
88 |
ADD_TEST_STEP_ISO_CPP(CCTsyCallControlFU, TestUnit0020L);
|
|
89 |
ADD_TEST_STEP_ISO_CPP(CCTsyCallControlFU, TestUnit0021L);
|
|
90 |
|
|
91 |
|
|
92 |
END_SUITE;
|
|
93 |
}
|
|
94 |
|
|
95 |
|
|
96 |
//
|
|
97 |
// Use-case tests
|
|
98 |
//
|
|
99 |
|
|
100 |
/**
|
|
101 |
@SYMTestCaseID BA-CTSYD-DIS-CALLCONTROL-UC0001
|
|
102 |
@SYMComponent telephony_ctsy
|
|
103 |
@SYMTestCaseDesc Test support in CTSY for mobile originated voice call accepted and hang up
|
|
104 |
@SYMTestPriority High
|
|
105 |
@SYMTestActions Make a voice call, receive status change notifications, hang up
|
|
106 |
@SYMTestExpectedResults Pass - Call reaches connected state and call is hung up
|
|
107 |
@SYMTestType CT
|
|
108 |
*/
|
|
109 |
void CCTsyCallControlFU::TestUseCase0001L()
|
|
110 |
{
|
|
111 |
OpenEtelServerL(EUseExtendedError);
|
|
112 |
CleanupStack::PushL(TCleanupItem(Cleanup,this));
|
|
113 |
OpenPhoneL();
|
|
114 |
|
|
115 |
TRequestStatus reqStatus;
|
|
116 |
iMockLTSY.NotifyTerminated(reqStatus);
|
|
117 |
|
|
118 |
TInt callId = 1;
|
|
119 |
RMobilePhone::TMobileService mobileService = RMobilePhone::EVoiceService;
|
|
120 |
DriverDialCallL(callId, mobileService);
|
|
121 |
|
|
122 |
TInt hangUpCause = KErrGsmCCNormalCallClearing; // Hang up cause for normal hang up
|
|
123 |
DriverHangUpCallL(callId, hangUpCause);
|
|
124 |
|
|
125 |
// Client Side Test
|
|
126 |
|
|
127 |
RMobileLine mobileLine;
|
|
128 |
CleanupClosePushL(mobileLine);
|
|
129 |
RMobileCall mobileCall;
|
|
130 |
CleanupClosePushL(mobileCall);
|
|
131 |
ClientDialCallL(mobileLine, mobileCall, mobileService);
|
|
132 |
|
|
133 |
ClientHangUpCallL(mobileCall);
|
|
134 |
|
|
135 |
mobileCall.Close();
|
|
136 |
mobileLine.Close();
|
|
137 |
|
|
138 |
User::WaitForRequest(reqStatus);
|
|
139 |
ASSERT_EQUALS(KErrNone, reqStatus.Int());
|
|
140 |
|
|
141 |
AssertMockLtsyStatusL();
|
|
142 |
CleanupStack::PopAndDestroy(3, this); //mobileCall, mobileLine, this
|
|
143 |
} // CCTsyCallControlFU::TestUseCase0001L
|
|
144 |
|
|
145 |
|
|
146 |
/**
|
|
147 |
@SYMTestCaseID BA-CTSYD-DIS-CALLCONTROL-UC0002
|
|
148 |
@SYMComponent telephony_ctsy
|
|
149 |
@SYMTestCaseDesc Test support in CTSY for failed dialling of a mobile originated call
|
|
150 |
@SYMTestPriority High
|
|
151 |
@SYMTestActions Dials a voice call, receives error from LTSY
|
|
152 |
@SYMTestExpectedResults Pass - Dial request fails
|
|
153 |
@SYMTestType CT
|
|
154 |
*/
|
|
155 |
void CCTsyCallControlFU::TestUseCase0002L()
|
|
156 |
{
|
|
157 |
OpenEtelServerL(EUseExtendedError);
|
|
158 |
CleanupStack::PushL(TCleanupItem(Cleanup, this));
|
|
159 |
OpenPhoneL();
|
|
160 |
|
|
161 |
RBuf8 data;
|
|
162 |
CleanupClosePushL(data);
|
|
163 |
|
|
164 |
TInt callId = 1;
|
|
165 |
RMobilePhone::TMobileService mobileService = RMobilePhone::EVoiceService;
|
|
166 |
DriverExpectDialCallRequestL(callId, mobileService, KErrGeneral);
|
|
167 |
|
|
168 |
// Client Side Test
|
|
169 |
|
|
170 |
RMobileLine mobileLine;
|
|
171 |
CleanupClosePushL(mobileLine);
|
|
172 |
RMobileCall mobileCall;
|
|
173 |
CleanupClosePushL(mobileCall);
|
|
174 |
ASSERT_EQUALS(KErrNone, OpenLineAndCallL(mobileLine, mobileCall, RMobilePhone::EVoiceService));
|
|
175 |
|
|
176 |
RMobileCall::TMobileCallParamsV1 callParams;
|
|
177 |
RMobileCall::TMobileCallParamsV1Pckg callParamsPckg(callParams);
|
|
178 |
callParams.iAutoRedial = ETrue;
|
|
179 |
callParams.iIdRestrict = RMobileCall::ESendMyId;
|
|
180 |
TRequestStatus dialStatus;
|
|
181 |
mobileCall.Dial(dialStatus, callParamsPckg, KPhoneNumber);
|
|
182 |
User::WaitForRequest(dialStatus);
|
|
183 |
ASSERT_EQUALS(KErrGeneral, dialStatus.Int());
|
|
184 |
|
|
185 |
RMobileCall::TMobileCallStatus callStatus = RMobileCall::EStatusUnknown;
|
|
186 |
mobileCall.GetMobileCallStatus(callStatus);
|
|
187 |
ASSERT_EQUALS(RMobileCall::EStatusIdle, callStatus);
|
|
188 |
|
|
189 |
mobileCall.Close();
|
|
190 |
mobileLine.Close();
|
|
191 |
data.Close();
|
|
192 |
|
|
193 |
AssertMockLtsyStatusL();
|
|
194 |
CleanupStack::PopAndDestroy(4, this); // mobileCall, mobileLine, data, this
|
|
195 |
} // CCTsyCallControlFU::TestUseCase0002L
|
|
196 |
|
|
197 |
|
|
198 |
/**
|
|
199 |
@SYMTestCaseID BA-CTSYD-DIS-CALLCONTROL-UC0003
|
|
200 |
@SYMComponent telephony_ctsy
|
|
201 |
@SYMTestCaseDesc Test support in CTSY for remote party rejecting a dialled call
|
|
202 |
@SYMTestPriority High
|
|
203 |
@SYMTestActions Dials a call, remote party rejects it, check call status and notifications are correct
|
|
204 |
@SYMTestExpectedResults Pass
|
|
205 |
@SYMTestType CT
|
|
206 |
*/
|
|
207 |
void CCTsyCallControlFU::TestUseCase0003L()
|
|
208 |
{
|
|
209 |
OpenEtelServerL(EUseExtendedError);
|
|
210 |
CleanupStack::PushL(TCleanupItem(Cleanup, this));
|
|
211 |
OpenPhoneL();
|
|
212 |
|
|
213 |
RBuf8 data;
|
|
214 |
CleanupClosePushL(data);
|
|
215 |
|
|
216 |
TInt callId = 1;
|
|
217 |
RMobilePhone::TMobileService mobileService = RMobilePhone::EVoiceService;
|
|
218 |
DriverExpectDialCallRequestL(callId, mobileService, KErrNone);
|
|
219 |
|
|
220 |
// Complete KLtsyDispatchCallControlNotifyCallStatusChangeApiId
|
|
221 |
RMobileCall::TMobileCallStatus callStatus = RMobileCall::EStatusDialling;
|
|
222 |
TMockLtsyCallData1<RMobileCall::TMobileCallStatus> mockCallData(
|
|
223 |
callId, RMobilePhone::EServiceUnspecified, callStatus);
|
|
224 |
data.Close();
|
|
225 |
mockCallData.SerialiseL(data);
|
|
226 |
iMockLTSY.CompleteL(KMockLtsyDispatchCallControlNotifyCallStatusChangeIndId, KErrNone, data);
|
|
227 |
|
|
228 |
// Complete events expected when remote party rejects call
|
|
229 |
|
|
230 |
// Complete KLtsyDispatchCallControlNotifyCallStatusChangeApiId
|
|
231 |
DriverCompleteSuccessfulHangUpNotificationsL(callId, EFalse, KErrGsmCCCallRejected, EFalse);
|
|
232 |
|
|
233 |
// Client Side Test
|
|
234 |
|
|
235 |
RMobileLine mobileLine;
|
|
236 |
CleanupClosePushL(mobileLine);
|
|
237 |
RMobileCall mobileCall;
|
|
238 |
CleanupClosePushL(mobileCall);
|
|
239 |
ASSERT_EQUALS(KErrNone, OpenLineAndCallL(mobileLine, mobileCall, RMobilePhone::EVoiceService));
|
|
240 |
|
|
241 |
TRequestStatus notifyCallStatus;
|
|
242 |
callStatus = RMobileCall::EStatusUnknown;
|
|
243 |
mobileCall.NotifyMobileCallStatusChange(notifyCallStatus, callStatus);
|
|
244 |
|
|
245 |
RMobileCall::TMobileCallParamsV1 callParams;
|
|
246 |
RMobileCall::TMobileCallParamsV1Pckg callParamsPckg(callParams);
|
|
247 |
callParams.iAutoRedial = ETrue;
|
|
248 |
callParams.iIdRestrict = RMobileCall::ESendMyId;
|
|
249 |
TRequestStatus dialStatus;
|
|
250 |
mobileCall.Dial(dialStatus, callParamsPckg, KPhoneNumber);
|
|
251 |
User::WaitForRequest(dialStatus);
|
|
252 |
ASSERT_EQUALS(KErrGsmCCCallRejected, dialStatus.Int());
|
|
253 |
|
|
254 |
RArray<RMobileCall::TMobileCallStatus> expectedCallStatuses;
|
|
255 |
CleanupClosePushL(expectedCallStatuses);
|
|
256 |
expectedCallStatuses.AppendL(RMobileCall::EStatusDialling);
|
|
257 |
expectedCallStatuses.AppendL(RMobileCall::EStatusDisconnecting);
|
|
258 |
expectedCallStatuses.AppendL(RMobileCall::EStatusIdle);
|
|
259 |
ClientWaitForCallStatusNotifications(mobileCall, notifyCallStatus, callStatus, expectedCallStatuses, KErrNone);
|
|
260 |
|
|
261 |
callStatus = RMobileCall::EStatusUnknown;
|
|
262 |
mobileCall.GetMobileCallStatus(callStatus);
|
|
263 |
ASSERT_EQUALS(RMobileCall::EStatusIdle, callStatus);
|
|
264 |
|
|
265 |
expectedCallStatuses.Close();
|
|
266 |
mobileCall.Close();
|
|
267 |
mobileLine.Close();
|
|
268 |
data.Close();
|
|
269 |
|
|
270 |
AssertMockLtsyStatusL();
|
|
271 |
CleanupStack::PopAndDestroy(5, this); // expectedCallStatuses, mobileCall, mobileLine, data, this
|
|
272 |
} // CCTsyCallControlFU::TestUseCase0003L
|
|
273 |
|
|
274 |
|
|
275 |
/**
|
|
276 |
@SYMTestCaseID BA-CTSYD-DIS-CALLCONTROL-UC0004
|
|
277 |
@SYMComponent telephony_ctsy
|
|
278 |
@SYMTestCaseDesc Test support in CTSY for remote party hang up without inband info
|
|
279 |
@SYMTestPriority High
|
|
280 |
@SYMTestActions Invokes dialling voice call, receive remote party hang up
|
|
281 |
@SYMTestExpectedResults Pass
|
|
282 |
@SYMTestType CT
|
|
283 |
*/
|
|
284 |
void CCTsyCallControlFU::TestUseCase0004L()
|
|
285 |
{
|
|
286 |
OpenEtelServerL(EUseExtendedError);
|
|
287 |
CleanupStack::PushL(TCleanupItem(Cleanup, this));
|
|
288 |
OpenPhoneL();
|
|
289 |
|
|
290 |
RBuf8 data;
|
|
291 |
CleanupClosePushL(data);
|
|
292 |
|
|
293 |
TInt callId = 1;
|
|
294 |
RMobilePhone::TMobileService mobileService = RMobilePhone::EVoiceService;
|
|
295 |
DriverDialCallL(callId, mobileService);
|
|
296 |
|
|
297 |
RMobileLine mobileLine;
|
|
298 |
CleanupClosePushL(mobileLine);
|
|
299 |
RMobileCall mobileCall;
|
|
300 |
CleanupClosePushL(mobileCall);
|
|
301 |
ClientDialCallL(mobileLine, mobileCall, mobileService);
|
|
302 |
|
|
303 |
RMobileCall::TMobileCallEvent callEvent = RMobileCall::ERemoteTerminated;
|
|
304 |
TMockLtsyCallData1<RMobileCall::TMobileCallEvent> callEventData(callId, mobileService, callEvent);
|
|
305 |
callEventData.SerialiseL(data);
|
|
306 |
iMockLTSY.CompleteL(KMockLtsyDispatchCallControlNotifyCallEventIndId, KErrNone, data);
|
|
307 |
|
|
308 |
DriverCompleteSuccessfulHangUpNotificationsL(callId, EFalse, KErrGsmCCNormalCallClearing);
|
|
309 |
|
|
310 |
TRequestStatus notifyCallEventStatus;
|
|
311 |
RMobileCall::TMobileCallEvent receivedCallEvent;
|
|
312 |
mobileCall.NotifyCallEvent(notifyCallEventStatus, receivedCallEvent);
|
|
313 |
|
|
314 |
TRequestStatus notifyCallStatus;
|
|
315 |
RMobileCall::TMobileCallStatus callStatus = RMobileCall::EStatusUnknown;
|
|
316 |
mobileCall.NotifyMobileCallStatusChange(notifyCallStatus, callStatus);
|
|
317 |
|
|
318 |
RArray<RMobileCall::TMobileCallStatus> expectedCallStatuses;
|
|
319 |
CleanupClosePushL(expectedCallStatuses);
|
|
320 |
expectedCallStatuses.AppendL(RMobileCall::EStatusDisconnecting);
|
|
321 |
expectedCallStatuses.AppendL(RMobileCall::EStatusIdle);
|
|
322 |
ClientWaitForCallStatusNotifications(mobileCall, notifyCallStatus, callStatus, expectedCallStatuses, KErrNone);
|
|
323 |
|
|
324 |
User::WaitForRequest(notifyCallEventStatus);
|
|
325 |
ASSERT_EQUALS(KErrNone, notifyCallEventStatus.Int());
|
|
326 |
ASSERT_EQUALS(callEvent, receivedCallEvent);
|
|
327 |
|
|
328 |
expectedCallStatuses.Close();
|
|
329 |
mobileCall.Close();
|
|
330 |
mobileLine.Close();
|
|
331 |
data.Close();
|
|
332 |
|
|
333 |
AssertMockLtsyStatusL();
|
|
334 |
CleanupStack::PopAndDestroy(5, this); // expectedCallStatuses, mobileCall, mobileLine, data, this
|
|
335 |
} // CCTsyCallControlFU::TestUseCase0004L
|
|
336 |
|
|
337 |
|
|
338 |
/**
|
|
339 |
@SYMTestCaseID BA-CTSYD-DIS-CALLCONTROL-UC0005
|
|
340 |
@SYMComponent telephony_ctsy
|
|
341 |
@SYMTestCaseDesc Test support in CTSY for remote party hang up with inband info
|
|
342 |
@SYMTestPriority High
|
|
343 |
@SYMTestActions Dial a voice call, remote party hangs up with inband info
|
|
344 |
@SYMTestExpectedResults Pass
|
|
345 |
@SYMTestType CT
|
|
346 |
*/
|
|
347 |
void CCTsyCallControlFU::TestUseCase0005L()
|
|
348 |
{
|
|
349 |
OpenEtelServerL(EUseExtendedError);
|
|
350 |
CleanupStack::PushL(TCleanupItem(Cleanup, this));
|
|
351 |
OpenPhoneL();
|
|
352 |
|
|
353 |
RBuf8 data;
|
|
354 |
CleanupClosePushL(data);
|
|
355 |
|
|
356 |
TInt callId = 1;
|
|
357 |
RMobilePhone::TMobileService mobileService = RMobilePhone::EVoiceService;
|
|
358 |
DriverDialCallL(callId, mobileService);
|
|
359 |
|
|
360 |
RMobileLine mobileLine;
|
|
361 |
CleanupClosePushL(mobileLine);
|
|
362 |
RMobileCall mobileCall;
|
|
363 |
CleanupClosePushL(mobileCall);
|
|
364 |
ClientDialCallL(mobileLine, mobileCall, mobileService);
|
|
365 |
|
|
366 |
DriverCompleteSuccessfulHangUpNotificationsL(callId, ETrue, KErrGsmCCNormalCallClearing);
|
|
367 |
|
|
368 |
TRequestStatus notifyCallStatus;
|
|
369 |
RMobileCall::TMobileCallStatus callStatus = RMobileCall::EStatusUnknown;
|
|
370 |
mobileCall.NotifyMobileCallStatusChange(notifyCallStatus, callStatus);
|
|
371 |
|
|
372 |
RArray<RMobileCall::TMobileCallStatus> expectedCallStatuses;
|
|
373 |
CleanupClosePushL(expectedCallStatuses);
|
|
374 |
expectedCallStatuses.AppendL(RMobileCall::EStatusDisconnectingWithInband);
|
|
375 |
expectedCallStatuses.AppendL(RMobileCall::EStatusIdle);
|
|
376 |
ClientWaitForCallStatusNotifications(mobileCall, notifyCallStatus, callStatus, expectedCallStatuses, KErrNone);
|
|
377 |
|
|
378 |
expectedCallStatuses.Close();
|
|
379 |
mobileCall.Close();
|
|
380 |
mobileLine.Close();
|
|
381 |
data.Close();
|
|
382 |
|
|
383 |
AssertMockLtsyStatusL();
|
|
384 |
CleanupStack::PopAndDestroy(5, this); // expectedCallStatuses, mobileCall, mobileLine, data, this
|
|
385 |
} // CCTsyCallControlFU::TestUseCase0005L
|
|
386 |
|
|
387 |
|
|
388 |
/**
|
|
389 |
@SYMTestCaseID BA-CTSYD-DIS-CALLCONTROL-UC0006
|
|
390 |
@SYMComponent telephony_ctsy
|
|
391 |
@SYMTestCaseDesc Test support in CTSY for mobile originated data call
|
|
392 |
@SYMTestPriority High
|
|
393 |
@SYMTestActions Invokes Dials a data call, receives call status notifications, loan and recover the data port, hang up call.
|
|
394 |
@SYMTestExpectedResults Pass
|
|
395 |
@SYMTestType CT
|
|
396 |
*/
|
|
397 |
void CCTsyCallControlFU::TestUseCase0006L()
|
|
398 |
{
|
|
399 |
OpenEtelServerL(EUseExtendedError);
|
|
400 |
CleanupStack::PushL(TCleanupItem(Cleanup, this));
|
|
401 |
OpenPhoneL();
|
|
402 |
|
|
403 |
RBuf8 data;
|
|
404 |
CleanupClosePushL(data);
|
|
405 |
|
|
406 |
TInt callId = 1;
|
|
407 |
RMobilePhone::TMobileService mobileService = RMobilePhone::ECircuitDataService;
|
|
408 |
|
|
409 |
DriverDialCallL(callId, mobileService);
|
|
410 |
|
|
411 |
// KMockLtsyDispatchCallControlNotifyDataCallCapsChangeIndId
|
|
412 |
RMobileCall::TMobileCallDataCapsV1 completeCallCaps;
|
|
413 |
completeCallCaps.iSpeedCaps = RMobileCall::KCapsSpeed48000;
|
|
414 |
completeCallCaps.iProtocolCaps = RMobileCall::KCapsProtocolV34;
|
|
415 |
completeCallCaps.iServiceCaps = RMobileCall::KCapsPacketAccessSyncUDI;
|
|
416 |
completeCallCaps.iQoSCaps = RMobileCall::KCapsTransparentPreferred;
|
|
417 |
completeCallCaps.iHscsdSupport = ETrue;
|
|
418 |
completeCallCaps.iMClass = 2;
|
|
419 |
completeCallCaps.iMaxRxTimeSlots = 4;
|
|
420 |
completeCallCaps.iMaxTxTimeSlots = 8;
|
|
421 |
completeCallCaps.iTotalRxTxTimeSlots = 10;
|
|
422 |
completeCallCaps.iCodingCaps = RMobileCall::KCapsAiurCoding96;
|
|
423 |
completeCallCaps.iAsymmetryCaps = RMobileCall::KCapsAsymmetryDownlink;
|
|
424 |
completeCallCaps.iUserInitUpgrade = ETrue;
|
|
425 |
completeCallCaps.iRLPVersionCaps = RMobileCall::KCapsRLPSingleLinkVersion1;
|
|
426 |
completeCallCaps.iV42bisCaps = RMobileCall::KCapsV42bisRxDirection;
|
|
427 |
data.Close();
|
|
428 |
TMockLtsyCallData1<RMobileCall::TMobileCallDataCapsV1>
|
|
429 |
completeDataCapsData(callId, RMobilePhone::EServiceUnspecified, completeCallCaps);
|
|
430 |
completeDataCapsData.SerialiseL(data);
|
|
431 |
iMockLTSY.CompleteL(KMockLtsyDispatchCallControlNotifyDataCallCapsChangeIndId, KErrNone, data);
|
|
432 |
|
|
433 |
|
|
434 |
_LIT(KDataPort, "DATAPORT::0");
|
|
435 |
RCall::TCommPort commPort;
|
|
436 |
commPort.iPort = KDataPort;
|
|
437 |
data.Close();
|
|
438 |
TMockLtsyData2<TInt,RCall::TCommPort> loanDataPortExpData(callId,commPort);
|
|
439 |
loanDataPortExpData.SerialiseL(data);
|
|
440 |
iMockLTSY.ExpectL(MLtsyDispatchCallControlLoanDataPort::KLtsyDispatchCallControlLoanDataPortApiId, data);
|
|
441 |
iMockLTSY.ExpectL(MLtsyDispatchCallControlRecoverDataPort::KLtsyDispatchCallControlRecoverDataPortApiId, data);
|
|
442 |
|
|
443 |
|
|
444 |
// MLtsyDispatchCallControlSetDynamicHscsdParams::KLtsyDispatchCallControlSetDynamicHscsdParamsApiId
|
|
445 |
RMobileCall::TMobileHscsdCallParamsV8 hscsdParams;
|
|
446 |
hscsdParams.iWantedAiur = RMobileCall::EAiurBps38400;
|
|
447 |
hscsdParams.iWantedRxTimeSlots = 2;
|
|
448 |
data.Close();
|
|
449 |
TMockLtsyData2<TInt, RMobileCall::TMobileHscsdCallParamsV8> paramData(callId, hscsdParams);
|
|
450 |
paramData.SerialiseL(data);
|
|
451 |
iMockLTSY.ExpectL(MLtsyDispatchCallControlSetDynamicHscsdParams::KLtsyDispatchCallControlSetDynamicHscsdParamsApiId, data);
|
|
452 |
|
|
453 |
TMockLtsyData1<TInt> mockParamData(callId);
|
|
454 |
data.Close();
|
|
455 |
mockParamData.SerialiseL(data);
|
|
456 |
iMockLTSY.CompleteL(MLtsyDispatchCallControlSetDynamicHscsdParams::KLtsyDispatchCallControlSetDynamicHscsdParamsApiId, KErrNone, data);
|
|
457 |
|
|
458 |
// KMockLtsyDispatchCallControlNotifyHscsdInfoChangeIndId
|
|
459 |
RMobileCall::TMobileCallHscsdInfoV8 hscsdInfo;
|
|
460 |
hscsdInfo.iCodings = RMobileCall::ETchCoding320;
|
|
461 |
hscsdInfo.iAiur = RMobileCall::EAiurBps38400;
|
|
462 |
hscsdInfo.iRxTimeSlots = 2;
|
|
463 |
hscsdInfo.iTxTimeSlots = 2;
|
|
464 |
|
|
465 |
RMobileCall::TMobileCallDataCapsV1 completeCallCaps2 = completeCallCaps;
|
|
466 |
completeCallCaps2.iHscsdSupport = ETrue;
|
|
467 |
completeCallCaps2.iSpeedCaps = RMobileCall::KCapsSpeed57600;
|
|
468 |
completeCallCaps2.iMaxRxTimeSlots = 3;
|
|
469 |
completeCallCaps2.iMaxTxTimeSlots = 5;
|
|
470 |
|
|
471 |
TMockLtsyCallData2<RMobileCall::TMobileCallHscsdInfoV8, RMobileCall::TMobileCallDataCapsV1>
|
|
472 |
hscsdData(1, RMobilePhone::ECircuitDataService, hscsdInfo, completeCallCaps2);
|
|
473 |
data.Close();
|
|
474 |
hscsdData.SerialiseL(data);
|
|
475 |
|
|
476 |
iMockLTSY.CompleteL(KMockLtsyDispatchCallControlNotifyHscsdInfoChangeIndId, KErrNone, data);
|
|
477 |
|
|
478 |
TInt hangUpCause = KErrGsmCCNormalCallClearing;
|
|
479 |
DriverHangUpCallL(callId, hangUpCause);
|
|
480 |
|
|
481 |
// Client Side Test
|
|
482 |
|
|
483 |
RMobileLine mobileLine;
|
|
484 |
CleanupClosePushL(mobileLine);
|
|
485 |
RMobileCall mobileCall;
|
|
486 |
CleanupClosePushL(mobileCall);
|
|
487 |
|
|
488 |
ClientDialCallL(mobileLine, mobileCall, mobileService);
|
|
489 |
|
|
490 |
RCall::TCommPort dataPort;
|
|
491 |
TRequestStatus reqStatus;
|
|
492 |
mobileCall.LoanDataPort(reqStatus, dataPort);
|
|
493 |
User::WaitForRequest(reqStatus);
|
|
494 |
ASSERT_EQUALS(KErrNone, reqStatus.Int());
|
|
495 |
ASSERT_EQUALS(0, dataPort.iPort.Compare(KDataPort()));
|
|
496 |
|
|
497 |
TInt err = mobileCall.RecoverDataPort();
|
|
498 |
ASSERT_EQUALS(KErrNone, err);
|
|
499 |
|
|
500 |
RMobileCall::TMobileCallDataCapsV1 callCaps;
|
|
501 |
RMobileCall::TMobileCallDataCapsV1Pckg callCapsPckg(callCaps);
|
|
502 |
mobileCall.GetMobileDataCallCaps(callCapsPckg);
|
|
503 |
ASSERT_TRUE(TComparator<RMobileCall::TMobileCallDataCapsV1>::IsEqual(completeCallCaps, callCaps));
|
|
504 |
|
|
505 |
TRequestStatus hscsdInfoStatus;
|
|
506 |
RMobileCall::TMobileCallHscsdInfoV8 hscsdInfo2;
|
|
507 |
RMobileCall::TMobileCallHscsdInfoV8Pckg hscsdInfoPckg(hscsdInfo2);
|
|
508 |
mobileCall.NotifyHscsdInfoChange(hscsdInfoStatus, hscsdInfoPckg);
|
|
509 |
|
|
510 |
TRequestStatus dataCallCapsStatus;
|
|
511 |
RMobileCall::TMobileCallDataCapsV1 dataCallCaps2;
|
|
512 |
RMobileCall::TMobileCallDataCapsV1Pckg dataCallCapsPckg(dataCallCaps2);
|
|
513 |
mobileCall.NotifyMobileDataCallCapsChange(dataCallCapsStatus, dataCallCapsPckg);
|
|
514 |
|
|
515 |
TRequestStatus hscsdParamStatus;
|
|
516 |
mobileCall.SetDynamicHscsdParams(hscsdParamStatus, hscsdParams.iWantedAiur, hscsdParams.iWantedRxTimeSlots);
|
|
517 |
User::WaitForRequest(hscsdParamStatus);
|
|
518 |
|
|
519 |
User::WaitForRequest(hscsdInfoStatus);
|
|
520 |
ASSERT_EQUALS(KErrNone, hscsdInfoStatus.Int());
|
|
521 |
ASSERT_EQUALS(hscsdInfo2.iAiur, hscsdInfo.iAiur);
|
|
522 |
ASSERT_EQUALS(hscsdInfo2.iRxTimeSlots, hscsdInfo.iRxTimeSlots);
|
|
523 |
ASSERT_EQUALS(hscsdInfo2.iTxTimeSlots, hscsdInfo.iTxTimeSlots);
|
|
524 |
ASSERT_EQUALS(hscsdInfo2.iCodings, hscsdInfo.iCodings);
|
|
525 |
|
|
526 |
User::WaitForRequest(dataCallCapsStatus);
|
|
527 |
ASSERT_EQUALS(KErrNone, dataCallCapsStatus.Int());
|
|
528 |
ASSERT_EQUALS(completeCallCaps2.iSpeedCaps, dataCallCaps2.iSpeedCaps);
|
|
529 |
ASSERT_EQUALS(completeCallCaps2.iHscsdSupport, dataCallCaps2.iHscsdSupport);
|
|
530 |
ASSERT_EQUALS(completeCallCaps2.iMaxRxTimeSlots, dataCallCaps2.iMaxRxTimeSlots);
|
|
531 |
ASSERT_EQUALS(completeCallCaps2.iMaxTxTimeSlots, dataCallCaps2.iMaxTxTimeSlots);
|
|
532 |
|
|
533 |
TRequestStatus reqStatusTerminated;
|
|
534 |
iMockLTSY.NotifyTerminated(reqStatusTerminated);
|
|
535 |
ClientHangUpCallL(mobileCall);
|
|
536 |
|
|
537 |
mobileCall.Close();
|
|
538 |
mobileLine.Close();
|
|
539 |
data.Close();
|
|
540 |
|
|
541 |
User::WaitForRequest(reqStatusTerminated);
|
|
542 |
ASSERT_EQUALS(KErrNone, reqStatusTerminated.Int());
|
|
543 |
|
|
544 |
AssertMockLtsyStatusL();
|
|
545 |
CleanupStack::PopAndDestroy(4, this); // mobileCall, mobileLine, data, this
|
|
546 |
} // CCTsyCallControlFU::TestUseCase0006L
|
|
547 |
|
|
548 |
/**
|
|
549 |
@SYMTestCaseID BA-CTSYD-DIS-CALLCONTROL-UC0007
|
|
550 |
@SYMComponent telephony_ctsy
|
|
551 |
@SYMTestCaseDesc Test support in CTSY for incoming voice call accepted
|
|
552 |
@SYMTestPriority High
|
|
553 |
@SYMTestActions Requests notification of an incoming call, incoming call arrives, answer the call, hang up
|
|
554 |
@SYMTestExpectedResults Pass
|
|
555 |
@SYMTestType CT
|
|
556 |
*/
|
|
557 |
void CCTsyCallControlFU::TestUseCase0007L()
|
|
558 |
{
|
|
559 |
OpenEtelServerL(EUseExtendedError);
|
|
560 |
CleanupStack::PushL(TCleanupItem(Cleanup, this));
|
|
561 |
OpenPhoneL();
|
|
562 |
|
|
563 |
RBuf8 data;
|
|
564 |
CleanupClosePushL(data);
|
|
565 |
|
|
566 |
TInt callId = 1;
|
|
567 |
RMobilePhone::TMobileService mobileService = RMobilePhone::EVoiceService;
|
|
568 |
TName incomingCallName;
|
|
569 |
|
|
570 |
RMobileLine mobileLine;
|
|
571 |
CleanupClosePushL(mobileLine);
|
|
572 |
RMobileCall mobileCall;
|
|
573 |
CleanupClosePushL(mobileCall);
|
|
574 |
ASSERT_EQUALS(KErrNone, OpenLineAndCallL(mobileLine, mobileCall, RMobilePhone::EVoiceService));
|
|
575 |
mobileCall.Close();
|
|
576 |
CleanupStack::Pop(&mobileCall);
|
|
577 |
|
|
578 |
// Create an incoming call and answer it
|
|
579 |
|
|
580 |
DriverCreateIncomingCallL(callId, mobileService);
|
|
581 |
|
|
582 |
DriverCompleteGetMobileCallInfoL(callId, mobileService);
|
|
583 |
|
|
584 |
DriverAnswerIncomingCallL(callId, mobileService);
|
|
585 |
|
|
586 |
TInt hangUpCause = KErrGsmCCNormalCallClearing;
|
|
587 |
DriverHangUpCallL(callId, hangUpCause);
|
|
588 |
|
|
589 |
// Create another incoming call but fail to answer this one
|
|
590 |
|
|
591 |
DriverCreateIncomingCallL(callId, mobileService);
|
|
592 |
|
|
593 |
DriverCompleteGetMobileCallInfoL(callId, mobileService);
|
|
594 |
|
|
595 |
DriverAnswerIncomingCallL(callId, mobileService, EFalse, KErrGeneral);
|
|
596 |
|
|
597 |
// Client side test
|
|
598 |
|
|
599 |
ClientWaitForIncomingCallNotificationLC(mobileCall, mobileLine, incomingCallName);
|
|
600 |
|
|
601 |
ClientAnswerIncomingCallL(mobileCall);
|
|
602 |
|
|
603 |
ClientHangUpCallL(mobileCall);
|
|
604 |
|
|
605 |
mobileCall.Close();
|
|
606 |
CleanupStack::Pop(&mobileCall);
|
|
607 |
|
|
608 |
ClientWaitForIncomingCallNotificationLC(mobileCall, mobileLine, incomingCallName);
|
|
609 |
|
|
610 |
ClientAnswerIncomingCallL(mobileCall, KErrGeneral);
|
|
611 |
|
|
612 |
mobileCall.Close();
|
|
613 |
mobileLine.Close();
|
|
614 |
data.Close();
|
|
615 |
|
|
616 |
AssertMockLtsyStatusL();
|
|
617 |
CleanupStack::PopAndDestroy(4, this); // mobileCall, mobileLine, data, this
|
|
618 |
} // CCTsyCallControlFU::TestUseCase0007L
|
|
619 |
|
|
620 |
|
|
621 |
/**
|
|
622 |
@SYMTestCaseID BA-CTSYD-DIS-CALLCONTROL-UC0008
|
|
623 |
@SYMComponent telephony_ctsy
|
|
624 |
@SYMTestCaseDesc Test support in CTSY for incoming voice call rejected
|
|
625 |
@SYMTestPriority High
|
|
626 |
@SYMTestActions Invokes actions
|
|
627 |
@SYMTestExpectedResults Pass
|
|
628 |
@SYMTestType CT
|
|
629 |
*/
|
|
630 |
void CCTsyCallControlFU::TestUseCase0008L()
|
|
631 |
{
|
|
632 |
OpenEtelServerL(EUseExtendedError);
|
|
633 |
CleanupStack::PushL(TCleanupItem(Cleanup, this));
|
|
634 |
OpenPhoneL();
|
|
635 |
|
|
636 |
RBuf8 data;
|
|
637 |
CleanupClosePushL(data);
|
|
638 |
|
|
639 |
TInt callId = 1;
|
|
640 |
RMobilePhone::TMobileService mobileService = RMobilePhone::EVoiceService;
|
|
641 |
TName incomingCallName;
|
|
642 |
|
|
643 |
RMobileLine mobileLine;
|
|
644 |
CleanupClosePushL(mobileLine);
|
|
645 |
RMobileCall mobileCall;
|
|
646 |
CleanupClosePushL(mobileCall);
|
|
647 |
ASSERT_EQUALS(KErrNone, OpenLineAndCallL(mobileLine, mobileCall, RMobilePhone::EVoiceService));
|
|
648 |
mobileCall.Close();
|
|
649 |
CleanupStack::Pop(&mobileCall);
|
|
650 |
|
|
651 |
DriverCreateIncomingCallL(callId, mobileService);
|
|
652 |
|
|
653 |
DriverCompleteGetMobileCallInfoL(callId, mobileService);
|
|
654 |
|
|
655 |
// KErrGsmBusyUserRequest hardcoded to be sent by CTSY to LTSY,
|
|
656 |
// mapped to KErrGsmCCUserBusy
|
|
657 |
TInt hangUpCause = KErrGsmCCUserBusy;
|
|
658 |
TMockLtsyData2<TInt, TInt> mockData2(callId, hangUpCause);
|
|
659 |
data.Close();
|
|
660 |
mockData2.SerialiseL(data);
|
|
661 |
iMockLTSY.ExpectL(MLtsyDispatchCallControlHangUp::KLtsyDispatchCallControlHangUpApiId, data);
|
|
662 |
DriverCompleteSuccessfulHangUpNotificationsL(callId, EFalse, KErrGsmCCCallRejected, EFalse);
|
|
663 |
|
|
664 |
// Client side test
|
|
665 |
|
|
666 |
ClientWaitForIncomingCallNotificationLC(mobileCall, mobileLine, incomingCallName);
|
|
667 |
|
|
668 |
ClientHangUpCallL(mobileCall);
|
|
669 |
|
|
670 |
AssertMockLtsyStatusL();
|
|
671 |
CleanupStack::PopAndDestroy(4, this); // mobileCall, mobileLine, data, this
|
|
672 |
} // CCTsyCallControlFU::TestUseCase0008L
|
|
673 |
|
|
674 |
/**
|
|
675 |
@SYMTestCaseID BA-CTSYD-DIS-CALLCONTROL-UC0009
|
|
676 |
@SYMComponent telephony_ctsy
|
|
677 |
@SYMTestCaseDesc Test support in CTSY for cancel dialling a call when it is still in dialling state.
|
|
678 |
@SYMTestPriority High
|
|
679 |
@SYMTestActions Invokes dialling a call and then cancelling the dial during dialling process.
|
|
680 |
@SYMTestExpectedResults Pass
|
|
681 |
@SYMTestType CT
|
|
682 |
*/
|
|
683 |
void CCTsyCallControlFU::TestUseCase0009L()
|
|
684 |
{
|
|
685 |
OpenEtelServerL(EUseExtendedError);
|
|
686 |
CleanupStack::PushL(TCleanupItem(Cleanup, this));
|
|
687 |
OpenPhoneL();
|
|
688 |
|
|
689 |
RBuf8 data;
|
|
690 |
CleanupClosePushL(data);
|
|
691 |
|
|
692 |
TInt callId = 1;
|
|
693 |
RMobilePhone::TMobileService mobileService = RMobilePhone::EVoiceService;
|
|
694 |
|
|
695 |
DriverExpectDialCallRequestL(callId, mobileService, KErrNone);
|
|
696 |
|
|
697 |
// Complete KLtsyDispatchCallControlNotifyCallStatusChangeApiId with dialling
|
|
698 |
RMobileCall::TMobileCallStatus callStatus = RMobileCall::EStatusDialling;
|
|
699 |
TMockLtsyCallData1<RMobileCall::TMobileCallStatus> mockCallData(
|
|
700 |
callId, RMobilePhone::EServiceUnspecified, callStatus);
|
|
701 |
data.Close();
|
|
702 |
mockCallData.SerialiseL(data);
|
|
703 |
iMockLTSY.CompleteL(KMockLtsyDispatchCallControlNotifyCallStatusChangeIndId, KErrNone, data);
|
|
704 |
|
|
705 |
TInt hangUpCause = KErrGsmCCNormalCallClearing; // This cause always passed by CTSY in this situation
|
|
706 |
TMockLtsyData2<TInt, TInt> mockData2(callId, hangUpCause);
|
|
707 |
data.Close();
|
|
708 |
mockData2.SerialiseL(data);
|
|
709 |
iMockLTSY.ExpectL(MLtsyDispatchCallControlHangUp::KLtsyDispatchCallControlHangUpApiId, data);
|
|
710 |
|
|
711 |
DriverCompleteSuccessfulHangUpNotificationsL(callId, EFalse, KErrGsmCCNormalCallClearing, EFalse);
|
|
712 |
|
|
713 |
// Client side test
|
|
714 |
|
|
715 |
RMobileLine mobileLine;
|
|
716 |
CleanupClosePushL(mobileLine);
|
|
717 |
RMobileCall mobileCall;
|
|
718 |
CleanupClosePushL(mobileCall);
|
|
719 |
ASSERT_EQUALS(KErrNone, OpenLineAndCallL(mobileLine, mobileCall, RMobilePhone::EVoiceService));
|
|
720 |
|
|
721 |
TRequestStatus notifyCallStatus;
|
|
722 |
callStatus = RMobileCall::EStatusUnknown;
|
|
723 |
mobileCall.NotifyMobileCallStatusChange(notifyCallStatus, callStatus);
|
|
724 |
|
|
725 |
RMobileCall::TMobileCallParamsV1 callParams;
|
|
726 |
RMobileCall::TMobileCallParamsV1Pckg callParamsPckg(callParams);
|
|
727 |
callParams.iAutoRedial = ETrue;
|
|
728 |
callParams.iIdRestrict = RMobileCall::ESendMyId;
|
|
729 |
TRequestStatus dialStatus;
|
|
730 |
mobileCall.Dial(dialStatus, callParamsPckg, KPhoneNumber);
|
|
731 |
|
|
732 |
User::WaitForRequest(notifyCallStatus);
|
|
733 |
ASSERT_EQUALS(KErrNone, notifyCallStatus.Int());
|
|
734 |
ASSERT_EQUALS(RMobileCall::EStatusDialling, callStatus);
|
|
735 |
|
|
736 |
mobileCall.NotifyMobileCallStatusChange(notifyCallStatus, callStatus);
|
|
737 |
|
|
738 |
mobileCall.DialCancel();
|
|
739 |
|
|
740 |
RArray<RMobileCall::TMobileCallStatus> expectedCallStatuses;
|
|
741 |
CleanupClosePushL(expectedCallStatuses);
|
|
742 |
expectedCallStatuses.AppendL(RMobileCall::EStatusDisconnecting);
|
|
743 |
expectedCallStatuses.AppendL(RMobileCall::EStatusIdle);
|
|
744 |
ClientWaitForCallStatusNotifications(mobileCall, notifyCallStatus, callStatus, expectedCallStatuses, KErrNone);
|
|
745 |
|
|
746 |
User::WaitForRequest(dialStatus);
|
|
747 |
ASSERT_EQUALS(KErrCancel, dialStatus.Int());
|
|
748 |
|
|
749 |
expectedCallStatuses.Close();
|
|
750 |
mobileLine.Close();
|
|
751 |
mobileCall.Close();
|
|
752 |
|
|
753 |
AssertMockLtsyStatusL();
|
|
754 |
CleanupStack::PopAndDestroy(5, this); // expectedCallStatuses, mobileCall, mobileLine, data, this
|
|
755 |
} // CCTsyCallControlFU::TestUseCase0009L
|
|
756 |
|
|
757 |
/**
|
|
758 |
@SYMTestCaseID BA-CTSYD-DIS-CALLCONTROL-UC0010
|
|
759 |
@SYMComponent telephony_ctsy
|
|
760 |
@SYMTestCaseDesc Test support in CTSY for cancelling dial request when call is connecting
|
|
761 |
@SYMTestPriority High
|
|
762 |
@SYMTestActions Invokes dialling a call and cancelling the dial request when call reaches connecting state
|
|
763 |
@SYMTestExpectedResults Pass
|
|
764 |
@SYMTestType CT
|
|
765 |
*/
|
|
766 |
void CCTsyCallControlFU::TestUseCase0010L()
|
|
767 |
{
|
|
768 |
OpenEtelServerL(EUseExtendedError);
|
|
769 |
CleanupStack::PushL(TCleanupItem(Cleanup, this));
|
|
770 |
OpenPhoneL();
|
|
771 |
|
|
772 |
RBuf8 data;
|
|
773 |
CleanupClosePushL(data);
|
|
774 |
|
|
775 |
TInt callId = 1;
|
|
776 |
RMobilePhone::TMobileService mobileService = RMobilePhone::EVoiceService;
|
|
777 |
|
|
778 |
DriverExpectDialCallRequestL(callId, mobileService, KErrNone);
|
|
779 |
|
|
780 |
// Complete KLtsyDispatchCallControlNotifyCallStatusChangeApiId with dialling
|
|
781 |
RArray<RMobileCall::TMobileCallStatus> arrayCallStatus;
|
|
782 |
CleanupClosePushL(arrayCallStatus);
|
|
783 |
arrayCallStatus.AppendL(RMobileCall::EStatusDialling);
|
|
784 |
arrayCallStatus.AppendL(RMobileCall::EStatusConnecting);
|
|
785 |
DriverCompleteCallStatusChangeNotificationsL(arrayCallStatus, callId, KErrNone);
|
|
786 |
arrayCallStatus.Close();
|
|
787 |
|
|
788 |
TInt hangUpCause = KErrGsmCCNormalCallClearing; // This cause always passed by CTSY in this situation
|
|
789 |
TMockLtsyData2<TInt, TInt> mockData2(callId, hangUpCause);
|
|
790 |
data.Close();
|
|
791 |
mockData2.SerialiseL(data);
|
|
792 |
iMockLTSY.ExpectL(MLtsyDispatchCallControlHangUp::KLtsyDispatchCallControlHangUpApiId, data);
|
|
793 |
|
|
794 |
DriverCompleteSuccessfulHangUpNotificationsL(callId, EFalse, KErrGsmCCNormalCallClearing, EFalse);
|
|
795 |
|
|
796 |
// Client side test
|
|
797 |
|
|
798 |
RMobileLine mobileLine;
|
|
799 |
CleanupClosePushL(mobileLine);
|
|
800 |
RMobileCall mobileCall;
|
|
801 |
CleanupClosePushL(mobileCall);
|
|
802 |
ASSERT_EQUALS(KErrNone, OpenLineAndCallL(mobileLine, mobileCall, RMobilePhone::EVoiceService));
|
|
803 |
|
|
804 |
TRequestStatus notifyCallStatus;
|
|
805 |
RMobileCall::TMobileCallStatus callStatus = RMobileCall::EStatusUnknown;
|
|
806 |
mobileCall.NotifyMobileCallStatusChange(notifyCallStatus, callStatus);
|
|
807 |
|
|
808 |
RMobileCall::TMobileCallParamsV1 callParams;
|
|
809 |
RMobileCall::TMobileCallParamsV1Pckg callParamsPckg(callParams);
|
|
810 |
callParams.iAutoRedial = ETrue;
|
|
811 |
callParams.iIdRestrict = RMobileCall::ESendMyId;
|
|
812 |
TRequestStatus dialStatus;
|
|
813 |
mobileCall.Dial(dialStatus, callParamsPckg, KPhoneNumber);
|
|
814 |
|
|
815 |
RArray<RMobileCall::TMobileCallStatus> expectedCallStatuses;
|
|
816 |
CleanupClosePushL(expectedCallStatuses);
|
|
817 |
expectedCallStatuses.AppendL(RMobileCall::EStatusDialling);
|
|
818 |
expectedCallStatuses.AppendL(RMobileCall::EStatusConnecting);
|
|
819 |
ClientWaitForCallStatusNotifications(mobileCall, notifyCallStatus, callStatus, expectedCallStatuses, KErrNone);
|
|
820 |
|
|
821 |
mobileCall.NotifyMobileCallStatusChange(notifyCallStatus, callStatus);
|
|
822 |
|
|
823 |
mobileCall.DialCancel();
|
|
824 |
|
|
825 |
expectedCallStatuses.Close();
|
|
826 |
expectedCallStatuses.AppendL(RMobileCall::EStatusDisconnecting);
|
|
827 |
expectedCallStatuses.AppendL(RMobileCall::EStatusIdle);
|
|
828 |
ClientWaitForCallStatusNotifications(mobileCall, notifyCallStatus, callStatus, expectedCallStatuses, KErrNone);
|
|
829 |
|
|
830 |
User::WaitForRequest(dialStatus);
|
|
831 |
ASSERT_EQUALS(KErrCancel, dialStatus.Int());
|
|
832 |
|
|
833 |
expectedCallStatuses.Close();
|
|
834 |
arrayCallStatus.Close();
|
|
835 |
mobileLine.Close();
|
|
836 |
mobileCall.Close();
|
|
837 |
|
|
838 |
AssertMockLtsyStatusL();
|
|
839 |
CleanupStack::PopAndDestroy(6, this); // expectedCallStatuses, mobileCall, mobileLine, arrayCallStatus, data, this
|
|
840 |
} // CCTsyCallControlFU::TestUseCase0010L
|
|
841 |
|
|
842 |
/**
|
|
843 |
@SYMTestCaseID BA-CTSYD-DIS-CALLCONTROL-UC0011
|
|
844 |
@SYMComponent telephony_ctsy
|
|
845 |
@SYMTestCaseDesc Test support in CTSY for missed incoming call
|
|
846 |
@SYMTestPriority High
|
|
847 |
@SYMTestActions Invokes requesting an incoming call, line rings, call is not answered, call disconnects
|
|
848 |
@SYMTestExpectedResults Pass
|
|
849 |
@SYMTestType CT
|
|
850 |
*/
|
|
851 |
void CCTsyCallControlFU::TestUseCase0011L()
|
|
852 |
{
|
|
853 |
OpenEtelServerL(EUseExtendedError);
|
|
854 |
CleanupStack::PushL(TCleanupItem(Cleanup, this));
|
|
855 |
OpenPhoneL();
|
|
856 |
|
|
857 |
RBuf8 data;
|
|
858 |
CleanupClosePushL(data);
|
|
859 |
|
|
860 |
TInt callId = 1;
|
|
861 |
RMobilePhone::TMobileService mobileService = RMobilePhone::EVoiceService;
|
|
862 |
TName incomingCallName;
|
|
863 |
|
|
864 |
RMobileLine mobileLine;
|
|
865 |
CleanupClosePushL(mobileLine);
|
|
866 |
RMobileCall mobileCall;
|
|
867 |
CleanupClosePushL(mobileCall);
|
|
868 |
ASSERT_EQUALS(KErrNone, OpenLineAndCallL(mobileLine, mobileCall, RMobilePhone::EVoiceService));
|
|
869 |
mobileCall.Close();
|
|
870 |
CleanupStack::Pop(&mobileCall);
|
|
871 |
|
|
872 |
DriverCreateIncomingCallL(callId, mobileService);
|
|
873 |
|
|
874 |
DriverCompleteGetMobileCallInfoL(callId, mobileService);
|
|
875 |
|
|
876 |
ClientWaitForIncomingCallNotificationLC(mobileCall, mobileLine, incomingCallName);
|
|
877 |
|
|
878 |
DriverCompleteSuccessfulHangUpNotificationsL(callId, EFalse, KErrGsmCCNormalCallClearing, EFalse);
|
|
879 |
|
|
880 |
TRequestStatus notifyCallStatus;
|
|
881 |
RMobileCall::TMobileCallStatus callStatus;
|
|
882 |
mobileCall.NotifyMobileCallStatusChange(notifyCallStatus, callStatus);
|
|
883 |
|
|
884 |
RArray<RMobileCall::TMobileCallStatus> expectedCallStatuses;
|
|
885 |
CleanupClosePushL(expectedCallStatuses);
|
|
886 |
expectedCallStatuses.AppendL(RMobileCall::EStatusDisconnecting);
|
|
887 |
expectedCallStatuses.AppendL(RMobileCall::EStatusIdle);
|
|
888 |
|
|
889 |
ClientWaitForCallStatusNotifications(mobileCall, notifyCallStatus, callStatus, expectedCallStatuses, KErrNone);
|
|
890 |
|
|
891 |
expectedCallStatuses.Close();
|
|
892 |
mobileCall.Close();
|
|
893 |
mobileLine.Close();
|
|
894 |
data.Close();
|
|
895 |
|
|
896 |
AssertMockLtsyStatusL();
|
|
897 |
CleanupStack::PopAndDestroy(5, this); // expectedCallStatuses, mobileCall, mobileLine, data, this
|
|
898 |
} // CCTsyCallControlFU::TestUseCase0011L
|
|
899 |
|
|
900 |
|
|
901 |
/**
|
|
902 |
@SYMTestCaseID BA-CTSYD-DIS-CALLCONTROL-UC0012
|
|
903 |
@SYMComponent telephony_ctsy
|
|
904 |
@SYMTestCaseDesc Test support in CTSY for holding, resuming a call
|
|
905 |
@SYMTestPriority High
|
|
906 |
@SYMTestActions Invokes dialling a call, holding it, then resuming it
|
|
907 |
@SYMTestExpectedResults Pass
|
|
908 |
@SYMTestType CT
|
|
909 |
*/
|
|
910 |
void CCTsyCallControlFU::TestUseCase0012L()
|
|
911 |
{
|
|
912 |
OpenEtelServerL(EUseExtendedError);
|
|
913 |
CleanupStack::PushL(TCleanupItem(Cleanup, this));
|
|
914 |
OpenPhoneL();
|
|
915 |
|
|
916 |
RBuf8 data;
|
|
917 |
CleanupClosePushL(data);
|
|
918 |
|
|
919 |
TInt callId = 1;
|
|
920 |
RMobilePhone::TMobileService mobileService = RMobilePhone::EVoiceService;
|
|
921 |
DriverDialCallL(callId, mobileService);
|
|
922 |
|
|
923 |
// Hold call
|
|
924 |
DriverHoldCallL(callId, KErrNone);
|
|
925 |
|
|
926 |
// Resume call
|
|
927 |
DriverResumeCallL(callId, KErrNone);
|
|
928 |
|
|
929 |
// Swap single call.
|
|
930 |
DriverSwapCallL(callId, KErrNone, RMobileCall::EStatusHold);
|
|
931 |
|
|
932 |
// Swap single call again.
|
|
933 |
DriverSwapCallL(callId, KErrNone, RMobileCall::EStatusConnected);
|
|
934 |
|
|
935 |
TInt hangUpCause = KErrGsmCCNormalCallClearing;
|
|
936 |
DriverHangUpCallL(callId, hangUpCause);
|
|
937 |
|
|
938 |
// Client Side Test
|
|
939 |
|
|
940 |
RMobileLine mobileLine;
|
|
941 |
CleanupClosePushL(mobileLine);
|
|
942 |
RMobileCall mobileCall;
|
|
943 |
CleanupClosePushL(mobileCall);
|
|
944 |
ClientDialCallL(mobileLine, mobileCall, mobileService);
|
|
945 |
|
|
946 |
TRequestStatus notifyStatus;
|
|
947 |
RMobileCall::TMobileCallStatus callStatus;
|
|
948 |
mobileCall.NotifyMobileCallStatusChange(notifyStatus, callStatus);
|
|
949 |
|
|
950 |
TRequestStatus holdStatus;
|
|
951 |
mobileCall.Hold(holdStatus);
|
|
952 |
User::WaitForRequest(holdStatus);
|
|
953 |
ASSERT_EQUALS(KErrNone, holdStatus.Int());
|
|
954 |
|
|
955 |
User::WaitForRequest(notifyStatus);
|
|
956 |
ASSERT_EQUALS(KErrNone, notifyStatus.Int());
|
|
957 |
ASSERT_EQUALS(RMobileCall::EStatusHold, callStatus);
|
|
958 |
|
|
959 |
mobileCall.NotifyMobileCallStatusChange(notifyStatus, callStatus);
|
|
960 |
|
|
961 |
TRequestStatus resumeStatus;
|
|
962 |
mobileCall.Resume(resumeStatus);
|
|
963 |
User::WaitForRequest(resumeStatus);
|
|
964 |
ASSERT_EQUALS(KErrNone, resumeStatus.Int());
|
|
965 |
|
|
966 |
User::WaitForRequest(notifyStatus);
|
|
967 |
ASSERT_EQUALS(KErrNone, notifyStatus.Int());
|
|
968 |
ASSERT_EQUALS(RMobileCall::EStatusConnected, callStatus);
|
|
969 |
|
|
970 |
mobileCall.NotifyMobileCallStatusChange(notifyStatus, callStatus);
|
|
971 |
|
|
972 |
// Attempt to swap it when it is the sole call.
|
|
973 |
TRequestStatus swapStatus;
|
|
974 |
mobileCall.Swap(swapStatus);
|
|
975 |
User::WaitForRequest(swapStatus);
|
|
976 |
ASSERT_EQUALS(KErrNone, swapStatus.Int());
|
|
977 |
|
|
978 |
User::WaitForRequest(notifyStatus);
|
|
979 |
ASSERT_EQUALS(KErrNone, notifyStatus.Int());
|
|
980 |
ASSERT_EQUALS(RMobileCall::EStatusHold, callStatus);
|
|
981 |
|
|
982 |
mobileCall.NotifyMobileCallStatusChange(notifyStatus, callStatus);
|
|
983 |
|
|
984 |
// Swapping single call again, back to connected.
|
|
985 |
mobileCall.Swap(swapStatus);
|
|
986 |
User::WaitForRequest(swapStatus);
|
|
987 |
ASSERT_EQUALS(KErrNone, swapStatus.Int());
|
|
988 |
|
|
989 |
User::WaitForRequest(notifyStatus);
|
|
990 |
ASSERT_EQUALS(KErrNone, notifyStatus.Int());
|
|
991 |
ASSERT_EQUALS(RMobileCall::EStatusConnected, callStatus);
|
|
992 |
|
|
993 |
|
|
994 |
TRequestStatus reqStatusTerminated;
|
|
995 |
iMockLTSY.NotifyTerminated(reqStatusTerminated);
|
|
996 |
|
|
997 |
ClientHangUpCallL(mobileCall);
|
|
998 |
|
|
999 |
mobileCall.Close();
|
|
1000 |
mobileLine.Close();
|
|
1001 |
data.Close();
|
|
1002 |
|
|
1003 |
User::WaitForRequest(notifyStatus);
|
|
1004 |
ASSERT_EQUALS(KErrNone, notifyStatus.Int());
|
|
1005 |
|
|
1006 |
AssertMockLtsyStatusL();
|
|
1007 |
CleanupStack::PopAndDestroy(4, this); // mobileCall, mobileLine, data, this
|
|
1008 |
} // CCTsyCallControlFU::TestUseCase0012L
|
|
1009 |
|
|
1010 |
/**
|
|
1011 |
@SYMTestCaseID BA-CTSYD-DIS-CALLCONTROL-UC0013
|
|
1012 |
@SYMComponent telephony_ctsy
|
|
1013 |
@SYMTestCaseDesc Test support in CTSY for failure to hold a connected call
|
|
1014 |
@SYMTestPriority High
|
|
1015 |
@SYMTestActions Invokes dialling a call, attempting to hold it, receiving an error
|
|
1016 |
@SYMTestExpectedResults Pass
|
|
1017 |
@SYMTestType CT
|
|
1018 |
*/
|
|
1019 |
void CCTsyCallControlFU::TestUseCase0013L()
|
|
1020 |
{
|
|
1021 |
OpenEtelServerL(EUseExtendedError);
|
|
1022 |
CleanupStack::PushL(TCleanupItem(Cleanup, this));
|
|
1023 |
OpenPhoneL();
|
|
1024 |
|
|
1025 |
RBuf8 data;
|
|
1026 |
CleanupClosePushL(data);
|
|
1027 |
|
|
1028 |
TInt callId = 1;
|
|
1029 |
RMobilePhone::TMobileService mobileService = RMobilePhone::EVoiceService;
|
|
1030 |
DriverDialCallL(callId, mobileService);
|
|
1031 |
|
|
1032 |
DriverHoldCallL(callId, KErrGeneral);
|
|
1033 |
|
|
1034 |
TInt hangUpCause = KErrGsmCCNormalCallClearing;
|
|
1035 |
DriverHangUpCallL(callId, hangUpCause);
|
|
1036 |
|
|
1037 |
// Client side test
|
|
1038 |
RMobileLine mobileLine;
|
|
1039 |
CleanupClosePushL(mobileLine);
|
|
1040 |
RMobileCall mobileCall;
|
|
1041 |
CleanupClosePushL(mobileCall);
|
|
1042 |
ClientDialCallL(mobileLine, mobileCall, mobileService);
|
|
1043 |
|
|
1044 |
TRequestStatus holdStatus;
|
|
1045 |
mobileCall.Hold(holdStatus);
|
|
1046 |
User::WaitForRequest(holdStatus);
|
|
1047 |
ASSERT_EQUALS(KErrGeneral, holdStatus.Int());
|
|
1048 |
|
|
1049 |
RMobileCall::TMobileCallStatus callStatus;
|
|
1050 |
ASSERT_EQUALS(KErrNone, mobileCall.GetMobileCallStatus(callStatus));
|
|
1051 |
ASSERT_EQUALS(RMobileCall::EStatusConnected, callStatus);
|
|
1052 |
|
|
1053 |
TRequestStatus reqStatusTerminated;
|
|
1054 |
iMockLTSY.NotifyTerminated(reqStatusTerminated);
|
|
1055 |
|
|
1056 |
ClientHangUpCallL(mobileCall);
|
|
1057 |
|
|
1058 |
mobileCall.Close();
|
|
1059 |
mobileLine.Close();
|
|
1060 |
data.Close();
|
|
1061 |
|
|
1062 |
User::WaitForRequest(reqStatusTerminated);
|
|
1063 |
ASSERT_EQUALS(KErrNone, reqStatusTerminated.Int());
|
|
1064 |
|
|
1065 |
AssertMockLtsyStatusL();
|
|
1066 |
CleanupStack::PopAndDestroy(4, this); // mobileCall, mobileLine, data, this
|
|
1067 |
} // CCTsyCallControlFU::TestUseCase0013L
|
|
1068 |
|
|
1069 |
/**
|
|
1070 |
@SYMTestCaseID BA-CTSYD-DIS-CALLCONTROL-UC0014
|
|
1071 |
@SYMComponent telephony_ctsy
|
|
1072 |
@SYMTestCaseDesc Test support in CTSY for failure to resume
|
|
1073 |
@SYMTestPriority High
|
|
1074 |
@SYMTestActions Invokes holding a call, attempting to resume it and receiving a failure.
|
|
1075 |
@SYMTestExpectedResults Pass - Call still on hold
|
|
1076 |
@SYMTestType CT
|
|
1077 |
*/
|
|
1078 |
void CCTsyCallControlFU::TestUseCase0014L()
|
|
1079 |
{
|
|
1080 |
OpenEtelServerL(EUseExtendedError);
|
|
1081 |
CleanupStack::PushL(TCleanupItem(Cleanup, this));
|
|
1082 |
OpenPhoneL();
|
|
1083 |
|
|
1084 |
RBuf8 data;
|
|
1085 |
CleanupClosePushL(data);
|
|
1086 |
|
|
1087 |
TInt callId = 1;
|
|
1088 |
RMobilePhone::TMobileService mobileService = RMobilePhone::EVoiceService;
|
|
1089 |
DriverDialCallL(callId, mobileService);
|
|
1090 |
|
|
1091 |
DriverHoldCallL(callId, KErrNone);
|
|
1092 |
|
|
1093 |
DriverResumeCallL(callId, KErrGeneral);
|
|
1094 |
|
|
1095 |
TInt hangUpCause = KErrGsmCCNormalCallClearing;
|
|
1096 |
TMockLtsyData2<TInt, TInt> mockData2(callId, hangUpCause);
|
|
1097 |
data.Close();
|
|
1098 |
mockData2.SerialiseL(data);
|
|
1099 |
iMockLTSY.ExpectL(MLtsyDispatchCallControlHangUp::KLtsyDispatchCallControlHangUpApiId, data);
|
|
1100 |
|
|
1101 |
// Client side test
|
|
1102 |
|
|
1103 |
RMobileLine mobileLine;
|
|
1104 |
CleanupClosePushL(mobileLine);
|
|
1105 |
RMobileCall mobileCall;
|
|
1106 |
CleanupClosePushL(mobileCall);
|
|
1107 |
ClientDialCallL(mobileLine, mobileCall, mobileService);
|
|
1108 |
|
|
1109 |
TRequestStatus holdStatus;
|
|
1110 |
mobileCall.Hold(holdStatus);
|
|
1111 |
User::WaitForRequest(holdStatus);
|
|
1112 |
ASSERT_EQUALS(KErrNone, holdStatus.Int());
|
|
1113 |
|
|
1114 |
TRequestStatus resumeStatus;
|
|
1115 |
mobileCall.Resume(resumeStatus);
|
|
1116 |
User::WaitForRequest(resumeStatus);
|
|
1117 |
ASSERT_EQUALS(KErrGeneral, resumeStatus.Int());
|
|
1118 |
|
|
1119 |
RMobileCall::TMobileCallStatus callStatus;
|
|
1120 |
ASSERT_EQUALS(KErrNone, mobileCall.GetMobileCallStatus(callStatus));
|
|
1121 |
ASSERT_EQUALS(RMobileCall::EStatusHold, callStatus);
|
|
1122 |
|
|
1123 |
mobileCall.Close();
|
|
1124 |
mobileLine.Close();
|
|
1125 |
data.Close();
|
|
1126 |
|
|
1127 |
AssertMockLtsyStatusL();
|
|
1128 |
CleanupStack::PopAndDestroy(4, this); // mobileCall, mobileLine, data, this
|
|
1129 |
} // CCTsyCallControlFU::TestUseCase0014L
|
|
1130 |
|
|
1131 |
/**
|
|
1132 |
@SYMTestCaseID BA-CTSYD-DIS-CALLCONTROL-UC0015
|
|
1133 |
@SYMComponent telephony_ctsy
|
|
1134 |
@SYMTestCaseDesc Test support in CTSY for failure to swap a call
|
|
1135 |
@SYMTestPriority High
|
|
1136 |
@SYMTestActions Invokes swapping a call and receiving error
|
|
1137 |
@SYMTestExpectedResults Pass
|
|
1138 |
@SYMTestType CT
|
|
1139 |
*/
|
|
1140 |
void CCTsyCallControlFU::TestUseCase0015L()
|
|
1141 |
{
|
|
1142 |
OpenEtelServerL(EUseExtendedError);
|
|
1143 |
CleanupStack::PushL(TCleanupItem(Cleanup, this));
|
|
1144 |
OpenPhoneL();
|
|
1145 |
|
|
1146 |
RBuf8 data;
|
|
1147 |
CleanupClosePushL(data);
|
|
1148 |
|
|
1149 |
TInt callId1 = 1;
|
|
1150 |
TInt callId2 = 2;
|
|
1151 |
RMobilePhone::TMobileService mobileService = RMobilePhone::EVoiceService;
|
|
1152 |
|
|
1153 |
DriverDialAndHoldFirstCallDialSecondCallL(mobileService, callId1, callId2);
|
|
1154 |
|
|
1155 |
DriverSwapCallL(callId1, callId2, KErrGeneral, RMobileCall::EStatusConnected, RMobileCall::EStatusHold);
|
|
1156 |
|
|
1157 |
DriverSwapCallL(callId1, callId2, KErrGeneral, RMobileCall::EStatusConnected, RMobileCall::EStatusHold);
|
|
1158 |
|
|
1159 |
TInt hangUpCause = KErrGsmCCNormalCallClearing;
|
|
1160 |
DriverHangUpCallL(callId1, hangUpCause, EFalse);
|
|
1161 |
|
|
1162 |
DriverHangUpCallL(callId2, hangUpCause, ETrue);
|
|
1163 |
|
|
1164 |
// Client side test
|
|
1165 |
|
|
1166 |
RMobileLine mobileLine;
|
|
1167 |
CleanupClosePushL(mobileLine);
|
|
1168 |
RMobileCall mobileCall;
|
|
1169 |
CleanupClosePushL(mobileCall);
|
|
1170 |
|
|
1171 |
RMobileLine mobileLine2;
|
|
1172 |
CleanupClosePushL(mobileLine2);
|
|
1173 |
RMobileCall mobileCall2;
|
|
1174 |
CleanupClosePushL(mobileCall2);
|
|
1175 |
|
|
1176 |
ClientDialAndHoldFirstCallDialSecondCallL(mobileService, mobileCall, mobileLine,
|
|
1177 |
mobileCall2, mobileLine2);
|
|
1178 |
|
|
1179 |
TRequestStatus swapStatus;
|
|
1180 |
mobileCall.Swap(swapStatus);
|
|
1181 |
User::WaitForRequest(swapStatus);
|
|
1182 |
ASSERT_EQUALS(KErrGeneral, swapStatus.Int());
|
|
1183 |
|
|
1184 |
mobileCall2.Swap(swapStatus);
|
|
1185 |
User::WaitForRequest(swapStatus);
|
|
1186 |
ASSERT_EQUALS(KErrGeneral, swapStatus.Int());
|
|
1187 |
|
|
1188 |
RMobileCall::TMobileCallStatus callStatus;
|
|
1189 |
ASSERT_EQUALS(KErrNone, mobileCall.GetMobileCallStatus(callStatus));
|
|
1190 |
ASSERT_EQUALS(RMobileCall::EStatusHold, callStatus);
|
|
1191 |
|
|
1192 |
ASSERT_EQUALS(KErrNone, mobileCall2.GetMobileCallStatus(callStatus));
|
|
1193 |
ASSERT_EQUALS(RMobileCall::EStatusConnected, callStatus);
|
|
1194 |
|
|
1195 |
TRequestStatus reqStatusTerminated;
|
|
1196 |
iMockLTSY.NotifyTerminated(reqStatusTerminated);
|
|
1197 |
|
|
1198 |
ClientHangUpCallL(mobileCall);
|
|
1199 |
ClientHangUpCallL(mobileCall2);
|
|
1200 |
|
|
1201 |
mobileCall.Close();
|
|
1202 |
mobileLine.Close();
|
|
1203 |
|
|
1204 |
User::WaitForRequest(reqStatusTerminated);
|
|
1205 |
ASSERT_EQUALS(KErrNone, reqStatusTerminated.Int());
|
|
1206 |
|
|
1207 |
AssertMockLtsyStatusL();
|
|
1208 |
CleanupStack::PopAndDestroy(6, this); //mobileCall2, mobileLine2, mobileCall, mobileLine, data, this
|
|
1209 |
} // CCTsyCallControlFU::TestUseCase0015L
|
|
1210 |
|
|
1211 |
|
|
1212 |
|
|
1213 |
/**
|
|
1214 |
@SYMTestCaseID BA-CTSYD-DIS-CALLCONTROL-UC0016
|
|
1215 |
@SYMComponent telephony_ctsy
|
|
1216 |
@SYMTestCaseDesc Test support in CTSY for holding a call then dialling a second and swapping them
|
|
1217 |
@SYMTestPriority High
|
|
1218 |
@SYMTestActions Invokes dialling then holding a call and dialling a second call and swapping them
|
|
1219 |
@SYMTestExpectedResults Pass - Second call can be dialled
|
|
1220 |
@SYMTestType CT
|
|
1221 |
*/
|
|
1222 |
void CCTsyCallControlFU::TestUseCase0016L()
|
|
1223 |
{
|
|
1224 |
OpenEtelServerL(EUseExtendedError);
|
|
1225 |
CleanupStack::PushL(TCleanupItem(Cleanup, this));
|
|
1226 |
OpenPhoneL();
|
|
1227 |
|
|
1228 |
RBuf8 data;
|
|
1229 |
CleanupClosePushL(data);
|
|
1230 |
|
|
1231 |
TInt callId1 = 1;
|
|
1232 |
TInt callId2 = 2;
|
|
1233 |
RMobilePhone::TMobileService mobileService = RMobilePhone::EVoiceService;
|
|
1234 |
|
|
1235 |
DriverDialAndHoldFirstCallDialSecondCallL(mobileService, callId1, callId2);
|
|
1236 |
|
|
1237 |
DriverSwapCallL(callId1, callId2, KErrNone, RMobileCall::EStatusConnected, RMobileCall::EStatusHold);
|
|
1238 |
|
|
1239 |
TInt hangUpCause = KErrGsmCCNormalCallClearing;
|
|
1240 |
DriverHangUpCallL(callId2, hangUpCause, EFalse);
|
|
1241 |
|
|
1242 |
hangUpCause = KErrGsmCCNormalCallClearing;
|
|
1243 |
DriverHangUpCallL(callId1, hangUpCause, ETrue);
|
|
1244 |
|
|
1245 |
// Client side test
|
|
1246 |
|
|
1247 |
RMobileLine mobileLine;
|
|
1248 |
CleanupClosePushL(mobileLine);
|
|
1249 |
RMobileCall mobileCall;
|
|
1250 |
CleanupClosePushL(mobileCall);
|
|
1251 |
|
|
1252 |
RMobileLine mobileLine2;
|
|
1253 |
CleanupClosePushL(mobileLine2);
|
|
1254 |
RMobileCall mobileCall2;
|
|
1255 |
CleanupClosePushL(mobileCall2);
|
|
1256 |
|
|
1257 |
ClientDialAndHoldFirstCallDialSecondCallL(mobileService, mobileCall, mobileLine,
|
|
1258 |
mobileCall2, mobileLine2);
|
|
1259 |
|
|
1260 |
TRequestStatus notifyStatus;
|
|
1261 |
RMobileCall::TMobileCallStatus callStatus;
|
|
1262 |
mobileCall.NotifyMobileCallStatusChange(notifyStatus, callStatus);
|
|
1263 |
|
|
1264 |
TRequestStatus notifyStatus2;
|
|
1265 |
RMobileCall::TMobileCallStatus callStatus2;
|
|
1266 |
mobileCall2.NotifyMobileCallStatusChange(notifyStatus2, callStatus2);
|
|
1267 |
|
|
1268 |
TRequestStatus swapStatus;
|
|
1269 |
mobileCall.Swap(swapStatus);
|
|
1270 |
User::WaitForRequest(swapStatus);
|
|
1271 |
ASSERT_EQUALS(KErrNone, swapStatus.Int());
|
|
1272 |
|
|
1273 |
User::WaitForRequest(notifyStatus);
|
|
1274 |
ASSERT_EQUALS(KErrNone, notifyStatus.Int());
|
|
1275 |
ASSERT_EQUALS(RMobileCall::EStatusConnected, callStatus);
|
|
1276 |
|
|
1277 |
User::WaitForRequest(notifyStatus2);
|
|
1278 |
ASSERT_EQUALS(KErrNone, notifyStatus2.Int());
|
|
1279 |
ASSERT_EQUALS(RMobileCall::EStatusHold, callStatus2);
|
|
1280 |
|
|
1281 |
ClientHangUpCallL(mobileCall2);
|
|
1282 |
|
|
1283 |
ASSERT_EQUALS(KErrNone, mobileCall.GetMobileCallStatus(callStatus));
|
|
1284 |
ASSERT_EQUALS(RMobileCall::EStatusConnected, callStatus);
|
|
1285 |
|
|
1286 |
TRequestStatus reqStatusTerminated;
|
|
1287 |
iMockLTSY.NotifyTerminated(reqStatusTerminated);
|
|
1288 |
|
|
1289 |
ClientHangUpCallL(mobileCall);
|
|
1290 |
|
|
1291 |
ASSERT_EQUALS(KErrNone, mobileCall.GetMobileCallStatus(callStatus));
|
|
1292 |
ASSERT_EQUALS(RMobileCall::EStatusIdle, callStatus);
|
|
1293 |
|
|
1294 |
mobileCall.Close();
|
|
1295 |
mobileLine.Close();
|
|
1296 |
data.Close();
|
|
1297 |
|
|
1298 |
User::WaitForRequest(reqStatusTerminated);
|
|
1299 |
ASSERT_EQUALS(KErrNone, reqStatusTerminated.Int());
|
|
1300 |
|
|
1301 |
AssertMockLtsyStatusL();
|
|
1302 |
CleanupStack::PopAndDestroy(6, this); // mobileCall2, mobileLine2, mobileCall, mobileLine, data, this
|
|
1303 |
} // CCTsyCallControlFU::TestUseCase0016L
|
|
1304 |
|
|
1305 |
|
|
1306 |
|
|
1307 |
/**
|
|
1308 |
@SYMTestCaseID BA-CTSYD-DIS-CALLCONTROL-UC0017
|
|
1309 |
@SYMComponent telephony_ctsy
|
|
1310 |
@SYMTestCaseDesc Test support in CTSY for dialling and hanging up an ISV call
|
|
1311 |
@SYMTestPriority High
|
|
1312 |
@SYMTestActions Invokes dialling then hanging up a voice call using CTelephony
|
|
1313 |
@SYMTestExpectedResults Pass
|
|
1314 |
@SYMTestType CT
|
|
1315 |
*/
|
|
1316 |
void CCTsyCallControlFU::TestUseCase0017L()
|
|
1317 |
{
|
|
1318 |
OpenEtelServerL(EUseExtendedError);
|
|
1319 |
CleanupStack::PushL(TCleanupItem(Cleanup, this));
|
|
1320 |
OpenPhoneL();
|
|
1321 |
|
|
1322 |
RMmCustomAPI customApi;
|
|
1323 |
OpenCustomApiLC(customApi);
|
|
1324 |
|
|
1325 |
RBuf8 data;
|
|
1326 |
CleanupClosePushL(data);
|
|
1327 |
|
|
1328 |
TDesC* phoneNumberPtr = const_cast<TDesC*>(&KPhoneNumber);
|
|
1329 |
TBool isEmergency = EFalse;
|
|
1330 |
TMockLtsyData2<TDesC*, TBool> queryIsEmergencyNumberExpData(phoneNumberPtr,isEmergency);
|
|
1331 |
queryIsEmergencyNumberExpData.SerialiseL(data);
|
|
1332 |
iMockLTSY.ExpectL(MLtsyDispatchCallControlQueryIsEmergencyNumber::KLtsyDispatchCallControlQueryIsEmergencyNumberApiId, data);
|
|
1333 |
data.Close();
|
|
1334 |
|
|
1335 |
TInt callId = 1;
|
|
1336 |
RMobilePhone::TMobileService mode = RMobilePhone::EVoiceService;
|
|
1337 |
DriverDialCallL(callId, mode, ETrue);
|
|
1338 |
|
|
1339 |
TInt hangUpCause = KErrGsmCCNormalCallClearing; // Hang up cause for normal hang up
|
|
1340 |
DriverHangUpCallL(callId, hangUpCause);
|
|
1341 |
|
|
1342 |
ClientSetIsvPubSubKeyL();
|
|
1343 |
|
|
1344 |
TRequestStatus reqStatusTerminated;
|
|
1345 |
iMockLTSY.NotifyTerminated(reqStatusTerminated);
|
|
1346 |
|
|
1347 |
CIsvAO* isvAO = CIsvAO::NewL();
|
|
1348 |
CleanupStack::PushL(isvAO);
|
|
1349 |
|
|
1350 |
isvAO->DoOperation(CIsvAO::EIsvDial);
|
|
1351 |
ASSERT_EQUALS(KErrNone, isvAO->Status().Int());
|
|
1352 |
|
|
1353 |
isvAO->DoOperation(CIsvAO::EIsvHangUp);
|
|
1354 |
ASSERT_EQUALS(KErrNone, isvAO->Status().Int());
|
|
1355 |
|
|
1356 |
User::WaitForRequest(reqStatusTerminated);
|
|
1357 |
ASSERT_EQUALS(KErrNone, reqStatusTerminated.Int());
|
|
1358 |
|
|
1359 |
AssertMockLtsyStatusL();
|
|
1360 |
CleanupStack::PopAndDestroy(4, this); //isvAO, data, customApi, this
|
|
1361 |
} // CCTsyCallControlFU::TestUseCase0017L
|
|
1362 |
|
|
1363 |
/**
|
|
1364 |
@SYMTestCaseID BA-CTSYD-DIS-CALLCONTROL-UC0018
|
|
1365 |
@SYMComponent telephony_ctsy
|
|
1366 |
@SYMTestCaseDesc Test support in CTSY for getting notification of and answering an incoming call using CTelephony
|
|
1367 |
@SYMTestPriority High
|
|
1368 |
@SYMTestActions Invokes CTelephony APIs to get notification of an incoming call, answer it.
|
|
1369 |
@SYMTestExpectedResults Pass
|
|
1370 |
@SYMTestType CT
|
|
1371 |
*/
|
|
1372 |
void CCTsyCallControlFU::TestUseCase0018L()
|
|
1373 |
{
|
|
1374 |
OpenEtelServerL(EUseExtendedError);
|
|
1375 |
CleanupStack::PushL(TCleanupItem(Cleanup, this));
|
|
1376 |
OpenPhoneL();
|
|
1377 |
|
|
1378 |
ClientSetIsvPubSubKeyL();
|
|
1379 |
|
|
1380 |
CIsvAO* isvAO = CIsvAO::NewL();
|
|
1381 |
CleanupStack::PushL(isvAO);
|
|
1382 |
|
|
1383 |
TInt callId = 1;
|
|
1384 |
RMobilePhone::TMobileService mobileService = RMobilePhone::EVoiceService;
|
|
1385 |
DriverCreateIncomingCallL(callId, mobileService);
|
|
1386 |
|
|
1387 |
isvAO->DoOperation(CIsvAO::EIsvNotifyIncomingCall);
|
|
1388 |
ASSERT_EQUALS(KErrNone, isvAO->Status().Int());
|
|
1389 |
|
|
1390 |
DriverCompleteGetMobileCallInfoL(callId, mobileService);
|
|
1391 |
|
|
1392 |
DriverAnswerIncomingCallL(callId, mobileService, ETrue);
|
|
1393 |
|
|
1394 |
TInt hangUpCause = KErrGsmCCNormalCallClearing;
|
|
1395 |
DriverHangUpCallL(callId, hangUpCause);
|
|
1396 |
|
|
1397 |
TRequestStatus reqStatusTerminated;
|
|
1398 |
iMockLTSY.NotifyTerminated(reqStatusTerminated);
|
|
1399 |
|
|
1400 |
isvAO->DoOperation(CIsvAO::EIsvAnswer);
|
|
1401 |
ASSERT_EQUALS(KErrNone, isvAO->Status().Int());
|
|
1402 |
|
|
1403 |
isvAO->DoOperation(CIsvAO::EIsvHangUp);
|
|
1404 |
ASSERT_EQUALS(KErrNone, isvAO->Status().Int());
|
|
1405 |
|
|
1406 |
User::WaitForRequest(reqStatusTerminated);
|
|
1407 |
ASSERT_EQUALS(KErrNone, reqStatusTerminated.Int());
|
|
1408 |
|
|
1409 |
AssertMockLtsyStatusL();
|
|
1410 |
CleanupStack::PopAndDestroy(2, this); // isvAO, this
|
|
1411 |
} // CCTsyCallControlFU::TestUseCase0018L
|
|
1412 |
|
|
1413 |
/**
|
|
1414 |
@SYMTestCaseID BA-CTSYD-DIS-CALLCONTROL-UC0019
|
|
1415 |
@SYMComponent telephony_ctsy
|
|
1416 |
@SYMTestCaseDesc Test support in CTSY for dialling an emergency call
|
|
1417 |
@SYMTestPriority High
|
|
1418 |
@SYMTestActions Invokes dialling of an emergency call
|
|
1419 |
@SYMTestExpectedResults Pass
|
|
1420 |
@SYMTestType CT
|
|
1421 |
*/
|
|
1422 |
void CCTsyCallControlFU::TestUseCase0019L()
|
|
1423 |
{
|
|
1424 |
OpenEtelServerL(EUseExtendedError);
|
|
1425 |
CleanupStack::PushL(TCleanupItem(Cleanup, this));
|
|
1426 |
OpenPhoneL();
|
|
1427 |
|
|
1428 |
RBuf8 data;
|
|
1429 |
CleanupClosePushL(data);
|
|
1430 |
|
|
1431 |
RMobileENStore::TEmergencyNumber emergencyNumber = _L("911");
|
|
1432 |
TMockLtsyData1<RMobileENStore::TEmergencyNumber> dialData(emergencyNumber);
|
|
1433 |
dialData.SerialiseL(data);
|
|
1434 |
iMockLTSY.ExpectL(MLtsyDispatchCallControlDialEmergency::KLtsyDispatchCallControlDialEmergencyApiId, data);
|
|
1435 |
|
|
1436 |
TInt callId = 1;
|
|
1437 |
TMockLtsyData1<TInt> dialData2(callId);
|
|
1438 |
data.Close();
|
|
1439 |
dialData2.SerialiseL(data);
|
|
1440 |
iMockLTSY.CompleteL(MLtsyDispatchCallControlDialEmergency::KLtsyDispatchCallControlDialEmergencyApiId, KErrNone, data);
|
|
1441 |
|
|
1442 |
RMobilePhone::TMobileService mode = RMobilePhone::EVoiceService;
|
|
1443 |
DriverCompleteGetMobileCallInfoL(callId, mode);
|
|
1444 |
DriverCompleteSuccessfulDialNotificationsL(callId);
|
|
1445 |
|
|
1446 |
TInt hangUpCause = KErrGsmCCNormalCallClearing; // Hang up cause for normal hang up
|
|
1447 |
DriverHangUpCallL(callId, hangUpCause);
|
|
1448 |
|
|
1449 |
// Client side test
|
|
1450 |
|
|
1451 |
RMobileLine mobileLine;
|
|
1452 |
CleanupClosePushL(mobileLine);
|
|
1453 |
RMobileCall mobileCall;
|
|
1454 |
CleanupClosePushL(mobileCall);
|
|
1455 |
|
|
1456 |
ClientDialCallL(mobileLine, mobileCall, mode, ETrue);
|
|
1457 |
|
|
1458 |
TRequestStatus reqStatusTerminated;
|
|
1459 |
iMockLTSY.NotifyTerminated(reqStatusTerminated);
|
|
1460 |
|
|
1461 |
ClientHangUpCallL(mobileCall);
|
|
1462 |
|
|
1463 |
mobileCall.Close();
|
|
1464 |
mobileLine.Close();
|
|
1465 |
data.Close();
|
|
1466 |
|
|
1467 |
User::WaitForRequest(reqStatusTerminated);
|
|
1468 |
ASSERT_EQUALS(KErrNone, reqStatusTerminated.Int());
|
|
1469 |
|
|
1470 |
AssertMockLtsyStatusL();
|
|
1471 |
CleanupStack::PopAndDestroy(4, this); // mobileLine, mobileCall, data, this
|
|
1472 |
} // CCTsyCallControlFU::TestUseCase0019L
|
|
1473 |
|
|
1474 |
|
|
1475 |
/**
|
|
1476 |
@SYMTestCaseID BA-CTSYD-DIS-CALLCONTROL-UC0020
|
|
1477 |
@SYMComponent telephony_ctsy
|
|
1478 |
@SYMTestCaseDesc Test support in CTSY for failed dialling an emergency call
|
|
1479 |
@SYMTestPriority High
|
|
1480 |
@SYMTestActions Invokes dialling an emergency call
|
|
1481 |
@SYMTestExpectedResults Pass
|
|
1482 |
@SYMTestType CT
|
|
1483 |
*/
|
|
1484 |
void CCTsyCallControlFU::TestUseCase0020L()
|
|
1485 |
{
|
|
1486 |
OpenEtelServerL(EUseExtendedError);
|
|
1487 |
CleanupStack::PushL(TCleanupItem(Cleanup, this));
|
|
1488 |
OpenPhoneL();
|
|
1489 |
|
|
1490 |
RBuf8 data;
|
|
1491 |
CleanupClosePushL(data);
|
|
1492 |
|
|
1493 |
RMobileENStore::TEmergencyNumber emergencyNumber = _L("911");
|
|
1494 |
TMockLtsyData1<RMobileENStore::TEmergencyNumber> dialData(emergencyNumber);
|
|
1495 |
dialData.SerialiseL(data);
|
|
1496 |
iMockLTSY.ExpectL(MLtsyDispatchCallControlDialEmergency::KLtsyDispatchCallControlDialEmergencyApiId, data);
|
|
1497 |
|
|
1498 |
TInt callId = 1;
|
|
1499 |
RMobilePhone::TMobileService mode = RMobilePhone::EVoiceService;
|
|
1500 |
TMockLtsyCallData0 dialData2(callId, mode); // Mode not actually used
|
|
1501 |
data.Close();
|
|
1502 |
dialData2.SerialiseL(data);
|
|
1503 |
iMockLTSY.CompleteL(MLtsyDispatchCallControlDialEmergency::KLtsyDispatchCallControlDialEmergencyApiId, KErrGeneral, data);
|
|
1504 |
|
|
1505 |
// Client side test
|
|
1506 |
|
|
1507 |
RMobileLine mobileLine;
|
|
1508 |
CleanupClosePushL(mobileLine);
|
|
1509 |
RMobileCall mobileCall;
|
|
1510 |
CleanupClosePushL(mobileCall);
|
|
1511 |
|
|
1512 |
OpenLineAndCallL(mobileLine, mobileCall, mode);
|
|
1513 |
|
|
1514 |
TRequestStatus dialStatus;
|
|
1515 |
mobileCall.DialEmergencyCall(dialStatus, emergencyNumber);
|
|
1516 |
User::WaitForRequest(dialStatus);
|
|
1517 |
ASSERT_EQUALS(KErrGeneral, dialStatus.Int());
|
|
1518 |
|
|
1519 |
RMobileCall::TMobileCallStatus callStatus = RMobileCall::EStatusUnknown;
|
|
1520 |
mobileCall.GetMobileCallStatus(callStatus);
|
|
1521 |
ASSERT_EQUALS(RMobileCall::EStatusIdle, callStatus);
|
|
1522 |
|
|
1523 |
mobileCall.Close();
|
|
1524 |
mobileLine.Close();
|
|
1525 |
data.Close();
|
|
1526 |
|
|
1527 |
AssertMockLtsyStatusL();
|
|
1528 |
CleanupStack::PopAndDestroy(4, this); // mobileLine, mobileCall, data, this
|
|
1529 |
} // CCTsyCallControlFU::TestUseCase0020L
|
|
1530 |
|
|
1531 |
/**
|
|
1532 |
@SYMTestCaseID BA-CTSYD-DIS-CALLCONTROL-UC0021
|
|
1533 |
@SYMComponent telephony_ctsy
|
|
1534 |
@SYMTestCaseDesc Test support in CTSY for transferring a call
|
|
1535 |
@SYMTestPriority High
|
|
1536 |
@SYMTestActions Invokes RMobileCall::Transfer
|
|
1537 |
@SYMTestExpectedResults Pass
|
|
1538 |
@SYMTestType CT
|
|
1539 |
*/
|
|
1540 |
void CCTsyCallControlFU::TestUseCase0021L()
|
|
1541 |
{
|
|
1542 |
OpenEtelServerL(EUseExtendedError);
|
|
1543 |
CleanupStack::PushL(TCleanupItem(Cleanup, this));
|
|
1544 |
OpenPhoneL();
|
|
1545 |
|
|
1546 |
RBuf8 data;
|
|
1547 |
CleanupClosePushL(data);
|
|
1548 |
|
|
1549 |
TInt callId = 1;
|
|
1550 |
RMobilePhone::TMobileService mobileService = RMobilePhone::EVoiceService;
|
|
1551 |
DriverDialCallL(callId, mobileService);
|
|
1552 |
|
|
1553 |
DriverHoldCallL(callId, KErrNone);
|
|
1554 |
|
|
1555 |
TInt callId2 = 2;
|
|
1556 |
DriverDialCallL(callId2, mobileService);
|
|
1557 |
|
|
1558 |
TMockLtsyData2<TInt, TInt> mockData(callId, callId2);
|
|
1559 |
data.Close();
|
|
1560 |
mockData.SerialiseL(data);
|
|
1561 |
iMockLTSY.ExpectL(MLtsyDispatchCallControlTransfer::KLtsyDispatchCallControlTransferApiId, data);
|
|
1562 |
|
|
1563 |
iMockLTSY.CompleteL(MLtsyDispatchCallControlTransfer::KLtsyDispatchCallControlTransferApiId, KErrNone);
|
|
1564 |
|
|
1565 |
RMobileCall::TMobileCallStatus callStatus = RMobileCall::EStatusIdle;
|
|
1566 |
TMockLtsyCallData1<RMobileCall::TMobileCallStatus> mockCallData(
|
|
1567 |
callId, RMobilePhone::EServiceUnspecified, callStatus);
|
|
1568 |
data.Close();
|
|
1569 |
mockCallData.SerialiseL(data);
|
|
1570 |
iMockLTSY.CompleteL(KMockLtsyDispatchCallControlNotifyCallStatusChangeIndId, KErrNone, data);
|
|
1571 |
|
|
1572 |
TMockLtsyCallData1<RMobileCall::TMobileCallStatus> mockCallData2(
|
|
1573 |
callId2, RMobilePhone::EServiceUnspecified, callStatus);
|
|
1574 |
data.Close();
|
|
1575 |
mockCallData2.SerialiseL(data);
|
|
1576 |
iMockLTSY.CompleteL(KMockLtsyDispatchCallControlNotifyCallStatusChangeIndId, KErrNone, data);
|
|
1577 |
|
|
1578 |
data.Close();
|
|
1579 |
|
|
1580 |
TUint32 duration = 3; //this is the length of the call and its not possible to be certain of this due to
|
|
1581 |
//e.g. logging statements so this argument is not actually checked in the mockltsy
|
|
1582 |
TMockLtsyData1<TUint32> durationLtsyData(duration);
|
|
1583 |
durationLtsyData.SerialiseL(data);
|
|
1584 |
iMockLTSY.ExpectL(MLtsyDispatchCallControlUpdateLifeTimer::KLtsyDispatchCallControlUpdateLifeTimerApiId, data, KErrNone);
|
|
1585 |
data.Close();
|
|
1586 |
|
|
1587 |
TRequestStatus termiantedReqStatus;
|
|
1588 |
iMockLTSY.NotifyTerminated(termiantedReqStatus);
|
|
1589 |
iMockLTSY.CompleteL(MLtsyDispatchCallControlUpdateLifeTimer::KLtsyDispatchCallControlUpdateLifeTimerApiId, KErrNone);
|
|
1590 |
|
|
1591 |
// Client side test
|
|
1592 |
|
|
1593 |
RMobileLine mobileLine;
|
|
1594 |
CleanupClosePushL(mobileLine);
|
|
1595 |
RMobileCall mobileCall;
|
|
1596 |
CleanupClosePushL(mobileCall);
|
|
1597 |
|
|
1598 |
RMobileLine mobileLine2;
|
|
1599 |
CleanupClosePushL(mobileLine2);
|
|
1600 |
RMobileCall mobileCall2;
|
|
1601 |
CleanupClosePushL(mobileCall2);
|
|
1602 |
|
|
1603 |
ClientDialAndHoldFirstCallDialSecondCallL(mobileService, mobileCall, mobileLine,
|
|
1604 |
mobileCall2, mobileLine2);
|
|
1605 |
|
|
1606 |
TRequestStatus notifyStatus;
|
|
1607 |
mobileCall.NotifyMobileCallStatusChange(notifyStatus, callStatus);
|
|
1608 |
|
|
1609 |
TRequestStatus notifyStatus2;
|
|
1610 |
RMobileCall::TMobileCallStatus callStatus2;
|
|
1611 |
mobileCall2.NotifyMobileCallStatusChange(notifyStatus2, callStatus2);
|
|
1612 |
|
|
1613 |
TRequestStatus transferStatus;
|
|
1614 |
mobileCall.Transfer(transferStatus);
|
|
1615 |
User::WaitForRequest(transferStatus);
|
|
1616 |
ASSERT_EQUALS(KErrNone, transferStatus.Int());
|
|
1617 |
|
|
1618 |
User::WaitForRequest(notifyStatus);
|
|
1619 |
ASSERT_EQUALS(KErrNone, notifyStatus.Int());
|
|
1620 |
ASSERT_EQUALS(RMobileCall::EStatusIdle, callStatus);
|
|
1621 |
|
|
1622 |
User::WaitForRequest(notifyStatus2);
|
|
1623 |
ASSERT_EQUALS(KErrNone, notifyStatus2.Int());
|
|
1624 |
ASSERT_EQUALS(RMobileCall::EStatusIdle, callStatus2);
|
|
1625 |
|
|
1626 |
User::WaitForRequest(termiantedReqStatus);
|
|
1627 |
ASSERT_EQUALS(KErrNone, termiantedReqStatus.Int());
|
|
1628 |
|
|
1629 |
AssertMockLtsyStatusL();
|
|
1630 |
CleanupStack::PopAndDestroy(6, this); //mobileCall2, mobileLine2, mobileCall, mobileLine, data, this
|
|
1631 |
} // CCTsyCallControlFU::TestUseCase0021L
|
|
1632 |
|
|
1633 |
|
|
1634 |
/**
|
|
1635 |
@SYMTestCaseID BA-CTSYD-DIS-CALLCONTROL-UC0022
|
|
1636 |
@SYMComponent telephony_ctsy
|
|
1637 |
@SYMTestCaseDesc Test support in CTSY for failure to transfer a call
|
|
1638 |
@SYMTestPriority High
|
|
1639 |
@SYMTestActions Invokes RMobileCall::Transfer
|
|
1640 |
@SYMTestExpectedResults Pass
|
|
1641 |
@SYMTestType CT
|
|
1642 |
*/
|
|
1643 |
void CCTsyCallControlFU::TestUseCase0022L()
|
|
1644 |
{
|
|
1645 |
OpenEtelServerL(EUseExtendedError);
|
|
1646 |
CleanupStack::PushL(TCleanupItem(Cleanup, this));
|
|
1647 |
OpenPhoneL();
|
|
1648 |
|
|
1649 |
RBuf8 data;
|
|
1650 |
CleanupClosePushL(data);
|
|
1651 |
|
|
1652 |
TInt callId = 1;
|
|
1653 |
RMobilePhone::TMobileService mobileService = RMobilePhone::EVoiceService;
|
|
1654 |
DriverDialCallL(callId, mobileService);
|
|
1655 |
|
|
1656 |
DriverHoldCallL(callId, KErrNone);
|
|
1657 |
|
|
1658 |
TInt callId2 = 2;
|
|
1659 |
DriverDialCallL(callId2, mobileService);
|
|
1660 |
|
|
1661 |
TMockLtsyData2<TInt, TInt> mockData(callId, callId2);
|
|
1662 |
data.Close();
|
|
1663 |
mockData.SerialiseL(data);
|
|
1664 |
|
|
1665 |
iMockLTSY.ExpectL(MLtsyDispatchCallControlTransfer::KLtsyDispatchCallControlTransferApiId, data);
|
|
1666 |
|
|
1667 |
iMockLTSY.CompleteL(MLtsyDispatchCallControlTransfer::KLtsyDispatchCallControlTransferApiId, KErrGeneral);
|
|
1668 |
|
|
1669 |
// Client side test
|
|
1670 |
|
|
1671 |
RMobileLine mobileLine;
|
|
1672 |
CleanupClosePushL(mobileLine);
|
|
1673 |
RMobileCall mobileCall;
|
|
1674 |
CleanupClosePushL(mobileCall);
|
|
1675 |
|
|
1676 |
RMobileLine mobileLine2;
|
|
1677 |
CleanupClosePushL(mobileLine2);
|
|
1678 |
RMobileCall mobileCall2;
|
|
1679 |
CleanupClosePushL(mobileCall2);
|
|
1680 |
|
|
1681 |
ClientDialAndHoldFirstCallDialSecondCallL(mobileService, mobileCall, mobileLine,
|
|
1682 |
mobileCall2, mobileLine2);
|
|
1683 |
|
|
1684 |
// Transfer call, which fails, check first call is still on hold and second
|
|
1685 |
// is still connected
|
|
1686 |
TRequestStatus notifyStatus;
|
|
1687 |
RMobileCall::TMobileCallStatus callStatus;
|
|
1688 |
mobileCall.NotifyMobileCallStatusChange(notifyStatus, callStatus);
|
|
1689 |
|
|
1690 |
TRequestStatus notifyStatus2;
|
|
1691 |
RMobileCall::TMobileCallStatus callStatus2;
|
|
1692 |
mobileCall2.NotifyMobileCallStatusChange(notifyStatus2, callStatus2);
|
|
1693 |
|
|
1694 |
TRequestStatus transferStatus;
|
|
1695 |
mobileCall.Transfer(transferStatus);
|
|
1696 |
User::WaitForRequest(transferStatus);
|
|
1697 |
ASSERT_EQUALS(KErrGeneral, transferStatus.Int());
|
|
1698 |
|
|
1699 |
ASSERT_EQUALS(KRequestPending, notifyStatus.Int());
|
|
1700 |
mobileCall.CancelAsyncRequest(EMobileCallNotifyMobileCallStatusChange);
|
|
1701 |
User::WaitForRequest(notifyStatus);
|
|
1702 |
ASSERT_EQUALS(KErrCancel, notifyStatus.Int());
|
|
1703 |
|
|
1704 |
mobileCall.GetMobileCallStatus(callStatus);
|
|
1705 |
ASSERT_EQUALS(RMobileCall::EStatusHold, callStatus);
|
|
1706 |
|
|
1707 |
ASSERT_EQUALS(KRequestPending, notifyStatus2.Int());
|
|
1708 |
mobileCall2.CancelAsyncRequest(EMobileCallNotifyMobileCallStatusChange);
|
|
1709 |
ASSERT_EQUALS(KErrCancel, notifyStatus2.Int());
|
|
1710 |
|
|
1711 |
mobileCall2.GetMobileCallStatus(callStatus2);
|
|
1712 |
ASSERT_EQUALS(RMobileCall::EStatusConnected, callStatus2);
|
|
1713 |
|
|
1714 |
TInt hangUpCause = KErrGsmCCNormalCallClearing; // Hang up cause for normal hang up
|
|
1715 |
|
|
1716 |
DriverHangUpCallL(callId, hangUpCause, EFalse);
|
|
1717 |
ClientHangUpCallL(mobileCall);
|
|
1718 |
|
|
1719 |
TRequestStatus reqStatusTerminated;
|
|
1720 |
iMockLTSY.NotifyTerminated(reqStatusTerminated);
|
|
1721 |
|
|
1722 |
DriverHangUpCallL(callId2, hangUpCause, ETrue);
|
|
1723 |
ClientHangUpCallL(mobileCall2);
|
|
1724 |
|
|
1725 |
User::WaitForRequest(reqStatusTerminated);
|
|
1726 |
ASSERT_EQUALS(KErrNone, reqStatusTerminated.Int());
|
|
1727 |
|
|
1728 |
AssertMockLtsyStatusL();
|
|
1729 |
|
|
1730 |
CleanupStack::PopAndDestroy(6, this); //mobileCall2, mobileLine2, mobileCall, mobileLine, data, this
|
|
1731 |
} // CCTsyCallControlFU::TestUseCase0022L
|
|
1732 |
|
|
1733 |
/**
|
|
1734 |
@SYMTestCaseID BA-CTSYD-DIS-CALLCONTROL-UC0023
|
|
1735 |
@SYMComponent telephony_ctsy
|
|
1736 |
@SYMTestCaseDesc Test support in CTSY for sending a DTMF string containing a 'w' and continuing after the 'w'
|
|
1737 |
@SYMTestPriority High
|
|
1738 |
@SYMTestActions Invokes RMobilePhone::SendDTMFTones with a 'w' in the string then RMobilePhone::ContinueDTMFStringSending
|
|
1739 |
@SYMTestExpectedResults Pass
|
|
1740 |
@SYMTestType CT
|
|
1741 |
*/
|
|
1742 |
void CCTsyCallControlFU::TestUseCase0023L()
|
|
1743 |
{
|
|
1744 |
OpenEtelServerL(EUseExtendedError);
|
|
1745 |
CleanupStack::PushL(TCleanupItem(Cleanup, this));
|
|
1746 |
OpenPhoneL();
|
|
1747 |
|
|
1748 |
RBuf8 data;
|
|
1749 |
CleanupClosePushL(data);
|
|
1750 |
|
|
1751 |
TInt callId = 1;
|
|
1752 |
RMobilePhone::TMobileService mobileService = RMobilePhone::EVoiceService;
|
|
1753 |
DriverDialCallL(callId, mobileService);
|
|
1754 |
|
|
1755 |
TInfoName fullTonesString = _L("12345w67890wABCD");
|
|
1756 |
TBuf<5> tonesFirstPart;
|
|
1757 |
tonesFirstPart.Copy(fullTonesString.Left(5)); // 12345
|
|
1758 |
TMockLtsyData2<TInt, TBuf<5> > toneLtsyData(callId, tonesFirstPart);
|
|
1759 |
toneLtsyData.SerialiseL(data);
|
|
1760 |
iMockLTSY.ExpectL(MLtsyDispatchCallControlSendDtmfTones::KLtsyDispatchCallControlSendDtmfTonesApiId, data, KErrNone);
|
|
1761 |
iMockLTSY.CompleteL(MLtsyDispatchCallControlSendDtmfTones::KLtsyDispatchCallControlSendDtmfTonesApiId, KErrNone);
|
|
1762 |
|
|
1763 |
TBuf<5> tonesSecondPart;
|
|
1764 |
tonesSecondPart.Copy(fullTonesString.Mid(6, 5)); // 67890
|
|
1765 |
data.Close();
|
|
1766 |
TMockLtsyData2<TInt, TBuf<5> > toneLtsyData2(callId, tonesSecondPart);
|
|
1767 |
toneLtsyData2.SerialiseL(data);
|
|
1768 |
iMockLTSY.ExpectL(MLtsyDispatchCallControlSendDtmfTones::KLtsyDispatchCallControlSendDtmfTonesApiId, data, KErrNone);
|
|
1769 |
iMockLTSY.CompleteL(MLtsyDispatchCallControlSendDtmfTones::KLtsyDispatchCallControlSendDtmfTonesApiId, KErrNone);
|
|
1770 |
|
|
1771 |
TBuf<4> tonesThirdPart;
|
|
1772 |
tonesThirdPart.Copy(fullTonesString.Mid(12, 4)); // ABCD
|
|
1773 |
data.Close();
|
|
1774 |
TMockLtsyData2<TInt, TBuf<4> > toneLtsyData3(callId, tonesThirdPart);
|
|
1775 |
toneLtsyData3.SerialiseL(data);
|
|
1776 |
iMockLTSY.ExpectL(MLtsyDispatchCallControlSendDtmfTones::KLtsyDispatchCallControlSendDtmfTonesApiId, data, KErrNone);
|
|
1777 |
iMockLTSY.CompleteL(MLtsyDispatchCallControlSendDtmfTones::KLtsyDispatchCallControlSendDtmfTonesApiId, KErrNone);
|
|
1778 |
|
|
1779 |
TInt hangUpCause = KErrGsmCCNormalCallClearing; // Hang up cause for normal hang up
|
|
1780 |
DriverHangUpCallL(callId, hangUpCause);
|
|
1781 |
|
|
1782 |
// Client side test
|
|
1783 |
|
|
1784 |
RMobileLine mobileLine;
|
|
1785 |
CleanupClosePushL(mobileLine);
|
|
1786 |
RMobileCall mobileCall;
|
|
1787 |
CleanupClosePushL(mobileCall);
|
|
1788 |
ClientDialCallL(mobileLine, mobileCall, mobileService);
|
|
1789 |
|
|
1790 |
TRequestStatus notifyStopStatus;
|
|
1791 |
iPhone.NotifyStopInDTMFString(notifyStopStatus);
|
|
1792 |
|
|
1793 |
TRequestStatus sendStatus;
|
|
1794 |
iPhone.SendDTMFTones(sendStatus, fullTonesString);
|
|
1795 |
|
|
1796 |
User::WaitForRequest(notifyStopStatus);
|
|
1797 |
ASSERT_EQUALS(KErrNone, notifyStopStatus.Int());
|
|
1798 |
iPhone.NotifyStopInDTMFString(notifyStopStatus);
|
|
1799 |
|
|
1800 |
ASSERT_EQUALS(KErrNone, iPhone.ContinueDTMFStringSending(ETrue));
|
|
1801 |
|
|
1802 |
User::WaitForRequest(notifyStopStatus);
|
|
1803 |
ASSERT_EQUALS(KErrNone, notifyStopStatus.Int());
|
|
1804 |
|
|
1805 |
ASSERT_EQUALS(KErrNone, iPhone.ContinueDTMFStringSending(ETrue));
|
|
1806 |
|
|
1807 |
User::WaitForRequest(sendStatus);
|
|
1808 |
ASSERT_EQUALS(KErrNone, sendStatus.Int());
|
|
1809 |
|
|
1810 |
TRequestStatus reqStatusTerminated;
|
|
1811 |
iMockLTSY.NotifyTerminated(reqStatusTerminated);
|
|
1812 |
|
|
1813 |
ClientHangUpCallL(mobileCall);
|
|
1814 |
|
|
1815 |
User::WaitForRequest(reqStatusTerminated);
|
|
1816 |
ASSERT_EQUALS(KErrNone, reqStatusTerminated.Int());
|
|
1817 |
|
|
1818 |
AssertMockLtsyStatusL();
|
|
1819 |
CleanupStack::PopAndDestroy(4, this); // mobileCall, mobileLine, data, this
|
|
1820 |
} // CCTsyCallControlFU::TestUseCase0023L
|
|
1821 |
|
|
1822 |
/**
|
|
1823 |
@SYMTestCaseID BA-CTSYD-DIS-CALLCONTROL-UC0024
|
|
1824 |
@SYMComponent telephony_ctsy
|
|
1825 |
@SYMTestCaseDesc Test support in CTSY for RMobilePhone::SendDTMFTones with 'w' and not continuing
|
|
1826 |
@SYMTestPriority High
|
|
1827 |
@SYMTestActions Invokes RMobilePhone::SendDTMFTones with 'w' and RMobilePhone::ContinueDTMFStringSending with EFalse
|
|
1828 |
@SYMTestExpectedResults Pass
|
|
1829 |
@SYMTestType CT
|
|
1830 |
*/
|
|
1831 |
void CCTsyCallControlFU::TestUseCase0024L()
|
|
1832 |
{
|
|
1833 |
OpenEtelServerL(EUseExtendedError);
|
|
1834 |
CleanupStack::PushL(TCleanupItem(Cleanup, this));
|
|
1835 |
OpenPhoneL();
|
|
1836 |
|
|
1837 |
RBuf8 data;
|
|
1838 |
CleanupClosePushL(data);
|
|
1839 |
|
|
1840 |
TInt callId = 1;
|
|
1841 |
RMobilePhone::TMobileService mobileService = RMobilePhone::EVoiceService;
|
|
1842 |
DriverDialCallL(callId, mobileService);
|
|
1843 |
|
|
1844 |
TInfoName fullTonesString = _L("12345w67890");
|
|
1845 |
TBuf<5> tonesFirstPart;
|
|
1846 |
tonesFirstPart.Copy(fullTonesString.Left(5)); // 12345
|
|
1847 |
TMockLtsyData2<TInt, TBuf<5> > toneLtsyData(callId, tonesFirstPart);
|
|
1848 |
toneLtsyData.SerialiseL(data);
|
|
1849 |
iMockLTSY.ExpectL(MLtsyDispatchCallControlSendDtmfTones::KLtsyDispatchCallControlSendDtmfTonesApiId, data, KErrNone);
|
|
1850 |
iMockLTSY.CompleteL(MLtsyDispatchCallControlSendDtmfTones::KLtsyDispatchCallControlSendDtmfTonesApiId, KErrNone);
|
|
1851 |
|
|
1852 |
TInt hangUpCause = KErrGsmCCNormalCallClearing; // Hang up cause for normal hang up
|
|
1853 |
DriverHangUpCallL(callId, hangUpCause);
|
|
1854 |
|
|
1855 |
// Client side test
|
|
1856 |
|
|
1857 |
RMobileLine mobileLine;
|
|
1858 |
CleanupClosePushL(mobileLine);
|
|
1859 |
RMobileCall mobileCall;
|
|
1860 |
CleanupClosePushL(mobileCall);
|
|
1861 |
ClientDialCallL(mobileLine, mobileCall, mobileService);
|
|
1862 |
|
|
1863 |
TRequestStatus notifyStopStatus;
|
|
1864 |
iPhone.NotifyStopInDTMFString(notifyStopStatus);
|
|
1865 |
|
|
1866 |
TRequestStatus sendStatus;
|
|
1867 |
iPhone.SendDTMFTones(sendStatus, fullTonesString);
|
|
1868 |
|
|
1869 |
User::WaitForRequest(notifyStopStatus);
|
|
1870 |
ASSERT_EQUALS(KErrNone, notifyStopStatus.Int());
|
|
1871 |
|
|
1872 |
ASSERT_EQUALS(KErrNone, iPhone.ContinueDTMFStringSending(EFalse));
|
|
1873 |
|
|
1874 |
User::WaitForRequest(sendStatus);
|
|
1875 |
ASSERT_EQUALS(KErrAbort, sendStatus.Int());
|
|
1876 |
|
|
1877 |
TRequestStatus reqStatusTerminated;
|
|
1878 |
iMockLTSY.NotifyTerminated(reqStatusTerminated);
|
|
1879 |
|
|
1880 |
ClientHangUpCallL(mobileCall);
|
|
1881 |
|
|
1882 |
User::WaitForRequest(reqStatusTerminated);
|
|
1883 |
ASSERT_EQUALS(KErrNone, reqStatusTerminated.Int());
|
|
1884 |
|
|
1885 |
AssertMockLtsyStatusL();
|
|
1886 |
CleanupStack::PopAndDestroy(4, this); //mobileCall, mobileLine, data, this
|
|
1887 |
} // CCTsyCallControlFU::TestUseCase0024L
|
|
1888 |
|
|
1889 |
/**
|
|
1890 |
@SYMTestCaseID BA-CTSYD-DIS-CALLCONTROL-UC0025
|
|
1891 |
@SYMComponent telephony_ctsy
|
|
1892 |
@SYMTestCaseDesc Test support in CTSY for dialling a call using the alternate line
|
|
1893 |
@SYMTestPriority High
|
|
1894 |
@SYMTestActions Invokes dialling a call using the alternate line
|
|
1895 |
@SYMTestExpectedResults Pass
|
|
1896 |
@SYMTestType CT
|
|
1897 |
*/
|
|
1898 |
void CCTsyCallControlFU::TestUseCase0025L()
|
|
1899 |
{
|
|
1900 |
OpenEtelServerL(EUseExtendedError);
|
|
1901 |
CleanupStack::PushL(TCleanupItem(Cleanup, this));
|
|
1902 |
OpenPhoneL();
|
|
1903 |
|
|
1904 |
RBuf8 data;
|
|
1905 |
CleanupClosePushL(data);
|
|
1906 |
|
|
1907 |
TInt callId = 1;
|
|
1908 |
RMobilePhone::TMobileService mobileService = RMobilePhone::EAuxVoiceService;
|
|
1909 |
DriverDialCallL(callId, mobileService);
|
|
1910 |
|
|
1911 |
TInt hangUpCause = KErrGsmCCNormalCallClearing; // Hang up cause for normal hang up
|
|
1912 |
DriverHangUpCallL(callId, hangUpCause);
|
|
1913 |
|
|
1914 |
// Client Side Test
|
|
1915 |
|
|
1916 |
RMobileLine mobileLine;
|
|
1917 |
CleanupClosePushL(mobileLine);
|
|
1918 |
RMobileCall mobileCall;
|
|
1919 |
CleanupClosePushL(mobileCall);
|
|
1920 |
ClientDialCallL(mobileLine, mobileCall, mobileService);
|
|
1921 |
|
|
1922 |
TRequestStatus reqStatusTerminated;
|
|
1923 |
iMockLTSY.NotifyTerminated(reqStatusTerminated);
|
|
1924 |
|
|
1925 |
ClientHangUpCallL(mobileCall);
|
|
1926 |
|
|
1927 |
User::WaitForRequest(reqStatusTerminated);
|
|
1928 |
ASSERT_EQUALS(KErrNone, reqStatusTerminated.Int());
|
|
1929 |
|
|
1930 |
mobileCall.Close();
|
|
1931 |
mobileLine.Close();
|
|
1932 |
data.Close();
|
|
1933 |
|
|
1934 |
AssertMockLtsyStatusL();
|
|
1935 |
CleanupStack::PopAndDestroy(4, this); //mobileCall, mobileLine, data, this
|
|
1936 |
} // CCTsyCallControlFU::TestUseCase0025L
|
|
1937 |
|
|
1938 |
|
|
1939 |
//
|
|
1940 |
// Other unit tests
|
|
1941 |
//
|
|
1942 |
|
|
1943 |
/**
|
|
1944 |
@SYMTestCaseID BA-CTSYD-DIS-CALLCONTROL-UN0001
|
|
1945 |
@SYMComponent telephony_ctsy
|
|
1946 |
@SYMTestCaseDesc Test support in CTSY Dispatcher for RMobilePhone::GetIdentityServiceStatus
|
|
1947 |
@SYMTestPriority High
|
|
1948 |
@SYMTestActions Invokes RMobilePhone::GetIdentityServiceStatus
|
|
1949 |
@SYMTestExpectedResults Pass
|
|
1950 |
@SYMTestType UT
|
|
1951 |
*/
|
|
1952 |
void CCTsyCallControlFU::TestUnit0001L()
|
|
1953 |
{
|
|
1954 |
OpenEtelServerL(EUseExtendedError);
|
|
1955 |
CleanupStack::PushL(TCleanupItem(Cleanup,this));
|
|
1956 |
OpenPhoneL();
|
|
1957 |
|
|
1958 |
RBuf8 data;
|
|
1959 |
CleanupClosePushL(data);
|
|
1960 |
|
|
1961 |
RMobilePhone::TMobilePhoneIdService expService(RMobilePhone::EIdServiceCallerPresentation);
|
|
1962 |
TMockLtsyData1<RMobilePhone::TMobilePhoneIdService> expLtsyData(expService);
|
|
1963 |
data.Close();
|
|
1964 |
expLtsyData.SerialiseL(data);
|
|
1965 |
iMockLTSY.ExpectL(MLtsyDispatchCallControlGetIdentityServiceStatus::KLtsyDispatchCallControlGetIdentityServiceStatusApiId, data);
|
|
1966 |
|
|
1967 |
RMobilePhone::TMobilePhoneIdServiceStatus completeStatus(RMobilePhone::EIdServiceActivePermanent);
|
|
1968 |
TMockLtsyData1<RMobilePhone::TMobilePhoneIdServiceStatus> completeLtsyData(completeStatus);
|
|
1969 |
data.Close();
|
|
1970 |
completeLtsyData.SerialiseL(data);
|
|
1971 |
iMockLTSY.CompleteL(MLtsyDispatchCallControlGetIdentityServiceStatus::KLtsyDispatchCallControlGetIdentityServiceStatusApiId, KErrNone, data);
|
|
1972 |
|
|
1973 |
// Client Side Test
|
|
1974 |
|
|
1975 |
TRequestStatus reqStatus;
|
|
1976 |
RMobilePhone::TMobilePhoneIdServiceStatus status;
|
|
1977 |
iPhone.GetIdentityServiceStatus(reqStatus, expService, status);
|
|
1978 |
User::WaitForRequest(reqStatus);
|
|
1979 |
ASSERT_EQUALS(KErrNone, reqStatus.Int());
|
|
1980 |
ASSERT_EQUALS(completeStatus, status);
|
|
1981 |
|
|
1982 |
AssertMockLtsyStatusL();
|
|
1983 |
CleanupStack::PopAndDestroy(2, this); // data, this
|
|
1984 |
|
|
1985 |
} // CCTsyCallControlFU::TestUnit0001L
|
|
1986 |
|
|
1987 |
/**
|
|
1988 |
@SYMTestCaseID BA-CTSYD-DIS-CALLCONTROL-UN0002
|
|
1989 |
@SYMComponent telephony_ctsy
|
|
1990 |
@SYMTestCaseDesc Test support in CTSY Dispatcher for RMmCustomApi::CheckEmergencyNumber to check emergency number querying
|
|
1991 |
@SYMTestPriority High
|
|
1992 |
@SYMTestActions Invokes RMmCustomApi::CheckEmergencyNumber to check emergency number querying
|
|
1993 |
@SYMTestExpectedResults Pass
|
|
1994 |
@SYMTestType UT
|
|
1995 |
*/
|
|
1996 |
void CCTsyCallControlFU::TestUnit0002L()
|
|
1997 |
{
|
|
1998 |
OpenEtelServerL(EUseExtendedError);
|
|
1999 |
CleanupStack::PushL(TCleanupItem(Cleanup, this));
|
|
2000 |
OpenPhoneL();
|
|
2001 |
|
|
2002 |
RMmCustomAPI customApi;
|
|
2003 |
OpenCustomApiLC(customApi);
|
|
2004 |
|
|
2005 |
RBuf8 data;
|
|
2006 |
CleanupClosePushL(data);
|
|
2007 |
|
|
2008 |
TDesC* phoneNumberPtr = const_cast<TDesC*>(&KEmergencyPhoneNumber);
|
|
2009 |
TBool isEmergency = ETrue;
|
|
2010 |
TMockLtsyData2<TDesC*, TBool> queryIsEmergencyNumberExpData(phoneNumberPtr, isEmergency);
|
|
2011 |
queryIsEmergencyNumberExpData.SerialiseL(data);
|
|
2012 |
iMockLTSY.ExpectL(MLtsyDispatchCallControlQueryIsEmergencyNumber::KLtsyDispatchCallControlQueryIsEmergencyNumberApiId, data);
|
|
2013 |
data.Close();
|
|
2014 |
|
|
2015 |
TRequestStatus reqStatus;
|
|
2016 |
RMmCustomAPI::TEmerNumberCheckMode numCheckMode;
|
|
2017 |
numCheckMode.iCheckMode = RMmCustomAPI::EEmerNumberCheckNormal;
|
|
2018 |
numCheckMode.iNumber = KEmergencyPhoneNumber;
|
|
2019 |
TBool emergencyNumCheckResult = EFalse;
|
|
2020 |
customApi.CheckEmergencyNumber(reqStatus, numCheckMode, emergencyNumCheckResult);
|
|
2021 |
User::WaitForRequest(reqStatus);
|
|
2022 |
ASSERT_EQUALS(KErrNone, reqStatus.Int());
|
|
2023 |
ASSERT_EQUALS(emergencyNumCheckResult, isEmergency);
|
|
2024 |
|
|
2025 |
customApi.Close();
|
|
2026 |
|
|
2027 |
AssertMockLtsyStatusL();
|
|
2028 |
CleanupStack::PopAndDestroy(3, this); // customApi, data, this
|
|
2029 |
|
|
2030 |
} // CCTsyCallControlFU::TestUnit0002L
|
|
2031 |
|
|
2032 |
|
|
2033 |
/**
|
|
2034 |
@SYMTestCaseID BA-CTSYD-DIS-CALLCONTROL-UN003
|
|
2035 |
@SYMComponent telephony_ctsy
|
|
2036 |
@SYMTestCaseDesc Test support in CTSY Dispatcher for RMobilePhone::SetALSLine
|
|
2037 |
@SYMTestPriority High
|
|
2038 |
@SYMTestActions Invokes RMobilePhone::SetALSLine
|
|
2039 |
@SYMTestExpectedResults Pass
|
|
2040 |
@SYMTestType UT
|
|
2041 |
*/
|
|
2042 |
void CCTsyCallControlFU::TestUnit0003L()
|
|
2043 |
{
|
|
2044 |
OpenEtelServerL(EUseExtendedError);
|
|
2045 |
CleanupStack::PushL(TCleanupItem(Cleanup, this));
|
|
2046 |
OpenPhoneL();
|
|
2047 |
|
|
2048 |
RBuf8 data;
|
|
2049 |
CleanupClosePushL(data);
|
|
2050 |
|
|
2051 |
RMobilePhone::TMobilePhoneALSLine alsLine = RMobilePhone::EAlternateLineAuxiliary;
|
|
2052 |
TMockLtsyData1<RMobilePhone::TMobilePhoneALSLine> expLtsyData(alsLine);
|
|
2053 |
data.Close();
|
|
2054 |
expLtsyData.SerialiseL(data);
|
|
2055 |
iMockLTSY.ExpectL(MLtsyDispatchCallControlSetActiveAlsLine::KLtsyDispatchCallControlSetActiveAlsLineApiId, data);
|
|
2056 |
|
|
2057 |
iMockLTSY.CompleteL(MLtsyDispatchCallControlSetActiveAlsLine::KLtsyDispatchCallControlSetActiveAlsLineApiId, KErrNone);
|
|
2058 |
|
|
2059 |
// Client Side Test
|
|
2060 |
|
|
2061 |
const TUid KCRUidCtsyMEAlsLine = { 0x102029A2 };
|
|
2062 |
const TUint KCtsyMEAlsSupported = { 0x00000002 };
|
|
2063 |
|
|
2064 |
// Create centRep to change repository
|
|
2065 |
CRepository* centRep = CRepository::NewL( KCRUidCtsyMEAlsLine );
|
|
2066 |
CleanupStack::PushL(centRep);
|
|
2067 |
|
|
2068 |
TInt ret = centRep->Set( KCtsyMEAlsSupported, ETrue );
|
|
2069 |
ASSERT_EQUALS(KErrNone, ret);
|
|
2070 |
|
|
2071 |
TRequestStatus notifyStatus;
|
|
2072 |
RMobilePhone::TMobilePhoneALSLine newAlsLine;
|
|
2073 |
iPhone.NotifyALSLineChange(notifyStatus, newAlsLine);
|
|
2074 |
|
|
2075 |
TRequestStatus requestStatus;
|
|
2076 |
iPhone.SetALSLine(requestStatus, alsLine);
|
|
2077 |
User::WaitForRequest(requestStatus);
|
|
2078 |
ASSERT_EQUALS(KErrNone, requestStatus.Int());
|
|
2079 |
|
|
2080 |
User::WaitForRequest(notifyStatus);
|
|
2081 |
ASSERT_EQUALS(KErrNone, notifyStatus.Int());
|
|
2082 |
ASSERT_EQUALS(alsLine, newAlsLine);
|
|
2083 |
|
|
2084 |
AssertMockLtsyStatusL();
|
|
2085 |
CleanupStack::PopAndDestroy(3, this); // centRep, data, this
|
|
2086 |
|
|
2087 |
} // CCTsyCallControlFU::TestUnit0003L
|
|
2088 |
|
|
2089 |
/**
|
|
2090 |
@SYMTestCaseID BA-CTSYD-DIS-CALLCONTROL-UN0004
|
|
2091 |
@SYMComponent telephony_ctsy
|
|
2092 |
@SYMTestCaseDesc Test support in CTSY Dispatcher for RMobilePhone::StartDTMFTone and RMobilePhone::StopDTMFTone
|
|
2093 |
@SYMTestPriority High
|
|
2094 |
@SYMTestActions Invokes RMobilePhone::StartDTMFTone and RMobilePhone::StopDTMFTone
|
|
2095 |
@SYMTestExpectedResults Pass
|
|
2096 |
@SYMTestType UT
|
|
2097 |
*/
|
|
2098 |
void CCTsyCallControlFU::TestUnit0004L()
|
|
2099 |
{
|
|
2100 |
OpenEtelServerL(EUseExtendedError);
|
|
2101 |
CleanupStack::PushL(TCleanupItem(Cleanup, this));
|
|
2102 |
OpenPhoneL();
|
|
2103 |
|
|
2104 |
RBuf8 data;
|
|
2105 |
CleanupClosePushL(data);
|
|
2106 |
|
|
2107 |
TInt callId = 1;
|
|
2108 |
RMobilePhone::TMobileService mobileService = RMobilePhone::EVoiceService;
|
|
2109 |
DriverDialCallL(callId, mobileService);
|
|
2110 |
|
|
2111 |
TChar tone('1');
|
|
2112 |
TMockLtsyData2<TInt, TChar> toneLtsyData(callId, tone);
|
|
2113 |
toneLtsyData.SerialiseL(data);
|
|
2114 |
iMockLTSY.ExpectL(MLtsyDispatchCallControlStartDtmfTone::KLtsyDispatchCallControlStartDtmfToneApiId, data, KErrNone);
|
|
2115 |
|
|
2116 |
iMockLTSY.CompleteL(MLtsyDispatchCallControlStartDtmfTone::KLtsyDispatchCallControlStartDtmfToneApiId, KErrNone);
|
|
2117 |
|
|
2118 |
TMockLtsyData1<TInt> toneLtsyData2(callId);
|
|
2119 |
toneLtsyData2.SerialiseL(data);
|
|
2120 |
iMockLTSY.ExpectL(MLtsyDispatchCallControlStopDtmfTone::KLtsyDispatchCallControlStopDtmfToneApiId, data, KErrNone);
|
|
2121 |
|
|
2122 |
iMockLTSY.CompleteL(MLtsyDispatchCallControlStopDtmfTone::KLtsyDispatchCallControlStopDtmfToneApiId, KErrNone);
|
|
2123 |
|
|
2124 |
TInt hangUpCause = KErrGsmCCNormalCallClearing; // Hang up cause for normal hang up
|
|
2125 |
DriverHangUpCallL(callId, hangUpCause);
|
|
2126 |
|
|
2127 |
// Client Side Test
|
|
2128 |
|
|
2129 |
RMobileLine mobileLine;
|
|
2130 |
CleanupClosePushL(mobileLine);
|
|
2131 |
RMobileCall mobileCall;
|
|
2132 |
CleanupClosePushL(mobileCall);
|
|
2133 |
ClientDialCallL(mobileLine, mobileCall, mobileService);
|
|
2134 |
|
|
2135 |
ASSERT_EQUALS(KErrNone, iPhone.StartDTMFTone(tone));
|
|
2136 |
|
|
2137 |
ASSERT_EQUALS(KErrNone, iPhone.StopDTMFTone());
|
|
2138 |
|
|
2139 |
TRequestStatus reqStatusTerminated;
|
|
2140 |
iMockLTSY.NotifyTerminated(reqStatusTerminated);
|
|
2141 |
|
|
2142 |
ClientHangUpCallL(mobileCall);
|
|
2143 |
|
|
2144 |
User::WaitForRequest(reqStatusTerminated);
|
|
2145 |
ASSERT_EQUALS(KErrNone, reqStatusTerminated.Int());
|
|
2146 |
|
|
2147 |
AssertMockLtsyStatusL();
|
|
2148 |
CleanupStack::PopAndDestroy(4, this); //mobileCall, mobileLine, data, this
|
|
2149 |
} // CCTsyCallControlFU::TestUnit0004L
|
|
2150 |
|
|
2151 |
/**
|
|
2152 |
@SYMTestCaseID BA-CTSYD-DIS-CALLCONTROL-UN0005
|
|
2153 |
@SYMComponent telephony_ctsy
|
|
2154 |
@SYMTestCaseDesc Test support in CTSY Dispatcher for cancelling sending of a DTMF string
|
|
2155 |
@SYMTestPriority High
|
|
2156 |
@SYMTestActions Invokes RMobilePhone::SendDTMFTones and cancels it
|
|
2157 |
@SYMTestExpectedResults Pass
|
|
2158 |
@SYMTestType UT
|
|
2159 |
*/
|
|
2160 |
void CCTsyCallControlFU::TestUnit0005L()
|
|
2161 |
{
|
|
2162 |
OpenEtelServerL(EUseExtendedError);
|
|
2163 |
CleanupStack::PushL(TCleanupItem(Cleanup, this));
|
|
2164 |
OpenPhoneL();
|
|
2165 |
|
|
2166 |
RBuf8 data;
|
|
2167 |
CleanupClosePushL(data);
|
|
2168 |
|
|
2169 |
TInt callId = 1;
|
|
2170 |
RMobilePhone::TMobileService mobileService = RMobilePhone::EVoiceService;
|
|
2171 |
DriverDialCallL(callId, mobileService);
|
|
2172 |
|
|
2173 |
TInfoName tones(_L("123456789"));
|
|
2174 |
TMockLtsyData2<TInt, TInfoName> toneLtsyData(callId, tones);
|
|
2175 |
toneLtsyData.SerialiseL(data);
|
|
2176 |
iMockLTSY.ExpectL(MLtsyDispatchCallControlSendDtmfTones::KLtsyDispatchCallControlSendDtmfTonesApiId, data, KErrNone);
|
|
2177 |
|
|
2178 |
TMockLtsyData1<TInt> cancelMockData(callId);
|
|
2179 |
cancelMockData.SerialiseL(data);
|
|
2180 |
iMockLTSY.ExpectL(MLtsyDispatchCallControlSendDtmfTonesCancel::KLtsyDispatchCallControlSendDtmfTonesCancelApiId, data, KErrNone);
|
|
2181 |
|
|
2182 |
iMockLTSY.CompleteL(MLtsyDispatchCallControlSendDtmfTonesCancel::KLtsyDispatchCallControlSendDtmfTonesCancelApiId, KErrNone);
|
|
2183 |
|
|
2184 |
TInt hangUpCause = KErrGsmCCNormalCallClearing; // Hang up cause for normal hang up
|
|
2185 |
DriverHangUpCallL(callId, hangUpCause);
|
|
2186 |
|
|
2187 |
// Client Side Test
|
|
2188 |
|
|
2189 |
RMobileLine mobileLine;
|
|
2190 |
CleanupClosePushL(mobileLine);
|
|
2191 |
RMobileCall mobileCall;
|
|
2192 |
CleanupClosePushL(mobileCall);
|
|
2193 |
|
|
2194 |
// First test sending cancel when there is no active call in progress
|
|
2195 |
iPhone.CancelAsyncRequest(EMobilePhoneSendDTMFTones);
|
|
2196 |
|
|
2197 |
ClientDialCallL(mobileLine, mobileCall, mobileService);
|
|
2198 |
|
|
2199 |
// Test sending cancel when there is no SendDTMFTones in progress
|
|
2200 |
iPhone.CancelAsyncRequest(EMobilePhoneSendDTMFTones);
|
|
2201 |
|
|
2202 |
// Test sending DTMF tones and then cancelling
|
|
2203 |
|
|
2204 |
TRequestStatus reqStatus;
|
|
2205 |
iPhone.SendDTMFTones(reqStatus, tones);
|
|
2206 |
iPhone.CancelAsyncRequest(EMobilePhoneSendDTMFTones);
|
|
2207 |
User::WaitForRequest(reqStatus);
|
|
2208 |
ASSERT_EQUALS(KErrCancel, reqStatus.Int());
|
|
2209 |
|
|
2210 |
// Test sending cancel when there is no SendDTMFTones in progress
|
|
2211 |
// after a cancel
|
|
2212 |
iPhone.CancelAsyncRequest(EMobilePhoneSendDTMFTones);
|
|
2213 |
|
|
2214 |
TRequestStatus reqStatusTerminated;
|
|
2215 |
iMockLTSY.NotifyTerminated(reqStatusTerminated);
|
|
2216 |
|
|
2217 |
ClientHangUpCallL(mobileCall);
|
|
2218 |
|
|
2219 |
// Test sending cancel when there is no SendDTMFTones in progress
|
|
2220 |
// and no call in progress
|
|
2221 |
iPhone.CancelAsyncRequest(EMobilePhoneSendDTMFTones);
|
|
2222 |
|
|
2223 |
User::WaitForRequest(reqStatusTerminated);
|
|
2224 |
ASSERT_EQUALS(KErrNone, reqStatusTerminated.Int());
|
|
2225 |
|
|
2226 |
|
|
2227 |
AssertMockLtsyStatusL();
|
|
2228 |
CleanupStack::PopAndDestroy(4, this); //mobileCall, mobileLine, data, this
|
|
2229 |
|
|
2230 |
} // CCTsyCallControlFU::TestUnit0005L
|
|
2231 |
|
|
2232 |
|
|
2233 |
/**
|
|
2234 |
@SYMTestCaseID BA-CTSYD-DIS-CALLCONTROL-UN0006
|
|
2235 |
@SYMComponent telephony_ctsy
|
|
2236 |
@SYMTestCaseDesc Test support in CTSY Dispatcher for RMobilePhone::StartDTMFTone
|
|
2237 |
@SYMTestPriority High
|
|
2238 |
@SYMTestActions Invokes RMobilePhone::StartDTMFTone
|
|
2239 |
@SYMTestExpectedResults Pass
|
|
2240 |
@SYMTestType UT
|
|
2241 |
*/
|
|
2242 |
void CCTsyCallControlFU::TestUnit0006L()
|
|
2243 |
{
|
|
2244 |
OpenEtelServerL(EUseExtendedError);
|
|
2245 |
CleanupStack::PushL(TCleanupItem(Cleanup, this));
|
|
2246 |
OpenPhoneL();
|
|
2247 |
|
|
2248 |
RBuf8 data;
|
|
2249 |
CleanupClosePushL(data);
|
|
2250 |
|
|
2251 |
// Set up so that there is an active call for testing sending of DTMF
|
|
2252 |
TInt callId = 1;
|
|
2253 |
RMobilePhone::TMobileService mobileService = RMobilePhone::EVoiceService;
|
|
2254 |
DriverDialCallL(callId, mobileService);
|
|
2255 |
|
|
2256 |
RMobileLine mobileLine;
|
|
2257 |
CleanupClosePushL(mobileLine);
|
|
2258 |
RMobileCall mobileCall;
|
|
2259 |
CleanupClosePushL(mobileCall);
|
|
2260 |
ClientDialCallL(mobileLine, mobileCall, mobileService);
|
|
2261 |
|
|
2262 |
//-------------------------------------------------------------------------
|
|
2263 |
// TEST A: failure to dispatch request to LTSY
|
|
2264 |
//-------------------------------------------------------------------------
|
|
2265 |
|
|
2266 |
TChar tone('1');
|
|
2267 |
TMockLtsyData2<TInt, TChar> toneLtsyData(callId, tone);
|
|
2268 |
toneLtsyData.SerialiseL(data);
|
|
2269 |
iMockLTSY.ExpectL(MLtsyDispatchCallControlStartDtmfTone::KLtsyDispatchCallControlStartDtmfToneApiId, data, KErrNotSupported);
|
|
2270 |
|
|
2271 |
ASSERT_EQUALS(KErrNotSupported, iPhone.StartDTMFTone(tone));
|
|
2272 |
|
|
2273 |
//-------------------------------------------------------------------------
|
|
2274 |
// TEST B: failure on completion of pending request from LTSY->CTSY
|
|
2275 |
//-------------------------------------------------------------------------
|
|
2276 |
|
|
2277 |
iMockLTSY.ExpectL(MLtsyDispatchCallControlStartDtmfTone::KLtsyDispatchCallControlStartDtmfToneApiId, data, KErrNone);
|
|
2278 |
iMockLTSY.CompleteL(MLtsyDispatchCallControlStartDtmfTone::KLtsyDispatchCallControlStartDtmfToneApiId, KErrNotSupported);
|
|
2279 |
|
|
2280 |
ASSERT_EQUALS(KErrNotSupported, iPhone.StartDTMFTone(tone));
|
|
2281 |
|
|
2282 |
//-------------------------------------------------------------------------
|
|
2283 |
// TEST C: Successful completion request of
|
|
2284 |
// RMobilePhone::StartDTMFTone
|
|
2285 |
//-------------------------------------------------------------------------
|
|
2286 |
|
|
2287 |
iMockLTSY.ExpectL(MLtsyDispatchCallControlStartDtmfTone::KLtsyDispatchCallControlStartDtmfToneApiId, data, KErrNone);
|
|
2288 |
iMockLTSY.CompleteL(MLtsyDispatchCallControlStartDtmfTone::KLtsyDispatchCallControlStartDtmfToneApiId, KErrNone);
|
|
2289 |
|
|
2290 |
ASSERT_EQUALS(KErrNone, iPhone.StartDTMFTone(tone));
|
|
2291 |
|
|
2292 |
//-------------------------------------------------------------------------
|
|
2293 |
// TEST E: Unsolicited completion of RMobilePhone::StartDTMFTone
|
|
2294 |
// from LTSY.
|
|
2295 |
//-------------------------------------------------------------------------
|
|
2296 |
|
|
2297 |
TRequestStatus terminatedStatus;
|
|
2298 |
iMockLTSY.NotifyTerminated(terminatedStatus);
|
|
2299 |
|
|
2300 |
iMockLTSY.CompleteL(MLtsyDispatchCallControlStartDtmfTone::KLtsyDispatchCallControlStartDtmfToneApiId, KErrNone);
|
|
2301 |
|
|
2302 |
User::WaitForRequest(terminatedStatus);
|
|
2303 |
|
|
2304 |
//-------------------------------------------------------------------------
|
|
2305 |
// TEST F: Extra coverage tests, extra scenarios
|
|
2306 |
//-------------------------------------------------------------------------
|
|
2307 |
|
|
2308 |
// Test StartDTMFTone when there is no active call
|
|
2309 |
TInt hangUpCause = KErrGsmCCNormalCallClearing; // Hang up cause for normal hang up
|
|
2310 |
DriverHangUpCallL(callId, hangUpCause);
|
|
2311 |
|
|
2312 |
TRequestStatus reqStatusTerminated;
|
|
2313 |
iMockLTSY.NotifyTerminated(reqStatusTerminated);
|
|
2314 |
|
|
2315 |
ClientHangUpCallL(mobileCall);
|
|
2316 |
|
|
2317 |
ASSERT_EQUALS(KErrEtelCallNotActive, iPhone.StartDTMFTone(tone));
|
|
2318 |
|
|
2319 |
User::WaitForRequest(reqStatusTerminated);
|
|
2320 |
ASSERT_EQUALS(KErrNone, reqStatusTerminated.Int());
|
|
2321 |
|
|
2322 |
AssertMockLtsyStatusL();
|
|
2323 |
CleanupStack::PopAndDestroy(4, this); //mobileCall, mobileLine, data, this
|
|
2324 |
} // CCTsyCallControlFU::TestUnit0006L
|
|
2325 |
|
|
2326 |
/**
|
|
2327 |
@SYMTestCaseID BA-CTSYD-DIS-CALLCONTROL-UN0007
|
|
2328 |
@SYMComponent telephony_ctsy
|
|
2329 |
@SYMTestCaseDesc Test support in CTSY Dispatcher for RMobilePhone::StopDTMFTone
|
|
2330 |
@SYMTestPriority High
|
|
2331 |
@SYMTestActions Invokes RMobilePhone::StopDTMFTone
|
|
2332 |
@SYMTestExpectedResults Pass
|
|
2333 |
@SYMTestType UT
|
|
2334 |
*/
|
|
2335 |
void CCTsyCallControlFU::TestUnit0007L()
|
|
2336 |
{
|
|
2337 |
OpenEtelServerL(EUseExtendedError);
|
|
2338 |
CleanupStack::PushL(TCleanupItem(Cleanup, this));
|
|
2339 |
OpenPhoneL();
|
|
2340 |
|
|
2341 |
RBuf8 data;
|
|
2342 |
CleanupClosePushL(data);
|
|
2343 |
|
|
2344 |
// Set up so that there is an active call for testing stopping of DTMF
|
|
2345 |
TInt callId = 1;
|
|
2346 |
RMobilePhone::TMobileService mobileService = RMobilePhone::EVoiceService;
|
|
2347 |
DriverDialCallL(callId, mobileService);
|
|
2348 |
|
|
2349 |
RMobileLine mobileLine;
|
|
2350 |
CleanupClosePushL(mobileLine);
|
|
2351 |
RMobileCall mobileCall;
|
|
2352 |
CleanupClosePushL(mobileCall);
|
|
2353 |
ClientDialCallL(mobileLine, mobileCall, mobileService);
|
|
2354 |
|
|
2355 |
//-------------------------------------------------------------------------
|
|
2356 |
// TEST A: failure to dispatch request to LTSY
|
|
2357 |
//-------------------------------------------------------------------------
|
|
2358 |
|
|
2359 |
TMockLtsyData1<TInt> toneLtsyData(callId);
|
|
2360 |
toneLtsyData.SerialiseL(data);
|
|
2361 |
iMockLTSY.ExpectL(MLtsyDispatchCallControlStopDtmfTone::KLtsyDispatchCallControlStopDtmfToneApiId, data, KErrNotSupported);
|
|
2362 |
|
|
2363 |
ASSERT_EQUALS(KErrNotSupported, iPhone.StopDTMFTone());
|
|
2364 |
|
|
2365 |
//-------------------------------------------------------------------------
|
|
2366 |
// TEST B: failure on completion of pending request from LTSY->CTSY
|
|
2367 |
//-------------------------------------------------------------------------
|
|
2368 |
|
|
2369 |
iMockLTSY.ExpectL(MLtsyDispatchCallControlStopDtmfTone::KLtsyDispatchCallControlStopDtmfToneApiId, data, KErrNone);
|
|
2370 |
iMockLTSY.CompleteL(MLtsyDispatchCallControlStopDtmfTone::KLtsyDispatchCallControlStopDtmfToneApiId, KErrNotSupported);
|
|
2371 |
|
|
2372 |
ASSERT_EQUALS(KErrNotSupported, iPhone.StopDTMFTone());
|
|
2373 |
|
|
2374 |
//-------------------------------------------------------------------------
|
|
2375 |
// TEST C: Successful completion request of
|
|
2376 |
// RMobilePhone::StopDTMFTone
|
|
2377 |
//-------------------------------------------------------------------------
|
|
2378 |
|
|
2379 |
iMockLTSY.ExpectL(MLtsyDispatchCallControlStopDtmfTone::KLtsyDispatchCallControlStopDtmfToneApiId, data, KErrNone);
|
|
2380 |
iMockLTSY.CompleteL(MLtsyDispatchCallControlStopDtmfTone::KLtsyDispatchCallControlStopDtmfToneApiId, KErrNone);
|
|
2381 |
|
|
2382 |
ASSERT_EQUALS(KErrNone, iPhone.StopDTMFTone());
|
|
2383 |
|
|
2384 |
//-------------------------------------------------------------------------
|
|
2385 |
// TEST E: Unsolicited completion of RMobilePhone::StopDTMFTone
|
|
2386 |
// from LTSY.
|
|
2387 |
//-------------------------------------------------------------------------
|
|
2388 |
|
|
2389 |
TRequestStatus terminatedStatus;
|
|
2390 |
iMockLTSY.NotifyTerminated(terminatedStatus);
|
|
2391 |
|
|
2392 |
iMockLTSY.CompleteL(MLtsyDispatchCallControlStopDtmfTone::KLtsyDispatchCallControlStopDtmfToneApiId, KErrNone);
|
|
2393 |
|
|
2394 |
User::WaitForRequest(terminatedStatus);
|
|
2395 |
|
|
2396 |
//-------------------------------------------------------------------------
|
|
2397 |
// TEST F: Coverage test(s) for RMobilePhone::StopDTMFTone
|
|
2398 |
//-------------------------------------------------------------------------
|
|
2399 |
|
|
2400 |
// Test StopDTMFTone when there is no active call
|
|
2401 |
TInt hangUpCause = KErrGsmCCNormalCallClearing; // Hang up cause for normal hang up
|
|
2402 |
DriverHangUpCallL(callId, hangUpCause);
|
|
2403 |
|
|
2404 |
TRequestStatus reqStatusTerminated;
|
|
2405 |
iMockLTSY.NotifyTerminated(reqStatusTerminated);
|
|
2406 |
|
|
2407 |
ClientHangUpCallL(mobileCall);
|
|
2408 |
|
|
2409 |
ASSERT_EQUALS(KErrEtelCallNotActive, iPhone.StopDTMFTone());
|
|
2410 |
|
|
2411 |
User::WaitForRequest(reqStatusTerminated);
|
|
2412 |
ASSERT_EQUALS(KErrNone, reqStatusTerminated.Int());
|
|
2413 |
|
|
2414 |
AssertMockLtsyStatusL();
|
|
2415 |
CleanupStack::PopAndDestroy(4, this); //mobileCall, mobileLine, data, this
|
|
2416 |
|
|
2417 |
} // CCTsyCallControlFU::TestUnit0007L
|
|
2418 |
|
|
2419 |
/**
|
|
2420 |
@SYMTestCaseID BA-CTSYD-DIS-CALLCONTROL-UN0008
|
|
2421 |
@SYMComponent telephony_ctsy
|
|
2422 |
@SYMTestCaseDesc Test support in CTSY Dispatcher for RMobilePhone::SendDTMFTones
|
|
2423 |
@SYMTestPriority High
|
|
2424 |
@SYMTestActions Invokes RMobilePhone::SendDTMFTones
|
|
2425 |
@SYMTestExpectedResults Pass
|
|
2426 |
@SYMTestType UT
|
|
2427 |
*/
|
|
2428 |
void CCTsyCallControlFU::TestUnit0008L()
|
|
2429 |
{
|
|
2430 |
OpenEtelServerL(EUseExtendedError);
|
|
2431 |
CleanupStack::PushL(TCleanupItem(Cleanup, this));
|
|
2432 |
OpenPhoneL();
|
|
2433 |
|
|
2434 |
RBuf8 data;
|
|
2435 |
CleanupClosePushL(data);
|
|
2436 |
|
|
2437 |
// Set up so that there is an active call for testing sending of DTMF
|
|
2438 |
TInt callId = 1;
|
|
2439 |
RMobilePhone::TMobileService mobileService = RMobilePhone::EVoiceService;
|
|
2440 |
DriverDialCallL(callId, mobileService);
|
|
2441 |
|
|
2442 |
RMobileLine mobileLine;
|
|
2443 |
CleanupClosePushL(mobileLine);
|
|
2444 |
RMobileCall mobileCall;
|
|
2445 |
CleanupClosePushL(mobileCall);
|
|
2446 |
ClientDialCallL(mobileLine, mobileCall, mobileService);
|
|
2447 |
|
|
2448 |
//-------------------------------------------------------------------------
|
|
2449 |
// TEST A: failure to dispatch request to LTSY
|
|
2450 |
//-------------------------------------------------------------------------
|
|
2451 |
|
|
2452 |
TInfoName tones = _L("12345");
|
|
2453 |
TMockLtsyData2<TInt, TInfoName> toneLtsyData(callId, tones);
|
|
2454 |
toneLtsyData.SerialiseL(data);
|
|
2455 |
iMockLTSY.ExpectL(MLtsyDispatchCallControlSendDtmfTones::KLtsyDispatchCallControlSendDtmfTonesApiId, data, KErrNotSupported);
|
|
2456 |
|
|
2457 |
TRequestStatus reqStatus;
|
|
2458 |
iPhone.SendDTMFTones(reqStatus, tones);
|
|
2459 |
User::WaitForRequest(reqStatus);
|
|
2460 |
ASSERT_EQUALS(KErrNotSupported, reqStatus.Int());
|
|
2461 |
|
|
2462 |
//-------------------------------------------------------------------------
|
|
2463 |
// TEST B: failure on completion of pending request from LTSY->CTSY
|
|
2464 |
//-------------------------------------------------------------------------
|
|
2465 |
|
|
2466 |
iMockLTSY.ExpectL(MLtsyDispatchCallControlSendDtmfTones::KLtsyDispatchCallControlSendDtmfTonesApiId, data, KErrNone);
|
|
2467 |
iMockLTSY.CompleteL(MLtsyDispatchCallControlSendDtmfTones::KLtsyDispatchCallControlSendDtmfTonesApiId, KErrNotSupported);
|
|
2468 |
|
|
2469 |
iPhone.SendDTMFTones(reqStatus, tones);
|
|
2470 |
User::WaitForRequest(reqStatus);
|
|
2471 |
ASSERT_EQUALS(KErrNotSupported, reqStatus.Int());
|
|
2472 |
|
|
2473 |
//-------------------------------------------------------------------------
|
|
2474 |
// TEST C: Successful completion request of
|
|
2475 |
// RMobilePhone::SendDTMFTones
|
|
2476 |
//-------------------------------------------------------------------------
|
|
2477 |
|
|
2478 |
iMockLTSY.ExpectL(MLtsyDispatchCallControlSendDtmfTones::KLtsyDispatchCallControlSendDtmfTonesApiId, data, KErrNone);
|
|
2479 |
iMockLTSY.CompleteL(MLtsyDispatchCallControlSendDtmfTones::KLtsyDispatchCallControlSendDtmfTonesApiId, KErrNone);
|
|
2480 |
|
|
2481 |
iPhone.SendDTMFTones(reqStatus, tones);
|
|
2482 |
User::WaitForRequest(reqStatus);
|
|
2483 |
ASSERT_EQUALS(KErrNone, reqStatus.Int());
|
|
2484 |
|
|
2485 |
//-------------------------------------------------------------------------
|
|
2486 |
// TEST E: Unsolicited completion of RMobilePhone::SendDTMFTones
|
|
2487 |
// from LTSY.
|
|
2488 |
//-------------------------------------------------------------------------
|
|
2489 |
|
|
2490 |
TRequestStatus terminatedStatus;
|
|
2491 |
iMockLTSY.NotifyTerminated(terminatedStatus);
|
|
2492 |
|
|
2493 |
iMockLTSY.CompleteL(MLtsyDispatchCallControlSendDtmfTones::KLtsyDispatchCallControlSendDtmfTonesApiId, KErrNone);
|
|
2494 |
|
|
2495 |
User::WaitForRequest(terminatedStatus);
|
|
2496 |
|
|
2497 |
//-------------------------------------------------------------------------
|
|
2498 |
// TEST F: Coverage test(s) for RMobilePhone::SendDTMFTones
|
|
2499 |
//-------------------------------------------------------------------------
|
|
2500 |
|
|
2501 |
// Test second clients requesting to send DTMF tones when one request is still
|
|
2502 |
// pending returns KErrServerBusy
|
|
2503 |
|
|
2504 |
iMockLTSY.ExpectL(MLtsyDispatchCallControlSendDtmfTones::KLtsyDispatchCallControlSendDtmfTonesApiId, data, KErrNone);
|
|
2505 |
iMockLTSY.CompleteL(MLtsyDispatchCallControlSendDtmfTones::KLtsyDispatchCallControlSendDtmfTonesApiId, KErrNone);
|
|
2506 |
|
|
2507 |
// Open second client
|
|
2508 |
RTelServer telServer2;
|
|
2509 |
TInt ret = telServer2.Connect();
|
|
2510 |
ASSERT_EQUALS(KErrNone, ret);
|
|
2511 |
CleanupClosePushL(telServer2);
|
|
2512 |
|
|
2513 |
RMobilePhone phone2;
|
|
2514 |
ret = phone2.Open(telServer2,KMmTsyPhoneName);
|
|
2515 |
ASSERT_EQUALS(KErrNone, ret);
|
|
2516 |
CleanupClosePushL(phone2);
|
|
2517 |
|
|
2518 |
iPhone.SendDTMFTones(reqStatus, tones);
|
|
2519 |
TRequestStatus reqStatus2;
|
|
2520 |
phone2.SendDTMFTones(reqStatus2, tones);
|
|
2521 |
|
|
2522 |
User::WaitForRequest(reqStatus2);
|
|
2523 |
ASSERT_EQUALS(KErrServerBusy, reqStatus2.Int());
|
|
2524 |
|
|
2525 |
User::WaitForRequest(reqStatus);
|
|
2526 |
ASSERT_EQUALS(KErrNone, reqStatus.Int());
|
|
2527 |
|
|
2528 |
// Test SendDtmfTone when there is no active call
|
|
2529 |
|
|
2530 |
TInt hangUpCause = KErrGsmCCNormalCallClearing; // Hang up cause for normal hang up
|
|
2531 |
DriverHangUpCallL(callId, hangUpCause);
|
|
2532 |
|
|
2533 |
TRequestStatus reqStatusTerminated;
|
|
2534 |
iMockLTSY.NotifyTerminated(reqStatusTerminated);
|
|
2535 |
|
|
2536 |
ClientHangUpCallL(mobileCall);
|
|
2537 |
|
|
2538 |
iPhone.SendDTMFTones(reqStatus, tones);
|
|
2539 |
User::WaitForRequest(reqStatus);
|
|
2540 |
ASSERT_EQUALS(KErrEtelCallNotActive, reqStatus.Int());
|
|
2541 |
|
|
2542 |
User::WaitForRequest(reqStatusTerminated);
|
|
2543 |
ASSERT_EQUALS(KErrNone, reqStatusTerminated.Int());
|
|
2544 |
|
|
2545 |
AssertMockLtsyStatusL();
|
|
2546 |
CleanupStack::PopAndDestroy(6, this);//phone2, telserver2, mobileCall, mobileLine, data, this
|
|
2547 |
|
|
2548 |
} // CCTsyCallControlFU::TestUnit0008L
|
|
2549 |
|
|
2550 |
/**
|
|
2551 |
@SYMTestCaseID BA-CTSYD-DIS-CALLCONTROL-UN0009
|
|
2552 |
@SYMComponent telephony_ctsy
|
|
2553 |
@SYMTestCaseDesc Test support in CTSY Dispatcher for RMobileCall::ReceiveUUI
|
|
2554 |
@SYMTestPriority High
|
|
2555 |
@SYMTestActions Invokes RMobileCall::ReceiveUUI
|
|
2556 |
@SYMTestExpectedResults Pass - client receives data from LTSY
|
|
2557 |
@SYMTestType UT
|
|
2558 |
*/
|
|
2559 |
void CCTsyCallControlFU::TestUnit0009L()
|
|
2560 |
{
|
|
2561 |
OpenEtelServerL(EUseExtendedError);
|
|
2562 |
CleanupStack::PushL(TCleanupItem(Cleanup, this));
|
|
2563 |
OpenPhoneL();
|
|
2564 |
|
|
2565 |
RBuf8 data;
|
|
2566 |
CleanupClosePushL(data);
|
|
2567 |
|
|
2568 |
TInt callId = 1;
|
|
2569 |
RMobilePhone::TMobileService mobileService = RMobilePhone::EVoiceService;
|
|
2570 |
DriverDialCallL(callId, mobileService);
|
|
2571 |
|
|
2572 |
RMobileLine mobileLine;
|
|
2573 |
CleanupClosePushL(mobileLine);
|
|
2574 |
RMobileCall mobileCall;
|
|
2575 |
CleanupClosePushL(mobileCall);
|
|
2576 |
ClientDialCallL(mobileLine, mobileCall, mobileService);
|
|
2577 |
|
|
2578 |
_LIT(KUUI, "important");
|
|
2579 |
RMobileCall::TMobileCallUUI receiveUui;
|
|
2580 |
receiveUui.Append(KUUI);
|
|
2581 |
data.Close();
|
|
2582 |
TMockLtsyCallData1<RMobileCall::TMobileCallUUI> mockData(callId, mobileService, receiveUui);
|
|
2583 |
mockData.SerialiseL(data);
|
|
2584 |
iMockLTSY.CompleteL(KMockLtsyDispatchCallControlReceiveUuiIndId, KErrNone, data);
|
|
2585 |
|
|
2586 |
TRequestStatus uuiStatus;
|
|
2587 |
RMobileCall::TMobileCallUUI receivedUui;
|
|
2588 |
mobileCall.ReceiveUUI(uuiStatus, receivedUui);
|
|
2589 |
User::WaitForRequest(uuiStatus);
|
|
2590 |
ASSERT_EQUALS(KErrNone, uuiStatus.Int());
|
|
2591 |
ASSERT_EQUALS(0, receivedUui.Compare(receiveUui));
|
|
2592 |
|
|
2593 |
TInt hangUpCause = KErrGsmCCNormalCallClearing; // Hang up cause for normal hang up
|
|
2594 |
|
|
2595 |
DriverHangUpCallL(callId, hangUpCause);
|
|
2596 |
|
|
2597 |
TRequestStatus reqStatusTerminated;
|
|
2598 |
iMockLTSY.NotifyTerminated(reqStatusTerminated);
|
|
2599 |
|
|
2600 |
ClientHangUpCallL(mobileCall);
|
|
2601 |
|
|
2602 |
User::WaitForRequest(reqStatusTerminated);
|
|
2603 |
ASSERT_EQUALS(KErrNone, reqStatusTerminated.Int());
|
|
2604 |
|
|
2605 |
AssertMockLtsyStatusL();
|
|
2606 |
|
|
2607 |
CleanupStack::PopAndDestroy(4, this); //mobileCall, mobileLine, data, this
|
|
2608 |
} // CCTsyCallControlFU::TestUnit0009L
|
|
2609 |
|
|
2610 |
/**
|
|
2611 |
@SYMTestCaseID BA-CTSYD-DIS-CALLCONTROL-UN0010
|
|
2612 |
@SYMComponent telephony_ctsy
|
|
2613 |
@SYMTestCaseDesc Test support in CTSY for RMobilePhone::SendDTMFTones and waits for it to timeout
|
|
2614 |
@SYMTestPriority High
|
|
2615 |
@SYMTestActions Invokes RMobilePhone::SendDTMFTones and waits for it to timeout
|
|
2616 |
@SYMTestExpectedResults Pass
|
|
2617 |
@SYMTestType UT
|
|
2618 |
*/
|
|
2619 |
void CCTsyCallControlFU::TestUnit0010L()
|
|
2620 |
{
|
|
2621 |
OpenEtelServerL(EUseExtendedError);
|
|
2622 |
CleanupStack::PushL(TCleanupItem(Cleanup, this));
|
|
2623 |
OpenPhoneL();
|
|
2624 |
|
|
2625 |
RBuf8 data;
|
|
2626 |
CleanupClosePushL(data);
|
|
2627 |
|
|
2628 |
TInt callId = 1;
|
|
2629 |
RMobilePhone::TMobileService mobileService = RMobilePhone::EVoiceService;
|
|
2630 |
DriverDialCallL(callId, mobileService);
|
|
2631 |
|
|
2632 |
RMobileLine mobileLine;
|
|
2633 |
CleanupClosePushL(mobileLine);
|
|
2634 |
RMobileCall mobileCall;
|
|
2635 |
CleanupClosePushL(mobileCall);
|
|
2636 |
ClientDialCallL(mobileLine, mobileCall, mobileService);
|
|
2637 |
|
|
2638 |
|
|
2639 |
TBuf<5> tones = _L("12345");
|
|
2640 |
TMockLtsyData2<TInt, TBuf<5> > toneLtsyData(callId, tones);
|
|
2641 |
toneLtsyData.SerialiseL(data);
|
|
2642 |
iMockLTSY.ExpectL(MLtsyDispatchCallControlSendDtmfTones::KLtsyDispatchCallControlSendDtmfTonesApiId, data, KErrNone);
|
|
2643 |
data.Close();
|
|
2644 |
|
|
2645 |
TRequestStatus reqStatus;
|
|
2646 |
iPhone.SendDTMFTones(reqStatus, tones);
|
|
2647 |
|
|
2648 |
//KMmPhoneSendDTMFTonesTimeOut = 125,
|
|
2649 |
//Life timers come every 10s thus 125s / 10s = 12 expects to queue.
|
|
2650 |
TUint32 duration = 10; //this is the length of the call and its not possible to be certain of this due to
|
|
2651 |
//e.g. logging statements so this argument is not actually checked in the mockltsy
|
|
2652 |
TMockLtsyData1<TUint32> durationLtsyData(duration);
|
|
2653 |
durationLtsyData.SerialiseL(data);
|
|
2654 |
|
|
2655 |
for(TInt i = 0; i < 12; ++i)
|
|
2656 |
{
|
|
2657 |
iMockLTSY.ExpectL(MLtsyDispatchCallControlUpdateLifeTimer::KLtsyDispatchCallControlUpdateLifeTimerApiId, data, KErrNone);
|
|
2658 |
iMockLTSY.CompleteL(MLtsyDispatchCallControlUpdateLifeTimer::KLtsyDispatchCallControlUpdateLifeTimerApiId, KErrNone);
|
|
2659 |
}
|
|
2660 |
data.Close();
|
|
2661 |
|
|
2662 |
User::WaitForRequest(reqStatus);
|
|
2663 |
ASSERT_EQUALS(KErrTimedOut, reqStatus.Int());
|
|
2664 |
AssertMockLtsyStatusL();
|
|
2665 |
|
|
2666 |
|
|
2667 |
TInt hangUpCause = KErrGsmCCNormalCallClearing; // Hang up cause for normal hang up
|
|
2668 |
DriverHangUpCallL(callId, hangUpCause);
|
|
2669 |
|
|
2670 |
TRequestStatus reqStatusTerminated;
|
|
2671 |
iMockLTSY.NotifyTerminated(reqStatusTerminated);
|
|
2672 |
|
|
2673 |
ClientHangUpCallL(mobileCall);
|
|
2674 |
|
|
2675 |
User::WaitForRequest(reqStatusTerminated);
|
|
2676 |
ASSERT_EQUALS(reqStatusTerminated.Int(),KErrNone);
|
|
2677 |
|
|
2678 |
AssertMockLtsyStatusL();
|
|
2679 |
CleanupStack::PopAndDestroy(4, this); //mobileCall, mobileLine, data, this
|
|
2680 |
} // CCTsyCallControlFU::TestUnit0010L
|
|
2681 |
|
|
2682 |
/**
|
|
2683 |
@SYMTestCaseID BA-CTSYD-DIS-CALLCONTROL-UN0011
|
|
2684 |
@SYMComponent telephony_ctsy
|
|
2685 |
@SYMTestCaseDesc Test support in CTSY for RMobilePhone::StartDTMFTone and RMobilePhone::StopDTMFTone timeout
|
|
2686 |
@SYMTestPriority High
|
|
2687 |
@SYMTestActions Invokes RMobilePhone::StartDTMFTone and RMobilePhone::StopDTMFTone waits for it to timeout
|
|
2688 |
@SYMTestExpectedResults Pass
|
|
2689 |
@SYMTestType UT
|
|
2690 |
*/
|
|
2691 |
void CCTsyCallControlFU::TestUnit0011L()
|
|
2692 |
{
|
|
2693 |
OpenEtelServerL(EUseExtendedError);
|
|
2694 |
CleanupStack::PushL(TCleanupItem(Cleanup, this));
|
|
2695 |
OpenPhoneL();
|
|
2696 |
|
|
2697 |
RBuf8 data;
|
|
2698 |
CleanupClosePushL(data);
|
|
2699 |
|
|
2700 |
TInt callId = 1;
|
|
2701 |
RMobilePhone::TMobileService mobileService = RMobilePhone::EVoiceService;
|
|
2702 |
DriverDialCallL(callId, mobileService);
|
|
2703 |
|
|
2704 |
TChar tone('1');
|
|
2705 |
TMockLtsyData2<TInt, TChar> toneLtsyData(callId, tone);
|
|
2706 |
toneLtsyData.SerialiseL(data);
|
|
2707 |
iMockLTSY.ExpectL(MLtsyDispatchCallControlStartDtmfTone::KLtsyDispatchCallControlStartDtmfToneApiId, data, KErrNone);
|
|
2708 |
|
|
2709 |
iMockLTSY.ExpectL(MLtsyDispatchCallControlStartDtmfTone::KLtsyDispatchCallControlStartDtmfToneApiId, data, KErrNone);
|
|
2710 |
|
|
2711 |
iMockLTSY.CompleteL(MLtsyDispatchCallControlStartDtmfTone::KLtsyDispatchCallControlStartDtmfToneApiId, KErrNone);
|
|
2712 |
|
|
2713 |
TMockLtsyData1<TInt> toneLtsyData2(callId);
|
|
2714 |
toneLtsyData2.SerialiseL(data);
|
|
2715 |
iMockLTSY.ExpectL(MLtsyDispatchCallControlStopDtmfTone::KLtsyDispatchCallControlStopDtmfToneApiId, data, KErrNone);
|
|
2716 |
|
|
2717 |
TInt hangUpCause = KErrGsmCCNormalCallClearing; // Hang up cause for normal hang up
|
|
2718 |
DriverHangUpCallL(callId, hangUpCause);
|
|
2719 |
|
|
2720 |
// Client Side Test
|
|
2721 |
|
|
2722 |
RMobileLine mobileLine;
|
|
2723 |
CleanupClosePushL(mobileLine);
|
|
2724 |
RMobileCall mobileCall;
|
|
2725 |
CleanupClosePushL(mobileCall);
|
|
2726 |
ClientDialCallL(mobileLine, mobileCall, mobileService);
|
|
2727 |
|
|
2728 |
ASSERT_EQUALS(KErrTimedOut, iPhone.StartDTMFTone(tone));
|
|
2729 |
|
|
2730 |
// Now test timeout of stop
|
|
2731 |
ASSERT_EQUALS(KErrNone, iPhone.StartDTMFTone(tone));
|
|
2732 |
ASSERT_EQUALS(KErrTimedOut, iPhone.StopDTMFTone());
|
|
2733 |
|
|
2734 |
TRequestStatus reqStatusTerminated;
|
|
2735 |
iMockLTSY.NotifyTerminated(reqStatusTerminated);
|
|
2736 |
|
|
2737 |
ClientHangUpCallL(mobileCall);
|
|
2738 |
|
|
2739 |
User::WaitForRequest(reqStatusTerminated);
|
|
2740 |
ASSERT_EQUALS(KErrNone, reqStatusTerminated.Int());
|
|
2741 |
|
|
2742 |
AssertMockLtsyStatusL();
|
|
2743 |
CleanupStack::PopAndDestroy(4, this); //mobileCall, mobileLine, data, this
|
|
2744 |
} // CCTsyCallControlFU::TestUnit0011L
|
|
2745 |
|
|
2746 |
|
|
2747 |
/**
|
|
2748 |
@SYMTestCaseID BA-CTSYD-DIS-CALLCONTROL-UN0012
|
|
2749 |
@SYMComponent telephony_ctsy
|
|
2750 |
@SYMTestCaseDesc Test support in CTSYDispatch for ICC Call Forwarding Status Change Indicator
|
|
2751 |
@SYMTestPriority High
|
|
2752 |
@SYMTestActions Invokes RMmCustomAPI::NotifyIccCallForwardingStatusChange()
|
|
2753 |
@SYMTestExpectedResults Pass
|
|
2754 |
@SYMTestType UT
|
|
2755 |
*/
|
|
2756 |
void CCTsyCallControlFU::TestUnit0012L()
|
|
2757 |
{
|
|
2758 |
OpenEtelServerL(EUseExtendedError);
|
|
2759 |
CleanupStack::PushL(TCleanupItem(Cleanup,this));
|
|
2760 |
|
|
2761 |
OpenPhoneL();
|
|
2762 |
|
|
2763 |
RMmCustomAPI customApi;
|
|
2764 |
OpenCustomApiLC(customApi);
|
|
2765 |
|
|
2766 |
TRequestStatus reqStatus;
|
|
2767 |
|
|
2768 |
TInt error = KErrNone;
|
|
2769 |
|
|
2770 |
RBuf8 data;
|
|
2771 |
CleanupClosePushL(data);
|
|
2772 |
RMmCustomAPI::TCFIndicators cfIndicators;
|
|
2773 |
TPckg<RMmCustomAPI::TCFIndicators> cfIndicatorsPckg(cfIndicators);
|
|
2774 |
|
|
2775 |
|
|
2776 |
RMobilePhone::TMobileAddress phoneNumber;
|
|
2777 |
phoneNumber.iTelNumber = _L("012345");
|
|
2778 |
RMobilePhone::TCFUIndicatorStatusFlags indicators = RMobilePhone::KCFUIndicatorFax | RMobilePhone::KCFUIndicatorData;
|
|
2779 |
RMmCustomAPI::TMultipleSubscriberProfileID subscriberId (RMmCustomAPI::KProfileIdentityThree);
|
|
2780 |
|
|
2781 |
TMockLtsyData3<RMobilePhone::TMobileAddress,
|
|
2782 |
RMobilePhone::TCFUIndicatorStatusFlags,
|
|
2783 |
RMmCustomAPI::TMultipleSubscriberProfileID> mockLtsyData(phoneNumber, indicators, subscriberId);
|
|
2784 |
|
|
2785 |
mockLtsyData.SerialiseL(data);
|
|
2786 |
|
|
2787 |
customApi.NotifyIccCallForwardingStatusChange(reqStatus,cfIndicatorsPckg);
|
|
2788 |
iMockLTSY.CompleteL(KMockLtsyDispatchCallControlNotifyIccCallForwardingStatusChangeIndId,error,data);
|
|
2789 |
User::WaitForRequest(reqStatus);
|
|
2790 |
ASSERT_EQUALS(reqStatus.Int(),error);
|
|
2791 |
ASSERT_EQUALS(cfIndicators.iIndicator,indicators);
|
|
2792 |
ASSERT_EQUALS(cfIndicators.iMultipleSubscriberProfileID, subscriberId);
|
|
2793 |
ASSERT_TRUE(cfIndicators.iCFNumber.iTelNumber.Compare(phoneNumber.iTelNumber) == 0);
|
|
2794 |
AssertMockLtsyStatusL();
|
|
2795 |
|
|
2796 |
|
|
2797 |
CleanupStack::PopAndDestroy(&data);
|
|
2798 |
CleanupStack::PopAndDestroy(&customApi);
|
|
2799 |
CleanupStack::PopAndDestroy(this);
|
|
2800 |
}
|
|
2801 |
|
|
2802 |
|
|
2803 |
/**
|
|
2804 |
@SYMTestCaseID BA-CTSYD-DIS-CALLCONTROL-UN0013
|
|
2805 |
@SYMComponent telephony_ctsy
|
|
2806 |
@SYMTestCaseDesc Test support in CTSY Dispatcher for RMmCustomAPI::GetAlsBlocked and RMmCustomAPI::SetAlsBlocked
|
|
2807 |
@SYMTestPriority High
|
|
2808 |
@SYMTestActions Invokes RMmCustomAPI::GetAlsBlocked and RMmCustomAPI::SetAlsBlocked
|
|
2809 |
@SYMTestExpectedResults Pass
|
|
2810 |
@SYMTestType UT
|
|
2811 |
*/
|
|
2812 |
void CCTsyCallControlFU::TestUnit0013L()
|
|
2813 |
{
|
|
2814 |
OpenEtelServerL(EUseExtendedError);
|
|
2815 |
CleanupStack::PushL(TCleanupItem(Cleanup, this));
|
|
2816 |
OpenPhoneL();
|
|
2817 |
|
|
2818 |
RBuf8 data;
|
|
2819 |
CleanupClosePushL(data);
|
|
2820 |
|
|
2821 |
RMmCustomAPI customApi;
|
|
2822 |
OpenCustomApiLC(customApi);
|
|
2823 |
|
|
2824 |
// A. Get Status
|
|
2825 |
iMockLTSY.ExpectL(MLtsyDispatchCallControlGetAlsBlockedStatus::KLtsyDispatchCallControlGetAlsBlockedStatusApiId, KErrNone);
|
|
2826 |
RMmCustomAPI::TGetAlsBlockStatus compData = RMmCustomAPI::EBlockStatusInactive;
|
|
2827 |
TMockLtsyData1<RMmCustomAPI::TGetAlsBlockStatus> alsLtsyData1(compData);
|
|
2828 |
alsLtsyData1.SerialiseL(data);
|
|
2829 |
iMockLTSY.CompleteL(MLtsyDispatchCallControlGetAlsBlockedStatus::KLtsyDispatchCallControlGetAlsBlockedStatusApiId, KErrNone, data);
|
|
2830 |
|
|
2831 |
RMmCustomAPI::TGetAlsBlockStatus status;
|
|
2832 |
ASSERT_EQUALS(KErrNone, customApi.GetAlsBlocked(status));
|
|
2833 |
ASSERT_EQUALS(compData, status);
|
|
2834 |
|
|
2835 |
// B. Set blocked
|
|
2836 |
data.Close();
|
|
2837 |
RMmCustomAPI::TSetAlsBlock setData = RMmCustomAPI::EActivateBlock;
|
|
2838 |
TMockLtsyData1<RMmCustomAPI::TSetAlsBlock> alsLtsyData2(setData);
|
|
2839 |
alsLtsyData2.SerialiseL(data);
|
|
2840 |
iMockLTSY.ExpectL(MLtsyDispatchCallControlSetAlsBlocked::KLtsyDispatchCallControlSetAlsBlockedApiId, data, KErrNone);
|
|
2841 |
iMockLTSY.CompleteL(MLtsyDispatchCallControlSetAlsBlocked::KLtsyDispatchCallControlSetAlsBlockedApiId, KErrNone);
|
|
2842 |
|
|
2843 |
ASSERT_EQUALS(KErrNone, customApi.SetAlsBlocked(setData));
|
|
2844 |
|
|
2845 |
AssertMockLtsyStatusL();
|
|
2846 |
CleanupStack::PopAndDestroy(3, this); // customApi, data, this
|
|
2847 |
} // CCTsyCallControlFU::TestUnit0013L
|
|
2848 |
|
|
2849 |
|
|
2850 |
/**
|
|
2851 |
@SYMTestCaseID BA-CTSYD-DIS-CALLCONTROL-UN0014
|
|
2852 |
@SYMComponent telephony_ctsy
|
|
2853 |
@SYMTestCaseDesc Test support in CTSY Dispatcher for RMmCustomAPI::GetLifeTime
|
|
2854 |
@SYMTestPriority High
|
|
2855 |
@SYMTestActions Invokes RMmCustomAPI::GetLifeTime
|
|
2856 |
@SYMTestExpectedResults Pass
|
|
2857 |
@SYMTestType UT
|
|
2858 |
*/
|
|
2859 |
void CCTsyCallControlFU::TestUnit0014L()
|
|
2860 |
{
|
|
2861 |
OpenEtelServerL(EUseExtendedError);
|
|
2862 |
CleanupStack::PushL(TCleanupItem(Cleanup, this));
|
|
2863 |
OpenPhoneL();
|
|
2864 |
|
|
2865 |
RBuf8 data;
|
|
2866 |
CleanupClosePushL(data);
|
|
2867 |
|
|
2868 |
RMmCustomAPI customApi;
|
|
2869 |
OpenCustomApiLC(customApi);
|
|
2870 |
|
|
2871 |
// A. Test when there is no life time data
|
|
2872 |
iMockLTSY.ExpectL(MLtsyDispatchCallControlGetLifeTime::KLtsyDispatchCallControlGetLifeTimeApiId, KErrNone);
|
|
2873 |
|
|
2874 |
RMmCustomAPI::TLifeTimeData compData;
|
|
2875 |
compData.iCaps = 0;
|
|
2876 |
TMockLtsyData1<RMmCustomAPI::TLifeTimeData> ltLtsyData1(compData);
|
|
2877 |
ltLtsyData1.SerialiseL(data);
|
|
2878 |
iMockLTSY.CompleteL(MLtsyDispatchCallControlGetLifeTime::KLtsyDispatchCallControlGetLifeTimeApiId, KErrNone, data);
|
|
2879 |
|
|
2880 |
RMmCustomAPI::TLifeTimeData lifeTime;
|
|
2881 |
RMmCustomAPI::TLifeTimeDataPckg lifeTimePckg(lifeTime);
|
|
2882 |
ASSERT_EQUALS(KErrNone, customApi.GetLifeTime(lifeTimePckg));
|
|
2883 |
ASSERT_EQUALS(compData.iCaps, lifeTime.iCaps);
|
|
2884 |
|
|
2885 |
|
|
2886 |
// B. Test when there is only life time data
|
|
2887 |
iMockLTSY.ExpectL(MLtsyDispatchCallControlGetLifeTime::KLtsyDispatchCallControlGetLifeTimeApiId, KErrNone);
|
|
2888 |
|
|
2889 |
compData.iCaps = RMmCustomAPI::TLifeTimeData::ELifeTimeDataCapsLifeTime;
|
|
2890 |
compData.iHours = 12234;
|
|
2891 |
compData.iMinutes = 14;
|
|
2892 |
data.Close();
|
|
2893 |
TMockLtsyData1<RMmCustomAPI::TLifeTimeData> ltLtsyData2(compData);
|
|
2894 |
ltLtsyData2.SerialiseL(data);
|
|
2895 |
iMockLTSY.CompleteL(MLtsyDispatchCallControlGetLifeTime::KLtsyDispatchCallControlGetLifeTimeApiId, KErrNone, data);
|
|
2896 |
|
|
2897 |
ASSERT_EQUALS(KErrNone, customApi.GetLifeTime(lifeTimePckg));
|
|
2898 |
ASSERT_EQUALS(compData.iHours, lifeTime.iHours);
|
|
2899 |
ASSERT_EQUALS(compData.iMinutes, lifeTime.iMinutes);
|
|
2900 |
|
|
2901 |
// C. Test when there is only manufacturing date data
|
|
2902 |
iMockLTSY.ExpectL(MLtsyDispatchCallControlGetLifeTime::KLtsyDispatchCallControlGetLifeTimeApiId, KErrNone);
|
|
2903 |
|
|
2904 |
compData.iCaps = RMmCustomAPI::TLifeTimeData::ELifeTimeDataCapsManufacturerDate;
|
|
2905 |
compData.iManufacturingDate.SetYear(1995);
|
|
2906 |
compData.iManufacturingDate.SetMonth(EAugust);
|
|
2907 |
compData.iManufacturingDate.SetDay(21);
|
|
2908 |
data.Close();
|
|
2909 |
TMockLtsyData1<RMmCustomAPI::TLifeTimeData> ltLtsyData3(compData);
|
|
2910 |
ltLtsyData3.SerialiseL(data);
|
|
2911 |
iMockLTSY.CompleteL(MLtsyDispatchCallControlGetLifeTime::KLtsyDispatchCallControlGetLifeTimeApiId, KErrNone, data);
|
|
2912 |
|
|
2913 |
ASSERT_EQUALS(KErrNone, customApi.GetLifeTime(lifeTimePckg));
|
|
2914 |
ASSERT_EQUALS(compData.iManufacturingDate.Year(), lifeTime.iManufacturingDate.Year());
|
|
2915 |
ASSERT_EQUALS(compData.iManufacturingDate.Month(), lifeTime.iManufacturingDate.Month());
|
|
2916 |
ASSERT_EQUALS(compData.iManufacturingDate.Day(), lifeTime.iManufacturingDate.Day());
|
|
2917 |
|
|
2918 |
// D. Test when there is manufacturing date data and lifetime data
|
|
2919 |
iMockLTSY.ExpectL(MLtsyDispatchCallControlGetLifeTime::KLtsyDispatchCallControlGetLifeTimeApiId, KErrNone);
|
|
2920 |
|
|
2921 |
compData.iCaps = RMmCustomAPI::TLifeTimeData::ELifeTimeDataCapsManufacturerDate | RMmCustomAPI::TLifeTimeData::ELifeTimeDataCapsLifeTime;
|
|
2922 |
compData.iManufacturingDate.SetYear(2000);
|
|
2923 |
compData.iManufacturingDate.SetMonth(EJune);
|
|
2924 |
compData.iManufacturingDate.SetDay(12);
|
|
2925 |
compData.iHours = 31234;
|
|
2926 |
compData.iMinutes = 43;
|
|
2927 |
data.Close();
|
|
2928 |
TMockLtsyData1<RMmCustomAPI::TLifeTimeData> ltLtsyData4(compData);
|
|
2929 |
ltLtsyData3.SerialiseL(data);
|
|
2930 |
iMockLTSY.CompleteL(MLtsyDispatchCallControlGetLifeTime::KLtsyDispatchCallControlGetLifeTimeApiId, KErrNone, data);
|
|
2931 |
|
|
2932 |
ASSERT_EQUALS(KErrNone, customApi.GetLifeTime(lifeTimePckg));
|
|
2933 |
ASSERT_EQUALS(compData.iHours, lifeTime.iHours);
|
|
2934 |
ASSERT_EQUALS(compData.iMinutes, lifeTime.iMinutes);
|
|
2935 |
ASSERT_EQUALS(compData.iManufacturingDate.Year(), lifeTime.iManufacturingDate.Year());
|
|
2936 |
ASSERT_EQUALS(compData.iManufacturingDate.Month(), lifeTime.iManufacturingDate.Month());
|
|
2937 |
ASSERT_EQUALS(compData.iManufacturingDate.Day(), lifeTime.iManufacturingDate.Day());
|
|
2938 |
|
|
2939 |
AssertMockLtsyStatusL();
|
|
2940 |
CleanupStack::PopAndDestroy(3, this); //customApi, data, this
|
|
2941 |
} // CCTsyCallControlFU::TestUnit0014L
|
|
2942 |
|
|
2943 |
|
|
2944 |
/**
|
|
2945 |
@SYMTestCaseID BA-CTSYD-DIS-CALLCONTROL-UN0015
|
|
2946 |
@SYMComponent telephony_ctsy
|
|
2947 |
@SYMTestCaseDesc Test support in CTSY Dispatcher for RMmCustomAPI::TerminateCall
|
|
2948 |
@SYMTestPriority High
|
|
2949 |
@SYMTestActions Invokes RMmCustomAPI::TerminateCall
|
|
2950 |
@SYMTestExpectedResults Pass
|
|
2951 |
@SYMTestType UT
|
|
2952 |
*/
|
|
2953 |
void CCTsyCallControlFU::TestUnit0015L()
|
|
2954 |
{
|
|
2955 |
OpenEtelServerL(EUseExtendedError);
|
|
2956 |
CleanupStack::PushL(TCleanupItem(Cleanup, this));
|
|
2957 |
OpenPhoneL();
|
|
2958 |
|
|
2959 |
RBuf8 data;
|
|
2960 |
CleanupClosePushL(data);
|
|
2961 |
|
|
2962 |
RMmCustomAPI customApi;
|
|
2963 |
OpenCustomApiLC(customApi);
|
|
2964 |
|
|
2965 |
// A. Terminate a specific call
|
|
2966 |
// Create an active call
|
|
2967 |
TInt callId = 1;
|
|
2968 |
DriverDialCallL(callId, RMobilePhone::EVoiceService);
|
|
2969 |
RMobileLine mobileLine;
|
|
2970 |
CleanupClosePushL(mobileLine);
|
|
2971 |
RMobileCall mobileCall;
|
|
2972 |
CleanupClosePushL(mobileCall);
|
|
2973 |
ClientDialCallL(mobileLine, mobileCall, RMobilePhone::EVoiceService);
|
|
2974 |
|
|
2975 |
// Getting the call information
|
|
2976 |
RMobileCall::TMobileCallInfoV1 callInfo;
|
|
2977 |
RMobileCall::TMobileCallInfoV1Pckg callInfoPckg(callInfo);
|
|
2978 |
ASSERT_EQUALS(KErrNone, mobileCall.GetMobileCallInfo(callInfoPckg));
|
|
2979 |
ASSERT_EQUALS(callId , callInfo.iCallId);
|
|
2980 |
|
|
2981 |
// Getting mock ltsy ready
|
|
2982 |
data.Close();
|
|
2983 |
TMockLtsyData1<TInt> termLtsyData1(callId);
|
|
2984 |
termLtsyData1.SerialiseL(data);
|
|
2985 |
iMockLTSY.ExpectL(MLtsyDispatchCallControlTerminateErrorCall::KLtsyDispatchCallControlTerminateErrorCallApiId, data, KErrNone);
|
|
2986 |
iMockLTSY.CompleteL(MLtsyDispatchCallControlTerminateErrorCall::KLtsyDispatchCallControlTerminateErrorCallApiId, KErrNone, data);
|
|
2987 |
|
|
2988 |
// Activate the API
|
|
2989 |
ASSERT_EQUALS(KErrNone, customApi.TerminateCall(callInfo.iCallName));
|
|
2990 |
|
|
2991 |
// Hang up the call
|
|
2992 |
DriverHangUpCallL(callId, KErrGsmCCNormalCallClearing);
|
|
2993 |
ClientHangUpCallL(mobileCall);
|
|
2994 |
|
|
2995 |
// B. All calls
|
|
2996 |
// Create an active call
|
|
2997 |
callId = 71;
|
|
2998 |
DriverDialCallL(callId, RMobilePhone::EVoiceService);
|
|
2999 |
RMobileLine mobileLine2;
|
|
3000 |
CleanupClosePushL(mobileLine2);
|
|
3001 |
RMobileCall mobileCall2;
|
|
3002 |
CleanupClosePushL(mobileCall2);
|
|
3003 |
ClientDialCallL(mobileLine2, mobileCall2, RMobilePhone::EVoiceService);
|
|
3004 |
|
|
3005 |
// Getting mock ltsy ready
|
|
3006 |
iMockLTSY.ExpectL(MLtsyDispatchCallControlTerminateAllCalls::KLtsyDispatchCallControlTerminateAllCallsApiId, KErrNone);
|
|
3007 |
iMockLTSY.CompleteL(MLtsyDispatchCallControlTerminateAllCalls::KLtsyDispatchCallControlTerminateAllCallsApiId, KErrNone);
|
|
3008 |
|
|
3009 |
// Activate the API
|
|
3010 |
TName terminateAll(KTerminateAllCalls);
|
|
3011 |
ASSERT_EQUALS(KErrNone, customApi.TerminateCall(terminateAll));
|
|
3012 |
|
|
3013 |
// Hang up the call
|
|
3014 |
DriverHangUpCallL(callId, KErrGsmCCNormalCallClearing);
|
|
3015 |
|
|
3016 |
|
|
3017 |
TRequestStatus reqStatusTerminated;
|
|
3018 |
iMockLTSY.NotifyTerminated(reqStatusTerminated);
|
|
3019 |
|
|
3020 |
ClientHangUpCallL(mobileCall2);
|
|
3021 |
|
|
3022 |
User::WaitForRequest(reqStatusTerminated);
|
|
3023 |
ASSERT_EQUALS(KErrNone, reqStatusTerminated.Int());
|
|
3024 |
|
|
3025 |
AssertMockLtsyStatusL();
|
|
3026 |
CleanupStack::PopAndDestroy(7, this); //mobileCall2, mobileLine2, mobileCall, mobileLine, customApi, data, this
|
|
3027 |
} // CCTsyCallControlFU::TestUnit0015L
|
|
3028 |
|
|
3029 |
|
|
3030 |
/**
|
|
3031 |
@SYMTestCaseID BA-CTSYD-DIS-CALLCONTROL-UN0016
|
|
3032 |
@SYMComponent telephony_ctsy
|
|
3033 |
@SYMTestCaseDesc Test support in CTSY Dispatcher for RMmCustomAPI::GetRemoteAlertingToneStatus and RMmCustomAPI::NotifyRemoteAlertingToneStatusChange
|
|
3034 |
@SYMTestPriority High
|
|
3035 |
@SYMTestActions Invokes RMmCustomAPI::GetRemoteAlertingToneStatus and RMmCustomAPI::NotifyRemoteAlertingToneStatusChange
|
|
3036 |
@SYMTestExpectedResults Pass
|
|
3037 |
@SYMTestType UT
|
|
3038 |
*/
|
|
3039 |
void CCTsyCallControlFU::TestUnit0016L()
|
|
3040 |
{
|
|
3041 |
OpenEtelServerL(EUseExtendedError);
|
|
3042 |
CleanupStack::PushL(TCleanupItem(Cleanup, this));
|
|
3043 |
OpenPhoneL();
|
|
3044 |
|
|
3045 |
RBuf8 data;
|
|
3046 |
CleanupClosePushL(data);
|
|
3047 |
|
|
3048 |
RMmCustomAPI customApi;
|
|
3049 |
OpenCustomApiLC(customApi);
|
|
3050 |
|
|
3051 |
// A. Test without notification from the LTSY
|
|
3052 |
RMmCustomAPI::TRemoteAlertingToneStatus status;
|
|
3053 |
ASSERT_EQUALS(KErrNone, customApi.GetRemoteAlertingToneStatus(status));
|
|
3054 |
ASSERT_EQUALS(RMmCustomAPI::EUiNoTone, status);
|
|
3055 |
|
|
3056 |
// B. LTSY notify that the status was set
|
|
3057 |
TRequestStatus terminatedStatus;
|
|
3058 |
iMockLTSY.NotifyTerminated(terminatedStatus);
|
|
3059 |
RMmCustomAPI::TRemoteAlertingToneStatus compStatus = RMmCustomAPI::EUiRbtTone;
|
|
3060 |
TMockLtsyData1<RMmCustomAPI::TRemoteAlertingToneStatus> compData1(compStatus);
|
|
3061 |
data.Close();
|
|
3062 |
compData1.SerialiseL(data);
|
|
3063 |
iMockLTSY.CompleteL(KMockLtsyDispatchCallControlRemoteAlertingToneChangeIndId, KErrNone, data);
|
|
3064 |
User::WaitForRequest(terminatedStatus);
|
|
3065 |
|
|
3066 |
// Activate the API
|
|
3067 |
ASSERT_EQUALS(KErrNone, customApi.GetRemoteAlertingToneStatus(status));
|
|
3068 |
ASSERT_EQUALS(compStatus, status);
|
|
3069 |
|
|
3070 |
|
|
3071 |
// C. Check the change notification
|
|
3072 |
TRequestStatus notifyStatus;
|
|
3073 |
customApi.NotifyRemoteAlertingToneStatusChange(notifyStatus, status);
|
|
3074 |
compStatus = RMmCustomAPI::EUiStopTone;
|
|
3075 |
TMockLtsyData1<RMmCustomAPI::TRemoteAlertingToneStatus> compData2(compStatus);
|
|
3076 |
data.Close();
|
|
3077 |
compData1.SerialiseL(data);
|
|
3078 |
iMockLTSY.CompleteL(KMockLtsyDispatchCallControlRemoteAlertingToneChangeIndId, KErrNone, data);
|
|
3079 |
User::WaitForRequest(notifyStatus);
|
|
3080 |
ASSERT_EQUALS(compStatus, status);
|
|
3081 |
|
|
3082 |
AssertMockLtsyStatusL();
|
|
3083 |
CleanupStack::PopAndDestroy(3, this); //customApi, data, this
|
|
3084 |
} // CCTsyCallControlFU::TestUnit0016L
|
|
3085 |
|
|
3086 |
|
|
3087 |
/**
|
|
3088 |
@SYMTestCaseID BA-CTSYD-DIS-CALLCONTROL-UN0017
|
|
3089 |
@SYMComponent telephony_ctsy
|
|
3090 |
@SYMTestCaseDesc Test support in CTSY Dispatcher for RMmCustomAPI::GetIccCallForwardingIndicatorStatus
|
|
3091 |
@SYMTestPriority High
|
|
3092 |
@SYMTestActions Invokes RMmCustomAPI::GetIccCallForwardingIndicatorStatus
|
|
3093 |
@SYMTestExpectedResults Pass
|
|
3094 |
@SYMTestType UT
|
|
3095 |
*/
|
|
3096 |
void CCTsyCallControlFU::TestUnit0017L()
|
|
3097 |
{
|
|
3098 |
OpenEtelServerL(EUseExtendedError);
|
|
3099 |
CleanupStack::PushL(TCleanupItem(Cleanup, this));
|
|
3100 |
OpenPhoneL();
|
|
3101 |
|
|
3102 |
RBuf8 data;
|
|
3103 |
CleanupClosePushL(data);
|
|
3104 |
|
|
3105 |
RMmCustomAPI customApi;
|
|
3106 |
OpenCustomApiLC(customApi);
|
|
3107 |
// Getting mock ltsy ready
|
|
3108 |
data.Close();
|
|
3109 |
iMockLTSY.ExpectL(MLtsyDispatchCallControlGetCallForwardingIndicator::KLtsyDispatchCallControlGetCallForwardingIndicatorApiId);
|
|
3110 |
RMobilePhone::TMobilePhoneCFUIndicatorV6 compIndicator;
|
|
3111 |
compIndicator.iMultipleSubscriberProfileID = RMobilePhone::KProfileIdentityThree;
|
|
3112 |
compIndicator.iIndicator = RMobilePhone::KCFUIndicatorVoice | RMobilePhone::KCFUIndicatorData;
|
|
3113 |
compIndicator.iCFNumber.iNumberPlan = RMobilePhone::ENationalNumberPlan;
|
|
3114 |
compIndicator.iCFNumber.iTypeOfNumber = RMobilePhone::EAlphanumericNumber;
|
|
3115 |
_LIT(KTelNumber, "020102010201");
|
|
3116 |
compIndicator.iCFNumber.iTelNumber = KTelNumber;
|
|
3117 |
TMockLtsyData1<RMobilePhone::TMobilePhoneCFUIndicatorV6> indicatorData(compIndicator);
|
|
3118 |
data.Close();
|
|
3119 |
indicatorData.SerialiseL(data);
|
|
3120 |
iMockLTSY.CompleteL(MLtsyDispatchCallControlGetCallForwardingIndicator::KLtsyDispatchCallControlGetCallForwardingIndicatorApiId,KErrNone,data,0);
|
|
3121 |
|
|
3122 |
// Activate the API
|
|
3123 |
RMmCustomAPI::TCFIndicators indicator;
|
|
3124 |
RMmCustomAPI::TCFIndicatorsPckg indicatorPckg(indicator);
|
|
3125 |
TRequestStatus apiStatus;
|
|
3126 |
customApi.GetIccCallForwardingIndicatorStatus(apiStatus, indicatorPckg);
|
|
3127 |
User::WaitForRequest(apiStatus);
|
|
3128 |
ASSERT_EQUALS(KErrNone, apiStatus.Int());
|
|
3129 |
ASSERT_EQUALS(compIndicator.iCFNumber.iTelNumber, indicator.iCFNumber.iTelNumber);
|
|
3130 |
ASSERT_EQUALS(compIndicator.iCFNumber.iTypeOfNumber, indicator.iCFNumber.iTypeOfNumber);
|
|
3131 |
ASSERT_EQUALS(compIndicator.iCFNumber.iNumberPlan, indicator.iCFNumber.iNumberPlan);
|
|
3132 |
ASSERT_EQUALS(compIndicator.iIndicator, indicator.iIndicator);
|
|
3133 |
// CTSY sets the value of iMultipleSubscriberProfileID into a private repository, but not to the API struct.
|
|
3134 |
// ASSERT_EQUALS(RMmCustomAPI::KProfileIdentityThree, indicator.iMultipleSubscriberProfileID);
|
|
3135 |
|
|
3136 |
|
|
3137 |
AssertMockLtsyStatusL();
|
|
3138 |
CleanupStack::PopAndDestroy(3, this); //customApi, data, this
|
|
3139 |
} // CCTsyCallControlFU::TestUnit0017L
|
|
3140 |
|
|
3141 |
|
|
3142 |
/**
|
|
3143 |
@SYMTestCaseID BA-CTSYD-DIS-CALLCONTROL-UN0018
|
|
3144 |
@SYMComponent telephony_ctsy
|
|
3145 |
@SYMTestCaseDesc Test support in CTSY Dispatcher for RMmCustomAPI::CheckAlsPpSupport
|
|
3146 |
@SYMTestPriority High
|
|
3147 |
@SYMTestActions Invokes RMmCustomAPI::CheckAlsPpSupport
|
|
3148 |
@SYMTestExpectedResults Pass
|
|
3149 |
@SYMTestType UT
|
|
3150 |
*/
|
|
3151 |
void CCTsyCallControlFU::TestUnit0018L()
|
|
3152 |
{
|
|
3153 |
OpenEtelServerL(EUseExtendedError);
|
|
3154 |
CleanupStack::PushL(TCleanupItem(Cleanup, this));
|
|
3155 |
OpenPhoneL();
|
|
3156 |
|
|
3157 |
RBuf8 data;
|
|
3158 |
CleanupClosePushL(data);
|
|
3159 |
|
|
3160 |
RMmCustomAPI customApi;
|
|
3161 |
OpenCustomApiLC(customApi);
|
|
3162 |
|
|
3163 |
iMockLTSY.ExpectL(MLtsyDispatchCallControlGetAlsPpSupport::KLtsyDispatchCallControlGetAlsPpSupportApiId, KErrNone);
|
|
3164 |
|
|
3165 |
|
|
3166 |
RMmCustomAPI::TAlsSupport compData = RMmCustomAPI::EAlsSupportOff;
|
|
3167 |
TMockLtsyData1<RMmCustomAPI::TAlsSupport> alsLtsyData1(compData);
|
|
3168 |
alsLtsyData1.SerialiseL(data);
|
|
3169 |
iMockLTSY.CompleteL(MLtsyDispatchCallControlGetAlsPpSupport::KLtsyDispatchCallControlGetAlsPpSupportApiId, KErrNone, data);
|
|
3170 |
|
|
3171 |
RMmCustomAPI::TAlsSupport support;
|
|
3172 |
ASSERT_EQUALS(KErrNone, customApi.CheckAlsPpSupport(support));
|
|
3173 |
ASSERT_EQUALS(compData, support);
|
|
3174 |
|
|
3175 |
AssertMockLtsyStatusL();
|
|
3176 |
CleanupStack::PopAndDestroy(3, this); //customApi, data, this
|
|
3177 |
} // CCTsyCallControlFU::TestUnit0018L
|
|
3178 |
|
|
3179 |
/**
|
|
3180 |
@SYMTestCaseID BA-CTSYD-DIS-CALLCONTROL-UN0019
|
|
3181 |
@SYMComponent telephony_ctsy
|
|
3182 |
@SYMTestCaseDesc Test support in CTSY for ECtsyUpdateLifeTimeReq/ECtsyUpdateLifeTimeComp IPCs by keeping a call open for longer than 10s
|
|
3183 |
@SYMTestPriority High
|
|
3184 |
@SYMTestActions Invokes ECtsyUpdateLifeTimeReq/ECtsyUpdateLifeTimeComp
|
|
3185 |
@SYMTestExpectedResults Pass
|
|
3186 |
@SYMTestType UT
|
|
3187 |
*/
|
|
3188 |
void CCTsyCallControlFU::TestUnit0019L()
|
|
3189 |
{
|
|
3190 |
OpenEtelServerL(EUseExtendedError);
|
|
3191 |
CleanupStack::PushL(TCleanupItem(Cleanup, this));
|
|
3192 |
OpenPhoneL();
|
|
3193 |
|
|
3194 |
RBuf8 data;
|
|
3195 |
CleanupClosePushL(data);
|
|
3196 |
|
|
3197 |
TInt callId = 1;
|
|
3198 |
RMobilePhone::TMobileService mobileService = RMobilePhone::EVoiceService;
|
|
3199 |
DriverDialCallL(callId, mobileService);
|
|
3200 |
|
|
3201 |
|
|
3202 |
|
|
3203 |
|
|
3204 |
// Client Side Test
|
|
3205 |
|
|
3206 |
RMobileLine mobileLine;
|
|
3207 |
CleanupClosePushL(mobileLine);
|
|
3208 |
RMobileCall mobileCall;
|
|
3209 |
CleanupClosePushL(mobileCall);
|
|
3210 |
ClientDialCallL(mobileLine, mobileCall, mobileService);
|
|
3211 |
|
|
3212 |
|
|
3213 |
AssertMockLtsyStatusL();
|
|
3214 |
|
|
3215 |
//expect the lifetimer call to come through
|
|
3216 |
|
|
3217 |
TUint32 duration = 10;
|
|
3218 |
TMockLtsyData1<TUint32> durationLtsyData(duration);
|
|
3219 |
durationLtsyData.SerialiseL(data);
|
|
3220 |
iMockLTSY.ExpectL(MLtsyDispatchCallControlUpdateLifeTimer::KLtsyDispatchCallControlUpdateLifeTimerApiId, data, KErrNone);
|
|
3221 |
data.Close();
|
|
3222 |
iMockLTSY.CompleteL(MLtsyDispatchCallControlUpdateLifeTimer::KLtsyDispatchCallControlUpdateLifeTimerApiId, KErrNone);
|
|
3223 |
|
|
3224 |
User::After(12500000);
|
|
3225 |
|
|
3226 |
TInt hangUpCause = KErrGsmCCNormalCallClearing; // Hang up cause for normal hang up
|
|
3227 |
DriverHangUpCallL(callId, hangUpCause);
|
|
3228 |
|
|
3229 |
TRequestStatus reqStatusTerminated;
|
|
3230 |
iMockLTSY.NotifyTerminated(reqStatusTerminated);
|
|
3231 |
|
|
3232 |
ClientHangUpCallL(mobileCall);
|
|
3233 |
|
|
3234 |
User::WaitForRequest(reqStatusTerminated);
|
|
3235 |
ASSERT_EQUALS(KErrNone, reqStatusTerminated.Int());
|
|
3236 |
|
|
3237 |
AssertMockLtsyStatusL();
|
|
3238 |
|
|
3239 |
CleanupStack::PopAndDestroy(3, &data); //mobileCall, mobileLine, data
|
|
3240 |
AssertMockLtsyStatusL();
|
|
3241 |
CleanupStack::PopAndDestroy(this);
|
|
3242 |
} // CCTsyCallControlFU::TestUnit0019L
|
|
3243 |
|
|
3244 |
|
|
3245 |
/**
|
|
3246 |
@SYMTestCaseID BA-CTSYD-DIS-CALLCONTROL-UN0020
|
|
3247 |
@SYMComponent telephony_ctsy
|
|
3248 |
@SYMTestCaseDesc Test support in CTSY for mobile originated voice call with no FDN check
|
|
3249 |
@SYMTestPriority High
|
|
3250 |
@SYMTestActions RMobileCall::DialNoFdnCheck() for a voice call
|
|
3251 |
@SYMTestExpectedResults Pass - Call reaches connected state and call is hung up
|
|
3252 |
@SYMTestType CT
|
|
3253 |
*/
|
|
3254 |
void CCTsyCallControlFU::TestUnit0020L()
|
|
3255 |
{
|
|
3256 |
OpenEtelServerL(EUseExtendedError);
|
|
3257 |
CleanupStack::PushL(TCleanupItem(Cleanup,this));
|
|
3258 |
OpenPhoneL();
|
|
3259 |
|
|
3260 |
TRequestStatus reqStatus;
|
|
3261 |
|
|
3262 |
//Test voice call
|
|
3263 |
|
|
3264 |
iMockLTSY.NotifyTerminated(reqStatus);
|
|
3265 |
|
|
3266 |
TInt callId = 1;
|
|
3267 |
RMobilePhone::TMobileService mobileService = RMobilePhone::EVoiceService;
|
|
3268 |
DriverDialCallL(callId, mobileService, EFalse, EFalse, EFalse);
|
|
3269 |
|
|
3270 |
TInt hangUpCause = KErrGsmCCNormalCallClearing; // Hang up cause for normal hang up
|
|
3271 |
DriverHangUpCallL(callId, hangUpCause);
|
|
3272 |
|
|
3273 |
// Client Side Test
|
|
3274 |
|
|
3275 |
RMobileLine mobileLine;
|
|
3276 |
CleanupClosePushL(mobileLine);
|
|
3277 |
RMobileCall mobileCall;
|
|
3278 |
CleanupClosePushL(mobileCall);
|
|
3279 |
ClientDialCallL(mobileLine, mobileCall, mobileService, EFalse, EFalse);
|
|
3280 |
|
|
3281 |
ClientHangUpCallL(mobileCall);
|
|
3282 |
|
|
3283 |
|
|
3284 |
mobileCall.Close();
|
|
3285 |
mobileLine.Close();
|
|
3286 |
|
|
3287 |
User::WaitForRequest(reqStatus);
|
|
3288 |
ASSERT_EQUALS(KErrNone, reqStatus.Int());
|
|
3289 |
|
|
3290 |
AssertMockLtsyStatusL();
|
|
3291 |
CleanupStack::PopAndDestroy(3, this); //mobileCall, mobileLine, this
|
|
3292 |
} // CCTsyCallControlFU::TestUnit0020L
|
|
3293 |
|
|
3294 |
|
|
3295 |
/**
|
|
3296 |
@SYMTestCaseID BA-CTSYD-DIS-CALLCONTROL-UT0021
|
|
3297 |
@SYMComponent telephony_ctsy
|
|
3298 |
@SYMTestCaseDesc Test support in CTSY for mobile originated data call with no FDN check
|
|
3299 |
@SYMTestPriority High
|
|
3300 |
@SYMTestActions Invokes RMobileCall::DialNoFdnCheck() for a data call
|
|
3301 |
@SYMTestExpectedResults Pass
|
|
3302 |
@SYMTestType CT
|
|
3303 |
*/
|
|
3304 |
void CCTsyCallControlFU::TestUnit0021L()
|
|
3305 |
{
|
|
3306 |
OpenEtelServerL(EUseExtendedError);
|
|
3307 |
CleanupStack::PushL(TCleanupItem(Cleanup, this));
|
|
3308 |
OpenPhoneL();
|
|
3309 |
|
|
3310 |
RBuf8 data;
|
|
3311 |
CleanupClosePushL(data);
|
|
3312 |
|
|
3313 |
TInt callId = 1;
|
|
3314 |
RMobilePhone::TMobileService mobileService = RMobilePhone::ECircuitDataService;
|
|
3315 |
|
|
3316 |
DriverDialCallL(callId, mobileService, EFalse, EFalse, EFalse);
|
|
3317 |
|
|
3318 |
// KMockLtsyDispatchCallControlNotifyDataCallCapsChangeIndId
|
|
3319 |
RMobileCall::TMobileCallDataCapsV1 completeCallCaps;
|
|
3320 |
completeCallCaps.iSpeedCaps = RMobileCall::KCapsSpeed48000;
|
|
3321 |
completeCallCaps.iProtocolCaps = RMobileCall::KCapsProtocolV34;
|
|
3322 |
completeCallCaps.iServiceCaps = RMobileCall::KCapsPacketAccessSyncUDI;
|
|
3323 |
completeCallCaps.iQoSCaps = RMobileCall::KCapsTransparentPreferred;
|
|
3324 |
completeCallCaps.iHscsdSupport = ETrue;
|
|
3325 |
completeCallCaps.iMClass = 2;
|
|
3326 |
completeCallCaps.iMaxRxTimeSlots = 4;
|
|
3327 |
completeCallCaps.iMaxTxTimeSlots = 8;
|
|
3328 |
completeCallCaps.iTotalRxTxTimeSlots = 10;
|
|
3329 |
completeCallCaps.iCodingCaps = RMobileCall::KCapsAiurCoding96;
|
|
3330 |
completeCallCaps.iAsymmetryCaps = RMobileCall::KCapsAsymmetryDownlink;
|
|
3331 |
completeCallCaps.iUserInitUpgrade = ETrue;
|
|
3332 |
completeCallCaps.iRLPVersionCaps = RMobileCall::KCapsRLPSingleLinkVersion1;
|
|
3333 |
completeCallCaps.iV42bisCaps = RMobileCall::KCapsV42bisRxDirection;
|
|
3334 |
data.Close();
|
|
3335 |
TMockLtsyCallData1<RMobileCall::TMobileCallDataCapsV1>
|
|
3336 |
completeDataCapsData(callId, RMobilePhone::EServiceUnspecified, completeCallCaps);
|
|
3337 |
completeDataCapsData.SerialiseL(data);
|
|
3338 |
iMockLTSY.CompleteL(KMockLtsyDispatchCallControlNotifyDataCallCapsChangeIndId, KErrNone, data);
|
|
3339 |
|
|
3340 |
_LIT(KDataPort, "DATAPORT::0");
|
|
3341 |
RCall::TCommPort commPort;
|
|
3342 |
commPort.iPort = KDataPort;
|
|
3343 |
data.Close();
|
|
3344 |
TMockLtsyData2<TInt,RCall::TCommPort> loanDataPortExpData(callId,commPort);
|
|
3345 |
loanDataPortExpData.SerialiseL(data);
|
|
3346 |
iMockLTSY.ExpectL(MLtsyDispatchCallControlLoanDataPort::KLtsyDispatchCallControlLoanDataPortApiId, data);
|
|
3347 |
iMockLTSY.ExpectL(MLtsyDispatchCallControlRecoverDataPort::KLtsyDispatchCallControlRecoverDataPortApiId, data);
|
|
3348 |
|
|
3349 |
|
|
3350 |
// MLtsyDispatchCallControlSetDynamicHscsdParams::KLtsyDispatchCallControlSetDynamicHscsdParamsApiId
|
|
3351 |
RMobileCall::TMobileHscsdCallParamsV8 hscsdParams;
|
|
3352 |
hscsdParams.iWantedAiur = RMobileCall::EAiurBps38400;
|
|
3353 |
hscsdParams.iWantedRxTimeSlots = 2;
|
|
3354 |
data.Close();
|
|
3355 |
TMockLtsyData2<TInt, RMobileCall::TMobileHscsdCallParamsV8> paramData(callId, hscsdParams);
|
|
3356 |
paramData.SerialiseL(data);
|
|
3357 |
iMockLTSY.ExpectL(MLtsyDispatchCallControlSetDynamicHscsdParams::KLtsyDispatchCallControlSetDynamicHscsdParamsApiId, data);
|
|
3358 |
|
|
3359 |
TMockLtsyData1<TInt> mockParamData(callId);
|
|
3360 |
data.Close();
|
|
3361 |
mockParamData.SerialiseL(data);
|
|
3362 |
iMockLTSY.CompleteL(MLtsyDispatchCallControlSetDynamicHscsdParams::KLtsyDispatchCallControlSetDynamicHscsdParamsApiId, KErrNone, data);
|
|
3363 |
|
|
3364 |
// KMockLtsyDispatchCallControlNotifyHscsdInfoChangeIndId
|
|
3365 |
RMobileCall::TMobileCallHscsdInfoV8 hscsdInfo;
|
|
3366 |
hscsdInfo.iCodings = RMobileCall::ETchCoding320;
|
|
3367 |
hscsdInfo.iAiur = RMobileCall::EAiurBps38400;
|
|
3368 |
hscsdInfo.iRxTimeSlots = 2;
|
|
3369 |
hscsdInfo.iTxTimeSlots = 2;
|
|
3370 |
|
|
3371 |
RMobileCall::TMobileCallDataCapsV1 completeCallCaps2 = completeCallCaps;
|
|
3372 |
completeCallCaps2.iHscsdSupport = ETrue;
|
|
3373 |
completeCallCaps2.iSpeedCaps = RMobileCall::KCapsSpeed57600;
|
|
3374 |
completeCallCaps2.iMaxRxTimeSlots = 3;
|
|
3375 |
completeCallCaps2.iMaxTxTimeSlots = 5;
|
|
3376 |
|
|
3377 |
TMockLtsyCallData2<RMobileCall::TMobileCallHscsdInfoV8, RMobileCall::TMobileCallDataCapsV1>
|
|
3378 |
hscsdData(1, RMobilePhone::ECircuitDataService, hscsdInfo, completeCallCaps2);
|
|
3379 |
data.Close();
|
|
3380 |
hscsdData.SerialiseL(data);
|
|
3381 |
|
|
3382 |
iMockLTSY.CompleteL(KMockLtsyDispatchCallControlNotifyHscsdInfoChangeIndId, KErrNone, data);
|
|
3383 |
|
|
3384 |
TInt hangUpCause = KErrGsmCCNormalCallClearing;
|
|
3385 |
DriverHangUpCallL(callId, hangUpCause);
|
|
3386 |
|
|
3387 |
// Client Side Test
|
|
3388 |
|
|
3389 |
RMobileLine mobileLine;
|
|
3390 |
CleanupClosePushL(mobileLine);
|
|
3391 |
RMobileCall mobileCall;
|
|
3392 |
CleanupClosePushL(mobileCall);
|
|
3393 |
|
|
3394 |
ClientDialCallL(mobileLine, mobileCall, mobileService, EFalse, EFalse);
|
|
3395 |
|
|
3396 |
RCall::TCommPort dataPort;
|
|
3397 |
TRequestStatus reqStatus;
|
|
3398 |
mobileCall.LoanDataPort(reqStatus, dataPort);
|
|
3399 |
User::WaitForRequest(reqStatus);
|
|
3400 |
ASSERT_EQUALS(KErrNone, reqStatus.Int());
|
|
3401 |
ASSERT_EQUALS(0, dataPort.iPort.Compare(KDataPort()));
|
|
3402 |
|
|
3403 |
TInt err = mobileCall.RecoverDataPort();
|
|
3404 |
ASSERT_EQUALS(KErrNone, err);
|
|
3405 |
|
|
3406 |
RMobileCall::TMobileCallDataCapsV1 callCaps;
|
|
3407 |
RMobileCall::TMobileCallDataCapsV1Pckg callCapsPckg(callCaps);
|
|
3408 |
mobileCall.GetMobileDataCallCaps(callCapsPckg);
|
|
3409 |
ASSERT_TRUE(TComparator<RMobileCall::TMobileCallDataCapsV1>::IsEqual(completeCallCaps, callCaps));
|
|
3410 |
|
|
3411 |
TRequestStatus hscsdInfoStatus;
|
|
3412 |
RMobileCall::TMobileCallHscsdInfoV8 hscsdInfo2;
|
|
3413 |
RMobileCall::TMobileCallHscsdInfoV8Pckg hscsdInfoPckg(hscsdInfo2);
|
|
3414 |
mobileCall.NotifyHscsdInfoChange(hscsdInfoStatus, hscsdInfoPckg);
|
|
3415 |
|
|
3416 |
TRequestStatus dataCallCapsStatus;
|
|
3417 |
RMobileCall::TMobileCallDataCapsV1 dataCallCaps2;
|
|
3418 |
RMobileCall::TMobileCallDataCapsV1Pckg dataCallCapsPckg(dataCallCaps2);
|
|
3419 |
mobileCall.NotifyMobileDataCallCapsChange(dataCallCapsStatus, dataCallCapsPckg);
|
|
3420 |
|
|
3421 |
TRequestStatus hscsdParamStatus;
|
|
3422 |
mobileCall.SetDynamicHscsdParams(hscsdParamStatus, hscsdParams.iWantedAiur, hscsdParams.iWantedRxTimeSlots);
|
|
3423 |
User::WaitForRequest(hscsdParamStatus);
|
|
3424 |
|
|
3425 |
User::WaitForRequest(hscsdInfoStatus);
|
|
3426 |
ASSERT_EQUALS(KErrNone, hscsdInfoStatus.Int());
|
|
3427 |
ASSERT_EQUALS(hscsdInfo2.iAiur, hscsdInfo.iAiur);
|
|
3428 |
ASSERT_EQUALS(hscsdInfo2.iRxTimeSlots, hscsdInfo.iRxTimeSlots);
|
|
3429 |
ASSERT_EQUALS(hscsdInfo2.iTxTimeSlots, hscsdInfo.iTxTimeSlots);
|
|
3430 |
ASSERT_EQUALS(hscsdInfo2.iCodings, hscsdInfo.iCodings);
|
|
3431 |
|
|
3432 |
User::WaitForRequest(dataCallCapsStatus);
|
|
3433 |
ASSERT_EQUALS(KErrNone, dataCallCapsStatus.Int());
|
|
3434 |
ASSERT_EQUALS(completeCallCaps2.iSpeedCaps, dataCallCaps2.iSpeedCaps);
|
|
3435 |
ASSERT_EQUALS(completeCallCaps2.iHscsdSupport, dataCallCaps2.iHscsdSupport);
|
|
3436 |
ASSERT_EQUALS(completeCallCaps2.iMaxRxTimeSlots, dataCallCaps2.iMaxRxTimeSlots);
|
|
3437 |
ASSERT_EQUALS(completeCallCaps2.iMaxTxTimeSlots, dataCallCaps2.iMaxTxTimeSlots);
|
|
3438 |
|
|
3439 |
TRequestStatus reqStatusTerminated;
|
|
3440 |
iMockLTSY.NotifyTerminated(reqStatusTerminated);
|
|
3441 |
ClientHangUpCallL(mobileCall);
|
|
3442 |
|
|
3443 |
mobileCall.Close();
|
|
3444 |
mobileLine.Close();
|
|
3445 |
data.Close();
|
|
3446 |
|
|
3447 |
User::WaitForRequest(reqStatusTerminated);
|
|
3448 |
ASSERT_EQUALS(KErrNone, reqStatus.Int());
|
|
3449 |
|
|
3450 |
AssertMockLtsyStatusL();
|
|
3451 |
CleanupStack::PopAndDestroy(4, this); // mobileCall, mobileLine, data, this
|
|
3452 |
} // CCTsyCallControlFU::TestUnit0021L
|
|
3453 |
|
|
3454 |
|
|
3455 |
//
|
|
3456 |
// Other helper functions
|
|
3457 |
//
|
|
3458 |
|
|
3459 |
|
|
3460 |
void CCTsyCallControlFU::ClientSetIsvPubSubKeyL()
|
|
3461 |
{
|
|
3462 |
// CTelephony requires property to be set otherwise it thinks flight mode
|
|
3463 |
// is on.
|
|
3464 |
TInt err = RProperty::Set(KUidSystemCategory, KUidPhonePwr.iUid, ESAPhoneOn);
|
|
3465 |
User::LeaveIfError(err);
|
|
3466 |
} // CCTsyCallControlFU::ClientSetIsvPubSubKeyL
|
|
3467 |
|
|
3468 |
|
|
3469 |
|
|
3470 |
void CCTsyCallControlFU::DriverCreateIncomingCallL(TInt aCallId, RMobilePhone::TMobileService aMode)
|
|
3471 |
{
|
|
3472 |
RBuf8 data;
|
|
3473 |
CleanupClosePushL(data);
|
|
3474 |
|
|
3475 |
RMobileCall::TMobileCallInfoV1 mobileCallInfo;
|
|
3476 |
mobileCallInfo.iService = aMode;
|
|
3477 |
mobileCallInfo.iCallId = aCallId;
|
|
3478 |
TMockLtsyCallData1<RMobileCall::TMobileCallInfoV1> mockCallData1(aCallId, aMode, mobileCallInfo);
|
|
3479 |
mockCallData1.SerialiseL(data);
|
|
3480 |
iMockLTSY.CompleteL(KMockLtsyDispatchCallControlNotifyIncomingCallIndId, KErrNone, data);
|
|
3481 |
|
|
3482 |
data.Close();
|
|
3483 |
CleanupStack::PopAndDestroy(1, &data);
|
|
3484 |
} // CCTsyCallControlFU::DriverCreateIncomingCallL
|
|
3485 |
|
|
3486 |
void CCTsyCallControlFU::DriverAnswerIncomingCallL(TInt aCallId, RMobilePhone::TMobileService aMode, TBool aIsIsvCall,TInt aAnswerError)
|
|
3487 |
{
|
|
3488 |
RBuf8 data;
|
|
3489 |
CleanupClosePushL(data);
|
|
3490 |
|
|
3491 |
TMockLtsyData2<TInt, TInt> data1(aCallId, aIsIsvCall);
|
|
3492 |
data.Close();
|
|
3493 |
data1.SerialiseL(data);
|
|
3494 |
iMockLTSY.ExpectL(MLtsyDispatchCallControlAnswer::KLtsyDispatchCallControlAnswerApiId, data);
|
|
3495 |
|
|
3496 |
TMockLtsyData1<TInt> data2(aCallId);
|
|
3497 |
data.Close();
|
|
3498 |
data2.SerialiseL(data);
|
|
3499 |
iMockLTSY.CompleteL(MLtsyDispatchCallControlAnswer::KLtsyDispatchCallControlAnswerApiId, aAnswerError, data);
|
|
3500 |
|
|
3501 |
if (aAnswerError == KErrNone)
|
|
3502 |
{
|
|
3503 |
RMobileCall::TMobileCallStatus callStatus = RMobileCall::EStatusAnswering;
|
|
3504 |
TMockLtsyCallData1<RMobileCall::TMobileCallStatus> mockCallData3(aCallId, aMode, callStatus);
|
|
3505 |
data.Close();
|
|
3506 |
mockCallData3.SerialiseL(data);
|
|
3507 |
iMockLTSY.CompleteL(KMockLtsyDispatchCallControlNotifyCallStatusChangeIndId, KErrNone, data);
|
|
3508 |
|
|
3509 |
callStatus = RMobileCall::EStatusConnected;
|
|
3510 |
TMockLtsyCallData1<RMobileCall::TMobileCallStatus> mockCallData4(aCallId, aMode, callStatus);
|
|
3511 |
data.Close();
|
|
3512 |
mockCallData4.SerialiseL(data);
|
|
3513 |
iMockLTSY.CompleteL(KMockLtsyDispatchCallControlNotifyCallStatusChangeIndId, KErrNone, data);
|
|
3514 |
}
|
|
3515 |
else
|
|
3516 |
{
|
|
3517 |
RMobileCall::TMobileCallStatus callStatus = RMobileCall::EStatusIdle;
|
|
3518 |
TMockLtsyCallData1<RMobileCall::TMobileCallStatus> mockCallData3(aCallId, aMode, callStatus);
|
|
3519 |
data.Close();
|
|
3520 |
mockCallData3.SerialiseL(data);
|
|
3521 |
iMockLTSY.CompleteL(KMockLtsyDispatchCallControlNotifyCallStatusChangeIndId , KErrNone, data);
|
|
3522 |
}
|
|
3523 |
|
|
3524 |
data.Close();
|
|
3525 |
CleanupStack::PopAndDestroy(1, &data);
|
|
3526 |
} // CCTsyCallControlFU::DriverAnswerIncomingCallL
|
|
3527 |
|
|
3528 |
|
|
3529 |
void CCTsyCallControlFU::DriverResumeCallL(TInt aCallId, TInt aResumeError)
|
|
3530 |
{
|
|
3531 |
RBuf8 data;
|
|
3532 |
CleanupClosePushL(data);
|
|
3533 |
|
|
3534 |
TMockLtsyData1<TInt> mockData2(aCallId);
|
|
3535 |
data.Close();
|
|
3536 |
mockData2.SerialiseL(data);
|
|
3537 |
iMockLTSY.ExpectL(MLtsyDispatchCallControlResume::KLtsyDispatchCallControlResumeApiId, data);
|
|
3538 |
|
|
3539 |
TMockLtsyData1<TInt> resumeData(aCallId);
|
|
3540 |
data.Close();
|
|
3541 |
resumeData.SerialiseL(data);
|
|
3542 |
iMockLTSY.CompleteL(MLtsyDispatchCallControlResume::KLtsyDispatchCallControlResumeApiId, aResumeError, data);
|
|
3543 |
|
|
3544 |
if (aResumeError == KErrNone)
|
|
3545 |
{
|
|
3546 |
RMobileCall::TMobileCallStatus callStatus = RMobileCall::EStatusConnected;
|
|
3547 |
TMockLtsyCallData1<RMobileCall::TMobileCallStatus> mockCallData2(
|
|
3548 |
aCallId, RMobilePhone::EServiceUnspecified, callStatus);
|
|
3549 |
data.Close();
|
|
3550 |
mockCallData2.SerialiseL(data);
|
|
3551 |
iMockLTSY.CompleteL(KMockLtsyDispatchCallControlNotifyCallStatusChangeIndId, KErrNone, data);
|
|
3552 |
}
|
|
3553 |
|
|
3554 |
data.Close();
|
|
3555 |
CleanupStack::PopAndDestroy(1, &data);
|
|
3556 |
} // CCTsyCallControlFU::DriverResumeCallL
|
|
3557 |
|
|
3558 |
/**
|
|
3559 |
* Swap the call.
|
|
3560 |
*
|
|
3561 |
* @param aCallId Call ID of held call to swap.
|
|
3562 |
* @param aSwapError Error returned by LTSY in response to the swap request.
|
|
3563 |
* @param aNewCallStatus New status of the call 1 if aSwapError = KErrNone
|
|
3564 |
*
|
|
3565 |
* In the case where aSwapError passed is not KErrNone, the new call statuses
|
|
3566 |
* are irrelevant as the calls don't change state.
|
|
3567 |
*/
|
|
3568 |
void CCTsyCallControlFU::DriverSwapCallL(TInt aCallId, TInt aSwapError,
|
|
3569 |
RMobileCall::TMobileCallStatus aNewCallStatus)
|
|
3570 |
{
|
|
3571 |
RBuf8 data;
|
|
3572 |
CleanupClosePushL(data);
|
|
3573 |
|
|
3574 |
TMockLtsyData1<TInt> mockData2(aCallId);
|
|
3575 |
data.Close();
|
|
3576 |
mockData2.SerialiseL(data);
|
|
3577 |
iMockLTSY.ExpectL(MLtsyDispatchCallControlSwap::KLtsyDispatchCallControlSingleSwapApiId, data);
|
|
3578 |
|
|
3579 |
iMockLTSY.CompleteL(MLtsyDispatchCallControlSwap::KLtsyDispatchCallControlSingleSwapApiId, aSwapError);
|
|
3580 |
|
|
3581 |
if (aSwapError == KErrNone)
|
|
3582 |
{
|
|
3583 |
TMockLtsyCallData1<RMobileCall::TMobileCallStatus> mockCallData2(
|
|
3584 |
aCallId, RMobilePhone::EServiceUnspecified, aNewCallStatus);
|
|
3585 |
data.Close();
|
|
3586 |
mockCallData2.SerialiseL(data);
|
|
3587 |
iMockLTSY.CompleteL(KMockLtsyDispatchCallControlNotifyCallStatusChangeIndId, KErrNone, data);
|
|
3588 |
}
|
|
3589 |
|
|
3590 |
data.Close();
|
|
3591 |
CleanupStack::PopAndDestroy(1, &data);
|
|
3592 |
} // CCTsyCallControlFU::DriverSwapCallL
|
|
3593 |
|
|
3594 |
|
|
3595 |
/**
|
|
3596 |
* Swap the call.
|
|
3597 |
*
|
|
3598 |
* @param aCallId1 Call ID of held call to swap.
|
|
3599 |
* @param aCallId2 Call ID of connected call to swap.
|
|
3600 |
* @param aSwapError Error returned by LTSY in response to the swap request.
|
|
3601 |
* @param aNewCall1Status New status of the call 1 if aSwapError = KErrNone
|
|
3602 |
* @param aNewCall2Status New status of the call 2 if aSwapError = KErrNone
|
|
3603 |
*
|
|
3604 |
* In the case where aSwapError passed is not KErrNone, the new call statuses
|
|
3605 |
* are irrelevant as the calls don't change state.
|
|
3606 |
*/
|
|
3607 |
void CCTsyCallControlFU::DriverSwapCallL(TInt aCallId1, TInt aCallId2,
|
|
3608 |
TInt aSwapError, RMobileCall::TMobileCallStatus aNewCall1Status,
|
|
3609 |
RMobileCall::TMobileCallStatus aNewCall2Status)
|
|
3610 |
{
|
|
3611 |
RBuf8 data;
|
|
3612 |
CleanupClosePushL(data);
|
|
3613 |
|
|
3614 |
TMockLtsyData2<TInt, TInt> mockData2(aCallId1, aCallId2);
|
|
3615 |
data.Close();
|
|
3616 |
mockData2.SerialiseL(data);
|
|
3617 |
iMockLTSY.ExpectL(MLtsyDispatchCallControlSwap::KLtsyDispatchCallControlSwapApiId, data);
|
|
3618 |
|
|
3619 |
iMockLTSY.CompleteL(MLtsyDispatchCallControlSwap::KLtsyDispatchCallControlSwapApiId, aSwapError);
|
|
3620 |
|
|
3621 |
if (aSwapError == KErrNone)
|
|
3622 |
{
|
|
3623 |
TMockLtsyCallData1<RMobileCall::TMobileCallStatus> mockCallData2(
|
|
3624 |
aCallId1, RMobilePhone::EServiceUnspecified, aNewCall1Status);
|
|
3625 |
data.Close();
|
|
3626 |
mockCallData2.SerialiseL(data);
|
|
3627 |
iMockLTSY.CompleteL(KMockLtsyDispatchCallControlNotifyCallStatusChangeIndId, KErrNone, data);
|
|
3628 |
|
|
3629 |
TMockLtsyCallData1<RMobileCall::TMobileCallStatus> mockCallData3(
|
|
3630 |
aCallId2, RMobilePhone::EServiceUnspecified, aNewCall2Status);
|
|
3631 |
data.Close();
|
|
3632 |
mockCallData3.SerialiseL(data);
|
|
3633 |
iMockLTSY.CompleteL(KMockLtsyDispatchCallControlNotifyCallStatusChangeIndId, KErrNone, data);
|
|
3634 |
}
|
|
3635 |
|
|
3636 |
data.Close();
|
|
3637 |
CleanupStack::PopAndDestroy(1, &data);
|
|
3638 |
} // CCTsyCallControlFU::DriverSwapCallL
|
|
3639 |
|
|
3640 |
|
|
3641 |
/**
|
|
3642 |
* Waits for an incoming call notification and opens the call.
|
|
3643 |
*
|
|
3644 |
* @param aMobileCall RMobileCall subsession, should not be open before calling this function.
|
|
3645 |
* Pushed on CleanupStack in this function.
|
|
3646 |
*
|
|
3647 |
* @param aMobileLine Line that will ring.
|
|
3648 |
* @param aCallName Populated with the call name when incoming call arrives.
|
|
3649 |
*/
|
|
3650 |
void CCTsyCallControlFU::ClientWaitForIncomingCallNotificationLC(
|
|
3651 |
RMobileCall& aMobileCall, RMobileLine& aMobileLine, TName& aCallName)
|
|
3652 |
{
|
|
3653 |
TRequestStatus notifyStatus;
|
|
3654 |
aMobileLine.NotifyIncomingCall(notifyStatus, aCallName);
|
|
3655 |
User::WaitForRequest(notifyStatus);
|
|
3656 |
ASSERT_EQUALS(KErrNone, notifyStatus.Int());
|
|
3657 |
|
|
3658 |
TInt err = aMobileCall.OpenExistingCall(aMobileLine, aCallName);
|
|
3659 |
CleanupClosePushL(aMobileCall);
|
|
3660 |
ASSERT_EQUALS(KErrNone, err);
|
|
3661 |
|
|
3662 |
RMobileCall::TMobileCallStatus callStatus;
|
|
3663 |
aMobileCall.GetMobileCallStatus(callStatus);
|
|
3664 |
ASSERT_EQUALS(RMobileCall::EStatusRinging, callStatus);
|
|
3665 |
} // CCTsyCallControlFU::ClientWaitForIncomingCallNotificationLC
|
|
3666 |
|
|
3667 |
void CCTsyCallControlFU::ClientAnswerIncomingCallL(RMobileCall& aMobileCall, TInt aExpectedAnswerError)
|
|
3668 |
{
|
|
3669 |
TRequestStatus notifyStatus;
|
|
3670 |
RMobileCall::TMobileCallStatus callStatus;
|
|
3671 |
aMobileCall.NotifyMobileCallStatusChange(notifyStatus, callStatus);
|
|
3672 |
|
|
3673 |
TRequestStatus ansStatus;
|
|
3674 |
aMobileCall.AnswerIncomingCall(ansStatus);
|
|
3675 |
|
|
3676 |
RArray<RMobileCall::TMobileCallStatus> expectedCallStatuses;
|
|
3677 |
CleanupClosePushL(expectedCallStatuses);
|
|
3678 |
|
|
3679 |
if (aExpectedAnswerError == KErrNone)
|
|
3680 |
{
|
|
3681 |
expectedCallStatuses.AppendL(RMobileCall::EStatusAnswering);
|
|
3682 |
expectedCallStatuses.AppendL(RMobileCall::EStatusConnected);
|
|
3683 |
}
|
|
3684 |
else
|
|
3685 |
{
|
|
3686 |
expectedCallStatuses.AppendL(RMobileCall::EStatusIdle);
|
|
3687 |
}
|
|
3688 |
|
|
3689 |
ClientWaitForCallStatusNotifications(aMobileCall, notifyStatus, callStatus, expectedCallStatuses, KErrNone);
|
|
3690 |
|
|
3691 |
User::WaitForRequest(ansStatus);
|
|
3692 |
ASSERT_EQUALS(aExpectedAnswerError, ansStatus.Int());
|
|
3693 |
|
|
3694 |
aMobileCall.GetMobileCallStatus(callStatus);
|
|
3695 |
|
|
3696 |
if (aExpectedAnswerError == KErrNone)
|
|
3697 |
{
|
|
3698 |
ASSERT_EQUALS(RMobileCall::EStatusConnected, callStatus);
|
|
3699 |
}
|
|
3700 |
else
|
|
3701 |
{
|
|
3702 |
ASSERT_EQUALS(RMobileCall::EStatusIdle, callStatus);
|
|
3703 |
}
|
|
3704 |
|
|
3705 |
expectedCallStatuses.Close();
|
|
3706 |
CleanupStack::PopAndDestroy(1, &expectedCallStatuses);
|
|
3707 |
} // CCTsyCallControlFU::ClientAnswerIncomingCallL
|
|
3708 |
|