|
1 /* |
|
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: This file contains the header file of the CUIEngine. |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef STIF_TFW_IF_CONTAINER_H |
|
19 #define STIF_TFW_IF_CONTAINER_H |
|
20 |
|
21 // INCLUDES |
|
22 #include <e32std.h> |
|
23 #include <e32base.h> |
|
24 #include <StifTFwIf.h> |
|
25 |
|
26 #include <TestEngineClient.h> |
|
27 #include <stifinternal/UIEngine.h> |
|
28 |
|
29 // CONSTANTS |
|
30 // None |
|
31 _LIT( KUIStoreDefaultDir, "C:\\TestFramework\\" ); |
|
32 // MACROS |
|
33 // None |
|
34 |
|
35 // DATA TYPES |
|
36 // None |
|
37 |
|
38 // FUNCTION PROTOTYPES |
|
39 // None |
|
40 |
|
41 // FORWARD DECLARATIONS |
|
42 class CUIEngine; |
|
43 class CUIEngineRunner; |
|
44 class CUIEnginePrinter; |
|
45 class CUIEngineErrorPrinter; |
|
46 class CUIEngineRemote; |
|
47 |
|
48 // CLASS DECLARATION |
|
49 |
|
50 // DESCRIPTION |
|
51 |
|
52 // CUIEngineContainer is interface between main class CUIEngine |
|
53 // and CUIEngineRunner, which execute test cases |
|
54 class CUIEngineContainer |
|
55 : public CBase |
|
56 { |
|
57 public: // Enumerations |
|
58 // Case state |
|
59 enum TCaseState |
|
60 { |
|
61 ENotStarted, |
|
62 ERunning, |
|
63 EPaused, |
|
64 EExecuted, |
|
65 EFinished, |
|
66 }; |
|
67 |
|
68 private: // Enumerations |
|
69 // None |
|
70 |
|
71 public: // Constructor |
|
72 |
|
73 /** |
|
74 * NewL is two-phased constructor. |
|
75 */ |
|
76 static CUIEngineContainer* NewL( CUIEngine* aUIEngine, |
|
77 const TTestInfo& aTestInfo, |
|
78 RTestEngine& aTestEngine ); |
|
79 |
|
80 public: // New functions |
|
81 |
|
82 |
|
83 public: // Functions from base classes |
|
84 |
|
85 /** |
|
86 * StartContainerL starts test case execution. |
|
87 * |
|
88 * Returns Symbian OS error code. |
|
89 */ |
|
90 TInt StartContainerL(); |
|
91 |
|
92 /** |
|
93 * TestCaseExecuted informs that test case has executed. |
|
94 */ |
|
95 void TestCaseExecuted( TFullTestResult& aResult, TInt aStatus ); |
|
96 |
|
97 /** |
|
98 * PrintProgress forwards print information from test case. |
|
99 */ |
|
100 void PrintProgress( TTestProgress& aProgress ); |
|
101 |
|
102 /** |
|
103 * RemoteSend forwards remote protocol messages from master. |
|
104 */ |
|
105 void RemoteSend( const TDesC& aRemoteMsg, TInt aStatus ); |
|
106 |
|
107 /** |
|
108 * GoingToReboot forwards reboot indication. |
|
109 */ |
|
110 TInt GoingToReboot( TRequestStatus& aStatus ); |
|
111 |
|
112 /** |
|
113 * RemoteReceive forwards remote protocol messages to master. |
|
114 */ |
|
115 TInt RemoteReceive( const TDesC& aRemoteMsg ); |
|
116 |
|
117 /** |
|
118 * CancelTest cancels test case execution. TestCompleted() will be called |
|
119 * with aTestExecutionResult set to KErrCancel. |
|
120 * |
|
121 * Returns Symbian OS error code. |
|
122 */ |
|
123 IMPORT_C TInt CancelTest(); |
|
124 |
|
125 /** |
|
126 * PauseTest pauses test case execution. |
|
127 * |
|
128 * Returns Symbian OS error code. |
|
129 */ |
|
130 IMPORT_C TInt PauseTest(); |
|
131 |
|
132 /** |
|
133 * ResumeTest resumes test case execution. |
|
134 * |
|
135 * Returns Symbian OS error code. |
|
136 */ |
|
137 IMPORT_C TInt ResumeTest(); |
|
138 |
|
139 /** |
|
140 * Return remote identifier. |
|
141 */ |
|
142 TUint32 RemoteId() const { return iRemoteId; }; |
|
143 |
|
144 /** |
|
145 * Set remote identifier. |
|
146 */ |
|
147 void SetRemoteId( TUint32 aRemoteId ){ iRemoteId = aRemoteId; }; |
|
148 |
|
149 /** |
|
150 * Return master identifier. |
|
151 */ |
|
152 TUint32 MasterId() const { return iMasterId; }; |
|
153 |
|
154 /** |
|
155 * Return test case execution state. |
|
156 */ |
|
157 TCaseState State() const { return iState; }; |
|
158 |
|
159 /** |
|
160 * Printer signals all prints done event. |
|
161 */ |
|
162 void PrintsDone(); |
|
163 |
|
164 protected: // New functions |
|
165 // None |
|
166 |
|
167 protected: // Functions from base classes |
|
168 // None |
|
169 |
|
170 private: // Constructors and destructor |
|
171 |
|
172 /** |
|
173 * C++ default constructor. |
|
174 */ |
|
175 CUIEngineContainer( CUIEngine* aUIEngine, |
|
176 const TTestInfo& aTestInfo, |
|
177 RTestEngine& aTestEngine ); |
|
178 |
|
179 /** |
|
180 * By default Symbian OS constructor is private. |
|
181 */ |
|
182 void ConstructL(); |
|
183 |
|
184 /** |
|
185 * Destructor of CUIEngineContainer. |
|
186 */ |
|
187 ~CUIEngineContainer(); |
|
188 |
|
189 public: //Data |
|
190 // Pointer to UIEngine |
|
191 CUIEngine* iUIEngine; |
|
192 |
|
193 protected: // Data |
|
194 // None |
|
195 |
|
196 private: // Data |
|
197 |
|
198 // Handle to Test Engine |
|
199 RTestEngine iTestEngine; |
|
200 |
|
201 // Handle to Test Case |
|
202 RTestCase iTestCase; |
|
203 |
|
204 // Test case runner |
|
205 CUIEngineRunner* iRunner; |
|
206 |
|
207 // Test case printer |
|
208 CUIEnginePrinter* iPrinter; |
|
209 |
|
210 // Test case remote command handler |
|
211 CUIEngineRemote* iRemote; |
|
212 |
|
213 // Test info and package |
|
214 TTestInfo iTestInfo; |
|
215 TTestInfoPckg iTestInfoPckg; |
|
216 |
|
217 // Case state |
|
218 TCaseState iState; |
|
219 |
|
220 // Remote protocol identifier |
|
221 TUint32 iRemoteId; |
|
222 |
|
223 // Master protocol identifier |
|
224 TUint32 iMasterId; |
|
225 |
|
226 public: // Friend classes |
|
227 friend class CUIEngine; |
|
228 |
|
229 protected: // Friend classes |
|
230 |
|
231 private: // Friend classes |
|
232 |
|
233 }; |
|
234 |
|
235 |
|
236 #endif // STIF_TFW_IF_CONTAINER_H |
|
237 |
|
238 // End of File |