|
1 // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // The TEFUnit test suite for LineControl in the Common TSY. |
|
15 // |
|
16 // |
|
17 |
|
18 /** |
|
19 @file |
|
20 */ |
|
21 |
|
22 #include "cctsylinecontrolfu.h" |
|
23 #include <etel.h> |
|
24 #include <etelmm.h> |
|
25 #include <et_clsvr.h> |
|
26 #include <ctsy/mmtsy_names.h> |
|
27 #include <ctsy/serviceapi/mmtsy_ipcdefs.h> |
|
28 #include "tmockltsydata.h" |
|
29 #include <ctsy/serviceapi/gsmerror.h> |
|
30 #include "MmTsy_conf.h" |
|
31 |
|
32 CTestSuite* CCTsyLineControlFU::CreateSuiteL(const TDesC& aName) |
|
33 { |
|
34 SUB_SUITE; |
|
35 |
|
36 ADD_TEST_STEP_ISO_CPP(CCTsyLineControlFU, TestGetHookStatus0001L); |
|
37 ADD_TEST_STEP_ISO_CPP(CCTsyLineControlFU, TestGetHookStatus0002L); |
|
38 ADD_TEST_STEP_ISO_CPP(CCTsyLineControlFU, TestGetHookStatus0003L); |
|
39 |
|
40 ADD_TEST_STEP_ISO_CPP(CCTsyLineControlFU, TestGetCaps0001L); |
|
41 ADD_TEST_STEP_ISO_CPP(CCTsyLineControlFU, TestGetCaps0006L); |
|
42 ADD_TEST_STEP_ISO_CPP(CCTsyLineControlFU, TestGetCaps00011L); |
|
43 |
|
44 ADD_TEST_STEP_ISO_CPP(CCTsyLineControlFU, TestGetInfo0001L); |
|
45 ADD_TEST_STEP_ISO_CPP(CCTsyLineControlFU, TestGetInfo0006L); |
|
46 ADD_TEST_STEP_ISO_CPP(CCTsyLineControlFU, TestGetInfo00011L); |
|
47 |
|
48 ADD_TEST_STEP_ISO_CPP(CCTsyLineControlFU, TestGetStatus0001L); |
|
49 ADD_TEST_STEP_ISO_CPP(CCTsyLineControlFU, TestGetStatus0006L); |
|
50 ADD_TEST_STEP_ISO_CPP(CCTsyLineControlFU, TestGetStatus00011L); |
|
51 |
|
52 ADD_TEST_STEP_ISO_CPP(CCTsyLineControlFU, TestGetLineInfo0001L); |
|
53 ADD_TEST_STEP_ISO_CPP(CCTsyLineControlFU, TestGetLineInfo0003L); |
|
54 |
|
55 ADD_TEST_STEP_ISO_CPP(CCTsyLineControlFU, TestEnumerateLines0001L); |
|
56 |
|
57 ADD_TEST_STEP_ISO_CPP(CCTsyLineControlFU, TestNotifyCapsChange0002L); |
|
58 ADD_TEST_STEP_ISO_CPP(CCTsyLineControlFU, TestNotifyCapsChange0007L); |
|
59 ADD_TEST_STEP_ISO_CPP(CCTsyLineControlFU, TestNotifyCapsChange00012L); |
|
60 |
|
61 ADD_TEST_STEP_ISO_CPP(CCTsyLineControlFU, TestNotifyStatusChange0001L); |
|
62 ADD_TEST_STEP_ISO_CPP(CCTsyLineControlFU, TestNotifyStatusChange0001aL); |
|
63 ADD_TEST_STEP_ISO_CPP(CCTsyLineControlFU, TestNotifyStatusChange0002L); |
|
64 ADD_TEST_STEP_ISO_CPP(CCTsyLineControlFU, TestNotifyStatusChange0004L); |
|
65 ADD_TEST_STEP_ISO_CPP(CCTsyLineControlFU, TestNotifyStatusChange0006L); |
|
66 ADD_TEST_STEP_ISO_CPP(CCTsyLineControlFU, TestNotifyStatusChange0007L); |
|
67 ADD_TEST_STEP_ISO_CPP(CCTsyLineControlFU, TestNotifyStatusChange0009L); |
|
68 ADD_TEST_STEP_ISO_CPP(CCTsyLineControlFU, TestNotifyStatusChange00011L); |
|
69 ADD_TEST_STEP_ISO_CPP(CCTsyLineControlFU, TestNotifyStatusChange00012L); |
|
70 ADD_TEST_STEP_ISO_CPP(CCTsyLineControlFU, TestNotifyStatusChange00014L); |
|
71 |
|
72 ADD_TEST_STEP_ISO_CPP(CCTsyLineControlFU, TestGetMobileLineStatus0001L); |
|
73 ADD_TEST_STEP_ISO_CPP(CCTsyLineControlFU, TestGetMobileLineStatus0006L); |
|
74 ADD_TEST_STEP_ISO_CPP(CCTsyLineControlFU, TestGetMobileLineStatus00011L); |
|
75 |
|
76 ADD_TEST_STEP_ISO_CPP(CCTsyLineControlFU, TestNotifyMobileLineStatusChange0001L); |
|
77 ADD_TEST_STEP_ISO_CPP(CCTsyLineControlFU, TestNotifyMobileLineStatusChange0002L); |
|
78 ADD_TEST_STEP_ISO_CPP(CCTsyLineControlFU, TestNotifyMobileLineStatusChange0004L); |
|
79 ADD_TEST_STEP_ISO_CPP(CCTsyLineControlFU, TestNotifyMobileLineStatusChange0006L); |
|
80 ADD_TEST_STEP_ISO_CPP(CCTsyLineControlFU, TestNotifyMobileLineStatusChange0007L); |
|
81 ADD_TEST_STEP_ISO_CPP(CCTsyLineControlFU, TestNotifyMobileLineStatusChange0009L); |
|
82 ADD_TEST_STEP_ISO_CPP(CCTsyLineControlFU, TestNotifyMobileLineStatusChange00011L); |
|
83 ADD_TEST_STEP_ISO_CPP(CCTsyLineControlFU, TestNotifyMobileLineStatusChange00012L); |
|
84 ADD_TEST_STEP_ISO_CPP(CCTsyLineControlFU, TestNotifyMobileLineStatusChange00014L); |
|
85 |
|
86 END_SUITE; |
|
87 } |
|
88 |
|
89 |
|
90 // |
|
91 // Actual test cases |
|
92 // |
|
93 |
|
94 |
|
95 /** |
|
96 @SYMTestCaseID BA-CTSY-LINC-LGHS-0001 |
|
97 @SYMComponent telephony_ctsy |
|
98 @SYMTestCaseDesc Test support in CTSY for RLine::GetHookStatus for voice lines |
|
99 @SYMTestPriority High |
|
100 @SYMTestActions Invokes RLine::GetHookStatus for voice lines |
|
101 @SYMTestExpectedResults Pass |
|
102 @SYMTestType CT |
|
103 */ |
|
104 void CCTsyLineControlFU::TestGetHookStatus0001L() |
|
105 { |
|
106 |
|
107 OpenEtelServerL(EUseExtendedError); |
|
108 CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
|
109 OpenPhoneL(); |
|
110 |
|
111 RLine line; |
|
112 TInt err = line.Open(iPhone, KMmTsyVoice1LineName); |
|
113 ASSERT_EQUALS(KErrNone, err) |
|
114 CleanupClosePushL(line); |
|
115 |
|
116 // Test API is not supported |
|
117 RCall::THookStatus hookStatus; |
|
118 err = line.GetHookStatus(hookStatus); |
|
119 ASSERT_EQUALS(KErrNotSupported, err); |
|
120 |
|
121 AssertMockLtsyStatusL(); |
|
122 CleanupStack::PopAndDestroy(2, this); // line, this |
|
123 |
|
124 } |
|
125 |
|
126 |
|
127 /** |
|
128 @SYMTestCaseID BA-CTSY-LINC-LGHS-0002 |
|
129 @SYMComponent telephony_ctsy |
|
130 @SYMTestCaseDesc Test support in CTSY for RLine::GetHookStatus for data lines |
|
131 @SYMTestPriority High |
|
132 @SYMTestActions Invokes RLine::GetHookStatus for data lines |
|
133 @SYMTestExpectedResults Pass |
|
134 @SYMTestType CT |
|
135 */ |
|
136 void CCTsyLineControlFU::TestGetHookStatus0002L() |
|
137 { |
|
138 |
|
139 OpenEtelServerL(EUseExtendedError); |
|
140 CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
|
141 OpenPhoneL(); |
|
142 |
|
143 RLine line; |
|
144 TInt err = line.Open(iPhone, KMmTsyDataLineName); |
|
145 ASSERT_EQUALS(KErrNone, err) |
|
146 CleanupClosePushL(line); |
|
147 |
|
148 // Test API is not supported |
|
149 RCall::THookStatus hookStatus; |
|
150 err = line.GetHookStatus(hookStatus); |
|
151 ASSERT_EQUALS(KErrNotSupported, err); |
|
152 |
|
153 AssertMockLtsyStatusL(); |
|
154 CleanupStack::PopAndDestroy(2, this); // line, this |
|
155 |
|
156 } |
|
157 |
|
158 |
|
159 /** |
|
160 @SYMTestCaseID BA-CTSY-LINC-LGHS-0003 |
|
161 @SYMComponent telephony_ctsy |
|
162 @SYMTestCaseDesc Test support in CTSY for RLine::GetHookStatus for fax lines |
|
163 @SYMTestPriority High |
|
164 @SYMTestActions Invokes RLine::GetHookStatus for fax lines |
|
165 @SYMTestExpectedResults Pass |
|
166 @SYMTestType CT |
|
167 */ |
|
168 void CCTsyLineControlFU::TestGetHookStatus0003L() |
|
169 { |
|
170 |
|
171 OpenEtelServerL(EUseExtendedError); |
|
172 CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
|
173 OpenPhoneL(); |
|
174 |
|
175 RLine line; |
|
176 TInt err = line.Open(iPhone, KMmTsyFaxLineName); |
|
177 ASSERT_EQUALS(KErrNone, err) |
|
178 CleanupClosePushL(line); |
|
179 |
|
180 // Test API is not supported |
|
181 RCall::THookStatus hookStatus; |
|
182 err = line.GetHookStatus(hookStatus); |
|
183 ASSERT_EQUALS(KErrNotSupported, err); |
|
184 |
|
185 AssertMockLtsyStatusL(); |
|
186 CleanupStack::PopAndDestroy(2, this); // line, this |
|
187 |
|
188 } |
|
189 |
|
190 |
|
191 /** |
|
192 @SYMTestCaseID BA-CTSY-LINC-LGC-0001 |
|
193 @SYMComponent telephony_ctsy |
|
194 @SYMTestCaseDesc Test support in CTSY for RLine::GetCaps for voice lines |
|
195 @SYMTestPriority High |
|
196 @SYMTestActions Invokes RLine::GetCaps for voice lines |
|
197 @SYMTestExpectedResults Pass |
|
198 @SYMTestType CT |
|
199 */ |
|
200 void CCTsyLineControlFU::TestGetCaps0001L() |
|
201 { |
|
202 |
|
203 OpenEtelServerL(EUseExtendedError); |
|
204 CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
|
205 OpenPhoneL(); |
|
206 |
|
207 //------------------------------------------------------------------------- |
|
208 // TEST C: Successful completion request of |
|
209 // RLine::GetCaps |
|
210 // Get initial value of caps for KMmTsyVoice1LineName-line |
|
211 //------------------------------------------------------------------------- |
|
212 RLine line; |
|
213 TInt err = line.Open(iPhone, KMmTsyVoice1LineName); |
|
214 ASSERT_EQUALS(KErrNone, err) |
|
215 CleanupClosePushL(line); |
|
216 |
|
217 RLine::TCaps expectedCaps; |
|
218 expectedCaps.iFlags = RLine::KCapsVoice | RLine::KCapsEventIncomingCall; |
|
219 RLine::TCaps caps; |
|
220 |
|
221 err = line.GetCaps(caps); |
|
222 ASSERT_EQUALS(KErrNone, err); |
|
223 ASSERT_EQUALS(expectedCaps.iFlags, caps.iFlags); |
|
224 AssertMockLtsyStatusL(); |
|
225 |
|
226 //------------------------------------------------------------------------- |
|
227 // TEST C: Successful completion request of |
|
228 // RLine::GetCaps |
|
229 // Get initial value of caps for KMmTsyVoice2LineName-line |
|
230 //------------------------------------------------------------------------- |
|
231 RLine line2; |
|
232 err = line2.Open(iPhone, KMmTsyVoice2LineName); |
|
233 ASSERT_EQUALS(KErrNone, err) |
|
234 CleanupClosePushL(line2); |
|
235 |
|
236 expectedCaps.iFlags = RLine::KCapsVoice | RLine::KCapsEventIncomingCall | RMobileLine::KCapsAuxVoice; |
|
237 |
|
238 err = line2.GetCaps(caps); |
|
239 ASSERT_EQUALS(KErrNone, err) |
|
240 ASSERT_EQUALS(expectedCaps.iFlags, caps.iFlags); |
|
241 |
|
242 AssertMockLtsyStatusL(); |
|
243 CleanupStack::PopAndDestroy(3, this); // line2, line, this |
|
244 |
|
245 } |
|
246 |
|
247 /** |
|
248 @SYMTestCaseID BA-CTSY-LINC-LGC-0006 |
|
249 @SYMComponent telephony_ctsy |
|
250 @SYMTestCaseDesc Test support in CTSY for RLine::GetCaps for data lines |
|
251 @SYMTestPriority High |
|
252 @SYMTestActions Invokes RLine::GetCaps for data lines |
|
253 @SYMTestExpectedResults Pass |
|
254 @SYMTestType CT |
|
255 */ |
|
256 void CCTsyLineControlFU::TestGetCaps0006L() |
|
257 { |
|
258 OpenEtelServerL(EUseExtendedError); |
|
259 CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
|
260 OpenPhoneL(); |
|
261 |
|
262 //------------------------------------------------------------------------- |
|
263 // TEST C: Successful completion request of |
|
264 // RLine::GetCaps |
|
265 // Get initial value of caps for KMmTsyDataLineName-line |
|
266 //------------------------------------------------------------------------- |
|
267 RLine line; |
|
268 TInt err = line.Open(iPhone, KMmTsyDataLineName); |
|
269 ASSERT_EQUALS(KErrNone, err) |
|
270 CleanupClosePushL(line); |
|
271 |
|
272 RLine::TCaps expectedCaps; |
|
273 expectedCaps.iFlags = RLine::KCapsData | RLine::KCapsEventIncomingCall; |
|
274 RLine::TCaps caps; |
|
275 |
|
276 err = line.GetCaps(caps); |
|
277 ASSERT_EQUALS(KErrNone, err); |
|
278 ASSERT_EQUALS(expectedCaps.iFlags, caps.iFlags); |
|
279 AssertMockLtsyStatusL(); |
|
280 |
|
281 CleanupStack::PopAndDestroy(2, this); // line, this |
|
282 } |
|
283 |
|
284 |
|
285 /** |
|
286 @SYMTestCaseID BA-CTSY-LINC-LGC-00011 |
|
287 @SYMComponent telephony_ctsy |
|
288 @SYMTestCaseDesc Test support in CTSY for RLine::GetCaps for fax lines |
|
289 @SYMTestPriority High |
|
290 @SYMTestActions Invokes RLine::GetCaps for fax lines |
|
291 @SYMTestExpectedResults Pass |
|
292 @SYMTestType CT |
|
293 */ |
|
294 void CCTsyLineControlFU::TestGetCaps00011L() |
|
295 { |
|
296 |
|
297 OpenEtelServerL(EUseExtendedError); |
|
298 CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
|
299 OpenPhoneL(); |
|
300 |
|
301 //------------------------------------------------------------------------- |
|
302 // TEST C: Successful completion request of |
|
303 // RLine::GetCaps |
|
304 // Get initial value of caps for KMmTsyFaxLineName-line |
|
305 //------------------------------------------------------------------------- |
|
306 RLine line; |
|
307 TInt err = line.Open(iPhone, KMmTsyFaxLineName); |
|
308 ASSERT_EQUALS(KErrNone, err); |
|
309 CleanupClosePushL(line); |
|
310 |
|
311 RLine::TCaps expectedCaps; |
|
312 expectedCaps.iFlags = RLine::KCapsFax | RLine::KCapsEventIncomingCall; |
|
313 RLine::TCaps caps; |
|
314 |
|
315 err = line.GetCaps(caps); |
|
316 ASSERT_EQUALS(KErrNone, err); |
|
317 ASSERT_EQUALS(expectedCaps.iFlags, caps.iFlags); |
|
318 AssertMockLtsyStatusL(); |
|
319 |
|
320 CleanupStack::PopAndDestroy(2, this); // line, this |
|
321 |
|
322 } |
|
323 |
|
324 /** |
|
325 @SYMTestCaseID BA-CTSY-LINC-LGI-0001 |
|
326 @SYMComponent telephony_ctsy |
|
327 @SYMTestCaseDesc Test support in CTSY for RLine::GetInfo for voice lines |
|
328 @SYMTestPriority High |
|
329 @SYMTestActions Invokes RLine::GetInfo for voice lines |
|
330 @SYMTestExpectedResults Pass |
|
331 @SYMTestType CT |
|
332 */ |
|
333 void CCTsyLineControlFU::TestGetInfo0001L() |
|
334 { |
|
335 OpenEtelServerL(EUseExtendedError); |
|
336 CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
|
337 OpenPhoneL(); |
|
338 |
|
339 //------------------------------------------------------------------------- |
|
340 // TEST C: Successful completion request of |
|
341 // RLine::GetInfo |
|
342 // Get initial value of caps for KMmTsyVoice1LineName-line |
|
343 //------------------------------------------------------------------------- |
|
344 RLine line; |
|
345 TInt err = line.Open(iPhone, KMmTsyVoice1LineName); |
|
346 ASSERT_EQUALS(KErrNone, err) |
|
347 CleanupClosePushL(line); |
|
348 |
|
349 RLine::TLineInfo info; |
|
350 AssertMockLtsyStatusL(); |
|
351 err = line.GetInfo(info); |
|
352 ASSERT_EQUALS(KErrNone, err); |
|
353 ASSERT_EQUALS (RCall::EHookStatusUnknown, info.iHookStatus);// hard-coded value |
|
354 ASSERT_EQUALS(RCall::EStatusIdle, info.iStatus); |
|
355 TName emptyName; |
|
356 TName voice11(_L("Voice11")); |
|
357 TName voice12(_L("Voice12")); |
|
358 ASSERT_EQUALS(emptyName, info.iNameOfCallForAnswering); |
|
359 ASSERT_EQUALS(voice11, info.iNameOfLastCallAdded); |
|
360 |
|
361 //------------------------------------------------------------------------- |
|
362 // TEST D: RLine::GetInfo again, this time CTSY |
|
363 // will get result from the cache. |
|
364 //----------------------------------------------------------------------- |
|
365 |
|
366 //------------------------------------------------------------------------- |
|
367 // create new incoming call |
|
368 TInt callId(1); |
|
369 RMobileCall::TMobileCallStatus mobileCallStatus = RMobileCall::EStatusRinging; |
|
370 RMobilePhone::TMobileService mobileService = RMobilePhone::EVoiceService; |
|
371 TName incomingCallName; |
|
372 err = CreateIncomingCallL(line, callId, KNullDesC, incomingCallName, |
|
373 mobileService, mobileCallStatus); |
|
374 ASSERT_EQUALS(KErrNone, err); |
|
375 |
|
376 RCall call; |
|
377 err = call.OpenExistingCall(line, incomingCallName); |
|
378 ASSERT_EQUALS(KErrNone, err); |
|
379 CleanupClosePushL(call); |
|
380 //------------------------------------------------------------------------- |
|
381 |
|
382 // Get changed info |
|
383 err = line.GetInfo(info); |
|
384 ASSERT_EQUALS (RCall::EHookStatusUnknown, info.iHookStatus);// hard-coded value |
|
385 ASSERT_EQUALS(RCall::EStatusRinging, info.iStatus); |
|
386 ASSERT_EQUALS(voice11, info.iNameOfCallForAnswering); |
|
387 ASSERT_EQUALS(voice12, info.iNameOfLastCallAdded); |
|
388 AssertMockLtsyStatusL(); |
|
389 |
|
390 CleanupStack::PopAndDestroy(3, this); // call, line, this |
|
391 } |
|
392 |
|
393 |
|
394 /** |
|
395 @SYMTestCaseID BA-CTSY-LINC-LGI-0006 |
|
396 @SYMComponent telephony_ctsy |
|
397 @SYMTestCaseDesc Test support in CTSY for RLine::GetInfo for data lines |
|
398 @SYMTestPriority High |
|
399 @SYMTestActions Invokes RLine::GetInfo for data lines |
|
400 @SYMTestExpectedResults Pass |
|
401 @SYMTestType CT |
|
402 */ |
|
403 void CCTsyLineControlFU::TestGetInfo0006L() |
|
404 { |
|
405 |
|
406 OpenEtelServerL(EUseExtendedError); |
|
407 CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
|
408 OpenPhoneL(); |
|
409 |
|
410 |
|
411 //------------------------------------------------------------------------- |
|
412 // TEST C: Successful completion request of |
|
413 // RLine::GetInfo |
|
414 // Get initial value of caps for KMmTsyVoice1LineName-line |
|
415 //------------------------------------------------------------------------- |
|
416 RLine line; |
|
417 TInt err = line.Open(iPhone, KMmTsyDataLineName); |
|
418 ASSERT_EQUALS(KErrNone, err) |
|
419 CleanupClosePushL(line); |
|
420 |
|
421 RLine::TLineInfo info; |
|
422 err = line.GetInfo(info); |
|
423 AssertMockLtsyStatusL(); |
|
424 ASSERT_EQUALS(KErrNone, err); |
|
425 ASSERT_EQUALS (RCall::EHookStatusUnknown, info.iHookStatus);// hard-coded value |
|
426 ASSERT_EQUALS(RCall::EStatusIdle, info.iStatus); |
|
427 TName emptyName; |
|
428 TName data1(_L("Data1")); |
|
429 TName data2(_L("Data2")); |
|
430 ASSERT_EQUALS(emptyName, info.iNameOfCallForAnswering); |
|
431 ASSERT_EQUALS(data1, info.iNameOfLastCallAdded); |
|
432 |
|
433 //------------------------------------------------------------------------- |
|
434 // TEST D: RLine::GetInfo again, this time CTSY |
|
435 // will get result from the cache. |
|
436 //----------------------------------------------------------------------- |
|
437 |
|
438 //------------------------------------------------------------------------- |
|
439 // create new incoming call |
|
440 TInt callId(1); |
|
441 RMobileCall::TMobileCallStatus mobileCallStatus = RMobileCall::EStatusRinging; |
|
442 RMobilePhone::TMobileService mobileService = RMobilePhone::ECircuitDataService; |
|
443 TName incomingCallName; |
|
444 err = CreateIncomingCallL(line, callId, KNullDesC, incomingCallName, |
|
445 mobileService, mobileCallStatus); |
|
446 ASSERT_EQUALS(KErrNone, err); |
|
447 |
|
448 RCall call; |
|
449 err = call.OpenExistingCall(line, incomingCallName); |
|
450 ASSERT_EQUALS(KErrNone, err); |
|
451 CleanupClosePushL(call); |
|
452 //------------------------------------------------------------------------- |
|
453 |
|
454 // Get changed info |
|
455 err = line.GetInfo(info); |
|
456 ASSERT_EQUALS (RCall::EHookStatusUnknown, info.iHookStatus);// hard-coded value |
|
457 ASSERT_EQUALS(RCall::EStatusRinging, info.iStatus); |
|
458 ASSERT_EQUALS(data1, info.iNameOfCallForAnswering); |
|
459 ASSERT_EQUALS(data2, info.iNameOfLastCallAdded); |
|
460 AssertMockLtsyStatusL(); |
|
461 |
|
462 CleanupStack::PopAndDestroy(3, this); // call, line, this |
|
463 |
|
464 } |
|
465 |
|
466 |
|
467 /** |
|
468 @SYMTestCaseID BA-CTSY-LINC-LGI-00011 |
|
469 @SYMComponent telephony_ctsy |
|
470 @SYMTestCaseDesc Test support in CTSY for RLine::GetInfo for fax lines |
|
471 @SYMTestPriority High |
|
472 @SYMTestActions Invokes RLine::GetInfo for fax lines |
|
473 @SYMTestExpectedResults Pass |
|
474 @SYMTestType CT |
|
475 */ |
|
476 void CCTsyLineControlFU::TestGetInfo00011L() |
|
477 { |
|
478 |
|
479 OpenEtelServerL(EUseExtendedError); |
|
480 CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
|
481 OpenPhoneL(); |
|
482 |
|
483 //------------------------------------------------------------------------- |
|
484 // TEST C: Successful completion request of |
|
485 // RLine::GetInfo |
|
486 // Get initial value of caps for KMmTsyVoice1LineName-line |
|
487 //------------------------------------------------------------------------- |
|
488 RLine line; |
|
489 TInt err = line.Open(iPhone, KMmTsyFaxLineName); |
|
490 ASSERT_EQUALS(KErrNone, err) |
|
491 CleanupClosePushL(line); |
|
492 |
|
493 RLine::TLineInfo info; |
|
494 err = line.GetInfo(info); |
|
495 AssertMockLtsyStatusL(); |
|
496 ASSERT_EQUALS(KErrNone, err); |
|
497 ASSERT_EQUALS (RCall::EHookStatusUnknown, info.iHookStatus);// hard-coded value |
|
498 ASSERT_EQUALS(RCall::EStatusIdle, info.iStatus); |
|
499 TName emptyName; |
|
500 TName fax1(_L("Fax1")); |
|
501 TName fax2(_L("Fax2")); |
|
502 ASSERT_EQUALS(emptyName, info.iNameOfCallForAnswering); |
|
503 ASSERT_EQUALS(fax1, info.iNameOfLastCallAdded); |
|
504 |
|
505 //------------------------------------------------------------------------- |
|
506 // TEST D: RLine::GetInfo again, this time CTSY |
|
507 // will get result from the cache. |
|
508 //----------------------------------------------------------------------- |
|
509 |
|
510 //------------------------------------------------------------------------- |
|
511 // create new incoming call |
|
512 TInt callId(1); |
|
513 RMobileCall::TMobileCallStatus mobileCallStatus = RMobileCall::EStatusRinging; |
|
514 RMobilePhone::TMobileService mobileService = RMobilePhone::EFaxService; |
|
515 TName incomingCallName; |
|
516 err = CreateIncomingCallL(line, callId, KNullDesC, incomingCallName, |
|
517 mobileService, mobileCallStatus); |
|
518 ASSERT_EQUALS(KErrNone, err); |
|
519 |
|
520 RCall call; |
|
521 err = call.OpenExistingCall(line, incomingCallName); |
|
522 ASSERT_EQUALS(KErrNone, err); |
|
523 CleanupClosePushL(call); |
|
524 //------------------------------------------------------------------------- |
|
525 |
|
526 // Get changed info |
|
527 err = line.GetInfo(info); |
|
528 ASSERT_EQUALS (RCall::EHookStatusUnknown, info.iHookStatus);// hard-coded value |
|
529 ASSERT_EQUALS(RCall::EStatusRinging, info.iStatus); |
|
530 ASSERT_EQUALS(fax1, info.iNameOfCallForAnswering); |
|
531 ASSERT_EQUALS(fax2, info.iNameOfLastCallAdded); |
|
532 AssertMockLtsyStatusL(); |
|
533 |
|
534 CleanupStack::PopAndDestroy(3, this); // call, line, this |
|
535 |
|
536 } |
|
537 |
|
538 |
|
539 /** |
|
540 @SYMTestCaseID BA-CTSY-LINC-LGS-0001 |
|
541 @SYMComponent telephony_ctsy |
|
542 @SYMTestCaseDesc Test support in CTSY for RLine::GetStatus for voice lines |
|
543 @SYMTestPriority High |
|
544 @SYMTestActions Invokes RLine::GetStatus for voice lines |
|
545 @SYMTestExpectedResults Pass |
|
546 @SYMTestType CT |
|
547 */ |
|
548 void CCTsyLineControlFU::TestGetStatus0001L() |
|
549 { |
|
550 |
|
551 OpenEtelServerL(EUseExtendedError); |
|
552 CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
|
553 OpenPhoneL(); |
|
554 |
|
555 |
|
556 RLine line; |
|
557 TInt err = line.Open(iPhone, KMmTsyVoice1LineName); |
|
558 ASSERT_EQUALS(KErrNone, err); |
|
559 CleanupClosePushL(line); |
|
560 |
|
561 //------------------------------------------------------------------------- |
|
562 // TEST C: Successful completion request of |
|
563 // RLine::GetStatus when result is not cached. |
|
564 //------------------------------------------------------------------------- |
|
565 RCall::TStatus callStatus; |
|
566 // get initial status |
|
567 err = line.GetStatus(callStatus); |
|
568 ASSERT_EQUALS(KErrNone, err); |
|
569 ASSERT_EQUALS(RCall::EStatusIdle, callStatus); |
|
570 |
|
571 //------------------------------------------------------------------------- |
|
572 // TEST D: RLine::GetStatus again, this time CTSY |
|
573 // will get result from the cache. |
|
574 // modify status by creating incoming call |
|
575 //------------------------------------------------------------------------- |
|
576 // create new incoming call |
|
577 TInt callId(1); |
|
578 RMobileCall::TMobileCallStatus mobileCallStatus = RMobileCall::EStatusRinging; |
|
579 RMobilePhone::TMobileService mobileService = RMobilePhone::EVoiceService; |
|
580 TName incomingCallName; |
|
581 err = CreateIncomingCallL(line, callId, KNullDesC, incomingCallName, |
|
582 mobileService, mobileCallStatus); |
|
583 ASSERT_EQUALS(KErrNone, err); |
|
584 RCall call; |
|
585 err = call.OpenExistingCall(line, incomingCallName); |
|
586 ASSERT_EQUALS(KErrNone, err); |
|
587 CleanupClosePushL(call); |
|
588 |
|
589 // get modified status |
|
590 err = line.GetStatus(callStatus); |
|
591 ASSERT_EQUALS(KErrNone, err); |
|
592 ASSERT_EQUALS(RCall::EStatusRinging, callStatus); |
|
593 |
|
594 AssertMockLtsyStatusL(); |
|
595 CleanupStack::PopAndDestroy(3, this); //call, line, this |
|
596 |
|
597 } |
|
598 |
|
599 |
|
600 /** |
|
601 @SYMTestCaseID BA-CTSY-LINC-LGS-0006 |
|
602 @SYMComponent telephony_ctsy |
|
603 @SYMTestCaseDesc Test support in CTSY for RLine::GetStatus for data lines |
|
604 @SYMTestPriority High |
|
605 @SYMTestActions Invokes RLine::GetStatus for data lines |
|
606 @SYMTestExpectedResults Pass |
|
607 @SYMTestType CT |
|
608 */ |
|
609 void CCTsyLineControlFU::TestGetStatus0006L() |
|
610 { |
|
611 |
|
612 OpenEtelServerL(EUseExtendedError); |
|
613 CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
|
614 OpenPhoneL(); |
|
615 |
|
616 RLine line; |
|
617 TInt err = line.Open(iPhone, KMmTsyDataLineName); |
|
618 ASSERT_EQUALS(KErrNone, err); |
|
619 CleanupClosePushL(line); |
|
620 |
|
621 //------------------------------------------------------------------------- |
|
622 // TEST C: Successful completion request of |
|
623 // RLine::GetStatus when result is not cached. |
|
624 //------------------------------------------------------------------------- |
|
625 RCall::TStatus callStatus; |
|
626 // get initial status |
|
627 err = line.GetStatus(callStatus); |
|
628 ASSERT_EQUALS(KErrNone, err); |
|
629 ASSERT_EQUALS(RCall::EStatusIdle, callStatus); |
|
630 |
|
631 //------------------------------------------------------------------------- |
|
632 // TEST D: RLine::GetStatus again, this time CTSY |
|
633 // will get result from the cache. |
|
634 // modify status by creating incoming call |
|
635 //------------------------------------------------------------------------- |
|
636 // create new incoming call |
|
637 TInt callId(1); |
|
638 RMobileCall::TMobileCallStatus mobileCallStatus = RMobileCall::EStatusRinging; |
|
639 RMobilePhone::TMobileService mobileService = RMobilePhone::ECircuitDataService; |
|
640 TName incomingCallName; |
|
641 err = CreateIncomingCallL(line, callId, KNullDesC, incomingCallName, |
|
642 mobileService, mobileCallStatus); |
|
643 ASSERT_EQUALS(KErrNone, err); |
|
644 RCall call; |
|
645 err = call.OpenExistingCall(line, incomingCallName); |
|
646 ASSERT_EQUALS(KErrNone, err); |
|
647 CleanupClosePushL(call); |
|
648 |
|
649 // get modified status |
|
650 err = line.GetStatus(callStatus); |
|
651 ASSERT_EQUALS(KErrNone, err); |
|
652 ASSERT_EQUALS(RCall::EStatusRinging, callStatus); |
|
653 |
|
654 AssertMockLtsyStatusL(); |
|
655 CleanupStack::PopAndDestroy(3, this); //call, line, this |
|
656 |
|
657 } |
|
658 |
|
659 |
|
660 /** |
|
661 @SYMTestCaseID BA-CTSY-LINC-LGS-00011 |
|
662 @SYMComponent telephony_ctsy |
|
663 @SYMTestCaseDesc Test support in CTSY for RLine::GetStatus for fax lines |
|
664 @SYMTestPriority High |
|
665 @SYMTestActions Invokes RLine::GetStatus for fax lines |
|
666 @SYMTestExpectedResults Pass |
|
667 @SYMTestType CT |
|
668 */ |
|
669 void CCTsyLineControlFU::TestGetStatus00011L() |
|
670 { |
|
671 |
|
672 OpenEtelServerL(EUseExtendedError); |
|
673 CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
|
674 OpenPhoneL(); |
|
675 |
|
676 RLine line; |
|
677 TInt err = line.Open(iPhone, KMmTsyFaxLineName); |
|
678 ASSERT_EQUALS(KErrNone, err); |
|
679 CleanupClosePushL(line); |
|
680 |
|
681 //------------------------------------------------------------------------- |
|
682 // TEST C: Successful completion request of |
|
683 // RLine::GetStatus when result is not cached. |
|
684 //------------------------------------------------------------------------- |
|
685 RCall::TStatus callStatus; |
|
686 // get initial status |
|
687 err = line.GetStatus(callStatus); |
|
688 ASSERT_EQUALS(KErrNone, err); |
|
689 ASSERT_EQUALS(RCall::EStatusIdle, callStatus); |
|
690 |
|
691 //------------------------------------------------------------------------- |
|
692 // TEST D: RLine::GetStatus again, this time CTSY |
|
693 // will get result from the cache. |
|
694 // modify status by creating incoming call |
|
695 //------------------------------------------------------------------------- |
|
696 // create new incoming call |
|
697 TInt callId(1); |
|
698 RMobileCall::TMobileCallStatus mobileCallStatus = RMobileCall::EStatusRinging; |
|
699 RMobilePhone::TMobileService mobileService = RMobilePhone::EFaxService; |
|
700 TName incomingCallName; |
|
701 err = CreateIncomingCallL(line, callId, KNullDesC, incomingCallName, |
|
702 mobileService, mobileCallStatus); |
|
703 ASSERT_EQUALS(KErrNone, err); |
|
704 RCall call; |
|
705 err = call.OpenExistingCall(line, incomingCallName); |
|
706 ASSERT_EQUALS(KErrNone, err); |
|
707 CleanupClosePushL(call); |
|
708 |
|
709 // get modified status |
|
710 err = line.GetStatus(callStatus); |
|
711 ASSERT_EQUALS(KErrNone, err); |
|
712 ASSERT_EQUALS(RCall::EStatusRinging, callStatus); |
|
713 |
|
714 AssertMockLtsyStatusL(); |
|
715 CleanupStack::PopAndDestroy(3, this); //call, line, this |
|
716 |
|
717 } |
|
718 |
|
719 |
|
720 /** |
|
721 @SYMTestCaseID BA-CTSY-LINC-PGLI-0001 |
|
722 @SYMComponent telephony_ctsy |
|
723 @SYMTestCaseDesc Test support in CTSY for RPhone::GetLineInfo |
|
724 @SYMTestPriority High |
|
725 @SYMTestActions Invokes RPhone::GetLineInfo |
|
726 @SYMTestExpectedResults Pass |
|
727 @SYMTestType CT |
|
728 */ |
|
729 void CCTsyLineControlFU::TestGetLineInfo0001L() |
|
730 { |
|
731 |
|
732 OpenEtelServerL(EUseExtendedError); |
|
733 CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
|
734 OpenPhoneL(); |
|
735 |
|
736 //------------------------------------------------------------------------- |
|
737 // TEST with no line opened |
|
738 // get initial LineInfo with index = 0 |
|
739 //------------------------------------------------------------------------- |
|
740 TInt index(0); |
|
741 RPhone::TLineInfo lineInfo; |
|
742 TInt err = iPhone.GetLineInfo(index, lineInfo); |
|
743 ASSERT_EQUALS(KErrNone, err); |
|
744 ASSERT_EQUALS(lineInfo.iStatus, RCall::EStatusUnknown); |
|
745 ASSERT_EQUALS(lineInfo.iLineCapsFlags, (TUint32)(RLine::KCapsVoice|RLine::KCapsEventIncomingCall)); |
|
746 ASSERT_TRUE(0 == lineInfo.iName.Compare(KMmTsyVoice1LineName)); |
|
747 AssertMockLtsyStatusL(); |
|
748 |
|
749 //------------------------------------------------------------------------- |
|
750 // TEST with no line opened |
|
751 // get initial LineInfo with index = 1 |
|
752 //------------------------------------------------------------------------- |
|
753 index = 1; |
|
754 err = iPhone.GetLineInfo(index, lineInfo); |
|
755 ASSERT_EQUALS(KErrNone, err); |
|
756 ASSERT_EQUALS(lineInfo.iStatus, RCall::EStatusUnknown); |
|
757 ASSERT_EQUALS(lineInfo.iLineCapsFlags, (TUint32)0x00010008); |
|
758 ASSERT_TRUE(0 == lineInfo.iName.Compare(KMmTsyVoice2LineName)); |
|
759 AssertMockLtsyStatusL(); |
|
760 |
|
761 //------------------------------------------------------------------------- |
|
762 // TEST with no line opened |
|
763 // get initial LineInfo with index = 2 |
|
764 //------------------------------------------------------------------------- |
|
765 index = 2; |
|
766 err = iPhone.GetLineInfo(index, lineInfo); |
|
767 ASSERT_EQUALS(KErrNone, err); |
|
768 ASSERT_EQUALS(lineInfo.iStatus, RCall::EStatusUnknown); |
|
769 ASSERT_EQUALS(lineInfo.iLineCapsFlags, (TUint32)0x10001); |
|
770 ASSERT_TRUE(0 == lineInfo.iName.Compare(KMmTsyDataLineName)); |
|
771 AssertMockLtsyStatusL(); |
|
772 |
|
773 //------------------------------------------------------------------------- |
|
774 // TEST with no line opened |
|
775 // get initial LineInfo with index = 3 |
|
776 //------------------------------------------------------------------------- |
|
777 index = 3; |
|
778 err = iPhone.GetLineInfo(index, lineInfo); |
|
779 ASSERT_EQUALS(KErrNone, err); |
|
780 ASSERT_EQUALS(lineInfo.iStatus, RCall::EStatusUnknown); |
|
781 ASSERT_EQUALS(lineInfo.iLineCapsFlags, (TUint32)0x10002); |
|
782 ASSERT_TRUE(0 == lineInfo.iName.Compare(KMmTsyFaxLineName)); |
|
783 AssertMockLtsyStatusL(); |
|
784 |
|
785 |
|
786 //------------------------------------------------------------------------- |
|
787 // TEST with with line opened |
|
788 // get LineInfo for Voice1 line |
|
789 //------------------------------------------------------------------------- |
|
790 // now create voice1 line |
|
791 RLine line; |
|
792 err = line.Open(iPhone, KMmTsyVoice1LineName); |
|
793 ASSERT_EQUALS(KErrNone, err) |
|
794 CleanupClosePushL(line); |
|
795 |
|
796 // get initial voice1 line info |
|
797 index = 0; |
|
798 err = iPhone.GetLineInfo(index, lineInfo); |
|
799 ASSERT_EQUALS(KErrNone, err); |
|
800 ASSERT_EQUALS(lineInfo.iStatus, RCall::EStatusIdle); |
|
801 ASSERT_EQUALS(lineInfo.iLineCapsFlags, (TUint32)0x00010004); |
|
802 ASSERT_TRUE(0 == lineInfo.iName.Compare(KMmTsyVoice1LineName)); |
|
803 AssertMockLtsyStatusL(); |
|
804 |
|
805 // ----------- change voice1 line info -------------------------------------- |
|
806 // create new incoming call |
|
807 TInt callId(1); |
|
808 RMobileCall::TMobileCallStatus mobileCallStatus = RMobileCall::EStatusRinging; |
|
809 RMobilePhone::TMobileService mobileService = RMobilePhone::EVoiceService; |
|
810 TName incomingCallName; |
|
811 err = CreateIncomingCallL(line, callId, KNullDesC, incomingCallName, |
|
812 mobileService, mobileCallStatus); |
|
813 ASSERT_EQUALS(KErrNone, err); |
|
814 RCall call; |
|
815 err = call.OpenExistingCall(line, incomingCallName); |
|
816 ASSERT_EQUALS(KErrNone, err); |
|
817 CleanupClosePushL(call); |
|
818 // -------------------------------------------------------------------------- |
|
819 |
|
820 // get changed voice1 line info |
|
821 index = 0; |
|
822 err = iPhone.GetLineInfo(index, lineInfo); |
|
823 ASSERT_EQUALS(KErrNone, err); |
|
824 ASSERT_EQUALS(lineInfo.iStatus, RCall::EStatusRinging); |
|
825 ASSERT_EQUALS(lineInfo.iLineCapsFlags, (TUint32)0x00010004); |
|
826 ASSERT_TRUE(0 == lineInfo.iName.Compare(KMmTsyVoice1LineName)); |
|
827 AssertMockLtsyStatusL(); |
|
828 |
|
829 |
|
830 //------------------------------------------------------------------------- |
|
831 // TEST with with line opened |
|
832 // get LineInfo for Voice2 line |
|
833 //------------------------------------------------------------------------- |
|
834 // now create voice2 line |
|
835 RLine line2; |
|
836 err = line2.Open(iPhone, KMmTsyVoice2LineName); |
|
837 ASSERT_EQUALS(KErrNone, err) |
|
838 CleanupClosePushL(line2); |
|
839 |
|
840 // get initial voice2 line info |
|
841 index = 1; |
|
842 err = iPhone.GetLineInfo(index, lineInfo); |
|
843 ASSERT_EQUALS(KErrNone, err); |
|
844 ASSERT_EQUALS(lineInfo.iStatus, RCall::EStatusIdle); |
|
845 ASSERT_EQUALS(lineInfo.iLineCapsFlags, (TUint32)0x0001000C); |
|
846 ASSERT_TRUE(0 == lineInfo.iName.Compare(KMmTsyVoice2LineName)); |
|
847 AssertMockLtsyStatusL(); |
|
848 |
|
849 // ----------- change voice2 line info -------------------------------------- |
|
850 // create new incoming call |
|
851 TInt callId2(2); |
|
852 RMobileCall::TMobileCallStatus mobileCallStatus2 = RMobileCall::EStatusRinging; |
|
853 RMobilePhone::TMobileService mobileService2 = RMobilePhone::EAuxVoiceService; |
|
854 TName incomingCallName2; |
|
855 err = CreateIncomingCallL(line2, callId2, KNullDesC, incomingCallName2, |
|
856 mobileService2, mobileCallStatus2); |
|
857 ASSERT_EQUALS(KErrNone, err); |
|
858 RCall call2; |
|
859 err = call2.OpenExistingCall(line2, incomingCallName2); |
|
860 ASSERT_EQUALS(KErrNone, err); |
|
861 CleanupClosePushL(call2); |
|
862 // -------------------------------------------------------------------------- |
|
863 |
|
864 // get changed voice2 line info |
|
865 index = 1; |
|
866 err = iPhone.GetLineInfo(index, lineInfo); |
|
867 ASSERT_EQUALS(KErrNone, err); |
|
868 ASSERT_EQUALS(lineInfo.iStatus, RCall::EStatusRinging); |
|
869 ASSERT_EQUALS(lineInfo.iLineCapsFlags, (TUint32)0x0001000C); |
|
870 ASSERT_TRUE(0 == lineInfo.iName.Compare(KMmTsyVoice2LineName)); |
|
871 AssertMockLtsyStatusL(); |
|
872 |
|
873 |
|
874 //------------------------------------------------------------------------- |
|
875 // TEST with with line opened |
|
876 // get LineInfo for Data line |
|
877 //------------------------------------------------------------------------- |
|
878 // now create Data line |
|
879 RLine line3; |
|
880 err = line3.Open(iPhone, KMmTsyDataLineName); |
|
881 ASSERT_EQUALS(KErrNone, err) |
|
882 CleanupClosePushL(line3); |
|
883 |
|
884 // get initial Data line info |
|
885 index = 2; |
|
886 err = iPhone.GetLineInfo(index, lineInfo); |
|
887 ASSERT_EQUALS(KErrNone, err); |
|
888 ASSERT_EQUALS(lineInfo.iStatus, RCall::EStatusIdle); |
|
889 ASSERT_EQUALS(lineInfo.iLineCapsFlags, (TUint32)0x00010001); |
|
890 ASSERT_TRUE(0 == lineInfo.iName.Compare(KMmTsyDataLineName)); |
|
891 AssertMockLtsyStatusL(); |
|
892 |
|
893 // ----------- change Data line info -------------------------------------- |
|
894 // create new incoming call |
|
895 TInt callId3(3); |
|
896 RMobileCall::TMobileCallStatus mobileCallStatus3 = RMobileCall::EStatusRinging; |
|
897 RMobilePhone::TMobileService mobileService3 = RMobilePhone::ECircuitDataService; |
|
898 TName incomingCallName3; |
|
899 err = CreateIncomingCallL(line3, callId3, KNullDesC, incomingCallName3, |
|
900 mobileService3, mobileCallStatus3); |
|
901 ASSERT_EQUALS(KErrNone, err); |
|
902 RCall call3; |
|
903 err = call3.OpenExistingCall(line3, incomingCallName3); |
|
904 ASSERT_EQUALS(KErrNone, err); |
|
905 CleanupClosePushL(call3); |
|
906 // -------------------------------------------------------------------------- |
|
907 |
|
908 // get changed Data line info |
|
909 index = 2; |
|
910 err = iPhone.GetLineInfo(index, lineInfo); |
|
911 ASSERT_EQUALS(KErrNone, err); |
|
912 ASSERT_EQUALS(lineInfo.iStatus, RCall::EStatusRinging); |
|
913 ASSERT_EQUALS(lineInfo.iLineCapsFlags, (TUint32)0x00010001); |
|
914 ASSERT_TRUE(0 == lineInfo.iName.Compare(KMmTsyDataLineName)); |
|
915 AssertMockLtsyStatusL(); |
|
916 |
|
917 |
|
918 //------------------------------------------------------------------------- |
|
919 // TEST with with line opened |
|
920 // get LineInfo for Fax line |
|
921 //------------------------------------------------------------------------- |
|
922 // now create Fax line |
|
923 RLine line4; |
|
924 err = line4.Open(iPhone, KMmTsyFaxLineName); |
|
925 ASSERT_EQUALS(KErrNone, err) |
|
926 CleanupClosePushL(line4); |
|
927 |
|
928 // get initial Fax line info |
|
929 index = 3; |
|
930 err = iPhone.GetLineInfo(index, lineInfo); |
|
931 ASSERT_EQUALS(KErrNone, err); |
|
932 ASSERT_EQUALS(lineInfo.iStatus, RCall::EStatusIdle); |
|
933 ASSERT_EQUALS(lineInfo.iLineCapsFlags, (TUint32)0x00010002); |
|
934 ASSERT_TRUE(0 == lineInfo.iName.Compare(KMmTsyFaxLineName)); |
|
935 AssertMockLtsyStatusL(); |
|
936 |
|
937 // ----------- change Fax line info -------------------------------------- |
|
938 // create new incoming call |
|
939 TInt callId4(4); |
|
940 RMobileCall::TMobileCallStatus mobileCallStatus4 = RMobileCall::EStatusRinging; |
|
941 RMobilePhone::TMobileService mobileService4 = RMobilePhone::EFaxService; |
|
942 TName incomingCallName4; |
|
943 err = CreateIncomingCallL(line4, callId4, KNullDesC, incomingCallName4, |
|
944 mobileService4, mobileCallStatus4); |
|
945 ASSERT_EQUALS(KErrNone, err); |
|
946 RCall call4; |
|
947 err = call4.OpenExistingCall(line4, incomingCallName4); |
|
948 ASSERT_EQUALS(KErrNone, err); |
|
949 CleanupClosePushL(call4); |
|
950 // -------------------------------------------------------------------------- |
|
951 |
|
952 // get changed Fax line info |
|
953 index = 3; |
|
954 err = iPhone.GetLineInfo(index, lineInfo); |
|
955 ASSERT_EQUALS(KErrNone, err); |
|
956 ASSERT_EQUALS(lineInfo.iStatus, RCall::EStatusRinging); |
|
957 ASSERT_EQUALS(lineInfo.iLineCapsFlags, (TUint32)0x00010002); |
|
958 ASSERT_TRUE(0 == lineInfo.iName.Compare(KMmTsyFaxLineName)); |
|
959 AssertMockLtsyStatusL(); |
|
960 |
|
961 |
|
962 CleanupStack::PopAndDestroy(9, this); // ... this |
|
963 } |
|
964 |
|
965 /** |
|
966 @SYMTestCaseID BA-CTSY-LINC-PGLI-0003 |
|
967 @SYMComponent telephony_ctsy |
|
968 @SYMTestCaseDesc Test support in CTSY for RPhone::GetLineInfo with bad parameter data |
|
969 @SYMTestPriority High |
|
970 @SYMTestActions Invokes RPhone::GetLineInfo with bad parameter data |
|
971 @SYMTestExpectedResults Pass |
|
972 @SYMTestType CT |
|
973 */ |
|
974 void CCTsyLineControlFU::TestGetLineInfo0003L() |
|
975 { |
|
976 // This test should test sending bad parameter data for GetLineInfo |
|
977 |
|
978 OpenEtelServerL(EUseExtendedError); |
|
979 CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
|
980 OpenPhoneL(); |
|
981 |
|
982 |
|
983 TInt index(-1); // out of bound undex |
|
984 RPhone::TLineInfo lineInfo; |
|
985 TInt err = iPhone.GetLineInfo(index, lineInfo); |
|
986 ASSERT_EQUALS(KErrNotFound, err); |
|
987 AssertMockLtsyStatusL(); |
|
988 |
|
989 index = KMmTsyNumOfSupportedLines; // out of bound undex |
|
990 err = iPhone.GetLineInfo(index, lineInfo); |
|
991 ASSERT_EQUALS(KErrNotFound, err); |
|
992 AssertMockLtsyStatusL(); |
|
993 |
|
994 // Done ! |
|
995 CleanupStack::PopAndDestroy(1, this); // this |
|
996 |
|
997 } |
|
998 |
|
999 |
|
1000 /** |
|
1001 @SYMTestCaseID BA-CTSY-LINC-PEL-0001 |
|
1002 @SYMComponent telephony_ctsy |
|
1003 @SYMTestCaseDesc Test support in CTSY for RPhone::EnumerateLines |
|
1004 @SYMTestPriority High |
|
1005 @SYMTestActions Invokes RPhone::EnumerateLines |
|
1006 @SYMTestExpectedResults Pass |
|
1007 @SYMTestType CT |
|
1008 */ |
|
1009 void CCTsyLineControlFU::TestEnumerateLines0001L() |
|
1010 { |
|
1011 |
|
1012 OpenEtelServerL(EUseExtendedError); |
|
1013 CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
|
1014 OpenPhoneL(); |
|
1015 |
|
1016 //------------------------------------------------------------------------- |
|
1017 // TEST C |
|
1018 //------------------------------------------------------------------------- |
|
1019 TInt cnt; |
|
1020 TInt err = iPhone.EnumerateLines(cnt); |
|
1021 ASSERT_EQUALS(KErrNone, err); |
|
1022 ASSERT_EQUALS(KMmTsyNumOfSupportedLines, cnt); // hard-coded value |
|
1023 AssertMockLtsyStatusL(); |
|
1024 |
|
1025 CleanupStack::PopAndDestroy(1, this); // this |
|
1026 } |
|
1027 |
|
1028 |
|
1029 |
|
1030 /** |
|
1031 @SYMTestCaseID BA-CTSY-LINC-LNCC-0002 |
|
1032 @SYMComponent telephony_ctsy |
|
1033 @SYMTestCaseDesc Test support in CTSY for cancelling of RLine::NotifyCapsChange for voice lines |
|
1034 @SYMTestPriority High |
|
1035 @SYMTestActions Invokes cancelling of RLine::NotifyCapsChange for voice lines |
|
1036 @SYMTestExpectedResults Pass |
|
1037 @SYMTestType CT |
|
1038 */ |
|
1039 void CCTsyLineControlFU::TestNotifyCapsChange0002L() |
|
1040 { |
|
1041 |
|
1042 // This test should test cancellation of NotifyCapsChange |
|
1043 // If this API does not have a cancel, the test step should be completely removed. |
|
1044 |
|
1045 OpenEtelServerL(EUseExtendedError); |
|
1046 CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
|
1047 OpenPhoneL(); |
|
1048 |
|
1049 RLine line; |
|
1050 TInt err = line.Open(iPhone, KMmTsyVoice1LineName); |
|
1051 ASSERT_EQUALS(KErrNone, err); |
|
1052 CleanupClosePushL(line); |
|
1053 |
|
1054 //------------------------------------------------------------------------- |
|
1055 // Test cancelling of RLine::NotifyCapsChange |
|
1056 //------------------------------------------------------------------------- |
|
1057 TRequestStatus reqStatus; |
|
1058 RLine::TCaps caps; |
|
1059 line.NotifyCapsChange(reqStatus, caps); |
|
1060 |
|
1061 // cancelling of RLine::NotifyCapsChange |
|
1062 line.CancelAsyncRequest(EETelLineCapsChangeNotification); |
|
1063 |
|
1064 User::WaitForRequest(reqStatus); |
|
1065 AssertMockLtsyStatusL(); |
|
1066 ASSERT_EQUALS(KErrCancel, reqStatus.Int()); |
|
1067 |
|
1068 CleanupStack::PopAndDestroy(2); // line, this |
|
1069 } |
|
1070 |
|
1071 |
|
1072 |
|
1073 /** |
|
1074 @SYMTestCaseID BA-CTSY-LINC-LNCC-0007 |
|
1075 @SYMComponent telephony_ctsy |
|
1076 @SYMTestCaseDesc Test support in CTSY for cancelling of RLine::NotifyCapsChange for data lines |
|
1077 @SYMTestPriority High |
|
1078 @SYMTestActions Invokes cancelling of RLine::NotifyCapsChange for data lines |
|
1079 @SYMTestExpectedResults Pass |
|
1080 @SYMTestType CT |
|
1081 */ |
|
1082 void CCTsyLineControlFU::TestNotifyCapsChange0007L() |
|
1083 { |
|
1084 |
|
1085 // This test should test cancellation of NotifyCapsChange |
|
1086 // If this API does not have a cancel, the test step should be completely removed. |
|
1087 |
|
1088 OpenEtelServerL(EUseExtendedError); |
|
1089 CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
|
1090 OpenPhoneL(); |
|
1091 |
|
1092 RLine line; |
|
1093 TInt err = line.Open(iPhone, KMmTsyDataLineName); |
|
1094 ASSERT_EQUALS(KErrNone, err); |
|
1095 CleanupClosePushL(line); |
|
1096 |
|
1097 //------------------------------------------------------------------------- |
|
1098 // Test cancelling of RLine::NotifyCapsChange |
|
1099 //------------------------------------------------------------------------- |
|
1100 TRequestStatus reqStatus; |
|
1101 RLine::TCaps caps; |
|
1102 line.NotifyCapsChange(reqStatus, caps); |
|
1103 |
|
1104 // cancelling of RLine::NotifyCapsChange |
|
1105 line.CancelAsyncRequest(EETelLineCapsChangeNotification); |
|
1106 |
|
1107 User::WaitForRequest(reqStatus); |
|
1108 AssertMockLtsyStatusL(); |
|
1109 ASSERT_EQUALS(KErrCancel, reqStatus.Int()); |
|
1110 |
|
1111 CleanupStack::PopAndDestroy(2); // line, this |
|
1112 } |
|
1113 |
|
1114 |
|
1115 |
|
1116 /** |
|
1117 @SYMTestCaseID BA-CTSY-LINC-LNCC-00012 |
|
1118 @SYMComponent telephony_ctsy |
|
1119 @SYMTestCaseDesc Test support in CTSY for cancelling of RLine::NotifyCapsChange for fax lines |
|
1120 @SYMTestPriority High |
|
1121 @SYMTestActions Invokes cancelling of RLine::NotifyCapsChange for fax lines |
|
1122 @SYMTestExpectedResults Pass |
|
1123 @SYMTestType CT |
|
1124 */ |
|
1125 void CCTsyLineControlFU::TestNotifyCapsChange00012L() |
|
1126 { |
|
1127 |
|
1128 // This test should test cancellation of NotifyCapsChange |
|
1129 // If this API does not have a cancel, the test step should be completely removed. |
|
1130 |
|
1131 OpenEtelServerL(EUseExtendedError); |
|
1132 CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
|
1133 OpenPhoneL(); |
|
1134 |
|
1135 RLine line; |
|
1136 TInt err = line.Open(iPhone, KMmTsyFaxLineName); |
|
1137 ASSERT_EQUALS(KErrNone, err); |
|
1138 CleanupClosePushL(line); |
|
1139 |
|
1140 //------------------------------------------------------------------------- |
|
1141 // Test cancelling of RLine::NotifyCapsChange |
|
1142 //------------------------------------------------------------------------- |
|
1143 TRequestStatus reqStatus; |
|
1144 RLine::TCaps caps; |
|
1145 line.NotifyCapsChange(reqStatus, caps); |
|
1146 |
|
1147 // cancelling of RLine::NotifyCapsChange |
|
1148 line.CancelAsyncRequest(EETelLineCapsChangeNotification); |
|
1149 |
|
1150 User::WaitForRequest(reqStatus); |
|
1151 AssertMockLtsyStatusL(); |
|
1152 ASSERT_EQUALS(KErrCancel, reqStatus.Int()); |
|
1153 |
|
1154 CleanupStack::PopAndDestroy(2); // line, this |
|
1155 |
|
1156 } |
|
1157 |
|
1158 |
|
1159 |
|
1160 /** |
|
1161 @SYMTestCaseID BA-CTSY-LINC-LNSC-0001 |
|
1162 @SYMComponent telephony_ctsy |
|
1163 @SYMTestCaseDesc Test support in CTSY for RLine::NotifyStatusChange for voice lines |
|
1164 @SYMTestPriority High |
|
1165 @SYMTestActions Invokes RLine::NotifyStatusChange for voice lines |
|
1166 @SYMTestExpectedResults Pass |
|
1167 @SYMTestType CT |
|
1168 */ |
|
1169 void CCTsyLineControlFU::TestNotifyStatusChange0001L() |
|
1170 { |
|
1171 |
|
1172 OpenEtelServerL(EUseExtendedError); |
|
1173 CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
|
1174 OpenPhoneL(); |
|
1175 |
|
1176 RBuf8 data; |
|
1177 CleanupClosePushL(data); |
|
1178 |
|
1179 RBuf8 expectData; |
|
1180 CleanupClosePushL(expectData); |
|
1181 |
|
1182 RLine line; |
|
1183 TInt err = line.Open(iPhone, KMmTsyVoice1LineName); |
|
1184 |
|
1185 ASSERT_EQUALS(KErrNone, err); |
|
1186 CleanupClosePushL(line); |
|
1187 |
|
1188 //------------------------------------------------------------------------- |
|
1189 // TEST C: Successful completion request of |
|
1190 // RLine::NotifyStatusChange when result is not cached. |
|
1191 //------------------------------------------------------------------------- |
|
1192 |
|
1193 RCall::TStatus callStatus; |
|
1194 TRequestStatus reqStatus; |
|
1195 line.NotifyStatusChange(reqStatus, callStatus); |
|
1196 |
|
1197 // ----------- change Voice status --------------------------------------- |
|
1198 TRequestStatus mockLtsyStatus; |
|
1199 iMockLTSY.NotifyTerminated(mockLtsyStatus); |
|
1200 TInt callId(1); |
|
1201 RMobilePhone::TMobileService mobileService = RMobilePhone::EVoiceService; |
|
1202 RMobileCall::TMobileCallInfoV1 mobileCallInfo; |
|
1203 mobileCallInfo.iCallId = callId; |
|
1204 mobileCallInfo.iService = mobileService; |
|
1205 mobileCallInfo.iStatus = RMobileCall::EStatusDialling; |
|
1206 |
|
1207 TMockLtsyCallData1<RMobileCall::TMobileCallInfoV1> mockCallData1(callId, mobileService, mobileCallInfo); |
|
1208 mockCallData1.SerialiseL(data); |
|
1209 iMockLTSY.CompleteL(EMobileCallGetMobileCallInfo, KErrNone, data); |
|
1210 |
|
1211 User::WaitForRequest(mockLtsyStatus); |
|
1212 ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int()); |
|
1213 //------------------------------------------------------------------------- |
|
1214 |
|
1215 // wait for NotifyStatusChange completion |
|
1216 User::WaitForRequest(reqStatus); |
|
1217 ASSERT_EQUALS(KErrNone, reqStatus.Int()); |
|
1218 // check callStatus |
|
1219 ASSERT_EQUALS(RCall::EStatusDialling, callStatus); |
|
1220 AssertMockLtsyStatusL(); |
|
1221 |
|
1222 // close line |
|
1223 CloseLineL(line, callId, mobileService); |
|
1224 CleanupStack::Pop(1); //line |
|
1225 AssertMockLtsyStatusL(); |
|
1226 |
|
1227 //------------------------------------------------------------------------- |
|
1228 // TEST E: Unsolicited completion of RLine::NotifyStatusChange |
|
1229 // from LTSY. |
|
1230 //------------------------------------------------------------------------- |
|
1231 |
|
1232 //open new line |
|
1233 err = line.Open(iPhone, KMmTsyVoice1LineName); |
|
1234 ASSERT_EQUALS(KErrNone, err); |
|
1235 CleanupClosePushL(line); |
|
1236 |
|
1237 // use another status for coverage increasing |
|
1238 mobileCallInfo.iStatus = RMobileCall::EStatusConnecting; |
|
1239 |
|
1240 iMockLTSY.NotifyTerminated(mockLtsyStatus); |
|
1241 |
|
1242 |
|
1243 TMockLtsyCallData1<RMobileCall::TMobileCallInfoV1> mockCallData3(callId, mobileService, mobileCallInfo); |
|
1244 data.Close(); |
|
1245 mockCallData3.SerialiseL(data); |
|
1246 iMockLTSY.CompleteL(EMobileCallGetMobileCallInfo, KErrNone, data); |
|
1247 |
|
1248 User::WaitForRequest(mockLtsyStatus); |
|
1249 ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int()); |
|
1250 |
|
1251 //------------------------------------------------------------------------- |
|
1252 // TEST C: |
|
1253 // for voice KMmTsyVoice2LineName and for coverage increase |
|
1254 //------------------------------------------------------------------------- |
|
1255 |
|
1256 RLine line2; |
|
1257 err = line2.Open(iPhone, KMmTsyVoice2LineName); |
|
1258 ASSERT_EQUALS(KErrNone, err); |
|
1259 CleanupClosePushL(line2); |
|
1260 |
|
1261 line2.NotifyStatusChange(reqStatus, callStatus); |
|
1262 |
|
1263 // ---try to change Voice2 status |
|
1264 // with mobileCallInfo.iStatus = RMobileCall::EStatusUnknown---------------- |
|
1265 iMockLTSY.NotifyTerminated(mockLtsyStatus); |
|
1266 callId = 2; |
|
1267 mobileService = RMobilePhone::EAuxVoiceService; |
|
1268 mobileCallInfo.iCallId = callId; |
|
1269 mobileCallInfo.iService = mobileService; |
|
1270 mobileCallInfo.iStatus = RMobileCall::EStatusDialling; |
|
1271 |
|
1272 TMockLtsyCallData1<RMobileCall::TMobileCallInfoV1> mockCallData4(callId, mobileService, mobileCallInfo); |
|
1273 data.Close(); |
|
1274 mockCallData4.SerialiseL(data); |
|
1275 iMockLTSY.CompleteL(EMobileCallGetMobileCallInfo, KErrNone, data); |
|
1276 |
|
1277 User::WaitForRequest(mockLtsyStatus); |
|
1278 ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int()); |
|
1279 |
|
1280 User::WaitForRequest(reqStatus); |
|
1281 ASSERT_EQUALS(KErrNone, reqStatus.Int()); |
|
1282 ASSERT_EQUALS(RCall::EStatusDialling, callStatus); |
|
1283 AssertMockLtsyStatusL(); |
|
1284 |
|
1285 //------------------------------------------------------------------------- |
|
1286 // TEST C: Successful completion request of |
|
1287 // RLine::NotifyStatusChange when event EEtelLineNotifyCallAdded occurs |
|
1288 //------------------------------------------------------------------------- |
|
1289 |
|
1290 RLine line3; |
|
1291 err = line3.Open(iPhone, KMmTsyDataLineName); |
|
1292 ASSERT_EQUALS(KErrNone, err); |
|
1293 CleanupClosePushL(line3); |
|
1294 |
|
1295 line3.NotifyStatusChange(reqStatus, callStatus); |
|
1296 |
|
1297 // completes NotifyStatusChange |
|
1298 iMockLTSY.NotifyTerminated(mockLtsyStatus); |
|
1299 |
|
1300 callId = 1; |
|
1301 mobileCallInfo.iStatus = RMobileCall::EStatusConnected; |
|
1302 mobileService = RMobilePhone::ECircuitDataService; |
|
1303 |
|
1304 TMockLtsyCallData1<RMobileCall::TMobileCallInfoV1> mockCallData6(callId, mobileService, mobileCallInfo); |
|
1305 data.Close(); |
|
1306 mockCallData6.SerialiseL(data); |
|
1307 |
|
1308 iMockLTSY.CompleteL(EEtelLineNotifyCallAdded, KErrNone, data); |
|
1309 |
|
1310 User::WaitForRequest(mockLtsyStatus); |
|
1311 ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int()); |
|
1312 |
|
1313 // wait for NotifyStatusChange completion |
|
1314 User::WaitForRequest(reqStatus); |
|
1315 ASSERT_EQUALS(KErrNone, reqStatus.Int()); |
|
1316 ASSERT_EQUALS(RCall::EStatusDialling, callStatus); |
|
1317 AssertMockLtsyStatusL(); |
|
1318 |
|
1319 CleanupStack::PopAndDestroy(6, this); //line3, line2, line, expectData, data, this |
|
1320 |
|
1321 } |
|
1322 |
|
1323 |
|
1324 |
|
1325 /** |
|
1326 @SYMTestCaseID BA-CTSY-LINC-LNSC-0001a |
|
1327 @SYMDefectId DEF126595 |
|
1328 @SYMComponent telephony_ctsy |
|
1329 @SYMTestCaseDesc Test support in CTSY for RLine::NotifyStatusChange for voice lines |
|
1330 @SYMTestPriority High |
|
1331 @SYMTestActions Invokes RLine::NotifyStatusChange for voice lines |
|
1332 @SYMTestExpectedResults Pass |
|
1333 @SYMTestType CT |
|
1334 */ |
|
1335 void CCTsyLineControlFU::TestNotifyStatusChange0001aL() |
|
1336 { |
|
1337 OpenEtelServerL(EUseExtendedError); |
|
1338 CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
|
1339 OpenPhoneL(); |
|
1340 |
|
1341 RBuf8 data; |
|
1342 CleanupClosePushL(data); |
|
1343 |
|
1344 RBuf8 expectData; |
|
1345 CleanupClosePushL(expectData); |
|
1346 |
|
1347 //Line name is set to lower case, "voice1" |
|
1348 RLine line; |
|
1349 _LIT( KMmTsyVoice1LineNameLowerCase, "voice1"); |
|
1350 TInt err = line.Open(iPhone, KMmTsyVoice1LineNameLowerCase); |
|
1351 ASSERT_EQUALS(KErrNone, err); |
|
1352 CleanupClosePushL(line); |
|
1353 |
|
1354 //------------------------------------------------------------------------- |
|
1355 // TEST C: Successful completion request of |
|
1356 // RLine::NotifyStatusChange when result is not cached |
|
1357 // and voice line name is lower case. |
|
1358 //------------------------------------------------------------------------- |
|
1359 RCall::TStatus callStatus; |
|
1360 TRequestStatus reqStatus; |
|
1361 line.NotifyStatusChange(reqStatus, callStatus); |
|
1362 |
|
1363 // ----------- change Voice status --------------------------------------- |
|
1364 TRequestStatus mockLtsyStatus; |
|
1365 iMockLTSY.NotifyTerminated(mockLtsyStatus); |
|
1366 TInt callId(1); |
|
1367 RMobilePhone::TMobileService mobileService = RMobilePhone::EVoiceService; |
|
1368 RMobileCall::TMobileCallInfoV1 mobileCallInfo; |
|
1369 mobileCallInfo.iCallId = callId; |
|
1370 mobileCallInfo.iService = mobileService; |
|
1371 mobileCallInfo.iStatus = RMobileCall::EStatusDialling; |
|
1372 |
|
1373 TMockLtsyCallData1<RMobileCall::TMobileCallInfoV1> mockCallData1(callId, mobileService, mobileCallInfo); |
|
1374 mockCallData1.SerialiseL(data); |
|
1375 iMockLTSY.CompleteL(EMobileCallGetMobileCallInfo, KErrNone, data); |
|
1376 |
|
1377 User::WaitForRequest(mockLtsyStatus); |
|
1378 ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int()); |
|
1379 //------------------------------------------------------------------------- |
|
1380 |
|
1381 // wait for NotifyStatusChange completion |
|
1382 User::WaitForRequest(reqStatus); |
|
1383 ASSERT_EQUALS(KErrNone, reqStatus.Int()); |
|
1384 // check callStatus |
|
1385 ASSERT_EQUALS(RCall::EStatusDialling, callStatus); |
|
1386 AssertMockLtsyStatusL(); |
|
1387 |
|
1388 //Get Call Info |
|
1389 RLine::TCallInfo callInfo; |
|
1390 TInt ret = line.GetCallInfo( 0, callInfo); |
|
1391 ASSERT_EQUALS(KErrNone, ret); |
|
1392 ASSERT_TRUE(callInfo.iStatus==RCall::EStatusDialling); |
|
1393 |
|
1394 // close line |
|
1395 CloseLineL(line, callId, mobileService); |
|
1396 CleanupStack::Pop(1); //line |
|
1397 AssertMockLtsyStatusL(); |
|
1398 |
|
1399 CleanupStack::PopAndDestroy(3, this); // |
|
1400 } |
|
1401 |
|
1402 /** |
|
1403 @SYMTestCaseID BA-CTSY-LINC-LNSC-0002 |
|
1404 @SYMComponent telephony_ctsy |
|
1405 @SYMTestCaseDesc Test support in CTSY for cancelling of RLine::NotifyStatusChange for voice lines |
|
1406 @SYMTestPriority High |
|
1407 @SYMTestActions Invokes cancelling of RLine::NotifyStatusChange for voice lines |
|
1408 @SYMTestExpectedResults Pass |
|
1409 @SYMTestType CT |
|
1410 */ |
|
1411 void CCTsyLineControlFU::TestNotifyStatusChange0002L() |
|
1412 { |
|
1413 |
|
1414 // This test should test cancellation of NotifyStatusChange |
|
1415 // If this API does not have a cancel, the test step should be completely removed. |
|
1416 |
|
1417 OpenEtelServerL(EUseExtendedError); |
|
1418 CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
|
1419 OpenPhoneL(); |
|
1420 |
|
1421 RLine line; |
|
1422 TInt err = line.Open(iPhone, KMmTsyVoice1LineName); |
|
1423 ASSERT_EQUALS(KErrNone, err); |
|
1424 CleanupClosePushL(line); |
|
1425 |
|
1426 //------------------------------------------------------------------------- |
|
1427 // Test cancelling of RLine::NotifyStatusChange |
|
1428 //------------------------------------------------------------------------- |
|
1429 RCall::TStatus callStatus; |
|
1430 TRequestStatus reqStatus; |
|
1431 |
|
1432 line.NotifyStatusChange(reqStatus, callStatus); |
|
1433 |
|
1434 // cancel request |
|
1435 line.CancelAsyncRequest(EEtelLineNotifyStatusChange); |
|
1436 |
|
1437 User::WaitForRequest(reqStatus); |
|
1438 ASSERT_EQUALS(KErrCancel, reqStatus.Int()); |
|
1439 |
|
1440 AssertMockLtsyStatusL(); |
|
1441 CleanupStack::PopAndDestroy(2); // line, this |
|
1442 |
|
1443 } |
|
1444 |
|
1445 /** |
|
1446 @SYMTestCaseID BA-CTSY-LINC-LNSC-0004 |
|
1447 @SYMComponent telephony_ctsy |
|
1448 @SYMTestCaseDesc Test support in CTSY for multiple client requests to RLine::NotifyStatusChange for voice lines |
|
1449 @SYMTestPriority High |
|
1450 @SYMTestActions Invokes multiple client requests to RLine::NotifyStatusChange for voice lines |
|
1451 @SYMTestExpectedResults Pass |
|
1452 @SYMTestType CT |
|
1453 */ |
|
1454 void CCTsyLineControlFU::TestNotifyStatusChange0004L() |
|
1455 { |
|
1456 |
|
1457 OpenEtelServerL(EUseExtendedError); |
|
1458 CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
|
1459 OpenPhoneL(); |
|
1460 |
|
1461 RBuf8 data; |
|
1462 CleanupClosePushL(data); |
|
1463 |
|
1464 // Open second client |
|
1465 RTelServer telServer2; |
|
1466 TInt ret = telServer2.Connect(); |
|
1467 ASSERT_EQUALS(KErrNone, ret); |
|
1468 CleanupClosePushL(telServer2); |
|
1469 |
|
1470 RMobilePhone phone2; |
|
1471 ret = phone2.Open(telServer2, KMmTsyPhoneName); |
|
1472 ASSERT_EQUALS(KErrNone, ret); |
|
1473 CleanupClosePushL(phone2); |
|
1474 |
|
1475 RLine line; |
|
1476 TInt err = line.Open(iPhone, KMmTsyVoice1LineName); |
|
1477 ASSERT_EQUALS(KErrNone, err); |
|
1478 CleanupClosePushL(line); |
|
1479 |
|
1480 RLine line2; |
|
1481 err = line2.Open(phone2, KMmTsyVoice1LineName); |
|
1482 ASSERT_EQUALS(KErrNone, err); |
|
1483 CleanupClosePushL(line2); |
|
1484 |
|
1485 //------------------------------------------------------------------------- |
|
1486 // Test A: Test multiple clients requesting RLine::NotifyStatusChange |
|
1487 //------------------------------------------------------------------------- |
|
1488 //first client |
|
1489 RCall::TStatus callStatus; |
|
1490 TRequestStatus reqStatus; |
|
1491 line.NotifyStatusChange(reqStatus, callStatus); |
|
1492 |
|
1493 //second client |
|
1494 RCall::TStatus callStatus2; |
|
1495 TRequestStatus reqStatus2; |
|
1496 line2.NotifyStatusChange(reqStatus2, callStatus2); |
|
1497 |
|
1498 // ----------- change Voice status --------------------------------------- |
|
1499 TRequestStatus mockLtsyStatus; |
|
1500 iMockLTSY.NotifyTerminated(mockLtsyStatus); |
|
1501 TInt callId(1); |
|
1502 RMobilePhone::TMobileService mobileService = RMobilePhone::EVoiceService; |
|
1503 RMobileCall::TMobileCallInfoV1 mobileCallInfo; |
|
1504 mobileCallInfo.iCallId = callId; |
|
1505 mobileCallInfo.iService = mobileService; |
|
1506 mobileCallInfo.iStatus = RMobileCall::EStatusConnecting; |
|
1507 |
|
1508 TMockLtsyCallData1<RMobileCall::TMobileCallInfoV1> mockCallData1(callId, mobileService, mobileCallInfo); |
|
1509 mockCallData1.SerialiseL(data); |
|
1510 iMockLTSY.CompleteL(EMobileCallGetMobileCallInfo, KErrNone, data); |
|
1511 |
|
1512 User::WaitForRequest(mockLtsyStatus); |
|
1513 ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int()); |
|
1514 //------------------------------------------------------------------------- |
|
1515 |
|
1516 // wait for first NotifyStatusChange completion |
|
1517 User::WaitForRequest(reqStatus); |
|
1518 ASSERT_EQUALS(KErrNone, reqStatus.Int()); |
|
1519 // check callStatus |
|
1520 ASSERT_EQUALS(RCall::EStatusDialling, callStatus); |
|
1521 |
|
1522 // wait for second NotifyStatusChange completion |
|
1523 User::WaitForRequest(reqStatus2); |
|
1524 ASSERT_EQUALS(KErrNone, reqStatus2.Int()); |
|
1525 // check callStatus |
|
1526 ASSERT_EQUALS(RCall::EStatusDialling, callStatus2); |
|
1527 |
|
1528 // Done ! |
|
1529 CleanupStack::PopAndDestroy(6, this); // .... phone2, telServer2, data, this |
|
1530 |
|
1531 } |
|
1532 |
|
1533 /** |
|
1534 @SYMTestCaseID BA-CTSY-LINC-LNSC-0006 |
|
1535 @SYMComponent telephony_ctsy |
|
1536 @SYMTestCaseDesc Test support in CTSY for RLine::NotifyStatusChange for data lines |
|
1537 @SYMTestPriority High |
|
1538 @SYMTestActions Invokes RLine::NotifyStatusChange for data lines |
|
1539 @SYMTestExpectedResults Pass |
|
1540 @SYMTestType CT |
|
1541 */ |
|
1542 void CCTsyLineControlFU::TestNotifyStatusChange0006L() |
|
1543 { |
|
1544 |
|
1545 OpenEtelServerL(EUseExtendedError); |
|
1546 CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
|
1547 OpenPhoneL(); |
|
1548 |
|
1549 RBuf8 data; |
|
1550 CleanupClosePushL(data); |
|
1551 |
|
1552 RBuf8 expectData; |
|
1553 CleanupClosePushL(expectData); |
|
1554 |
|
1555 RLine line; |
|
1556 TInt err = line.Open(iPhone, KMmTsyDataLineName); |
|
1557 ASSERT_EQUALS(KErrNone, err); |
|
1558 CleanupClosePushL(line); |
|
1559 |
|
1560 //------------------------------------------------------------------------- |
|
1561 // TEST C: Successful completion request of |
|
1562 // RLine::NotifyStatusChange when result is not cached. |
|
1563 //------------------------------------------------------------------------- |
|
1564 RCall::TStatus callStatus; |
|
1565 TRequestStatus reqStatus; |
|
1566 line.NotifyStatusChange(reqStatus, callStatus); |
|
1567 |
|
1568 // ----------- change Data status --------------------------------------- |
|
1569 TRequestStatus mockLtsyStatus; |
|
1570 iMockLTSY.NotifyTerminated(mockLtsyStatus); |
|
1571 TInt callId(1); |
|
1572 RMobilePhone::TMobileService mobileService = RMobilePhone::ECircuitDataService; |
|
1573 RMobileCall::TMobileCallInfoV1 mobileCallInfo; |
|
1574 mobileCallInfo.iCallId = callId; |
|
1575 mobileCallInfo.iService = mobileService; |
|
1576 mobileCallInfo.iStatus = RMobileCall::EStatusConnected; |
|
1577 |
|
1578 TMockLtsyCallData1<RMobileCall::TMobileCallInfoV1> mockCallData1(callId, mobileService, mobileCallInfo); |
|
1579 mockCallData1.SerialiseL(data); |
|
1580 iMockLTSY.CompleteL(EMobileCallGetMobileCallInfo, KErrNone, data); |
|
1581 |
|
1582 User::WaitForRequest(mockLtsyStatus); |
|
1583 ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int()); |
|
1584 //------------------------------------------------------------------------- |
|
1585 |
|
1586 // wait for NotifyStatusChange completion |
|
1587 User::WaitForRequest(reqStatus); |
|
1588 ASSERT_EQUALS(KErrNone, reqStatus.Int()); |
|
1589 // check callStatus |
|
1590 ASSERT_EQUALS(RCall::EStatusDialling, callStatus); |
|
1591 |
|
1592 // close line |
|
1593 mobileService = RMobilePhone::ECircuitDataService; |
|
1594 CloseLineL(line, callId, mobileService); |
|
1595 CleanupStack::Pop(1); //line |
|
1596 AssertMockLtsyStatusL(); |
|
1597 |
|
1598 //------------------------------------------------------------------------- |
|
1599 // TEST E: Unsolicited completion of RLine::NotifyStatusChange |
|
1600 // from LTSY. |
|
1601 //------------------------------------------------------------------------- |
|
1602 //open new line |
|
1603 err = line.Open(iPhone, KMmTsyDataLineName); |
|
1604 ASSERT_EQUALS(KErrNone, err); |
|
1605 CleanupClosePushL(line); |
|
1606 |
|
1607 // use another status for coverage increasing |
|
1608 mobileCallInfo.iStatus = RMobileCall::EStatusConnecting; |
|
1609 |
|
1610 iMockLTSY.NotifyTerminated(mockLtsyStatus); |
|
1611 |
|
1612 TMockLtsyCallData1<RMobileCall::TMobileCallInfoV1> mockCallData2(callId, mobileService, mobileCallInfo); |
|
1613 data.Close(); |
|
1614 mockCallData2.SerialiseL(data); |
|
1615 iMockLTSY.CompleteL(EMobileCallGetMobileCallInfo, KErrNone, data); |
|
1616 |
|
1617 User::WaitForRequest(mockLtsyStatus); |
|
1618 ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int()); |
|
1619 |
|
1620 AssertMockLtsyStatusL(); |
|
1621 CleanupStack::PopAndDestroy(4, this); // line, expectData, data, this |
|
1622 } |
|
1623 |
|
1624 |
|
1625 /** |
|
1626 @SYMTestCaseID BA-CTSY-LINC-LNSC-0007 |
|
1627 @SYMComponent telephony_ctsy |
|
1628 @SYMTestCaseDesc Test support in CTSY for cancelling of RLine::NotifyStatusChange for data lines |
|
1629 @SYMTestPriority High |
|
1630 @SYMTestActions Invokes cancelling of RLine::NotifyStatusChange for data lines |
|
1631 @SYMTestExpectedResults Pass |
|
1632 @SYMTestType CT |
|
1633 */ |
|
1634 void CCTsyLineControlFU::TestNotifyStatusChange0007L() |
|
1635 { |
|
1636 |
|
1637 // This test should test cancellation of NotifyStatusChange |
|
1638 // If this API does not have a cancel, the test step should be completely removed. |
|
1639 |
|
1640 OpenEtelServerL(EUseExtendedError); |
|
1641 CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
|
1642 OpenPhoneL(); |
|
1643 |
|
1644 RLine line; |
|
1645 TInt err = line.Open(iPhone, KMmTsyDataLineName); |
|
1646 ASSERT_EQUALS(KErrNone, err); |
|
1647 CleanupClosePushL(line); |
|
1648 |
|
1649 //------------------------------------------------------------------------- |
|
1650 // Test cancelling of RLine::NotifyStatusChange |
|
1651 //------------------------------------------------------------------------- |
|
1652 RCall::TStatus callStatus; |
|
1653 TRequestStatus reqStatus; |
|
1654 |
|
1655 line.NotifyStatusChange(reqStatus, callStatus); |
|
1656 |
|
1657 // cancel request |
|
1658 line.CancelAsyncRequest(EEtelLineNotifyStatusChange); |
|
1659 |
|
1660 User::WaitForRequest(reqStatus); |
|
1661 ASSERT_EQUALS(KErrCancel, reqStatus.Int()); |
|
1662 |
|
1663 AssertMockLtsyStatusL(); |
|
1664 CleanupStack::PopAndDestroy(2); // line, this |
|
1665 |
|
1666 } |
|
1667 |
|
1668 /** |
|
1669 @SYMTestCaseID BA-CTSY-LINC-LNSC-0009 |
|
1670 @SYMComponent telephony_ctsy |
|
1671 @SYMTestCaseDesc Test support in CTSY for multiple client requests to RLine::NotifyStatusChange for data lines |
|
1672 @SYMTestPriority High |
|
1673 @SYMTestActions Invokes multiple client requests to RLine::NotifyStatusChange for data lines |
|
1674 @SYMTestExpectedResults Pass |
|
1675 @SYMTestType CT |
|
1676 */ |
|
1677 void CCTsyLineControlFU::TestNotifyStatusChange0009L() |
|
1678 { |
|
1679 |
|
1680 OpenEtelServerL(EUseExtendedError); |
|
1681 CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
|
1682 OpenPhoneL(); |
|
1683 |
|
1684 RBuf8 data; |
|
1685 CleanupClosePushL(data); |
|
1686 |
|
1687 // Open second client |
|
1688 RTelServer telServer2; |
|
1689 TInt ret = telServer2.Connect(); |
|
1690 ASSERT_EQUALS(KErrNone, ret); |
|
1691 CleanupClosePushL(telServer2); |
|
1692 |
|
1693 RMobilePhone phone2; |
|
1694 ret = phone2.Open(telServer2, KMmTsyPhoneName); |
|
1695 ASSERT_EQUALS(KErrNone, ret); |
|
1696 CleanupClosePushL(phone2); |
|
1697 |
|
1698 RLine line; |
|
1699 TInt err = line.Open(iPhone, KMmTsyDataLineName); |
|
1700 ASSERT_EQUALS(KErrNone, err); |
|
1701 CleanupClosePushL(line); |
|
1702 |
|
1703 RLine line2; |
|
1704 err = line2.Open(phone2, KMmTsyDataLineName); |
|
1705 ASSERT_EQUALS(KErrNone, err); |
|
1706 CleanupClosePushL(line2); |
|
1707 |
|
1708 //------------------------------------------------------------------------- |
|
1709 // Test A: Test multiple clients requesting RLine::NotifyStatusChange |
|
1710 //------------------------------------------------------------------------- |
|
1711 //first client |
|
1712 RCall::TStatus callStatus; |
|
1713 TRequestStatus reqStatus; |
|
1714 line.NotifyStatusChange(reqStatus, callStatus); |
|
1715 |
|
1716 //second client |
|
1717 RCall::TStatus callStatus2; |
|
1718 TRequestStatus reqStatus2; |
|
1719 line2.NotifyStatusChange(reqStatus2, callStatus2); |
|
1720 |
|
1721 // ----------- change Data status --------------------------------------- |
|
1722 TRequestStatus mockLtsyStatus; |
|
1723 iMockLTSY.NotifyTerminated(mockLtsyStatus); |
|
1724 TInt callId(1); |
|
1725 RMobilePhone::TMobileService mobileService = RMobilePhone::ECircuitDataService; |
|
1726 RMobileCall::TMobileCallInfoV1 mobileCallInfo; |
|
1727 mobileCallInfo.iCallId = callId; |
|
1728 mobileCallInfo.iService = mobileService; |
|
1729 mobileCallInfo.iStatus = RMobileCall::EStatusConnecting; |
|
1730 |
|
1731 TMockLtsyCallData1<RMobileCall::TMobileCallInfoV1> mockCallData1(callId, mobileService, mobileCallInfo); |
|
1732 mockCallData1.SerialiseL(data); |
|
1733 iMockLTSY.CompleteL(EMobileCallGetMobileCallInfo, KErrNone, data); |
|
1734 |
|
1735 User::WaitForRequest(mockLtsyStatus); |
|
1736 ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int()); |
|
1737 //------------------------------------------------------------------------- |
|
1738 |
|
1739 // wait for first NotifyStatusChange completion |
|
1740 User::WaitForRequest(reqStatus); |
|
1741 ASSERT_EQUALS(KErrNone, reqStatus.Int()); |
|
1742 // check callStatus |
|
1743 ASSERT_EQUALS(RCall::EStatusDialling, callStatus); |
|
1744 |
|
1745 // wait for second NotifyStatusChange completion |
|
1746 User::WaitForRequest(reqStatus2); |
|
1747 ASSERT_EQUALS(KErrNone, reqStatus2.Int()); |
|
1748 // check callStatus |
|
1749 ASSERT_EQUALS(RCall::EStatusDialling, callStatus2); |
|
1750 |
|
1751 // Done ! |
|
1752 CleanupStack::PopAndDestroy(6, this); // .... phone2, telServer2, data, this |
|
1753 |
|
1754 } |
|
1755 |
|
1756 |
|
1757 /** |
|
1758 @SYMTestCaseID BA-CTSY-LINC-LNSC-00011 |
|
1759 @SYMComponent telephony_ctsy |
|
1760 @SYMTestCaseDesc Test support in CTSY for RLine::NotifyStatusChange for fax lines |
|
1761 @SYMTestPriority High |
|
1762 @SYMTestActions Invokes RLine::NotifyStatusChange for fax lines |
|
1763 @SYMTestExpectedResults Pass |
|
1764 @SYMTestType CT |
|
1765 */ |
|
1766 void CCTsyLineControlFU::TestNotifyStatusChange00011L() |
|
1767 { |
|
1768 |
|
1769 OpenEtelServerL(EUseExtendedError); |
|
1770 CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
|
1771 OpenPhoneL(); |
|
1772 |
|
1773 RBuf8 data; |
|
1774 CleanupClosePushL(data); |
|
1775 |
|
1776 RBuf8 expectData; |
|
1777 CleanupClosePushL(expectData); |
|
1778 |
|
1779 RLine line; |
|
1780 TInt err = line.Open(iPhone, KMmTsyFaxLineName); |
|
1781 ASSERT_EQUALS(KErrNone, err); |
|
1782 CleanupClosePushL(line); |
|
1783 |
|
1784 //------------------------------------------------------------------------- |
|
1785 // TEST C: Successful completion request of |
|
1786 // RLine::NotifyStatusChange when result is not cached. |
|
1787 //------------------------------------------------------------------------- |
|
1788 RCall::TStatus callStatus; |
|
1789 TRequestStatus reqStatus; |
|
1790 line.NotifyStatusChange(reqStatus, callStatus); |
|
1791 |
|
1792 // ----------- change Data status --------------------------------------- |
|
1793 TRequestStatus mockLtsyStatus; |
|
1794 iMockLTSY.NotifyTerminated(mockLtsyStatus); |
|
1795 TInt callId(1); |
|
1796 RMobilePhone::TMobileService mobileService = RMobilePhone::EFaxService; |
|
1797 RMobileCall::TMobileCallInfoV1 mobileCallInfo; |
|
1798 mobileCallInfo.iCallId = callId; |
|
1799 mobileCallInfo.iService = mobileService; |
|
1800 mobileCallInfo.iStatus = RMobileCall::EStatusConnected; |
|
1801 |
|
1802 TMockLtsyCallData1<RMobileCall::TMobileCallInfoV1> mockCallData1(callId, mobileService, mobileCallInfo); |
|
1803 mockCallData1.SerialiseL(data); |
|
1804 iMockLTSY.CompleteL(EMobileCallGetMobileCallInfo, KErrNone, data); |
|
1805 |
|
1806 User::WaitForRequest(mockLtsyStatus); |
|
1807 ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int()); |
|
1808 //------------------------------------------------------------------------- |
|
1809 |
|
1810 // wait for NotifyStatusChange completion |
|
1811 User::WaitForRequest(reqStatus); |
|
1812 ASSERT_EQUALS(KErrNone, reqStatus.Int()); |
|
1813 // check callStatus |
|
1814 ASSERT_EQUALS(RCall::EStatusDialling, callStatus); |
|
1815 |
|
1816 |
|
1817 mobileService = RMobilePhone::EFaxService; |
|
1818 // close line |
|
1819 CloseLineL(line, callId, mobileService); |
|
1820 CleanupStack::Pop(1); //line |
|
1821 AssertMockLtsyStatusL(); |
|
1822 |
|
1823 |
|
1824 //------------------------------------------------------------------------- |
|
1825 // TEST E: Unsolicited completion of RLine::NotifyStatusChange |
|
1826 // from LTSY. |
|
1827 //------------------------------------------------------------------------- |
|
1828 //open new line |
|
1829 err = line.Open(iPhone, KMmTsyFaxLineName); |
|
1830 ASSERT_EQUALS(KErrNone, err); |
|
1831 CleanupClosePushL(line); |
|
1832 |
|
1833 // use another status for coverage increasing |
|
1834 mobileCallInfo.iStatus = RMobileCall::EStatusConnecting; |
|
1835 |
|
1836 iMockLTSY.NotifyTerminated(mockLtsyStatus); |
|
1837 |
|
1838 |
|
1839 TMockLtsyCallData1<RMobileCall::TMobileCallInfoV1> mockCallData2(callId, mobileService, mobileCallInfo); |
|
1840 data.Close(); |
|
1841 mockCallData2.SerialiseL(data); |
|
1842 iMockLTSY.CompleteL(EMobileCallGetMobileCallInfo, KErrNone, data); |
|
1843 |
|
1844 User::WaitForRequest(mockLtsyStatus); |
|
1845 ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int()); |
|
1846 |
|
1847 AssertMockLtsyStatusL(); |
|
1848 CleanupStack::PopAndDestroy(4, this); //line, expectData, data, this |
|
1849 |
|
1850 } |
|
1851 |
|
1852 |
|
1853 /** |
|
1854 @SYMTestCaseID BA-CTSY-LINC-LNSC-00012 |
|
1855 @SYMComponent telephony_ctsy |
|
1856 @SYMTestCaseDesc Test support in CTSY for cancelling of RLine::NotifyStatusChange for fax lines |
|
1857 @SYMTestPriority High |
|
1858 @SYMTestActions Invokes cancelling of RLine::NotifyStatusChange for fax lines |
|
1859 @SYMTestExpectedResults Pass |
|
1860 @SYMTestType CT |
|
1861 */ |
|
1862 void CCTsyLineControlFU::TestNotifyStatusChange00012L() |
|
1863 { |
|
1864 |
|
1865 // This test should test cancellation of NotifyStatusChange |
|
1866 // If this API does not have a cancel, the test step should be completely removed. |
|
1867 |
|
1868 OpenEtelServerL(EUseExtendedError); |
|
1869 CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
|
1870 OpenPhoneL(); |
|
1871 |
|
1872 RLine line; |
|
1873 TInt err = line.Open(iPhone, KMmTsyFaxLineName); |
|
1874 ASSERT_EQUALS(KErrNone, err); |
|
1875 CleanupClosePushL(line); |
|
1876 |
|
1877 //------------------------------------------------------------------------- |
|
1878 // Test cancelling of RLine::NotifyStatusChange |
|
1879 //------------------------------------------------------------------------- |
|
1880 RCall::TStatus callStatus; |
|
1881 TRequestStatus reqStatus; |
|
1882 |
|
1883 line.NotifyStatusChange(reqStatus, callStatus); |
|
1884 |
|
1885 // cancel request |
|
1886 line.CancelAsyncRequest(EEtelLineNotifyStatusChange); |
|
1887 |
|
1888 User::WaitForRequest(reqStatus); |
|
1889 ASSERT_EQUALS(KErrCancel, reqStatus.Int()); |
|
1890 |
|
1891 AssertMockLtsyStatusL(); |
|
1892 CleanupStack::PopAndDestroy(2); // line, this |
|
1893 |
|
1894 } |
|
1895 |
|
1896 |
|
1897 |
|
1898 /** |
|
1899 @SYMTestCaseID BA-CTSY-LINC-LNSC-00014 |
|
1900 @SYMComponent telephony_ctsy |
|
1901 @SYMTestCaseDesc Test support in CTSY for multiple client requests to RLine::NotifyStatusChange for fax lines |
|
1902 @SYMTestPriority High |
|
1903 @SYMTestActions Invokes multiple client requests to RLine::NotifyStatusChange for fax lines |
|
1904 @SYMTestExpectedResults Pass |
|
1905 @SYMTestType CT |
|
1906 */ |
|
1907 void CCTsyLineControlFU::TestNotifyStatusChange00014L() |
|
1908 { |
|
1909 |
|
1910 OpenEtelServerL(EUseExtendedError); |
|
1911 CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
|
1912 OpenPhoneL(); |
|
1913 |
|
1914 RBuf8 data; |
|
1915 CleanupClosePushL(data); |
|
1916 |
|
1917 // Open second client |
|
1918 RTelServer telServer2; |
|
1919 TInt ret = telServer2.Connect(); |
|
1920 ASSERT_EQUALS(KErrNone, ret); |
|
1921 CleanupClosePushL(telServer2); |
|
1922 |
|
1923 RMobilePhone phone2; |
|
1924 ret = phone2.Open(telServer2, KMmTsyPhoneName); |
|
1925 ASSERT_EQUALS(KErrNone, ret); |
|
1926 CleanupClosePushL(phone2); |
|
1927 |
|
1928 |
|
1929 RLine line; |
|
1930 TInt err = line.Open(iPhone, KMmTsyFaxLineName); |
|
1931 ASSERT_EQUALS(KErrNone, err); |
|
1932 CleanupClosePushL(line); |
|
1933 |
|
1934 RLine line2; |
|
1935 err = line2.Open(phone2, KMmTsyFaxLineName); |
|
1936 ASSERT_EQUALS(KErrNone, err); |
|
1937 CleanupClosePushL(line2); |
|
1938 |
|
1939 //------------------------------------------------------------------------- |
|
1940 // Test A: Test multiple clients requesting RLine::NotifyStatusChange |
|
1941 //------------------------------------------------------------------------- |
|
1942 //first client |
|
1943 RCall::TStatus callStatus; |
|
1944 TRequestStatus reqStatus; |
|
1945 line.NotifyStatusChange(reqStatus, callStatus); |
|
1946 |
|
1947 //second client |
|
1948 RCall::TStatus callStatus2; |
|
1949 TRequestStatus reqStatus2; |
|
1950 line2.NotifyStatusChange(reqStatus2, callStatus2); |
|
1951 |
|
1952 // ----------- change Data status --------------------------------------- |
|
1953 TRequestStatus mockLtsyStatus; |
|
1954 iMockLTSY.NotifyTerminated(mockLtsyStatus); |
|
1955 TInt callId(1); |
|
1956 RMobilePhone::TMobileService mobileService = RMobilePhone::EFaxService; |
|
1957 RMobileCall::TMobileCallInfoV1 mobileCallInfo; |
|
1958 mobileCallInfo.iCallId = callId; |
|
1959 mobileCallInfo.iService = mobileService; |
|
1960 mobileCallInfo.iStatus = RMobileCall::EStatusConnecting; |
|
1961 |
|
1962 TMockLtsyCallData1<RMobileCall::TMobileCallInfoV1> mockCallData1(callId, mobileService, mobileCallInfo); |
|
1963 mockCallData1.SerialiseL(data); |
|
1964 iMockLTSY.CompleteL(EMobileCallGetMobileCallInfo, KErrNone, data); |
|
1965 |
|
1966 User::WaitForRequest(mockLtsyStatus); |
|
1967 ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int()); |
|
1968 //------------------------------------------------------------------------- |
|
1969 |
|
1970 // wait for first NotifyStatusChange completion |
|
1971 User::WaitForRequest(reqStatus); |
|
1972 ASSERT_EQUALS(KErrNone, reqStatus.Int()); |
|
1973 // check callStatus |
|
1974 ASSERT_EQUALS(RCall::EStatusDialling, callStatus); |
|
1975 |
|
1976 // wait for second NotifyStatusChange completion |
|
1977 User::WaitForRequest(reqStatus2); |
|
1978 ASSERT_EQUALS(KErrNone, reqStatus2.Int()); |
|
1979 // check callStatus |
|
1980 ASSERT_EQUALS(RCall::EStatusDialling, callStatus2); |
|
1981 |
|
1982 // Done ! |
|
1983 CleanupStack::PopAndDestroy(6, this); // .... phone2, telServer2, data, this |
|
1984 |
|
1985 } |
|
1986 |
|
1987 |
|
1988 /** |
|
1989 @SYMTestCaseID BA-CTSY-LINC-LGMLS-0001 |
|
1990 @SYMComponent telephony_ctsy |
|
1991 @SYMTestCaseDesc Test support in CTSY for RMobileLine::GetMobileLineStatus for voice lines |
|
1992 @SYMTestPriority High |
|
1993 @SYMTestActions Invokes RMobileLine::GetMobileLineStatus for voice lines |
|
1994 @SYMTestExpectedResults Pass |
|
1995 @SYMTestType CT |
|
1996 */ |
|
1997 void CCTsyLineControlFU::TestGetMobileLineStatus0001L() |
|
1998 { |
|
1999 |
|
2000 OpenEtelServerL(EUseExtendedError); |
|
2001 CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
|
2002 OpenPhoneL(); |
|
2003 |
|
2004 RBuf8 data; |
|
2005 CleanupClosePushL(data); |
|
2006 |
|
2007 RMobileLine mobileLine; |
|
2008 TInt err = mobileLine.Open(iPhone, KMmTsyVoice1LineName); |
|
2009 ASSERT_EQUALS(KErrNone, err); |
|
2010 CleanupClosePushL(mobileLine); |
|
2011 |
|
2012 // Get initial MobileLineStatus |
|
2013 RMobileCall::TMobileCallStatus callStatus; |
|
2014 mobileLine.GetMobileLineStatus(callStatus); |
|
2015 ASSERT_EQUALS(RMobileCall::EStatusIdle, callStatus); |
|
2016 |
|
2017 //------- change MobileLineStatus ----------------------------------------- |
|
2018 TRequestStatus mockLtsyStatus; |
|
2019 iMockLTSY.NotifyTerminated(mockLtsyStatus); |
|
2020 TInt callId(1); |
|
2021 RMobilePhone::TMobileService mobileService = RMobilePhone::EVoiceService; |
|
2022 RMobileCall::TMobileCallInfoV1 mobileCallInfo; |
|
2023 mobileCallInfo.iCallId = callId; |
|
2024 mobileCallInfo.iService = mobileService; |
|
2025 mobileCallInfo.iStatus = RMobileCall::EStatusDialling; |
|
2026 |
|
2027 TMockLtsyCallData1<RMobileCall::TMobileCallInfoV1> mockCallData1(callId, mobileService, mobileCallInfo); |
|
2028 mockCallData1.SerialiseL(data); |
|
2029 iMockLTSY.CompleteL(EMobileCallGetMobileCallInfo, KErrNone, data); |
|
2030 |
|
2031 User::WaitForRequest(mockLtsyStatus); |
|
2032 ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int()); |
|
2033 //------------------------------------------------------------------------- |
|
2034 |
|
2035 // Get changed MobileLineStatus |
|
2036 mobileLine.GetMobileLineStatus(callStatus); |
|
2037 ASSERT_EQUALS(RMobileCall::EStatusDialling, callStatus); |
|
2038 |
|
2039 AssertMockLtsyStatusL(); |
|
2040 CleanupStack::PopAndDestroy(3, this); // mobileLine, data, this |
|
2041 |
|
2042 } |
|
2043 |
|
2044 /** |
|
2045 @SYMTestCaseID BA-CTSY-LINC-LGMLS-0006 |
|
2046 @SYMComponent telephony_ctsy |
|
2047 @SYMTestCaseDesc Test support in CTSY for RMobileLine::GetMobileLineStatus for data lines |
|
2048 @SYMTestPriority High |
|
2049 @SYMTestActions Invokes RMobileLine::GetMobileLineStatus for data lines |
|
2050 @SYMTestExpectedResults Pass |
|
2051 @SYMTestType CT |
|
2052 */ |
|
2053 void CCTsyLineControlFU::TestGetMobileLineStatus0006L() |
|
2054 { |
|
2055 |
|
2056 OpenEtelServerL(EUseExtendedError); |
|
2057 CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
|
2058 OpenPhoneL(); |
|
2059 |
|
2060 RBuf8 data; |
|
2061 CleanupClosePushL(data); |
|
2062 |
|
2063 RMobileLine mobileLine; |
|
2064 TInt err = mobileLine.Open(iPhone, KMmTsyDataLineName); |
|
2065 ASSERT_EQUALS(KErrNone, err); |
|
2066 CleanupClosePushL(mobileLine); |
|
2067 |
|
2068 // Get initial MobileLineStatus |
|
2069 RMobileCall::TMobileCallStatus callStatus; |
|
2070 mobileLine.GetMobileLineStatus(callStatus); |
|
2071 ASSERT_EQUALS(RMobileCall::EStatusIdle, callStatus); |
|
2072 |
|
2073 //------- change MobileLineStatus ----------------------------------------- |
|
2074 TRequestStatus mockLtsyStatus; |
|
2075 iMockLTSY.NotifyTerminated(mockLtsyStatus); |
|
2076 TInt callId(1); |
|
2077 RMobilePhone::TMobileService mobileService = RMobilePhone::ECircuitDataService; |
|
2078 RMobileCall::TMobileCallInfoV1 mobileCallInfo; |
|
2079 mobileCallInfo.iCallId = callId; |
|
2080 mobileCallInfo.iService = mobileService; |
|
2081 mobileCallInfo.iStatus = RMobileCall::EStatusConnecting; |
|
2082 |
|
2083 TMockLtsyCallData1<RMobileCall::TMobileCallInfoV1> mockCallData1(callId, mobileService, mobileCallInfo); |
|
2084 mockCallData1.SerialiseL(data); |
|
2085 iMockLTSY.CompleteL(EMobileCallGetMobileCallInfo, KErrNone, data); |
|
2086 |
|
2087 User::WaitForRequest(mockLtsyStatus); |
|
2088 ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int()); |
|
2089 //------------------------------------------------------------------------- |
|
2090 |
|
2091 // Get changed MobileLineStatus |
|
2092 mobileLine.GetMobileLineStatus(callStatus); |
|
2093 ASSERT_EQUALS(RMobileCall::EStatusDialling, callStatus); |
|
2094 |
|
2095 AssertMockLtsyStatusL(); |
|
2096 CleanupStack::PopAndDestroy(3, this); // mobileLine, data, this |
|
2097 |
|
2098 } |
|
2099 |
|
2100 |
|
2101 /** |
|
2102 @SYMTestCaseID BA-CTSY-LINC-LGMLS-00011 |
|
2103 @SYMComponent telephony_ctsy |
|
2104 @SYMTestCaseDesc Test support in CTSY for RMobileLine::GetMobileLineStatus for fax lines |
|
2105 @SYMTestPriority High |
|
2106 @SYMTestActions Invokes RMobileLine::GetMobileLineStatus for fax lines |
|
2107 @SYMTestExpectedResults Pass |
|
2108 @SYMTestType CT |
|
2109 */ |
|
2110 void CCTsyLineControlFU::TestGetMobileLineStatus00011L() |
|
2111 { |
|
2112 |
|
2113 OpenEtelServerL(EUseExtendedError); |
|
2114 CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
|
2115 OpenPhoneL(); |
|
2116 |
|
2117 RBuf8 data; |
|
2118 CleanupClosePushL(data); |
|
2119 |
|
2120 RMobileLine mobileLine; |
|
2121 TInt err = mobileLine.Open(iPhone, KMmTsyFaxLineName); |
|
2122 ASSERT_EQUALS(KErrNone, err); |
|
2123 CleanupClosePushL(mobileLine); |
|
2124 |
|
2125 // Get initial MobileLineStatus |
|
2126 RMobileCall::TMobileCallStatus callStatus; |
|
2127 mobileLine.GetMobileLineStatus(callStatus); |
|
2128 ASSERT_EQUALS(RMobileCall::EStatusIdle, callStatus); |
|
2129 |
|
2130 //------- change MobileLineStatus ----------------------------------------- |
|
2131 TRequestStatus mockLtsyStatus; |
|
2132 iMockLTSY.NotifyTerminated(mockLtsyStatus); |
|
2133 TInt callId(1); |
|
2134 RMobilePhone::TMobileService mobileService = RMobilePhone::EFaxService; |
|
2135 RMobileCall::TMobileCallInfoV1 mobileCallInfo; |
|
2136 mobileCallInfo.iCallId = callId; |
|
2137 mobileCallInfo.iService = mobileService; |
|
2138 mobileCallInfo.iStatus = RMobileCall::EStatusConnecting; |
|
2139 |
|
2140 TMockLtsyCallData1<RMobileCall::TMobileCallInfoV1> mockCallData1(callId, mobileService, mobileCallInfo); |
|
2141 mockCallData1.SerialiseL(data); |
|
2142 iMockLTSY.CompleteL(EMobileCallGetMobileCallInfo, KErrNone, data); |
|
2143 |
|
2144 User::WaitForRequest(mockLtsyStatus); |
|
2145 ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int()); |
|
2146 //------------------------------------------------------------------------- |
|
2147 |
|
2148 // Get changed MobileLineStatus |
|
2149 mobileLine.GetMobileLineStatus(callStatus); |
|
2150 ASSERT_EQUALS(RMobileCall::EStatusDialling, callStatus); |
|
2151 |
|
2152 AssertMockLtsyStatusL(); |
|
2153 CleanupStack::PopAndDestroy(3, this); // mobileLine, data, this |
|
2154 } |
|
2155 |
|
2156 |
|
2157 /** |
|
2158 @SYMTestCaseID BA-CTSY-LINC-LNMLSC-0001 |
|
2159 @SYMComponent telephony_ctsy |
|
2160 @SYMTestCaseDesc Test support in CTSY for RMobileLine::NotifyMobileLineStatusChange for voice lines |
|
2161 @SYMTestPriority High |
|
2162 @SYMTestActions Invokes RMobileLine::NotifyMobileLineStatusChange for voice lines |
|
2163 @SYMTestExpectedResults Pass |
|
2164 @SYMTestType CT |
|
2165 */ |
|
2166 void CCTsyLineControlFU::TestNotifyMobileLineStatusChange0001L() |
|
2167 { |
|
2168 |
|
2169 OpenEtelServerL(EUseExtendedError); |
|
2170 CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
|
2171 OpenPhoneL(); |
|
2172 |
|
2173 RBuf8 data; |
|
2174 CleanupClosePushL(data); |
|
2175 |
|
2176 RMobileLine mobileLine; |
|
2177 TInt err = mobileLine.Open(iPhone, KMmTsyVoice1LineName); |
|
2178 ASSERT_EQUALS(KErrNone, err); |
|
2179 CleanupClosePushL(mobileLine); |
|
2180 |
|
2181 //------------------------------------------------------------------------- |
|
2182 // TEST C: Successful completion request of |
|
2183 // RMobileLine::NotifyMobileLineStatusChange when result is not cached. |
|
2184 //------------------------------------------------------------------------- |
|
2185 TRequestStatus reqStatus; |
|
2186 RMobileCall::TMobileCallStatus callStatus; |
|
2187 |
|
2188 // set notification |
|
2189 mobileLine.NotifyMobileLineStatusChange(reqStatus, callStatus); |
|
2190 |
|
2191 //------- change MobileLineStatus ----------------------------------------- |
|
2192 TRequestStatus mockLtsyStatus; |
|
2193 iMockLTSY.NotifyTerminated(mockLtsyStatus); |
|
2194 TInt callId(1); |
|
2195 RMobilePhone::TMobileService mobileService = RMobilePhone::EVoiceService; |
|
2196 RMobileCall::TMobileCallInfoV1 mobileCallInfo; |
|
2197 mobileCallInfo.iCallId = callId; |
|
2198 mobileCallInfo.iService = mobileService; |
|
2199 mobileCallInfo.iStatus = RMobileCall::EStatusConnecting; |
|
2200 |
|
2201 TMockLtsyCallData1<RMobileCall::TMobileCallInfoV1> mockCallData1(callId, mobileService, mobileCallInfo); |
|
2202 mockCallData1.SerialiseL(data); |
|
2203 iMockLTSY.CompleteL(EMobileCallGetMobileCallInfo, KErrNone, data); |
|
2204 |
|
2205 User::WaitForRequest(mockLtsyStatus); |
|
2206 ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int()); |
|
2207 //------------------------------------------------------------------------- |
|
2208 |
|
2209 // wait for notification |
|
2210 User::WaitForRequest(reqStatus); |
|
2211 ASSERT_EQUALS(KErrNone, reqStatus.Int()); |
|
2212 ASSERT_EQUALS(RMobileCall::EStatusDialling, callStatus); |
|
2213 |
|
2214 AssertMockLtsyStatusL(); |
|
2215 CleanupStack::PopAndDestroy(3, this); //mobileLine, data, this |
|
2216 |
|
2217 } |
|
2218 |
|
2219 |
|
2220 /** |
|
2221 @SYMTestCaseID BA-CTSY-LINC-LNMLSC-0002 |
|
2222 @SYMComponent telephony_ctsy |
|
2223 @SYMTestCaseDesc Test support in CTSY for cancelling of RMobileLine::NotifyMobileLineStatusChange for voice lines |
|
2224 @SYMTestPriority High |
|
2225 @SYMTestActions Invokes cancelling of RMobileLine::NotifyMobileLineStatusChange for voice lines |
|
2226 @SYMTestExpectedResults Pass |
|
2227 @SYMTestType CT |
|
2228 */ |
|
2229 void CCTsyLineControlFU::TestNotifyMobileLineStatusChange0002L() |
|
2230 { |
|
2231 |
|
2232 // This test should test cancellation of NotifyMobileLineStatusChange |
|
2233 // If this API does not have a cancel, the test step should be completely removed. |
|
2234 |
|
2235 OpenEtelServerL(EUseExtendedError); |
|
2236 CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
|
2237 OpenPhoneL(); |
|
2238 |
|
2239 RMobileLine mobileLine; |
|
2240 TInt err = mobileLine.Open(iPhone, KMmTsyVoice1LineName); |
|
2241 ASSERT_EQUALS(KErrNone, err); |
|
2242 CleanupClosePushL(mobileLine); |
|
2243 |
|
2244 TRequestStatus reqStatus; |
|
2245 RMobileCall::TMobileCallStatus callStatus; |
|
2246 |
|
2247 //------------------------------------------------------------------------- |
|
2248 // Test cancelling of RMobileLine::NotifyMobileLineStatusChange |
|
2249 //------------------------------------------------------------------------- |
|
2250 |
|
2251 // set notification |
|
2252 mobileLine.NotifyMobileLineStatusChange(reqStatus, callStatus); |
|
2253 |
|
2254 // cancelling of RMobileLine::NotifyMobileLineStatusChange |
|
2255 mobileLine.CancelAsyncRequest(EMobileLineNotifyMobileLineStatusChange); |
|
2256 |
|
2257 User::WaitForRequest(reqStatus); |
|
2258 ASSERT_EQUALS(KErrCancel, reqStatus.Int()); |
|
2259 |
|
2260 AssertMockLtsyStatusL(); |
|
2261 CleanupStack::PopAndDestroy(2, this); //mobileLine, this |
|
2262 |
|
2263 } |
|
2264 |
|
2265 |
|
2266 /** |
|
2267 @SYMTestCaseID BA-CTSY-LINC-LNMLSC-0004 |
|
2268 @SYMComponent telephony_ctsy |
|
2269 @SYMTestCaseDesc Test support in CTSY for multiple client requests to RMobileLine::NotifyMobileLineStatusChange for voice lines |
|
2270 @SYMTestPriority High |
|
2271 @SYMTestActions Invokes multiple client requests to RMobileLine::NotifyMobileLineStatusChange for voice lines |
|
2272 @SYMTestExpectedResults Pass |
|
2273 @SYMTestType CT |
|
2274 */ |
|
2275 void CCTsyLineControlFU::TestNotifyMobileLineStatusChange0004L() |
|
2276 { |
|
2277 |
|
2278 |
|
2279 OpenEtelServerL(EUseExtendedError); |
|
2280 CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
|
2281 OpenPhoneL(); |
|
2282 |
|
2283 RBuf8 data; |
|
2284 CleanupClosePushL(data); |
|
2285 |
|
2286 // Open second client |
|
2287 RTelServer telServer2; |
|
2288 TInt ret = telServer2.Connect(); |
|
2289 ASSERT_EQUALS(KErrNone, ret); |
|
2290 CleanupClosePushL(telServer2); |
|
2291 |
|
2292 RMobilePhone phone2; |
|
2293 ret = phone2.Open(telServer2,KMmTsyPhoneName); |
|
2294 ASSERT_EQUALS(KErrNone, ret); |
|
2295 CleanupClosePushL(phone2); |
|
2296 |
|
2297 RMobileLine mobileLine; |
|
2298 TInt err = mobileLine.Open(iPhone, KMmTsyVoice1LineName); |
|
2299 ASSERT_EQUALS(KErrNone, err); |
|
2300 CleanupClosePushL(mobileLine); |
|
2301 |
|
2302 RMobileLine mobileLine2; |
|
2303 err = mobileLine2.Open(phone2, KMmTsyVoice1LineName); |
|
2304 ASSERT_EQUALS(KErrNone, err); |
|
2305 CleanupClosePushL(mobileLine2); |
|
2306 |
|
2307 //------------------------------------------------------------------------- |
|
2308 // Test A: Test multiple clients requesting RMobileLine::NotifyMobileLineStatusChange |
|
2309 //------------------------------------------------------------------------- |
|
2310 |
|
2311 // set first notification |
|
2312 TRequestStatus reqStatus; |
|
2313 RMobileCall::TMobileCallStatus callStatus; |
|
2314 mobileLine.NotifyMobileLineStatusChange(reqStatus, callStatus); |
|
2315 |
|
2316 // set second notification |
|
2317 TRequestStatus reqStatus2; |
|
2318 RMobileCall::TMobileCallStatus callStatus2; |
|
2319 mobileLine2.NotifyMobileLineStatusChange(reqStatus2, callStatus2); |
|
2320 |
|
2321 //------- change MobileLineStatus ----------------------------------------- |
|
2322 TRequestStatus mockLtsyStatus; |
|
2323 iMockLTSY.NotifyTerminated(mockLtsyStatus); |
|
2324 TInt callId(1); |
|
2325 RMobilePhone::TMobileService mobileService = RMobilePhone::EVoiceService; |
|
2326 RMobileCall::TMobileCallInfoV1 mobileCallInfo; |
|
2327 mobileCallInfo.iCallId = callId; |
|
2328 mobileCallInfo.iService = mobileService; |
|
2329 mobileCallInfo.iStatus = RMobileCall::EStatusConnecting; |
|
2330 |
|
2331 TMockLtsyCallData1<RMobileCall::TMobileCallInfoV1> mockCallData1(callId, mobileService, mobileCallInfo); |
|
2332 mockCallData1.SerialiseL(data); |
|
2333 iMockLTSY.CompleteL(EMobileCallGetMobileCallInfo, KErrNone, data); |
|
2334 |
|
2335 User::WaitForRequest(mockLtsyStatus); |
|
2336 ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int()); |
|
2337 //------------------------------------------------------------------------- |
|
2338 |
|
2339 // wait for first notification |
|
2340 User::WaitForRequest(reqStatus); |
|
2341 ASSERT_EQUALS(KErrNone, reqStatus.Int()); |
|
2342 ASSERT_EQUALS(RMobileCall::EStatusDialling, callStatus); |
|
2343 |
|
2344 // wait for second notification |
|
2345 User::WaitForRequest(reqStatus2); |
|
2346 ASSERT_EQUALS(KErrNone, reqStatus2.Int()); |
|
2347 ASSERT_EQUALS(RMobileCall::EStatusDialling, callStatus2); |
|
2348 |
|
2349 AssertMockLtsyStatusL(); |
|
2350 // Done ! |
|
2351 CleanupStack::PopAndDestroy(6, this); // mobileLine2, mobileLine, phone2, telServer2, data, this |
|
2352 |
|
2353 } |
|
2354 |
|
2355 |
|
2356 /** |
|
2357 @SYMTestCaseID BA-CTSY-LINC-LNMLSC-0006 |
|
2358 @SYMComponent telephony_ctsy |
|
2359 @SYMTestCaseDesc Test support in CTSY for RMobileLine::NotifyMobileLineStatusChange for data lines |
|
2360 @SYMTestPriority High |
|
2361 @SYMTestActions Invokes RMobileLine::NotifyMobileLineStatusChange for data lines |
|
2362 @SYMTestExpectedResults Pass |
|
2363 @SYMTestType CT |
|
2364 */ |
|
2365 void CCTsyLineControlFU::TestNotifyMobileLineStatusChange0006L() |
|
2366 { |
|
2367 |
|
2368 OpenEtelServerL(EUseExtendedError); |
|
2369 CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
|
2370 OpenPhoneL(); |
|
2371 |
|
2372 RBuf8 data; |
|
2373 CleanupClosePushL(data); |
|
2374 |
|
2375 RMobileLine mobileLine; |
|
2376 TInt err = mobileLine.Open(iPhone, KMmTsyDataLineName); |
|
2377 ASSERT_EQUALS(KErrNone, err); |
|
2378 CleanupClosePushL(mobileLine); |
|
2379 |
|
2380 //------------------------------------------------------------------------- |
|
2381 // TEST C: Successful completion request of |
|
2382 // RMobileLine::NotifyMobileLineStatusChange when result is not cached. |
|
2383 //------------------------------------------------------------------------- |
|
2384 TRequestStatus reqStatus; |
|
2385 RMobileCall::TMobileCallStatus callStatus; |
|
2386 |
|
2387 // set notification |
|
2388 mobileLine.NotifyMobileLineStatusChange(reqStatus, callStatus); |
|
2389 |
|
2390 //------- change MobileLineStatus ----------------------------------------- |
|
2391 TRequestStatus mockLtsyStatus; |
|
2392 iMockLTSY.NotifyTerminated(mockLtsyStatus); |
|
2393 TInt callId(1); |
|
2394 RMobilePhone::TMobileService mobileService = RMobilePhone::ECircuitDataService; |
|
2395 RMobileCall::TMobileCallInfoV1 mobileCallInfo; |
|
2396 mobileCallInfo.iCallId = callId; |
|
2397 mobileCallInfo.iService = mobileService; |
|
2398 mobileCallInfo.iStatus = RMobileCall::EStatusConnecting; |
|
2399 |
|
2400 TMockLtsyCallData1<RMobileCall::TMobileCallInfoV1> mockCallData1(callId, mobileService, mobileCallInfo); |
|
2401 mockCallData1.SerialiseL(data); |
|
2402 iMockLTSY.CompleteL(EMobileCallGetMobileCallInfo, KErrNone, data); |
|
2403 |
|
2404 User::WaitForRequest(mockLtsyStatus); |
|
2405 ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int()); |
|
2406 //------------------------------------------------------------------------- |
|
2407 |
|
2408 // wait for notification |
|
2409 User::WaitForRequest(reqStatus); |
|
2410 ASSERT_EQUALS(KErrNone, reqStatus.Int()); |
|
2411 ASSERT_EQUALS(RMobileCall::EStatusDialling, callStatus); |
|
2412 |
|
2413 AssertMockLtsyStatusL(); |
|
2414 CleanupStack::PopAndDestroy(3, this); //mobileLine, data, this |
|
2415 |
|
2416 } |
|
2417 |
|
2418 |
|
2419 /** |
|
2420 @SYMTestCaseID BA-CTSY-LINC-LNMLSC-0007 |
|
2421 @SYMComponent telephony_ctsy |
|
2422 @SYMTestCaseDesc Test support in CTSY for cancelling of RMobileLine::NotifyMobileLineStatusChange for data lines |
|
2423 @SYMTestPriority High |
|
2424 @SYMTestActions Invokes cancelling of RMobileLine::NotifyMobileLineStatusChange for data lines |
|
2425 @SYMTestExpectedResults Pass |
|
2426 @SYMTestType CT |
|
2427 */ |
|
2428 void CCTsyLineControlFU::TestNotifyMobileLineStatusChange0007L() |
|
2429 { |
|
2430 |
|
2431 // This test should test cancellation of NotifyMobileLineStatusChange |
|
2432 // If this API does not have a cancel, the test step should be completely removed. |
|
2433 |
|
2434 OpenEtelServerL(EUseExtendedError); |
|
2435 CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
|
2436 OpenPhoneL(); |
|
2437 |
|
2438 RMobileLine mobileLine; |
|
2439 TInt err = mobileLine.Open(iPhone, KMmTsyDataLineName); |
|
2440 ASSERT_EQUALS(KErrNone, err); |
|
2441 CleanupClosePushL(mobileLine); |
|
2442 |
|
2443 TRequestStatus reqStatus; |
|
2444 RMobileCall::TMobileCallStatus callStatus; |
|
2445 |
|
2446 //------------------------------------------------------------------------- |
|
2447 // Test cancelling of RMobileLine::NotifyMobileLineStatusChange |
|
2448 //------------------------------------------------------------------------- |
|
2449 |
|
2450 // set notification |
|
2451 mobileLine.NotifyMobileLineStatusChange(reqStatus, callStatus); |
|
2452 |
|
2453 // cancelling of RMobileLine::NotifyMobileLineStatusChange |
|
2454 mobileLine.CancelAsyncRequest(EMobileLineNotifyMobileLineStatusChange); |
|
2455 |
|
2456 User::WaitForRequest(reqStatus); |
|
2457 ASSERT_EQUALS(KErrCancel, reqStatus.Int()); |
|
2458 |
|
2459 AssertMockLtsyStatusL(); |
|
2460 CleanupStack::PopAndDestroy(2, this); //mobileLine, this |
|
2461 |
|
2462 } |
|
2463 |
|
2464 |
|
2465 /** |
|
2466 @SYMTestCaseID BA-CTSY-LINC-LNMLSC-0009 |
|
2467 @SYMComponent telephony_ctsy |
|
2468 @SYMTestCaseDesc Test support in CTSY for multiple client requests to RMobileLine::NotifyMobileLineStatusChange for data lines |
|
2469 @SYMTestPriority High |
|
2470 @SYMTestActions Invokes multiple client requests to RMobileLine::NotifyMobileLineStatusChange for data lines |
|
2471 @SYMTestExpectedResults Pass |
|
2472 @SYMTestType CT |
|
2473 */ |
|
2474 void CCTsyLineControlFU::TestNotifyMobileLineStatusChange0009L() |
|
2475 { |
|
2476 |
|
2477 |
|
2478 OpenEtelServerL(EUseExtendedError); |
|
2479 CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
|
2480 OpenPhoneL(); |
|
2481 |
|
2482 RBuf8 data; |
|
2483 CleanupClosePushL(data); |
|
2484 |
|
2485 // Open second client |
|
2486 RTelServer telServer2; |
|
2487 TInt ret = telServer2.Connect(); |
|
2488 ASSERT_EQUALS(KErrNone, ret); |
|
2489 CleanupClosePushL(telServer2); |
|
2490 |
|
2491 RMobilePhone phone2; |
|
2492 ret = phone2.Open(telServer2,KMmTsyPhoneName); |
|
2493 ASSERT_EQUALS(KErrNone, ret); |
|
2494 CleanupClosePushL(phone2); |
|
2495 |
|
2496 RMobileLine mobileLine; |
|
2497 TInt err = mobileLine.Open(iPhone, KMmTsyDataLineName); |
|
2498 ASSERT_EQUALS(KErrNone, err); |
|
2499 CleanupClosePushL(mobileLine); |
|
2500 |
|
2501 RMobileLine mobileLine2; |
|
2502 err = mobileLine2.Open(phone2, KMmTsyDataLineName); |
|
2503 ASSERT_EQUALS(KErrNone, err); |
|
2504 CleanupClosePushL(mobileLine2); |
|
2505 |
|
2506 //------------------------------------------------------------------------- |
|
2507 // Test A: Test multiple clients requesting RMobileLine::NotifyMobileLineStatusChange |
|
2508 //------------------------------------------------------------------------- |
|
2509 |
|
2510 // set first notification |
|
2511 TRequestStatus reqStatus; |
|
2512 RMobileCall::TMobileCallStatus callStatus; |
|
2513 mobileLine.NotifyMobileLineStatusChange(reqStatus, callStatus); |
|
2514 |
|
2515 // set second notification |
|
2516 TRequestStatus reqStatus2; |
|
2517 RMobileCall::TMobileCallStatus callStatus2; |
|
2518 mobileLine2.NotifyMobileLineStatusChange(reqStatus2, callStatus2); |
|
2519 |
|
2520 //------- change MobileLineStatus ----------------------------------------- |
|
2521 TRequestStatus mockLtsyStatus; |
|
2522 iMockLTSY.NotifyTerminated(mockLtsyStatus); |
|
2523 TInt callId(1); |
|
2524 RMobilePhone::TMobileService mobileService = RMobilePhone::ECircuitDataService; |
|
2525 RMobileCall::TMobileCallInfoV1 mobileCallInfo; |
|
2526 mobileCallInfo.iCallId = callId; |
|
2527 mobileCallInfo.iService = mobileService; |
|
2528 mobileCallInfo.iStatus = RMobileCall::EStatusConnected; |
|
2529 |
|
2530 TMockLtsyCallData1<RMobileCall::TMobileCallInfoV1> mockCallData1(callId, mobileService, mobileCallInfo); |
|
2531 mockCallData1.SerialiseL(data); |
|
2532 iMockLTSY.CompleteL(EMobileCallGetMobileCallInfo, KErrNone, data); |
|
2533 |
|
2534 User::WaitForRequest(mockLtsyStatus); |
|
2535 ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int()); |
|
2536 //------------------------------------------------------------------------- |
|
2537 |
|
2538 // wait for first notification |
|
2539 User::WaitForRequest(reqStatus); |
|
2540 ASSERT_EQUALS(KErrNone, reqStatus.Int()); |
|
2541 ASSERT_EQUALS(RMobileCall::EStatusDialling, callStatus); |
|
2542 |
|
2543 // wait for second notification |
|
2544 User::WaitForRequest(reqStatus2); |
|
2545 ASSERT_EQUALS(KErrNone, reqStatus2.Int()); |
|
2546 ASSERT_EQUALS(RMobileCall::EStatusDialling, callStatus2); |
|
2547 |
|
2548 AssertMockLtsyStatusL(); |
|
2549 // Done ! |
|
2550 CleanupStack::PopAndDestroy(6, this); // mobileLine2, mobileLine, phone2, telServer2, data, this |
|
2551 } |
|
2552 |
|
2553 |
|
2554 |
|
2555 /** |
|
2556 @SYMTestCaseID BA-CTSY-LINC-LNMLSC-00011 |
|
2557 @SYMComponent telephony_ctsy |
|
2558 @SYMTestCaseDesc Test support in CTSY for RMobileLine::NotifyMobileLineStatusChange for fax lines |
|
2559 @SYMTestPriority High |
|
2560 @SYMTestActions Invokes RMobileLine::NotifyMobileLineStatusChange for fax lines |
|
2561 @SYMTestExpectedResults Pass |
|
2562 @SYMTestType CT |
|
2563 */ |
|
2564 void CCTsyLineControlFU::TestNotifyMobileLineStatusChange00011L() |
|
2565 { |
|
2566 |
|
2567 OpenEtelServerL(EUseExtendedError); |
|
2568 CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
|
2569 OpenPhoneL(); |
|
2570 |
|
2571 RBuf8 data; |
|
2572 CleanupClosePushL(data); |
|
2573 |
|
2574 RMobileLine mobileLine; |
|
2575 TInt err = mobileLine.Open(iPhone, KMmTsyFaxLineName); |
|
2576 ASSERT_EQUALS(KErrNone, err); |
|
2577 CleanupClosePushL(mobileLine); |
|
2578 |
|
2579 //------------------------------------------------------------------------- |
|
2580 // TEST C: Successful completion request of |
|
2581 // RMobileLine::NotifyMobileLineStatusChange when result is not cached. |
|
2582 //------------------------------------------------------------------------- |
|
2583 TRequestStatus reqStatus; |
|
2584 RMobileCall::TMobileCallStatus callStatus; |
|
2585 |
|
2586 // set notification |
|
2587 mobileLine.NotifyMobileLineStatusChange(reqStatus, callStatus); |
|
2588 |
|
2589 //------- change MobileLineStatus ----------------------------------------- |
|
2590 TRequestStatus mockLtsyStatus; |
|
2591 iMockLTSY.NotifyTerminated(mockLtsyStatus); |
|
2592 TInt callId(1); |
|
2593 RMobilePhone::TMobileService mobileService = RMobilePhone::EFaxService; |
|
2594 RMobileCall::TMobileCallInfoV1 mobileCallInfo; |
|
2595 mobileCallInfo.iCallId = callId; |
|
2596 mobileCallInfo.iService = mobileService; |
|
2597 mobileCallInfo.iStatus = RMobileCall::EStatusConnecting; |
|
2598 |
|
2599 TMockLtsyCallData1<RMobileCall::TMobileCallInfoV1> mockCallData1(callId, mobileService, mobileCallInfo); |
|
2600 mockCallData1.SerialiseL(data); |
|
2601 iMockLTSY.CompleteL(EMobileCallGetMobileCallInfo, KErrNone, data); |
|
2602 |
|
2603 User::WaitForRequest(mockLtsyStatus); |
|
2604 ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int()); |
|
2605 //------------------------------------------------------------------------- |
|
2606 |
|
2607 // wait for notification |
|
2608 User::WaitForRequest(reqStatus); |
|
2609 ASSERT_EQUALS(KErrNone, reqStatus.Int()); |
|
2610 ASSERT_EQUALS(RMobileCall::EStatusDialling, callStatus); |
|
2611 |
|
2612 AssertMockLtsyStatusL(); |
|
2613 CleanupStack::PopAndDestroy(3, this); //mobileLine, data, this |
|
2614 |
|
2615 } |
|
2616 |
|
2617 |
|
2618 /** |
|
2619 @SYMTestCaseID BA-CTSY-LINC-LNMLSC-00012 |
|
2620 @SYMComponent telephony_ctsy |
|
2621 @SYMTestCaseDesc Test support in CTSY for cancelling of RMobileLine::NotifyMobileLineStatusChange for fax lines |
|
2622 @SYMTestPriority High |
|
2623 @SYMTestActions Invokes cancelling of RMobileLine::NotifyMobileLineStatusChange for fax lines |
|
2624 @SYMTestExpectedResults Pass |
|
2625 @SYMTestType CT |
|
2626 */ |
|
2627 void CCTsyLineControlFU::TestNotifyMobileLineStatusChange00012L() |
|
2628 { |
|
2629 |
|
2630 // This test should test cancellation of NotifyMobileLineStatusChange |
|
2631 // If this API does not have a cancel, the test step should be completely removed. |
|
2632 |
|
2633 OpenEtelServerL(EUseExtendedError); |
|
2634 CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
|
2635 OpenPhoneL(); |
|
2636 |
|
2637 RMobileLine mobileLine; |
|
2638 TInt err = mobileLine.Open(iPhone, KMmTsyFaxLineName); |
|
2639 ASSERT_EQUALS(KErrNone, err); |
|
2640 CleanupClosePushL(mobileLine); |
|
2641 |
|
2642 TRequestStatus reqStatus; |
|
2643 RMobileCall::TMobileCallStatus callStatus; |
|
2644 |
|
2645 //------------------------------------------------------------------------- |
|
2646 // Test cancelling of RMobileLine::NotifyMobileLineStatusChange |
|
2647 //------------------------------------------------------------------------- |
|
2648 |
|
2649 // set notification |
|
2650 mobileLine.NotifyMobileLineStatusChange(reqStatus, callStatus); |
|
2651 |
|
2652 // cancelling of RMobileLine::NotifyMobileLineStatusChange |
|
2653 mobileLine.CancelAsyncRequest(EMobileLineNotifyMobileLineStatusChange); |
|
2654 |
|
2655 User::WaitForRequest(reqStatus); |
|
2656 ASSERT_EQUALS(KErrCancel, reqStatus.Int()); |
|
2657 |
|
2658 AssertMockLtsyStatusL(); |
|
2659 CleanupStack::PopAndDestroy(2, this); //mobileLine, this |
|
2660 |
|
2661 } |
|
2662 |
|
2663 /** |
|
2664 @SYMTestCaseID BA-CTSY-LINC-LNMLSC-00014 |
|
2665 @SYMComponent telephony_ctsy |
|
2666 @SYMTestCaseDesc Test support in CTSY for multiple client requests to RMobileLine::NotifyMobileLineStatusChange for fax lines |
|
2667 @SYMTestPriority High |
|
2668 @SYMTestActions Invokes multiple client requests to RMobileLine::NotifyMobileLineStatusChange for fax lines |
|
2669 @SYMTestExpectedResults Pass |
|
2670 @SYMTestType CT |
|
2671 */ |
|
2672 void CCTsyLineControlFU::TestNotifyMobileLineStatusChange00014L() |
|
2673 { |
|
2674 OpenEtelServerL(EUseExtendedError); |
|
2675 CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
|
2676 OpenPhoneL(); |
|
2677 |
|
2678 RBuf8 data; |
|
2679 CleanupClosePushL(data); |
|
2680 |
|
2681 // Open second client |
|
2682 RTelServer telServer2; |
|
2683 TInt ret = telServer2.Connect(); |
|
2684 ASSERT_EQUALS(KErrNone, ret); |
|
2685 CleanupClosePushL(telServer2); |
|
2686 |
|
2687 RMobilePhone phone2; |
|
2688 ret = phone2.Open(telServer2,KMmTsyPhoneName); |
|
2689 ASSERT_EQUALS(KErrNone, ret); |
|
2690 CleanupClosePushL(phone2); |
|
2691 |
|
2692 RMobileLine mobileLine; |
|
2693 TInt err = mobileLine.Open(iPhone, KMmTsyFaxLineName); |
|
2694 ASSERT_EQUALS(KErrNone, err); |
|
2695 CleanupClosePushL(mobileLine); |
|
2696 |
|
2697 RMobileLine mobileLine2; |
|
2698 err = mobileLine2.Open(phone2, KMmTsyFaxLineName); |
|
2699 ASSERT_EQUALS(KErrNone, err); |
|
2700 CleanupClosePushL(mobileLine2); |
|
2701 |
|
2702 //------------------------------------------------------------------------- |
|
2703 // Test A: Test multiple clients requesting RMobileLine::NotifyMobileLineStatusChange |
|
2704 //------------------------------------------------------------------------- |
|
2705 |
|
2706 // set first notification |
|
2707 TRequestStatus reqStatus; |
|
2708 RMobileCall::TMobileCallStatus callStatus; |
|
2709 mobileLine.NotifyMobileLineStatusChange(reqStatus, callStatus); |
|
2710 |
|
2711 // set second notification |
|
2712 TRequestStatus reqStatus2; |
|
2713 RMobileCall::TMobileCallStatus callStatus2; |
|
2714 mobileLine2.NotifyMobileLineStatusChange(reqStatus2, callStatus2); |
|
2715 |
|
2716 //------- change MobileLineStatus ----------------------------------------- |
|
2717 TRequestStatus mockLtsyStatus; |
|
2718 iMockLTSY.NotifyTerminated(mockLtsyStatus); |
|
2719 TInt callId(1); |
|
2720 RMobilePhone::TMobileService mobileService = RMobilePhone::EFaxService; |
|
2721 RMobileCall::TMobileCallInfoV1 mobileCallInfo; |
|
2722 mobileCallInfo.iCallId = callId; |
|
2723 mobileCallInfo.iService = mobileService; |
|
2724 mobileCallInfo.iStatus = RMobileCall::EStatusConnected; |
|
2725 |
|
2726 TMockLtsyCallData1<RMobileCall::TMobileCallInfoV1> mockCallData1(callId, mobileService, mobileCallInfo); |
|
2727 mockCallData1.SerialiseL(data); |
|
2728 iMockLTSY.CompleteL(EMobileCallGetMobileCallInfo, KErrNone, data); |
|
2729 |
|
2730 User::WaitForRequest(mockLtsyStatus); |
|
2731 ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int()); |
|
2732 //------------------------------------------------------------------------- |
|
2733 |
|
2734 // wait for first notification |
|
2735 User::WaitForRequest(reqStatus); |
|
2736 ASSERT_EQUALS(KErrNone, reqStatus.Int()); |
|
2737 ASSERT_EQUALS(RMobileCall::EStatusDialling, callStatus); |
|
2738 |
|
2739 // wait for second notification |
|
2740 User::WaitForRequest(reqStatus2); |
|
2741 ASSERT_EQUALS(KErrNone, reqStatus2.Int()); |
|
2742 ASSERT_EQUALS(RMobileCall::EStatusDialling, callStatus2); |
|
2743 |
|
2744 AssertMockLtsyStatusL(); |
|
2745 // Done ! |
|
2746 CleanupStack::PopAndDestroy(6, this); // mobileLine2, mobileLine, phone2, telServer2, data, this |
|
2747 |
|
2748 } |
|
2749 |
|
2750 |
|
2751 |
|
2752 |