|
1 /* |
|
2 * Copyright (c) 2002 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: ?Description |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef PSMTEST_H |
|
21 #define PSMTEST_H |
|
22 |
|
23 // INCLUDES |
|
24 #include <StifLogger.h> |
|
25 #include <TestScripterInternal.h> |
|
26 #include <StifTestModule.h> |
|
27 #include <psmclientobserver.h> |
|
28 |
|
29 // CONSTANTS |
|
30 //const ?type ?constant_var = ?constant; |
|
31 |
|
32 // MACROS |
|
33 //#define ?macro ?macro_def |
|
34 // Logging path |
|
35 _LIT( KPSMTestLogPath, "\\logs\\testframework\\PSMTest\\" ); |
|
36 // Log file |
|
37 _LIT( KPSMTestLogFile, "PSMTest.txt" ); |
|
38 |
|
39 // FUNCTION PROTOTYPES |
|
40 //?type ?function_name(?arg_list); |
|
41 |
|
42 // FORWARD DECLARATIONS |
|
43 //class ?FORWARD_CLASSNAME; |
|
44 class CPSMTest; |
|
45 class CPsmClient; |
|
46 class CPsmNotifier; |
|
47 class CRepository; |
|
48 |
|
49 // DATA TYPES |
|
50 //enum ?declaration |
|
51 //typedef ?declaration |
|
52 //extern ?data_type; |
|
53 |
|
54 /** |
|
55 * Observer class for PSM change notifications |
|
56 |
|
57 NONSHARABLE_CLASS(CPSMTestObserver) : public CBase, |
|
58 public MPsmClientObserver |
|
59 { |
|
60 public: |
|
61 /** |
|
62 * Constructor. |
|
63 CPSMTestObserver(); |
|
64 |
|
65 /** |
|
66 * Destructor. |
|
67 /* virtual ~CPSMTestObserver(); |
|
68 |
|
69 public: |
|
70 // From MPsmChangeCompleteObserver |
|
71 virtual void PowerSaveModeChanged( const TPsmsrvMode aMode ); |
|
72 |
|
73 // From MPsmChangeCompleteObserver |
|
74 virtual void PowerSaveModeChangeError( const TInt aError ); |
|
75 |
|
76 public: // data |
|
77 |
|
78 TInt iNewMode; |
|
79 |
|
80 }; |
|
81 */ |
|
82 |
|
83 /** |
|
84 * Active object observer class for PSM change notifications |
|
85 */ |
|
86 /*NONSHARABLE_CLASS(CPSMTestActiveObject) : public CActive |
|
87 { |
|
88 public: |
|
89 /** |
|
90 * Constructor. |
|
91 CPSMTestActiveObject(); |
|
92 |
|
93 /** |
|
94 * Destructor. |
|
95 virtual ~CPSMTestActiveObject(); |
|
96 |
|
97 public: |
|
98 |
|
99 TRequestStatus& RequestStatus(); |
|
100 |
|
101 protected: |
|
102 |
|
103 public: // data |
|
104 |
|
105 TInt iNewMode; |
|
106 |
|
107 }; |
|
108 |
|
109 */ |
|
110 |
|
111 // CLASS DECLARATION |
|
112 |
|
113 /** |
|
114 * CSSYTest test class for STIF Test Framework TestScripter. |
|
115 * ?other_description_lines |
|
116 * |
|
117 * @lib ?library |
|
118 * @since ?Series60_version |
|
119 */ |
|
120 NONSHARABLE_CLASS(CPSMTest) : public CScriptBase, |
|
121 public MPsmClientObserver |
|
122 { |
|
123 public: // Constructors and destructor |
|
124 |
|
125 /** |
|
126 * Two-phased constructor. |
|
127 */ |
|
128 static CPSMTest* NewL( CTestModuleIf& aTestModuleIf ); |
|
129 |
|
130 /** |
|
131 * Destructor. |
|
132 */ |
|
133 virtual ~CPSMTest(); |
|
134 |
|
135 public: // New functions |
|
136 |
|
137 /** |
|
138 * ?member_description. |
|
139 * @since ?Series60_version |
|
140 * @param ?arg1 ?description |
|
141 * @return ?description |
|
142 */ |
|
143 //?type ?member_function( ?type ?arg1 ); |
|
144 |
|
145 public: // Functions from base classes |
|
146 |
|
147 /** |
|
148 * From CScriptBase Runs a script line. |
|
149 * @since ?Series60_version |
|
150 * @param aItem Script line containing method name and parameters |
|
151 * @return Symbian OS error code |
|
152 */ |
|
153 virtual TInt RunMethodL( CStifItemParser& aItem ); |
|
154 |
|
155 protected: // New functions |
|
156 |
|
157 /** |
|
158 * ?member_description. |
|
159 * @since ?Series60_version |
|
160 * @param ?arg1 ?description |
|
161 * @return ?description |
|
162 */ |
|
163 //?type ?member_function( ?type ?arg1 ); |
|
164 |
|
165 protected: // Functions from base classes |
|
166 |
|
167 /** |
|
168 * From ?base_class ?member_description |
|
169 */ |
|
170 //?type ?member_function(); |
|
171 |
|
172 private: |
|
173 |
|
174 /** |
|
175 * C++ default constructor. |
|
176 */ |
|
177 CPSMTest( CTestModuleIf& aTestModuleIf ); |
|
178 |
|
179 /** |
|
180 * By default Symbian 2nd phase constructor is private. |
|
181 */ |
|
182 void ConstructL(); |
|
183 |
|
184 // Prohibit copy constructor if not deriving from CBase. |
|
185 // ?classname( const ?classname& ); |
|
186 // Prohibit assigment operator if not deriving from CBase. |
|
187 // ?classname& operator=( const ?classname& ); |
|
188 |
|
189 /** |
|
190 * Frees all resources allocated from test methods. |
|
191 * @since ?Series60_version |
|
192 */ |
|
193 void Delete(); |
|
194 |
|
195 /** |
|
196 * Test methods are listed below. |
|
197 */ |
|
198 |
|
199 /** |
|
200 * Example test method. |
|
201 * @since ?Series60_version |
|
202 * @param aItem Script line containing parameters. |
|
203 * @return Symbian OS error code. |
|
204 */ |
|
205 virtual TInt InitializeTest( CStifItemParser& aItem ); |
|
206 |
|
207 virtual TInt FullPowerSaveModeChange( CStifItemParser& aItem ); |
|
208 |
|
209 virtual TInt NotifyPowerSaveModeChangeInit( CStifItemParser& aItem ); |
|
210 |
|
211 virtual TInt PsmWaitComplete( CStifItemParser& aItem ); |
|
212 |
|
213 virtual TInt NotifyPowerSaveModeChangeEnd( CStifItemParser& aItem ); |
|
214 |
|
215 virtual TInt CancelPowerSaveModeChange( CStifItemParser& aItem ); |
|
216 |
|
217 virtual TInt CheckPsmMode( CStifItemParser& aItem ); |
|
218 |
|
219 virtual TInt GetCurrentSettings( CStifItemParser& aItem ); |
|
220 |
|
221 virtual TInt BackupSettings( CStifItemParser& aItem ); |
|
222 |
|
223 virtual TInt PsmNotificationInit( CStifItemParser& aItem ); |
|
224 |
|
225 virtual TInt PsmNotificationCancel( CStifItemParser& aItem ); |
|
226 |
|
227 virtual TInt PsmNotificationEnd( CStifItemParser& aItem ); |
|
228 |
|
229 virtual TInt LoadAndUnload( CStifItemParser& aItem ); |
|
230 |
|
231 virtual TInt CenRepChange( CStifItemParser& aItem ); |
|
232 |
|
233 virtual TInt VerifyCenRepChangeL( CStifItemParser& aItem ); |
|
234 |
|
235 virtual TInt ChangeSettingsInit( CStifItemParser& aItem ); |
|
236 |
|
237 virtual TInt ChangeSettings( CStifItemParser& aItem ); |
|
238 |
|
239 virtual TInt ChangeSettingsEnd( CStifItemParser& aItem ); |
|
240 |
|
241 virtual TInt OpenClosePerformanceInit( CStifItemParser& aItem ); |
|
242 virtual TInt OpenClosePerformanceRequest( CStifItemParser& aItem ); |
|
243 virtual TInt OpenClosePerformanceCancel( CStifItemParser& aItem ); |
|
244 virtual TInt OpenClosePerformanceChange( CStifItemParser& aItem ); |
|
245 virtual TInt OpenClosePerformanceEnd( CStifItemParser& aItem ); |
|
246 |
|
247 virtual TInt ChangePsmPerformance( CStifItemParser& aItem ); |
|
248 |
|
249 virtual TInt ChangeSettingsPerformance( CStifItemParser& aItem ); |
|
250 |
|
251 // Fills config array with correct values to mode |
|
252 virtual void GenerateConfigArray( RConfigInfoArray& aPsmConfigArray, TInt aMode, TInt aIncrement ); |
|
253 |
|
254 // Compare two TPsmConfigInfos |
|
255 virtual TBool Compare( TPsmsrvConfigInfo aTarget, TPsmsrvConfigInfo aSource ); |
|
256 |
|
257 |
|
258 |
|
259 |
|
260 |
|
261 |
|
262 |
|
263 // From MPsmChangeCompleteObserver |
|
264 virtual void PowerSaveModeChanged( const TPsmsrvMode aMode ); |
|
265 |
|
266 // From MPsmChangeCompleteObserver |
|
267 virtual void PowerSaveModeChangeError( const TInt aError ); |
|
268 |
|
269 |
|
270 public: // Data |
|
271 // ?one_line_short_description_of_data |
|
272 //?data_declaration; |
|
273 |
|
274 protected: // Data |
|
275 // ?one_line_short_description_of_data |
|
276 //?data_declaration; |
|
277 |
|
278 CActiveSchedulerWait iSchedulerWait; |
|
279 |
|
280 CPsmClient* iPsmClient; |
|
281 |
|
282 //CPsmNotifier* iPsmNotifier; |
|
283 |
|
284 TInt iErrorCode; |
|
285 |
|
286 TInt iChangedMode; |
|
287 |
|
288 //CPSMTestObserver* iChangeObserver; |
|
289 |
|
290 TBool iPsmComplete; |
|
291 |
|
292 // For Settings API tests |
|
293 RConfigInfoArray iPsmConfigArray; |
|
294 |
|
295 // For performance tests |
|
296 //RArray<CPsmNotifier*> iNotifierArray; |
|
297 //RArray<CPSMTestObserver*> iObserverArray; |
|
298 |
|
299 // For noitifications |
|
300 CRepository* iRepository; |
|
301 |
|
302 private: // Data |
|
303 |
|
304 |
|
305 }; |
|
306 |
|
307 #endif // PSMTEST_H |
|
308 |
|
309 // End of File |