|
1 // Copyright (c) 2005-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 /** |
|
17 @file |
|
18 @internalComponent - Internal Symbian test code |
|
19 */ |
|
20 |
|
21 #include <asaltdefs.h> |
|
22 #include "ASAltClientSession.h" |
|
23 |
|
24 #include "TMultipleAlarmStep.h" |
|
25 |
|
26 // |
|
27 // |
|
28 |
|
29 |
|
30 static TBool CompareAlarm(TInt aOffset, TInt aLength, const TDesC8& aDesc, const TDesC8& aSubDesc) |
|
31 { |
|
32 for (TInt i = 0; i < aLength; ++i) |
|
33 { |
|
34 if (aDesc[i + aOffset] != aSubDesc[i]) |
|
35 { |
|
36 return EFalse; |
|
37 } |
|
38 } |
|
39 |
|
40 return ETrue; |
|
41 } |
|
42 |
|
43 // |
|
44 // |
|
45 |
|
46 |
|
47 CTMultipleAlarmStep::~CTMultipleAlarmStep() |
|
48 { |
|
49 iDataArray.Close(); |
|
50 } |
|
51 |
|
52 CTMultipleAlarmStep::CTMultipleAlarmStep() |
|
53 { |
|
54 // Call base class method to set up the human readable name for logging |
|
55 SetTestStepName(KTMultipleAlarm); |
|
56 } |
|
57 |
|
58 TVerdict CTMultipleAlarmStep::doTestStepPreambleL() |
|
59 { |
|
60 SetTestStepResult(EPass); |
|
61 return TestStepResult(); |
|
62 } |
|
63 |
|
64 TVerdict CTMultipleAlarmStep::doTestStepPostambleL() |
|
65 { |
|
66 return TestStepResult(); |
|
67 } |
|
68 |
|
69 void CTMultipleAlarmStep::StartAlertServerL(const TInt aMaxAlarms) |
|
70 { |
|
71 LaunchServerL(aMaxAlarms, EFalse, 0, 0, Time::NullTTime(), 0, EFalse, 0); |
|
72 } |
|
73 |
|
74 void CTMultipleAlarmStep::StartAlertServerL(const TInt aMaxAlarms, const TAlarmId aId, const TInt aResponse) |
|
75 { |
|
76 LaunchServerL(aMaxAlarms, ETrue, aId, aResponse, Time::NullTTime(), 0, EFalse, 0); |
|
77 } |
|
78 |
|
79 void CTMultipleAlarmStep::StartAlertServerL(const TInt aMaxAlarms, const TAlarmId aId, const TInt aResponse, const TTime& aTime) |
|
80 { |
|
81 LaunchServerL(aMaxAlarms, ETrue, aId, aResponse, aTime, 0, EFalse, 0); |
|
82 } |
|
83 |
|
84 void CTMultipleAlarmStep::StartAlertServerL(const TInt aMaxAlarms, const TAlarmId aId, const TInt aResponse, const TTime& aTime, TInt aSnoozeTime, TBool aUpdateSnooze,TInt aInitialState) |
|
85 { |
|
86 LaunchServerL(aMaxAlarms, ETrue, aId, aResponse, aTime, aSnoozeTime, aUpdateSnooze, aInitialState); |
|
87 } |
|
88 |
|
89 void CTMultipleAlarmStep::StopAlertServer() |
|
90 { |
|
91 iMsgQ.Close(); |
|
92 iServer.Terminate(KErrCancel); |
|
93 iServer.Close(); |
|
94 } |
|
95 |
|
96 void CTMultipleAlarmStep::LaunchServerL(const TInt aMaxAlarms, const TBool aReplies, const TAlarmId aId, const TInt aResponse, const TTime& aTime, TInt aSnoozeTime, TBool aUpdateSnooze, TInt aInitialState) |
|
97 { |
|
98 User::LeaveIfError(iMsgQ.CreateGlobal(KRemoteQName, KRemoteQSize, EOwnerThread)); |
|
99 |
|
100 // UID of console alarm alert server |
|
101 const TUid KServerUid2={0x1000008D}; |
|
102 const TUid KServerUid3={0x1020E043}; |
|
103 const TUidType serverUid(KNullUid,KServerUid2,KServerUid3); |
|
104 _LIT(KTAlertServerImg, "TAlertServer"); |
|
105 |
|
106 INFO_PRINTF2(_L("Starting Alert Server with max alarms: %i"), aMaxAlarms); |
|
107 SendInt(aMaxAlarms); |
|
108 SendInt(aInitialState); |
|
109 SendBool(aReplies); |
|
110 |
|
111 if(aReplies) |
|
112 { |
|
113 TBuf<12> buf; |
|
114 aTime.FormatL(buf, _L("%H:%T:%S")); |
|
115 INFO_PRINTF4(_L("response id: %i op-code: %i time: %s"), aId, aResponse, buf.PtrZ()); |
|
116 SendInt(aId); |
|
117 SendInt(aResponse); |
|
118 |
|
119 SendInt(aSnoozeTime); |
|
120 SendBool(aUpdateSnooze); |
|
121 |
|
122 SendInt(I64HIGH(aTime.Int64())); |
|
123 SendInt(I64LOW(aTime.Int64())); |
|
124 } |
|
125 |
|
126 User::LeaveIfError(iServer.Create(KTAlertServerImg, KNullDesC, serverUid)); |
|
127 iServer.Resume(); // logon OK - start the server |
|
128 |
|
129 // Wait for the Alert Server to start up |
|
130 User::After(1000000); |
|
131 } |
|
132 |
|
133 void CTMultipleAlarmStep::SendInt(const TInt aValue) |
|
134 { |
|
135 TRemoteMsg msg(aValue); |
|
136 iMsgQ.SendBlocking(msg); |
|
137 } |
|
138 |
|
139 void CTMultipleAlarmStep::SendBool(const TBool aValue) |
|
140 { |
|
141 TRemoteMsg msg(aValue); |
|
142 iMsgQ.SendBlocking(msg); |
|
143 } |
|
144 |
|
145 TInt CTMultipleAlarmStep::ReadInt() |
|
146 { |
|
147 TRemoteMsg msg; |
|
148 iMsgQ.ReceiveBlocking(msg); |
|
149 return msg.Int(); |
|
150 } |
|
151 |
|
152 TInt CTMultipleAlarmStep::ReadIntL() |
|
153 { |
|
154 TRemoteMsg msg; |
|
155 User::LeaveIfError(iMsgQ.Receive(msg)); |
|
156 return msg.Int(); |
|
157 } |
|
158 |
|
159 void CTMultipleAlarmStep::ReadData(TDes8& aBuffer) |
|
160 { |
|
161 TRemoteMsg msg; |
|
162 iMsgQ.ReceiveBlocking(msg); |
|
163 |
|
164 aBuffer.Copy(msg.Data(), KRemoteQMaxDataSize); |
|
165 } |
|
166 |
|
167 void CTMultipleAlarmStep::ResetConfigValues() |
|
168 { |
|
169 iMaxAlarms = 0; |
|
170 iAlarmCount = 0; |
|
171 iInitialState = 0; |
|
172 iId = 0; |
|
173 iState = 0; |
|
174 iQuietTime = 0; |
|
175 |
|
176 iDataArray.Reset(); |
|
177 |
|
178 iResponse = 0; |
|
179 iSnoozeTime = 0; |
|
180 iQueueResponse = 0; |
|
181 iCancelNotify = EFalse; |
|
182 iNoResponse = EFalse; |
|
183 iWaitForUpdate = EFalse; |
|
184 iTime.HomeTime(); |
|
185 |
|
186 iPauseTime = 0; |
|
187 iExpectedSnoozeTime = 0; |
|
188 iAction = 0; |
|
189 } |
|
190 |
|
191 // |
|
192 // |
|
193 |
|
194 |
|
195 void CTMultipleAlarmStep::MaxAlarmTestL() |
|
196 { |
|
197 INFO_PRINTF2(_L("Testing MaxAlarm with MaxAlarm=%d"), iMaxAlarms); |
|
198 TEST(iMaxAlarms > 0); |
|
199 |
|
200 // Start alert server |
|
201 StartAlertServerL(iMaxAlarms); |
|
202 |
|
203 RASAltClientSession session; |
|
204 User::LeaveIfError(session.Connect()); |
|
205 CleanupClosePushL(session); |
|
206 |
|
207 TInt ret = 0; |
|
208 session.GetMaxNumberOfAlarms(ret); |
|
209 TEST(ret == iMaxAlarms); |
|
210 |
|
211 //Clean-up |
|
212 CleanupStack::PopAndDestroy(&session); |
|
213 StopAlertServer(); |
|
214 ResetConfigValues(); |
|
215 } |
|
216 |
|
217 |
|
218 /** |
|
219 @SYMTestCaseID UIF-UCT-PREQ1118-MAN-AltS-351 |
|
220 */ |
|
221 |
|
222 /** |
|
223 @SYMTestCaseID UIF-UCT-PREQ1118-MAN-AltS-352 |
|
224 |
|
225 @SYMPREQ PREQ1118 |
|
226 |
|
227 @SYMTestCaseDesc Alarm Server in SAN and MAN mode. |
|
228 |
|
229 @SYMTestPriority High |
|
230 |
|
231 @SYMTestStatus Implemented |
|
232 |
|
233 @SYMTestActions Create Alert Server by invoking CEikServAlarmAlertServer::NewL(MEirkServAlarmFactory*) with aMaxAlarms 1 and 5; |
|
234 Create RASAltClientSession, call GetMaxNumberOfAlarms(). |
|
235 |
|
236 @SYMTestExpectedResults RASAltClientSession::GetMaxNumberOfAlarms() returns 1 and 5. |
|
237 */ |
|
238 void CTMultipleAlarmStep::DoMaxAlarmTestL() |
|
239 { |
|
240 // Test with MaxAlarm = 1 |
|
241 iMaxAlarms = 1; |
|
242 MaxAlarmTestL(); |
|
243 |
|
244 // Test with MaxAlarm = 5 |
|
245 iMaxAlarms = 5; |
|
246 MaxAlarmTestL(); |
|
247 } |
|
248 |
|
249 // |
|
250 // |
|
251 |
|
252 |
|
253 TInt CTMultipleAlarmStep::AddAlarmsL(RASAltClientSession& aSession) |
|
254 { |
|
255 for(TInt i = 0; i < iAlarmCount; ++i) |
|
256 { |
|
257 TBufC8<1> data; |
|
258 TInt ret = AddAlarmL(aSession, TAlarmId(i + 1), data); |
|
259 if(ret == KErrNotFound && i >= iMaxAlarms) |
|
260 { |
|
261 continue; // Expected result, since iAlarmCount is bigger than iMaxAlarms |
|
262 } |
|
263 else if(ret != KErrNone) |
|
264 { |
|
265 return ret; |
|
266 } |
|
267 } |
|
268 return KErrNone; |
|
269 } |
|
270 |
|
271 |
|
272 TInt CTMultipleAlarmStep::AddAlarmL(RASAltClientSession& aSession, const TAlarmId aId, const TDesC8& aData) |
|
273 { |
|
274 TFullName name; |
|
275 |
|
276 TTAlarm alarm; |
|
277 alarm.Id() = aId; |
|
278 |
|
279 if(aData.Size() > 0) |
|
280 { |
|
281 alarm.SetHasAssociatedData(ETrue); |
|
282 } |
|
283 |
|
284 if(alarm.Id() % 2) |
|
285 { |
|
286 TTime now; |
|
287 now.UniversalTime(); |
|
288 alarm.NextDueTime() = now; |
|
289 alarm.OriginalExpiryTime() = now; |
|
290 } |
|
291 else |
|
292 { |
|
293 alarm.NextDueTime() = Time::NullTTime(); |
|
294 alarm.OriginalExpiryTime() = Time::NullTTime(); |
|
295 } |
|
296 |
|
297 INFO_PRINTF2(_L("Adding alarm with id: %i"), alarm.Id()); |
|
298 |
|
299 TRequestStatus status; |
|
300 aSession.SetAlarm(status, alarm, name, aData); |
|
301 User::WaitForRequest(status); |
|
302 if (status.Int() == KErrNone) |
|
303 { |
|
304 // Make sure the correct alarm was added |
|
305 if(ReadIntL() != EASAltOpCodeSetAlarm || ReadIntL() != aId) |
|
306 { |
|
307 INFO_PRINTF1(_L("Mismatched SetAlarm return")); |
|
308 return KErrUnknown; |
|
309 } |
|
310 |
|
311 TInt dataSize = ReadIntL(); |
|
312 while(dataSize > 0) // There is data associated with alarm |
|
313 { |
|
314 TBuf8<KRemoteQMaxDataSize> buf; |
|
315 ReadData(buf); |
|
316 |
|
317 TInt length = dataSize > KRemoteQMaxDataSize ? KRemoteQMaxDataSize : dataSize; |
|
318 if(!CompareAlarm(aData.Length() - dataSize, length, aData, buf)) |
|
319 { |
|
320 INFO_PRINTF1(_L("Mismatched SetAlarm data")); |
|
321 return KErrUnknown; |
|
322 } |
|
323 dataSize -= KRemoteQMaxDataSize; |
|
324 } |
|
325 |
|
326 TInt opCode = ReadIntL(); |
|
327 TInt state = ReadIntL(); |
|
328 TInt id = ReadIntL(); |
|
329 |
|
330 if(opCode != EASAltOpCodeSetState || state != iInitialState || id != aId) |
|
331 { |
|
332 INFO_PRINTF1(_L("Mismatched SetState return")); |
|
333 return KErrUnknown; |
|
334 } |
|
335 } |
|
336 |
|
337 return status.Int(); |
|
338 } |
|
339 |
|
340 |
|
341 void CTMultipleAlarmStep::AddAlarmTestL() |
|
342 { |
|
343 INFO_PRINTF3(_L("Testing AddAlarm with MAxAlarms=%d, and AlarmCount=%d"), iMaxAlarms, iAlarmCount); |
|
344 TEST(iMaxAlarms > 0); |
|
345 TEST(iAlarmCount > 0); |
|
346 |
|
347 // Start alert server |
|
348 StartAlertServerL(iMaxAlarms); |
|
349 |
|
350 RASAltClientSession session; |
|
351 User::LeaveIfError(session.Connect()); |
|
352 CleanupClosePushL(session); |
|
353 |
|
354 if(iDataArray.Count() > 0) |
|
355 { |
|
356 for(TInt i = 0; i < iAlarmCount; ++i) |
|
357 { |
|
358 TAlarmData data(i + 1); |
|
359 TInt index = iDataArray.FindInOrder(data, TLinearOrder<TAlarmData>(TAlarmData::Compare)); |
|
360 TBuf8<256> value; |
|
361 |
|
362 if(index != KErrNotFound) |
|
363 { |
|
364 value.Copy(iDataArray[index].iData); |
|
365 } |
|
366 |
|
367 TEST(AddAlarmL(session, i + 1, value) == KErrNone); |
|
368 } |
|
369 } |
|
370 else |
|
371 { |
|
372 TEST(AddAlarmsL(session) == KErrNone); |
|
373 } |
|
374 |
|
375 //Clean-up |
|
376 CleanupStack::PopAndDestroy(&session); |
|
377 StopAlertServer(); |
|
378 ResetConfigValues(); |
|
379 } |
|
380 |
|
381 /** |
|
382 @SYMTestCaseID UIF-UCT-PREQ1118-MAN-AltS-354 |
|
383 */ |
|
384 /** |
|
385 @SYMTestCaseID UIF-UCT-PREQ1118-AD-AltS-241 |
|
386 */ |
|
387 /** |
|
388 @SYMTestCaseID UIF-UCT-PREQ1118-AD-AltS-242 |
|
389 |
|
390 @SYMPREQ PREQ1118 |
|
391 |
|
392 @SYMTestCaseDesc Alarm Server maxAlarms and Retrieve AD. |
|
393 |
|
394 @SYMTestPriority High |
|
395 |
|
396 @SYMTestStatus Implemented |
|
397 |
|
398 @SYMTestActions (1) Start Alert Server specifying aMaxAlarms equal to 3; |
|
399 Call RASAltClientSession::SetAlarm() fifty (50) times; |
|
400 (2) Register 1 alarm with expiry time and associated data; |
|
401 (3) Register 3 alarms with expiry time and associated data; |
|
402 |
|
403 @SYMTestExpectedResults (1) Number of alarms objects: 3. |
|
404 (2 & 3) Is possible to retrieve the Associated Data for the alarm; |
|
405 Data retrieved matches the data supplied at the time when the alarm was registered. |
|
406 */ |
|
407 void CTMultipleAlarmStep::DoAddAlarmTestL() |
|
408 { |
|
409 // Add alarm with no data associated |
|
410 SetTestStepID(_L("UIF-UCT-PREQ1118-MAN-AltS-354")); |
|
411 iMaxAlarms = 3; |
|
412 iAlarmCount = 50; |
|
413 AddAlarmTestL(); |
|
414 RecordTestResultL(); |
|
415 |
|
416 // Add alarm with data |
|
417 SetTestStepID(_L("UIF-UCT-PREQ1118-AD-AltS-241")); |
|
418 iMaxAlarms = 1; |
|
419 iAlarmCount = 1; |
|
420 iDataArray.AppendL(TAlarmData(1, _L("Data For Alarm 0"))); |
|
421 AddAlarmTestL(); |
|
422 RecordTestResultL(); |
|
423 |
|
424 // Add alarm with data |
|
425 SetTestStepID(_L("UIF-UCT-PREQ1118-AD-AltS-242")); |
|
426 iMaxAlarms = 3; |
|
427 iAlarmCount = 3; |
|
428 iDataArray.AppendL(TAlarmData(1, _L("Data For Alarm 0"))); |
|
429 iDataArray.AppendL(TAlarmData(2, _L(""))); |
|
430 iDataArray.AppendL(TAlarmData(3, _L("Data For Alarm 2 And some filler because to see what happens when I send larger pieces of data."))); |
|
431 AddAlarmTestL(); |
|
432 RecordTestResultL(); |
|
433 CloseTMSGraphicsStep(); |
|
434 } |
|
435 |
|
436 // |
|
437 // |
|
438 |
|
439 void CTMultipleAlarmStep::DelAlarmTestL(const TInt aDeleteAll) |
|
440 { |
|
441 INFO_PRINTF2(_L("Testing DeleteAlarm with AlarmId=%d"), iId); |
|
442 TEST(iMaxAlarms > 0); |
|
443 TEST(iAlarmCount > 0); |
|
444 |
|
445 // Start alert server |
|
446 StartAlertServerL(iMaxAlarms); |
|
447 |
|
448 RASAltClientSession session; |
|
449 User::LeaveIfError(session.Connect()); |
|
450 CleanupClosePushL(session); |
|
451 |
|
452 // Add alarms |
|
453 TEST(AddAlarmsL(session) == KErrNone); |
|
454 |
|
455 // Delete alarm |
|
456 if (aDeleteAll) |
|
457 { |
|
458 session.DeleteAlarm(); |
|
459 } |
|
460 else |
|
461 { |
|
462 session.DeleteAlarm(iId); |
|
463 } |
|
464 |
|
465 // Void return by method, but KNullAlarmId is an invalid id we assume we pass |
|
466 // (KErrNotFound is actually returned in the message but it doesn't propagate). |
|
467 if(iId != KNullAlarmId && iMaxAlarms > 1) |
|
468 { |
|
469 if (aDeleteAll) |
|
470 { |
|
471 for (TInt i =0; i< iAlarmCount; i++) |
|
472 { |
|
473 User::After(10000); |
|
474 TInt id = ReadInt(); |
|
475 TEST(id == i+1); |
|
476 INFO_PRINTF2(_L("Alarm %d deleted"), id); |
|
477 } |
|
478 } |
|
479 else |
|
480 { |
|
481 TEST(ReadInt() == iId); |
|
482 INFO_PRINTF2(_L("Alarm %d deleted"), iId); |
|
483 } |
|
484 } |
|
485 |
|
486 //Clean-up |
|
487 CleanupStack::PopAndDestroy(&session); |
|
488 StopAlertServer(); |
|
489 ResetConfigValues(); |
|
490 } |
|
491 |
|
492 /** |
|
493 @SYMTestCaseID UIF-UCT-PREQ1118-MAN-AltS-369 |
|
494 */ |
|
495 /** |
|
496 @SYMTestCaseID UIF-UCT-PREQ1118-MAN-AltS-370 |
|
497 */ |
|
498 /** |
|
499 @SYMTestCaseID UIF-UCT-PREQ1118-MAN-AltS-379 |
|
500 |
|
501 @SYMPREQ PREQ1118 |
|
502 |
|
503 @SYMTestCaseDesc Delete Alarm. |
|
504 |
|
505 @SYMTestPriority High |
|
506 |
|
507 @SYMTestStatus Implemented |
|
508 |
|
509 @SYMTestActions (1) Alert Server in SAN mode; |
|
510 create RASClientSession, notify Alarm Server on the 3 alarms in a row (call RASClientSession::SetAlarm() 3 times providing corresponding supplementary data; |
|
511 delete alarm #2 |
|
512 (2) Alert Server in MAN mode; |
|
513 create RASClientSession, notify Alarm Server on the 3 alarms in a row (call RASClientSession::SetAlarm() 3 times providing corresponding supplementary data; |
|
514 delete alarm #2 |
|
515 (3) Alert Server in MAN mode; |
|
516 create RASClientSession, notify Alarm Server on the 3 alarms in a row (call RASClientSession::SetAlarm() 3 times providing corresponding supplementary data; |
|
517 delete alarm with invalid id. |
|
518 |
|
519 @SYMTestExpectedResults (1 & 2) Alarm #2 is deleted. |
|
520 (3) No alarm is deleted. |
|
521 */ |
|
522 void CTMultipleAlarmStep::DoDelAlarmTestL() |
|
523 { |
|
524 // Delete alarm #2 in SAN mode |
|
525 SetTestStepID(_L("UIF-UCT-PREQ1118-MAN-AltS-369")); |
|
526 iMaxAlarms = 1; |
|
527 iAlarmCount = 3; |
|
528 iId = 1; |
|
529 DelAlarmTestL(); |
|
530 RecordTestResultL(); |
|
531 |
|
532 // Delete alarm #2 in SAN mode |
|
533 SetTestStepID(_L("UIF-UCT-PREQ1118-MAN-AltS-370")); |
|
534 iMaxAlarms = 3; |
|
535 iAlarmCount = 3; |
|
536 iId = 2; |
|
537 DelAlarmTestL(); |
|
538 RecordTestResultL(); |
|
539 |
|
540 // Delete an invalid alarm id |
|
541 SetTestStepID(_L("UIF-UCT-PREQ1118-MAN-AltS-379")); |
|
542 iMaxAlarms = 3; |
|
543 iAlarmCount = 3; |
|
544 iId = 0; |
|
545 DelAlarmTestL(); |
|
546 RecordTestResultL(); |
|
547 |
|
548 // Delete all alarms |
|
549 iMaxAlarms = 3; |
|
550 iAlarmCount = 3; |
|
551 iId = 2; |
|
552 DelAlarmTestL(1); |
|
553 |
|
554 CloseTMSGraphicsStep(); |
|
555 } |
|
556 |
|
557 // |
|
558 // |
|
559 |
|
560 void CTMultipleAlarmStep::SoundTestL() |
|
561 { |
|
562 INFO_PRINTF2(_L("Testing Sound with AlarmId=%d"), iId); |
|
563 TEST(iMaxAlarms > 0); |
|
564 TEST(iAlarmCount > 0); |
|
565 |
|
566 _LIT(KSoundFile, "Sound File\0"); // Zero terminate to simplify logging. |
|
567 |
|
568 // Start alert server |
|
569 StartAlertServerL(iMaxAlarms); |
|
570 |
|
571 RASAltClientSession session; |
|
572 User::LeaveIfError(session.Connect()); |
|
573 CleanupClosePushL(session); |
|
574 |
|
575 // Add alarms |
|
576 TEST(AddAlarmsL(session) == KErrNone); |
|
577 |
|
578 // Start playing sound |
|
579 session.StartPlayingSound(KSoundFile, iId); |
|
580 INFO_PRINTF1(_L("Testing that Alarm id and op-code match after StartPlayingSound")); |
|
581 TEST(ReadInt() == EASAltOpCodeStartPlayingSound && ReadInt() == iId); |
|
582 |
|
583 TBuf8<KRemoteQMaxDataSize> data; |
|
584 ReadData(data); |
|
585 |
|
586 TBuf<KRemoteQMaxDataSize> buf; |
|
587 buf.Copy(data); |
|
588 |
|
589 TBuf<KRemoteQMaxDataSize> cmp(KSoundFile); |
|
590 |
|
591 TEST(buf.Compare(cmp)); |
|
592 INFO_PRINTF3(_L("Testing Alarm sound file name match, expected: '%s', got: '%s'"), KSoundFile().Ptr(), buf.Ptr()); |
|
593 |
|
594 // Stop playing sound |
|
595 session.StopPlayingSound(iId); |
|
596 INFO_PRINTF1(_L("Testing that Alarm id and op-code match after StopPlayingSound")); |
|
597 TEST(ReadInt() == EASAltOpCodeStopPlayingSound && ReadInt() == iId); |
|
598 |
|
599 session.StopPlayingSound(); |
|
600 if(iMaxAlarms > 1) |
|
601 { |
|
602 for (TInt i = 0; i < iMaxAlarms; ++i) |
|
603 { |
|
604 TEST(ReadInt() == EASAltOpCodeStopPlayingSound && ReadInt() == (i + 1)); |
|
605 } |
|
606 } |
|
607 else |
|
608 { |
|
609 TEST(ReadInt() == EASAltOpCodeStopPlayingSound && ReadInt() == iId); |
|
610 } |
|
611 |
|
612 //Clean-up |
|
613 CleanupStack::PopAndDestroy(&session); |
|
614 StopAlertServer(); |
|
615 ResetConfigValues(); |
|
616 } |
|
617 |
|
618 /** |
|
619 @SYMTestCaseID UIF-UCT-PREQ1118-MAN-AltS-355 |
|
620 */ |
|
621 /** |
|
622 @SYMTestCaseID UIF-UCT-PREQ1118-MAN-AltS-356 |
|
623 |
|
624 @SYMPREQ PREQ1118 |
|
625 |
|
626 @SYMTestCaseDesc StartPlayingSound specified alarm MAN and SAN |
|
627 |
|
628 @SYMTestPriority High |
|
629 |
|
630 @SYMTestStatus Implemented |
|
631 |
|
632 @SYMTestActions (1) Alert Server in MAN mode; |
|
633 Create RASClientSession, notify Alarm Server on the 3 alarms in a row (call RASClientSession::SetAlarm() 3 times providing corresponding supplementary data); |
|
634 Call StartPlayingSound() for the 2nd alarm; |
|
635 Call StopPlayingSound() for the 2nd alarm; |
|
636 (2) Start Alert Server in SAN mode; |
|
637 create RASClientSession, notify Alarm Server on the 3 alarms in a row (call RASClientSession::SetAlarm() 3 times providing corresponding supplementary data); |
|
638 Call StartPlayingSound(); |
|
639 Call StartPlayingSound(.., aAlarmID) with aAlarmID = ID of the 2nd alarm; |
|
640 Call StopPlayingSound(); |
|
641 |
|
642 @SYMTestExpectedResults (1) Verify through MEikServAlarm and CEikAlmControlSupervisor that the action is taken for the 2nd alarm exactly, |
|
643 and the state of the other two alarms (1st and 3rd) is not affected. |
|
644 (2) Verify through MEikServAlarm and CEikAlmControlSupervisor that the action is taken for the alarm 1, |
|
645 Regardless of the ID supplied. |
|
646 The calls for the 2nd and 3rd alarms should be dropped by the Alarm Server. |
|
647 */ |
|
648 void CTMultipleAlarmStep::DoSoundTestL() |
|
649 { |
|
650 // Sound test 1 |
|
651 SetTestStepID(_L("UIF-UCT-PREQ1118-MAN-AltS-355")); |
|
652 iMaxAlarms = 3; |
|
653 iAlarmCount = 3; |
|
654 iId = 2; |
|
655 SoundTestL(); |
|
656 RecordTestResultL(); |
|
657 |
|
658 // Sound test 2 |
|
659 SetTestStepID(_L("UIF-UCT-PREQ1118-MAN-AltS-356")); |
|
660 iMaxAlarms = 1; |
|
661 iAlarmCount = 3; |
|
662 iId = 3; |
|
663 SoundTestL(); |
|
664 RecordTestResultL(); |
|
665 |
|
666 CloseTMSGraphicsStep(); |
|
667 } |
|
668 |
|
669 // |
|
670 // |
|
671 |
|
672 |
|
673 void CTMultipleAlarmStep::VisibleTestL() |
|
674 { |
|
675 INFO_PRINTF2(_L("Testing Visibility with AlarmId=%d"), iId); |
|
676 TEST(iMaxAlarms > 0); |
|
677 TEST(iAlarmCount > 0); |
|
678 |
|
679 // Start alert server |
|
680 StartAlertServerL(iMaxAlarms); |
|
681 |
|
682 RASAltClientSession session; |
|
683 User::LeaveIfError(session.Connect()); |
|
684 CleanupClosePushL(session); |
|
685 |
|
686 // Add alarms |
|
687 TEST(AddAlarmsL(session) == KErrNone); |
|
688 |
|
689 // Set visibility true |
|
690 session.SetVisibility(ETrue, iId); |
|
691 INFO_PRINTF1(_L("Checking AlarmId, op-code and visiblity match after setting visibility ON")); |
|
692 TEST(ReadInt() == EASAltOpCodeVisible && ReadInt() == iId && TTrue(ReadInt()) == ETrue); |
|
693 |
|
694 // Set visibility false |
|
695 session.SetVisibility(EFalse, iId); |
|
696 INFO_PRINTF1(_L("Checking AlarmId, op-code and visiblity match after setting visibility OFF"));; |
|
697 TEST(ReadInt() == EASAltOpCodeVisible && ReadInt() == iId && TTrue(ReadInt()) != ETrue); |
|
698 |
|
699 |
|
700 session.SetVisibility(EFalse); |
|
701 if(iMaxAlarms > 1) |
|
702 { |
|
703 for (TInt i = 0; i < iMaxAlarms; ++i) |
|
704 { |
|
705 TEST(ReadInt() == EASAltOpCodeVisible && ReadInt() == (i + 1) && ReadInt() == EFalse); |
|
706 } |
|
707 } |
|
708 else |
|
709 { |
|
710 TEST(ReadInt() == EASAltOpCodeVisible && ReadInt() == iId && ReadInt() == EFalse); |
|
711 } |
|
712 |
|
713 //Clean-up |
|
714 CleanupStack::PopAndDestroy(&session); |
|
715 StopAlertServer(); |
|
716 ResetConfigValues(); |
|
717 } |
|
718 |
|
719 /** |
|
720 @SYMTestCaseID UIF-UCT-PREQ1118-MAN-AltS-357 |
|
721 */ |
|
722 /** |
|
723 @SYMTestCaseID UIF-UCT-PREQ1118-MAN-AltS-358 |
|
724 |
|
725 @SYMPREQ PREQ1118 |
|
726 |
|
727 @SYMTestCaseDesc SetVisibility in mode MAN and SAN |
|
728 |
|
729 @SYMTestPriority High |
|
730 |
|
731 @SYMTestStatus Implemented |
|
732 |
|
733 @SYMTestActions (1) Alert Server in MAN mode; |
|
734 Create RASClientSession, notify Alarm Server on the 3 alarms in a row (call RASClientSession::SetAlarm() 3 times providing corresponding supplementary data); |
|
735 Call SetVisibility(ETrue, aAlarmId) for the 2nd alarm; |
|
736 Call SetVisibility(EFalse, aAlarmId) for the 2nd alarm; |
|
737 (2) Start Alert Server in SAN mode; |
|
738 Create RASClientSession, notify Alarm Server on the 3 alarms in a row (call RASClientSession::SetAlarm() 3 times providing corresponding supplementary data); |
|
739 Call SetVisibility(ETrue); |
|
740 Call SetVisibility(EFalse, aAlarmID) with aAlarmID = ID of the 2nd alarm; |
|
741 Call SetVisibility(EFalse); |
|
742 |
|
743 @SYMTestExpectedResults (1) Verify through MEikServAlarm and CEikAlmControlSupervisor that the action is taken for the 2nd alarm exactly, |
|
744 and the state of the other two alarms (1st and 3rd) is not affected. |
|
745 |
|
746 (2) Verify through MEikServAlarm and CEikAlmControlSupervisor that the action is taken for the alarm 1, |
|
747 regardless of the ID supplied. |
|
748 The calls for the 2nd and 3rd alarms should be dropped by the Alarm Server. |
|
749 */ |
|
750 void CTMultipleAlarmStep::DoVisibleTestL() |
|
751 { |
|
752 // Visibility test 1 |
|
753 SetTestStepID(_L("UIF-UCT-PREQ1118-MAN-AltS-357")); |
|
754 iMaxAlarms = 3; |
|
755 iAlarmCount = 3; |
|
756 iId = 2; |
|
757 VisibleTestL(); |
|
758 RecordTestResultL(); |
|
759 |
|
760 // Visibility test 2 |
|
761 SetTestStepID(_L("UIF-UCT-PREQ1118-MAN-AltS-358")); |
|
762 iMaxAlarms = 1; |
|
763 iAlarmCount = 3; |
|
764 iId = 3; |
|
765 VisibleTestL(); |
|
766 RecordTestResultL(); |
|
767 |
|
768 CloseTMSGraphicsStep(); |
|
769 } |
|
770 |
|
771 // |
|
772 // |
|
773 |
|
774 |
|
775 void CTMultipleAlarmStep::StateTestL() |
|
776 { |
|
777 INFO_PRINTF2(_L("Testing State with AlarmId=%d"), iId); |
|
778 TEST(iMaxAlarms > 0); |
|
779 TEST(iAlarmCount > 0); |
|
780 |
|
781 // Start alert server |
|
782 StartAlertServerL(iMaxAlarms); |
|
783 |
|
784 RASAltClientSession session; |
|
785 User::LeaveIfError(session.Connect()); |
|
786 CleanupClosePushL(session); |
|
787 |
|
788 // Add alarms |
|
789 TEST(AddAlarmsL(session) == KErrNone); |
|
790 |
|
791 // Set State |
|
792 session.SetAlertServerState(iState, iId); |
|
793 INFO_PRINTF1(_L("Checking that AlarmId, state and op-code match")); |
|
794 TEST(ReadInt() == EASAltOpCodeSetState && ReadInt() == iState && ReadInt() == iId); |
|
795 |
|
796 |
|
797 session.SetAlertServerState(iState); |
|
798 if(iMaxAlarms > 1) |
|
799 { |
|
800 for (TInt i = 0; i < iMaxAlarms; ++i) |
|
801 { |
|
802 TEST(ReadInt() == EASAltOpCodeSetState && ReadInt() == iState && ReadInt() == (i + 1)); |
|
803 } |
|
804 } |
|
805 else |
|
806 { |
|
807 TEST(ReadInt() == EASAltOpCodeSetState && ReadInt() == iState && ReadInt() == iId); |
|
808 } |
|
809 |
|
810 //Clean-up |
|
811 CleanupStack::PopAndDestroy(&session); |
|
812 StopAlertServer(); |
|
813 ResetConfigValues(); |
|
814 } |
|
815 |
|
816 /** |
|
817 @SYMTestCaseID UIF-UCT-PREQ1118-MAN-AltS-359 |
|
818 */ |
|
819 /** |
|
820 @SYMTestCaseID UIF-UCT-PREQ1118-MAN-AltS-360 |
|
821 |
|
822 @SYMPREQ PREQ1118 |
|
823 |
|
824 @SYMTestCaseDesc SetAlertState MAN and SAN |
|
825 |
|
826 @SYMTestPriority High |
|
827 |
|
828 @SYMTestStatus Implemented |
|
829 |
|
830 @SYMTestActions (1) Alert Server in MAN mode; |
|
831 Create RASClientSession, notify Alarm Server on the 3 alarms in a row (call RASClientSession::SetAlarm() 3 times providing corresponding supplementary data); |
|
832 Call SetAlertState(..., aAlarmId) for the 2nd alarm, check alarm flags |
|
833 (2) Start Alert Server in SAN mode; |
|
834 Create RASClientSession, notify Alarm Server on the 3 alarms in a row (call RASClientSession::SetAlarm() 3 times providing corresponding supplementary data); |
|
835 Call SetAlertState(..., aAlarmID) with aAlarmID = ID of the 2nd alarm; |
|
836 Call SetAlertState(...). |
|
837 |
|
838 @SYMTestExpectedResults (1) Verify through MEikServAlarm and CEikAlmControlSupervisor that the action is taken for the 2nd alarm exactly, |
|
839 and the state of the other two alarms (1st and 3rd) is not affected |
|
840 (2) Verify through MEikServAlarm and CEikAlmControlSupervisor that the action is taken for the alarm 1, |
|
841 regardless of the ID supplied. |
|
842 The calls for the 2nd and 3rd alarms should be dropped by the Alarm Server. |
|
843 */ |
|
844 void CTMultipleAlarmStep::DoStateTestL() |
|
845 { |
|
846 // State test 1 |
|
847 SetTestStepID(_L("UIF-UCT-PREQ1118-MAN-AltS-359")); |
|
848 iMaxAlarms = 3; |
|
849 iAlarmCount = 3; |
|
850 iId = 1; |
|
851 iState = 3; |
|
852 StateTestL(); |
|
853 RecordTestResultL(); |
|
854 |
|
855 // State test 2 |
|
856 SetTestStepID(_L("UIF-UCT-PREQ1118-MAN-AltS-360")); |
|
857 iMaxAlarms = 1; |
|
858 iAlarmCount = 3; |
|
859 iId = 3; |
|
860 iState = 3; |
|
861 StateTestL(); |
|
862 RecordTestResultL(); |
|
863 |
|
864 CloseTMSGraphicsStep(); |
|
865 } |
|
866 |
|
867 // |
|
868 // |
|
869 |
|
870 |
|
871 void CTMultipleAlarmStep::QuietTestL() |
|
872 { |
|
873 INFO_PRINTF2(_L("Testing Quiet with QuietTime=%d"), iQuietTime); |
|
874 TEST(iMaxAlarms > 0); |
|
875 TEST(iAlarmCount > 0); |
|
876 |
|
877 // Start alert server |
|
878 StartAlertServerL(iMaxAlarms); |
|
879 |
|
880 RASAltClientSession session; |
|
881 User::LeaveIfError(session.Connect()); |
|
882 CleanupClosePushL(session); |
|
883 |
|
884 // Add alarms |
|
885 TEST(AddAlarmsL(session) == KErrNone); |
|
886 |
|
887 TTime now; |
|
888 now.UniversalTime(); |
|
889 now += TTimeIntervalSeconds(iQuietTime); |
|
890 |
|
891 // Set Quiet period |
|
892 session.SetQuietPeriod(now); |
|
893 |
|
894 TRequestStatus status; |
|
895 TPckgBuf<TTime> pTime; |
|
896 |
|
897 session.TimeWhenQuietPeriodShouldEnd(status, pTime); |
|
898 User::WaitForRequest(status); |
|
899 if(status.Int() != KErrNone || pTime() != now) |
|
900 { |
|
901 TBuf<12> nowBuf; |
|
902 TBuf<12> timeBuf; |
|
903 pTime().FormatL(timeBuf, _L("%H:%T:%S")); |
|
904 now.FormatL(nowBuf, _L("%H:%T:%S")); |
|
905 |
|
906 INFO_PRINTF4(_L("Expected status: 'KErrNone', got '%i', expected time: '%s', got: '%s'"), status.Int(), nowBuf.PtrZ(), timeBuf.PtrZ()); |
|
907 TEST(EFalse); |
|
908 } |
|
909 |
|
910 //Clean-up |
|
911 CleanupStack::PopAndDestroy(&session); |
|
912 StopAlertServer(); |
|
913 ResetConfigValues(); |
|
914 } |
|
915 |
|
916 /** |
|
917 @SYMTestCaseID UIF-UCT-PREQ1118-MAN-AltS-361 |
|
918 |
|
919 @SYMPREQ PREQ1118 |
|
920 |
|
921 @SYMTestCaseDesc SetQuietPeriod |
|
922 |
|
923 @SYMTestPriority High |
|
924 |
|
925 @SYMTestStatus Implemented |
|
926 |
|
927 @SYMTestActions Alert Server in MAN mode; |
|
928 Create RASClientSession, notify Alarm Server on the 3 alarms in a row (call RASClientSession::SetAlarm() 3 times providing corresponding supplementary data); |
|
929 Call SetQuietPeriod(). |
|
930 |
|
931 @SYMTestExpectedResults Verify through MEikServAlarm and CEikAlmControlSupervisor that all alarm sounds have been silenced. |
|
932 */ |
|
933 void CTMultipleAlarmStep::DoQuietTestL() |
|
934 { |
|
935 // Quiet test 1 |
|
936 SetTestStepID(_L("UIF-UCT-PREQ1118-MAN-AltS-361")); |
|
937 iMaxAlarms = 3; |
|
938 iAlarmCount = 3; |
|
939 iQuietTime = 5; |
|
940 QuietTestL(); |
|
941 RecordTestResultL(); |
|
942 |
|
943 CloseTMSGraphicsStep(); |
|
944 } |
|
945 |
|
946 // |
|
947 // |
|
948 |
|
949 |
|
950 void CTMultipleAlarmStep::NotifyTestL() |
|
951 { |
|
952 INFO_PRINTF2(_L("Testing Notify with Response=%d"), iResponse); |
|
953 TEST(iMaxAlarms > 0); |
|
954 TEST(iAlarmCount > 0); |
|
955 |
|
956 // Start alert server |
|
957 if(iCancelNotify) |
|
958 { |
|
959 StartAlertServerL(iMaxAlarms); |
|
960 } |
|
961 else if(iResponse == ETestActionSetQuietPeriod) |
|
962 { |
|
963 StartAlertServerL(iMaxAlarms, iId, iResponse, iTime); |
|
964 } |
|
965 else if(iResponse == EASAltAlertServerResponseSnooze || iResponse == EASAltAlertServerResponsePauseSound) |
|
966 { |
|
967 StartAlertServerL(iMaxAlarms, iId, iResponse, Time::NullTTime(), iSnoozeTime, iWaitForUpdate, 0); |
|
968 } |
|
969 else |
|
970 { |
|
971 StartAlertServerL(iMaxAlarms, iId, iResponse); |
|
972 } |
|
973 |
|
974 RASAltClientSession session; |
|
975 User::LeaveIfError(session.Connect()); |
|
976 CleanupClosePushL(session); |
|
977 |
|
978 TRequestStatus status; |
|
979 TTime time; |
|
980 TAlarmId id; |
|
981 |
|
982 if(!iQueueResponse) |
|
983 { |
|
984 session.NotifyOnResponse(status, time, id); |
|
985 } |
|
986 |
|
987 // Add alarms |
|
988 TEST(AddAlarmsL(session) == KErrNone); |
|
989 |
|
990 if(iResponse == ETestActionTaskKey) // Alarm needs to be visible for response to be sent. |
|
991 { |
|
992 session.SetVisibility(ETrue, iId); |
|
993 INFO_PRINTF1(_L("Checking that AlarmId, op-code and visiblity match")); |
|
994 TEST(ReadInt() == EASAltOpCodeVisible && ReadInt() == iId && TTrue(ReadInt()) == ETrue); |
|
995 } |
|
996 |
|
997 if(iCancelNotify) |
|
998 { |
|
999 session.NotifyOnResponseCancel(); |
|
1000 if(status.Int() != iResponse) |
|
1001 { |
|
1002 INFO_PRINTF3(_L("Response doesn't match! response: '%i' != '%i'"), status.Int(), iResponse); |
|
1003 TEST(EFalse); |
|
1004 } |
|
1005 } |
|
1006 else if(!iNoResponse) // Action in the alert server generates a response |
|
1007 { |
|
1008 if(iQueueResponse) |
|
1009 { |
|
1010 session.NotifyOnResponse(status, time, id); |
|
1011 } |
|
1012 |
|
1013 // wait for notification. |
|
1014 User::WaitForRequest(status); |
|
1015 TAlarmId checkId = (iResponse == EASAltAlertServerResponseClearAll || |
|
1016 iResponse == KErrCancel || |
|
1017 iResponse == ETestActionSetQuietPeriod) ? KNullAlarmId : iId; |
|
1018 |
|
1019 if(iResponse == ETestActionTaskKey) // We should receive a snooze alarm |
|
1020 { |
|
1021 iResponse = EASAltAlertServerResponseSnooze; |
|
1022 } |
|
1023 |
|
1024 else if(iResponse == ETestActionSetQuietPeriod) |
|
1025 { |
|
1026 iResponse = EASAltAlertServerResponseQuietPeriod; |
|
1027 |
|
1028 TRequestStatus quietStatus; |
|
1029 TPckgBuf<TTime> pTime; |
|
1030 |
|
1031 session.TimeWhenQuietPeriodShouldEnd(quietStatus, pTime); |
|
1032 User::WaitForRequest(quietStatus); |
|
1033 |
|
1034 if(pTime() != iTime) |
|
1035 { |
|
1036 TBuf<12> buf1; |
|
1037 TBuf<12> buf2; |
|
1038 |
|
1039 iTime.FormatL(buf1, _L("%H:%S:%T")); |
|
1040 time.FormatL(buf2, _L("%H:%S:%T")); |
|
1041 INFO_PRINTF3(_L("Quiet period doesn't match, expected: %s got: %s"), buf1.PtrZ(), buf2.PtrZ()); |
|
1042 TEST(EFalse); |
|
1043 } |
|
1044 } |
|
1045 |
|
1046 if(status.Int() != iResponse || |
|
1047 id != checkId) |
|
1048 { |
|
1049 INFO_PRINTF5(_L("Response or id doesn't match! id: %i != %i || resonse: %i != %i"), id, checkId, status.Int(), iResponse); |
|
1050 TEST(EFalse); |
|
1051 } |
|
1052 |
|
1053 if(iWaitForUpdate && ReadInt() != 0) // Paused update after the time-out |
|
1054 { |
|
1055 TEST(EFalse); |
|
1056 } |
|
1057 } |
|
1058 |
|
1059 //Clean-up |
|
1060 session.NotifyOnResponseCancel(); |
|
1061 CleanupStack::PopAndDestroy(&session); |
|
1062 StopAlertServer(); |
|
1063 ResetConfigValues(); |
|
1064 |
|
1065 } |
|
1066 |
|
1067 /** |
|
1068 @SYMTestCaseID UIF-UCT-PREQ1118-MAN-AltS-362 |
|
1069 */ |
|
1070 /** |
|
1071 @SYMTestCaseID UIF-UCT-PREQ1118-MAN-AltS-363 |
|
1072 */ |
|
1073 /** |
|
1074 @SYMTestCaseID UIF-UCT-PREQ1118-MAN-AltS-364 |
|
1075 */ |
|
1076 /** |
|
1077 @SYMTestCaseID UIF-UCT-PREQ1118-MAN-AltS-365 |
|
1078 */ |
|
1079 /** |
|
1080 @SYMTestCaseID UIF-UCT-PREQ1118-MAN-AltS-366 |
|
1081 */ |
|
1082 /** |
|
1083 @SYMTestCaseID UIF-UCT-PREQ1118-MAN-AltS-367 |
|
1084 */ |
|
1085 /** |
|
1086 @SYMTestCaseID UIF-UCT-PREQ1118-MAN-AltS-368 |
|
1087 |
|
1088 @SYMPREQ PREQ1118 |
|
1089 |
|
1090 @SYMTestCaseDesc Snooze, Clear, Pause, Silence specified alarms, and cancel notifications |
|
1091 |
|
1092 @SYMTestPriority High |
|
1093 |
|
1094 @SYMTestStatus Implemented |
|
1095 |
|
1096 @SYMTestActions Alert Server in MAN mode; |
|
1097 Create RASClientSession, notify Alarm Server on the 3 alarms in a row (call RASClientSession::SetAlarm() 3 times providing corresponding supplementary data); |
|
1098 (1) Snooze alarm #2 through MEikServAlarm |
|
1099 (2) Clear alarm #2 (via MEikServAlarm). |
|
1100 (3) Pause sound for alarm #2 (via MEikServAlarm) for 1 minute. |
|
1101 (4) Clear all alarms. |
|
1102 (5) Silence alarm #2 through MEikServAlarm. |
|
1103 (6) Cancel alarm notification. |
|
1104 Alert Server in MAN mode; |
|
1105 Create RASClientSession, notify Alarm Server on the 3 alarms in a row (call RASClientSession::SetAlarm() 3 times providing corresponding supplementary data); |
|
1106 (7) Cancel alarm notification. |
|
1107 |
|
1108 @SYMTestExpectedResults Vverify that RASAltClientSession::NotifyOnResponse() triggers, sending back |
|
1109 (1) Snooze message and AlarmId of alarm #2. |
|
1110 (2) Clear message and AlarmId of alarm #2. |
|
1111 (3) Pause sound message and AlarmId of alarm #2. |
|
1112 (4) EASAlertServerResponseClearAll. |
|
1113 (5) proper message and specified AlarmId (alarm #2). |
|
1114 (6) KErrCancel. |
|
1115 (7) KErrCancel. |
|
1116 */ |
|
1117 void CTMultipleAlarmStep::DoNotifyTest1L() |
|
1118 { |
|
1119 // Notify test 1 |
|
1120 SetTestStepID(_L("UIF-UCT-PREQ1118-MAN-AltS-362")); |
|
1121 iMaxAlarms = 3; |
|
1122 iAlarmCount = 3; |
|
1123 iId = 1; |
|
1124 iQueueResponse = ETrue; |
|
1125 iWaitForUpdate = ETrue; |
|
1126 iSnoozeTime = 1; |
|
1127 iResponse = 4; // EASAltAlertServerResponseSnooze |
|
1128 NotifyTestL(); |
|
1129 RecordTestResultL(); |
|
1130 |
|
1131 // Notify test 2 |
|
1132 SetTestStepID(_L("UIF-UCT-PREQ1118-MAN-AltS-363")); |
|
1133 iMaxAlarms = 3; |
|
1134 iAlarmCount = 3; |
|
1135 iId = 1; |
|
1136 iResponse = 2; // EASAltAlertServerResponseClear |
|
1137 NotifyTestL(); |
|
1138 RecordTestResultL(); |
|
1139 |
|
1140 // Notify test 3 |
|
1141 SetTestStepID(_L("UIF-UCT-PREQ1118-MAN-AltS-364")); |
|
1142 iMaxAlarms = 3; |
|
1143 iAlarmCount = 3; |
|
1144 iId = 1; |
|
1145 iSnoozeTime = 1; |
|
1146 iResponse = 5; // EASAltAlertServerResponsePauseSound |
|
1147 NotifyTestL(); |
|
1148 RecordTestResultL(); |
|
1149 |
|
1150 // Notify test 4 |
|
1151 SetTestStepID(_L("UIF-UCT-PREQ1118-MAN-AltS-365")); |
|
1152 iMaxAlarms = 3; |
|
1153 iAlarmCount = 3; |
|
1154 iId = 1; |
|
1155 iResponse = 3; // EASAltAlertServerResponseClearAll |
|
1156 NotifyTestL(); |
|
1157 RecordTestResultL(); |
|
1158 |
|
1159 // Notify test 5 |
|
1160 SetTestStepID(_L("UIF-UCT-PREQ1118-MAN-AltS-366")); |
|
1161 iMaxAlarms = 3; |
|
1162 iAlarmCount = 3; |
|
1163 iId = 1; |
|
1164 iQueueResponse = ETrue; |
|
1165 iResponse = 0; // EASAltAlertServerResponseSilence |
|
1166 NotifyTestL(); |
|
1167 RecordTestResultL(); |
|
1168 |
|
1169 // Notify test 6 |
|
1170 SetTestStepID(_L("UIF-UCT-PREQ1118-MAN-AltS-367")); |
|
1171 iMaxAlarms = 3; |
|
1172 iAlarmCount = 3; |
|
1173 iId = 0; |
|
1174 iCancelNotify = ETrue; |
|
1175 iResponse = -3; // KErrCancel |
|
1176 NotifyTestL(); |
|
1177 RecordTestResultL(); |
|
1178 |
|
1179 // Notify test 7 |
|
1180 SetTestStepID(_L("UIF-UCT-PREQ1118-MAN-AltS-368")); |
|
1181 iMaxAlarms = 1; |
|
1182 iAlarmCount = 1; |
|
1183 iId = 0; |
|
1184 iCancelNotify = ETrue; |
|
1185 iResponse = -3; // KErrCancel |
|
1186 NotifyTestL(); |
|
1187 RecordTestResultL(); |
|
1188 CloseTMSGraphicsStep(); |
|
1189 } |
|
1190 |
|
1191 |
|
1192 /** |
|
1193 @SYMTestCaseID UIF-UCT-PREQ1118-MAN-AltS-373 |
|
1194 */ |
|
1195 /** |
|
1196 @SYMTestCaseID UIF-UCT-PREQ1118-MAN-AltS-374 |
|
1197 */ |
|
1198 /** |
|
1199 @SYMTestCaseID UIF-UCT-PREQ1118-MAN-AltS-375 |
|
1200 */ |
|
1201 /** |
|
1202 @SYMTestCaseID UIF-UCT-PREQ1118-MAN-AltS-376 |
|
1203 |
|
1204 @SYMPREQ PREQ1118 |
|
1205 |
|
1206 @SYMTestCaseDesc TaskKeyPressedL in Alert Server and Quiet period response chain |
|
1207 |
|
1208 @SYMTestPriority High |
|
1209 |
|
1210 @SYMTestStatus Implemented |
|
1211 |
|
1212 @SYMTestActions (1) Alert Server in SAN mode; |
|
1213 Create RASClientSession, notify Alarm Server on the 3 alarms in a row (call RASClientSession::SetAlarm() 3 times providing corresponding supplementary data; |
|
1214 Perform a TaskKeyPressedL in the Alert Server. |
|
1215 (2) Repeat (1) in MAN mode. |
|
1216 (3) Alert Server in SAN mode; |
|
1217 Create RASClientSession, notify Alarm Server on the 3 alarms in a row (call RASClientSession::SetAlarm() 3 times providing corresponding supplementary data; |
|
1218 Perform a SetQuietPeriodL in the Alert Server. |
|
1219 (4) Repeat (3) in MAN mode. |
|
1220 |
|
1221 @SYMTestExpectedResults Verify that RASAltClientSession::NotifyOnResponse() triggers, |
|
1222 (1) Snoozing the specified AlarmId (alarm #1). |
|
1223 (2) Snoozing the specified AlarmId (alarm #1). |
|
1224 (3) and TimeWhenQuietPeriodShouldEnd() returns the correct time. |
|
1225 (4) and TimeWhenQuietPeriodShouldEnd() returns the correct time. |
|
1226 */ |
|
1227 void CTMultipleAlarmStep::DoNotifyTest2L() |
|
1228 { |
|
1229 TDateTime dt; |
|
1230 |
|
1231 // Notify test 1 |
|
1232 SetTestStepID(_L("UIF-UCT-PREQ1118-MAN-AltS-373")); |
|
1233 iMaxAlarms = 1; |
|
1234 iAlarmCount = 3; |
|
1235 iId = 3; |
|
1236 iResponse = 1005; // ETestActionTaskKey |
|
1237 NotifyTestL(); |
|
1238 RecordTestResultL(); |
|
1239 |
|
1240 // Notify test 2 |
|
1241 SetTestStepID(_L("UIF-UCT-PREQ1118-MAN-AltS-374")); |
|
1242 iMaxAlarms = 3; |
|
1243 iAlarmCount = 3; |
|
1244 iId = 2; |
|
1245 iResponse = 1005; // ETestActionTaskKey |
|
1246 NotifyTestL(); |
|
1247 RecordTestResultL(); |
|
1248 |
|
1249 // Notify test 3 |
|
1250 SetTestStepID(_L("UIF-UCT-PREQ1118-MAN-AltS-375")); |
|
1251 iMaxAlarms = 1; |
|
1252 iAlarmCount = 3; |
|
1253 iId = 3; |
|
1254 dt.SetHour(07); |
|
1255 dt.SetMinute(00); |
|
1256 iTime = dt; |
|
1257 iResponse = 1007; // ETestActionSetQuietPeriod |
|
1258 NotifyTestL(); |
|
1259 RecordTestResultL(); |
|
1260 |
|
1261 // Notify test 4 |
|
1262 SetTestStepID(_L("UIF-UCT-PREQ1118-MAN-AltS-376")); |
|
1263 iMaxAlarms = 3; |
|
1264 iAlarmCount = 3; |
|
1265 iId = 2; |
|
1266 dt.SetHour(07); |
|
1267 dt.SetMinute(00); |
|
1268 iTime = dt; |
|
1269 iResponse = 1007; // ETestActionSetQuietPeriod |
|
1270 NotifyTestL(); |
|
1271 RecordTestResultL(); |
|
1272 |
|
1273 CloseTMSGraphicsStep(); |
|
1274 } |
|
1275 |
|
1276 |
|
1277 /** |
|
1278 @SYMTestCaseID UIF-UCT-PREQ1118-MAN-AltS-380 |
|
1279 */ |
|
1280 /** |
|
1281 @SYMTestCaseID UIF-UCT-PREQ1118-MAN-AltS-381 |
|
1282 */ |
|
1283 /** |
|
1284 @SYMTestCaseID UIF-UCT-PREQ1118-MAN-AltS-382 |
|
1285 |
|
1286 @SYMPREQ PREQ1118 |
|
1287 |
|
1288 @SYMTestCaseDesc Snooze specified alarm |
|
1289 |
|
1290 @SYMTestPriority High |
|
1291 |
|
1292 @SYMTestStatus Implemented |
|
1293 |
|
1294 @SYMTestActions Alert Server in MAN mode; |
|
1295 Create RASClientSession, notify Alarm Server on the 3 alarms in a row (call RASClientSession::SetAlarm() 3 times providing corresponding supplementary data); |
|
1296 (1) Snooze alarm #2 through MEikServAlarm with a snooze time out of 0 minutes. |
|
1297 (2) Snooze alarm #2 through MEikServAlarm with a snooze time out of 61 minutes. |
|
1298 (3) Snooze alarm #2 through MEikServAlarm with default snooze timeout. |
|
1299 |
|
1300 @SYMTestExpectedResults Verify that RASAltClientSession::NotifyOnResponse() triggers, |
|
1301 sending back Snooze message and AlarmId of alarm #2 |
|
1302 */ |
|
1303 void CTMultipleAlarmStep::DoNotifyTest3L() |
|
1304 { |
|
1305 // Notify test 1 |
|
1306 SetTestStepID(_L("UIF-UCT-PREQ1118-MAN-AltS-380")); |
|
1307 iMaxAlarms = 3; |
|
1308 iAlarmCount = 3; |
|
1309 iId = 1; |
|
1310 iNoResponse = ETrue; |
|
1311 iSnoozeTime = 0; |
|
1312 iResponse = 4; // EASAltAlertServerResponseSnooze |
|
1313 NotifyTestL(); |
|
1314 RecordTestResultL(); |
|
1315 |
|
1316 // Notify test 2 |
|
1317 SetTestStepID(_L("UIF-UCT-PREQ1118-MAN-AltS-381")); |
|
1318 iMaxAlarms = 3; |
|
1319 iAlarmCount = 3; |
|
1320 iId = 1; |
|
1321 iQueueResponse = ETrue; |
|
1322 iSnoozeTime = 61; |
|
1323 iResponse = 4; // EASAltAlertServerResponseSnooze |
|
1324 NotifyTestL(); |
|
1325 RecordTestResultL(); |
|
1326 |
|
1327 // Notify test 3 |
|
1328 SetTestStepID(_L("UIF-UCT-PREQ1118-MAN-AltS-382")); |
|
1329 iMaxAlarms = 3; |
|
1330 iAlarmCount = 3; |
|
1331 iId = 1; |
|
1332 iQueueResponse = ETrue; |
|
1333 iSnoozeTime = -1; |
|
1334 iResponse = 4; // EASAltAlertServerResponseSnooze |
|
1335 NotifyTestL(); |
|
1336 RecordTestResultL(); |
|
1337 CloseTMSGraphicsStep(); |
|
1338 } |
|
1339 |
|
1340 |
|
1341 /** |
|
1342 @SYMTestCaseID UIF-UCT-PREQ1118-MAN-AltS-386 |
|
1343 */ |
|
1344 /** |
|
1345 @SYMTestCaseID UIF-UCT-PREQ1118-MAN-AltS-387 |
|
1346 */ |
|
1347 /** |
|
1348 @SYMTestCaseID UIF-UCT-PREQ1118-MAN-AltS-388 |
|
1349 */ |
|
1350 /** |
|
1351 @SYMTestCaseID UIF-UCT-PREQ1118-MAN-AltS-389 |
|
1352 |
|
1353 @SYMPREQ PREQ1118 |
|
1354 |
|
1355 @SYMTestCaseDesc Snooze and pause sound for specified alarm |
|
1356 |
|
1357 @SYMTestPriority High |
|
1358 |
|
1359 @SYMTestStatus Implemented |
|
1360 |
|
1361 @SYMTestActions Alert Server in MAN mode; |
|
1362 Create RASClientSession, notify Alarm Server on the 3 alarms in a row (call RASClientSession::SetAlarm() 3 times providing corresponding supplementary data; |
|
1363 (1) Pause sound for alarm #2 (via MEikServAlarm) for 0 minutes.. |
|
1364 (2) Pause sound for alarm #2 (via MEikServAlarm) for 61 minutes. |
|
1365 (3) Pause sound for alarm #2 (via MEikServAlarm) for 120 minutes. |
|
1366 (4) Snooze alarm #2 through MEikServAlarm with a snooze time out of 120 minutes. |
|
1367 |
|
1368 @SYMTestExpectedResults Verify that RASAltClientSession::NotifyOnResponse() triggers, |
|
1369 (1, 2, 3) Sending back PauseSound message and AlarmId of alarm #2. |
|
1370 (4) Sending back Snooze message and AlarmId of alarm #2 |
|
1371 |
|
1372 */ |
|
1373 void CTMultipleAlarmStep::DoNotifyTest4L() |
|
1374 { |
|
1375 // Notify test 1 |
|
1376 SetTestStepID(_L("UIF-UCT-PREQ1118-MAN-AltS-386")); |
|
1377 iMaxAlarms = 3; |
|
1378 iAlarmCount = 3; |
|
1379 iId = 1; |
|
1380 iSnoozeTime = 0; |
|
1381 iNoResponse = ETrue; |
|
1382 iResponse = 5; // EASAltAlertServerResponsePauseSound |
|
1383 NotifyTestL(); |
|
1384 RecordTestResultL(); |
|
1385 |
|
1386 // Notify test 2 |
|
1387 SetTestStepID(_L("UIF-UCT-PREQ1118-MAN-AltS-387")); |
|
1388 iMaxAlarms = 3; |
|
1389 iAlarmCount = 3; |
|
1390 iId = 1; |
|
1391 iSnoozeTime = 61; |
|
1392 iResponse = 5; // EASAltAlertServerResponsePauseSound |
|
1393 NotifyTestL(); |
|
1394 RecordTestResultL(); |
|
1395 |
|
1396 // Notify test 3 |
|
1397 SetTestStepID(_L("UIF-UCT-PREQ1118-MAN-AltS-388")); |
|
1398 iMaxAlarms = 3; |
|
1399 iAlarmCount = 3; |
|
1400 iId = 1; |
|
1401 iSnoozeTime = 120; |
|
1402 iResponse = 5; // EASAltAlertServerResponsePauseSound |
|
1403 NotifyTestL(); |
|
1404 RecordTestResultL(); |
|
1405 |
|
1406 // Notify test 4 |
|
1407 SetTestStepID(_L("UIF-UCT-PREQ1118-MAN-AltS-389")); |
|
1408 iMaxAlarms = 3; |
|
1409 iAlarmCount = 3; |
|
1410 iId = 1; |
|
1411 iSnoozeTime = 120; |
|
1412 iResponse = 4; // EASAltAlertServerResponseSnooze |
|
1413 NotifyTestL(); |
|
1414 RecordTestResultL(); |
|
1415 |
|
1416 CloseTMSGraphicsStep(); |
|
1417 } |
|
1418 |
|
1419 // |
|
1420 // |
|
1421 |
|
1422 |
|
1423 void CTMultipleAlarmStep::ServerDeathTestL() |
|
1424 { |
|
1425 INFO_PRINTF2(_L("Testing Server Death with MaxAlarms=%d"), iMaxAlarms); |
|
1426 TEST(iMaxAlarms > 0); |
|
1427 TEST(iAlarmCount > 0); |
|
1428 |
|
1429 // Start alert server |
|
1430 StartAlertServerL(iMaxAlarms, iMaxAlarms, ETestActionDie); |
|
1431 |
|
1432 RASAltClientSession session; |
|
1433 User::LeaveIfError(session.Connect()); |
|
1434 CleanupClosePushL(session); |
|
1435 |
|
1436 TRequestStatus status; |
|
1437 session.NotifyAlertServerDeath(status); |
|
1438 |
|
1439 // Add alarms |
|
1440 TInt ret = AddAlarmsL(session); |
|
1441 TEST(ret == KErrServerTerminated || ret == KErrNone); // Server may die during AddAlarmsL() |
|
1442 |
|
1443 User::WaitForRequest(status); |
|
1444 TEST(status == KErrServerTerminated); |
|
1445 |
|
1446 //Clean-up |
|
1447 CleanupStack::PopAndDestroy(&session); |
|
1448 StopAlertServer(); |
|
1449 ResetConfigValues(); |
|
1450 } |
|
1451 |
|
1452 /** |
|
1453 @SYMTestCaseID UIF-UCT-PREQ1118-MAN-AltS-371 |
|
1454 */ |
|
1455 /** |
|
1456 @SYMTestCaseID UIF-UCT-PREQ1118-MAN-AltS-372 |
|
1457 |
|
1458 @SYMPREQ PREQ1118 |
|
1459 |
|
1460 @SYMTestCaseDesc Alert Server death |
|
1461 |
|
1462 @SYMTestPriority High |
|
1463 |
|
1464 @SYMTestStatus Implemented |
|
1465 |
|
1466 @SYMTestActions (1) Alert Server in SAN mode; |
|
1467 Create RASClientSession, register for NotifyAlertServerDeath; stop alert server. |
|
1468 (2) Repeat (1) in MAN mode |
|
1469 |
|
1470 @SYMTestExpectedResults NotifyAlertServerDeath should complete. |
|
1471 */ |
|
1472 void CTMultipleAlarmStep::DoServerDeathTestL() |
|
1473 { |
|
1474 // Server Death test 1 |
|
1475 SetTestStepID(_L("UIF-UCT-PREQ1118-MAN-AltS-371")); |
|
1476 iMaxAlarms = 1; |
|
1477 iAlarmCount = 3; |
|
1478 ServerDeathTestL(); |
|
1479 RecordTestResultL(); |
|
1480 |
|
1481 // Sound test 2 |
|
1482 SetTestStepID(_L("UIF-UCT-PREQ1118-MAN-AltS-372")); |
|
1483 iMaxAlarms = 3; |
|
1484 iAlarmCount = 3; |
|
1485 ServerDeathTestL(); |
|
1486 RecordTestResultL(); |
|
1487 CloseTMSGraphicsStep(); |
|
1488 } |
|
1489 |
|
1490 // |
|
1491 // |
|
1492 |
|
1493 |
|
1494 void CTMultipleAlarmStep::SwitchEventTestL() |
|
1495 { |
|
1496 INFO_PRINTF2(_L("Testing SwitchEvent with Action=%d"), iAction); |
|
1497 TEST(iMaxAlarms > 0); |
|
1498 TEST(iAlarmCount > 0); |
|
1499 |
|
1500 // Start alert server |
|
1501 StartAlertServerL(iMaxAlarms, iAlarmCount, iAction, Time::NullTTime(), iSnoozeTime, EFalse, iInitialState); |
|
1502 |
|
1503 RASAltClientSession session; |
|
1504 User::LeaveIfError(session.Connect()); |
|
1505 CleanupClosePushL(session); |
|
1506 |
|
1507 // Add alarms |
|
1508 TEST(AddAlarmsL(session) == KErrNone); |
|
1509 |
|
1510 if(iAction == ETestActionHandleSwitchAndPause) |
|
1511 { |
|
1512 TEST(ReadIntL() == iAction && ReadIntL() == iSnoozeTime); |
|
1513 } |
|
1514 |
|
1515 for(TInt i = 1; i <= iMaxAlarms; ++i) |
|
1516 { |
|
1517 if(iNoResponse) |
|
1518 { |
|
1519 TRAPD(r, ReadIntL()); |
|
1520 INFO_PRINTF1(_L("Checking that we don't receive pause time when we shouldn't")); |
|
1521 TEST(r == KErrUnderflow); |
|
1522 } |
|
1523 else |
|
1524 { |
|
1525 // snooze time is only valid for alarm we operated on. |
|
1526 TInt expectedSnooze = (i == iAlarmCount) ? iExpectedSnoozeTime : 0; |
|
1527 TEST(ReadIntL() == iAction && ReadIntL() == expectedSnooze); |
|
1528 } |
|
1529 } |
|
1530 |
|
1531 //Clean-up |
|
1532 session.NotifyOnResponseCancel(); |
|
1533 CleanupStack::PopAndDestroy(&session); |
|
1534 StopAlertServer(); |
|
1535 ResetConfigValues(); |
|
1536 } |
|
1537 |
|
1538 /** |
|
1539 @SYMTestCaseID UIF-UCT-PREQ1118-MAN-AltS-377 |
|
1540 */ |
|
1541 /** |
|
1542 @SYMTestCaseID UIF-UCT-PREQ1118-MAN-AltS-378 |
|
1543 */ |
|
1544 /** |
|
1545 @SYMTestCaseID UIF-UCT-PREQ1118-MAN-AltS-390 |
|
1546 */ |
|
1547 /** |
|
1548 @SYMTestCaseID UIF-UCT-PREQ1118-MAN-AltS-391 |
|
1549 */ |
|
1550 /** |
|
1551 @SYMTestCaseID UIF-UCT-PREQ1118-MAN-AltS-392 |
|
1552 */ |
|
1553 /** |
|
1554 @SYMTestCaseID UIF-UCT-PREQ1118-MAN-AltS-393 |
|
1555 */ |
|
1556 /** |
|
1557 @SYMTestCaseID UIF-UCT-PREQ1118-MAN-AltS-394 |
|
1558 |
|
1559 @SYMPREQ PREQ1118 |
|
1560 |
|
1561 @SYMTestCaseDesc HandleSwitchOnEvent |
|
1562 |
|
1563 @SYMTestPriority High |
|
1564 |
|
1565 @SYMTestStatus Implemented |
|
1566 |
|
1567 @SYMTestActions (1) Alert Server in SAN mode; |
|
1568 Create RASClientSession, notify Alarm Server on the 3 alarms in a row (call RASClientSession::SetAlarm() 3 times providing corresponding supplementary data; |
|
1569 Perform a HandleSwitchOnEvent in the Alert Server. |
|
1570 (2, 3, 4, 5, 6, 7) Alert Server in MAN mode; |
|
1571 Create RASClientSession, notify Alarm Server on the 3 alarms in a row (call RASClientSession::SetAlarm() 3 times providing |
|
1572 corresponding supplementary data. Each separate test case use different initial alarm state. |
|
1573 Perform a HandleSwitchOnEvent in the Alert Server. |
|
1574 |
|
1575 |
|
1576 @SYMTestExpectedResults UpdateSoundPauseTimeInterval will be called in the Alert Server. |
|
1577 */ |
|
1578 void CTMultipleAlarmStep::DoSwitchEventTestL() |
|
1579 { |
|
1580 // Switch Event test 1 |
|
1581 SetTestStepID(_L("UIF-UCT-PREQ1118-MAN-AltS-377")); |
|
1582 iMaxAlarms = 1; |
|
1583 iAlarmCount = 3; |
|
1584 iAction = 1006; // ETestActionHandleSwitch |
|
1585 SwitchEventTestL(); |
|
1586 RecordTestResultL(); |
|
1587 |
|
1588 // Switch Event test 2 |
|
1589 SetTestStepID(_L("UIF-UCT-PREQ1118-MAN-AltS-378")); |
|
1590 iMaxAlarms = 3; |
|
1591 iAlarmCount = 3; |
|
1592 iAction = 1006; // ETestActionHandleSwitch |
|
1593 SwitchEventTestL(); |
|
1594 RecordTestResultL(); |
|
1595 |
|
1596 // Switch Event test 3 |
|
1597 SetTestStepID(_L("UIF-UCT-PREQ1118-MAN-AltS-390")); |
|
1598 iMaxAlarms = 3; |
|
1599 iAlarmCount = 3; |
|
1600 iAction = 1006; // ETestActionHandleSwitch |
|
1601 SwitchEventTestL(); |
|
1602 RecordTestResultL(); |
|
1603 |
|
1604 // Switch Event test 4 |
|
1605 SetTestStepID(_L("UIF-UCT-PREQ1118-MAN-AltS-391")); |
|
1606 iMaxAlarms = 3; |
|
1607 iAlarmCount = 3; |
|
1608 iNoResponse = ETrue; |
|
1609 iInitialState = 4; // EASAltStateFlagsInQuietPeriod (1 << 2) |
|
1610 iAction = 1006; // ETestActionHandleSwitch |
|
1611 SwitchEventTestL(); |
|
1612 RecordTestResultL(); |
|
1613 |
|
1614 // Switch Event test 5 |
|
1615 SetTestStepID(_L("UIF-UCT-PREQ1118-MAN-AltS-392")); |
|
1616 iMaxAlarms = 3; |
|
1617 iAlarmCount = 3; |
|
1618 iNoResponse = ETrue; |
|
1619 iInitialState = 2; // EASAltStateFlagsSilentRunning (1 << 1) |
|
1620 iAction = 1006; // ETestActionHandleSwitch |
|
1621 SwitchEventTestL(); |
|
1622 RecordTestResultL(); |
|
1623 |
|
1624 // Switch Event test 6 |
|
1625 SetTestStepID(_L("UIF-UCT-PREQ1118-MAN-AltS-393")); |
|
1626 iMaxAlarms = 3; |
|
1627 iAlarmCount = 3; |
|
1628 iNoResponse = ETrue; |
|
1629 iInitialState = 32; // EASAltStateFlagsSilentRunning (1 << 5) |
|
1630 iAction = 1006; // ETestActionHandleSwitch |
|
1631 SwitchEventTestL(); |
|
1632 RecordTestResultL(); |
|
1633 |
|
1634 // Switch Event test 7 |
|
1635 SetTestStepID(_L("UIF-UCT-PREQ1118-MAN-AltS-394")); |
|
1636 iMaxAlarms = 3; |
|
1637 iAlarmCount = 3; |
|
1638 iSnoozeTime = 1; |
|
1639 iExpectedSnoozeTime = 2; |
|
1640 iAction = 1009; // ETestActionHandleSwitchAndPause |
|
1641 SwitchEventTestL(); |
|
1642 RecordTestResultL(); |
|
1643 |
|
1644 CloseTMSGraphicsStep(); |
|
1645 } |
|
1646 |
|
1647 |
|
1648 // |
|
1649 // |
|
1650 |
|
1651 |
|
1652 TInt CTMultipleAlarmStep::RTestSession::Connect(TInt aVersion) |
|
1653 { |
|
1654 const TVersion KVersion(aVersion, KASAltVersionMinor, KASAltVersionBuild); |
|
1655 return CreateSession(KAlarmAlertServerName, KVersion); |
|
1656 } |
|
1657 |
|
1658 TInt CTMultipleAlarmStep::RTestSession::SendOpCode(TInt aOpCode) |
|
1659 { |
|
1660 return SendReceive(aOpCode); |
|
1661 } |
|
1662 |
|
1663 |
|
1664 void CTMultipleAlarmStep::SessionTestL() |
|
1665 { |
|
1666 INFO_PRINTF2(_L("Testing session with SessionCount=%d"), iSessionCount); |
|
1667 TEST(iMaxAlarms > 0); |
|
1668 |
|
1669 const TInt KBadOpcode = 0xffff; |
|
1670 |
|
1671 // Start Alert Server |
|
1672 StartAlertServerL(iMaxAlarms); |
|
1673 |
|
1674 RTestSession session; |
|
1675 TInt ret = session.Connect(iSessionVersion); |
|
1676 if(ret == KErrNone) |
|
1677 { |
|
1678 for(TInt i = 1; i < iSessionCount; ++i) |
|
1679 { |
|
1680 RTestSession failedSession; |
|
1681 |
|
1682 if(failedSession.Connect(iSessionVersion) != KErrArgument) |
|
1683 { |
|
1684 failedSession.Close(); |
|
1685 TEST(EFalse); |
|
1686 } |
|
1687 } |
|
1688 |
|
1689 if(iInvalidOpCode) |
|
1690 { |
|
1691 // Should be the last entry in the enum |
|
1692 TEST(session.SendOpCode(KBadOpcode) == KErrNotSupported); |
|
1693 } |
|
1694 } |
|
1695 else |
|
1696 { |
|
1697 TEST(ret == KErrNotSupported && iSessionVersion != KASAltVersionMajor); |
|
1698 } |
|
1699 |
|
1700 //Clean-up |
|
1701 session.Close(); |
|
1702 StopAlertServer(); |
|
1703 ResetConfigValues(); |
|
1704 } |
|
1705 |
|
1706 /** |
|
1707 @SYMTestCaseID UIF-UCT-PREQ1118-MAN-AltS-383 |
|
1708 */ |
|
1709 /** |
|
1710 @SYMTestCaseID UIF-UCT-PREQ1118-MAN-AltS-384 |
|
1711 */ |
|
1712 /** |
|
1713 @SYMTestCaseID UIF-UCT-PREQ1118-MAN-AltS-385 |
|
1714 |
|
1715 @SYMPREQ PREQ1118 |
|
1716 |
|
1717 @SYMTestCaseDesc Multiple sessions, wrong client, invalid op-code, |
|
1718 |
|
1719 @SYMTestPriority High |
|
1720 |
|
1721 @SYMTestStatus Implemented |
|
1722 |
|
1723 @SYMTestActions Alert Server in MAN mode; |
|
1724 (1) Create multiple client sessions and attempt to connect to alert server. |
|
1725 (2) Attempt to connect to alert server using wrong client major version. |
|
1726 (3) Send an invalid op-code to Alert Server. |
|
1727 |
|
1728 @SYMTestExpectedResults (1) All sessions except the first one should fail to connect with KErrArgument. |
|
1729 (2) Connect call should fail with KErrNotSupported. |
|
1730 (3) Call completes with KErrNotSupported. |
|
1731 */ |
|
1732 void CTMultipleAlarmStep::DoSessionTestL() |
|
1733 { |
|
1734 // Session test 1 |
|
1735 SetTestStepID(_L("UIF-UCT-PREQ1118-MAN-AltS-383")); |
|
1736 iMaxAlarms = 3; |
|
1737 iSessionCount = 3; |
|
1738 iSessionVersion = 3; |
|
1739 SessionTestL(); |
|
1740 RecordTestResultL(); |
|
1741 |
|
1742 // Session test 1 |
|
1743 SetTestStepID(_L("UIF-UCT-PREQ1118-MAN-AltS-384")); |
|
1744 iMaxAlarms = 3; |
|
1745 iSessionCount = 2; |
|
1746 iSessionVersion = 2; |
|
1747 SessionTestL(); |
|
1748 RecordTestResultL(); |
|
1749 |
|
1750 // Session test 1 |
|
1751 SetTestStepID(_L("UIF-UCT-PREQ1118-MAN-AltS-385")); |
|
1752 iMaxAlarms = 3; |
|
1753 iSessionCount = 1; |
|
1754 iSessionVersion = 3; |
|
1755 iInvalidOpCode = ETrue; |
|
1756 SessionTestL(); |
|
1757 RecordTestResultL(); |
|
1758 |
|
1759 CloseTMSGraphicsStep(); |
|
1760 } |
|
1761 |
|
1762 // |
|
1763 // |
|
1764 |
|
1765 |
|
1766 TVerdict CTMultipleAlarmStep::doTestStepL() |
|
1767 { |
|
1768 __UHEAP_MARK; |
|
1769 TRAPD(ret,DoMaxAlarmTestL()); |
|
1770 INFO_PRINTF2(_L(" DoMaxAlarmTestL completes with %d\n"), ret); |
|
1771 TEST(ret==KErrNone); |
|
1772 __UHEAP_MARKEND; |
|
1773 |
|
1774 __UHEAP_MARK; |
|
1775 TRAP(ret,DoAddAlarmTestL()); |
|
1776 INFO_PRINTF2(_L(" DoAddAlarmTestL completes with %d\n"), ret); |
|
1777 TEST(ret==KErrNone); |
|
1778 __UHEAP_MARKEND; |
|
1779 |
|
1780 __UHEAP_MARK; |
|
1781 TRAP(ret,DoDelAlarmTestL()); |
|
1782 INFO_PRINTF2(_L(" DoDelAlarmTestL completes with %d\n"), ret); |
|
1783 TEST(ret==KErrNone); |
|
1784 __UHEAP_MARKEND; |
|
1785 |
|
1786 __UHEAP_MARK; |
|
1787 TRAP(ret,DoSoundTestL()); |
|
1788 INFO_PRINTF2(_L(" DoSoundTestL completes with %d\n"), ret); |
|
1789 TEST(ret==KErrNone); |
|
1790 __UHEAP_MARKEND; |
|
1791 |
|
1792 __UHEAP_MARK; |
|
1793 TRAP(ret,DoVisibleTestL()); |
|
1794 INFO_PRINTF2(_L(" DoVisibleTestL completes with %d\n"), ret); |
|
1795 TEST(ret==KErrNone); |
|
1796 __UHEAP_MARKEND; |
|
1797 |
|
1798 __UHEAP_MARK; |
|
1799 TRAP(ret,DoStateTestL()); |
|
1800 INFO_PRINTF2(_L(" DoStateTestL completes with %d\n"), ret); |
|
1801 TEST(ret==KErrNone); |
|
1802 __UHEAP_MARKEND; |
|
1803 |
|
1804 __UHEAP_MARK; |
|
1805 TRAP(ret,DoQuietTestL()); |
|
1806 INFO_PRINTF2(_L(" DoQuietTestL completes with %d\n"), ret); |
|
1807 TEST(ret==KErrNone); |
|
1808 __UHEAP_MARKEND; |
|
1809 |
|
1810 __UHEAP_MARK; |
|
1811 TRAP(ret,DoNotifyTest1L()); |
|
1812 INFO_PRINTF2(_L(" DoNotifyTest1L completes with %d\n"), ret); |
|
1813 TEST(ret==KErrNone); |
|
1814 __UHEAP_MARKEND; |
|
1815 |
|
1816 __UHEAP_MARK; |
|
1817 TRAP(ret,DoNotifyTest2L()); |
|
1818 INFO_PRINTF2(_L(" DoNotifyTest2L completes with %d\n"), ret); |
|
1819 TEST(ret==KErrNone); |
|
1820 __UHEAP_MARKEND; |
|
1821 |
|
1822 __UHEAP_MARK; |
|
1823 TRAP(ret,DoNotifyTest3L()); |
|
1824 INFO_PRINTF2(_L(" DoNotifyTest3L completes with %d\n"), ret); |
|
1825 TEST(ret==KErrNone); |
|
1826 __UHEAP_MARKEND; |
|
1827 |
|
1828 __UHEAP_MARK; |
|
1829 TRAP(ret,DoNotifyTest4L()); |
|
1830 INFO_PRINTF2(_L(" DoNotifyTest4L completes with %d\n"), ret); |
|
1831 TEST(ret==KErrNone); |
|
1832 __UHEAP_MARKEND; |
|
1833 |
|
1834 __UHEAP_MARK; |
|
1835 TRAP(ret,DoServerDeathTestL()); |
|
1836 INFO_PRINTF2(_L(" DoServerDeathTestL completes with %d\n"), ret); |
|
1837 TEST(ret==KErrNone); |
|
1838 __UHEAP_MARKEND; |
|
1839 |
|
1840 __UHEAP_MARK; |
|
1841 TRAP(ret,DoSwitchEventTestL()); |
|
1842 INFO_PRINTF2(_L(" DoSwitchEventTestL completes with %d\n"), ret); |
|
1843 TEST(ret==KErrNone); |
|
1844 __UHEAP_MARKEND; |
|
1845 |
|
1846 __UHEAP_MARK; |
|
1847 TRAP(ret,DoSessionTestL()); |
|
1848 INFO_PRINTF2(_L(" DoSessionTestL completes with %d\n"), ret); |
|
1849 TEST(ret==KErrNone); |
|
1850 __UHEAP_MARKEND; |
|
1851 |
|
1852 INFO_PRINTF1(_L("Test Completed!")); |
|
1853 return TestStepResult(); |
|
1854 } |
|
1855 |