|
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 // Test step definitions for the CallOwnership functional unit. |
|
15 // |
|
16 // |
|
17 |
|
18 /** |
|
19 @internalTechnology |
|
20 */ |
|
21 |
|
22 #include "cctsyintegrationtestcallownership.h" |
|
23 |
|
24 |
|
25 |
|
26 |
|
27 CCTSYIntegrationTestCallOwnershipBase::CCTSYIntegrationTestCallOwnershipBase(CEtelSessionMgr& aEtelSessionMgr) |
|
28 : CCTSYIntegrationTestSuiteStepBase(aEtelSessionMgr), iNetworkTestHelper(*this) |
|
29 /** |
|
30 * Constructor |
|
31 */ |
|
32 { |
|
33 } |
|
34 |
|
35 CCTSYIntegrationTestCallOwnershipBase::~CCTSYIntegrationTestCallOwnershipBase() |
|
36 /* |
|
37 * Destructor |
|
38 */ |
|
39 { |
|
40 } |
|
41 |
|
42 |
|
43 CCTSYIntegrationTestCallOwnership0001::CCTSYIntegrationTestCallOwnership0001(CEtelSessionMgr& aEtelSessionMgr) |
|
44 : CCTSYIntegrationTestCallOwnershipBase(aEtelSessionMgr) |
|
45 /** |
|
46 * Constructor. |
|
47 */ |
|
48 { |
|
49 SetTestStepName(CCTSYIntegrationTestCallOwnership0001::GetTestStepName()); |
|
50 } |
|
51 |
|
52 CCTSYIntegrationTestCallOwnership0001::~CCTSYIntegrationTestCallOwnership0001() |
|
53 /** |
|
54 * Destructor. |
|
55 */ |
|
56 { |
|
57 } |
|
58 |
|
59 TVerdict CCTSYIntegrationTestCallOwnership0001::doTestStepL() |
|
60 /** |
|
61 * @SYMTestCaseID BA-CTSY-INT-COWN-0001 |
|
62 * @SYMFssID BA/CTSY/COWN-0001 |
|
63 * @SYMTestCaseDesc Check that call ownership is not supported for voice calls. |
|
64 * @SYMTestPriority High |
|
65 * @SYMTestActions RCall::TransferOwnership, RCall::GetOwnershipStatus |
|
66 * @SYMTestExpectedResults Pass - KErrNotSupported returned. |
|
67 * @SYMTestType CIT |
|
68 * @SYMTestCaseDependencies live/automatic |
|
69 * |
|
70 * Reason for test: Verify KErrNotSupported is returned. |
|
71 * |
|
72 * @return - TVerdict code |
|
73 */ |
|
74 { |
|
75 |
|
76 // |
|
77 // SET UP |
|
78 // |
|
79 |
|
80 RMobilePhone& mobilePhone = iEtelSessionMgr.GetPhoneL(KMainServer, KMainPhone); |
|
81 |
|
82 // Call TNetworkTsyTestHelper::WaitForRegisteredOnHomeNetworkL |
|
83 CHECK_EQUALS_L(iNetworkTestHelper.WaitForRegisteredOnHomeNetworkL(mobilePhone), KErrNone, _L("TNetworkTsyTestHelper::WaitForRegisteredOnHomeNetworkL returned with an error")); |
|
84 |
|
85 // Get voice line 1. |
|
86 RMobileLine& mobileLine= iEtelSessionMgr.GetLineL(KMainServer, KMainPhone, KVoiceLine); |
|
87 |
|
88 // Get call 1. |
|
89 RMobileCall& mobileCall= iEtelSessionMgr.GetCallL(KMainServer, KMainPhone, KVoiceLine, KCall1); |
|
90 |
|
91 // |
|
92 // SET UP END |
|
93 // |
|
94 |
|
95 StartTest(); |
|
96 |
|
97 // |
|
98 // TEST START |
|
99 // |
|
100 |
|
101 // Check RCall::GetOwnershipStatus for call 1 returns EOwnershipUnowned |
|
102 RCall::TOwnershipStatus ownershipStatus; |
|
103 |
|
104 ASSERT_EQUALS(mobileCall.GetOwnershipStatus(ownershipStatus), KErrNone, _L("RCall::GetOwnershipStatus returned incorrect value")); |
|
105 ASSERT_EQUALS(ownershipStatus, RCall::EOwnershipUnowned, _L("RCall::GetOwnershipStatus returned incorrect value")); |
|
106 |
|
107 // Check RCall::TransferOwnership for call 1 returns KErrNotSupported |
|
108 ASSERT_EQUALS(mobileCall.TransferOwnership(), KErrNotSupported, _L("RCall::TransferOwnership returned incorrect value")); |
|
109 |
|
110 // Check RCall::AcquireOwnership for call 1 returns KErrNotSupported |
|
111 TCoreEtelRequestStatus<RCall> acquireOwnershipStatus(mobileCall, &RCall::AcquireOwnershipCancel); |
|
112 CleanupStack::PushL(acquireOwnershipStatus); |
|
113 |
|
114 mobileCall.AcquireOwnership(acquireOwnershipStatus); |
|
115 |
|
116 ASSERT_EQUALS(WaitForRequestWithTimeOut(acquireOwnershipStatus, ETimeShort), KErrNone, _L("RCall::AcquireOwnership timed-out")); |
|
117 ASSERT_EQUALS(acquireOwnershipStatus.Int(), KErrNotSupported, _L("RCall::AcquireOwnership returned with an incorrect error")); |
|
118 |
|
119 // |
|
120 // TEST END |
|
121 // |
|
122 |
|
123 StartCleanup(); |
|
124 |
|
125 CleanupStack::PopAndDestroy(&acquireOwnershipStatus); |
|
126 |
|
127 return TestStepResult(); |
|
128 } |
|
129 |
|
130 TPtrC CCTSYIntegrationTestCallOwnership0001::GetTestStepName() |
|
131 /** |
|
132 * @return The test step name. |
|
133 */ |
|
134 { |
|
135 return _L("CCTSYIntegrationTestCallOwnership0001"); |
|
136 } |
|
137 |
|
138 |
|
139 |
|
140 CCTSYIntegrationTestCallOwnership0002::CCTSYIntegrationTestCallOwnership0002(CEtelSessionMgr& aEtelSessionMgr) |
|
141 : CCTSYIntegrationTestCallOwnershipBase(aEtelSessionMgr) |
|
142 /** |
|
143 * Constructor. |
|
144 */ |
|
145 { |
|
146 SetTestStepName(CCTSYIntegrationTestCallOwnership0002::GetTestStepName()); |
|
147 } |
|
148 |
|
149 CCTSYIntegrationTestCallOwnership0002::~CCTSYIntegrationTestCallOwnership0002() |
|
150 /** |
|
151 * Destructor. |
|
152 */ |
|
153 { |
|
154 } |
|
155 |
|
156 TVerdict CCTSYIntegrationTestCallOwnership0002::doTestStepL() |
|
157 /** |
|
158 * @SYMTestCaseID BA-CTSY-INT-COWN-0002 |
|
159 * @SYMFssID BA/CTSY/COWN-0002 |
|
160 * @SYMTestCaseDesc Acquire ownership of a data and fax call when call owner closes subsession. |
|
161 * @SYMTestPriority High |
|
162 * @SYMTestActions RCall::TransferOwnership, RCall::Dial, RCall::HangUp, RCall::GetOwnershipStatus |
|
163 * @SYMTestExpectedResults Pass - Call 2 acquires ownership of the call. |
|
164 * @SYMTestType CIT |
|
165 * @SYMTestCaseDependencies live/automatic |
|
166 * |
|
167 * Reason for test: Verify call ownership acquired. |
|
168 * |
|
169 * @return - TVerdict code |
|
170 */ |
|
171 { |
|
172 |
|
173 // |
|
174 // SET UP |
|
175 // |
|
176 |
|
177 |
|
178 // Get data line 1. |
|
179 |
|
180 // Get call 1. |
|
181 |
|
182 // Get data line 2 on alternate server. |
|
183 |
|
184 // Get call 2 on the alternate server. Call 2 should open existing call with call 1's name. |
|
185 |
|
186 |
|
187 // |
|
188 // SET UP END |
|
189 // |
|
190 |
|
191 StartTest(); |
|
192 |
|
193 // |
|
194 // TEST START |
|
195 // |
|
196 |
|
197 |
|
198 // === Call 1 dials, then call 2 requests ownership === |
|
199 |
|
200 // Dial a number that answers using call 1 |
|
201 |
|
202 // Check RCall::GetOwnershipStatus on call 1 returns EOwnershipOwnedByThisClient |
|
203 |
|
204 // Call RCall::AcquireOwnership on call 2. |
|
205 |
|
206 // === Close call 1 without hanging-up === |
|
207 |
|
208 // Release call 1 subsession |
|
209 |
|
210 // === Check ownership transfer is successfull === |
|
211 |
|
212 // Check RCall::AcquireOwnership on call 2 completes with KErrNone |
|
213 |
|
214 // Check RCall::GetOwnershipStatus on call 2 returns EOwnershipOwnedByThisClient |
|
215 |
|
216 // Hang up on call 2. |
|
217 |
|
218 // Repeat test with a fax call. |
|
219 |
|
220 |
|
221 // |
|
222 // TEST END |
|
223 // |
|
224 |
|
225 StartCleanup(); |
|
226 |
|
227 // Put any required test clean up here, then remove this comment |
|
228 |
|
229 return TestStepResult(); |
|
230 } |
|
231 |
|
232 TPtrC CCTSYIntegrationTestCallOwnership0002::GetTestStepName() |
|
233 /** |
|
234 * @return The test step name. |
|
235 */ |
|
236 { |
|
237 return _L("CCTSYIntegrationTestCallOwnership0002"); |
|
238 } |
|
239 |
|
240 |
|
241 |
|
242 CCTSYIntegrationTestCallOwnership0003::CCTSYIntegrationTestCallOwnership0003(CEtelSessionMgr& aEtelSessionMgr) |
|
243 : CCTSYIntegrationTestCallOwnershipBase(aEtelSessionMgr) |
|
244 /** |
|
245 * Constructor. |
|
246 */ |
|
247 { |
|
248 SetTestStepName(CCTSYIntegrationTestCallOwnership0003::GetTestStepName()); |
|
249 } |
|
250 |
|
251 CCTSYIntegrationTestCallOwnership0003::~CCTSYIntegrationTestCallOwnership0003() |
|
252 /** |
|
253 * Destructor. |
|
254 */ |
|
255 { |
|
256 } |
|
257 |
|
258 TVerdict CCTSYIntegrationTestCallOwnership0003::doTestStepL() |
|
259 /** |
|
260 * @SYMTestCaseID BA-CTSY-INT-COWN-0003 |
|
261 * @SYMFssID BA/CTSY/COWN-0003 |
|
262 * @SYMTestCaseDesc Transfer ownership of a data and fax call. |
|
263 * @SYMTestPriority High |
|
264 * @SYMTestActions RCall::TransferOwnership, RCall::Dial, RCall::HangUp, RCall::GetOwnershipStatus |
|
265 * @SYMTestExpectedResults Pass - Call ownership transferred by call owner when another client is interested. |
|
266 * @SYMTestType CIT |
|
267 * @SYMTestCaseDependencies live/automatic |
|
268 * |
|
269 * Reason for test: Verify ownership can only be transferred by call owner when another client is interested. |
|
270 * |
|
271 * @return - TVerdict code |
|
272 */ |
|
273 { |
|
274 |
|
275 // |
|
276 // SET UP |
|
277 // |
|
278 |
|
279 |
|
280 // Get data line 1. |
|
281 |
|
282 // Get call 1. |
|
283 |
|
284 // Get data line 2 on alternate server. |
|
285 |
|
286 // Get call 2 on the alternate server. Call 2 should open existing call with call 1's name. |
|
287 |
|
288 |
|
289 // |
|
290 // SET UP END |
|
291 // |
|
292 |
|
293 StartTest(); |
|
294 |
|
295 // |
|
296 // TEST START |
|
297 // |
|
298 |
|
299 |
|
300 // === call 1 dials, then call 2 requests ownership === |
|
301 |
|
302 // Dial a number that answers using call 1 |
|
303 |
|
304 // Check RCall::GetOwnershipStatus on call 1 returns EOwnershipOwnedByThisClient |
|
305 |
|
306 // === Call 1 transfers ownership when client is not interested === |
|
307 |
|
308 // Check RCall::TransferOwnership() on call 1 returns KErrEtelNoClientInterestedInThisCall |
|
309 |
|
310 // === Call 2 attempts to transfer ownership when it is not call owner === |
|
311 |
|
312 // Check RCall::TransferOwnership on call 2 returns KErrEtelNotCallOwner |
|
313 |
|
314 // Call RCall::AcquireOwnership on call 2 |
|
315 |
|
316 // === Call 1 transfers ownership when client is interested === |
|
317 |
|
318 // Check RCall::TransferOwnership() on call 1 returns KErrNone |
|
319 |
|
320 // === Check ownership transfer is successfull === |
|
321 |
|
322 // Check RCall::AcquireOwnership on call 2 completes with KErrNone |
|
323 |
|
324 // Check RCall::GetOwnershipStatus on call 2 returns EOwnershipOwnedByThisClient |
|
325 // Check RCall::GetOwnershipStatus on call 1 returns EOwnershipOwnedByAnotherClient |
|
326 |
|
327 // === call 2 has ownership. Hang up call === |
|
328 |
|
329 // Hang up call 2. |
|
330 |
|
331 // Repeat test with a fax call. |
|
332 |
|
333 |
|
334 // |
|
335 // TEST END |
|
336 // |
|
337 |
|
338 StartCleanup(); |
|
339 |
|
340 // Put any required test clean up here, then remove this comment |
|
341 |
|
342 return TestStepResult(); |
|
343 } |
|
344 |
|
345 TPtrC CCTSYIntegrationTestCallOwnership0003::GetTestStepName() |
|
346 /** |
|
347 * @return The test step name. |
|
348 */ |
|
349 { |
|
350 return _L("CCTSYIntegrationTestCallOwnership0003"); |
|
351 } |
|
352 |
|
353 |
|
354 |
|
355 CCTSYIntegrationTestCallOwnership0004::CCTSYIntegrationTestCallOwnership0004(CEtelSessionMgr& aEtelSessionMgr) |
|
356 : CCTSYIntegrationTestCallOwnershipBase(aEtelSessionMgr) |
|
357 /** |
|
358 * Constructor. |
|
359 */ |
|
360 { |
|
361 SetTestStepName(CCTSYIntegrationTestCallOwnership0004::GetTestStepName()); |
|
362 } |
|
363 |
|
364 CCTSYIntegrationTestCallOwnership0004::~CCTSYIntegrationTestCallOwnership0004() |
|
365 /** |
|
366 * Destructor. |
|
367 */ |
|
368 { |
|
369 } |
|
370 |
|
371 TVerdict CCTSYIntegrationTestCallOwnership0004::doTestStepL() |
|
372 /** |
|
373 * @SYMTestCaseID BA-CTSY-INT-COWN-0004 |
|
374 * @SYMFssID BA/CTSY/COWN-0004 |
|
375 * @SYMTestCaseDesc Cancel acquire ownership of a data and fax call. |
|
376 * @SYMTestPriority High |
|
377 * @SYMTestActions RCall::AcquireOwnership, RCall::AcquireOwnershipCancel, RCall::GetOwnershipStatus |
|
378 * @SYMTestExpectedResults Pass - Acquire ownership request cancelled. |
|
379 * @SYMTestType CIT |
|
380 * @SYMTestCaseDependencies live/automatic |
|
381 * |
|
382 * Reason for test: Verify KErrCancel returned. |
|
383 * |
|
384 * @return - TVerdict code |
|
385 */ |
|
386 { |
|
387 |
|
388 // |
|
389 // SET UP |
|
390 // |
|
391 |
|
392 |
|
393 // Get data line 1. |
|
394 |
|
395 // Get call 1. |
|
396 |
|
397 // Get data line 2 on alternate server. |
|
398 |
|
399 // Get call 2 on the alternate server. Call 2 should open existing call with call 1's name. |
|
400 |
|
401 |
|
402 // |
|
403 // SET UP END |
|
404 // |
|
405 |
|
406 StartTest(); |
|
407 |
|
408 // |
|
409 // TEST START |
|
410 // |
|
411 |
|
412 |
|
413 // Dial a number that answers using lcall1 and dialReqStatus |
|
414 |
|
415 // Call RCall::AcquireOwnership on call 2 |
|
416 |
|
417 // Check RCall::AcquireOwnershipCancel on call 2 completes with KErrCancel |
|
418 |
|
419 // Check RCall::GetOwnershipStatus on call 1 returns EOwnershipOwnedByThisClient |
|
420 // Check RCall::GetOwnershipStatus on call 2 returns EOwnershipOwnedByAnotherClient |
|
421 |
|
422 |
|
423 // |
|
424 // TEST END |
|
425 // |
|
426 |
|
427 StartCleanup(); |
|
428 |
|
429 // Put any required test clean up here, then remove this comment |
|
430 |
|
431 return TestStepResult(); |
|
432 } |
|
433 |
|
434 TPtrC CCTSYIntegrationTestCallOwnership0004::GetTestStepName() |
|
435 /** |
|
436 * @return The test step name. |
|
437 */ |
|
438 { |
|
439 return _L("CCTSYIntegrationTestCallOwnership0004"); |
|
440 } |
|
441 |
|
442 |
|
443 |
|
444 CCTSYIntegrationTestCallOwnership0005::CCTSYIntegrationTestCallOwnership0005(CEtelSessionMgr& aEtelSessionMgr) |
|
445 : CCTSYIntegrationTestCallOwnershipBase(aEtelSessionMgr) |
|
446 /** |
|
447 * Constructor. |
|
448 */ |
|
449 { |
|
450 SetTestStepName(CCTSYIntegrationTestCallOwnership0005::GetTestStepName()); |
|
451 } |
|
452 |
|
453 CCTSYIntegrationTestCallOwnership0005::~CCTSYIntegrationTestCallOwnership0005() |
|
454 /** |
|
455 * Destructor. |
|
456 */ |
|
457 { |
|
458 } |
|
459 |
|
460 TVerdict CCTSYIntegrationTestCallOwnership0005::doTestStepL() |
|
461 /** |
|
462 * @SYMTestCaseID BA-CTSY-INT-COWN-0005 |
|
463 * @SYMFssID BA/CTSY/COWN-0005 |
|
464 * @SYMTestCaseDesc Cancel transfer ownership of a data and fax call. |
|
465 * @SYMTestPriority High |
|
466 * @SYMTestActions RCall::AcquireOwnership, RCall::TransferOwnership, RCall::TransferOwnershipCancel |
|
467 * @SYMTestExpectedResults Pass - Transfer ownership cancelled. |
|
468 * @SYMTestType CIT |
|
469 * @SYMTestCaseDependencies live/automatic |
|
470 * |
|
471 * Reason for test: Verify KErrCancel returned. |
|
472 * |
|
473 * @return - TVerdict code |
|
474 */ |
|
475 { |
|
476 |
|
477 // |
|
478 // SET UP |
|
479 // |
|
480 |
|
481 |
|
482 // Get data line 1. |
|
483 |
|
484 // Get call 1. |
|
485 |
|
486 // Get data line 2 on alternate server. |
|
487 |
|
488 // Get call 2 on the alternate server. Call 2 should open existing call with call 1's name. |
|
489 |
|
490 |
|
491 // |
|
492 // SET UP END |
|
493 // |
|
494 |
|
495 StartTest(); |
|
496 |
|
497 // |
|
498 // TEST START |
|
499 // |
|
500 |
|
501 |
|
502 // Dial a number that answers using lcall1 and dialReqStatus |
|
503 |
|
504 // Call RCall::AcquireOwnership on call 2 |
|
505 |
|
506 // Call RCall::TransferOwnership on call 1. |
|
507 |
|
508 // Call RCall::TransferOwnershipCancel on call 1 completes with KErrCancel | KErrNone |
|
509 |
|
510 |
|
511 // |
|
512 // TEST END |
|
513 // |
|
514 |
|
515 StartCleanup(); |
|
516 |
|
517 // Put any required test clean up here, then remove this comment |
|
518 |
|
519 return TestStepResult(); |
|
520 } |
|
521 |
|
522 TPtrC CCTSYIntegrationTestCallOwnership0005::GetTestStepName() |
|
523 /** |
|
524 * @return The test step name. |
|
525 */ |
|
526 { |
|
527 return _L("CCTSYIntegrationTestCallOwnership0005"); |
|
528 } |
|
529 |
|
530 |
|
531 |