|
1 // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 /** |
|
17 @file |
|
18 @test |
|
19 @internalComponent - Internal Symbian test code |
|
20 */ |
|
21 |
|
22 |
|
23 |
|
24 #ifndef __TESTANDSTOPPER_H__ |
|
25 #define __TESTANDSTOPPER_H__ |
|
26 |
|
27 #include <e32base.h> |
|
28 #include <e32def.h> |
|
29 |
|
30 #include <ssm/ssmstartsafe.h> |
|
31 #include "tss_step_base.h" |
|
32 |
|
33 class CTestAndStopper : public CActive |
|
34 { |
|
35 public: |
|
36 CTestAndStopper( CSsmStartSafe& aSsmStartSafe, |
|
37 const CSsmStartupProperties &aStartupProperties, |
|
38 RProcess& aProcess, |
|
39 TInt aTimeout, |
|
40 MSsTestAsyncNotifier* aSsTestAsyncNotifier = NULL ); |
|
41 |
|
42 ~CTestAndStopper(); |
|
43 |
|
44 protected: |
|
45 void RunL(); |
|
46 TInt RunError( TInt aError ); |
|
47 void DoCancel(); |
|
48 |
|
49 private: |
|
50 void DoStartsL(); |
|
51 |
|
52 private: |
|
53 RTimer iTimer; |
|
54 TBool iRunning; |
|
55 TBool iFinish; |
|
56 CSsmStartSafe& iSsmStartSafe; |
|
57 const CSsmStartupProperties& iStartupProperties; |
|
58 RProcess& iProcess; |
|
59 TInt iTimeout; |
|
60 MSsTestAsyncNotifier* iSsTestAsyncNotifier; // Not owning |
|
61 }; |
|
62 |
|
63 // for inducing error condition |
|
64 class CDuffTestAndStopper : public CActive |
|
65 { |
|
66 public: |
|
67 CDuffTestAndStopper( CSsmStartSafe& aSsmStartSafe, |
|
68 const CSsmStartupProperties &aStartupProperties, |
|
69 RProcess& aProcess, |
|
70 TInt aTimeout, |
|
71 MSsTestAsyncNotifier* aSsTestAsyncNotifier = NULL ); |
|
72 |
|
73 ~CDuffTestAndStopper(); |
|
74 |
|
75 protected: |
|
76 void RunL(); |
|
77 TInt RunError( TInt aError ); |
|
78 void DoCancel(); |
|
79 |
|
80 private: |
|
81 void DoStartsL(); |
|
82 |
|
83 private: |
|
84 RTimer iTimer; |
|
85 TBool iRunning; |
|
86 TBool iFinish; |
|
87 CSsmStartSafe& iSsmStartSafe; |
|
88 const CSsmStartupProperties& iStartupProperties; |
|
89 RProcess& iProcess; |
|
90 TInt iTimeout; |
|
91 MSsTestAsyncNotifier* iSsTestAsyncNotifier; // Not owning |
|
92 }; |
|
93 |
|
94 |
|
95 class CTestTwoAndStopper : public CActive |
|
96 { |
|
97 public: |
|
98 CTestTwoAndStopper( CSsmStartSafe& aSsmStartSafe, |
|
99 const CSsmStartupProperties &aStartupProperties, |
|
100 RProcess& aProcess_0, RProcess& aProcess_1, |
|
101 TInt aTimeout, |
|
102 MSsTestAsyncNotifier* aSsTestAsyncNotifier = NULL ); |
|
103 |
|
104 ~CTestTwoAndStopper(); |
|
105 |
|
106 protected: |
|
107 void RunL(); |
|
108 TInt RunError( TInt aError ); |
|
109 void DoCancel(); |
|
110 |
|
111 private: |
|
112 void DoStartsL(); |
|
113 |
|
114 private: |
|
115 RTimer iTimer; |
|
116 TBool iRunning; |
|
117 TBool iFinish; |
|
118 CSsmStartSafe& iSsmStartSafe; |
|
119 const CSsmStartupProperties& iStartupProperties; |
|
120 RProcess& iProcess_0; |
|
121 RProcess& iProcess_1; |
|
122 TInt iTimeout; |
|
123 MSsTestAsyncNotifier* iSsTestAsyncNotifier; // Not owning |
|
124 }; |
|
125 |
|
126 #endif // __TESTANDSTOPPER_H__ |