|
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 // 1. What is the test code testing? |
|
15 // TNotdial has been designed to exercise the API of the extended notifier |
|
16 // framework. The extended notifier framework has |
|
17 // support for priorities, channels, and plugin-in implementation modules --- see the |
|
18 // tplugin.* files. |
|
19 // When the notifier framework is started for the first time Connect is called on |
|
20 // a RNotifier object. The manager is created and Register is called and the plug-in |
|
21 // dll implementing the MEikSrvNotifierbase2 classes: |
|
22 // CMyPhoneNotifierSubject |
|
23 // CMyLEDPhoneNotifierSubject |
|
24 // CMyLEDLowBatteryNotifierSubject |
|
25 // CMyLowBatteryNotifierSubject |
|
26 // CMyAgendaNotifierSubject |
|
27 // CMyLEDAgendaNotifierSubject |
|
28 // is created and registered in the list of notifiers owned by the manager class. |
|
29 // The basic tests performed are starting notifiers, updating notifiers and cancelling |
|
30 // notifiers. Notifiers for phone, agenda and low battery can be requested. Each notifier |
|
31 // has two channels visually displayed as a busy message and dialog in the middle of the |
|
32 // screen. Updates are displayed along the bottom of the screen as info messages. |
|
33 // Messages when starting agenda notifier asynchronously are displayed as info messages |
|
34 // along the top of the screen. The notifiers have been assigned priorities with Low |
|
35 // Battery having the highest and Agenda the lowest. When a notifier is already displayed, |
|
36 // and another request is called on a notifier with a higher notifier priority on the same |
|
37 // channel, the high priority notifier has focus, and the low priority notifier remains |
|
38 // in the background where it can be updated. When a notifier is alreday displayed, and |
|
39 // another request is called on a notifier with a lower priority on the same channel, |
|
40 // nothing happens until the high priority notifier is in an idle state. |
|
41 // 2. The APIs: |
|
42 // ------ class RNotifier |
|
43 // TInt Connect() |
|
44 // Creates a session to the extended notifier server, if the server isn't started already, |
|
45 // it will be started, and the plug-in dll(s) will be loaded. Returns an error code. |
|
46 // Tint StartNotifier(TUid aNotifierUid, const TDesC8& aBuffer,TDes8& aResponse) |
|
47 // When started the two channels for a notifier appear as a busy message and dialog, |
|
48 // horizontally, in the middle of the display. The busy message on the left displays |
|
49 // the contents of aBuffer. |
|
50 // TInt CancelNotifier(TUid aNotifierUid) |
|
51 // This removes the two channels from the screen |
|
52 // TInt UpdateNotifier(TUid aNotifierUid,const TDesC8& aBuffer,TDes8& aResponse) |
|
53 // When a notifier is already displayed and another request is called on a notifier with a higher priority |
|
54 // on the same channel, the high priority notifier has focus and the low priority notifier |
|
55 // remains in updated in the background. Updates are displayed as info messages along the |
|
56 // bottom of the screen --- an info message on the left displays the content of aBuffer |
|
57 // and an info message on the right displays the content of aResponse. If an update is not |
|
58 // possible because the notifier has not been started, then a suitable info message is |
|
59 // displayed in the bottom right hand corner. |
|
60 // void StartNotifierAndGetResponse(TRequestStatus& aRs,TUid aNotifierUid, |
|
61 // const TDesC8& aBuffer,TDes8& aResponse) |
|
62 // This function is only implemented for Agenda. Calling results in Agenda channels |
|
63 // displayed in the middle of screen as expected and an info message at the top left |
|
64 // hand corner of the screen. If the call completes and returns, an info message displays |
|
65 // aResponse at the top right hand corner of the screen. |
|
66 // ------ class MEikSrvNotifierBase |
|
67 // This is a mixin class and the following pure virtual functions from (eiknotapi.h) are |
|
68 // implemented in the plug-in, (see tplugin.* files), for the notifiers |
|
69 // virtual void Release() |
|
70 // Called when all resources allocated by notifiers should be freed. |
|
71 // TNotifierInfo RegisterL() |
|
72 // Called when a notifier is first loaded to allow any initial construction |
|
73 // that is required. |
|
74 // TNotifierInfo Info() const |
|
75 // Packages the notifier info, contains public members: |
|
76 // TUid iUid - The notifier's own uid (e.g KPhoneNotifierUid) |
|
77 // TUid iChannel - a Uid specifying which channel the notifier uses |
|
78 // TNotifierPriority iPriority - the priority channel |
|
79 // TPtrC8 StartL(const TDesC8& aBuffer) |
|
80 // Will be called by the manager to start the notifier, the contents of the |
|
81 // buffer are passed unchanged from RNotifier call (and in the test code displayed |
|
82 // in the busy message representing the LED channel). |
|
83 // void StartL(const TDesC8& aBuffer, const TAny* aReturnVal, RMessage aMessage) |
|
84 // Same as above but asynchronous version. Response is returned to |
|
85 // void StartNotifierAndGetResponse(TRequestStatus& aRs,TUid aNotifierUid, |
|
86 // const TDesC8& aBuffer,TDes8& aResponse) |
|
87 // by calling |
|
88 // aMessage.WriteL(aReturnVal,descriptor). |
|
89 // The test code calls |
|
90 // StartL(const TDesC8& aBuffer), and then aMessage.WriteL(aReturnVal,descriptor), |
|
91 // successful completion is noted by calling |
|
92 // aMessage.Complete(EEikNotExtRequestCompleted); |
|
93 // void Cancel() |
|
94 // Will be called by the manager to stop the notifier. Nothing hapens when a call to |
|
95 // cancel is made on a notifier that hasn't started. Calling cancel in the test code |
|
96 // cancels the busy message and dialog channels. |
|
97 // TPtrC8 UpdateL(const TDesC8& aBuffer) |
|
98 // Will be called by the manager to update an already started notifier, the contents |
|
99 // of aBuffer are passed unchanged from the RNotifier call and can be used by the notifier |
|
100 // implementation. In the test code aBuffer is displayed as an info message at the |
|
101 // bottom left hand corner of the screen. A response is returned to: |
|
102 // TInt UpdateNotifier(TUid aNotifierUid,const TDesC8& aBuffer,TDes8& aResponse) |
|
103 // 3. The test code does not check the error codes returned by StartNotifier, UpdateNotifier |
|
104 // and CancelNotifier. Also code and checks for the responses from |
|
105 // StartL(const TDesC8& aBuffer) are not implemented. Only three of the 5 priority levels |
|
106 // a notifier can have are implemented. |
|
107 // |
|
108 // |
|
109 |
|
110 /** |
|
111 @file |
|
112 @test |
|
113 @internalComponent - Internal Symbian test code |
|
114 */ |
|
115 |
|
116 |
|
117 |
|
118 #include <basched.h> |
|
119 #include <eikenv.h> |
|
120 |
|
121 #include "tnotdial.h" |
|
122 |
|
123 #include "tpluginV2.h" |
|
124 #include "tnotify2v2.h" |
|
125 #include <techview/eikmenup.h> |
|
126 #include <e32test.h> |
|
127 #include "w32std.h" |
|
128 #include <ecom/ecom.h> |
|
129 |
|
130 |
|
131 // globals |
|
132 _LIT(KTNOTDIALResourceFilePath, "z:\\system\\test\\tnotdial\\tnotdial.rsc"); |
|
133 |
|
134 |
|
135 // |
|
136 // Models |
|
137 // |
|
138 |
|
139 /** |
|
140 This method creates an empty control which provides the background for |
|
141 the test step. |
|
142 */ |
|
143 void CEmptyControl::ConstructL(const TRect& aRect) |
|
144 { |
|
145 CreateWindowL(); |
|
146 SetRect(aRect); |
|
147 SetBlank(); |
|
148 ActivateL(); |
|
149 } |
|
150 |
|
151 // |
|
152 // class CTNotdialAppUi |
|
153 // |
|
154 |
|
155 CTNotdialAppUi::CTNotdialAppUi(CTmsTestStep* aTestStep) : |
|
156 CTestAppUi(aTestStep, KTNOTDIALResourceFilePath, R_TNOT_HOTKEYS, R_TDLG_MENUBAR, R_TDLG_TOOLBAR) |
|
157 { |
|
158 } |
|
159 |
|
160 /** |
|
161 This method copies notifiers along with its resource file from ROM to RAM |
|
162 and connects to the extended notifier server. The method also creates an |
|
163 empty control and a periodic timer. Once all the construction is completed |
|
164 it prepares to execute the test step. |
|
165 */ |
|
166 void CTNotdialAppUi::ConstructL() |
|
167 { |
|
168 INFO_PRINTF1(_L("CTNotdialAppUi::ConstructL")); |
|
169 |
|
170 CTestAppUi::ConstructL(); |
|
171 |
|
172 iEmptyControl=new(ELeave) CEmptyControl; |
|
173 iEmptyControl->ConstructL(ClientRect()); |
|
174 |
|
175 INFO_PRINTF1(_L("iNotifier Connect")); |
|
176 User::LeaveIfError(iNotifier.Connect()); |
|
177 iColor[0]=KRgbBlack; |
|
178 iColor[1]=KRgbBlack; |
|
179 iBattTimer = CPeriodic::NewL(CActive::EPriorityIdle); |
|
180 |
|
181 INFO_PRINTF1(_L("Start Auto Test")); |
|
182 |
|
183 iMyPhoneNotifierUid = KMyNewPhoneNotifierUid ; |
|
184 iMySmsNotifierUid = KMyNewSmsNotifierUid ; |
|
185 iMyEmailNotifierUid = KMyNewEmailNotifierUid; |
|
186 iMyLowBatteryNotifierUid =KMyNewLowBatteryNotifierUid ; |
|
187 iMyAgendaAlarmUid =KMyNewAgendaAlarmUid ; |
|
188 |
|
189 AutoTestManager().StartAutoTest(); |
|
190 } |
|
191 |
|
192 CTNotdialAppUi::~CTNotdialAppUi() |
|
193 { |
|
194 delete iEmptyControl; |
|
195 iNotifier.Close(); |
|
196 if(iBattTimer->IsActive()) |
|
197 { |
|
198 iBattTimer->Cancel(); |
|
199 } |
|
200 delete iBattTimer; |
|
201 } |
|
202 |
|
203 /** |
|
204 The method is an override from CTestAppUi. The method initiates tests on |
|
205 public APIs of RNotifier and MEikSrvNotifierBase. |
|
206 */ |
|
207 void CTNotdialAppUi::RunTestStepL(TInt aNextStep) |
|
208 { |
|
209 switch(aNextStep) |
|
210 { |
|
211 case 1: |
|
212 SetTestStepID(_L("UIF-TNotdialStep-TestStep01L")); |
|
213 TestStep01L(); |
|
214 RecordTestResultL(); |
|
215 break; |
|
216 case 2: |
|
217 SetTestStepID(_L("UIF-TNotdialStep-TestStep02L")); |
|
218 TestStep02L(); |
|
219 RecordTestResultL(); |
|
220 break; |
|
221 case 3: |
|
222 SetTestStepID(_L("UIF-TNotdialStep-TestStep03L")); |
|
223 TestStep03L(); |
|
224 RecordTestResultL(); |
|
225 break; |
|
226 case 4: |
|
227 SetTestStepID(_L("UIF-TNotdialStep-TestStep04L")); |
|
228 TestStep04L(); |
|
229 RecordTestResultL(); |
|
230 break; |
|
231 case 5: |
|
232 SetTestStepID(_L("UIF-TNotdialStep-TestStep05L")); |
|
233 TestStep05L(); |
|
234 RecordTestResultL(); |
|
235 break; |
|
236 case 6: |
|
237 SetTestStepID(_L("UIF-TNotdialStep-TestStep06L")); |
|
238 TestStep06L(); |
|
239 RecordTestResultL(); |
|
240 break; |
|
241 case 7: |
|
242 SetTestStepID(_L("UIF-TNotdialStep-TestStep07L")); |
|
243 TestStep07L(); |
|
244 RecordTestResultL(); |
|
245 break; |
|
246 case 8: |
|
247 SetTestStepID(_L("UIF-TNotdialStep-TestStep08L")); |
|
248 TestStep08L(); |
|
249 RecordTestResultL(); |
|
250 break; |
|
251 case 9: |
|
252 SetTestStepID(_L("UIF-TNotdialStep-TestStep09L")); |
|
253 TestStep09L(); |
|
254 RecordTestResultL(); |
|
255 break; |
|
256 case 10: |
|
257 SetTestStepID(_L("UIF-TNotdialStep-TestStep10L")); |
|
258 TestStep10L(); |
|
259 RecordTestResultL(); |
|
260 break; |
|
261 case 11: |
|
262 SetTestStepID(_L("UIF-TNotdialStep-TestStep11L")); |
|
263 TestStep11L(); |
|
264 RecordTestResultL(); |
|
265 break; |
|
266 case 12: |
|
267 SetTestStepID(_L("UIF-TNotdialStep-TestStep12L")); |
|
268 TestStep12L(); |
|
269 RecordTestResultL(); |
|
270 break; |
|
271 case 13: |
|
272 SetTestStepID(_L("UIF-TNotdialStep-TestStep13L")); |
|
273 TestStep13L(); |
|
274 RecordTestResultL(); |
|
275 break; |
|
276 case 14: |
|
277 SetTestStepID(_L("UIF-TNotdialStep-TestStep14L")); |
|
278 TestStep14L(); |
|
279 RecordTestResultL(); |
|
280 break; |
|
281 case 15: |
|
282 SetTestStepID(_L("UIF-TNotdialStep-TestStep15L")); |
|
283 TestStep15L(); |
|
284 RecordTestResultL(); |
|
285 break; |
|
286 case 16: |
|
287 SetTestStepID(_L("UIF-TNotdialStep-TestStep16L")); |
|
288 TestStep16L(); |
|
289 RecordTestResultL(); |
|
290 break; |
|
291 case 17: |
|
292 SetTestStepID(_L("UIF-TNotdialStep-TestStep17L")); |
|
293 TestStep17L(); |
|
294 RecordTestResultL(); |
|
295 break; |
|
296 case 18: |
|
297 SetTestStepID(_L("UIF-TNotdialStep-TestStep18L")); |
|
298 TestStep18L(); |
|
299 RecordTestResultL(); |
|
300 break; |
|
301 case 19: |
|
302 SetTestStepID(_L("UIF-TNotdialStep-TestStep19L")); |
|
303 TestStep19L(); |
|
304 RecordTestResultL(); |
|
305 break; |
|
306 case 20: |
|
307 SetTestStepID(_L("UIF-TNotdialStep-TestStep20L")); |
|
308 TestStep20L(); |
|
309 RecordTestResultL(); |
|
310 break; |
|
311 case 21: |
|
312 SetTestStepID(_L("UIF-TNotdialStep-TestStep21L")); |
|
313 TestStep21L(); |
|
314 RecordTestResultL(); |
|
315 break; |
|
316 case 22: |
|
317 TestStep22L(); |
|
318 break; |
|
319 case 23: |
|
320 SetTestStepID(_L("UIF-TNotdialStep-TestStep23L")); |
|
321 TestStep23L(); |
|
322 RecordTestResultL(); |
|
323 break; |
|
324 case 24: |
|
325 SetTestStepID(_L("UIF-TNotdialStep-TestStep24L")); |
|
326 TestStep24L(); |
|
327 RecordTestResultL(); |
|
328 break; |
|
329 case 25: |
|
330 SetTestStepID(_L("UIF-TNotdialStep-TestStep25L")); |
|
331 TestStep25L(); |
|
332 RecordTestResultL(); |
|
333 break; |
|
334 case 26: |
|
335 SetTestStepID(_L("UIF-TNotdialStep-TestStep26L")); |
|
336 TestStep26L(); |
|
337 RecordTestResultL(); |
|
338 break; |
|
339 case 27: |
|
340 SetTestStepID(_L("UIF-TNotdialStep-TestStep27L")); |
|
341 TestStep27L(); |
|
342 RecordTestResultL(); |
|
343 break; |
|
344 case 28: |
|
345 SetTestStepID(_L("UIF-TNotdialStep-TestStep28L")); |
|
346 TestStep28L(); |
|
347 RecordTestResultL(); |
|
348 break; |
|
349 case 29: |
|
350 SetTestStepID(_L("UIF-NotdialStep-TestStep29L")); |
|
351 TestStep29L(); |
|
352 RecordTestResultL(); |
|
353 break; |
|
354 case 30: |
|
355 SetTestStepID(_L("UIF-NotdialStep-TestStep30L")); |
|
356 TestStep30L(); |
|
357 RecordTestResultL(); |
|
358 break; |
|
359 case 31: |
|
360 SetTestStepID(_L("UIF-NotdialStep-TestStep31L")); |
|
361 TestStep31L(); |
|
362 RecordTestResultL(); |
|
363 break; |
|
364 case 32: |
|
365 SetTestStepID(_L("UIF-NotdialStep-TestStep32L")); |
|
366 TestStep32L(); |
|
367 RecordTestResultL(); |
|
368 CloseTMSGraphicsStep(); |
|
369 break; |
|
370 case 33: |
|
371 { |
|
372 INFO_PRINTF1(_L("Last test case reached -> finishing!")); |
|
373 CTestAppUi::AutoTestManager().FinishAllTestCases(CAutoTestManager::EPass); |
|
374 } |
|
375 default: |
|
376 break; |
|
377 } |
|
378 |
|
379 INFO_PRINTF1(_L("Test case completed\n")); |
|
380 } |
|
381 |
|
382 /** |
|
383 @SYMTestCaseID UIF-TNotdialStep-TestStep01L |
|
384 |
|
385 @SYMPREQ |
|
386 |
|
387 @SYMTestCaseDesc Test RNotifier::StartNotifier() & RNotifier::CancelNotifier() |
|
388 APIs. |
|
389 |
|
390 @SYMTestPriority High |
|
391 |
|
392 @SYMTestStatus Implemented |
|
393 |
|
394 @SYMTestActions The method calls CTNotdialAppUi::HandleCommandL() to test |
|
395 StartNotifier() & CancelNotifier() APIs for the following plug-in notifiers: |
|
396 (a) Phone Ring Notifier. |
|
397 (b) Low Battery Notifier. |
|
398 (c) Agenda Alarm Notifier. |
|
399 |
|
400 @SYMTestExpectedResults The test verifies whether StartNotifier() & |
|
401 CancelNotifier() method returns KErrNone on successful completion of |
|
402 function call. |
|
403 |
|
404 */ |
|
405 void CTNotdialAppUi::TestStep01L() |
|
406 { |
|
407 INFO_PRINTF1(_L(" ------------------------- Test Case 1:")); |
|
408 INFO_PRINTF1(_L("Start Phone Ring Notifier")); |
|
409 HandleCommandL(EAppRingPhone); |
|
410 |
|
411 INFO_PRINTF1(_L("Cancel Phone Ring Notifier")); |
|
412 HandleCommandL(EAppCancelRingPhone); |
|
413 |
|
414 INFO_PRINTF1(_L("Start Low Battery Notifier")); |
|
415 HandleCommandL(EAppLowBattery); |
|
416 |
|
417 INFO_PRINTF1(_L("Cancel Low Battery Notifier")); |
|
418 HandleCommandL(EAppCancelLowBattery); |
|
419 |
|
420 INFO_PRINTF1(_L("Start Agenda Alarm Notifier")); |
|
421 HandleCommandL(EAppAgendaAlarm); |
|
422 |
|
423 INFO_PRINTF1(_L("Cancel Agenda Alarm Notifier")); |
|
424 HandleCommandL(EAppCancelAgendaAlarm); |
|
425 } |
|
426 |
|
427 /** |
|
428 @SYMTestCaseID UIF-TNotdialStep-TestStep02L |
|
429 |
|
430 @SYMPREQ |
|
431 |
|
432 @SYMTestCaseDesc Test cancelling the plug-in notifiers via dialog. |
|
433 |
|
434 @SYMTestPriority High |
|
435 |
|
436 @SYMTestStatus Implemented |
|
437 |
|
438 @SYMTestActions The test method starts the plug-in notifier by calling |
|
439 CTNotdialAppUi::HandleCommandL(). The test then connects to Windows Server |
|
440 and simulates an ENTER key event on the notifier dialog to cancel. This test |
|
441 is carried out for the following plug-in notifiers: |
|
442 (a) Phone Ring Notifier. |
|
443 (b) Low Battery Notifier. |
|
444 (c) Agenda Alarm Notifier. |
|
445 |
|
446 @SYMTestExpectedResults The tests should be able to simulate the ENTER Key |
|
447 for the notifier dialog and cancel the notifier. |
|
448 |
|
449 */ |
|
450 void CTNotdialAppUi::TestStep02L() |
|
451 { |
|
452 INFO_PRINTF1(_L(" ------------------------- Test Case 2:")); |
|
453 RWsSession ws; |
|
454 TKeyEvent event; |
|
455 |
|
456 //Set up key event "enter" to simulate key enter to replace clicking "ok" on dialog. |
|
457 event.iCode=event.iScanCode=EKeyEnter; |
|
458 event.iModifiers=event.iRepeats=0; |
|
459 |
|
460 //Connect to Window Server Session |
|
461 TEST(ws.Connect()==KErrNone); |
|
462 |
|
463 //Start Notifier |
|
464 INFO_PRINTF1(_L("Start Phone Ring Notifier")); |
|
465 HandleCommandL(EAppRingPhone); |
|
466 |
|
467 //Cancel Notifier using dialog |
|
468 INFO_PRINTF1(_L("Cancel Phone Ring Notifier via dialog")); |
|
469 |
|
470 // Simulate key entry and flush the buffer to send event to windows server session. |
|
471 ws.SimulateKeyEvent(event); |
|
472 ws.Flush(); |
|
473 |
|
474 //Low battery notifier |
|
475 INFO_PRINTF1(_L("Start Low Battery Notifier")); |
|
476 HandleCommandL(EAppLowBattery); |
|
477 INFO_PRINTF1(_L("Cancel Low Battery Notifier via dialog")); |
|
478 |
|
479 ws.SimulateKeyEvent(event); |
|
480 ws.Flush(); |
|
481 |
|
482 //Agenda alarm notifier |
|
483 INFO_PRINTF1(_L("Start Agenda Alarm Notifier")); |
|
484 HandleCommandL(EAppAgendaAlarm); |
|
485 |
|
486 INFO_PRINTF1(_L("Cancel Agenda Alarm Notifier via dialog")); |
|
487 |
|
488 ws.SimulateKeyEvent(event); |
|
489 ws.Flush(); |
|
490 ws.Close(); |
|
491 } |
|
492 |
|
493 |
|
494 /** |
|
495 @SYMTestCaseID UIF-TNotdialStep-TestStep03L |
|
496 |
|
497 @SYMPREQ |
|
498 |
|
499 @SYMTestCaseDesc Test RNotifier::UpdateNotifier() API. |
|
500 |
|
501 @SYMTestPriority High |
|
502 |
|
503 @SYMTestStatus Implemented |
|
504 |
|
505 @SYMTestActions The test method starts the plug-in notifier by calling |
|
506 RNotifier::StartNotifier(). It then calls CTNotdialAppUi::AppUpdate() |
|
507 method which calls RNotifier::UpdateNotifier() to update the plug-in |
|
508 notifier identified by the specified UID. The test then cancels the |
|
509 notifier. The test is carried out for the following plug-in notifiers: |
|
510 (a) Phone Ring Notifier. |
|
511 (b) Low Battery Notifier. |
|
512 (c) Agenda Alarm Notifier. |
|
513 |
|
514 @SYMTestExpectedResults The response received from RNotifier::UpdateNotifier() |
|
515 is verified and displayed. |
|
516 |
|
517 */ |
|
518 void CTNotdialAppUi::TestStep03L() |
|
519 { |
|
520 INFO_PRINTF1(_L(" ------------------------- Test Case 3:")); |
|
521 |
|
522 INFO_PRINTF1(_L("Start Low Battery Notifier")); |
|
523 HandleCommandL(EAppLowBattery); |
|
524 |
|
525 INFO_PRINTF1(_L("Update Low Battery Notifier")); |
|
526 HandleCommandL(EAppUpdateLowBattery); |
|
527 |
|
528 INFO_PRINTF1(_L("Cancel Low Battery Notifier")); |
|
529 HandleCommandL(EAppCancelLowBattery); |
|
530 |
|
531 INFO_PRINTF1(_L("Start Low Phone Ring Notifier")); |
|
532 HandleCommandL(EAppRingPhone); |
|
533 |
|
534 INFO_PRINTF1(_L("Update Phone Ring Notifier.")); |
|
535 HandleCommandL(EAppUpdateRingPhone); |
|
536 |
|
537 INFO_PRINTF1(_L("Cancel Phone Ring Notifier")); |
|
538 HandleCommandL(EAppCancelRingPhone); |
|
539 |
|
540 INFO_PRINTF1(_L("Start Agenda Alarm Notifier")); |
|
541 HandleCommandL(EAppAgendaAlarm); |
|
542 |
|
543 INFO_PRINTF1(_L("Update Agenda Alarm Notifier")); |
|
544 HandleCommandL(EAppUpdateAgendaAlarm); |
|
545 |
|
546 INFO_PRINTF1(_L("Cancel Agenda Alarm Notifier")); |
|
547 HandleCommandL(EAppCancelAgendaAlarm); |
|
548 } |
|
549 |
|
550 /** |
|
551 @SYMTestCaseID UIF-TNotdialStep-TestStep04L |
|
552 |
|
553 @SYMPREQ |
|
554 |
|
555 @SYMTestCaseDesc Test RNotifier::UpdateNotifier() API without starting the |
|
556 plug-in notifier. |
|
557 |
|
558 @SYMTestPriority High |
|
559 |
|
560 @SYMTestStatus Implemented |
|
561 |
|
562 @SYMTestActions The method calls CTNotdialAppUi::AddUpdate() which invokes |
|
563 RNotifier::UpdateNotifier() to update the Low Battery Notifier without |
|
564 starting the plug-in notifier. |
|
565 |
|
566 @SYMTestExpectedResults The response received from RNotifier::UpdateNotifier() |
|
567 is verified and displayed. |
|
568 |
|
569 */ |
|
570 void CTNotdialAppUi::TestStep04L() |
|
571 { |
|
572 INFO_PRINTF1(_L(" ------------------------- Test Case 4:")); |
|
573 INFO_PRINTF1(_L("Update Low Battery Notifier")); |
|
574 HandleCommandL(EAppUpdateLowBattery); |
|
575 } |
|
576 |
|
577 /** |
|
578 @SYMTestCaseID UIF-TNotdialStep-TestStep05L |
|
579 |
|
580 @SYMPREQ |
|
581 |
|
582 @SYMTestCaseDesc Test RNotifier::StartNotifier() & RNotifier::CancelNotifier() |
|
583 API. |
|
584 |
|
585 @SYMTestPriority High |
|
586 |
|
587 @SYMTestStatus Implemented |
|
588 |
|
589 @SYMTestActions The method calls RNotifier::StartNotifier() to start |
|
590 (i) Low Battery (ii) Ringing Phone & (iii) Agenda Alarm Notifiers one after |
|
591 the other without cancelling any plug-in notifier. The test then cancels |
|
592 them one after the other in the same order. |
|
593 |
|
594 @SYMTestExpectedResults RNotifier::Cancel() should return KErrNone & only |
|
595 cancel the plug-in notifier specifed by the UID. |
|
596 |
|
597 */ |
|
598 void CTNotdialAppUi::TestStep05L() |
|
599 { |
|
600 INFO_PRINTF1(_L(" ------------------------- Test Case 5:")); |
|
601 INFO_PRINTF1(_L("Start Low Battery Notifier")); |
|
602 HandleCommandL(EAppLowBattery); |
|
603 |
|
604 INFO_PRINTF1(_L("Start Phone Ring Notifier")); |
|
605 HandleCommandL(EAppRingPhone); |
|
606 |
|
607 INFO_PRINTF1(_L("Start Agenda Alarm Notifier")); |
|
608 HandleCommandL(EAppAgendaAlarm); |
|
609 |
|
610 INFO_PRINTF1(_L("Cancel Low Battery Notifier")); |
|
611 HandleCommandL(EAppCancelLowBattery); |
|
612 |
|
613 INFO_PRINTF1(_L("Cancel Phone Ring Notifier")); |
|
614 HandleCommandL(EAppCancelRingPhone); |
|
615 |
|
616 INFO_PRINTF1(_L("Cancel Agenda Alarm Notifier")); |
|
617 HandleCommandL(EAppCancelAgendaAlarm); |
|
618 } |
|
619 |
|
620 /** |
|
621 @SYMTestCaseID UIF-TNotdialStep-TestStep06L |
|
622 |
|
623 @SYMPREQ |
|
624 |
|
625 @SYMTestCaseDesc Test RNotifier::StartNotifier() & RNotifier::CancelNotifier() |
|
626 API. |
|
627 |
|
628 @SYMTestPriority High |
|
629 |
|
630 @SYMTestStatus Implemented |
|
631 |
|
632 @SYMTestActions The method calls RNotifier::StartNotifier() to start notifiers |
|
633 in the order (i) Low Battery (ii) Agenda Alarm & (iii) Ringing Phone |
|
634 Notifier one after the other without cancelling any plug-in notifier. The |
|
635 test then cancels them so that Low Battery notifier is first cancelled |
|
636 followed by Ringing Phone and Agenda Alarm notifier. |
|
637 |
|
638 @SYMTestExpectedResults RNotifier::Cancel() should return KErrNone & only |
|
639 cancel the plug-in notifier specifed by the UID. |
|
640 |
|
641 */ |
|
642 void CTNotdialAppUi::TestStep06L() |
|
643 { |
|
644 INFO_PRINTF1(_L(" ------------------------- Test Case 6:")); |
|
645 INFO_PRINTF1(_L("Start Low Battery Notifier")); |
|
646 HandleCommandL(EAppLowBattery); |
|
647 |
|
648 INFO_PRINTF1(_L("Start Agenda Alarm Notifier")); |
|
649 HandleCommandL(EAppAgendaAlarm); |
|
650 |
|
651 INFO_PRINTF1(_L("Start Phone Ring Notifier")); |
|
652 HandleCommandL(EAppRingPhone); |
|
653 |
|
654 INFO_PRINTF1(_L("Cancel Low Battery Notifier")); |
|
655 HandleCommandL(EAppCancelLowBattery); |
|
656 |
|
657 INFO_PRINTF1(_L("Cancel Phone Ring Notifier")); |
|
658 HandleCommandL(EAppCancelRingPhone); |
|
659 |
|
660 INFO_PRINTF1(_L("Cancel Agenda Alarm Notifier")); |
|
661 HandleCommandL(EAppCancelAgendaAlarm); |
|
662 } |
|
663 |
|
664 |
|
665 /** |
|
666 @SYMTestCaseID UIF-TNotdialStep-TestStep07L |
|
667 |
|
668 @SYMPREQ |
|
669 |
|
670 @SYMTestCaseDesc Test RNotifier::StartNotifier() & RNotifier::CancelNotifier() |
|
671 API. |
|
672 |
|
673 @SYMTestPriority High |
|
674 |
|
675 @SYMTestStatus Implemented |
|
676 |
|
677 @SYMTestActions The method calls RNotifier::StartNotifier() to start notifiers |
|
678 in the order (i) Ringing Phone (ii) Low Battery & (iii) Alarm Agenda Notifier |
|
679 one after the other without cancelling any plug-in notifier. The test then |
|
680 cancels them so that Low Battery notifier is first cancelled followed by |
|
681 Ringing Phone and Agenda Alarm notifier. |
|
682 |
|
683 @SYMTestExpectedResults RNotifier::Cancel() should return KErrNone & only |
|
684 cancel the plug-in notifier specifed by the UID. |
|
685 |
|
686 */ |
|
687 void CTNotdialAppUi::TestStep07L() |
|
688 { |
|
689 INFO_PRINTF1(_L(" ------------------------- Test Case 7:")); |
|
690 INFO_PRINTF1(_L("Start Phone Ring Notifier")); |
|
691 HandleCommandL(EAppRingPhone); |
|
692 |
|
693 INFO_PRINTF1(_L("Start Low Battery Notifier")); |
|
694 HandleCommandL(EAppLowBattery); |
|
695 |
|
696 INFO_PRINTF1(_L("Start Agenda Alarm Notifier")); |
|
697 HandleCommandL(EAppAgendaAlarm); |
|
698 |
|
699 INFO_PRINTF1(_L("Cancel Low Battery Notifier")); |
|
700 HandleCommandL(EAppCancelLowBattery); |
|
701 |
|
702 INFO_PRINTF1(_L("Cancel Phone Ring Notifier")); |
|
703 HandleCommandL(EAppCancelRingPhone); |
|
704 |
|
705 INFO_PRINTF1(_L("Cancel Agenda Alarm Notifier")); |
|
706 HandleCommandL(EAppCancelAgendaAlarm); |
|
707 } |
|
708 |
|
709 /** |
|
710 @SYMTestCaseID UIF-TNotdialStep-TestStep08L |
|
711 |
|
712 @SYMPREQ |
|
713 |
|
714 @SYMTestCaseDesc Test RNotifier::StartNotifier() & RNotifier::CancelNotifier() |
|
715 API. |
|
716 |
|
717 @SYMTestPriority High |
|
718 |
|
719 @SYMTestStatus Implemented |
|
720 |
|
721 @SYMTestActions The method calls RNotifier::StartNotifier() to start notifiers |
|
722 in the order (i) Ringing Phone (ii) Alarm Agenda & (iii) Low Battery |
|
723 Notifiers one after the other without cancelling any plug-in notifier. The |
|
724 test then cancels them so that Low Battery notifier is first cancelled |
|
725 followed by Ringing Phone and Agenda Alarm notifier. |
|
726 |
|
727 @SYMTestExpectedResults RNotifier::Cancel() should return KErrNone & only |
|
728 cancel the plug-in notifier specifed by the UID. |
|
729 |
|
730 */ |
|
731 void CTNotdialAppUi::TestStep08L() |
|
732 { |
|
733 INFO_PRINTF1(_L(" ------------------------- Test Case 8:")); |
|
734 INFO_PRINTF1(_L("Start Phone Ring Notifier")); |
|
735 HandleCommandL(EAppRingPhone); |
|
736 |
|
737 INFO_PRINTF1(_L("Start Agenda Alarm Notifier")); |
|
738 HandleCommandL(EAppAgendaAlarm); |
|
739 |
|
740 INFO_PRINTF1(_L("Start Low Battery Notifier")); |
|
741 HandleCommandL(EAppLowBattery); |
|
742 |
|
743 INFO_PRINTF1(_L("Cancel Low Battery Notifier")); |
|
744 HandleCommandL(EAppCancelLowBattery); |
|
745 |
|
746 INFO_PRINTF1(_L("Cancel Phone Ring Notifier")); |
|
747 HandleCommandL(EAppCancelRingPhone); |
|
748 |
|
749 INFO_PRINTF1(_L("Cancel Agenda Alarm Notifier")); |
|
750 HandleCommandL(EAppCancelAgendaAlarm); |
|
751 } |
|
752 |
|
753 /** |
|
754 @SYMTestCaseID UIF-TNotdialStep-TestStep09L |
|
755 |
|
756 @SYMPREQ |
|
757 |
|
758 @SYMTestCaseDesc Test RNotifier::StartNotifier() & RNotifier::CancelNotifier() |
|
759 API. |
|
760 |
|
761 @SYMTestPriority High |
|
762 |
|
763 @SYMTestStatus Implemented |
|
764 |
|
765 @SYMTestActions The method calls RNotifier::StartNotifier() to start notifiers |
|
766 in the order (i) Alarm Agenda (ii) Ringing Phone & (iii) Low Battery |
|
767 Notifier one after the other without cancelling any plug-in notifier. The |
|
768 test then cancels them so that Low Battery notifier is first cancelled |
|
769 followed by Ringing Phone and Agenda Alarm notifier. |
|
770 |
|
771 @SYMTestExpectedResults RNotifier::Cancel() should return KErrNone & only |
|
772 cancel the plug-in notifier specifed by the UID. |
|
773 |
|
774 */ |
|
775 void CTNotdialAppUi::TestStep09L() |
|
776 { |
|
777 INFO_PRINTF1(_L(" ------------------------- Test Case 9:")); |
|
778 INFO_PRINTF1(_L("Start Agenda Alarm Notifier")); |
|
779 HandleCommandL(EAppAgendaAlarm); |
|
780 |
|
781 INFO_PRINTF1(_L("Start Phone Ring Notifier")); |
|
782 HandleCommandL(EAppRingPhone); |
|
783 |
|
784 INFO_PRINTF1(_L("Start Low Battery Notifier")); |
|
785 HandleCommandL(EAppLowBattery); |
|
786 |
|
787 INFO_PRINTF1(_L("Cancel Low Battery Notifier")); |
|
788 HandleCommandL(EAppCancelLowBattery); |
|
789 |
|
790 INFO_PRINTF1(_L("Cancel Phone Ring Notifier")); |
|
791 HandleCommandL(EAppCancelRingPhone); |
|
792 |
|
793 INFO_PRINTF1(_L("Cancel Agenda Alarm Notifier")); |
|
794 HandleCommandL(EAppCancelAgendaAlarm); |
|
795 } |
|
796 |
|
797 /** |
|
798 @SYMTestCaseID UIF-TNotdialStep-TestStep10L |
|
799 |
|
800 @SYMPREQ |
|
801 |
|
802 @SYMTestCaseDesc Test RNotifier::StartNotifier() & RNotifier::CancelNotifier() |
|
803 API. |
|
804 |
|
805 @SYMTestPriority High |
|
806 |
|
807 @SYMTestStatus Implemented |
|
808 |
|
809 @SYMTestActions The method calls RNotifier::StartNotifier() to start notifiers |
|
810 in the order (i) Alarm Agenda (ii) Low Battery & (iii) Ringing Phone |
|
811 Notifiers one after the other without cancelling any plug-in notifier. The |
|
812 test then cancels them so that Low Battery notifier is first cancelled |
|
813 followed by Ringing Phone and Agenda Alarm notifier. |
|
814 |
|
815 @SYMTestExpectedResults RNotifier::Cancel() should return KErrNone & only |
|
816 cancel the plug-in notifier specifed by the UID. |
|
817 |
|
818 */ |
|
819 void CTNotdialAppUi::TestStep10L() |
|
820 { |
|
821 INFO_PRINTF1(_L(" ------------------------- Test Case 10:")); |
|
822 INFO_PRINTF1(_L("Start Agenda Alarm Notifier")); |
|
823 HandleCommandL(EAppAgendaAlarm); |
|
824 |
|
825 INFO_PRINTF1(_L("Start Low Battery Notifier")); |
|
826 HandleCommandL(EAppLowBattery); |
|
827 |
|
828 INFO_PRINTF1(_L("Start Phone Ring Notifier")); |
|
829 HandleCommandL(EAppRingPhone); |
|
830 |
|
831 INFO_PRINTF1(_L("Cancel Low Battery Notifier")); |
|
832 HandleCommandL(EAppCancelLowBattery); |
|
833 |
|
834 INFO_PRINTF1(_L("Cancel Phone Ring Notifier")); |
|
835 HandleCommandL(EAppCancelRingPhone); |
|
836 |
|
837 INFO_PRINTF1(_L("Cancel Agenda Alarm Notifier")); |
|
838 HandleCommandL(EAppCancelAgendaAlarm); |
|
839 } |
|
840 |
|
841 |
|
842 /** |
|
843 @SYMTestCaseID UIF-TNotdialStep-TestStep11L |
|
844 |
|
845 @SYMPREQ |
|
846 |
|
847 @SYMTestCaseDesc Test RNotifier::StartNotifier() ,RNotifier::CancelNotifier() |
|
848 & RNotifier::UpdateNotifier() APIs. |
|
849 |
|
850 @SYMTestPriority High |
|
851 |
|
852 @SYMTestStatus Implemented |
|
853 |
|
854 @SYMTestActions The method calls RNotifier::StartNotifier() to start Low |
|
855 Battery notifier followed by Phone Ringing Notifier without cancelling any |
|
856 plug-in notifier. The test then calls UpdateNotifier() to update them so |
|
857 that Low Battery notifier is first updated followed by Ringing Phone |
|
858 updation.In the same order these notifiers are cancelled. |
|
859 |
|
860 @SYMTestExpectedResults The message from RNotifier::UpdateNotifer() is verified |
|
861 and recorded. RNotifier::Cancel() should return KErrNone & only cancel the |
|
862 plug-in notifier specifed by the UID. |
|
863 |
|
864 */ |
|
865 void CTNotdialAppUi::TestStep11L() |
|
866 { |
|
867 INFO_PRINTF1(_L(" ------------------------- Test Case 11:")); |
|
868 INFO_PRINTF1(_L("Start Low Battery Notifier")); |
|
869 HandleCommandL(EAppLowBattery); |
|
870 |
|
871 INFO_PRINTF1(_L("Start Phone Ring Notifier")); |
|
872 HandleCommandL(EAppRingPhone); |
|
873 |
|
874 INFO_PRINTF1(_L("Update Low Battery Notifier")); |
|
875 HandleCommandL(EAppUpdateLowBattery); |
|
876 |
|
877 INFO_PRINTF1(_L("Update Phone Ring Notifier.")); |
|
878 HandleCommandL(EAppUpdateRingPhone); |
|
879 |
|
880 INFO_PRINTF1(_L("Cancel Low Battery Notifier")); |
|
881 HandleCommandL(EAppCancelLowBattery); |
|
882 |
|
883 INFO_PRINTF1(_L("Cancel Phone Ring Notifier")); |
|
884 HandleCommandL(EAppCancelRingPhone); |
|
885 } |
|
886 |
|
887 |
|
888 /** |
|
889 @SYMTestCaseID UIF-TNotdialStep-TestStep12L |
|
890 |
|
891 @SYMPREQ |
|
892 |
|
893 @SYMTestCaseDesc Test RNotifier::StartNotifier() ,RNotifier::CancelNotifier() |
|
894 & RNotifier::UpdateNotifier() APIs. |
|
895 |
|
896 @SYMTestPriority High |
|
897 |
|
898 @SYMTestStatus Implemented |
|
899 |
|
900 @SYMTestActions The method calls RNotifier::StartNotifier() to start Phone |
|
901 Ringing notifier followed by Low Battery notifier without cancelling any |
|
902 plug-in notifier. The test then calls UpdateNotifier() to update them so |
|
903 that Low Battery notifier is first updated followed by Phone Ringing |
|
904 updation.Now the Low Battery notifier is cancelled followed by Phone |
|
905 Ringing notifier cancellation. |
|
906 |
|
907 @SYMTestExpectedResults The message from RNotifier::UpdateNotifer() is verified |
|
908 and recorded. RNotifier::Cancel() should return KErrNone & only cancel the |
|
909 plug-in notifier specifed by the UID. |
|
910 |
|
911 */ |
|
912 void CTNotdialAppUi::TestStep12L() |
|
913 { |
|
914 INFO_PRINTF1(_L(" ------------------------- Test Case 12:")); |
|
915 INFO_PRINTF1(_L("Start Phone Ring Notifier")); |
|
916 HandleCommandL(EAppRingPhone); |
|
917 |
|
918 INFO_PRINTF1(_L("Start Low Battery Notifier")); |
|
919 HandleCommandL(EAppLowBattery); |
|
920 |
|
921 INFO_PRINTF1(_L("Update Low Battery Notifier")); |
|
922 HandleCommandL(EAppUpdateLowBattery); |
|
923 |
|
924 INFO_PRINTF1(_L("Update Phone Ring Notifier.")); |
|
925 HandleCommandL(EAppUpdateRingPhone); |
|
926 |
|
927 INFO_PRINTF1(_L("Cancel Low Battery Notifier")); |
|
928 HandleCommandL(EAppCancelLowBattery); |
|
929 |
|
930 INFO_PRINTF1(_L("Cancel Phone Ring Notifier")); |
|
931 HandleCommandL(EAppCancelRingPhone); |
|
932 } |
|
933 |
|
934 |
|
935 /** |
|
936 @SYMTestCaseID UIF-TNotdialStep-TestStep13L |
|
937 |
|
938 @SYMPREQ |
|
939 |
|
940 @SYMTestCaseDesc Test RNotifier::StartNotifier() ,RNotifier::CancelNotifier() |
|
941 & RNotifier::UpdateNotifier() APIs. |
|
942 |
|
943 @SYMTestPriority High |
|
944 |
|
945 @SYMTestStatus Implemented |
|
946 |
|
947 @SYMTestActions The method calls RNotifier::StartNotifier() to start Alarm |
|
948 Agenda notifier followed by Low Battery notifier which is followed by |
|
949 Phone Ringing notifier without cancelling any plug-in notifier. The test |
|
950 then calls UpdateNotifier() to update them so that Phone Ringing notifier |
|
951 is first updated followed by Low Battery notifier updation which is followed |
|
952 by Alarm Agenda notifier updation.The Low Battery notifier is cancelled first, |
|
953 followed by Phone Ringing notifier and Alarm Agenda notifier cancellation. |
|
954 |
|
955 @SYMTestExpectedResults The message from RNotifier::UpdateNotifer() is verified |
|
956 and recorded. RNotifier::Cancel() should return KErrNone & only cancel the |
|
957 plug-in notifier specifed by the UID. |
|
958 |
|
959 */ |
|
960 void CTNotdialAppUi::TestStep13L() |
|
961 { |
|
962 INFO_PRINTF1(_L(" ------------------------- Test Case 13:")); |
|
963 INFO_PRINTF1(_L("Start Agenda Alarm Notifier")); |
|
964 HandleCommandL(EAppAgendaAlarm); |
|
965 |
|
966 INFO_PRINTF1(_L("Start Phone Ring Notifier")); |
|
967 HandleCommandL(EAppRingPhone); |
|
968 |
|
969 INFO_PRINTF1(_L("Start Low Battery Notifier")); |
|
970 HandleCommandL(EAppLowBattery); |
|
971 |
|
972 INFO_PRINTF1(_L("Update Low Battery Notifier")); |
|
973 HandleCommandL(EAppUpdateLowBattery); |
|
974 |
|
975 INFO_PRINTF1(_L("Update Phone Ring Notifier.")); |
|
976 HandleCommandL(EAppUpdateRingPhone); |
|
977 |
|
978 INFO_PRINTF1(_L("Update Agenda Alarm Notifier")); |
|
979 HandleCommandL(EAppUpdateAgendaAlarm); |
|
980 |
|
981 INFO_PRINTF1(_L("Cancel Low Battery Notifier")); |
|
982 HandleCommandL(EAppCancelLowBattery); |
|
983 |
|
984 INFO_PRINTF1(_L("Cancel Phone Ring Notifier")); |
|
985 HandleCommandL(EAppCancelRingPhone); |
|
986 |
|
987 INFO_PRINTF1(_L("Cancel Agenda Alarm Notifier")); |
|
988 HandleCommandL(EAppCancelAgendaAlarm); |
|
989 } |
|
990 |
|
991 /** |
|
992 @SYMTestCaseID UIF-TNotdialStep-TestStep14L |
|
993 |
|
994 @SYMPREQ |
|
995 |
|
996 @SYMTestCaseDesc Test RNotifier::StartNotifier() ,RNotifier::CancelNotifier() |
|
997 & RNotifier::UpdateNotifier() APIs. |
|
998 |
|
999 @SYMTestPriority High |
|
1000 |
|
1001 @SYMTestStatus Implemented |
|
1002 |
|
1003 @SYMTestActions The method calls RNotifier::StartNotifier() to start Phone |
|
1004 Ringing notifier followed by Alarm Agenda notifier and Low Battery |
|
1005 notifier started without cancelling any plug-in notifier. The test then |
|
1006 calls UpdateNotifier() to update them so that Low Battery notifier is first |
|
1007 updated followed by Phone Ringing notifier and Alarm Agenda notifier |
|
1008 updation. Then the Low Battery notifier is cancelled first followed by Phone |
|
1009 Ringing notifier and Alarm Agenda notifier cancellation. |
|
1010 |
|
1011 @SYMTestExpectedResults The message from RNotifier::UpdateNotifer() is verified |
|
1012 and recorded. RNotifier::Cancel() should return KErrNone & only cancel the |
|
1013 plug-in notifier specifed by the UID. |
|
1014 |
|
1015 */ |
|
1016 void CTNotdialAppUi::TestStep14L() |
|
1017 { |
|
1018 INFO_PRINTF1(_L(" ------------------------- Test Case 14:")); |
|
1019 INFO_PRINTF1(_L("Start Phone Ring Notifier")); |
|
1020 HandleCommandL(EAppRingPhone); |
|
1021 |
|
1022 INFO_PRINTF1(_L("Start Agenda Alarm Notifier")); |
|
1023 HandleCommandL(EAppAgendaAlarm); |
|
1024 |
|
1025 INFO_PRINTF1(_L("Start Low Battery Notifier")); |
|
1026 HandleCommandL(EAppLowBattery); |
|
1027 |
|
1028 INFO_PRINTF1(_L("Update Low Battery Notifier")); |
|
1029 HandleCommandL(EAppUpdateLowBattery); |
|
1030 |
|
1031 INFO_PRINTF1(_L("Update Phone Ring Notifier.")); |
|
1032 HandleCommandL(EAppUpdateRingPhone); |
|
1033 |
|
1034 INFO_PRINTF1(_L("Update Agenda Alarm Notifier")); |
|
1035 HandleCommandL(EAppUpdateAgendaAlarm); |
|
1036 |
|
1037 INFO_PRINTF1(_L("Cancel Low Battery Notifier")); |
|
1038 HandleCommandL(EAppCancelLowBattery); |
|
1039 |
|
1040 INFO_PRINTF1(_L("Cancel Phone Ring Notifier")); |
|
1041 HandleCommandL(EAppCancelRingPhone); |
|
1042 |
|
1043 INFO_PRINTF1(_L("Cancel Agenda Alarm Notifier")); |
|
1044 HandleCommandL(EAppCancelAgendaAlarm); |
|
1045 } |
|
1046 |
|
1047 /** |
|
1048 @SYMTestCaseID UIF-TNotdialStep-TestStep15L |
|
1049 |
|
1050 @SYMPREQ |
|
1051 |
|
1052 @SYMTestCaseDesc Test RNotifier::StartNotifier() ,RNotifier::CancelNotifier() |
|
1053 & RNotifier::UpdateNotifier() APIs. |
|
1054 |
|
1055 @SYMTestPriority High |
|
1056 |
|
1057 @SYMTestStatus Implemented |
|
1058 |
|
1059 @SYMTestActions The method calls RNotifier::StartNotifier() to start Low Battery |
|
1060 notifier followed by Phone Ringing notifier and Alarm Agenda notifier |
|
1061 without cancelling any plug-in notifier. The test then calls |
|
1062 UpdateNotifier() to update them so that Low Battery notifier is first |
|
1063 updated followed by Phone Ringing notifier and Alarm Agenda notifier |
|
1064 updation.Then the Low Battery notifier is cancelled first followed by Phone |
|
1065 Ringing notifier and Alarm Agenda notifier cancellation. |
|
1066 |
|
1067 @SYMTestExpectedResults The message from RNotifier::UpdateNotifer() is verified |
|
1068 and recorded. RNotifier::Cancel() should return KErrNone & only cancel the |
|
1069 plug-in notifier specifed by the UID. |
|
1070 |
|
1071 */ |
|
1072 void CTNotdialAppUi::TestStep15L() |
|
1073 { |
|
1074 INFO_PRINTF1(_L(" ------------------------- Test Case 15:")); |
|
1075 INFO_PRINTF1(_L("Start Low Battery Notifier")); |
|
1076 HandleCommandL(EAppLowBattery); |
|
1077 |
|
1078 INFO_PRINTF1(_L("Start Phone Ring Notifier")); |
|
1079 HandleCommandL(EAppRingPhone); |
|
1080 |
|
1081 INFO_PRINTF1(_L("Start Agenda Alarm Notifier")); |
|
1082 HandleCommandL(EAppAgendaAlarm); |
|
1083 |
|
1084 INFO_PRINTF1(_L("Update Low Battery Notifier")); |
|
1085 HandleCommandL(EAppUpdateLowBattery); |
|
1086 |
|
1087 INFO_PRINTF1(_L("Update Phone Ring Notifier.")); |
|
1088 HandleCommandL(EAppUpdateRingPhone); |
|
1089 |
|
1090 INFO_PRINTF1(_L("Update Agenda Alarm Notifier")); |
|
1091 HandleCommandL(EAppUpdateAgendaAlarm); |
|
1092 |
|
1093 INFO_PRINTF1(_L("Cancel Low Battery Notifier")); |
|
1094 HandleCommandL(EAppCancelLowBattery); |
|
1095 |
|
1096 INFO_PRINTF1(_L("Cancel Phone Ring Notifier")); |
|
1097 HandleCommandL(EAppCancelRingPhone); |
|
1098 |
|
1099 INFO_PRINTF1(_L("Cancel Agenda Alarm Notifier")); |
|
1100 HandleCommandL(EAppCancelAgendaAlarm); |
|
1101 } |
|
1102 |
|
1103 /** |
|
1104 @SYMTestCaseID UIF-TNotdialStep-TestStep16L |
|
1105 |
|
1106 @SYMPREQ |
|
1107 |
|
1108 @SYMTestCaseDesc Test RNotifier::StartNotifierAndGetResponse() & |
|
1109 RNotifier:: CancelNotifier() API. |
|
1110 |
|
1111 @SYMTestPriority High |
|
1112 |
|
1113 @SYMTestStatus Implemented |
|
1114 |
|
1115 @SYMTestActions The method connects to the extended notifier server and makes |
|
1116 an asynchronous requests to start the Alarm Agenda plug-in notifier by |
|
1117 calling RNotifier::StartNotifierAndGetResponse(). While the request is |
|
1118 outstanding the test attempts to cancel the Low Battery plug-in notifier |
|
1119 by calling RNotifier::CanelNotifier(). The response from CancelNotifier() |
|
1120 & response message on completion of asynchronous request |
|
1121 StartNotifierAndGetResponse() is observed. |
|
1122 |
|
1123 @SYMTestExpectedResults Test verifies that CancelNotifier returns KErrNone |
|
1124 even though the notifier is not started. It also verifies and displays the |
|
1125 response message on completion of asynchronous request |
|
1126 StartNotifierAndGetResponse() |
|
1127 |
|
1128 */ |
|
1129 void CTNotdialAppUi::TestStep16L() |
|
1130 { |
|
1131 INFO_PRINTF1(_L(" ------------------------- Test Case 16:")); |
|
1132 INFO_PRINTF1(_L("Start Agenda Alarm Notifier Status")); |
|
1133 HandleCommandL(EAppStartAgendaAlarmStatus); |
|
1134 } |
|
1135 |
|
1136 /** |
|
1137 @SYMTestCaseID UIF-TNotdialStep-TestStep17L |
|
1138 |
|
1139 @SYMPREQ |
|
1140 |
|
1141 @SYMTestCaseDesc Test cancelling plug-in notifier started by |
|
1142 RNotifier::StartNotifierAndGetResponse() request. |
|
1143 |
|
1144 @SYMTestPriority High |
|
1145 |
|
1146 @SYMTestStatus Implemented |
|
1147 |
|
1148 @SYMTestActions The method connects to the extended notifier server and makes |
|
1149 an asynchronous requests to start the Alarm Agenda plug-in notifier by |
|
1150 calling RNotifier::StartNotifierAndGetResponse(). Now the Low Battery |
|
1151 plug-in notifier is started by calling RNotifier::StartNotifier(). The test |
|
1152 now cancels the Alarm Agenda notifier followed by Low Battery notifier by |
|
1153 calling RNotifier::CancelNotifier(). |
|
1154 |
|
1155 @SYMTestExpectedResults Test verifies that RNotifier::CancelNotifier returns |
|
1156 KErrNone and cancels the notifier started by asynchronous method |
|
1157 RNotifier::StartNotifierAndGetResponse(). |
|
1158 |
|
1159 */ |
|
1160 void CTNotdialAppUi::TestStep17L() |
|
1161 { |
|
1162 INFO_PRINTF1(_L(" ------------------------- Test Case 17:")); |
|
1163 INFO_PRINTF1(_L("Start Agenda Alarm Notifier Status")); |
|
1164 HandleCommandL(EAppStartAgendaAlarmStatus); |
|
1165 |
|
1166 INFO_PRINTF1(_L("Start Low Battery Notifier")); |
|
1167 HandleCommandL(EAppLowBattery); |
|
1168 |
|
1169 INFO_PRINTF1(_L("Cancel Agenda Alarm Notifier")); |
|
1170 HandleCommandL(EAppCancelAgendaAlarm); |
|
1171 |
|
1172 INFO_PRINTF1(_L("Cancel Low Battery Notifier")); |
|
1173 HandleCommandL(EAppCancelLowBattery); |
|
1174 } |
|
1175 |
|
1176 |
|
1177 /** |
|
1178 @SYMTestCaseID UIF-TNotdialStep-TestStep18L |
|
1179 |
|
1180 @SYMPREQ |
|
1181 |
|
1182 @SYMTestCaseDesc Test StartNotifier(), CancelNotifier() & |
|
1183 StartNotifierAndGetResponse() APIs. |
|
1184 |
|
1185 @SYMTestPriority High |
|
1186 |
|
1187 @SYMTestStatus Implemented |
|
1188 |
|
1189 @SYMTestActions The method initially Starts & Cancels Low Battery plug-in |
|
1190 notifier. Now it starts Alarm Agenda notifer by calling |
|
1191 RNotifier::StartNotifierAndGetResponse(). Now Phone Ringing notifier is |
|
1192 started by calling RNotifier::StartNotifier(). Then the Alarm Agenda |
|
1193 notifier is cancelled followed by cancellation of Phone Ringing notifier. |
|
1194 |
|
1195 @SYMTestExpectedResults Test verifies that RNotifier::CancelNotifier returns |
|
1196 KErrNone and cancels the notifier started by asynchronous method |
|
1197 RNotifier::StartNotifierAndGetResponse(). |
|
1198 |
|
1199 */ |
|
1200 void CTNotdialAppUi::TestStep18L() |
|
1201 { |
|
1202 INFO_PRINTF1(_L(" ------------------------- Test Case 18:")); |
|
1203 |
|
1204 INFO_PRINTF1(_L("Start Low Battery Notifier")); |
|
1205 HandleCommandL(EAppLowBattery); |
|
1206 |
|
1207 INFO_PRINTF1(_L("Cancel Low Battery Notifier")); |
|
1208 HandleCommandL(EAppCancelLowBattery); |
|
1209 |
|
1210 INFO_PRINTF1(_L("Start Agenda Alarm Notifier Status")); |
|
1211 HandleCommandL(EAppStartAgendaAlarmStatus); |
|
1212 |
|
1213 INFO_PRINTF1(_L("Start Phone Ring Notifier")); |
|
1214 HandleCommandL(EAppRingPhone); |
|
1215 |
|
1216 INFO_PRINTF1(_L("Cancel Agenda Alarm Notifier")); |
|
1217 HandleCommandL(EAppCancelAgendaAlarm); |
|
1218 |
|
1219 INFO_PRINTF1(_L("Cancel Phone Ring Notifier")); |
|
1220 HandleCommandL(EAppCancelRingPhone); |
|
1221 } |
|
1222 |
|
1223 /** |
|
1224 @SYMTestCaseID UIF-TNotdialStep-TestStep19L |
|
1225 |
|
1226 @SYMPREQ |
|
1227 |
|
1228 @SYMTestCaseDesc Test RNotifier::StartNotifierAndGetResponse(), RNotifier::StartNotifier() |
|
1229 & RNotifier::CancelNotifier() API. |
|
1230 |
|
1231 @SYMTestPriority High |
|
1232 |
|
1233 @SYMTestStatus Implemented |
|
1234 |
|
1235 @SYMTestActions The method calls RNotifier::StartNotifierAndGetResponse() to |
|
1236 start the Alarm Agenda notifier asynchronously. This is followed by calls |
|
1237 to RNotifier::StartNotifier() to start Low Battery & Phone Ringing Notifiers |
|
1238 one after the other without cancelling any plug-in notifier. The test then |
|
1239 cancels them one after the other in the same order by calling |
|
1240 RNotifier::CancelNotifier(). |
|
1241 |
|
1242 @SYMTestExpectedResults RNotifier::Cancel() should return KErrNone & only |
|
1243 cancel the plug-in notifier specifed by the UID. |
|
1244 |
|
1245 */ |
|
1246 void CTNotdialAppUi::TestStep19L() |
|
1247 { |
|
1248 INFO_PRINTF1(_L(" ------------------------- Test Case 19:")); |
|
1249 INFO_PRINTF1(_L("Start Agenda Alarm Notifier Status")); |
|
1250 HandleCommandL(EAppStartAgendaAlarmStatus); |
|
1251 |
|
1252 INFO_PRINTF1(_L("Start Low Battery Notifier")); |
|
1253 HandleCommandL(EAppLowBattery); |
|
1254 |
|
1255 INFO_PRINTF1(_L("Start Phone Ring Notifier")); |
|
1256 HandleCommandL(EAppRingPhone); |
|
1257 |
|
1258 INFO_PRINTF1(_L("Cancel Agenda Alarm Notifier")); |
|
1259 HandleCommandL(EAppCancelAgendaAlarm); |
|
1260 |
|
1261 INFO_PRINTF1(_L("Cancel Low Battery Notifier")); |
|
1262 HandleCommandL(EAppCancelLowBattery); |
|
1263 |
|
1264 INFO_PRINTF1(_L("Cancel Phone Ring Notifier")); |
|
1265 HandleCommandL(EAppCancelRingPhone); |
|
1266 } |
|
1267 |
|
1268 /** |
|
1269 @SYMTestCaseID UIF-TNotdialStep-TestStep20L |
|
1270 |
|
1271 @SYMPREQ |
|
1272 |
|
1273 @SYMTestCaseDesc Test Starting & Cancelling the SMS plug-in notifier. |
|
1274 |
|
1275 @SYMTestPriority High |
|
1276 |
|
1277 @SYMTestStatus Implemented |
|
1278 |
|
1279 @SYMTestActions The test invokes RNotifier::StartNotifier() by specifying the |
|
1280 UID for SMS plug-in notifier to start the notifier. Then the test cancels |
|
1281 SMS notifier by invoking RNotifier::CancelNotifier(). |
|
1282 |
|
1283 @SYMTestExpectedResults The test verifies that StartNotifier() & |
|
1284 CancelNotifier() returns KErrNone on successful completion. |
|
1285 |
|
1286 */ |
|
1287 void CTNotdialAppUi::TestStep20L() |
|
1288 { |
|
1289 INFO_PRINTF1(_L(" ------------------------- Test Case 20:")); |
|
1290 INFO_PRINTF1(_L("Start SMS Notifier")); |
|
1291 HandleCommandL(EAppNewSms); |
|
1292 |
|
1293 INFO_PRINTF1(_L("Cancel SMS Notifier")); |
|
1294 HandleCommandL(EAppCancelSms); |
|
1295 } |
|
1296 |
|
1297 |
|
1298 /** |
|
1299 @SYMTestCaseID UIF-TNotdialStep-TestStep21L |
|
1300 |
|
1301 @SYMPREQ |
|
1302 |
|
1303 @SYMTestCaseDesc Test cancelling the SMS plug-in notifier via dialog. |
|
1304 |
|
1305 @SYMTestPriority High |
|
1306 |
|
1307 @SYMTestStatus Implemented |
|
1308 |
|
1309 @SYMTestActions The test method starts the SMS plug-in notifier by calling |
|
1310 RNotifier::StartNotifier. The test then connects to Windows Server |
|
1311 and simulates an ENTER key event on the notifier dialog to cancel the SMS |
|
1312 plug-in notifier. |
|
1313 |
|
1314 @SYMTestExpectedResults The simulated ENTER Key on the notifier dialog should |
|
1315 cancel the SMS notifier. |
|
1316 |
|
1317 */ |
|
1318 void CTNotdialAppUi::TestStep21L() |
|
1319 { |
|
1320 INFO_PRINTF1(_L(" ------------------------- Test Case 21:")); |
|
1321 RWsSession ws; |
|
1322 TKeyEvent event; |
|
1323 |
|
1324 INFO_PRINTF1(_L("Start SMS Notifier")); |
|
1325 HandleCommandL(EAppNewSms); |
|
1326 |
|
1327 //Set up key event "enter" to simulate key enter to replace clicking "ok" on dialog. |
|
1328 event.iCode=event.iScanCode=EKeyEnter; |
|
1329 event.iModifiers=event.iRepeats=0; |
|
1330 |
|
1331 //Connect to Window Server Session |
|
1332 TEST(ws.Connect()==KErrNone); |
|
1333 |
|
1334 // Simulate key entry and flush the buffer to send event to windows server session. |
|
1335 ws.SimulateKeyEvent(event); |
|
1336 ws.Flush(); |
|
1337 INFO_PRINTF1(_L("Cancel SMS Notifier via dialog")); |
|
1338 ws.Close(); |
|
1339 } |
|
1340 |
|
1341 |
|
1342 void CTNotdialAppUi::TestStep22L() |
|
1343 { |
|
1344 INFO_PRINTF1(_L(" ------------------------- Test Case 22:")); |
|
1345 INFO_PRINTF1(_L("Start Email Notifier")); |
|
1346 HandleCommandL(EAppNewEmail); |
|
1347 |
|
1348 INFO_PRINTF1(_L("Cancel Email Notifier")); |
|
1349 HandleCommandL(EAppCancelEmail); |
|
1350 } |
|
1351 |
|
1352 /** |
|
1353 @SYMTestCaseID UIF-TNotdialStep-TestStep23L |
|
1354 |
|
1355 @SYMPREQ |
|
1356 |
|
1357 @SYMTestCaseDesc Test cancelling the Email plug-in notifier via dialog. |
|
1358 |
|
1359 @SYMTestPriority High |
|
1360 |
|
1361 @SYMTestStatus Implemented |
|
1362 |
|
1363 @SYMTestActions The test method starts the Email plug-in notifier by calling |
|
1364 RNotifier::StartNotifier. The test then connects to Windows Server |
|
1365 and simulates an ENTER key event on the notifier dialog to cancel the Email |
|
1366 plug-in notifier. |
|
1367 |
|
1368 @SYMTestExpectedResults The simulated ENTER Key on the notifier dialog should |
|
1369 cancel the Email notifier. |
|
1370 |
|
1371 */ |
|
1372 void CTNotdialAppUi::TestStep23L() |
|
1373 { |
|
1374 INFO_PRINTF1(_L(" ------------------------- Test Case 23:")); |
|
1375 RWsSession ws; |
|
1376 TKeyEvent event; |
|
1377 |
|
1378 INFO_PRINTF1(_L("Start Email Notifier")); |
|
1379 HandleCommandL(EAppNewEmail); |
|
1380 |
|
1381 //Set up key event "enter" to simulate key enter to replace clicking "ok" on dialog. |
|
1382 event.iCode=event.iScanCode=EKeyEnter; |
|
1383 event.iModifiers=event.iRepeats=0; |
|
1384 |
|
1385 //Connect to Window Server Session |
|
1386 TEST(ws.Connect()==KErrNone); |
|
1387 |
|
1388 // Simulate key entry and flush the buffer to send event to windows server session. |
|
1389 ws.SimulateKeyEvent(event); |
|
1390 ws.Flush(); |
|
1391 INFO_PRINTF1(_L("Cancel Email Notifier via dialog")); |
|
1392 ws.Close(); |
|
1393 } |
|
1394 |
|
1395 |
|
1396 /** |
|
1397 @SYMTestCaseID UIF-TNotdialStep-TestStep24L |
|
1398 |
|
1399 @SYMPREQ |
|
1400 |
|
1401 @SYMTestCaseDesc Test updating the SMS notifier. |
|
1402 |
|
1403 @SYMTestPriority High |
|
1404 |
|
1405 @SYMTestStatus Implemented |
|
1406 |
|
1407 @SYMTestActions The test method starts the SMS plug-in notifier by invoking |
|
1408 RNotifier::StartNotifier() specifying the UID for SMS plug-in notifier. |
|
1409 It then calls CTNotdialAppUi::AppUpdate() method which calls |
|
1410 RNotifier::UpdateNotifier() to update the SMS plug-in notifier identified |
|
1411 by its UID. The test then cancels the notifier. |
|
1412 |
|
1413 @SYMTestExpectedResults The response received from RNotifier::UpdateNotifier() |
|
1414 is verified and displayed. |
|
1415 |
|
1416 */ |
|
1417 void CTNotdialAppUi::TestStep24L() |
|
1418 { |
|
1419 INFO_PRINTF1(_L(" ------------------------- Test Case 24:")); |
|
1420 INFO_PRINTF1(_L("Start SMS Notifier")); |
|
1421 HandleCommandL(EAppNewSms); |
|
1422 |
|
1423 INFO_PRINTF1(_L("Update SMS Notifier.")); |
|
1424 HandleCommandL(EAppUpdateSms); |
|
1425 |
|
1426 INFO_PRINTF1(_L("Cancel SMS Notifier")); |
|
1427 HandleCommandL(EAppCancelSms); |
|
1428 } |
|
1429 |
|
1430 /** |
|
1431 @SYMTestCaseID UIF-TNotdialStep-TestStep25L |
|
1432 |
|
1433 @SYMPREQ |
|
1434 |
|
1435 @SYMTestCaseDesc Test updating the Email notifier. |
|
1436 |
|
1437 @SYMTestPriority High |
|
1438 |
|
1439 @SYMTestStatus Implemented |
|
1440 |
|
1441 @SYMTestActions The test method starts the Email plug-in notifier by invoking |
|
1442 RNotifier::StartNotifier() specifying the UID for Email plug-in notifier. |
|
1443 It then calls CTNotdialAppUi::AppUpdate() method which calls |
|
1444 RNotifier::UpdateNotifier() to update the Email plug-in notifier identified |
|
1445 by its UID. The test then cancels the notifier. |
|
1446 |
|
1447 @SYMTestExpectedResults The response received from RNotifier::UpdateNotifier() |
|
1448 is verified and displayed. |
|
1449 |
|
1450 */ |
|
1451 void CTNotdialAppUi::TestStep25L() |
|
1452 { |
|
1453 INFO_PRINTF1(_L(" ------------------------- Test Case 25:")); |
|
1454 INFO_PRINTF1(_L("Start Email Notifier")); |
|
1455 HandleCommandL(EAppNewEmail); |
|
1456 |
|
1457 INFO_PRINTF1(_L("Update Email Notifier.")); |
|
1458 HandleCommandL(EAppUpdateEmail); |
|
1459 |
|
1460 INFO_PRINTF1(_L("Cancel Email Notifier")); |
|
1461 HandleCommandL(EAppCancelEmail); |
|
1462 } |
|
1463 |
|
1464 /** |
|
1465 @SYMTestCaseID UIF-TNotdialStep-TestStep26L |
|
1466 |
|
1467 @SYMPREQ |
|
1468 |
|
1469 @SYMTestCaseDesc Test RNotifier::StartNotifier() to start a plug-in notifier |
|
1470 which is invalid. |
|
1471 |
|
1472 @SYMTestPriority High |
|
1473 |
|
1474 @SYMTestStatus Implemented |
|
1475 |
|
1476 @SYMTestActions The test calls RNotifier::StartNotifier() by specifying an |
|
1477 invalid uid for the notifier. |
|
1478 |
|
1479 @SYMTestExpectedResults RNotifier::StartNotifier() should return KErrNotFound |
|
1480 if the UID of notifier is invalid. |
|
1481 |
|
1482 */ |
|
1483 void CTNotdialAppUi::TestStep26L() |
|
1484 { |
|
1485 INFO_PRINTF1(_L(" ------------------------- Test Case 26.")); |
|
1486 INFO_PRINTF1(_L("Test Checking Error Code")); |
|
1487 HandleCommandL(EAppCheckErrorCode); |
|
1488 } |
|
1489 |
|
1490 /** |
|
1491 @SYMTestCaseID UIF-TNotdialStep-TestStep27L |
|
1492 |
|
1493 @SYMPREQ |
|
1494 |
|
1495 @SYMTestCaseDesc Test to start a Low Battery Notifier using a CPeriodic Timer. |
|
1496 |
|
1497 @SYMTestPriority High |
|
1498 |
|
1499 @SYMTestStatus Implemented |
|
1500 |
|
1501 @SYMTestActions The test starts a CPeriodic Timer which invokes callback |
|
1502 method KickOffBatteryNotifierL(). This callback method starts Low Battery |
|
1503 notifier by calling RNotifier::StartNotifier(). |
|
1504 |
|
1505 @SYMTestExpectedResults The response message from StartNotifier() is verified |
|
1506 & displayed. |
|
1507 |
|
1508 */ |
|
1509 void CTNotdialAppUi::TestStep27L() |
|
1510 { |
|
1511 INFO_PRINTF1(_L(" ------------------------- Test Case 27.")); |
|
1512 INFO_PRINTF1(_L("Test Checking Battery On Timer Notifier ")); |
|
1513 HandleCommandL(EAppBatteryNotifiyOnTimer); |
|
1514 } |
|
1515 |
|
1516 |
|
1517 /** |
|
1518 @SYMTestCaseID UIF-TNotdialStep-TestStep28L |
|
1519 |
|
1520 @SYMPREQ |
|
1521 |
|
1522 @SYMTestCaseDesc Test RNotifier::Notify() API. |
|
1523 |
|
1524 @SYMTestPriority High |
|
1525 |
|
1526 @SYMTestStatus Implemented |
|
1527 |
|
1528 @SYMTestActions The method calls RNotifier::Notify() to asynchronously |
|
1529 display a dialog. Then it connects to the Windows server and |
|
1530 simulates an ENTER key event for the dialog to cancel it. |
|
1531 |
|
1532 @SYMTestExpectedResults RNotifier::Notify() should display a dialog and the |
|
1533 simulated key event should cancel the dialog. |
|
1534 |
|
1535 */ |
|
1536 void CTNotdialAppUi::TestStep28L() |
|
1537 { |
|
1538 INFO_PRINTF1(_L(" ------------------------- Test Case 28:")); |
|
1539 RNotifier n; |
|
1540 n.Connect(); |
|
1541 _LIT(KLine1,"Line1 - Select Button2"); |
|
1542 _LIT(KLine2,"Line2 - or press enter"); |
|
1543 _LIT(KButton1,"Button1"); |
|
1544 _LIT(KButton2,"Button2"); |
|
1545 TInt button=-1; |
|
1546 TRequestStatus stat; |
|
1547 INFO_PRINTF1(_L("Testing RNotifier::Notify:")); |
|
1548 n.Notify(KLine1,KLine2,KButton1,KButton2,button,stat); |
|
1549 // Wait for a time to allow the Notifier server to process this |
|
1550 // request and display a dialog before we simulate sending an enter key press |
|
1551 User::After(100000); |
|
1552 |
|
1553 RWsSession ws; |
|
1554 TKeyEvent event; |
|
1555 //Set up key event "enter" to simulate key enter to replace clicking "ok" on dialog. |
|
1556 event.iCode=event.iScanCode=EKeyEnter; |
|
1557 event.iModifiers=event.iRepeats=0; |
|
1558 TEST(ws.Connect()==KErrNone); |
|
1559 |
|
1560 // Simulate key entry and flush the buffer to send |
|
1561 // event to windows server session. |
|
1562 ws.SimulateKeyEvent(event); |
|
1563 ws.Flush(); |
|
1564 INFO_PRINTF1(_L("Cancel Notifier dialog by simulating pressing the enter key")); |
|
1565 ws.Close(); |
|
1566 |
|
1567 // Don't test the button until we know the server has completed the request |
|
1568 User::WaitForRequest(stat); |
|
1569 INFO_PRINTF1(_L("Testing the enter key was pressed:")); |
|
1570 TEST(button==1); |
|
1571 n.Close(); |
|
1572 } |
|
1573 |
|
1574 /** |
|
1575 @SYMTestCaseID UIF-NotdialStep-TestStep29L |
|
1576 |
|
1577 @SYMPREQ |
|
1578 |
|
1579 @SYMTestCaseDesc Tests RNotifer::Notify and notification messages of different threads. |
|
1580 |
|
1581 @SYMTestPriority High |
|
1582 |
|
1583 @SYMTestStatus Implemented |
|
1584 |
|
1585 @SYMTestActions |
|
1586 To create five threads,with a time gap of 5 seconds between creation of the next thread and |
|
1587 to test whether the notification messages of all the five threads are displayed |
|
1588 API Calls: |
|
1589 RNotifer::Notify(const TDesC& aLine1,const TDesC& aLine2,const TDesC& aBut1, |
|
1590 const TDesC& aBut2,TInt& aButtonVal,TRequestStatus& aStatus) |
|
1591 RThread::TInt Create(const TDesC& aName,TThreadFunction aFunction, |
|
1592 TInt aStackSize,RHeap* aHeap,TAny* aPtr,TOwnerType aType=EOwnerProcess) |
|
1593 RThread::Resume() const |
|
1594 RThread::Heap() |
|
1595 RThread::Close() |
|
1596 User::After(TTimeIntervalMicroSeconds32 anInterval) |
|
1597 |
|
1598 @SYMTestExpectedResults The notification messages of all the five threads to be displayed. |
|
1599 |
|
1600 */ |
|
1601 void CTNotdialAppUi::TestStep29L() |
|
1602 { |
|
1603 iNotifierCounter=0; |
|
1604 iMessageCounter=0; |
|
1605 INFO_PRINTF1(_L(" ------------------------- Test Case 29:")); |
|
1606 INFO_PRINTF1(_L("Testing Display of Queued Error Notes")); |
|
1607 _LIT(KMessage1, "Note 1"); |
|
1608 _LIT(KMessage2, "Note 2"); |
|
1609 _LIT(KMessage3, "Note 3"); |
|
1610 _LIT(KMessage4, "Note 4"); |
|
1611 _LIT(KMessage5, "Note 5"); |
|
1612 |
|
1613 iNotifierMessage[0].Set(KMessage1); |
|
1614 iNotifierMessage[1].Set(KMessage2); |
|
1615 iNotifierMessage[2].Set(KMessage3); |
|
1616 iNotifierMessage[3].Set(KMessage4); |
|
1617 iNotifierMessage[4].Set(KMessage5); |
|
1618 |
|
1619 // Launch a thread to pop up an error note |
|
1620 RThread one; |
|
1621 one.Create(KMessage1,NotifyFunc, 4096, NULL, (void*) this); |
|
1622 one.Resume(); |
|
1623 one.Close(); |
|
1624 // Wait for a bit (5 secs) |
|
1625 User::After(1000000); |
|
1626 // Launch another thread to pop up an error note |
|
1627 RThread two; |
|
1628 two.Create(KMessage2,NotifyFunc, 4096, NULL, (void*) this); |
|
1629 two.Resume(); |
|
1630 two.Close(); |
|
1631 // Wait for a bit more (5 secs) |
|
1632 User::After(1000000); |
|
1633 // Launch another thread to pop up an error note |
|
1634 RThread three; |
|
1635 three.Create(KMessage3,NotifyFunc, 4096, NULL, (void*) this); |
|
1636 three.Resume(); |
|
1637 three.Close(); |
|
1638 // Wait for a bit more (5 secs) |
|
1639 User::After(1000000); |
|
1640 // Launch another thread to pop up an error note |
|
1641 RThread four; |
|
1642 four.Create(KMessage4, NotifyFunc, 4096, NULL, (void*) this); |
|
1643 four.Resume(); |
|
1644 four.Close(); |
|
1645 // Wait for a bit more (5 secs) |
|
1646 User::After(1000000); |
|
1647 // Launch another thread to pop up an error note |
|
1648 RThread five; |
|
1649 five.Create(KMessage5, NotifyFunc, 4096, NULL, (void*) this); |
|
1650 five.Resume(); |
|
1651 five.Close(); |
|
1652 // Wait for a bit more (5 secs) |
|
1653 User::After(1000000); |
|
1654 while(iNotifierCounter<5) |
|
1655 { |
|
1656 User::After(2000000); |
|
1657 } |
|
1658 } |
|
1659 |
|
1660 /** |
|
1661 @SYMTestCaseID UIF-NotdialStep-TestStep30L |
|
1662 |
|
1663 @SYMPREQ INC079968 |
|
1664 |
|
1665 @SYMTestCaseDesc Tests activation and cancellation of Agenda Alarm, Low Battery notifier. |
|
1666 |
|
1667 |
|
1668 @SYMTestPriority High |
|
1669 |
|
1670 @SYMTestStatus Implemented |
|
1671 |
|
1672 @SYMTestActions |
|
1673 Activate the agenda alarm and low battery notifiers. |
|
1674 Update then cancel the agenda alarm and low battery notifiers.. |
|
1675 |
|
1676 |
|
1677 @SYMTestExpectedResults Both notifiers are activated and cancelled susccessfully. |
|
1678 |
|
1679 */ |
|
1680 |
|
1681 void CTNotdialAppUi::TestStep30L() |
|
1682 { |
|
1683 INFO_PRINTF1(_L(" ------------------------- Test Case 30:")); |
|
1684 INFO_PRINTF1(_L("Start Agenda Alarm Notifier")); |
|
1685 HandleCommandL(EAppAgendaAlarm); |
|
1686 |
|
1687 INFO_PRINTF1(_L("Start Low Battery Notifier")); |
|
1688 HandleCommandL(EAppLowBattery); |
|
1689 |
|
1690 INFO_PRINTF1(_L("Update Agenda Alarm Notifier Status")); |
|
1691 HandleCommandL(EAppUpdateAgendaAlarmStatus); |
|
1692 |
|
1693 INFO_PRINTF1(_L("Cancel Agenda Alarm Notifier")); |
|
1694 HandleCommandL(EAppCancelAgendaAlarm); |
|
1695 |
|
1696 INFO_PRINTF1(_L("Cancel Low Battery Notifier")); |
|
1697 HandleCommandL(EAppCancelLowBattery); |
|
1698 } |
|
1699 |
|
1700 |
|
1701 /** |
|
1702 @SYMTestCaseID UIF-NotdialStep-TestStep31L |
|
1703 |
|
1704 @SYMDEF INC079968 |
|
1705 |
|
1706 @SYMTestCaseDesc Verifies that messages are completed if the corresponding notifier is inactive. |
|
1707 |
|
1708 @SYMTestPriority High |
|
1709 |
|
1710 @SYMTestStatus Implemented |
|
1711 |
|
1712 @SYMTestActions |
|
1713 Attempt to send a message to the inactive agenda alarm notifier. |
|
1714 Observe that the message completes i.e. the test step continues. |
|
1715 |
|
1716 @SYMTestExpectedResults Messages sent to inactive notifiers complete. |
|
1717 */ |
|
1718 void CTNotdialAppUi::TestStep31L() |
|
1719 { |
|
1720 INFO_PRINTF1(_L(" ------------------------- Test Case 31:")); |
|
1721 INFO_PRINTF1(_L("Update Agenda Alarm Notifier Status after it was cancelled")); |
|
1722 HandleCommandL(EAppUpdateAgendaAlarmStatus); |
|
1723 |
|
1724 } |
|
1725 |
|
1726 /** |
|
1727 @SYMTestCaseID UIF-NotdialStep-TestStep32L |
|
1728 |
|
1729 @SYMDEF DEF113741 |
|
1730 |
|
1731 @SYMTestCaseDesc Verifies that attempting to cancel a notifier that doesn't exist returns the required error code |
|
1732 |
|
1733 @SYMTestPriority High |
|
1734 |
|
1735 @SYMTestStatus Implemented |
|
1736 |
|
1737 @SYMTestActions |
|
1738 Call RNotifier::CancelNotifier() with the UID of a notifier that hasn't been started. |
|
1739 |
|
1740 |
|
1741 @SYMTestExpectedResults RNotifier::CancelNotifier() returns KErrNotFound. |
|
1742 */ |
|
1743 void CTNotdialAppUi::TestStep32L() |
|
1744 { |
|
1745 INFO_PRINTF1(_L(" ------------------------- Test Case 32:")); |
|
1746 INFO_PRINTF1(_L("Cancelling a notifier that hasn't been started.\n")); |
|
1747 const TUid KNotifierNotExistUid = {0x1fffffff}; |
|
1748 TInt err = iNotifier.CancelNotifier(KNotifierNotExistUid); |
|
1749 INFO_PRINTF4(_L("RNotifier::Cancel(%x) returned '%D', expected '%D'"), KNotifierNotExistUid.iUid, err, KErrNotFound); |
|
1750 TEST(KErrNotFound == err); |
|
1751 } |
|
1752 |
|
1753 /** |
|
1754 The method creates a session with Notifier server for each of the five threads. |
|
1755 The notification message for each thread is displayed after a simulated lapse |
|
1756 of 10 seconds |
|
1757 */ |
|
1758 TInt CTNotdialAppUi::NotifyFunc(TAny *aPtr) |
|
1759 { |
|
1760 CTNotdialAppUi* notdialAppUi=(CTNotdialAppUi*)aPtr; |
|
1761 _LIT(KLine2,"Line2 - or press enter"); |
|
1762 _LIT(KButton1,"Button1"); |
|
1763 _LIT(KButton2,"Button2"); |
|
1764 TRequestStatus status; |
|
1765 TInt response; |
|
1766 RNotifier session; |
|
1767 session.Connect(); |
|
1768 session.Notify(notdialAppUi->iNotifierMessage[notdialAppUi->iMessageCounter++], KLine2, KButton1, KButton2, response, status); |
|
1769 //wait for 10 seconds and then dismiss the first queued message to check whether |
|
1770 //the other queued message in the notifier server are popped up. |
|
1771 User::After(10000000); |
|
1772 RWsSession ws; |
|
1773 TKeyEvent event; |
|
1774 //Set up key event "enter" to simulate key enter to replace clicking "ok" on dialog. |
|
1775 event.iCode=event.iScanCode=EKeyEnter; |
|
1776 event.iModifiers = event.iRepeats = 0; |
|
1777 |
|
1778 TInt err = ws.Connect(); |
|
1779 if(err==KErrNone) |
|
1780 { |
|
1781 // Simulate key entry and flush the buffer to send event to windows server session. |
|
1782 ws.SimulateKeyEvent(event); |
|
1783 ws.Flush(); |
|
1784 ws.Close(); |
|
1785 } |
|
1786 User::WaitForRequest(status); |
|
1787 notdialAppUi->iNotifierCounter++; |
|
1788 session.Close(); |
|
1789 return err; |
|
1790 } |
|
1791 |
|
1792 /** |
|
1793 This method is an oveerride from CCoeAppUi. It is used to handle key events. |
|
1794 */ |
|
1795 TKeyResponse CTNotdialAppUi::HandleKeyEventL(const TKeyEvent& /*aKeyEvent*/,TEventCode /*aType*/) |
|
1796 { |
|
1797 return EKeyWasNotConsumed; |
|
1798 } |
|
1799 |
|
1800 /** |
|
1801 This is an override from CEikAppUi. It is used to handle user commands. |
|
1802 */ |
|
1803 void CTNotdialAppUi::HandleCommandL(TInt aCommand) |
|
1804 { |
|
1805 TInt ret=KErrNotFound; |
|
1806 TBuf8<256> response; |
|
1807 response.SetMax(); |
|
1808 |
|
1809 User::After(TTimeIntervalMicroSeconds32(100000)); |
|
1810 |
|
1811 CEikonEnv* eikEnv=CEikonEnv::Static(); |
|
1812 |
|
1813 if (iNotifier.Handle()==KNullHandle) |
|
1814 { |
|
1815 User::LeaveIfError(iNotifier.Connect()); |
|
1816 } |
|
1817 |
|
1818 _LIT8(KMessagePhone, "Phone Ringing"); |
|
1819 _LIT8(KMessageBattery, "Low Battery"); |
|
1820 _LIT8(KMessageAgenda, "Agenda Alarm"); |
|
1821 _LIT8(KMessageSms, "New Sms"); |
|
1822 _LIT8(KMessageEmail, "New Email"); |
|
1823 |
|
1824 const TUid KRubbishUid={0x11111234}; |
|
1825 |
|
1826 switch (aCommand) |
|
1827 { |
|
1828 case EAppRingPhone: |
|
1829 ret=iNotifier.StartNotifier(iMyPhoneNotifierUid,KMessagePhone); |
|
1830 INFO_PRINTF3(_L("Start Phone Notifier returned :%d MyPhoneNotifierUid[%x]"), ret, iMyPhoneNotifierUid.iUid); |
|
1831 TEST (ret==KErrNone); |
|
1832 break; |
|
1833 case EAppNewSms: |
|
1834 ret=iNotifier.StartNotifier(iMySmsNotifierUid,KMessageSms,response); |
|
1835 INFO_PRINTF3(_L("Start SMS Notifier returned: %d MySmsNotifierUid[%x]"), ret, iMySmsNotifierUid.iUid); |
|
1836 TEST (ret==KErrNone); |
|
1837 break; |
|
1838 case EAppNewEmail: |
|
1839 ret=iNotifier.StartNotifier(iMyEmailNotifierUid,KMessageEmail,response); |
|
1840 INFO_PRINTF3(_L("Start Email Notifier returned: %d MyEmailNotifierUid[%x]"), ret, iMyEmailNotifierUid.iUid); |
|
1841 TEST (ret==KErrNone); |
|
1842 break; |
|
1843 case EAppLowBattery: |
|
1844 ret=iNotifier.StartNotifier(iMyLowBatteryNotifierUid,KMessageBattery,response); |
|
1845 INFO_PRINTF3(_L("Start Low Battery Notifier returned: %d MyLowBatteryNotifierUid[%x]"), ret,iMyLowBatteryNotifierUid.iUid); |
|
1846 TEST (ret==KErrNone); |
|
1847 break; |
|
1848 case EAppAgendaAlarm: |
|
1849 ret=iNotifier.StartNotifier(iMyAgendaAlarmUid,KMessageAgenda,response); |
|
1850 INFO_PRINTF3(_L("Start Agenda Alarm Notifier returned: %d MyAgendaAlarmUid[%x]"), ret,iMyAgendaAlarmUid.iUid); |
|
1851 TEST (ret==KErrNone); |
|
1852 break; |
|
1853 case EAppCancelRingPhone: |
|
1854 ret=iNotifier.CancelNotifier(iMyPhoneNotifierUid); |
|
1855 INFO_PRINTF3(_L("Cancel Phone Notifier returned: %d MyPhoneNotifierUid[%x]"), ret,iMyPhoneNotifierUid.iUid); |
|
1856 TEST (ret==KErrNone); |
|
1857 break; |
|
1858 case EAppCancelSms: |
|
1859 ret=iNotifier.CancelNotifier(iMySmsNotifierUid); |
|
1860 INFO_PRINTF3(_L("Cancel SMS Notifier returned: %d MySmsNotifierUid[%x]"), ret,iMySmsNotifierUid.iUid); |
|
1861 TEST (ret==KErrNone); |
|
1862 break; |
|
1863 case EAppCancelEmail: |
|
1864 ret=iNotifier.CancelNotifier(iMyEmailNotifierUid); |
|
1865 INFO_PRINTF3(_L("Cancel Email Notifier returned: %d MyEmailNotifierUid[%x]"), ret,iMyEmailNotifierUid.iUid); |
|
1866 TEST (ret==KErrNone); |
|
1867 break; |
|
1868 case EAppCancelLowBattery: |
|
1869 ret=iNotifier.CancelNotifier(iMyLowBatteryNotifierUid); |
|
1870 INFO_PRINTF3(_L("Cancel Low Battery Notifier returned: %d MyLowBatteryNotifierUid[%x]"), ret,iMyLowBatteryNotifierUid.iUid); |
|
1871 TEST (ret==KErrNone); |
|
1872 break; |
|
1873 case EAppCancelAgendaAlarm: |
|
1874 ret=iNotifier.CancelNotifier(iMyAgendaAlarmUid); |
|
1875 INFO_PRINTF3(_L("Cancel Agenda Notifier returned: %d MyAgendaAlarmUid[%x]"), ret,iMyAgendaAlarmUid.iUid); |
|
1876 TEST (ret==KErrNone); |
|
1877 break; |
|
1878 case EAppUpdateRingPhone: |
|
1879 { |
|
1880 INFO_PRINTF2(_L("Calling Phone Update MyPhoneNotifierUid[%x]"),iMyPhoneNotifierUid.iUid); |
|
1881 _LIT8(KMessage, "Calling Sms Update"); |
|
1882 AppUpdate(iMyPhoneNotifierUid,KMessage(),eikEnv,response); |
|
1883 } |
|
1884 break; |
|
1885 case EAppUpdateSms: |
|
1886 { |
|
1887 INFO_PRINTF2(_L("Calling Sms Update MySmsNotifierUid[%x]"),iMySmsNotifierUid.iUid); |
|
1888 _LIT8(KMessage, "Calling Sms Update"); |
|
1889 AppUpdate(iMySmsNotifierUid,KMessage(),eikEnv,response); |
|
1890 } |
|
1891 break; |
|
1892 case EAppUpdateEmail: |
|
1893 { |
|
1894 INFO_PRINTF2(_L("Calling Email Update MyEmailNotifierUid[%x]"),iMyEmailNotifierUid.iUid); |
|
1895 _LIT8(KMessage, "Calling Email Update"); |
|
1896 AppUpdate(iMyEmailNotifierUid,KMessage(),eikEnv,response); |
|
1897 } |
|
1898 break; |
|
1899 case EAppUpdateLowBattery: |
|
1900 { |
|
1901 INFO_PRINTF2(_L("Calling Low Battery Update MyLowBatteryNotifierUid[%x]"),iMyLowBatteryNotifierUid.iUid); |
|
1902 _LIT8(KMessage, "Calling Low Battery Update"); |
|
1903 AppUpdate(iMyLowBatteryNotifierUid,KMessage(),eikEnv,response); |
|
1904 } |
|
1905 break; |
|
1906 case EAppUpdateAgendaAlarm: |
|
1907 { |
|
1908 INFO_PRINTF2(_L("Calling Agenda Update MyAgendaAlarmUid[%x]"),iMyAgendaAlarmUid.iUid); |
|
1909 _LIT8(KMessage, "Calling Agenda Update"); |
|
1910 AppUpdate(iMyAgendaAlarmUid,KMessage(),eikEnv,response); |
|
1911 |
|
1912 } |
|
1913 break; |
|
1914 case EAppStartAgendaAlarmStatus: |
|
1915 { |
|
1916 if (iNotifier.Handle()==KNullHandle) |
|
1917 { |
|
1918 User::LeaveIfError(iNotifier.Connect()); |
|
1919 } |
|
1920 _LIT(KMessage,"Agenda:Status Request"); |
|
1921 _LIT(KRequestQMsg,"Agenda Alarm:Request Queued"); |
|
1922 _LIT(KNotifExists,"Agenda Alarm Already Exists"); |
|
1923 _LIT(KNotifNotFound,"Agenda Alarm notifier not found"); |
|
1924 |
|
1925 TRequestStatus status=KRequestPending; |
|
1926 INFO_PRINTF2(_L("StartNotifierAndGetResponse for MyAgendaAlarmUid [%x]"),iMyAgendaAlarmUid.iUid ); |
|
1927 |
|
1928 iNotifier.StartNotifierAndGetResponse(status,iMyAgendaAlarmUid,KMessageAgenda,response); |
|
1929 |
|
1930 INFO_PRINTF2(_L(">>call cancel low battery notifier MyLowBatteryNotifierUid[%x]"),iMyLowBatteryNotifierUid.iUid); |
|
1931 |
|
1932 //issue new call while request pending |
|
1933 TInt error=iNotifier.CancelNotifier(iMyLowBatteryNotifierUid); |
|
1934 TGulAlignment messageAlignment=EHLeftVTop; |
|
1935 eikEnv->InfoMsgWithAlignment(messageAlignment,KMessage); |
|
1936 INFO_PRINTF3(_L("cancel low battery notifier MyLowBatteryNotifierUid[%x] returned[%d]"),iMyLowBatteryNotifierUid.iUid,error); |
|
1937 User::WaitForRequest(status); |
|
1938 messageAlignment=EHRightVTop; |
|
1939 if (status.Int() == (TInt)EEikNotExtRequestQueued) |
|
1940 { |
|
1941 INFO_PRINTF1(_L(">>request queued")); |
|
1942 eikEnv->InfoMsgWithAlignment(messageAlignment,KRequestQMsg); |
|
1943 } |
|
1944 else if (status.Int() == (TInt)KErrAlreadyExists) |
|
1945 { |
|
1946 INFO_PRINTF1(_L(">>notifier exists")); |
|
1947 eikEnv->InfoMsgWithAlignment(messageAlignment,KNotifExists); |
|
1948 } |
|
1949 else if(status.Int() == (TInt)KErrNone) |
|
1950 { |
|
1951 INFO_PRINTF1(_L(">>request completed successfully")); |
|
1952 TBuf<256> buffer; |
|
1953 buffer.Copy(response); |
|
1954 INFO_PRINTF1(buffer); |
|
1955 eikEnv->InfoMsgWithAlignment(messageAlignment,buffer); |
|
1956 } |
|
1957 else if(status.Int() == (TInt)KErrNotFound) |
|
1958 { |
|
1959 INFO_PRINTF1(KNotifNotFound); |
|
1960 } |
|
1961 else |
|
1962 { |
|
1963 INFO_PRINTF2(_L("************ request completed with an error: %d"), status.Int()); |
|
1964 } |
|
1965 } |
|
1966 break; |
|
1967 case EAppUpdateAgendaAlarmStatus: |
|
1968 { |
|
1969 _LIT(KNotifNotFound,"Agenda Alarm notifier not found"); |
|
1970 _LIT(KRequestQMsg,"Agenda Alarm:Request Queued"); |
|
1971 _LIT(KMessage,"Agenda:Status Request"); |
|
1972 _LIT(KNotifNotReady,"Agenda Alarm notifier not ready"); |
|
1973 |
|
1974 TRequestStatus status=KRequestPending; |
|
1975 INFO_PRINTF2(_L("UpdateNotifierAndGetResponse for MyAgendaAlarmUid [%x]"),iMyAgendaAlarmUid.iUid); |
|
1976 iNotifier.UpdateNotifierAndGetResponse(status,iMyAgendaAlarmUid,KMessageAgenda,response); |
|
1977 TGulAlignment messageAlignment=EHLeftVTop; |
|
1978 eikEnv->InfoMsgWithAlignment(messageAlignment, KMessage); |
|
1979 |
|
1980 INFO_PRINTF1(_L("Update Low Battery Notifier")); |
|
1981 HandleCommandL(EAppUpdateLowBattery); |
|
1982 |
|
1983 User::WaitForRequest(status); |
|
1984 if(status.Int() == (TInt)EEikNotExtRequestQueued) |
|
1985 { |
|
1986 INFO_PRINTF1(_L(">>request queued")); |
|
1987 eikEnv->InfoMsgWithAlignment(messageAlignment, KRequestQMsg); |
|
1988 } |
|
1989 else if (status.Int() == (TInt) KErrNone) |
|
1990 { |
|
1991 INFO_PRINTF1(_L(">>request completed successfully")); |
|
1992 TBuf<256> buffer; |
|
1993 buffer.Copy(response); |
|
1994 INFO_PRINTF1(buffer); |
|
1995 eikEnv->InfoMsgWithAlignment(messageAlignment, buffer); |
|
1996 } |
|
1997 else if (status.Int() == (TInt) KErrNotFound) |
|
1998 { |
|
1999 INFO_PRINTF1(KNotifNotFound); |
|
2000 } |
|
2001 else if(status.Int() == (TInt)KErrNotReady) |
|
2002 { |
|
2003 INFO_PRINTF1(KNotifNotReady); |
|
2004 } |
|
2005 else |
|
2006 { |
|
2007 INFO_PRINTF2(_L("************ request completed with an error: %d"), status.Int()); |
|
2008 } |
|
2009 } |
|
2010 break; |
|
2011 case EAppStartEmailStatus: |
|
2012 { |
|
2013 if (iNotifier.Handle()==KNullHandle) |
|
2014 { |
|
2015 User::LeaveIfError(iNotifier.Connect()); |
|
2016 } |
|
2017 _LIT(KEmailMessage,"Email:Status Request"); |
|
2018 _LIT(KEmailRequestQMsg,"Email :Request Queued"); |
|
2019 _LIT(KEmailNotifExists,"Email Already Exists"); |
|
2020 _LIT(KEmailNotFound,"Email Notifier not found"); |
|
2021 |
|
2022 TRequestStatus status=KRequestPending; |
|
2023 |
|
2024 INFO_PRINTF2(_L("StartNotifierAndGetResponse for MyEmailNotifierUid [%x]"),iMyEmailNotifierUid.iUid ); |
|
2025 iNotifier.StartNotifierAndGetResponse(status,iMyEmailNotifierUid,KMessageEmail,response); |
|
2026 |
|
2027 INFO_PRINTF2(_L(">>call cancel low battery notifier MyLowBatteryNotifierUid[%x]"),iMyLowBatteryNotifierUid.iUid); |
|
2028 |
|
2029 //issue new call while request pending |
|
2030 TInt error = iNotifier.CancelNotifier(iMyLowBatteryNotifierUid); |
|
2031 TGulAlignment messageAlignment=EHLeftVTop; |
|
2032 eikEnv->InfoMsgWithAlignment(messageAlignment,KEmailMessage); |
|
2033 INFO_PRINTF3(_L(">>call cancel low battery notifier MyLowBatteryNotifierUid[%x]"),iMyLowBatteryNotifierUid.iUid,error); |
|
2034 |
|
2035 RWsSession ws; |
|
2036 TKeyEvent event; |
|
2037 |
|
2038 //Set up key event "enter" to simulate key enter to replace |
|
2039 //clicking "ok" on dialog. |
|
2040 event.iCode=event.iScanCode=EKeyEnter; |
|
2041 event.iModifiers=event.iRepeats=0; |
|
2042 |
|
2043 //Connect to Window Server Session |
|
2044 TEST(ws.Connect()==KErrNone); |
|
2045 |
|
2046 // Simulate key entry and flush the buffer to send event to windows server session. |
|
2047 ws.SimulateKeyEvent(event); |
|
2048 ws.Flush(); |
|
2049 INFO_PRINTF1(_L("Cancelled Email Status Notifier via dialog")); |
|
2050 ws.Close(); |
|
2051 |
|
2052 messageAlignment=EHRightVTop; |
|
2053 TInt statusValue=status.Int(); |
|
2054 if (statusValue == (TInt)EEikNotExtRequestQueued) |
|
2055 { |
|
2056 INFO_PRINTF1(_L(">>request queued")); |
|
2057 eikEnv->InfoMsgWithAlignment(messageAlignment,KEmailRequestQMsg); |
|
2058 } |
|
2059 else if (statusValue == (TInt)KErrAlreadyExists) |
|
2060 { |
|
2061 INFO_PRINTF1(_L(">>notifier exits")); |
|
2062 eikEnv->InfoMsgWithAlignment(messageAlignment,KEmailNotifExists); |
|
2063 } |
|
2064 else if(statusValue == (TInt)KErrNone) |
|
2065 { |
|
2066 INFO_PRINTF1(_L(">>request completed successfully")); |
|
2067 TBuf<256> buffer; |
|
2068 buffer.Copy(response); |
|
2069 INFO_PRINTF1(buffer); |
|
2070 eikEnv->InfoMsgWithAlignment(messageAlignment,buffer); |
|
2071 } |
|
2072 else if(statusValue == (TInt)KErrNotFound) |
|
2073 { |
|
2074 INFO_PRINTF1(KEmailNotFound); |
|
2075 } |
|
2076 else |
|
2077 { |
|
2078 INFO_PRINTF2(_L("************ request completed with an error: %d"),statusValue); |
|
2079 } |
|
2080 |
|
2081 } |
|
2082 |
|
2083 break; |
|
2084 case EAppUpdateEmailStatus: |
|
2085 { |
|
2086 _LIT(KNotifNotFound,"Email notifier not found"); |
|
2087 _LIT(KRequestQMsg,"Email:Request Queued"); |
|
2088 _LIT(KMessage,"Email:Status Request"); |
|
2089 |
|
2090 TRequestStatus status=KRequestPending; |
|
2091 INFO_PRINTF2(_L("UpdateNotifierAndGetResponse for MyEmailUid [%x]"),iMyEmailNotifierUid.iUid); |
|
2092 iNotifier.UpdateNotifierAndGetResponse(status,iMyEmailNotifierUid,KMessageEmail,response); |
|
2093 TGulAlignment messageAlignment=EHLeftVTop; |
|
2094 eikEnv->InfoMsgWithAlignment(messageAlignment, KMessage); |
|
2095 |
|
2096 INFO_PRINTF1(_L("Update Low Battery Notifier")); |
|
2097 HandleCommandL(EAppUpdateLowBattery); |
|
2098 |
|
2099 User::WaitForRequest(status); |
|
2100 if(status.Int() == (TInt)EEikNotExtRequestQueued) |
|
2101 { |
|
2102 INFO_PRINTF1(_L(">>request queued")); |
|
2103 eikEnv->InfoMsgWithAlignment(messageAlignment, KRequestQMsg); |
|
2104 } |
|
2105 else if (status.Int() == (TInt) KErrNone) |
|
2106 { |
|
2107 INFO_PRINTF1(_L(">>request completed successfully")); |
|
2108 TBuf<256> buffer; |
|
2109 buffer.Copy(response); |
|
2110 INFO_PRINTF1(buffer); |
|
2111 eikEnv->InfoMsgWithAlignment(messageAlignment, buffer); |
|
2112 } |
|
2113 else if (status.Int() == (TInt) KErrNotFound) |
|
2114 { |
|
2115 INFO_PRINTF1(KNotifNotFound); |
|
2116 } |
|
2117 else |
|
2118 { |
|
2119 INFO_PRINTF2(_L("************ request completed with an error: %d"), status.Int()); |
|
2120 } |
|
2121 } |
|
2122 break; |
|
2123 case EAppBatteryNotifiyOnTimer: |
|
2124 { |
|
2125 TTimeIntervalMicroSeconds32 delay(3000000); |
|
2126 TTimeIntervalMicroSeconds32 repeat(0); |
|
2127 if (!iBattTimer->IsActive()) |
|
2128 iBattTimer->Start(delay,repeat,(TCallBack(&KickOffBatteryNotifierL,this))); |
|
2129 } |
|
2130 break; |
|
2131 case EAppCheckErrorCode: |
|
2132 { |
|
2133 // Specific test for DEF022326 - RNotifier can start a notifier that doesn't exist |
|
2134 if (iNotifier.StartNotifier(KRubbishUid,KMessagePhone,response)==KErrNotFound) |
|
2135 { |
|
2136 INFO_PRINTF1(_L("Rubbish Notifer Not Found")); |
|
2137 } |
|
2138 } |
|
2139 break; |
|
2140 } |
|
2141 } |
|
2142 |
|
2143 /** |
|
2144 This is a callback method for CPeriodic Timer, iBattTimer. The method |
|
2145 invokes RNotifier::StartNotifier() to start Low Battery plug-in notifier. |
|
2146 */ |
|
2147 TInt CTNotdialAppUi::KickOffBatteryNotifierL(TAny* aSimpleAppUi) |
|
2148 { |
|
2149 CTNotdialAppUi* appUi=STATIC_CAST(CTNotdialAppUi*,aSimpleAppUi); |
|
2150 TBuf8<256> response; |
|
2151 response.SetMax(); |
|
2152 _LIT8(KMessageBattery, "Low Battery on Timer"); |
|
2153 if (appUi->iNotifier.Handle()==KNullHandle) |
|
2154 { |
|
2155 User::LeaveIfError(appUi->iNotifier.Connect()); |
|
2156 } |
|
2157 appUi->iNotifier.StartNotifier(appUi->iMyLowBatteryNotifierUid,KMessageBattery,response); |
|
2158 appUi->iBattTimer->Cancel(); |
|
2159 return 0; |
|
2160 } |
|
2161 |
|
2162 |
|
2163 /** |
|
2164 The method updates a plug-in notifier specified by UID aNotifierUid with |
|
2165 message aMessage by calling RNotifier::UpdateNotifier(). The method then |
|
2166 verifies the response aResponse and displays it. |
|
2167 */ |
|
2168 void CTNotdialAppUi::AppUpdate(TUid aNotifierUid, const TDesC8& aMessage, CEikonEnv* aEikEnv, TDes8& aResponse) |
|
2169 { |
|
2170 _LIT8(KPluginResponse, "Response:"); |
|
2171 _LIT(KNoPluginUpdate,"No Update from Plugin"); |
|
2172 |
|
2173 iNotifier.UpdateNotifier(aNotifierUid,aMessage,aResponse); |
|
2174 if (aResponse.Find(KPluginResponse)!=0) |
|
2175 { |
|
2176 aEikEnv->InfoMsgWithAlignment(EHRightVBottom, KNoPluginUpdate); |
|
2177 } |
|
2178 else |
|
2179 { |
|
2180 TBuf<256> buffer; |
|
2181 buffer.Copy(aResponse); |
|
2182 INFO_PRINTF1(buffer); |
|
2183 aEikEnv->InfoMsgWithAlignment(EHRightVBottom, buffer); |
|
2184 } |
|
2185 } |
|
2186 |
|
2187 /** |
|
2188 The method creates & sets the application's user interface object. |
|
2189 */ |
|
2190 void CTNotdialStep::ConstructAppL(CEikonEnv* aEikEnv) |
|
2191 { // runs inside a TRAP harness |
|
2192 INFO_PRINTF1(_L("CTNotdialStep::ConstructAppL")); |
|
2193 aEikEnv->ConstructL(); |
|
2194 CTNotdialAppUi* appUi=new(ELeave) CTNotdialAppUi(this); |
|
2195 INFO_PRINTF1(_L("SetAppUi")); |
|
2196 aEikEnv->SetAppUi(appUi); |
|
2197 appUi->ConstructL(); |
|
2198 } |
|
2199 |
|
2200 CTNotdialStep::CTNotdialStep() |
|
2201 { |
|
2202 // Call base class method to set up the human readable name for logging |
|
2203 SetTestStepName(KTNotdialStep); |
|
2204 } |
|
2205 |
|
2206 CTNotdialStep::~CTNotdialStep() |
|
2207 { |
|
2208 } |
|
2209 |
|
2210 TVerdict CTNotdialStep::doTestStepPreambleL() |
|
2211 { |
|
2212 SetTestStepResult(EPass); |
|
2213 return TestStepResult(); |
|
2214 } |
|
2215 |
|
2216 TVerdict CTNotdialStep::doTestStepPostambleL() |
|
2217 { |
|
2218 return TestStepResult(); |
|
2219 } |
|
2220 |
|
2221 TVerdict CTNotdialStep::doTestStepL() |
|
2222 { |
|
2223 PreallocateHALBuffer(); |
|
2224 |
|
2225 __UHEAP_MARK; |
|
2226 INFO_PRINTF1(_L("Start TNotdial test cases (TESTING V2 NOTIFIERS)....")); |
|
2227 CEikonEnv* eikEnv=new(ELeave) CEikonEnv; |
|
2228 TRAPD(err,ConstructAppL(eikEnv)); |
|
2229 if (!err) |
|
2230 { |
|
2231 eikEnv->ExecuteD(); |
|
2232 } |
|
2233 else |
|
2234 { |
|
2235 SetTestStepResult(EFail); |
|
2236 User::Leave(err); |
|
2237 } |
|
2238 |
|
2239 REComSession::FinalClose(); |
|
2240 __UHEAP_MARKEND; |
|
2241 |
|
2242 INFO_PRINTF1(_L("...TNotdial test completed!")); |
|
2243 return TestStepResult(); |
|
2244 } |