|
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 // |
|
15 |
|
16 #include "tcallcontroltsytesthelper.h" |
|
17 #include "cctsytestlogging.h" |
|
18 |
|
19 |
|
20 |
|
21 /** |
|
22 * Constructor |
|
23 */ |
|
24 TCallControlTsyTestHelper::TCallControlTsyTestHelper(CCTSYIntegrationTestSuiteStepBase& aTestStep) |
|
25 : TTsyTestHelperBase( aTestStep ) |
|
26 { |
|
27 } |
|
28 /** |
|
29 * Notify reset for RCall::NotifyCapsChange |
|
30 */ |
|
31 void TCallControlTsyTestHelper::WaitForCallNotifyCapsChange( |
|
32 RCall& aCall, |
|
33 TEtelRequestBase& aRequestStatus, |
|
34 RCall::TCaps& aCaps, |
|
35 RCall::TCaps aWantedCaps, |
|
36 RCall::TCaps aUnwantedCaps, |
|
37 TInt aWantedStatus ) |
|
38 |
|
39 { |
|
40 // Wait for the request to complete |
|
41 TInt err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeShort); |
|
42 ASSERT_EQUALS(err, KErrNone, _L("RCall::NotifyCapsChange did not complete")) |
|
43 |
|
44 while ( err == KErrNone && aRequestStatus.Int() == KErrNone |
|
45 && ( ((aCaps.iFlags & aWantedCaps.iFlags) != aWantedCaps.iFlags) |
|
46 || ((aCaps.iFlags & aUnwantedCaps.iFlags) != 0) ) ) |
|
47 { |
|
48 // Request has completed with incorrect result. Consume any outstanding |
|
49 // Repost notification until timeout or we get the right result. |
|
50 aCall.NotifyCapsChange(aRequestStatus, aCaps); |
|
51 err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeShort); |
|
52 } |
|
53 |
|
54 ASSERT_EQUALS(aRequestStatus.Int(), aWantedStatus, |
|
55 _L("RCall::NotifyCapsChange Wrong completion status")) |
|
56 ASSERT_BITS_SET(aCaps.iFlags, aWantedCaps.iFlags, aUnwantedCaps.iFlags, |
|
57 _L("RCall::NotifyCapsChange Wrong caps")) |
|
58 |
|
59 // Cancel request if it is still pending |
|
60 if (aRequestStatus.Int() == KRequestPending) |
|
61 { |
|
62 aRequestStatus.Cancel(); |
|
63 } |
|
64 } |
|
65 |
|
66 |
|
67 /** |
|
68 * Notify reset for RCall::NotifyCallDurationChange |
|
69 */ |
|
70 void TCallControlTsyTestHelper::WaitForCallNotifyCallDurationChange( |
|
71 RCall& aCall, |
|
72 TEtelRequestBase& aRequestStatus, |
|
73 TTimeIntervalSeconds& aTime, |
|
74 TTimeIntervalSeconds aExpectedTime, |
|
75 TInt aWantedStatus ) |
|
76 |
|
77 { |
|
78 // Wait for the request to complete |
|
79 TInt err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeShort); |
|
80 ASSERT_EQUALS(err, KErrNone, _L("RCall::NotifyCallDurationChange did not complete")) |
|
81 |
|
82 while ( err == KErrNone && aRequestStatus.Int() == KErrNone |
|
83 && aTime != aExpectedTime ) |
|
84 { |
|
85 // Request has completed with incorrect result. Consume any outstanding |
|
86 // Repost notification until timeout or we get the right result. |
|
87 |
|
88 aCall.NotifyCallDurationChange(aRequestStatus, aTime); |
|
89 err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeShort); |
|
90 } |
|
91 |
|
92 ASSERT_EQUALS(aRequestStatus.Int(), aWantedStatus, _L("RCall::NotifyCallDurationChange Wrong completion status")) |
|
93 ASSERT_EQUALS(aTime.Int(), aExpectedTime.Int(), |
|
94 _L("RCall::NotifyCallDurationChange Wrong result")) |
|
95 |
|
96 // Cancel request if it is still pending |
|
97 if (aRequestStatus.Int() == KRequestPending) |
|
98 { |
|
99 aRequestStatus.Cancel(); |
|
100 } |
|
101 } |
|
102 |
|
103 |
|
104 /** |
|
105 * Notify reset for RCall::NotifyHookChange |
|
106 */ |
|
107 void TCallControlTsyTestHelper::WaitForCallNotifyHookChange( |
|
108 RCall& aCall, |
|
109 TEtelRequestBase& aRequestStatus, |
|
110 RCall::THookStatus& aHookStatus, |
|
111 RCall::THookStatus aExpectedHookStatus, |
|
112 TInt aWantedStatus ) |
|
113 |
|
114 { |
|
115 // Wait for the request to complete |
|
116 TInt err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeShort); |
|
117 ASSERT_EQUALS(err, KErrNone, _L("RCall::NotifyHookChange did not complete")) |
|
118 |
|
119 while ( err == KErrNone && aRequestStatus.Int() == KErrNone |
|
120 && aHookStatus != aExpectedHookStatus ) |
|
121 { |
|
122 // Request has completed with incorrect result. Consume any outstanding |
|
123 // Repost notification until timeout or we get the right result. |
|
124 |
|
125 aCall.NotifyHookChange(aRequestStatus, aHookStatus); |
|
126 err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeShort); |
|
127 } |
|
128 |
|
129 ASSERT_EQUALS(aRequestStatus.Int(), aWantedStatus, _L("RCall::NotifyHookChange Wrong completion status")) |
|
130 ASSERT_EQUALS(aHookStatus, aExpectedHookStatus, |
|
131 _L("RCall::NotifyHookChange Wrong result")) |
|
132 |
|
133 // Cancel request if it is still pending |
|
134 if (aRequestStatus.Int() == KRequestPending) |
|
135 { |
|
136 aRequestStatus.Cancel(); |
|
137 } |
|
138 } |
|
139 |
|
140 |
|
141 /** |
|
142 * Notify reset for RCall::NotifyStatusChange |
|
143 */ |
|
144 void TCallControlTsyTestHelper::WaitForCallNotifyStatusChange( |
|
145 RCall& aCall, |
|
146 TEtelRequestBase& aRequestStatus, |
|
147 RCall::TStatus& aCallStatus, |
|
148 RCall::TStatus& aExpectedCallStatus, |
|
149 TInt aWantedStatus ) |
|
150 |
|
151 { |
|
152 // Wait for the request to complete |
|
153 TInt err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeMedium); |
|
154 ASSERT_EQUALS(err, KErrNone, _L("RCall::NotifyStatusChange did not complete")) |
|
155 |
|
156 while ( err == KErrNone && aRequestStatus.Int() == KErrNone |
|
157 && aCallStatus != aExpectedCallStatus ) |
|
158 { |
|
159 // Request has completed with incorrect result. Consume any outstanding |
|
160 // Repost notification until timeout or we get the right result. |
|
161 |
|
162 aCall.NotifyStatusChange(aRequestStatus, aCallStatus); |
|
163 err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeMedium); |
|
164 } |
|
165 |
|
166 ASSERT_EQUALS(aRequestStatus.Int(), aWantedStatus, _L("RCall::NotifyStatusChange Wrong completion status")) |
|
167 ASSERT_EQUALS(aCallStatus, aExpectedCallStatus, |
|
168 _L("RCall::NotifyStatusChange Wrong result")) |
|
169 |
|
170 // Cancel request if it is still pending |
|
171 if (aRequestStatus.Int() == KRequestPending) |
|
172 { |
|
173 aRequestStatus.Cancel(); |
|
174 } |
|
175 } |
|
176 |
|
177 |
|
178 /** |
|
179 * Notify reset for RLine::NotifyCapsChange |
|
180 */ |
|
181 void TCallControlTsyTestHelper::WaitForLineNotifyCapsChange( |
|
182 RLine& aLine, |
|
183 TEtelRequestBase& aRequestStatus, |
|
184 RLine::TCaps& aCaps, |
|
185 RLine::TCaps aWantedCaps, |
|
186 RLine::TCaps aUnwantedCaps, |
|
187 TInt aWantedStatus ) |
|
188 |
|
189 { |
|
190 // Wait for the request to complete |
|
191 TInt err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeShort); |
|
192 ASSERT_EQUALS(err, KErrNone, _L("RLine::NotifyCapsChange did not complete")) |
|
193 |
|
194 while ( err == KErrNone && aRequestStatus.Int() == KErrNone |
|
195 && ( ((aCaps.iFlags & aWantedCaps.iFlags) != aWantedCaps.iFlags) |
|
196 || ((aCaps.iFlags & aUnwantedCaps.iFlags) != 0) ) ) |
|
197 { |
|
198 // Request has completed with incorrect result. Consume any outstanding |
|
199 // Repost notification until timeout or we get the right result. |
|
200 aLine.NotifyCapsChange(aRequestStatus, aCaps); |
|
201 err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeShort); |
|
202 } |
|
203 |
|
204 ASSERT_EQUALS(aRequestStatus.Int(), aWantedStatus, |
|
205 _L("RLine::NotifyCapsChange Wrong completion status")) |
|
206 ASSERT_BITS_SET(aCaps.iFlags, aWantedCaps.iFlags, aUnwantedCaps.iFlags, |
|
207 _L("RLine::NotifyCapsChange Wrong caps")) |
|
208 |
|
209 // Cancel request if it is still pending |
|
210 if (aRequestStatus.Int() == KRequestPending) |
|
211 { |
|
212 aRequestStatus.Cancel(); |
|
213 } |
|
214 } |
|
215 |
|
216 |
|
217 /** |
|
218 * Notify reset for RLine::NotifyCallAdded |
|
219 */ |
|
220 void TCallControlTsyTestHelper::WaitForLineNotifyCallAdded( |
|
221 RLine& aLine, |
|
222 TEtelRequestBase& aRequestStatus, |
|
223 TName& aName, |
|
224 TName aExpectedName, |
|
225 TInt aWantedStatus ) |
|
226 |
|
227 { |
|
228 // Wait for the request to complete |
|
229 TInt err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeShort); |
|
230 ASSERT_EQUALS(err, KErrNone, _L("RLine::NotifyCallAdded did not complete")) |
|
231 |
|
232 while ( err == KErrNone && aRequestStatus.Int() == KErrNone |
|
233 && aName != aExpectedName ) |
|
234 { |
|
235 // Request has completed with incorrect result. Consume any outstanding |
|
236 // Repost notification until timeout or we get the right result. |
|
237 |
|
238 aLine.NotifyCallAdded(aRequestStatus, aName); |
|
239 err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeShort); |
|
240 } |
|
241 |
|
242 ASSERT_EQUALS(aRequestStatus.Int(), aWantedStatus, _L("RLine::NotifyCallAdded Wrong completion status")) |
|
243 ASSERT_EQUALS_DES16(aName, aExpectedName, |
|
244 _L("RLine::NotifyCallAdded Wrong result")) |
|
245 |
|
246 // Cancel request if it is still pending |
|
247 if (aRequestStatus.Int() == KRequestPending) |
|
248 { |
|
249 aRequestStatus.Cancel(); |
|
250 } |
|
251 } |
|
252 |
|
253 |
|
254 /** |
|
255 * Notify reset for RLine::NotifyHookChange |
|
256 */ |
|
257 void TCallControlTsyTestHelper::WaitForLineNotifyHookChange( |
|
258 RLine& aLine, |
|
259 TEtelRequestBase& aRequestStatus, |
|
260 RCall::THookStatus& aHookStatus, |
|
261 RCall::THookStatus aExpectedHookStatus, |
|
262 TInt aWantedStatus ) |
|
263 |
|
264 { |
|
265 // Wait for the request to complete |
|
266 TInt err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeShort); |
|
267 ASSERT_EQUALS(err, KErrNone, _L("RLine::NotifyHookChange did not complete")) |
|
268 |
|
269 while ( err == KErrNone && aRequestStatus.Int() == KErrNone |
|
270 && aHookStatus != aExpectedHookStatus ) |
|
271 { |
|
272 // Request has completed with incorrect result. Consume any outstanding |
|
273 // Repost notification until timeout or we get the right result. |
|
274 |
|
275 aLine.NotifyHookChange(aRequestStatus, aHookStatus); |
|
276 err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeShort); |
|
277 } |
|
278 |
|
279 ASSERT_EQUALS(aRequestStatus.Int(), aWantedStatus, _L("RLine::NotifyHookChange Wrong completion status")) |
|
280 ASSERT_EQUALS(aHookStatus, aExpectedHookStatus, |
|
281 _L("RLine::NotifyHookChange Wrong result")) |
|
282 |
|
283 // Cancel request if it is still pending |
|
284 if (aRequestStatus.Int() == KRequestPending) |
|
285 { |
|
286 aRequestStatus.Cancel(); |
|
287 } |
|
288 } |
|
289 |
|
290 |
|
291 /** |
|
292 * Notify reset for RLine::NotifyStatusChange |
|
293 */ |
|
294 void TCallControlTsyTestHelper::WaitForLineNotifyStatusChange( |
|
295 RLine& aLine, |
|
296 TEtelRequestBase& aRequestStatus, |
|
297 RCall::TStatus& aLineStatus, |
|
298 RCall::TStatus& aExpectedLineStatus, |
|
299 TInt aWantedStatus ) |
|
300 |
|
301 { |
|
302 // Wait for the request to complete |
|
303 TInt err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeVeryLong); |
|
304 ASSERT_EQUALS(err, KErrNone, _L("RLine::NotifyStatusChange did not complete")) |
|
305 |
|
306 while ( err == KErrNone && aRequestStatus.Int() == KErrNone |
|
307 && aLineStatus != aExpectedLineStatus ) |
|
308 { |
|
309 // Request has completed with incorrect result. Consume any outstanding |
|
310 // Repost notification until timeout or we get the right result. |
|
311 |
|
312 aLine.NotifyStatusChange(aRequestStatus, aLineStatus); |
|
313 err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeVeryLong); |
|
314 } |
|
315 |
|
316 ASSERT_EQUALS(aRequestStatus.Int(), aWantedStatus, _L("RLine::NotifyStatusChange Wrong completion status")) |
|
317 ASSERT_EQUALS(aLineStatus, aExpectedLineStatus, |
|
318 _L("RLine::NotifyStatusChange Wrong result")) |
|
319 |
|
320 // Cancel request if it is still pending |
|
321 if (aRequestStatus.Int() == KRequestPending) |
|
322 { |
|
323 aRequestStatus.Cancel(); |
|
324 } |
|
325 } |
|
326 |
|
327 |
|
328 /** |
|
329 * Notify reset for RLine::NotifyIncomingCall |
|
330 */ |
|
331 void TCallControlTsyTestHelper::WaitForLineNotifyIncomingCall( |
|
332 RLine& aLine, |
|
333 TEtelRequestBase& aRequestStatus, |
|
334 TName& aName, |
|
335 TName aExpectedName, |
|
336 TInt aWantedStatus ) |
|
337 |
|
338 { |
|
339 // Wait for the request to complete |
|
340 TInt err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeMedium); |
|
341 ASSERT_EQUALS(err, KErrNone, _L("RLine::NotifyIncomingCall did not complete")); |
|
342 |
|
343 DEBUG_PRINTF2(_L("Name returned is: %S"), &aName); |
|
344 |
|
345 while ( err == KErrNone && aRequestStatus.Int() == KErrNone |
|
346 && aName != aExpectedName ) |
|
347 { |
|
348 // Request has completed with incorrect result. Consume any outstanding |
|
349 // Repost notification until timeout or we get the right result. |
|
350 |
|
351 aLine.NotifyIncomingCall(aRequestStatus, aName); |
|
352 err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeMedium); |
|
353 } |
|
354 |
|
355 ASSERT_EQUALS(aRequestStatus.Int(), aWantedStatus, _L("RLine::NotifyIncomingCall Wrong completion status")) |
|
356 ASSERT_EQUALS_DES16(aName, aExpectedName, |
|
357 _L("RLine::NotifyIncomingCall Wrong result")) |
|
358 |
|
359 // Cancel request if it is still pending |
|
360 if (aRequestStatus.Int() == KRequestPending) |
|
361 { |
|
362 aRequestStatus.Cancel(); |
|
363 } |
|
364 } |
|
365 |
|
366 |
|
367 /** |
|
368 * Notify reset for RPhone::NotifyCapsChange |
|
369 */ |
|
370 void TCallControlTsyTestHelper::WaitForPhoneNotifyCapsChange( |
|
371 RPhone& aPhone, |
|
372 TEtelRequestBase& aRequestStatus, |
|
373 RPhone::TCaps& aCaps, |
|
374 RPhone::TCaps aWantedCaps, |
|
375 RPhone::TCaps aUnwantedCaps, |
|
376 TInt aWantedStatus ) |
|
377 |
|
378 { |
|
379 // Wait for the request to complete |
|
380 TInt err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeShort); |
|
381 ASSERT_EQUALS(err, KErrNone, _L("RPhone::NotifyCapsChange did not complete")) |
|
382 |
|
383 while ( err == KErrNone && aRequestStatus.Int() == KErrNone |
|
384 && ( ((aCaps.iFlags & aWantedCaps.iFlags) != aWantedCaps.iFlags) |
|
385 || ((aCaps.iFlags & aUnwantedCaps.iFlags) != 0) ) ) |
|
386 { |
|
387 // Request has completed with incorrect result. Consume any outstanding |
|
388 // Repost notification until timeout or we get the right result. |
|
389 aPhone.NotifyCapsChange(aRequestStatus, aCaps); |
|
390 err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeShort); |
|
391 } |
|
392 |
|
393 ASSERT_EQUALS(aRequestStatus.Int(), aWantedStatus, |
|
394 _L("RPhone::NotifyCapsChange Wrong completion status")) |
|
395 ASSERT_BITS_SET(aCaps.iFlags, aWantedCaps.iFlags, aUnwantedCaps.iFlags, |
|
396 _L("RPhone::NotifyCapsChange Wrong caps")) |
|
397 |
|
398 // Cancel request if it is still pending |
|
399 if (aRequestStatus.Int() == KRequestPending) |
|
400 { |
|
401 aRequestStatus.Cancel(); |
|
402 } |
|
403 } |
|
404 |
|
405 |
|
406 /** |
|
407 * Notify reset for RPhone::NotifyModemDetected |
|
408 */ |
|
409 void TCallControlTsyTestHelper::WaitForPhoneNotifyModemDetected( |
|
410 RPhone& aPhone, |
|
411 TEtelRequestBase& aRequestStatus, |
|
412 RPhone::TModemDetection& aDetection, |
|
413 RPhone::TModemDetection aExpectedDetection, |
|
414 TInt aWantedStatus ) |
|
415 |
|
416 { |
|
417 // Wait for the request to complete |
|
418 TInt err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeShort); |
|
419 ASSERT_EQUALS(err, KErrNone, _L("RPhone::NotifyModemDetected did not complete")) |
|
420 |
|
421 while ( err == KErrNone && aRequestStatus.Int() == KErrNone |
|
422 && aDetection != aExpectedDetection ) |
|
423 { |
|
424 // Request has completed with incorrect result. Consume any outstanding |
|
425 // Repost notification until timeout or we get the right result. |
|
426 |
|
427 aPhone.NotifyModemDetected(aRequestStatus, aDetection); |
|
428 err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeShort); |
|
429 } |
|
430 |
|
431 ASSERT_EQUALS(aRequestStatus.Int(), aWantedStatus, _L("RPhone::NotifyModemDetected Wrong completion status")) |
|
432 ASSERT_EQUALS(aDetection, aExpectedDetection, |
|
433 _L("RPhone::NotifyModemDetected Wrong result")) |
|
434 |
|
435 // Cancel request if it is still pending |
|
436 if (aRequestStatus.Int() == KRequestPending) |
|
437 { |
|
438 aRequestStatus.Cancel(); |
|
439 } |
|
440 } |
|
441 |
|
442 |
|
443 /** |
|
444 * Notify reset for RMobileCall::NotifyAlternatingCallSwitch |
|
445 */ |
|
446 void TCallControlTsyTestHelper::WaitForMobileCallNotifyAlternatingCallSwitch( |
|
447 TEtelRequestBase& aRequestStatus, |
|
448 TInt aWantedStatus ) |
|
449 |
|
450 { |
|
451 // Wait for the request to complete |
|
452 TInt err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeShort); |
|
453 ASSERT_EQUALS(err, KErrNone, _L("RMobileCall::NotifyAlternatingCallSwitch did not complete")) |
|
454 ASSERT_EQUALS(aRequestStatus.Int(), aWantedStatus, _L("RMobileCall::NotifyAlternatingCallSwitch Wrong completion status")) |
|
455 // Cancel request if it is still pending |
|
456 if (aRequestStatus.Int() == KRequestPending) |
|
457 { |
|
458 aRequestStatus.Cancel(); |
|
459 } |
|
460 } |
|
461 |
|
462 |
|
463 /** |
|
464 * Notify reset for RMobileCall::NotifyAudioToneEvent |
|
465 */ |
|
466 void TCallControlTsyTestHelper::WaitForMobileCallNotifyAudioToneEvent( |
|
467 RMobileCall& aMobileCall, |
|
468 TEtelRequestBase& aRequestStatus, |
|
469 TCmpBase<RMobileCall::TAudioToneV3> &aAudioToneV3, |
|
470 TInt aWantedStatus ) |
|
471 |
|
472 { |
|
473 // Wait for the request to complete |
|
474 TInt err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeShort); |
|
475 ASSERT_EQUALS(err, KErrNone, _L("RMobileCall::NotifyAudioToneEvent did not complete")) |
|
476 |
|
477 while ( err == KErrNone && aRequestStatus.Int() == KErrNone |
|
478 && !aAudioToneV3.IsEqual(ENoLogError) ) |
|
479 { |
|
480 // Request has completed with incorrect result. Consume any outstanding |
|
481 // Repost notification until timeout or we get the right result. |
|
482 RMobileCall::TAudioToneV3Pckg pkgParam( aAudioToneV3.GetValue() ); |
|
483 aMobileCall.NotifyAudioToneEvent(aRequestStatus, pkgParam); |
|
484 err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeShort); |
|
485 } |
|
486 |
|
487 ASSERT_EQUALS(aRequestStatus.Int(), aWantedStatus, _L("RMobileCall::NotifyAudioToneEvent Wrong completion status")) |
|
488 ASSERT_TRUE(aAudioToneV3.IsEqual(ELogError), |
|
489 _L("RMobileCall::NotifyAudioToneEvent Wrong result")) |
|
490 |
|
491 // Cancel request if it is still pending |
|
492 if (aRequestStatus.Int() == KRequestPending) |
|
493 { |
|
494 aRequestStatus.Cancel(); |
|
495 } |
|
496 } |
|
497 |
|
498 |
|
499 /** |
|
500 * Notify reset for RMobileCall::NotifyCallEvent |
|
501 */ |
|
502 void TCallControlTsyTestHelper::WaitForMobileCallNotifyCallEvent( |
|
503 RMobileCall& aMobileCall, |
|
504 TEtelRequestBase& aRequestStatus, |
|
505 RMobileCall::TMobileCallEvent& aEvent, |
|
506 RMobileCall::TMobileCallEvent aExpectedEvent, |
|
507 TInt aWantedStatus ) |
|
508 |
|
509 { |
|
510 // Wait for the request to complete |
|
511 TInt err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeMedium); |
|
512 ASSERT_EQUALS(err, KErrNone, _L("RMobileCall::NotifyCallEvent did not complete")) |
|
513 |
|
514 while ( err == KErrNone && aRequestStatus.Int() == KErrNone |
|
515 && aEvent != aExpectedEvent ) |
|
516 { |
|
517 // Request has completed with incorrect result. Consume any outstanding |
|
518 // Repost notification until timeout or we get the right result. |
|
519 |
|
520 aMobileCall.NotifyCallEvent(aRequestStatus, aEvent); |
|
521 err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeShort); |
|
522 } |
|
523 |
|
524 ASSERT_EQUALS(aRequestStatus.Int(), aWantedStatus, _L("RMobileCall::NotifyCallEvent Wrong completion status")) |
|
525 ASSERT_EQUALS(aEvent, aExpectedEvent, |
|
526 _L("RMobileCall::NotifyCallEvent Wrong result")) |
|
527 |
|
528 // Cancel request if it is still pending |
|
529 if (aRequestStatus.Int() == KRequestPending) |
|
530 { |
|
531 aRequestStatus.Cancel(); |
|
532 } |
|
533 } |
|
534 |
|
535 |
|
536 /** |
|
537 * Notify reset for RMobileCall::NotifyHscsdInfoChange |
|
538 */ |
|
539 void TCallControlTsyTestHelper::WaitForMobileCallNotifyHscsdInfoChange( |
|
540 RMobileCall& aMobileCall, |
|
541 TEtelRequestBase& aRequestStatus, |
|
542 TCmpBase<RMobileCall::TMobileCallHscsdInfoV1> &aMobileCallHscsdInfoV1, |
|
543 TInt aWantedStatus ) |
|
544 |
|
545 { |
|
546 // Wait for the request to complete |
|
547 TInt err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeShort); |
|
548 ASSERT_EQUALS(err, KErrNone, _L("RMobileCall::NotifyHscsdInfoChange did not complete")) |
|
549 |
|
550 while ( err == KErrNone && aRequestStatus.Int() == KErrNone |
|
551 && !aMobileCallHscsdInfoV1.IsEqual(ENoLogError) ) |
|
552 { |
|
553 // Request has completed with incorrect result. Consume any outstanding |
|
554 // Repost notification until timeout or we get the right result. |
|
555 RMobileCall::TMobileCallHscsdInfoV1Pckg pkgParam( aMobileCallHscsdInfoV1.GetValue() ); |
|
556 aMobileCall.NotifyHscsdInfoChange(aRequestStatus, pkgParam); |
|
557 err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeShort); |
|
558 } |
|
559 |
|
560 ASSERT_EQUALS(aRequestStatus.Int(), aWantedStatus, _L("RMobileCall::NotifyHscsdInfoChange Wrong completion status")) |
|
561 ASSERT_TRUE(aMobileCallHscsdInfoV1.IsEqual(ELogError), |
|
562 _L("RMobileCall::NotifyHscsdInfoChange Wrong result")) |
|
563 |
|
564 // Cancel request if it is still pending |
|
565 if (aRequestStatus.Int() == KRequestPending) |
|
566 { |
|
567 aRequestStatus.Cancel(); |
|
568 } |
|
569 } |
|
570 |
|
571 |
|
572 /** |
|
573 * Notify reset for RMobileCall::NotifyMobileCallCapsChange |
|
574 */ |
|
575 void TCallControlTsyTestHelper::WaitForMobileCallNotifyMobileCallCapsChange( |
|
576 RMobileCall& aMobileCall, |
|
577 TEtelRequestBase& aRequestStatus, |
|
578 TCmpRMobileCallTMobileCallCaps &aMobileCallCapsV1, |
|
579 TInt aWantedStatus ) |
|
580 |
|
581 { |
|
582 // Wait for the request to complete |
|
583 TInt err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeLong); |
|
584 ASSERT_EQUALS(err, KErrNone, _L("RMobileCall::NotifyMobileCallCapsChange did not complete")) |
|
585 |
|
586 while ( err == KErrNone && aRequestStatus.Int() == KErrNone |
|
587 && !aMobileCallCapsV1.IsEqual(ENoLogError) ) |
|
588 { |
|
589 // Request has completed with incorrect result. Consume any outstanding |
|
590 // Repost notification until timeout or we get the right result. |
|
591 RMobileCall::TMobileCallCapsV1Pckg pkgParam( aMobileCallCapsV1.GetValue() ); |
|
592 aMobileCall.NotifyMobileCallCapsChange(aRequestStatus, pkgParam); |
|
593 err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeVeryLong); |
|
594 } |
|
595 |
|
596 ASSERT_EQUALS(aRequestStatus.Int(), aWantedStatus, _L("RMobileCall::NotifyMobileCallCapsChange Wrong completion status")) |
|
597 ASSERT_TRUE(aMobileCallCapsV1.IsEqual(ELogError), |
|
598 _L("RMobileCall::NotifyMobileCallCapsChange Wrong result")) |
|
599 |
|
600 // Cancel request if it is still pending |
|
601 if (aRequestStatus.Int() == KRequestPending) |
|
602 { |
|
603 aRequestStatus.Cancel(); |
|
604 } |
|
605 } |
|
606 |
|
607 |
|
608 /** |
|
609 * Notify reset for RMobileCall::NotifyMobileCallStatusChange |
|
610 */ |
|
611 void TCallControlTsyTestHelper::WaitForMobileCallNotifyMobileCallStatusChange( |
|
612 RMobileCall& aMobileCall, |
|
613 TEtelRequestBase& aRequestStatus, |
|
614 RMobileCall::TMobileCallStatus& aStatus, |
|
615 RMobileCall::TMobileCallStatus aExpectedStatus, |
|
616 TInt aWantedStatus ) |
|
617 |
|
618 { |
|
619 // Wait for the request to complete |
|
620 TInt err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeLong); |
|
621 ASSERT_EQUALS(err, KErrNone, _L("RMobileCall::NotifyMobileCallStatusChange did not complete")) |
|
622 |
|
623 while ( err == KErrNone && aRequestStatus.Int() == KErrNone |
|
624 && aStatus != aExpectedStatus ) |
|
625 { |
|
626 |
|
627 // Request has completed with incorrect result. Consume any outstanding |
|
628 // Repost notification until timeout or we get the right result. |
|
629 |
|
630 aMobileCall.NotifyMobileCallStatusChange(aRequestStatus, aStatus); |
|
631 err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeLong); |
|
632 } |
|
633 |
|
634 ASSERT_EQUALS(aRequestStatus.Int(), aWantedStatus, _L("RMobileCall::NotifyMobileCallStatusChange Wrong completion status")) |
|
635 ASSERT_EQUALS(aStatus, aExpectedStatus, |
|
636 _L("RMobileCall::NotifyMobileCallStatusChange Wrong result")) |
|
637 |
|
638 // Cancel request if it is still pending |
|
639 if (aRequestStatus.Int() == KRequestPending) |
|
640 { |
|
641 aRequestStatus.Cancel(); |
|
642 } |
|
643 } |
|
644 |
|
645 |
|
646 /** |
|
647 * Notify reset for RMobileCall::NotifyMobileDataCallCapsChange |
|
648 */ |
|
649 void TCallControlTsyTestHelper::WaitForMobileCallNotifyMobileDataCallCapsChange( |
|
650 RMobileCall& aMobileCall, |
|
651 TEtelRequestBase& aRequestStatus, |
|
652 TCmpBase<RMobileCall::TMobileCallDataCapsV1> &aMobileCallDataCapsV1, |
|
653 TInt aWantedStatus ) |
|
654 |
|
655 { |
|
656 // Wait for the request to complete |
|
657 TInt err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeShort); |
|
658 ASSERT_EQUALS(err, KErrNone, _L("RMobileCall::NotifyMobileDataCallCapsChange did not complete")) |
|
659 |
|
660 while ( err == KErrNone && aRequestStatus.Int() == KErrNone |
|
661 && !aMobileCallDataCapsV1.IsEqual(ENoLogError) ) |
|
662 { |
|
663 // Request has completed with incorrect result. Consume any outstanding |
|
664 // Repost notification until timeout or we get the right result. |
|
665 RMobileCall::TMobileCallDataCapsV1Pckg pkgParam( aMobileCallDataCapsV1.GetValue() ); |
|
666 aMobileCall.NotifyMobileDataCallCapsChange(aRequestStatus, pkgParam); |
|
667 err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeShort); |
|
668 } |
|
669 |
|
670 ASSERT_EQUALS(aRequestStatus.Int(), aWantedStatus, _L("RMobileCall::NotifyMobileDataCallCapsChange Wrong completion status")) |
|
671 ASSERT_TRUE(aMobileCallDataCapsV1.IsEqual(ELogError), |
|
672 _L("RMobileCall::NotifyMobileDataCallCapsChange Wrong result")) |
|
673 |
|
674 // Cancel request if it is still pending |
|
675 if (aRequestStatus.Int() == KRequestPending) |
|
676 { |
|
677 aRequestStatus.Cancel(); |
|
678 } |
|
679 } |
|
680 |
|
681 |
|
682 /** |
|
683 * Notify reset for RMobileCall::NotifyUUSCapsChange |
|
684 */ |
|
685 void TCallControlTsyTestHelper::WaitForMobileCallNotifyUUSCapsChange( |
|
686 RMobileCall& aMobileCall, |
|
687 TEtelRequestBase& aRequestStatus, |
|
688 TUint32& aCaps, |
|
689 TUint32 aWantedCaps, |
|
690 TUint32 aUnwantedCaps, |
|
691 TInt aWantedStatus ) |
|
692 |
|
693 { |
|
694 // Wait for the request to complete |
|
695 TInt err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeShort); |
|
696 ASSERT_EQUALS(err, KErrNone, _L("RMobileCall::NotifyUUSCapsChange did not complete")) |
|
697 |
|
698 while ( err == KErrNone && aRequestStatus.Int() == KErrNone |
|
699 && ( ((aCaps & aWantedCaps) != aWantedCaps) |
|
700 || ((aCaps & aUnwantedCaps) != 0) ) ) |
|
701 { |
|
702 // Request has completed with incorrect result. Consume any outstanding |
|
703 // Repost notification until timeout or we get the right result. |
|
704 aMobileCall.NotifyUUSCapsChange(aRequestStatus, aCaps); |
|
705 err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeShort); |
|
706 } |
|
707 |
|
708 ASSERT_EQUALS(aRequestStatus.Int(), aWantedStatus, |
|
709 _L("RMobileCall::NotifyUUSCapsChange Wrong completion status")) |
|
710 ASSERT_BITS_SET(aCaps, aWantedCaps, aUnwantedCaps, |
|
711 _L("RMobileCall::NotifyUUSCapsChange Wrong caps")) |
|
712 |
|
713 // Cancel request if it is still pending |
|
714 if (aRequestStatus.Int() == KRequestPending) |
|
715 { |
|
716 aRequestStatus.Cancel(); |
|
717 } |
|
718 } |
|
719 |
|
720 |
|
721 /** |
|
722 * Notify reset for RMobileCall::NotifyVoiceFallback |
|
723 */ |
|
724 void TCallControlTsyTestHelper::WaitForMobileCallNotifyVoiceFallback( |
|
725 RMobileCall& aMobileCall, |
|
726 TEtelRequestBase& aRequestStatus, |
|
727 TName& aCallName, |
|
728 TName aExpectedCallName, |
|
729 TInt aWantedStatus ) |
|
730 |
|
731 { |
|
732 // Wait for the request to complete |
|
733 TInt err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeShort); |
|
734 ASSERT_EQUALS(err, KErrNone, _L("RMobileCall::NotifyVoiceFallback did not complete")) |
|
735 |
|
736 while ( err == KErrNone && aRequestStatus.Int() == KErrNone |
|
737 && aCallName != aExpectedCallName ) |
|
738 { |
|
739 // Request has completed with incorrect result. Consume any outstanding |
|
740 // Repost notification until timeout or we get the right result. |
|
741 |
|
742 aMobileCall.NotifyVoiceFallback(aRequestStatus, aCallName); |
|
743 err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeShort); |
|
744 } |
|
745 |
|
746 ASSERT_EQUALS(aRequestStatus.Int(), aWantedStatus, _L("RMobileCall::NotifyVoiceFallback Wrong completion status")) |
|
747 ASSERT_EQUALS_DES16(aCallName, aExpectedCallName, |
|
748 _L("RMobileCall::NotifyVoiceFallback Wrong result")) |
|
749 |
|
750 // Cancel request if it is still pending |
|
751 if (aRequestStatus.Int() == KRequestPending) |
|
752 { |
|
753 aRequestStatus.Cancel(); |
|
754 } |
|
755 } |
|
756 |
|
757 |
|
758 /** |
|
759 * Notify reset for RMobileCall::NotifyPrivacyConfirmation |
|
760 */ |
|
761 void TCallControlTsyTestHelper::WaitForMobileCallNotifyPrivacyConfirmation( |
|
762 RMobileCall& aMobileCall, |
|
763 TEtelRequestBase& aRequestStatus, |
|
764 RMobilePhone::TMobilePhonePrivacy& aPrivacySetting, |
|
765 RMobilePhone::TMobilePhonePrivacy aExpectedPrivacySetting, |
|
766 TInt aWantedStatus ) |
|
767 |
|
768 { |
|
769 // Wait for the request to complete |
|
770 TInt err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeShort); |
|
771 ASSERT_EQUALS(err, KErrNone, _L("RMobileCall::NotifyPrivacyConfirmation did not complete")) |
|
772 |
|
773 while ( err == KErrNone && aRequestStatus.Int() == KErrNone |
|
774 && aPrivacySetting != aExpectedPrivacySetting ) |
|
775 { |
|
776 // Request has completed with incorrect result. Consume any outstanding |
|
777 // Repost notification until timeout or we get the right result. |
|
778 |
|
779 aMobileCall.NotifyPrivacyConfirmation(aRequestStatus, aPrivacySetting); |
|
780 err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeShort); |
|
781 } |
|
782 |
|
783 ASSERT_EQUALS(aRequestStatus.Int(), aWantedStatus, _L("RMobileCall::NotifyPrivacyConfirmation Wrong completion status")) |
|
784 ASSERT_EQUALS(aPrivacySetting, aExpectedPrivacySetting, |
|
785 _L("RMobileCall::NotifyPrivacyConfirmation Wrong result")) |
|
786 |
|
787 // Cancel request if it is still pending |
|
788 if (aRequestStatus.Int() == KRequestPending) |
|
789 { |
|
790 aRequestStatus.Cancel(); |
|
791 } |
|
792 } |
|
793 |
|
794 |
|
795 /** |
|
796 * Notify reset for RMobileCall::NotifyTrafficChannelConfirmation |
|
797 */ |
|
798 void TCallControlTsyTestHelper::WaitForMobileCallNotifyTrafficChannelConfirmation( |
|
799 RMobileCall& aMobileCall, |
|
800 TEtelRequestBase& aRequestStatus, |
|
801 RMobileCall::TMobileCallTch& aTchType, |
|
802 RMobileCall::TMobileCallTch aExpectedTchType, |
|
803 TInt aWantedStatus ) |
|
804 |
|
805 { |
|
806 // Wait for the request to complete |
|
807 TInt err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeShort); |
|
808 ASSERT_EQUALS(err, KErrNone, _L("RMobileCall::NotifyTrafficChannelConfirmation did not complete")) |
|
809 |
|
810 while ( err == KErrNone && aRequestStatus.Int() == KErrNone |
|
811 && aTchType != aExpectedTchType ) |
|
812 { |
|
813 // Request has completed with incorrect result. Consume any outstanding |
|
814 // Repost notification until timeout or we get the right result. |
|
815 |
|
816 aMobileCall.NotifyTrafficChannelConfirmation(aRequestStatus, aTchType); |
|
817 err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeShort); |
|
818 } |
|
819 |
|
820 ASSERT_EQUALS(aRequestStatus.Int(), aWantedStatus, _L("RMobileCall::NotifyTrafficChannelConfirmation Wrong completion status")) |
|
821 ASSERT_EQUALS(aTchType, aExpectedTchType, |
|
822 _L("RMobileCall::NotifyTrafficChannelConfirmation Wrong result")) |
|
823 |
|
824 // Cancel request if it is still pending |
|
825 if (aRequestStatus.Int() == KRequestPending) |
|
826 { |
|
827 aRequestStatus.Cancel(); |
|
828 } |
|
829 } |
|
830 |
|
831 |
|
832 /** |
|
833 * Notify reset for RMobileCall::NotifyRemotePartyInfoChange |
|
834 */ |
|
835 void TCallControlTsyTestHelper::WaitForMobileCallNotifyRemotePartyInfoChange( |
|
836 RMobileCall& aMobileCall, |
|
837 TEtelRequestBase& aRequestStatus, |
|
838 TCmpBase<RMobileCall::TMobileCallRemotePartyInfoV1> &aMobileCallRemotePartyInfoV1, |
|
839 TInt aWantedStatus ) |
|
840 |
|
841 { |
|
842 // Wait for the request to complete |
|
843 TInt err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeShort); |
|
844 ASSERT_EQUALS(err, KErrNone, _L("RMobileCall::NotifyRemotePartyInfoChange did not complete")) |
|
845 |
|
846 while ( err == KErrNone && aRequestStatus.Int() == KErrNone |
|
847 && !aMobileCallRemotePartyInfoV1.IsEqual(ENoLogError) ) |
|
848 { |
|
849 // Request has completed with incorrect result. Consume any outstanding |
|
850 // Repost notification until timeout or we get the right result. |
|
851 RMobileCall::TMobileCallRemotePartyInfoV1Pckg pkgParam( aMobileCallRemotePartyInfoV1.GetValue() ); |
|
852 aMobileCall.NotifyRemotePartyInfoChange(aRequestStatus, pkgParam); |
|
853 err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeShort); |
|
854 } |
|
855 |
|
856 ASSERT_EQUALS(aRequestStatus.Int(), aWantedStatus, _L("RMobileCall::NotifyRemotePartyInfoChange Wrong completion status")) |
|
857 ASSERT_TRUE(aMobileCallRemotePartyInfoV1.IsEqual(ELogError), |
|
858 _L("RMobileCall::NotifyRemotePartyInfoChange Wrong result")) |
|
859 |
|
860 // Cancel request if it is still pending |
|
861 if (aRequestStatus.Int() == KRequestPending) |
|
862 { |
|
863 aRequestStatus.Cancel(); |
|
864 } |
|
865 } |
|
866 |
|
867 |
|
868 |
|
869 /** |
|
870 * Notify reset for RMobileConferenceCall::NotifyCapsChange |
|
871 */ |
|
872 void TCallControlTsyTestHelper::WaitForMobileConferenceCallNotifyCapsChange( |
|
873 RMobileConferenceCall& aMobileConferenceCall, |
|
874 TEtelRequestBase& aRequestStatus, |
|
875 TUint32& aCaps, |
|
876 TUint32 aWantedCaps, |
|
877 TUint32 aUnwantedCaps, |
|
878 TInt aWantedStatus ) |
|
879 |
|
880 { |
|
881 |
|
882 TEST_FRAMEWORK_LOG2(_L("RMobileConferenceCall::NotifyCapsChange looking for caps %08X"), |
|
883 aWantedCaps ); |
|
884 |
|
885 // Wait for the request to complete |
|
886 TInt err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeMedium); |
|
887 ASSERT_EQUALS(err, KErrNone, _L("RMobileConferenceCall::NotifyCapsChange did not complete")) |
|
888 |
|
889 while ( err == KErrNone && aRequestStatus.Int() == KErrNone |
|
890 && ( ((aCaps & aWantedCaps) != aWantedCaps) |
|
891 || ((aCaps & aUnwantedCaps) != 0) ) ) |
|
892 { |
|
893 // Request has completed with incorrect result. Consume any outstanding |
|
894 // Repost notification until timeout or we get the right result. |
|
895 TEST_FRAMEWORK_LOG2(_L("TCallControlTsyTestHelper::WaitForMobileConferenceCallNotifyCapsChange got caps %08X"), |
|
896 aCaps ); |
|
897 |
|
898 aMobileConferenceCall.NotifyCapsChange(aRequestStatus, aCaps); |
|
899 err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeShort); |
|
900 } |
|
901 |
|
902 ASSERT_EQUALS(aRequestStatus.Int(), aWantedStatus, |
|
903 _L("RMobileConferenceCall::NotifyCapsChange Wrong completion status")) |
|
904 ASSERT_BITS_SET(aCaps, aWantedCaps, aUnwantedCaps, |
|
905 _L("RMobileConferenceCall::NotifyCapsChange Wrong caps")) |
|
906 |
|
907 // Cancel request if it is still pending |
|
908 if (aRequestStatus.Int() == KRequestPending) |
|
909 { |
|
910 aRequestStatus.Cancel(); |
|
911 } |
|
912 } |
|
913 |
|
914 |
|
915 /** |
|
916 * Notify reset for RMobileConferenceCall::NotifyConferenceEvent |
|
917 */ |
|
918 void TCallControlTsyTestHelper::WaitForMobileConferenceCallNotifyConferenceEvent( |
|
919 RMobileConferenceCall& aMobileConferenceCall, |
|
920 TEtelRequestBase& aRequestStatus, |
|
921 RMobileConferenceCall::TMobileConferenceEvent& aEvent, |
|
922 RMobileConferenceCall::TMobileConferenceEvent aExpectedEvent, |
|
923 TName &aCallName, |
|
924 TInt aWantedStatus ) |
|
925 |
|
926 { |
|
927 // Wait for the request to complete |
|
928 TInt err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeMedium); |
|
929 ASSERT_EQUALS(err, KErrNone, _L("RMobileConferenceCall::NotifyConferenceEvent did not complete")) |
|
930 |
|
931 while ( err == KErrNone && aRequestStatus.Int() == KErrNone |
|
932 && aEvent != aExpectedEvent ) |
|
933 { |
|
934 // Request has completed with incorrect result. Consume any outstanding |
|
935 // Repost notification until timeout or we get the right result. |
|
936 TEST_FRAMEWORK_LOG4(_L("TCallControlTsyTestHelper::WaitForMobileConferenceCallNotifyConferenceEvent looking for %d got %d name %S"), |
|
937 aExpectedEvent, aEvent, &aCallName ); |
|
938 |
|
939 aMobileConferenceCall.NotifyConferenceEvent(aRequestStatus, aEvent, aCallName); |
|
940 err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeShort); |
|
941 } |
|
942 |
|
943 ASSERT_EQUALS(aRequestStatus.Int(), aWantedStatus, _L("RMobileConferenceCall::NotifyConferenceEvent Wrong completion status")) |
|
944 ASSERT_EQUALS(aEvent, aExpectedEvent, |
|
945 _L("RMobileConferenceCall::NotifyConferenceEvent Wrong result")) |
|
946 |
|
947 // Cancel request if it is still pending |
|
948 if (aRequestStatus.Int() == KRequestPending) |
|
949 { |
|
950 aRequestStatus.Cancel(); |
|
951 } |
|
952 } |
|
953 |
|
954 |
|
955 /** |
|
956 * Notify reset for RMobileConferenceCall::NotifyConferenceStatusChange |
|
957 */ |
|
958 void TCallControlTsyTestHelper::WaitForMobileConferenceCallNotifyConferenceStatusChange( |
|
959 RMobileConferenceCall& aMobileConferenceCall, |
|
960 TEtelRequestBase& aRequestStatus, |
|
961 RMobileConferenceCall::TMobileConferenceStatus& aStatus, |
|
962 RMobileConferenceCall::TMobileConferenceStatus aExpectedStatus, |
|
963 TInt aWantedStatus ) |
|
964 |
|
965 { |
|
966 TEST_FRAMEWORK_LOG2(_L("RMobileConferenceCall::NotifyConferenceStatusChange looking for %d"), |
|
967 aExpectedStatus ); |
|
968 |
|
969 // Wait for the request to complete |
|
970 TInt err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeMedium); |
|
971 ASSERT_EQUALS(err, KErrNone, _L("RMobileConferenceCall::NotifyConferenceStatusChange did not complete")) |
|
972 |
|
973 while ( err == KErrNone && aRequestStatus.Int() == KErrNone |
|
974 && aStatus != aExpectedStatus ) |
|
975 { |
|
976 // Request has completed with incorrect result. Consume any outstanding |
|
977 // Repost notification until timeout or we get the right result. |
|
978 TEST_FRAMEWORK_LOG2(_L("RMobileConferenceCall::NotifyConferenceStatusChange intermediate %d"), |
|
979 aStatus ); |
|
980 aMobileConferenceCall.NotifyConferenceStatusChange(aRequestStatus, aStatus); |
|
981 err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeShort); |
|
982 } |
|
983 |
|
984 ASSERT_EQUALS(aRequestStatus.Int(), aWantedStatus, _L("RMobileConferenceCall::NotifyConferenceStatusChange Wrong completion status")) |
|
985 ASSERT_EQUALS(aStatus, aExpectedStatus, |
|
986 _L("RMobileConferenceCall::NotifyConferenceStatusChange Wrong result")) |
|
987 |
|
988 // Cancel request if it is still pending |
|
989 if (aRequestStatus.Int() == KRequestPending) |
|
990 { |
|
991 aRequestStatus.Cancel(); |
|
992 } |
|
993 } |
|
994 |
|
995 |
|
996 /** |
|
997 * Notify reset for RMobileLine::NotifyMobileLineStatusChange |
|
998 */ |
|
999 void TCallControlTsyTestHelper::WaitForMobileLineNotifyMobileLineStatusChange( |
|
1000 RMobileLine& aMobileLine, |
|
1001 TEtelRequestBase& aRequestStatus, |
|
1002 RMobileCall::TMobileCallStatus& aStatus, |
|
1003 RMobileCall::TMobileCallStatus aExpectedStatus, |
|
1004 TInt aWantedStatus ) |
|
1005 |
|
1006 { |
|
1007 // Wait for the request to complete |
|
1008 TInt err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeMedium); |
|
1009 ASSERT_EQUALS(err, KErrNone, _L("RMobileLine::NotifyMobileLineStatusChange did not complete")) |
|
1010 |
|
1011 while ( err == KErrNone && aRequestStatus.Int() == KErrNone |
|
1012 && aStatus != aExpectedStatus ) |
|
1013 { |
|
1014 // Request has completed with incorrect result. Consume any outstanding |
|
1015 // Repost notification until timeout or we get the right result. |
|
1016 |
|
1017 aMobileLine.NotifyMobileLineStatusChange(aRequestStatus, aStatus); |
|
1018 err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeShort); |
|
1019 } |
|
1020 |
|
1021 ASSERT_EQUALS(aRequestStatus.Int(), aWantedStatus, _L("RMobileLine::NotifyMobileLineStatusChange Wrong completion status")) |
|
1022 ASSERT_EQUALS(aStatus, aExpectedStatus, |
|
1023 _L("RMobileLine::NotifyMobileLineStatusChange Wrong result")) |
|
1024 |
|
1025 // Cancel request if it is still pending |
|
1026 if (aRequestStatus.Int() == KRequestPending) |
|
1027 { |
|
1028 aRequestStatus.Cancel(); |
|
1029 } |
|
1030 } |
|
1031 |
|
1032 |
|
1033 /** |
|
1034 * Notify reset for RMobilePhone::NotifyALSLineChange |
|
1035 */ |
|
1036 void TCallControlTsyTestHelper::WaitForMobilePhoneNotifyALSLineChange( |
|
1037 RMobilePhone& aMobilePhone, |
|
1038 TEtelRequestBase& aRequestStatus, |
|
1039 RMobilePhone::TMobilePhoneALSLine& aALSLine, |
|
1040 RMobilePhone::TMobilePhoneALSLine aExpectedALSLine, |
|
1041 TInt aWantedStatus ) |
|
1042 |
|
1043 { |
|
1044 // Wait for the request to complete |
|
1045 TInt err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeShort); |
|
1046 ASSERT_EQUALS(err, KErrNone, _L("RMobilePhone::NotifyALSLineChange did not complete")) |
|
1047 |
|
1048 while ( err == KErrNone && aRequestStatus.Int() == KErrNone |
|
1049 && aALSLine != aExpectedALSLine ) |
|
1050 { |
|
1051 // Request has completed with incorrect result. Consume any outstanding |
|
1052 // Repost notification until timeout or we get the right result. |
|
1053 |
|
1054 aMobilePhone.NotifyALSLineChange(aRequestStatus, aALSLine); |
|
1055 err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeShort); |
|
1056 } |
|
1057 |
|
1058 ASSERT_EQUALS(aRequestStatus.Int(), aWantedStatus, _L("RMobilePhone::NotifyALSLineChange Wrong completion status")) |
|
1059 ASSERT_EQUALS(aALSLine, aExpectedALSLine, |
|
1060 _L("RMobilePhone::NotifyALSLineChange Wrong result")) |
|
1061 |
|
1062 // Cancel request if it is still pending |
|
1063 if (aRequestStatus.Int() == KRequestPending) |
|
1064 { |
|
1065 aRequestStatus.Cancel(); |
|
1066 } |
|
1067 } |
|
1068 |
|
1069 |
|
1070 /** |
|
1071 * Notify reset for RMobilePhone::NotifyAlternatingCallCapsChange |
|
1072 */ |
|
1073 void TCallControlTsyTestHelper::WaitForMobilePhoneNotifyAlternatingCallCapsChange( |
|
1074 RMobilePhone& aMobilePhone, |
|
1075 TEtelRequestBase& aRequestStatus, |
|
1076 TUint32& aCaps, |
|
1077 TUint32 aWantedCaps, |
|
1078 TUint32 aUnwantedCaps, |
|
1079 TInt aWantedStatus ) |
|
1080 |
|
1081 { |
|
1082 // Wait for the request to complete |
|
1083 TInt err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeShort); |
|
1084 ASSERT_EQUALS(err, KErrNone, _L("RMobilePhone::NotifyAlternatingCallCapsChange did not complete")) |
|
1085 |
|
1086 while ( err == KErrNone && aRequestStatus.Int() == KErrNone |
|
1087 && ( ((aCaps & aWantedCaps) != aWantedCaps) |
|
1088 || ((aCaps & aUnwantedCaps) != 0) ) ) |
|
1089 { |
|
1090 // Request has completed with incorrect result. Consume any outstanding |
|
1091 // Repost notification until timeout or we get the right result. |
|
1092 aMobilePhone.NotifyAlternatingCallCapsChange(aRequestStatus, aCaps); |
|
1093 err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeShort); |
|
1094 } |
|
1095 |
|
1096 ASSERT_EQUALS(aRequestStatus.Int(), aWantedStatus, |
|
1097 _L("RMobilePhone::NotifyAlternatingCallCapsChange Wrong completion status")) |
|
1098 ASSERT_BITS_SET(aCaps, aWantedCaps, aUnwantedCaps, |
|
1099 _L("RMobilePhone::NotifyAlternatingCallCapsChange Wrong caps")) |
|
1100 |
|
1101 // Cancel request if it is still pending |
|
1102 if (aRequestStatus.Int() == KRequestPending) |
|
1103 { |
|
1104 aRequestStatus.Cancel(); |
|
1105 } |
|
1106 } |
|
1107 |
|
1108 |
|
1109 /** |
|
1110 * Notify reset for RMobilePhone::NotifyAlternatingCallModeChange |
|
1111 */ |
|
1112 void TCallControlTsyTestHelper::WaitForMobilePhoneNotifyAlternatingCallModeChange( |
|
1113 RMobilePhone& aMobilePhone, |
|
1114 TEtelRequestBase& aRequestStatus, |
|
1115 RMobilePhone::TMobilePhoneAlternatingCallMode& aMode, |
|
1116 RMobilePhone::TMobilePhoneAlternatingCallMode aExpectedMode, |
|
1117 RMobilePhone::TMobileService &aFirstService, |
|
1118 TInt aWantedStatus ) |
|
1119 |
|
1120 { |
|
1121 // Wait for the request to complete |
|
1122 TInt err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeShort); |
|
1123 ASSERT_EQUALS(err, KErrNone, _L("RMobilePhone::NotifyAlternatingCallModeChange did not complete")) |
|
1124 |
|
1125 while ( err == KErrNone && aRequestStatus.Int() == KErrNone |
|
1126 && aMode != aExpectedMode ) |
|
1127 { |
|
1128 // Request has completed with incorrect result. Consume any outstanding |
|
1129 // Repost notification until timeout or we get the right result. |
|
1130 |
|
1131 aMobilePhone.NotifyAlternatingCallModeChange(aRequestStatus, aMode, aFirstService); |
|
1132 err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeShort); |
|
1133 } |
|
1134 |
|
1135 ASSERT_EQUALS(aRequestStatus.Int(), aWantedStatus, _L("RMobilePhone::NotifyAlternatingCallModeChange Wrong completion status")) |
|
1136 ASSERT_EQUALS(aMode, aExpectedMode, |
|
1137 _L("RMobilePhone::NotifyAlternatingCallModeChange Wrong result")) |
|
1138 |
|
1139 // Cancel request if it is still pending |
|
1140 if (aRequestStatus.Int() == KRequestPending) |
|
1141 { |
|
1142 aRequestStatus.Cancel(); |
|
1143 } |
|
1144 } |
|
1145 |
|
1146 |
|
1147 /** |
|
1148 * Notify reset for RMobilePhone::NotifyDTMFCapsChange |
|
1149 */ |
|
1150 void TCallControlTsyTestHelper::WaitForMobilePhoneNotifyDTMFCapsChange( |
|
1151 RMobilePhone& aMobilePhone, |
|
1152 TEtelRequestBase& aRequestStatus, |
|
1153 TUint32& aCaps, |
|
1154 TUint32 aWantedCaps, |
|
1155 TUint32 aUnwantedCaps, |
|
1156 TInt aWantedStatus ) |
|
1157 |
|
1158 { |
|
1159 // Wait for the request to complete |
|
1160 TInt err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeMedium); |
|
1161 ASSERT_EQUALS(err, KErrNone, _L("RMobilePhone::NotifyDTMFCapsChange did not complete")) |
|
1162 |
|
1163 while ( err == KErrNone && aRequestStatus.Int() == KErrNone |
|
1164 && ( ((aCaps & aWantedCaps) != aWantedCaps) |
|
1165 || ((aCaps & aUnwantedCaps) != 0) ) ) |
|
1166 { |
|
1167 // Request has completed with incorrect result. Consume any outstanding |
|
1168 // Repost notification until timeout or we get the right result. |
|
1169 aMobilePhone.NotifyDTMFCapsChange(aRequestStatus, aCaps); |
|
1170 err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeShort); |
|
1171 } |
|
1172 |
|
1173 ASSERT_EQUALS(aRequestStatus.Int(), aWantedStatus, |
|
1174 _L("RMobilePhone::NotifyDTMFCapsChange Wrong completion status")) |
|
1175 ASSERT_BITS_SET(aCaps, aWantedCaps, aUnwantedCaps, |
|
1176 _L("RMobilePhone::NotifyDTMFCapsChange Wrong caps")) |
|
1177 |
|
1178 // Cancel request if it is still pending |
|
1179 if (aRequestStatus.Int() == KRequestPending) |
|
1180 { |
|
1181 aRequestStatus.Cancel(); |
|
1182 } |
|
1183 } |
|
1184 |
|
1185 |
|
1186 /** |
|
1187 * Notify reset for RMobilePhone::NotifyDTMFEvent |
|
1188 */ |
|
1189 void TCallControlTsyTestHelper::WaitForMobilePhoneNotifyDTMFEvent( |
|
1190 RMobilePhone& aMobilePhone, |
|
1191 TEtelRequestBase& aRequestStatus, |
|
1192 RMobilePhone::TMobilePhoneDTMFEvent& aEvent, |
|
1193 RMobilePhone::TMobilePhoneDTMFEvent& aExpectedEvent, |
|
1194 TInt aWantedStatus ) |
|
1195 |
|
1196 { |
|
1197 // Wait for the request to complete |
|
1198 TInt err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeShort); |
|
1199 ASSERT_EQUALS(err, KErrNone, _L("RMobilePhone::NotifyDTMFEvent did not complete")) |
|
1200 |
|
1201 while ( err == KErrNone && aRequestStatus.Int() == KErrNone |
|
1202 && aEvent != aExpectedEvent ) |
|
1203 { |
|
1204 // Request has completed with incorrect result. Consume any outstanding |
|
1205 // Repost notification until timeout or we get the right result. |
|
1206 |
|
1207 aMobilePhone.NotifyDTMFEvent(aRequestStatus, aEvent); |
|
1208 err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeShort); |
|
1209 } |
|
1210 |
|
1211 ASSERT_EQUALS(aRequestStatus.Int(), aWantedStatus, _L("RMobilePhone::NotifyDTMFEvent Wrong completion status")) |
|
1212 ASSERT_EQUALS(aEvent, aExpectedEvent, |
|
1213 _L("RMobilePhone::NotifyDTMFEvent Wrong result")) |
|
1214 |
|
1215 // Cancel request if it is still pending |
|
1216 if (aRequestStatus.Int() == KRequestPending) |
|
1217 { |
|
1218 aRequestStatus.Cancel(); |
|
1219 } |
|
1220 } |
|
1221 |
|
1222 |
|
1223 /** |
|
1224 * Notify reset for RMobilePhone::NotifyFdnStatusChange |
|
1225 */ |
|
1226 void TCallControlTsyTestHelper::WaitForMobilePhoneNotifyFdnStatusChange( |
|
1227 RMobilePhone& aMobilePhone, |
|
1228 TEtelRequestBase& aRequestStatus, |
|
1229 RMobilePhone::TMobilePhoneFdnStatus& aFdnStatus, |
|
1230 RMobilePhone::TMobilePhoneFdnStatus aExpectedFdnStatus, |
|
1231 TInt aWantedStatus ) |
|
1232 |
|
1233 { |
|
1234 // Wait for the request to complete |
|
1235 TInt err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeShort); |
|
1236 ASSERT_EQUALS(err, KErrNone, _L("RMobilePhone::NotifyFdnStatusChange did not complete")) |
|
1237 |
|
1238 while ( err == KErrNone && aRequestStatus.Int() == KErrNone |
|
1239 && aFdnStatus != aExpectedFdnStatus ) |
|
1240 { |
|
1241 // Request has completed with incorrect result. Consume any outstanding |
|
1242 // Repost notification until timeout or we get the right result. |
|
1243 |
|
1244 aMobilePhone.NotifyFdnStatusChange(aRequestStatus, aFdnStatus); |
|
1245 err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeShort); |
|
1246 } |
|
1247 |
|
1248 ASSERT_EQUALS(aRequestStatus.Int(), aWantedStatus, _L("RMobilePhone::NotifyFdnStatusChange Wrong completion status")) |
|
1249 ASSERT_EQUALS(aFdnStatus, aExpectedFdnStatus, |
|
1250 _L("RMobilePhone::NotifyFdnStatusChange Wrong result")) |
|
1251 |
|
1252 // Cancel request if it is still pending |
|
1253 if (aRequestStatus.Int() == KRequestPending) |
|
1254 { |
|
1255 aRequestStatus.Cancel(); |
|
1256 } |
|
1257 } |
|
1258 |
|
1259 |
|
1260 /** |
|
1261 * Notify reset for RMobilePhone::NotifyIncomingCallTypeChange |
|
1262 */ |
|
1263 void TCallControlTsyTestHelper::WaitForMobilePhoneNotifyIncomingCallTypeChange( |
|
1264 RMobilePhone& aMobilePhone, |
|
1265 TEtelRequestBase& aRequestStatus, |
|
1266 RMobilePhone::TMobilePhoneIncomingCallType &aCallType, |
|
1267 TCmpBase<RMobileCall::TMobileDataCallParamsV1> &aMobileDataCallParamsV1, |
|
1268 TInt aWantedStatus ) |
|
1269 |
|
1270 { |
|
1271 // Wait for the request to complete |
|
1272 TInt err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeShort); |
|
1273 ASSERT_EQUALS(err, KErrNone, _L("RMobilePhone::NotifyIncomingCallTypeChange did not complete")) |
|
1274 |
|
1275 while ( err == KErrNone && aRequestStatus.Int() == KErrNone |
|
1276 && !aMobileDataCallParamsV1.IsEqual(ENoLogError) ) |
|
1277 { |
|
1278 // Request has completed with incorrect result. Consume any outstanding |
|
1279 // Repost notification until timeout or we get the right result. |
|
1280 RMobileCall::TMobileDataCallParamsV1Pckg pkgParam( aMobileDataCallParamsV1.GetValue() ); |
|
1281 aMobilePhone.NotifyIncomingCallTypeChange(aRequestStatus, aCallType, pkgParam); |
|
1282 err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeShort); |
|
1283 } |
|
1284 |
|
1285 ASSERT_EQUALS(aRequestStatus.Int(), aWantedStatus, _L("RMobilePhone::NotifyIncomingCallTypeChange Wrong completion status")) |
|
1286 ASSERT_TRUE(aMobileDataCallParamsV1.IsEqual(ELogError), |
|
1287 _L("RMobilePhone::NotifyIncomingCallTypeChange Wrong result")) |
|
1288 |
|
1289 // Cancel request if it is still pending |
|
1290 if (aRequestStatus.Int() == KRequestPending) |
|
1291 { |
|
1292 aRequestStatus.Cancel(); |
|
1293 } |
|
1294 } |
|
1295 |
|
1296 |
|
1297 /** |
|
1298 * Notify reset for RMobilePhone::NotifyIndicatorChange |
|
1299 */ |
|
1300 void TCallControlTsyTestHelper::WaitForMobilePhoneNotifyIndicatorChange( |
|
1301 RMobilePhone& aMobilePhone, |
|
1302 TEtelRequestBase& aRequestStatus, |
|
1303 TUint32& aIndicator, |
|
1304 TUint32 aExpectedIndicator, |
|
1305 TInt aWantedStatus ) |
|
1306 |
|
1307 { |
|
1308 // Wait for the request to complete |
|
1309 TInt err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeShort); |
|
1310 ASSERT_EQUALS(err, KErrNone, _L("RMobilePhone::NotifyIndicatorChange did not complete")) |
|
1311 |
|
1312 while ( err == KErrNone && aRequestStatus.Int() == KErrNone |
|
1313 && aIndicator != aExpectedIndicator ) |
|
1314 { |
|
1315 // Request has completed with incorrect result. Consume any outstanding |
|
1316 // Repost notification until timeout or we get the right result. |
|
1317 |
|
1318 aMobilePhone.NotifyIndicatorChange(aRequestStatus, aIndicator); |
|
1319 err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeShort); |
|
1320 } |
|
1321 |
|
1322 ASSERT_EQUALS(aRequestStatus.Int(), aWantedStatus, _L("RMobilePhone::NotifyIndicatorChange Wrong completion status")) |
|
1323 ASSERT_EQUALS(aIndicator, aExpectedIndicator, |
|
1324 _L("RMobilePhone::NotifyIndicatorChange Wrong result")) |
|
1325 |
|
1326 // Cancel request if it is still pending |
|
1327 if (aRequestStatus.Int() == KRequestPending) |
|
1328 { |
|
1329 aRequestStatus.Cancel(); |
|
1330 } |
|
1331 } |
|
1332 |
|
1333 |
|
1334 /** |
|
1335 * Notify reset for RMobilePhone::NotifyMessageWaiting |
|
1336 */ |
|
1337 void TCallControlTsyTestHelper::WaitForMobilePhoneNotifyMessageWaiting( |
|
1338 RMobilePhone& aMobilePhone, |
|
1339 TEtelRequestBase& aRequestStatus, |
|
1340 TInt& aCount, |
|
1341 TInt aExpectedCount, |
|
1342 TInt aWantedStatus ) |
|
1343 |
|
1344 { |
|
1345 // Wait for the request to complete |
|
1346 TInt err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeShort); |
|
1347 ASSERT_EQUALS(err, KErrNone, _L("RMobilePhone::NotifyMessageWaiting did not complete")) |
|
1348 |
|
1349 while ( err == KErrNone && aRequestStatus.Int() == KErrNone |
|
1350 && aCount != aExpectedCount ) |
|
1351 { |
|
1352 // Request has completed with incorrect result. Consume any outstanding |
|
1353 // Repost notification until timeout or we get the right result. |
|
1354 |
|
1355 aMobilePhone.NotifyMessageWaiting(aRequestStatus, aCount); |
|
1356 err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeShort); |
|
1357 } |
|
1358 |
|
1359 ASSERT_EQUALS(aRequestStatus.Int(), aWantedStatus, _L("RMobilePhone::NotifyMessageWaiting Wrong completion status")) |
|
1360 ASSERT_EQUALS(aCount, aExpectedCount, |
|
1361 _L("RMobilePhone::NotifyMessageWaiting Wrong result")) |
|
1362 |
|
1363 // Cancel request if it is still pending |
|
1364 if (aRequestStatus.Int() == KRequestPending) |
|
1365 { |
|
1366 aRequestStatus.Cancel(); |
|
1367 } |
|
1368 } |
|
1369 |
|
1370 |
|
1371 /** |
|
1372 * Notify reset for RMobilePhone::NotifyMulticallIndicatorChange |
|
1373 */ |
|
1374 void TCallControlTsyTestHelper::WaitForMobilePhoneNotifyMulticallIndicatorChange( |
|
1375 RMobilePhone& aMobilePhone, |
|
1376 TEtelRequestBase& aRequestStatus, |
|
1377 RMobilePhone::TMobilePhoneMulticallIndicator& aMulticallIndicator, |
|
1378 RMobilePhone::TMobilePhoneMulticallIndicator aExpectedMulticallIndicator, |
|
1379 TInt aWantedStatus ) |
|
1380 |
|
1381 { |
|
1382 // Wait for the request to complete |
|
1383 TInt err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeShort); |
|
1384 ASSERT_EQUALS(err, KErrNone, _L("RMobilePhone::NotifyMulticallIndicatorChange did not complete")) |
|
1385 |
|
1386 while ( err == KErrNone && aRequestStatus.Int() == KErrNone |
|
1387 && aMulticallIndicator != aExpectedMulticallIndicator ) |
|
1388 { |
|
1389 // Request has completed with incorrect result. Consume any outstanding |
|
1390 // Repost notification until timeout or we get the right result. |
|
1391 |
|
1392 aMobilePhone.NotifyMulticallIndicatorChange(aRequestStatus, aMulticallIndicator); |
|
1393 err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeShort); |
|
1394 } |
|
1395 |
|
1396 ASSERT_EQUALS(aRequestStatus.Int(), aWantedStatus, _L("RMobilePhone::NotifyMulticallIndicatorChange Wrong completion status")) |
|
1397 ASSERT_EQUALS(aMulticallIndicator, aExpectedMulticallIndicator, |
|
1398 _L("RMobilePhone::NotifyMulticallIndicatorChange Wrong result")) |
|
1399 |
|
1400 // Cancel request if it is still pending |
|
1401 if (aRequestStatus.Int() == KRequestPending) |
|
1402 { |
|
1403 aRequestStatus.Cancel(); |
|
1404 } |
|
1405 } |
|
1406 |
|
1407 |
|
1408 /** |
|
1409 * Notify reset for RMobilePhone::NotifyMulticallParamsChange |
|
1410 */ |
|
1411 void TCallControlTsyTestHelper::WaitForMobilePhoneNotifyMulticallParamsChange( |
|
1412 RMobilePhone& aMobilePhone, |
|
1413 TEtelRequestBase& aRequestStatus, |
|
1414 TCmpBase<RMobilePhone::TMobilePhoneMulticallSettingsV1> &aMobilePhoneMulticallSettingsV1, |
|
1415 TInt aWantedStatus ) |
|
1416 |
|
1417 { |
|
1418 // Wait for the request to complete |
|
1419 TInt err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeShort); |
|
1420 ASSERT_EQUALS(err, KErrNone, _L("RMobilePhone::NotifyMulticallParamsChange did not complete")) |
|
1421 |
|
1422 while ( err == KErrNone && aRequestStatus.Int() == KErrNone |
|
1423 && !aMobilePhoneMulticallSettingsV1.IsEqual(ENoLogError) ) |
|
1424 { |
|
1425 // Request has completed with incorrect result. Consume any outstanding |
|
1426 // Repost notification until timeout or we get the right result. |
|
1427 RMobilePhone::TMobilePhoneMulticallSettingsV1Pckg pkgParam( aMobilePhoneMulticallSettingsV1.GetValue() ); |
|
1428 aMobilePhone.NotifyMulticallParamsChange(aRequestStatus, pkgParam); |
|
1429 err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeShort); |
|
1430 } |
|
1431 |
|
1432 ASSERT_EQUALS(aRequestStatus.Int(), aWantedStatus, _L("RMobilePhone::NotifyMulticallParamsChange Wrong completion status")) |
|
1433 ASSERT_TRUE(aMobilePhoneMulticallSettingsV1.IsEqual(ELogError), |
|
1434 _L("RMobilePhone::NotifyMulticallParamsChange Wrong result")) |
|
1435 |
|
1436 // Cancel request if it is still pending |
|
1437 if (aRequestStatus.Int() == KRequestPending) |
|
1438 { |
|
1439 aRequestStatus.Cancel(); |
|
1440 } |
|
1441 } |
|
1442 |
|
1443 |
|
1444 /** |
|
1445 * Notify reset for RMobilePhone::NotifyMultimediaCallPreferenceChange |
|
1446 */ |
|
1447 void TCallControlTsyTestHelper::WaitForMobilePhoneNotifyMultimediaCallPreferenceChange( |
|
1448 RMobilePhone& aMobilePhone, |
|
1449 TEtelRequestBase& aRequestStatus, |
|
1450 RMobilePhone::TMobilePhoneMultimediaSettings& aMmSettings, |
|
1451 RMobilePhone::TMobilePhoneMultimediaSettings aExpectedMmSettings, |
|
1452 TInt aWantedStatus ) |
|
1453 |
|
1454 { |
|
1455 // Wait for the request to complete |
|
1456 TInt err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeShort); |
|
1457 ASSERT_EQUALS(err, KErrNone, _L("RMobilePhone::NotifyMultimediaCallPreferenceChange did not complete")) |
|
1458 |
|
1459 while ( err == KErrNone && aRequestStatus.Int() == KErrNone |
|
1460 && aMmSettings != aExpectedMmSettings ) |
|
1461 { |
|
1462 // Request has completed with incorrect result. Consume any outstanding |
|
1463 // Repost notification until timeout or we get the right result. |
|
1464 |
|
1465 aMobilePhone.NotifyMultimediaCallPreferenceChange(aRequestStatus, aMmSettings); |
|
1466 err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeShort); |
|
1467 } |
|
1468 |
|
1469 ASSERT_EQUALS(aRequestStatus.Int(), aWantedStatus, _L("RMobilePhone::NotifyMultimediaCallPreferenceChange Wrong completion status")) |
|
1470 ASSERT_EQUALS(aMmSettings, aExpectedMmSettings, |
|
1471 _L("RMobilePhone::NotifyMultimediaCallPreferenceChange Wrong result")) |
|
1472 |
|
1473 // Cancel request if it is still pending |
|
1474 if (aRequestStatus.Int() == KRequestPending) |
|
1475 { |
|
1476 aRequestStatus.Cancel(); |
|
1477 } |
|
1478 } |
|
1479 |
|
1480 |
|
1481 /** |
|
1482 * Notify reset for RMobilePhone::NotifyStopInDTMFString |
|
1483 */ |
|
1484 void TCallControlTsyTestHelper::WaitForMobilePhoneNotifyStopInDTMFString( |
|
1485 TEtelRequestBase& aRequestStatus, |
|
1486 TInt aWantedStatus ) |
|
1487 |
|
1488 { |
|
1489 // Wait for the request to complete |
|
1490 TInt err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeShort); |
|
1491 ASSERT_EQUALS(err, KErrNone, _L("RMobilePhone::NotifyStopInDTMFString did not complete")) |
|
1492 ASSERT_EQUALS(aRequestStatus.Int(), aWantedStatus, _L("RMobilePhone::NotifyStopInDTMFString Wrong completion status")) |
|
1493 // Cancel request if it is still pending |
|
1494 if (aRequestStatus.Int() == KRequestPending) |
|
1495 { |
|
1496 aRequestStatus.Cancel(); |
|
1497 } |
|
1498 } |
|
1499 |
|
1500 |
|
1501 /** |
|
1502 * Notify reset for RMobilePhone::NotifyAirTimeDurationChange |
|
1503 */ |
|
1504 void TCallControlTsyTestHelper::WaitForMobilePhoneNotifyAirTimeDurationChange( |
|
1505 RMobilePhone& aMobilePhone, |
|
1506 TEtelRequestBase& aRequestStatus, |
|
1507 TTimeIntervalSeconds& aTime, |
|
1508 TTimeIntervalSeconds aExpectedTime, |
|
1509 TInt aWantedStatus ) |
|
1510 |
|
1511 { |
|
1512 // Wait for the request to complete |
|
1513 TInt err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeShort); |
|
1514 ASSERT_EQUALS(err, KErrNone, _L("RMobilePhone::NotifyAirTimeDurationChange did not complete")) |
|
1515 |
|
1516 while ( err == KErrNone && aRequestStatus.Int() == KErrNone |
|
1517 && aTime != aExpectedTime ) |
|
1518 { |
|
1519 // Request has completed with incorrect result. Consume any outstanding |
|
1520 // Repost notification until timeout or we get the right result. |
|
1521 |
|
1522 aMobilePhone.NotifyAirTimeDurationChange(aRequestStatus, aTime); |
|
1523 err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeShort); |
|
1524 } |
|
1525 |
|
1526 ASSERT_EQUALS(aRequestStatus.Int(), aWantedStatus, _L("RMobilePhone::NotifyAirTimeDurationChange Wrong completion status")) |
|
1527 ASSERT_EQUALS(aTime.Int(), aExpectedTime.Int(), |
|
1528 _L("RMobilePhone::NotifyAirTimeDurationChange Wrong result")) |
|
1529 |
|
1530 // Cancel request if it is still pending |
|
1531 if (aRequestStatus.Int() == KRequestPending) |
|
1532 { |
|
1533 aRequestStatus.Cancel(); |
|
1534 } |
|
1535 } |
|
1536 |
|
1537 |
|
1538 /** |
|
1539 * Notify reset for RMobilePhone::NotifyCostInfoChange |
|
1540 */ |
|
1541 void TCallControlTsyTestHelper::WaitForMobilePhoneNotifyCostInfoChange( |
|
1542 RMobilePhone& aMobilePhone, |
|
1543 TEtelRequestBase& aRequestStatus, |
|
1544 TCmpBase<RMobilePhone::TMobilePhoneCostInfoV1> &aMobilePhoneCostInfoV1, |
|
1545 TInt aWantedStatus ) |
|
1546 |
|
1547 { |
|
1548 // Wait for the request to complete |
|
1549 TInt err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeShort); |
|
1550 ASSERT_EQUALS(err, KErrNone, _L("RMobilePhone::NotifyCostInfoChange did not complete")) |
|
1551 |
|
1552 while ( err == KErrNone && aRequestStatus.Int() == KErrNone |
|
1553 && !aMobilePhoneCostInfoV1.IsEqual(ENoLogError) ) |
|
1554 { |
|
1555 // Request has completed with incorrect result. Consume any outstanding |
|
1556 // Repost notification until timeout or we get the right result. |
|
1557 RMobilePhone::TMobilePhoneCostInfoV1Pckg pkgParam( aMobilePhoneCostInfoV1.GetValue() ); |
|
1558 aMobilePhone.NotifyCostInfoChange(aRequestStatus, pkgParam); |
|
1559 err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeShort); |
|
1560 } |
|
1561 |
|
1562 ASSERT_EQUALS(aRequestStatus.Int(), aWantedStatus, _L("RMobilePhone::NotifyCostInfoChange Wrong completion status")) |
|
1563 ASSERT_TRUE(aMobilePhoneCostInfoV1.IsEqual(ELogError), |
|
1564 _L("RMobilePhone::NotifyCostInfoChange Wrong result")) |
|
1565 |
|
1566 // Cancel request if it is still pending |
|
1567 if (aRequestStatus.Int() == KRequestPending) |
|
1568 { |
|
1569 aRequestStatus.Cancel(); |
|
1570 } |
|
1571 } |
|
1572 |
|
1573 /** |
|
1574 * Check the valid variables returned by RMobileCall::GetMobileCallInfo including the phone number |
|
1575 */ |
|
1576 void TCallControlTsyTestHelper::CheckForValidCallInfo(RMobileCall::TMobileCallInfoV1& aCallInfo, TPtrC aNumber) |
|
1577 { |
|
1578 CheckForValidCallInfo(aCallInfo); |
|
1579 if(aCallInfo.iValid & RMobileCall::KCallDialledParty) |
|
1580 { |
|
1581 ASSERT_TRUE( aCallInfo.iDialledParty.iTelNumber == aNumber, _L("RMobileCall::GetMobileCallInfo set bitmask for KCallId to true, but set iCallId to an invalid number")) |
|
1582 } |
|
1583 } |
|
1584 |
|
1585 /** |
|
1586 * Check the valid variables returned by RMobileCall::GetMobileCallInfo, when phone number is unknown |
|
1587 */ |
|
1588 void TCallControlTsyTestHelper::CheckForValidCallInfo(RMobileCall::TMobileCallInfoV1& aCallInfo, TInt aRequiredExitCode, TBool aIsCallConnected) |
|
1589 { |
|
1590 if(aCallInfo.iValid & RMobileCall::KCallStartTime) |
|
1591 { |
|
1592 TTime invalidTime = 0; |
|
1593 TTime startTime(aCallInfo.iStartTime); |
|
1594 if(aIsCallConnected) |
|
1595 { |
|
1596 ASSERT_TRUE( startTime > invalidTime, _L("RMobileCall::GetMobileCallInfo set bitmask for KCallStartTime to true, but set iStartTime to an invalid number")); |
|
1597 } |
|
1598 else |
|
1599 { |
|
1600 ASSERT_EQUALS( startTime.Int64(), invalidTime.Int64(), _L("RMobileCall::GetMobileCallInfo set bitmask for KCallStartTime to true, but set iStartTime to an invalid invalid time")); |
|
1601 } |
|
1602 } |
|
1603 |
|
1604 if(aCallInfo.iValid & RMobileCall::KCallDuration) |
|
1605 { |
|
1606 TTimeIntervalSeconds invalidTime = 0; |
|
1607 TTimeIntervalSeconds startTime(aCallInfo.iDuration); |
|
1608 if(aIsCallConnected) |
|
1609 { |
|
1610 ASSERT_TRUE( startTime > invalidTime, _L("RMobileCall::GetMobileCallInfo set bitmask for KCallDuration to true, but set iDuration to an invalid number")); |
|
1611 } |
|
1612 else |
|
1613 { |
|
1614 ASSERT_EQUALS( startTime.Int(), invalidTime.Int(), _L("RMobileCall::GetMobileCallInfo set bitmask for KCallDuration to true, but set iDuration to an invalid number")); |
|
1615 } |
|
1616 } |
|
1617 |
|
1618 if(aCallInfo.iValid & RMobileCall::KCallId) |
|
1619 { |
|
1620 if(aIsCallConnected) |
|
1621 { |
|
1622 ASSERT_TRUE( aCallInfo.iCallId > -1, _L("RMobileCall::GetMobileCallInfo set bitmask for KCallId to true, but set iCallId to an invalid number")) |
|
1623 } |
|
1624 else |
|
1625 { |
|
1626 ASSERT_EQUALS( aCallInfo.iCallId, -1, _L("RMobileCall::GetMobileCallInfo set bitmask for KCallId to true, but set iCallId to an invalid number")) |
|
1627 } |
|
1628 } |
|
1629 |
|
1630 if(aCallInfo.iValid & RMobileCall::KCallRemoteParty) |
|
1631 { |
|
1632 ASSERT_TRUE( aCallInfo.iRemoteParty.iRemoteNumber.iTelNumber.Length() > 0, _L("RMobileCall::GetMobileCallInfo set bitmask for KCallRemoteParty to true, but set iRemoteParty.iRemoteNumber.iTelNumber.Length() to an invalid length")) |
|
1633 } |
|
1634 |
|
1635 if(aCallInfo.iValid & RMobileCall::KCallExitCode) |
|
1636 { |
|
1637 ASSERT_EQUALS( aCallInfo.iExitCode, aRequiredExitCode, _L("RMobileCall::GetMobileCallInfo set bitmask for KCallExitCode to true, but did not set iExitCode to that expected.")) |
|
1638 } |
|
1639 |
|
1640 if(aCallInfo.iValid & RMobileCall::KCallEmergency) |
|
1641 { |
|
1642 ASSERT_EQUALS( aCallInfo.iEmergency, (TBool)EFalse, _L("RMobileCall::GetMobileCallInfo set bitmask for KCallEmergency to true, but did not set iEmergency to EFalse, even though this is not an emergency number")) |
|
1643 } |
|
1644 |
|
1645 if(aCallInfo.iValid & RMobileCall::KCallForwarded) |
|
1646 { |
|
1647 ASSERT_EQUALS( aCallInfo.iForwarded, (TBool)EFalse, _L("RMobileCall::GetMobileCallInfo set bitmask for KCallForwarded to true, but did not set iForwarded to EFalse, even though this is not an Forwarded call")) |
|
1648 } |
|
1649 |
|
1650 if(aCallInfo.iValid & RMobileCall::KCallPrivacy) |
|
1651 { |
|
1652 ASSERT_TRUE( aCallInfo.iPrivacy != RMobilePhone::EPrivacyUnspecified, _L("RMobileCall::GetMobileCallInfo set bitmask for KCallPrivacy to true, but did not set to an expected number")) |
|
1653 } |
|
1654 |
|
1655 if(aCallInfo.iValid & RMobileCall::KCallTch) |
|
1656 { |
|
1657 ASSERT_TRUE( (aCallInfo.iTch != RMobileCall::ETchUnknown) , _L("RMobileCall::GetMobileCallInfo set bitmask for KCallTch to true, but iTch is still unknown")) |
|
1658 } |
|
1659 |
|
1660 // CTSY initialises iAlternatingCall to EAlternatingModeUnspecified, which should be updated from LTSY. |
|
1661 // ( IPC is EMobileCallGetMobileCallInfo and method is CompleteNotifyMobileCallInfoChange(). |
|
1662 if(aCallInfo.iValid & RMobileCall::KCallAlternating) |
|
1663 { |
|
1664 if(aIsCallConnected) |
|
1665 { |
|
1666 // Because LTSY is not updating this correctly, check is changed from !=EAlternatingModeUnspecified to ==EAlternatingModeUnspecified |
|
1667 ASSERT_EQUALS(aCallInfo.iAlternatingCall, RMobilePhone::EAlternatingModeUnspecified, _L("RMobileCall::GetMobileCallInfo set bitmask for KCallAlternating to true, but iAlternatingCall is not EAlternatingModeUnspecified")) |
|
1668 } |
|
1669 else |
|
1670 { |
|
1671 ASSERT_EQUALS(aCallInfo.iAlternatingCall, RMobilePhone::EAlternatingModeUnspecified , _L("RMobileCall::GetMobileCallInfo set bitmask for KCallAlternating to true, but iAlternatingCall is not initialized EAlternatingModeUnspecified")); |
|
1672 } |
|
1673 } |
|
1674 |
|
1675 } |
|
1676 |