|
1 // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 /** |
|
17 @file |
|
18 @internalComponent - Internal Symbian test code |
|
19 */ |
|
20 |
|
21 |
|
22 #ifndef __ACTIVETESTSTEP_H__ |
|
23 #define __ACTIVETESTSTEP_H__ |
|
24 |
|
25 #include <test/testexecutestepbase.h> |
|
26 #include "appfwk_tmsteststep.h" |
|
27 |
|
28 // |
|
29 // |
|
30 // |
|
31 class CActiveTestStep; |
|
32 |
|
33 class CActiveTestStepLauncher : public CActive |
|
34 { |
|
35 public: |
|
36 CActiveTestStepLauncher(); |
|
37 ~CActiveTestStepLauncher(); |
|
38 |
|
39 void Launch(CActiveTestStep* aStep); |
|
40 TVerdict TestStepResult() const { return iVerdict; } |
|
41 void SetTestStepResult(TVerdict aVerdict) { iVerdict = aVerdict; } |
|
42 |
|
43 // from CActive |
|
44 void RunL(); |
|
45 void DoCancel(); |
|
46 private: |
|
47 CActiveTestStep* iStep; |
|
48 TVerdict iVerdict; |
|
49 }; |
|
50 |
|
51 class CActiveTestStepScheduler; |
|
52 |
|
53 class CActiveTestStep : public CTmsTestStep |
|
54 { |
|
55 public: |
|
56 CActiveTestStep(); |
|
57 ~CActiveTestStep(); |
|
58 |
|
59 void Stop(TInt aError = KErrNone); |
|
60 |
|
61 virtual TVerdict doActiveTestStepL() = 0; |
|
62 // From CTestStep: |
|
63 virtual TVerdict doTestStepPreambleL(); |
|
64 virtual TVerdict doTestStepL(); |
|
65 virtual TVerdict doTestStepPostambleL(); |
|
66 protected: |
|
67 CActiveScheduler * iScheduler; |
|
68 CActiveTestStepLauncher * iLauncher; |
|
69 }; |
|
70 |
|
71 class CActiveTestStepScheduler : public CActiveScheduler |
|
72 { |
|
73 public: |
|
74 void Error(TInt aError) const; |
|
75 void SetStep(CActiveTestStep* aStep) { iStep = aStep; } |
|
76 protected: |
|
77 CActiveTestStep* iStep; |
|
78 }; |
|
79 |
|
80 #endif //__ACTIVETESTSTEP_H__ |