|
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 // The test step tests CCoeControl Apis. A test control is created and |
|
15 // Key and Pointer events are generated asynchronously using AutoTest Manager.\n |
|
16 // These events are then handled by the appropriate handlers of the test control.\n |
|
17 // |
|
18 // |
|
19 |
|
20 /** |
|
21 @file |
|
22 @internalComponent - Internal Symbian test code |
|
23 */ |
|
24 |
|
25 |
|
26 #include <coemain.h> |
|
27 #include <coecntrl.h> |
|
28 #include <coeaui.h> |
|
29 #include <e32keys.h> |
|
30 #include <basched.h> |
|
31 #include <ecom/ecom.h> |
|
32 |
|
33 #include "TCone1Step.h" |
|
34 |
|
35 |
|
36 //#include <e32test.h> |
|
37 //RTest test(_L("tcone1")); |
|
38 |
|
39 //#define FORCE_AUTO |
|
40 |
|
41 // |
|
42 // class CTestControl |
|
43 // |
|
44 |
|
45 /** |
|
46 Second phase constructor for Test control.\n |
|
47 Creates a control's window. |
|
48 The created window is the child of the application's window group.\n |
|
49 Creates a Font.\n |
|
50 Requests pointer drag events using EnableDragEvents.\n |
|
51 This function should be called if a control is required to |
|
52 receive pointer drag and move events.\n |
|
53 */ |
|
54 void CTestControl::ConstructL() |
|
55 { |
|
56 CreateWindowL(); |
|
57 CreateFontL(); |
|
58 EnableDragEvents(); |
|
59 SetExtent(TPoint(20,20),TSize(600,200)); |
|
60 ActivateL(); |
|
61 } |
|
62 |
|
63 /** Creates a font used by the test control.\n */ |
|
64 |
|
65 void CTestControl::CreateFontL() |
|
66 { |
|
67 TFontSpec spec(_L("Arial"),240); |
|
68 iFont=iCoeEnv->CreateScreenFontL(spec); |
|
69 } |
|
70 /** |
|
71 Destructor for the CTestControl class.\n |
|
72 Calls the ReleaseScreenFont API of CCoeEnv to free all resources used by the font.\n |
|
73 |
|
74 */ |
|
75 CTestControl::~CTestControl() |
|
76 { |
|
77 iCoeEnv->ReleaseScreenFont(iFont); |
|
78 } |
|
79 /** |
|
80 Responds to focus changed.\n |
|
81 This function is called whenever a control gains or loses focus |
|
82 as a result of a call to SetFocus().\n |
|
83 A typical use of FocusChanged() is to change the appearance of the control |
|
84 to indicate whether or not it has focus, |
|
85 for example by drawing a focus rectangle around it.\n |
|
86 |
|
87 */ |
|
88 void CTestControl::FocusChanged(TDrawNow aDrawNow) |
|
89 { |
|
90 if (aDrawNow) |
|
91 { |
|
92 ActivateGc(); |
|
93 DrawBorder(); |
|
94 DeactivateGc(); |
|
95 } |
|
96 } |
|
97 /** |
|
98 Draws the border for the control window.\n |
|
99 */ |
|
100 void CTestControl::DrawBorder() const |
|
101 { |
|
102 CWindowGc& gc=SystemGc(); |
|
103 TRect rect=Rect(); |
|
104 gc.DrawRect(rect); |
|
105 if (!IsFocused()) |
|
106 gc.SetPenColor(KRgbWhite); |
|
107 rect.Shrink(1,1); |
|
108 gc.DrawRect(rect); |
|
109 rect.Shrink(1,1); |
|
110 gc.DrawRect(rect); |
|
111 } |
|
112 /** |
|
113 Draw function for the Test Control.\n |
|
114 The method draws the border using DrawBorder function.\n |
|
115 Later draws the message using DrawMessage function.\n |
|
116 */ |
|
117 void CTestControl::Draw(const TRect& /*aRect*/) const |
|
118 { |
|
119 DrawBorder(); |
|
120 DrawMessage(); |
|
121 } |
|
122 /** |
|
123 Draw function to draw a message specific to a key event.\n |
|
124 Gets a pointer to the Windows Graphic context which enables drawing.\n |
|
125 Sets the pen color, brush style and font for drawing message.\n |
|
126 Uses CWindowGc::DrawText API to draw the message.\n |
|
127 */ |
|
128 void CTestControl::DrawMessage() const |
|
129 { |
|
130 TRect rect=Rect(); |
|
131 rect.Shrink(3,3); |
|
132 CWindowGc& gc=SystemGc(); |
|
133 gc.UseFont(iFont); |
|
134 TInt ascent=(rect.iBr.iY-rect.iTl.iY-iFont->HeightInPixels())/2 + iFont->AscentInPixels(); |
|
135 gc.SetPenColor(KRgbBlack); |
|
136 gc.SetBrushStyle(CGraphicsContext::ESolidBrush); |
|
137 gc.DrawText(iMessage,rect,ascent,CGraphicsContext::ECenter); |
|
138 } |
|
139 /** |
|
140 This function draws the message on the window after handling a key event or a pointer event |
|
141 The method is called by the HandlerPointerEventL and OfferKeyEventL functions.\n |
|
142 Activates the Graphic context.\n |
|
143 Then invokes the DrawMessage function to draw the message.\n |
|
144 De activates the Graphic context.\n |
|
145 */ |
|
146 void CTestControl::DrawMessageNow() const |
|
147 { |
|
148 ActivateGc(); |
|
149 DrawMessage(); |
|
150 DeactivateGc(); |
|
151 } |
|
152 /** |
|
153 Auxilliary Function for Pointer based events.\n |
|
154 The method is an override from CCoeControl.\n |
|
155 The function handles the following pointer events.\n |
|
156 Double click Event.\n |
|
157 */ |
|
158 void CTestControl::HandlePointerEventL(const TPointerEvent& aPointerEvent) |
|
159 { |
|
160 TInt modifiers=aPointerEvent.iModifiers; |
|
161 if (modifiers&EModifierDoubleClick) |
|
162 iMessage.Format(_L("Double click event at (%d,%d)"),aPointerEvent.iPosition.iX,aPointerEvent.iPosition.iY); |
|
163 else |
|
164 iMessage.Format(_L("Pointer event %d at (%d,%d)"),aPointerEvent.iType,aPointerEvent.iPosition.iX,aPointerEvent.iPosition.iY); |
|
165 DrawMessageNow(); |
|
166 } |
|
167 |
|
168 /** |
|
169 Auxiliary Function for all key event based test cases.\n |
|
170 |
|
171 The method is an override from CCoeControl.\n |
|
172 The function is called to handle the key events. It handles the following key events.\n |
|
173 1. (Ctrl or Shift)+ KeyLeft Arrow Key Event.\n |
|
174 2. (Ctrl or Shift)+KeyRight Arrow Key Event.\n |
|
175 3. (Ctrl or Shift)+ KeyDown Arrow Key Event.\n |
|
176 4. (Ctrl or Shift)+ KeyUp Arrow Key Event.\n |
|
177 |
|
178 */ |
|
179 |
|
180 TKeyResponse CTestControl::OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType) |
|
181 { |
|
182 if (aType!=EEventKey) |
|
183 return(EKeyWasConsumed); |
|
184 TInt modifiers=aKeyEvent.iModifiers; |
|
185 TInt code=aKeyEvent.iCode; |
|
186 iMessage.Format(_L("Key 0x%x, modifier 0x%x"),code,modifiers); |
|
187 DrawMessageNow(); |
|
188 if (code==CTRL('e')) |
|
189 { |
|
190 iCoeEnv->Flush(200000); |
|
191 CBaActiveScheduler::Exit(); |
|
192 } |
|
193 if (((modifiers&EAllStdModifiers)==(EModifierCtrl))|((modifiers&EAllStdModifiers)==(EModifierShift))) |
|
194 { |
|
195 TPoint pos=Position(); |
|
196 switch (code) |
|
197 { |
|
198 case EKeyLeftArrow: |
|
199 pos.iX--; |
|
200 break; |
|
201 case EKeyRightArrow: |
|
202 pos.iX++; |
|
203 break; |
|
204 case EKeyUpArrow: |
|
205 pos.iY--; |
|
206 break; |
|
207 case EKeyDownArrow: |
|
208 pos.iY++; |
|
209 break; |
|
210 default: |
|
211 break; |
|
212 } |
|
213 if (pos != Position()) |
|
214 { |
|
215 SetPosition(pos); |
|
216 } |
|
217 } |
|
218 return(EKeyWasConsumed); |
|
219 } |
|
220 |
|
221 |
|
222 |
|
223 /** |
|
224 Constructor for the CCone1Test AppUi class.\n |
|
225 Calls the base class CTestCoeAppUi constructor.\n |
|
226 */ |
|
227 |
|
228 CCone1TestAppUi::CCone1TestAppUi(CTmsTestStep* aStep) : |
|
229 CTestCoeAppUi(aStep) |
|
230 {} |
|
231 |
|
232 /** |
|
233 Second phase constructor for CCone1Test AppUi class.\n |
|
234 Calls the second phase constructor of base class CTestCoeAppUi.\n |
|
235 Creates a Test control which handles the received key events.\n |
|
236 Adds the control to the control stack so that it can receive key events.\n |
|
237 Executes the testcases asynchronously using Autotest Manager.\n |
|
238 */ |
|
239 |
|
240 void CCone1TestAppUi::ConstructL() |
|
241 { |
|
242 CTestCoeAppUi::ConstructL(); |
|
243 |
|
244 iControl=new(ELeave) CTestControl; |
|
245 iControl->ConstructL(); |
|
246 AddToStackL(iControl); |
|
247 |
|
248 AutoTestManager().StartAutoTest(); |
|
249 } |
|
250 /** |
|
251 Destructor for CCone1TestAppUi class.\n |
|
252 Removes the Test control from the control stack.\n |
|
253 Deletes the test control.\n |
|
254 */ |
|
255 CCone1TestAppUi::~CCone1TestAppUi() |
|
256 { |
|
257 RemoveFromStack(iControl); |
|
258 delete iControl; |
|
259 } |
|
260 |
|
261 |
|
262 |
|
263 /** |
|
264 @SYMTestCaseID UIF-TCone1Step-TestKeyDownL |
|
265 |
|
266 @SYMPREQ |
|
267 |
|
268 @SYMTestPriority High |
|
269 |
|
270 @SYMTestStatus Implemented |
|
271 |
|
272 @SYMTestActions The method calls CTestControl::OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType) |
|
273 to simulate a key down event.\n |
|
274 |
|
275 @SYMTestExpectedResults. This test is manually verified, the system will display this string on the screen: |
|
276 "Key 0x11, modifier 0xcccccccc".\n |
|
277 |
|
278 @SYMTestType : CIT |
|
279 |
|
280 */ |
|
281 |
|
282 void CCone1TestAppUi::TestKeyDownL() |
|
283 { |
|
284 TKeyEvent theKeyEvent; |
|
285 theKeyEvent.iCode = CTRL('q'); |
|
286 INFO_PRINTF1(_L("Emulation the event KeyDown")); |
|
287 iControl->OfferKeyEventL(theKeyEvent,EEventKey); |
|
288 } |
|
289 |
|
290 |
|
291 /** |
|
292 @SYMTestCaseID UIF-TCone1Step-TestButtonDownL |
|
293 |
|
294 @SYMPREQ |
|
295 |
|
296 @SYMTestPriority High |
|
297 |
|
298 @SYMTestStatus Implemented |
|
299 |
|
300 @SYMTestActions The method calls CTestControl::HandlePointerEventL(const TPointerEvent& aPointerEvent) |
|
301 to simulate a Button 1 or pen down event.\n |
|
302 |
|
303 @SYMTestExpectedResults. This test is manually verified, the system will display this string on the screen: |
|
304 "Pointer event 0 at (10,20)".\n |
|
305 |
|
306 @SYMTestType : CIT |
|
307 |
|
308 */ |
|
309 |
|
310 void CCone1TestAppUi::TestButtonDownL() |
|
311 { |
|
312 TPointerEvent thePointerEvent; |
|
313 |
|
314 thePointerEvent.iType=TPointerEvent::EButton1Down; |
|
315 thePointerEvent.iModifiers = 0; |
|
316 thePointerEvent.iPosition.iX = 10; |
|
317 thePointerEvent.iPosition.iY = 20; |
|
318 INFO_PRINTF1(_L("Emulation the point event")); |
|
319 iControl->HandlePointerEventL(thePointerEvent); |
|
320 } |
|
321 |
|
322 |
|
323 /** |
|
324 @SYMTestCaseID UIF-TCone1Step-TestDoubleClickL |
|
325 |
|
326 @SYMPREQ |
|
327 |
|
328 @SYMTestPriority High |
|
329 |
|
330 @SYMTestStatus Implemented |
|
331 |
|
332 @SYMTestActions The method calls CTestControl::HandlePointerEventL(const TPointerEvent& aPointerEvent) |
|
333 to simulate a double click event.\n |
|
334 |
|
335 @SYMTestExpectedResults. This test is manually verified, the system will display this string on the screen: |
|
336 "Double click event at (30,40)".\n |
|
337 |
|
338 @SYMTestType : CIT |
|
339 |
|
340 */ |
|
341 |
|
342 void CCone1TestAppUi::TestDoubleClickL() |
|
343 { |
|
344 TPointerEvent thePointerEvent; |
|
345 thePointerEvent.iModifiers = EModifierDoubleClick; |
|
346 thePointerEvent.iPosition.iX = 30; |
|
347 thePointerEvent.iPosition.iY = 40; |
|
348 INFO_PRINTF1(_L("Emulation the double click point event")); |
|
349 iControl->HandlePointerEventL(thePointerEvent); |
|
350 } |
|
351 |
|
352 |
|
353 /** |
|
354 @SYMTestCaseID UIF-TCone1Step-TestCtrlKeyDownKeyRightArrowL |
|
355 |
|
356 @SYMPREQ |
|
357 |
|
358 @SYMTestPriority High |
|
359 |
|
360 @SYMTestStatus Implemented |
|
361 |
|
362 @SYMTestActions The method calls CTestControl::HandlePointerEventL(const TPointerEvent& aPointerEvent) |
|
363 to simulate prossing the control and right arrow keys together.\n |
|
364 |
|
365 @SYMTestExpectedResults. This test is manually verified, the system will display this string on the screen: |
|
366 "Key 0xf808, modifier 0x80".\n |
|
367 The position of the control on the screen is also moved one unit to the right.\n |
|
368 |
|
369 @SYMTestType : CIT |
|
370 |
|
371 */ |
|
372 |
|
373 void CCone1TestAppUi::TestCtrlKeyDownKeyRightArrowL() |
|
374 { |
|
375 TKeyEvent theKeyEvent; |
|
376 theKeyEvent.iModifiers=EModifierCtrl; |
|
377 theKeyEvent.iCode = EKeyRightArrow; |
|
378 INFO_PRINTF1(_L("Emulation the event KeyDown with code EKeyRightArrow")); |
|
379 iControl->OfferKeyEventL(theKeyEvent,EEventKey); |
|
380 } |
|
381 |
|
382 |
|
383 /** |
|
384 @SYMTestCaseID UIF-TCone1Step-TestCtrlKeyDownKeyLeftArrowL |
|
385 |
|
386 @SYMPREQ |
|
387 |
|
388 @SYMTestPriority High |
|
389 |
|
390 @SYMTestStatus Implemented |
|
391 |
|
392 @SYMTestActions The method calls CTestControl::HandlePointerEventL(const TPointerEvent& aPointerEvent) |
|
393 to simulate prossing the control and left arrow keys together.\n |
|
394 |
|
395 @SYMTestExpectedResults. This test is manually verified, the system will display this string on the screen: |
|
396 "Key 0xf807, modifier 0x80".\n |
|
397 The position of the control on the screen is also moved one unit to the left.\n |
|
398 |
|
399 @SYMTestType : CIT |
|
400 |
|
401 */ |
|
402 |
|
403 void CCone1TestAppUi::TestCtrlKeyDownKeyLeftArrowL() |
|
404 { |
|
405 TKeyEvent theKeyEvent; |
|
406 theKeyEvent.iModifiers=EModifierCtrl; |
|
407 theKeyEvent.iCode = EKeyLeftArrow; |
|
408 INFO_PRINTF1(_L("Emulation the event KeyDown with code EKeyLeftArrow")); |
|
409 iControl->OfferKeyEventL(theKeyEvent,EEventKey); |
|
410 } |
|
411 |
|
412 |
|
413 /** |
|
414 @SYMTestCaseID UIF-TCone1Step-TestCtrlKeyDownKeyDownArrowL |
|
415 |
|
416 @SYMPREQ |
|
417 |
|
418 @SYMTestPriority High |
|
419 |
|
420 @SYMTestStatus Implemented |
|
421 |
|
422 @SYMTestActions The method calls CTestControl::HandlePointerEventL(const TPointerEvent& aPointerEvent) |
|
423 to simulate prossing the control and left arrow keys together.\n |
|
424 |
|
425 @SYMTestExpectedResults. This test is manually verified, the system will display this string on the screen: |
|
426 "Key 0xf80a, modifier 0x80".\n |
|
427 The position of the control on the screen is also moved one unit down.\n |
|
428 |
|
429 @SYMTestType : CIT |
|
430 |
|
431 */ |
|
432 |
|
433 void CCone1TestAppUi::TestCtrlKeyDownKeyDownArrowL() |
|
434 { |
|
435 TKeyEvent theKeyEvent; |
|
436 theKeyEvent.iModifiers=EModifierCtrl; |
|
437 theKeyEvent.iCode = EKeyDownArrow; |
|
438 INFO_PRINTF1(_L("Emulation the event KeyDown with code EKeyDownArrow")); |
|
439 iControl->OfferKeyEventL(theKeyEvent,EEventKey); |
|
440 } |
|
441 |
|
442 |
|
443 |
|
444 /** |
|
445 @SYMTestCaseID UIF-TCone1Step-TestCtrlKeyDownKeyUpArrowL |
|
446 |
|
447 @SYMPREQ |
|
448 |
|
449 @SYMTestPriority High |
|
450 |
|
451 @SYMTestStatus Implemented |
|
452 |
|
453 @SYMTestActions The method calls CTestControl::HandlePointerEventL(const TPointerEvent& aPointerEvent) |
|
454 to simulate prossing the control and left arrow keys together.\n |
|
455 |
|
456 @SYMTestExpectedResults. This test is manually verified, the system will display this string on the screen: |
|
457 "Key 0xf809, modifier 0x80".\n |
|
458 The poition of the control on the screen is also moved one unit up.\n |
|
459 |
|
460 @SYMTestType : CIT |
|
461 |
|
462 */ |
|
463 |
|
464 void CCone1TestAppUi::TestCtrlKeyDownKeyUpArrowL() |
|
465 { |
|
466 TKeyEvent theKeyEvent; |
|
467 theKeyEvent.iModifiers=EModifierCtrl; |
|
468 theKeyEvent.iCode = EKeyUpArrow; |
|
469 INFO_PRINTF1(_L("Emulation the event KeyDown with code EKeyUpArrow")); |
|
470 iControl->OfferKeyEventL(theKeyEvent,EEventKey); |
|
471 } |
|
472 |
|
473 /** |
|
474 Auxiliary Function for all Test Cases.\n |
|
475 |
|
476 The method is an override from CTestCoeAppUi.\n |
|
477 This function is called asynchronously by RunL function of the |
|
478 AutotestManager after previous test case is executed.\n |
|
479 Generates the following key events iteratively.\n |
|
480 Key Down Event.\n |
|
481 Button Down Pointer Event.\n |
|
482 Double Click Event.\n |
|
483 Key Down event for LeftArrow Key.\n |
|
484 Key Down event for RightArrow Key.\n |
|
485 Key Down event for Up Arrow Key.\n |
|
486 Key Down event for Down Arrow Key.\n |
|
487 */ |
|
488 |
|
489 void CCone1TestAppUi::RunTestStepL(TInt aStepNum) |
|
490 { |
|
491 |
|
492 User::After(TTimeIntervalMicroSeconds32(1000000)); |
|
493 |
|
494 switch(aStepNum) |
|
495 { |
|
496 case 1: |
|
497 SetTestStepID(_L("UIF-TCone1Step-TestKeyDownL")); |
|
498 TestKeyDownL(); |
|
499 RecordTestResultL(); |
|
500 break; |
|
501 |
|
502 case 2: |
|
503 SetTestStepID(_L("UIF-TCone1Step-TestButtonDownL")); |
|
504 TestButtonDownL(); |
|
505 RecordTestResultL(); |
|
506 break; |
|
507 case 3: |
|
508 SetTestStepID(_L("UIF-TCone1Step-TestDoubleClickL")); |
|
509 TestDoubleClickL(); |
|
510 RecordTestResultL(); |
|
511 break; |
|
512 case 4: |
|
513 SetTestStepID(_L("UIF-TCone1Step-TestCtrlKeyDownKeyRightArrowL")); |
|
514 // follow on... |
|
515 case 5: case 6: case 7: case 8: |
|
516 TestCtrlKeyDownKeyRightArrowL(); |
|
517 if( aStepNum == 8 ) |
|
518 { |
|
519 RecordTestResultL(); |
|
520 } |
|
521 break; |
|
522 |
|
523 case 9: |
|
524 SetTestStepID(_L("UIF-TCone1Step-TestCtrlKeyDownKeyLeftArrowL")); |
|
525 // follow on... |
|
526 case 10: case 11: case 12: case 13: |
|
527 TestCtrlKeyDownKeyLeftArrowL(); |
|
528 if( aStepNum == 13 ) |
|
529 { |
|
530 RecordTestResultL(); |
|
531 } |
|
532 break; |
|
533 |
|
534 case 14: |
|
535 SetTestStepID(_L("UIF-TCone1Step-TestCtrlKeyDownKeyDownArrowL")); |
|
536 // follow on... |
|
537 case 15: case 16: case 17: case 18: |
|
538 TestCtrlKeyDownKeyDownArrowL(); |
|
539 if( aStepNum == 18 ) |
|
540 { |
|
541 RecordTestResultL(); |
|
542 } |
|
543 break; |
|
544 |
|
545 case 19: |
|
546 SetTestStepID(_L("UIF-TCone1Step-TestCtrlKeyDownKeyUpArrowL")); |
|
547 // follow on... |
|
548 case 20: case 21: case 22: case 23: |
|
549 TestCtrlKeyDownKeyUpArrowL(); |
|
550 if( aStepNum == 23 ) |
|
551 { |
|
552 RecordTestResultL(); |
|
553 CloseTMSGraphicsStep(); |
|
554 } |
|
555 break; |
|
556 |
|
557 case 24: |
|
558 AutoTestManager().FinishAllTestCases(CAutoTestManager::EPass); |
|
559 break; |
|
560 |
|
561 } |
|
562 } |
|
563 |
|
564 |
|
565 /** |
|
566 Completes the construction of the Control Environment(CCoeEnv object).\n |
|
567 Instantiates the CCone1TestAppUi class which serves as a AppUi class.\n |
|
568 Sets the CCone1TestAppUi object as the application's user interface object.\n |
|
569 Sets the system wide double click settings.\n |
|
570 Invokes the second phase constructor of the application's UI.\n |
|
571 */ |
|
572 void CTCone1Step::ConstructCone1AppL(CCoeEnv* aCoe) |
|
573 { // runs inside a TRAP harness |
|
574 aCoe->ConstructL(); |
|
575 CCone1TestAppUi* appUi=new(ELeave) CCone1TestAppUi(this); |
|
576 aCoe->SetAppUi(appUi); |
|
577 aCoe->WsSession().SetDoubleClick(1000000,4); |
|
578 appUi->ConstructL(); |
|
579 } |
|
580 |
|
581 /** |
|
582 Constructor for CTCone1Step class.\n |
|
583 Sets the test step name as KTCone1Step.\n |
|
584 */ |
|
585 CTCone1Step::CTCone1Step() |
|
586 { |
|
587 SetTestStepName(KTCone1Step); |
|
588 } |
|
589 /** |
|
590 Destructor for Cone1Step class.\n |
|
591 */ |
|
592 CTCone1Step::~CTCone1Step() |
|
593 {} |
|
594 /** |
|
595 Entry function for CTCone1 Test Step.\n |
|
596 Sets up the control environment.\n |
|
597 Constructs and Launches the CTCone1 Test application.\n |
|
598 |
|
599 */ |
|
600 TVerdict CTCone1Step::doTestStepL() // main function called by E32 |
|
601 { |
|
602 INFO_PRINTF1(_L("Test Started")); |
|
603 |
|
604 PreallocateHALBuffer(); |
|
605 |
|
606 __UHEAP_MARK; |
|
607 |
|
608 CCoeEnv* coe=new(ELeave) CCoeEnv; |
|
609 TRAPD(err,ConstructCone1AppL(coe)); |
|
610 |
|
611 if (!err) |
|
612 coe->ExecuteD(); |
|
613 else |
|
614 { |
|
615 SetTestStepResult(EFail); |
|
616 delete coe; |
|
617 } |
|
618 REComSession::FinalClose(); |
|
619 |
|
620 __UHEAP_MARKEND; |
|
621 |
|
622 INFO_PRINTF1(_L("Test Finished")); |
|
623 return TestStepResult(); |
|
624 } |
|
625 |
|
626 |
|
627 |